Skip to content

Commit ff961ef

Browse files
committed
Sync with embroider-addon blueprint and use decorator-transforms
1 parent 05d3364 commit ff961ef

39 files changed

+1756
-1339
lines changed

.editorconfig

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.hbs]
16+
insert_final_newline = false
17+
18+
[*.{diff,md}]
19+
trim_trailing_whitespace = false

.github/workflows/ci.yml

+20-27
Original file line numberDiff line numberDiff line change
@@ -18,37 +18,31 @@ jobs:
1818
timeout-minutes: 10
1919

2020
steps:
21-
- uses: actions/checkout@v3
22-
- name: Install Node
23-
uses: actions/setup-node@v3
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-node@v4
2423
with:
25-
node-version: 18.x
24+
node-version: 18
2625
cache: yarn
2726

2827
- name: Install Dependencies
2928
run: until yarn install --frozen-lockfile; do echo "Retrying yarn"; done
3029

31-
- name: Lint Addon
30+
- name: Lint
3231
run: yarn lint
33-
working-directory: ember-engines-router-service
34-
35-
- name: Lint Test App
36-
run: yarn lint
37-
working-directory: test-app
3832

3933
- name: Run Tests
40-
run: yarn test:ember
41-
working-directory: test-app
34+
run: yarn test
4235

4336
floating:
4437
name: "Floating Dependencies"
4538
runs-on: ubuntu-latest
39+
timeout-minutes: 10
4640

4741
steps:
48-
- uses: actions/checkout@v3
49-
- uses: actions/setup-node@v3
42+
- uses: actions/checkout@v4
43+
- uses: actions/setup-node@v4
5044
with:
51-
node-version: 18.x
45+
node-version: 18
5246
cache: yarn
5347

5448
- name: Install Dependencies
@@ -57,13 +51,13 @@ jobs:
5751
run: until yarn install --no-lockfile; do echo "Retrying yarn"; done
5852

5953
- name: Run Tests
60-
run: yarn test:ember
61-
working-directory: test-app
54+
run: yarn test
6255

6356
try-scenarios:
6457
name: ${{ matrix.try-scenario }}
6558
runs-on: ubuntu-latest
6659
needs: 'test'
60+
timeout-minutes: 10
6761

6862
strategy:
6963
fail-fast: false
@@ -73,25 +67,24 @@ jobs:
7367
- ember-lts-3.28
7468
- ember-lts-4.4
7569
- ember-lts-4.8
70+
- ember-lts-4.12
71+
- ember-lts-5.4
7672
- ember-release
7773
- ember-beta
7874
- ember-canary
79-
- ember-default-with-jquery
80-
- ember-classic
81-
# - embroider-safe
82-
# - embroider-optimized
75+
# - embroider-safe
76+
# - embroider-optimized
8377

8478
steps:
85-
- uses: actions/checkout@v3
86-
- name: Install Node
87-
uses: actions/setup-node@v3
79+
- uses: actions/checkout@v4
80+
- uses: actions/setup-node@v4
8881
with:
89-
node-version: 18.x
82+
node-version: 18
9083
cache: yarn
9184

9285
- name: Install Dependencies
9386
run: until yarn install --frozen-lockfile; do echo "Retrying yarn"; done
9487

9588
- name: Run Tests
96-
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
97-
working-directory: test-app
89+
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }} --skip-cleanup
90+
working-directory: test-app

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ npm-debug.log*
1010
yarn-error.log
1111
/.DS_Store
1212

