Skip to content

Commit 931d8f7

Browse files
Require Ember 3.28+, node 18+, modernize code (#86)
* Run ember-cli-update to 3.28 * ember-cli-update to 4.12 * pnpm install * Update ember-cli-update.json * ember-cli-update to 5.12 * pnpm update * Update ci.yml * Update application.hbs * Get tests passing * Fix some lint * Fix some lint, add some try scenarios * Update addon.css * Add TS support * Convert to glimmer and TS * Fix nested example * Fix lint * Update drag-sort-list.ts * Update some links * Fix dragging bug * Fix types * Fix lint * Update drag-sort.ts * Remove action helper
1 parent 41baec9 commit 931d8f7

73 files changed

Lines changed: 16498 additions & 15388 deletions

Some content is hidden

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

.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

.ember-cli

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
/**
3-
Ember CLI sends analytics information by default. The data is completely
4-
anonymous, but there are times when you might want to disable this behavior.
5-
6-
Setting `disableAnalytics` to true will prevent any data from being sent.
3+
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
4+
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
75
*/
8-
"disableAnalytics": false
6+
"isTypeScriptProject": true
97
}

.eslintignore

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
# unconventional js
22
/blueprints/*/files/
3-
/vendor/
43

54
# compiled output
5+
/declarations/
66
/dist/
7-
/tmp/
8-
9-
# dependencies
10-
/bower_components/
11-
/node_modules/
127

138
# misc
149
/coverage/
1510
!.*
11+
.*/
1612

1713
# ember-try
1814
/.node_modules.ember-try/
19-
/bower.json.ember-try
20-
/package.json.ember-try

.eslintrc.js

