Skip to content

Commit 69d3107

Browse files
authored
Merge pull request #412 from ember-learn/upgrade
Breaking: drop support for Node 10, update ember to 3.28, and remove deprecations
2 parents 5bd65b1 + 333ee41 commit 69d3107

25 files changed

+25792
-24041
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# misc
1414
/coverage/
1515
!.*
16+
.*/
1617
.eslintcache
1718

1819
# ember-try

.eslintrc.js

+14-16
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,15 @@ module.exports = {
2424
// node files
2525
{
2626
files: [
27-
'.eslintrc.js',
28-
'.stylelintrc.js',
29-
'.prettierrc.js',
30-
'.template-lintrc.js',
31-
'ember-cli-build.js',
32-
'index.js',
33-
'testem.js',
34-
'blueprints/*/index.js',
35-
'config/**/*.js',
36-
'tests/dummy/config/**/*.js',
37-
],
38-
excludedFiles: [
39-
'addon/**',
40-
'addon-test-support/**',
41-
'app/**',
42-
'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',
4336
],
4437
parserOptions: {
4538
sourceType: 'script',
@@ -51,5 +44,10 @@ module.exports = {
5144
plugins: ['node'],
5245
extends: ['plugin:node/recommended'],
5346
},
47+
{
48+
// Test files:
49+
files: ['tests/**/*-test.{js,ts}'],
50+
extends: ['plugin:qunit/recommended'],
51+
},
5452
],
5553
};

.github/workflows/ci.yml

+41-52
Original file line numberDiff line numberDiff line change
@@ -3,89 +3,78 @@ name: CI
33
on:
44
push:
55
branches:
6-
- master
76
- main
8-
- "v*"
9-
pull_request:
7+
- master
8+
pull_request: {}
109

11-
env:
12-
NODE_VERSION: 10
13-
PERCY_PARALLEL_NONCE: ${{ github.run_id }}-${{ github.run_number }}
14-
PERCY_PARALLEL_TOTAL: 1
15-
FORCE_COLOR: 1
10+
concurrency:
11+
group: ci-${{ github.head_ref || github.ref }}
12+
cancel-in-progress: true
1613

1714
jobs:
18-
lint:
19-
name: Linting
15+
test:
16+
name: "Tests"
2017
runs-on: ubuntu-latest
18+
env:
19+
PERCY_TOKEN: ee0a9d5c1122d6a21852edf19b5b309aaec18077fb3900c98995c90bc48ed240
20+
RUN_PERCY_TESTS: true
2121

2222
steps:
2323
- uses: actions/checkout@v2
24+
- uses: mansona/npm-lockfile-version@v1
2425
- uses: actions/setup-node@v2
2526
with:
26-
node-version: ${{ env.NODE_VERSION }}
27-
27+
node-version: 12.x
28+
cache: npm
2829
- run: npm i -g npm@7
2930
- run: npm ci
3031
- run: npm run lint
32+
- run: npx percy exec -- npm run test
3133

32-
floating-dependencies:
33-
name: Floating Dependencies
34-
runs-on: ubuntu-latest
35-
36-
steps:
37-
- uses: actions/checkout@v2
38-
- uses: actions/setup-node@v2
39-
with:
40-
node-version: ${{ env.NODE_VERSION }}
41-
42-
- run: npm i -g npm@7
43-
- run: npm install --no-package-lock
44-
- run: npm test
45-
46-
test:
47-
name: Tests
34+
floating:
35+
name: "Floating Dependencies"
4836
runs-on: ubuntu-latest
49-
env:
50-
PERCY_TOKEN: ee0a9d5c1122d6a21852edf19b5b309aaec18077fb3900c98995c90bc48ed240
51-
RUN_PERCY_TESTS: true
52-
5337

5438
steps:
5539
- uses: actions/checkout@v2
56-
- uses: mansona/npm-lockfile-version@v1
5740
- uses: actions/setup-node@v2
5841
with:
59-
node-version: ${{ env.NODE_VERSION }}
60-
42+
node-version: 12.x
43+
cache: npm
6144
- run: npm i -g npm@7
62-
- run: npm ci
63-
- run: npx percy exec -- npm run test
45+
- run: npm install --no-shrinkwrap
46+
- run: npm run test:ember
6447

6548
try-scenarios:
66-
name: "ember-try: ${{ matrix.ember-try-scenario }}"
49+
name: ${{ matrix.try-scenario }}
6750
runs-on: ubuntu-latest
68-
timeout-minutes: 10
69-
needs: test
51+
needs: 'test'
7052

7153
strategy:
54+
fail-fast: false
7255
matrix:
73-
ember-try-scenario:
74-
- 'ember-lts-3.16'
75-
- 'ember-lts-3.20'
76-
- 'ember-release'
77-
- 'ember-beta'
78-
- 'ember-canary'
79-
- 'ember-default-with-jquery'
80-
- 'ember-classic'
56+
try-scenario:
57+
- ember-lts-3.16
58+
- ember-lts-3.20
59+
- ember-lts-3.24
60+
- ember-lts-3.28
61+
- ember-release
62+
- ember-beta
63+
- ember-canary
64+
- ember-classic
65+
- ember-default-with-jquery
66+
- embroider-safe
67+
- embroider-optimized
68+
- no-deprecations
69+
- ember-release-no-deprecations
8170

8271
steps:
8372
- uses: actions/checkout@v2
8473
- uses: actions/setup-node@v2
8574
with:
86-
node-version: ${{ env.NODE_VERSION }}
87-
75+
node-version: 12.x
76+
cache: npm
8877
- run: npm i -g npm@7
8978
- run: npm ci
90-
- name: test
91-
run: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup
79+
- name: Run Tests
80+
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}