13-
# yarn
14-
.pnp.*
13+
14+
# https://yarnpkg.com/getting-started/qa/#which-files-should-be-gitignored
1515
.yarn/*
16+
!.yarn/cache
1617
!.yarn/patches
1718
!.yarn/plugins
1819
!.yarn/releases

CONTRIBUTING.md

+18-12
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,30 @@
22

33
## Installation
44

5-
* `git clone https://github.com/villander/ember-engines-router-service.git`
6-
* `cd ember-engines-router-service`
7-
* `yarn install`
5+
- `git clone https://github.com/villander/ember-engines-router-service.git`
6+
- `cd ember-engines-router-service`
7+
- `yarn install`
88

99
## Linting
1010

11-
* `yarn lint`
12-
* `yarn lint:fix`
11+
- `yarn lint`
12+
- `yarn lint:fix`
13+
14+
## Building the addon
15+
16+
- `cd ember-engines-router-service1`
17+
- `yarn build`
1318

1419
## Running tests
1520

16-
* `ember test` – Runs the test suite on the current Ember version
17-
* `ember test --server` – Runs the test suite in "watch mode"
18-
* `ember try:each` – Runs the test suite against multiple Ember versions
21+
- `cd test-app`
22+
- `yarn test` – Runs the test suite on the current Ember version
23+
- `yarn test:watch` – Runs the test suite in "watch mode"
1924

20-
## Running the test-app application
25+
## Running the test application
2126

22-
* `ember serve`
23-
* Visit the test-app application at [http://localhost:4200](http://localhost:4200).
27+
- `cd test-app`
28+
- `yarn start`
29+
- Visit the test application at [http://localhost:4200](http://localhost:4200).
2430

25-
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
31+
For more information on using ember-cli, visit [https://cli.emberjs.com/release/](https://cli.emberjs.com/release/).

README.md

+2-13
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,20 @@ This addon provides an API for authoring a [Router service](https://api.emberjs.
77

88

99
## Compatibility
10-
------------------------------------------------------------------------------
11-
12-
* Ember.js v3.12 or above
13-
* Ember CLI v3.24 or above
14-
* Node.js v14 or above
1510

11+
- Ember.js v3.12 or above
12+
- Embroider or ember-auto-import v2
1613

1714
## Installation
18-
------------------------------------------------------------------------------
1915

2016
```
2117
ember install ember-engines-router-service
2218
```
2319

24-
2520
## Usage
2621

2722
Basically you have the full [RouterService](https://api.emberjs.com/ember/release/classes/RouterService) API **inside each engine**. That means you can use APIs such as `transitionTo` and `isActive`, plus the new "external routing" APIs such as `transitionToExternal` and `isActiveExternal` which help link `externalRoutes` together.
2823

29-
------------------------------------------------------------------------------
3024
```js
3125
import Component from '@glimmer/component';
3226
import { inject as service } from '@ember/service';
@@ -59,9 +53,7 @@ export default class SomeComponent extends Component {
5953

6054
For further documentation on this subject, view the [Engine Linking RFC](https://github.com/emberjs/rfcs/pull/122).
6155

62-
6356
## TypeScript
64-
------------------------------------------------------------------------------
6557

6658
The library ships types for TypeScript usage:
6759

@@ -83,12 +75,9 @@ export default class MyService extends Service {
8375

8476

8577
## Contributing
86-
------------------------------------------------------------------------------
8778

8879
See the [Contributing](CONTRIBUTING.md) guide for details.
8980

90-
9181
## License
92-
------------------------------------------------------------------------------
9382

9483
This project is licensed under the [MIT License](LICENSE.md).

config/ember-cli-update.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"schemaVersion": "1.0.0",
3+
"projectName": "ember-engines-router-service",
4+
"packages": [
5+
{
6+
"name": "@embroider/addon-blueprint",
7+
"version": "2.14.0",
8+
"blueprints": [
9+
{
10+
"name": "@embroider/addon-blueprint",
11+
"isBaseBlueprint": true,
12+
"options": [
13+
"--ci-provider=github",
14+
"--release-it",
15+
"--yarn"
16+
]
17+
}
18+
]
19+
}
20+
]
21+
}
+1-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
# unconventional js
22
/blueprints/*/files/
3-
/vendor/
43

54
# compiled output
65
/dist/
7-
8-
# dependencies
9-
/node_modules/
6+
/declarations/
107

118
# misc
129
/coverage/
13-
!.*
14-
.*/
15-
.eslintcache

ember-engines-router-service/.eslintrc.js ember-engines-router-service/.eslintrc.cjs

+11-6
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ module.exports = {
44
root: true,
55
parser: '@babel/eslint-parser',
66
parserOptions: {
7-
ecmaVersion: 2021,
7+
ecmaVersion: 'latest',
88
sourceType: 'module',
9-
ecmaFeatures: {
10-
legacyDecorators: true,
9+
babelOptions: {
10+
root: __dirname,
1111
},
1212
},
1313
plugins: ['ember'],
@@ -23,16 +23,21 @@ module.exports = {
2323
overrides: [
2424
// node files
2525
{
26-
files: ['./.eslintrc.js', './.prettierrc.js', './addon-main.js'],
26+
files: [
27+
'./.eslintrc.cjs',
28+
'./.prettierrc.cjs',
29+
'./.template-lintrc.cjs',
30+
'./addon-main.cjs',
31+
],
2732
parserOptions: {
2833
sourceType: 'script',
2934
},
3035
env: {
3136
browser: false,
3237
node: true,
3338
},
34-
plugins: ['node'],
35-
extends: ['plugin:node/recommended'],
39+
plugins: ['n'],
40+
extends: ['plugin:n/recommended'],
3641
},
3742
],
3843
};
+12-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
# unconventional js
2-
/blueprints/*/files/
3-
/vendor/
1+
# The authoritative copies of these live in the monorepo root (because they're
2+
# more useful on github that way), but the build copies them into here so they
3+
# will also appear in published NPM packages.
4+
/README.md
5+
/LICENSE.md
46

57
# compiled output
6-
/dist/
8+
dist/
9+
declarations/
710

8-
# dependencies
9-
/node_modules/
11+
# npm/pnpm/yarn pack output
12+
*.tgz
1013

11-
# misc
12-
/coverage/
13-
!.*
14-
.*/
14+
# deps & caches
15+
node_modules/
1516
.eslintcache
17+
.prettiercache
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
# unconventional js
22
/blueprints/*/files/
3-
/vendor/
43

54
# compiled output
65
/dist/
7-
8-
# dependencies
9-
/node_modules/
6+
/declarations/
107

118
# misc
129
/coverage/
13-
!.*
14-
.eslintcache
15-
.lint-todo/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict';
2+
3+
module.exports = {
4+
plugins: ['prettier-plugin-ember-template-tag'],
5+
singleQuote: true,
6+
};
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
22

33
module.exports = {
4-
singleQuote: true,
4+
extends: 'recommended',
55
};
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
'use strict';
2+
13
const { addonV1Shim } = require('@embroider/addon-shim');
24
module.exports = addonV1Shim(__dirname);
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"plugins": [
33
"@embroider/addon-dev/template-colocation-plugin",
4-
["@babel/plugin-proposal-decorators", { "legacy": true }],
5-
"@babel/plugin-proposal-class-properties"
4+
["babel-plugin-ember-template-compilation", {
5+
"targetFormat": "hbs",
6+
"transforms": []
7+
}],
8+
["module:decorator-transforms", { "runtime": { "import": "decorator-transforms/runtime" } }]
69
]
7-
}
10+
}

0 commit comments

Comments
 (0)