Skip to content

Commit 8211de9

Browse files
authored
Allow @ember/test-helpers v5.x and update ember-cli to 6.1 (#539)
* Update addon blueprint to 4 * Update docs to ember-cli v6.1.0 * Readd ember/test-helpers * Fix ts for addon * Fix lint in docs * Fix lint in test * Update dependencies * Fix github workflows * Readd @embroider/macros in test-app
1 parent f2a5a2a commit 8211de9

Some content is hidden

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

54 files changed

+11974
-9478
lines changed

.github/workflows/ci.yml

+4-16
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v4
22-
23-
- uses: pnpm/action-setup@v3
24-
with:
25-
version: 8
22+
- uses: pnpm/action-setup@v4
2623

2724
- uses: actions/setup-node@v4
2825
with:
@@ -45,10 +42,7 @@ jobs:
4542

4643
steps:
4744
- uses: actions/checkout@v4
48-
49-
- uses: pnpm/action-setup@v3
50-
with:
51-
version: 8
45+
- uses: pnpm/action-setup@v4
5246

5347
- name: Install Node
5448
uses: actions/setup-node@v4
@@ -72,10 +66,7 @@ jobs:
7266

7367
steps:
7468
- uses: actions/checkout@v4
75-
76-
- uses: pnpm/action-setup@v3
77-
with:
78-
version: 8
69+
- uses: pnpm/action-setup@v4
7970

8071
- uses: actions/setup-node@v4
8172
with:
@@ -117,10 +108,7 @@ jobs:
117108

118109
steps:
119110
- uses: actions/checkout@v4
120-
121-
- uses: pnpm/action-setup@v3
122-
with:
123-
version: 8
111+
- uses: pnpm/action-setup@v4
124112

125113
- name: Install Node
126114
uses: actions/setup-node@v4

.github/workflows/docs.yml

+3-12
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v4
22-
23-
- uses: pnpm/action-setup@v3
24-
with:
25-
version: 8
22+
- uses: pnpm/action-setup@v4
2623

2724
- uses: actions/setup-node@v4
2825
with:
@@ -45,10 +42,7 @@ jobs:
4542

4643
steps:
4744
- uses: actions/checkout@v4
48-
49-
- uses: pnpm/action-setup@v3
50-
with:
51-
version: 8
45+
- uses: pnpm/action-setup@v4
5246

5347
- name: Install Node
5448
uses: actions/setup-node@v4
@@ -73,10 +67,7 @@ jobs:
7367
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/master'))
7468
steps:
7569
- uses: actions/checkout@v4
76-
77-
- uses: pnpm/action-setup@v3
78-
with:
79-
version: 8
70+
- uses: pnpm/action-setup@v4
8071

8172
- name: Install Node
8273
uses: actions/setup-node@v4

.github/workflows/push-dist.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v4
22-
- uses: pnpm/action-setup@v3
23-
with:
24-
version: 8
22+
- uses: pnpm/action-setup@v4
23+
2524
- uses: actions/setup-node@v4
2625
with:
2726
node-version: 18

config/ember-cli-update.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"packages": [
55
{
66
"name": "@embroider/addon-blueprint",
7-
"version": "2.18.0",
7+
"version": "4.0.0",
88
"blueprints": [
99
{
1010
"name": "@embroider/addon-blueprint",

docs/.eslintignore

-14
This file was deleted.

docs/.eslintrc.js

-55
This file was deleted.

docs/.prettierrc.js

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

33
module.exports = {
4+
plugins: ['prettier-plugin-ember-template-tag'],
45
overrides: [
56
{
6-
files: '*.{js,ts}',
7+
files: '*.{js,gjs,ts,gts,mjs,mts,cjs,cts}',
78
options: {
89
singleQuote: true,
910
},
1011
},
12+
{
13+
files: '*.{gjs,gts}',
14+
options: {
15+
singleQuote: true,
16+
templateSingleQuote: false,
17+
},
18+
},
1119
],
1220
};

docs/app/app.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import loadInitializers from 'ember-load-initializers';
44
import config from 'docs/config/environment';
55
import { registerDateLibrary } from 'ember-power-calendar';
66
import DateUtils from 'ember-power-calendar-moment';
7-
// @ts-expect-error no types shipped from prismjs
87
import Prism from 'prismjs';
98
import 'prismjs/plugins/normalize-whitespace/prism-normalize-whitespace';
109
import 'prismjs/components/prism-css';
@@ -18,6 +17,7 @@ import { setup } from 'prismjs-glimmer';
1817

1918
import 'prismjs/themes/prism.css';
2019

20+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
2121
setup(Prism);
2222

2323
registerDateLibrary(DateUtils);

docs/app/components/code-inline.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import { modifier } from 'ember-modifier';
33
import { htmlSafe, type SafeString } from '@ember/template';
44
import { tracked } from '@glimmer/tracking';
55
import { assert } from '@ember/debug';
6-
7-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
8-
declare const Prism: any;
6+
import Prism from 'prismjs';
97

108
interface CodeInlineSignature {
119
Element: HTMLElement;
@@ -25,8 +23,9 @@ export default class CodeInline extends Component<CodeInlineSignature> {
2523
"ember-prism's <CodeBlock/> and <CodeInline/> components require a `code` parameter to be passed in.",
2624
code !== undefined,
2725
);
28-
if (Prism?.plugins?.NormalizeWhitespace) {
29-
return Prism.plugins.NormalizeWhitespace.normalize(code);
26+
if (Prism?.plugins['NormalizeWhitespace']) {
27+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
28+
return Prism.plugins['NormalizeWhitespace'].normalize(code) as string;
3029
}
3130

3231
return code;

docs/config/ember-cli-update.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"packages": [
44
{
55
"name": "ember-cli",
6-
"version": "5.12.0",
6+
"version": "6.1.0",
77
"blueprints": [
88
{
99
"name": "app",

docs/eslint.config.mjs

+148
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
/**
2+
* Debugging:
3+
* https://eslint.org/docs/latest/use/configure/debug
4+
* ----------------------------------------------------
5+
*
6+
* Print a file's calculated configuration
7+
*
8+
* npx eslint --print-config path/to/file.js
9+
*
10+
* Inspecting the config
11+
*
12+
* npx eslint --inspect-config
13+
*
14+
*/
15+
import globals from 'globals';
16+
import js from '@eslint/js';
17+
18+
import ts from 'typescript-eslint';
19+
20+
import ember from 'eslint-plugin-ember/recommended';
21+
22+
import prettier from 'eslint-plugin-prettier/recommended';
23+
import qunit from 'eslint-plugin-qunit';
24+
import n from 'eslint-plugin-n';
25+
26+
import babelParser from '@babel/eslint-parser';
27+
28+
const parserOptions = {
29+
esm: {
30+
js: {
31+
ecmaFeatures: { modules: true },
32+
ecmaVersion: 'latest',
33+
requireConfigFile: false,
34+
babelOptions: {
35+
plugins: [
36+
[
37+
'@babel/plugin-proposal-decorators',
38+
{ decoratorsBeforeExport: true },
39+
],
40+
],
41+
},
42+
},
43+
ts: {
44+
projectService: true,
45+
tsconfigRootDir: import.meta.dirname,
46+
},
47+
},
48+
};
49+
50+
export default ts.config(
51+
js.configs.recommended,
52+
ember.configs.base,
53+
ember.configs.gjs,
54+
ember.configs.gts,
55+
prettier,
56+
/**
57+
* Ignores must be in their own object
58+
* https://eslint.org/docs/latest/use/configure/ignore
59+
*/
60+
{
61+
ignores: ['dist/', 'node_modules/', 'coverage/', '!**/.*'],
62+
},
63+
/**
64+
* https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
65+
*/
66+
{
67+
linterOptions: {
68+
reportUnusedDisableDirectives: 'error',
69+
},
70+
},
71+
{
72+
files: ['**/*.js'],
73+
languageOptions: {
74+
parser: babelParser,
75+
},
76+
},
77+
{
78+
files: ['**/*.{js,gjs}'],
79+
languageOptions: {
80+
parserOptions: parserOptions.esm.js,
81+
globals: {
82+
...globals.browser,
83+
},
84+
},
85+
},
86+
{
87+
files: ['**/*.{ts,gts}'],
88+
languageOptions: {
89+
parser: ember.parser,
90+
parserOptions: parserOptions.esm.ts,
91+
},
92+
extends: [...ts.configs.recommendedTypeChecked, ember.configs.gts],
93+
rules: {
94+
'@typescript-eslint/no-unsafe-member-access': 'off',
95+
'@typescript-eslint/no-unsafe-assignment': 'off',
96+
},
97+
},
98+
{
99+
files: ['tests/**/*-test.{js,gjs,ts,gts}'],
100+
plugins: {
101+
qunit,
102+
},
103+
},
104+
/**
105+
* CJS node files
106+
*/
107+
{
108+
files: [
109+
'**/*.cjs',
110+
'config/**/*.js',
111+
'testem.js',
112+
'testem*.js',
113+
'.prettierrc.js',
114+
'.stylelintrc.js',
115+
'.template-lintrc.js',
116+
'ember-cli-build.js',
117+
],
118+
plugins: {
119+
n,
120+
},
121+
122+
languageOptions: {
123+
sourceType: 'script',
124+
ecmaVersion: 'latest',
125+
globals: {
126+
...globals.node,
127+
},
128+
},
129+
},
130+
/**
131+
* ESM node files
132+
*/
133+
{
134+
files: ['**/*.mjs'],
135+
plugins: {
136+
n,
137+
},
138+
139+
languageOptions: {
140+
sourceType: 'module',
141+
ecmaVersion: 'latest',
142+
parserOptions: parserOptions.esm.js,
143+
globals: {
144+
...globals.node,
145+
},
146+
},
147+
},
148+
);

0 commit comments

Comments
 (0)