Skip to content

Commit 16410c3

Browse files
authored
Sync with embroider-addon blueprint and use decorator-transforms (#94)
1 parent 6f8e522 commit 16410c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3164
-2046
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

+21-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,25 @@ 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
72+
- ember-lts-5.8
7673
- ember-release
7774
- ember-beta
7875
- ember-canary
79-
- ember-default-with-jquery
80-
- ember-classic
81-
# - embroider-safe
82-
# - embroider-optimized
76+
# - embroider-safe
77+
# - embroider-optimized
8378

8479
steps:
85-
- uses: actions/checkout@v3
86-
- name: Install Node
87-
uses: actions/setup-node@v3
80+
- uses: actions/checkout@v4
81+
- uses: actions/setup-node@v4
8882
with:
89-
node-version: 18.x
83+
node-version: 18
9084
cache: yarn
9185

9286
- name: Install Dependencies
9387
run: until yarn install --frozen-lockfile; do echo "Retrying yarn"; done
9488

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

.github/workflows/push-dist.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Because this library needs to be built,
2+
# we can't easily point package.json files at the git repo for easy cross-repo testing.
3+
#
4+
# This workflow brings back that capability by placing the compiled assets on a "dist" branch
5+
# (configurable via the "branch" option below)
6+
name: Push dist
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
- master
13+
14+
jobs:
15+
push-dist:
16+
name: Push dist
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 10
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 18
25+
cache: yarn
26+
- name: Install Dependencies
27+
run: yarn install --frozen-lockfile
28+
- uses: kategengler/put-built-npm-package-contents-on-branch@v2.0.0
29+
with:
30+
branch: dist
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
working-directory: 'ember-engines-router-service'

.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-service`
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.24 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

@@ -81,12 +73,9 @@ export default class MyService extends Service {
8173

8274

8375
## Contributing
84-
------------------------------------------------------------------------------
8576

8677
See the [Contributing](CONTRIBUTING.md) guide for details.
8778

88-
8979
## License
90-
------------------------------------------------------------------------------
9180

9281
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.17.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
+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
'use strict';
2+
3+
module.exports = {
4+
root: true,
5+
// Only use overrides
6+
// https://github.com/ember-cli/eslint-plugin-ember?tab=readme-ov-file#gtsgjs
7+
overrides: [
8+
{
9+
files: ['**/*.js'],
10+
env: { browser: true },
11+
parser: '@babel/eslint-parser',
12+
parserOptions: {
13+
ecmaVersion: 'latest',
14+
sourceType: 'module',
15+
babelOptions: {
16+
root: __dirname,
17+
},
18+
},
19+
plugins: ['ember', 'import'],
20+
extends: [
21+
'eslint:recommended',
22+
'plugin:ember/recommended',
23+
'plugin:prettier/recommended',
24+
],
25+
rules: {
26+
// require relative imports use full extensions
27+
'import/extensions': ['error', 'always', { ignorePackages: true }],
28+
// Add any custom rules here
29+
},
30+
},
31+
{
32+
files: ['**/*.gjs'],
33+
parser: 'ember-eslint-parser',
34+
plugins: ['ember', 'import'],
35+
extends: [
36+
'eslint:recommended',
37+
'plugin:ember/recommended',
38+
'plugin:ember/recommended-gjs',
39+
'plugin:prettier/recommended',
40+
],
41+
rules: {
42+
// require relative imports use full extensions
43+
'import/extensions': ['error', 'always', { ignorePackages: true }],
44+
// Add any custom rules here
45+
},
46+
},
47+
// node files
48+
{
49+
files: [
50+
'./.eslintrc.cjs',
51+
'./.prettierrc.cjs',
52+
'./.template-lintrc.cjs',
53+
'./addon-main.cjs',
54+
],
55+
parserOptions: {
56+
sourceType: 'script',
57+
},
58+
env: {
59+
browser: false,
60+
node: true,
61+
},
62+
plugins: ['n'],
63+
extends: [
64+
'eslint:recommended',
65+
'plugin:n/recommended',
66+
'plugin:prettier/recommended',
67+
],
68+
},
69+
],
70+
};

0 commit comments

Comments
 (0)