Skip to content

Commit df871e0

Browse files
authored
upgrade blueprints to Ember 3.28 (#68)
1 parent c0ebb7e commit df871e0

39 files changed

+2330
-1307
lines changed

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
root = true
66

7-
87
[*]
98
end_of_line = lf
109
charset = utf-8

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# misc
1414
/coverage/
1515
!.*
16+
.*/
17+
.eslintcache
1618

1719
# ember-try
1820
/.node_modules.ember-try/

.eslintrc.js

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,53 @@
1+
'use strict';
2+
13
module.exports = {
24
root: true,
5+
parser: 'babel-eslint',
36
parserOptions: {
47
ecmaVersion: 2018,
5-
sourceType: 'module'
8+
sourceType: 'module',
9+
ecmaFeatures: {
10+
legacyDecorators: true,
11+
},
612
},
7-
plugins: [
8-
'ember'
9-
],
13+
plugins: ['ember'],
1014
extends: [
1115
'eslint:recommended',
12-
'plugin:ember/recommended'
16+
'plugin:ember/recommended',
17+
'plugin:prettier/recommended',
1318
],
1419
env: {
15-
browser: true
16-
},
17-
rules: {
20+
browser: true,
1821
},
22+
rules: {},
1923
overrides: [
2024
// node files
2125
{
2226
files: [
23-
'.eslintrc.js',
24-
'.template-lintrc.js',
25-
'ember-cli-build.js',
26-
'index.js',
27-
'testem.js',
28-
'blueprints/*/index.js',
29-
'config/**/*.js',
30-
'tests/dummy/config/**/*.js'
31-
],
32-
excludedFiles: [
33-
'addon/**',
34-
'addon-test-support/**',
35-
'app/**',
36-
'tests/dummy/app/**'
27+
'./.eslintrc.js',
28+
'./.prettierrc.js',
29+
'./.template-lintrc.js',
30+
'./ember-cli-build.js',
31+
'./index.js',
32+
'./testem.js',
33+
'./blueprints/*/index.js',
34+
'./config/**/*.js',
35+
'./tests/dummy/config/**/*.js',
3736
],
3837
parserOptions: {
39-
sourceType: 'script'
38+
sourceType: 'script',
4039
},
4140
env: {
4241
browser: false,
43-
node: true
42+
node: true,
4443
},
4544
plugins: ['node'],
46-
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
47-
// add your custom rules and overrides for node files here
48-
})
49-
}
50-
]
45+
extends: ['plugin:node/recommended'],
46+
},
47+
{
48+
// Test files:
49+
files: ['tests/**/*-test.{js,ts}'],
50+
extends: ['plugin:qunit/recommended'],
51+
},
52+
],
5153
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/.env*
1313
/.pnp*
1414
/.sass-cache
15+
/.eslintcache
1516
/connect.lock
1617
/coverage/
1718
/libpeerconnection.log

.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@
1010
/.editorconfig
1111
/.ember-cli
1212
/.env*
13+
/.eslintcache
1314
/.eslintignore
1415
/.eslintrc.js
16+
/.git/
1517
/.gitignore
18+
/.prettierignore
19+
/.prettierrc.js
1620
/.template-lintrc.js
1721
/.travis.yml
1822
/.watchmanconfig
@@ -22,6 +26,7 @@
2226
/ember-cli-build.js
2327
/testem.js
2428
/tests/
29+
/yarn-error.log
2530
/yarn.lock
2631
.gitkeep
2732

.prettierignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# unconventional js
2+
/blueprints/*/files/
3+
/vendor/
4+
5+
# compiled output
6+
/dist/
7+
/tmp/
8+
9+
# dependencies
10+
/bower_components/
11+
/node_modules/
12+
13+
# misc
14+
/coverage/
15+
!.*
16+
.eslintcache
17+
18+
# ember-try
19+
/.node_modules.ember-try/
20+
/bower.json.ember-try
21+
/package.json.ember-try

.prettierrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict';
2+
3+
module.exports = {
4+
singleQuote: true,
5+
};

.template-lintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
22

33
module.exports = {
4-
extends: 'recommended'
4+
extends: 'recommended',
55
};

.travis.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ language: node_js
33
node_js:
44
# we recommend testing addons with the same minimum supported node version as Ember CLI
55
# so that your addon works for all apps
6-
- "8"
6+
- "12"
77

8-
sudo: false
9-
dist: trusty
8+
dist: xenial
109

1110
addons:
1211
chrome: stable
@@ -26,42 +25,40 @@ branches:
2625
- /^v\d+\.\d+\.\d+/
2726

2827
jobs:
29-
fail_fast: true
28+
fast_finish: true
3029
allow_failures:
3130
- env: EMBER_TRY_SCENARIO=ember-canary
3231

3332
include:
3433
# runs linting and tests with current locked deps
35-
3634
- stage: "Tests"
3735
name: "Tests"
38-
install:
39-
- yarn install --non-interactive
4036
script:
41-
- yarn lint:hbs
42-
- yarn lint:js
43-
- yarn test
37+
- yarn lint
38+
- yarn test:ember
4439

45-
- name: "Floating Dependencies"
40+
- stage: "Additional Tests"
41+
name: "Floating Dependencies"
42+
install:
43+
- yarn install --no-lockfile --non-interactive
4644
script:
47-
- yarn test
45+
- yarn test:ember
4846

4947
# we recommend new addons test the current and previous LTS
5048
# as well as latest stable release (bonus points to beta/canary)
51-
- stage: "Additional Tests"
52-
env: EMBER_TRY_SCENARIO=ember-lts-3.4
53-
- env: EMBER_TRY_SCENARIO=ember-lts-3.8
49+
- env: EMBER_TRY_SCENARIO=ember-lts-3.20
50+
- env: EMBER_TRY_SCENARIO=ember-lts-3.24
5451
- env: EMBER_TRY_SCENARIO=ember-release
5552
- env: EMBER_TRY_SCENARIO=ember-beta
5653
- env: EMBER_TRY_SCENARIO=ember-canary
5754
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
55+
- env: EMBER_TRY_SCENARIO=ember-classic
56+
- env: EMBER_TRY_SCENARIO=embroider-safe
57+
- env: EMBER_TRY_SCENARIO=embroider-optimized
5858

5959
before_install:
6060
- curl -o- -L https://yarnpkg.com/install.sh | bash
6161
- export PATH=$HOME/.yarn/bin:$PATH
6262

63-
install:
64-
- yarn install --no-lockfile --non-interactive
65-
6663
script:
6764
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO

CONTRIBUTING.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88

99
## Linting
1010

11-
* `yarn lint:hbs`
12-
* `yarn lint:js`
13-
* `yarn lint:js --fix`
11+
* `yarn lint`
12+
* `yarn lint:fix`
1413

1514
## Running tests
1615

@@ -23,4 +22,4 @@
2322
* `ember serve`
2423
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).
2524

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

addon-test-support/index.js

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,31 @@ import Service from '@ember/service';
33
import { assert } from '@ember/debug';
44
import { getContext, settled } from '@ember/test-helpers';
55

6-
const backButton = async function() {
6+
const backButton = async function () {
77
let { owner } = getContext();
88
const history = owner.lookup('service:history');
9-
assert('setupBrowserNavigationButtons must be called before `backButton` could be used.', history);
9+
assert(
10+
'setupBrowserNavigationButtons must be called before `backButton` could be used.',
11+
history
12+
);
1013
await history.goBack();
1114
await settled();
1215
return;
1316
};
1417

15-
const forwardButton = async function() {
18+
const forwardButton = async function () {
1619
let { owner } = getContext();
1720
const history = owner.lookup('service:history');
18-
assert('setupBrowserNavigationButtons must be called before `forwardButton` could be used.', history);
21+
assert(
22+
'setupBrowserNavigationButtons must be called before `forwardButton` could be used.',
23+
history
24+
);
1925
await history.goForward();
2026
await settled();
2127
return;
2228
};
2329

24-
const setupBrowserNavigationButtons = function() {
30+
const setupBrowserNavigationButtons = function () {
2531
let { owner } = getContext();
2632
const router = owner.lookup('service:router');
2733
const history = Service.create({
@@ -39,22 +45,25 @@ const setupBrowserNavigationButtons = function() {
3945
// get the page before is our target
4046
// remove that one also, since it's readded by transition
4147
const previousURL = this.history.pop();
42-
assert('There were no URLs in the browser history. Make sure a transition ocurred after `setupBrowserNavigationButtons` was called.', previousURL);
48+
assert(
49+
'There were no URLs in the browser history. Make sure a transition ocurred after `setupBrowserNavigationButtons` was called.',
50+
previousURL
51+
);
4352
return this.router.transitionTo(previousURL);
4453
},
4554
goForward() {
4655
const nextURL = this.forward.pop();
47-
assert('backButton must be used at least once before forwardButton can be used.', nextURL);
56+
assert(
57+
'backButton must be used at least once before forwardButton can be used.',
58+
nextURL
59+
);
4860
return this.router.transitionTo(nextURL);
4961
},
50-
router
62+
router,
5163
});
5264
owner.register('service:history', history, { instantiate: false });
65+
// eslint-disable-next-line ember/no-observers
5366
addObserver(router, 'currentURL', history, 'addHistory');
5467
};
5568

56-
export {
57-
backButton,
58-
forwardButton,
59-
setupBrowserNavigationButtons,
60-
}
69+
export { backButton, forwardButton, setupBrowserNavigationButtons };

config/ember-try.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
11
'use strict';
22

33
const getChannelURL = require('ember-source-channel-url');
4+
const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');
45

5-
module.exports = async function() {
6+
module.exports = async function () {
67
return {
78
useYarn: true,
89
scenarios: [
910
{
1011
name: 'ember-lts-3.20',
1112
npm: {
1213
devDependencies: {
13-
'ember-source': '~3.20.0'
14-
}
15-
}
14+
'ember-source': '~3.20.0',
15+
},
16+
},
1617
},
1718
{
1819
name: 'ember-lts-3.24',
1920
npm: {
2021
devDependencies: {
21-
'ember-source': '~3.24.0'
22-
}
23-
}
22+
'ember-source': '~3.24.3',
23+
},
24+
},
2425
},
2526
{
2627
name: 'ember-lts-3.28',
2728
npm: {
2829
devDependencies: {
29-
'ember-source': '~3.28.0'
30-
}
31-
}
30+
'ember-source': '~3.28.0',
31+
},
32+
},
3233
},
3334
{
3435
name: 'ember-release',
@@ -85,6 +86,8 @@ module.exports = async function() {
8586
},
8687
},
8788
},
88-
]
89+
embroiderSafe(),
90+
embroiderOptimized(),
91+
],
8992
};
9093
};

config/environment.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
22

3-
module.exports = function(/* environment, appConfig */) {
4-
return { };
3+
module.exports = function (/* environment, appConfig */) {
4+
return {};
55
};

0 commit comments

Comments
 (0)