.node-version

-1
This file was deleted.

.npmignore

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
/.eslintrc.js
1616
/.git/
1717
/.gitignore
18+
/.prettierignore
19+
/.prettierrc.js
1820
/.template-lintrc.js
1921
/.travis.yml
2022
/.watchmanconfig
@@ -24,6 +26,7 @@
2426
/ember-cli-build.js
2527
/testem.js
2628
/tests/
29+
/yarn-error.log
2730
/yarn.lock
2831
.gitkeep
2932

.stylelintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable prettier/prettier */
1+
/* eslint-disable no-undef, prettier/prettier */
22
module.exports = {
33
extends: 'stylelint-config-standard',
44
plugins: [

.template-lintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
22

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

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## Linting
1010

1111
* `npm run lint`
12-
* `npm run lint:js -- --fix`
12+
* `npm run lint:fix`
1313

1414
## Running tests
1515

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ This addon is intended to provide basic components for easier style coordination
1111
Compatibility
1212
------------------------------------------------------------------------------
1313

14-
* Ember.js v3.16 or above
15-
* Ember CLI v2.13 or above
16-
* Node.js v10 or above
14+
* Ember.js v3.24 or above
15+
* Ember CLI v3.24 or above
16+
* Node.js v12 or above
1717

1818

1919
Installation

addon/components/es-header.hbs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{! template-lint-disable no-redundant-landmark-role }}
12
<header
23
class="es-header"
34
role="banner"

addon/services/progress.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { tracked } from '@glimmer/tracking';
44
import { action } from '@ember/object';
55

66
import { rawTimeout, task, timeout } from 'ember-concurrency';
7-
import { buildWaiter } from 'ember-test-waiters';
7+
import { buildWaiter } from '@ember/test-waiters';
88

99
const SPEED = 200;
1010

config/ember-try.js

+39
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

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

56
module.exports = async function () {
67
return {
@@ -21,6 +22,22 @@ module.exports = async function () {
2122
},
2223
},
2324
},
25+
{
26+
name: 'ember-lts-3.24',
27+
npm: {
28+
devDependencies: {
29+
'ember-source': '~3.24.3',
30+
},
31+
},
32+
},
33+
{
34+
name: 'ember-lts-3.28',
35+
npm: {
36+
devDependencies: {
37+
'ember-source': '~3.28.0',
38+
},
39+
},
40+
},
2441
{
2542
name: 'ember-release',
2643
npm: {
@@ -68,11 +85,33 @@ module.exports = async function () {
6885
}),
6986
},
7087
npm: {
88+
devDependencies: {
89+
'ember-source': '~3.28.0',
90+
},
7191
ember: {
7292
edition: 'classic',
7393
},
7494
},
7595
},
96+
embroiderSafe(),
97+
embroiderOptimized(),
98+
{
99+
name: 'no-deprecations',
100+
npm: {
101+
devDependencies: {
102+
'ember-deprecation-error': '*',
103+
},
104+
},
105+
},
106+
{
107+
name: 'ember-release-no-deprecations',
108+
npm: {
109+
devDependencies: {
110+
'ember-source': await getChannelURL('release'),
111+
'ember-deprecation-error': '*',
112+
},
113+
},
114+
},
76115
],
77116
};
78117
};

docs/components/button.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Component from '@glimmer/component';
2+
import { tracked } from '@glimmer/tracking';
3+
import { action } from '@ember/object';
4+
5+
export default class ButtonComponent extends Component {
6+
@tracked
7+
value = 0;
8+
9+
@action
10+
incrementValue() {
11+
this.value++;
12+
}
13+
}

docs/components/button.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ Also supported- block use:
1919
To add interactivity you can pass an action to `onClicked`
2020

2121
```handlebars
22-
<EsButton @onClicked={{action (mut value) (increment value)}}>
22+
<EsButton @onClicked={{this.incrementValue}}>
2323
Increment Value
2424
</EsButton>
2525
26-
{{value}}
26+
{{this.value}}
2727
```
2828

2929
## Secondary Buttons

docs/components/header.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import Component from '@glimmer/component';
2+
3+
export default class HeaderComponent extends Component {
4+
links = [
5+
{
6+
name: 'Example Links',
7+
type: 'dropdown',
8+
items: [
9+
{
10+
href: 'https://guides.emberjs.com/release/',
11+
name: 'Ember.js Guides',
12+
type: 'link',
13+
},
14+
{
15+
href: 'https://api.emberjs.com',
16+
name: 'API Reference',
17+
type: 'link',
18+
},
19+
{
20+
href: 'https://cli.emberjs.com',
21+
name: 'CLI Guides',
22+
type: 'link',
23+
},
24+
{
25+
type: 'divider',
26+
},
27+
{
28+
href: 'https://emberjs.com/learn',
29+
name: 'Learn Ember',
30+
type: 'link',
31+
},
32+
],
33+
},
34+
];
35+
}

docs/components/header.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Shows the side wide header with the global navigation.
99
If you would like to override the default links you can pass a json object to update the links in the navbar.
1010

1111
```handlebars
12-
<EsHeader @links={{links}} />
12+
<EsHeader @links={{this.links}} />
1313
```
1414

1515
You can also use the block form of the component to add extra HTML to the navigation bar

0 commit comments

Comments
 (0)