Skip to content

Commit

Permalink
feat(internal): convert to the Addon@v2 format
Browse files Browse the repository at this point in the history
This addon is now a native npm package, and means consuming apps
will have less work to do when compiling this addon (because it's
already compiled)
  • Loading branch information
NullVoxPopuli committed Dec 12, 2021
1 parent bb95c4b commit 54fca76
Show file tree
Hide file tree
Showing 81 changed files with 3,863 additions and 2,224 deletions.
6 changes: 6 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@
// changing peerDependencies *at all* is a breaking change
"matchDepTypes": ["peerDependencies"],
"enabled": false
},
{
// changing engines forces other people to need to upgrade their minimum node
// therefor engine changes are breaking changes
"depTypeList": ["engines"],
"enabled": false
}
]
}
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:

env:
CI: true
CACHE_PATH: '**/node_modules'
LIBRARY_DIR: './ember-statechart-component'
TEST_DIR: './testing/ember-app'

jobs:
tests:
Expand All @@ -33,6 +36,7 @@ jobs:

- name: Test with ${{ matrix.node }}
run: node_modules/.bin/ember test
working-directory: ${{ env.TEST_DIR }}

# floating-dependencies:
# if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
Expand Down Expand Up @@ -82,7 +86,8 @@ jobs:
- name: install dependencies
run: yarn install
- name: test
run: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup
run: yarn ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup
working-directory: ${{ env.TEST_DIR }}

# ember-cli-update:
# if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && ( ! contains(toJSON(github.event.commits.*.message), '[skip ci]') )
Expand Down Expand Up @@ -115,6 +120,7 @@ jobs:

- name: Release
run: node_modules/.bin/semantic-release
working-directory: ${{ env.LIBRARY_DIR }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66 changes: 51 additions & 15 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,89 @@
name: Lint

# based on:
# - https://github.com/NullVoxPopuli/eslint-plugin-decorator-position/blob/master/.github/workflows/lint.yml
# - https://github.com/NullVoxPopuli/ember-autostash-modifier/blob/master/.github/workflows/ci.yml
# - https://github.com/emberjs/ember-test-helpers/blob/master/.github/workflows/ci-build.yml
on:
pull_request:
push:
# filtering branches here prevents duplicate builds from pull_request and push
branches:
- main
- master

env:
CI: true
CACHE_PATH: '**/node_modules'
LIBRARY_DIR: './ember-statechart-component'
TEST_DIR: './testing/ember-app'

jobs:
install_dependencies:
name: Install Dependencies
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- uses: actions/cache@v2.1.7
with:
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: "${{ runner.os }}-modules-"
- run: yarn install

source:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
name: Source
runs-on: ubuntu-latest
needs: [install_dependencies]

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1

- uses: actions/cache@v2.1.7
with:
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install

- name: ESLint
run: yarn lint:js
run: |
cd ${{ env.LIBRARY_DIR }}
yarn lint:js
test_app:
name: Test App
runs-on: ubuntu-latest
needs: [install_dependencies]

- name: Templates
run: yarn lint:hbs
steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- uses: actions/cache@v2.1.7
with:
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install
- name: ESLint
run: |
cd ${{ env.TEST_DIR }}
yarn lint:js
tooling:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
name: Tooling
runs-on: ubuntu-latest
needs: [install_dependencies]

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- uses: actions/cache@v2.1.7
with:
node-version: "14" # min-supported
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- run: yarn install

- name: Semantic Release
run: yarn semantic-release --dry-run
run: |
cd ${{ env.LIBRARY_DIR }}
yarn semantic-release --dry-run
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -77,7 +114,6 @@ jobs:
# - run: yarn lint:docs-js

commits:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
name: Commit Messages
runs-on: ubuntu-latest

Expand Down
51 changes: 37 additions & 14 deletions .github/workflows/types.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,54 @@
name: Types

# based on:
# - https://github.com/NullVoxPopuli/eslint-plugin-decorator-position/blob/master/.github/workflows/lint.yml
# - https://github.com/NullVoxPopuli/ember-autostash-modifier/blob/master/.github/workflows/ci.yml
# - https://github.com/emberjs/ember-test-helpers/blob/master/.github/workflows/ci-build.yml
name: "Types"
on:
pull_request:
push:
# filtering branches here prevents duplicate builds from pull_request and push
branches:
- main
- master

env:
CI: true
CACHE_PATH: '**/node_modules'
LIBRARY_DIR: './ember-statechart-component'
TEST_DIR: './testing/ember-app'

jobs:
types:
install_dependencies:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
name: Type Checking
name: Install Dependencies
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- uses: actions/cache@v2
with:
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: "${{ runner.os }}-modules-"
- run: yarn install

- run: yarn install
types:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
name: "Type Correctness"
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [install_dependencies]

- name: Type Checking
run: yarn prepack
# run: npm run prepack
steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- uses: actions/cache@v2
with:
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install
- run: |
cd ${{ env.LIBRARY_DIR }}
yarn build:types
# - run: npm run prepack
# - run: yarn tsc --build
# - run: npm run prepack
# - run: npm exec tsc --build
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
# compiled output
/dist/
/tmp/
declarations/
.eslintcache

# dependencies
/bower_components/
/node_modules/
node_modules/

# misc
/.env*
Expand Down
35 changes: 0 additions & 35 deletions .npmignore

This file was deleted.

2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* `ember test --server` – Runs the test suite in "watch mode"
* `ember try:each` – Runs the test suite against multiple Ember versions

## Running the dummy application
## Running the test application

* `ember serve`
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).
* Visit the test application at [http://localhost:4200](http://localhost:4200).

For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
4 changes: 0 additions & 4 deletions app/instance-initializers/ember-statechart-component-setup.js

This file was deleted.

5 changes: 0 additions & 5 deletions config/environment.js

This file was deleted.

19 changes: 19 additions & 0 deletions ember-statechart-component/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false

[*.{diff,md}]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions ember-statechart-component/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
File renamed without changes.
2 changes: 2 additions & 0 deletions ember-statechart-component/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declarations/
dist/
File renamed without changes.
Loading

0 comments on commit 54fca76

Please sign in to comment.