Lines changed: 41 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,55 @@
1+
'use strict';
2+
13
module.exports = {
2-
root : true,
3-
parser : 'babel-eslint',
4-
parserOptions : {
5-
ecmaVersion : 2018,
6-
sourceType : 'module',
7-
ecmaFeatures : {
8-
legacyDecorators : true,
9-
},
4+
root: true,
5+
parser: '@typescript-eslint/parser',
6+
parserOptions: {
7+
ecmaVersion: 'latest',
108
},
11-
plugins : [
12-
'align-assignments',
13-
'ember',
14-
'varspacing',
15-
],
16-
extends : [
9+
plugins: ['ember', '@typescript-eslint'],
10+
extends: [
1711
'eslint:recommended',
1812
'plugin:ember/recommended',
19-
'standard',
20-
'plugin:varspacing/recommended',
13+
'plugin:prettier/recommended',
2114
],
22-
env : {
23-
browser : true,
15+
env: {
16+
browser: true,
2417
},
25-
rules : {
26-
'align-assignments/align-assignments' : 'error',
27-
'arrow-parens' : 'off',
28-
'camelcase' : 'off',
29-
'comma-dangle' : ['error', 'always-multiline'],
30-
'ember/no-jquery' : 'error',
31-
'ember/no-observers' : 'off',
32-
'func-call-spacing' : 'off',
33-
'generator-star-spacing' : 'off',
34-
'indent' : ['error', 2, {flatTernaryExpressions : true}],
35-
'key-spacing' : ['error', { beforeColon : true, afterColon : true, align : 'colon' }],
36-
'new-cap' : 'off',
37-
'no-console' : 'off',
38-
'no-mixed-operators' : 'off',
39-
'no-multi-spaces' : 'off',
40-
'no-multiple-empty-lines' : 'off',
41-
'no-return-assign' : 'off',
42-
'no-sequences' : 'off',
43-
'no-template-curly-in-string' : 'off',
44-
'no-whitespace-before-property' : 'off',
45-
'object-curly-spacing' : 'off',
46-
'operator-linebreak' : 'off',
47-
'padded-blocks' : 'off',
48-
'quote-props' : ['error', 'consistent-as-needed'],
49-
'quotes' : ['error', 'single'],
50-
'spaced-comment' : 'off',
51-
'standard/object-curly-even-spacing' : 'off',
52-
},
53-
overrides : [
54-
// node files
18+
rules: {},
19+
overrides: [
20+
// ts files
5521
{
56-
files : [
57-
'.eslintrc.js',
58-
'.template-lintrc.js',
59-
'ember-cli-build.js',
60-
'index.js',
61-
'testem.js',
62-
'blueprints/*/index.js',
63-
'config/**/*.js',
64-
'tests/dummy/config/**/*.js',
65-
],
66-
excludedFiles : [
67-
'addon/**',
68-
'addon-test-support/**',
69-
'app/**',
70-
'tests/dummy/app/**',
71-
'tests/pages/**',
22+
files: ['**/*.ts'],
23+
extends: [
24+
'plugin:@typescript-eslint/eslint-recommended',
25+
'plugin:@typescript-eslint/recommended',
7226
],
73-
parserOptions : {
74-
sourceType : 'script',
75-
ecmaVersion : 2015,
76-
},
77-
env : {
78-
browser : false,
79-
node : true,
80-
},
81-
plugins : ['node'],
82-
rules : Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
83-
// add your custom rules and overrides for node files here
84-
}),
27+
rules: {},
8528
},
86-
87-
// tests
29+
// node files
8830
{
89-
files : [
90-
'tests/**/*.js',
31+
files: [
32+
'./.eslintrc.js',
33+
'./.prettierrc.js',
34+
'./.stylelintrc.js',
35+
'./.template-lintrc.js',
36+
'./ember-cli-build.js',
37+
'./index.js',
38+
'./testem.js',
39+
'./blueprints/*/index.js',
40+
'./config/**/*.js',
41+
'./tests/dummy/config/**/*.js',
9142
],
92-
rules : {
93-
'no-unused-expressions' : 'off',
43+
env: {
44+
browser: false,
45+
node: true,
9446
},
47+
extends: ['plugin:n/recommended'],
48+
},
49+
{
50+
// test files
51+
files: ['tests/**/*-test.{js,ts}'],
52+
extends: ['plugin:qunit/recommended'],
9553
},
9654
],
97-
}
55+
};

.github/workflows/ci.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request: {}
9+
10+
concurrency:
11+
group: ci-${{ github.head_ref || github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test:
16+
name: "Tests"
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 10
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: pnpm/action-setup@v4
23+
with:
24+
version: 10
25+
- name: Install Node
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: 18
29+
cache: pnpm
30+
- name: Install Dependencies
31+
run: pnpm install --frozen-lockfile
32+
- name: Lint
33+
run: pnpm lint
34+
- name: Run Tests
35+
run: pnpm test:ember
36+
37+
floating:
38+
name: "Floating Dependencies"
39+
runs-on: ubuntu-latest
40+
timeout-minutes: 10
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
- uses: pnpm/action-setup@v4
45+
with:
46+
version: 10
47+
- uses: actions/setup-node@v4
48+
with:
49+
node-version: 18
50+
cache: pnpm
51+
- name: Install Dependencies
52+
run: pnpm install --no-lockfile
53+
- name: Run Tests
54+
run: pnpm test:ember
55+
56+
try-scenarios:
57+
name: ${{ matrix.try-scenario }}
58+
runs-on: ubuntu-latest
59+
needs: "test"
60+
timeout-minutes: 10
61+
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
try-scenario:
66+
- ember-lts-3.28
67+
- ember-lts-4.4
68+
- ember-lts-4.8
69+
- ember-lts-4.12
70+
- ember-lts-5.4
71+
- ember-release
72+
- ember-beta
73+
- ember-canary
74+
- embroider-safe
75+
- embroider-optimized
76+
77+
steps:
78+
- uses: actions/checkout@v4
79+
- uses: pnpm/action-setup@v4
80+
with:
81+
version: 10
82+
- name: Install Node
83+
uses: actions/setup-node@v4
84+
with:
85+
node-version: 18
86+
cache: pnpm
87+
- name: Install Dependencies
88+
run: pnpm install --frozen-lockfile
89+
- name: Run Tests
90+
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}

.gitignore

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
1-
# See https://help.github.com/ignore-files/ for more about ignoring files.
2-
31
# compiled output
42
/dist/
5-
/tmp/
3+
/declarations/
64

75
# dependencies
8-
/bower_components/
96
/node_modules/
107

118
# misc
129
/.env*
1310
/.pnp*
14-
/.sass-cache
15-
/connect.lock
11+
/.eslintcache
1612
/coverage/
17-
/*.log*
13+
/npm-debug.log*
14+
/testem.log
15+
/yarn-error.log
1816

1917
# ember-try
2018
/.node_modules.ember-try/
21-
/bower.json.ember-try
19+
/npm-shrinkwrap.json.ember-try
2220
/package.json.ember-try
21+
/package-lock.json.ember-try
22+
/yarn.lock.ember-try
23+
24+
# broccoli-debug
25+
/DEBUG/
2326

2427
# IDE
2528
/.idea/

.npmignore

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,36 @@
22
/dist/
33
/tmp/
44

5-
# dependencies
6-
/bower_components/
7-
85
# misc
9-
/.bowerrc
106
/.editorconfig
117
/.ember-cli
128
/.env*
9+
/.eslintcache
1310
/.eslintignore
1411
/.eslintrc.js
1512
/.git/
13+
/.github/
1614
/.gitignore
15+
/.prettierignore
16+
/.prettierrc.js
17+
/.stylelintignore
18+
/.stylelintrc.js
1719
/.template-lintrc.js
1820
/.travis.yml
1921
/.watchmanconfig
20-
/bower.json
21-
/config/ember-try.js
2222
/CONTRIBUTING.md
2323
/ember-cli-build.js
2424
/testem.js
2525
/tests/
26+
/tsconfig.declarations.json
27+
/tsconfig.json
28+
/yarn-error.log
2629
/yarn.lock
2730
.gitkeep
2831

2932
# ember-try
3033
/.node_modules.ember-try/
31-
/bower.json.ember-try
34+
/npm-shrinkwrap.json.ember-try
3235
/package.json.ember-try
36+
/package-lock.json.ember-try
37+
/yarn.lock.ember-try

.prettierignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# unconventional js
2+
/blueprints/*/files/
3+
4+
# compiled output
5+
/dist/
6+
7+
# misc
8+
/coverage/
9+
!.*
10+
.*/
11+
12+
# ember-try
13+
/.node_modules.ember-try/

.prettierrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'use strict';
2+
3+
module.exports = {
4+
overrides: [
5+
{
6+
files: '*.{js,ts}',
7+
options: {
8+
singleQuote: true,
9+
},
10+
},
11+
],
12+
};

.stylelintignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# unconventional files
2+
/blueprints/*/files/
3+
4+
# compiled output
5+
/dist/
6+
7+
# addons
8+
/.node_modules.ember-try/

0 commit comments

Comments
 (0)