Skip to content

Commit 69e8694

Browse files
authored
Downstreamed @embroider/[email protected] (#94)
* chore: Removed single quotes to support Windows * chore: Allowed Rollup to generate declaration files * chore: Simplified types/global.d.ts for test-app * chore: Updated latestVersions * chore: Updated fixtures --------- Co-authored-by: ijlee2 <[email protected]>
1 parent df153c3 commit 69e8694

File tree

93 files changed

+434
-480
lines changed

Some content is hidden

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

93 files changed

+434
-480
lines changed

src/blueprints/ember-addon/__addonLocation__/rollup.config.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export default {
3030
'helpers/**/*.js',
3131
'modifiers/**/*.js',
3232
'services/**/*.js',
33+
'utils/**/*.js',
3334
]),
3435

3536
// Follow the V2 Addon rules about dependencies. Your code can import from
@@ -52,7 +53,10 @@ export default {
5253
addon.hbs(),
5354

5455
// Ensure that .gjs files are properly integrated as Javascript
55-
addon.gjs(),
56+
addon.gjs(),<% if (options.packages.addon.hasTypeScript) { %>
57+
58+
// Emit .d.ts declaration files
59+
addon.declarations('declarations'),<% } %>
5660

5761
// addons are allowed to contain imports of .css files, which we want rollup
5862
// to leave alone and keep in the published output.

src/blueprints/ember-addon/__addonLocation__/tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
"emitDeclarationOnly": true,
88
"noEmit": false,
99
"noEmitOnError": false,
10-
"rootDir": "./src"
10+
"rootDir": "./src",
11+
"types": [
12+
"ember-source/types"
13+
]
1114
},
1215
"include": [
1316
"src/**/*",

src/blueprints/ember-addon/__addonLocation__/unpublished-development-types/index.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<% if (options.packages.addon.hasGlint) { %>
44
import '@glint/environment-ember-loose';
55
import '@glint/environment-ember-template-imports';
6-
import 'ember-source/types';
76

87
// Uncomment if you need to support consuming projects in loose mode
98
//
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// Types for compiled templates
2-
declare module '<%= options.packages.testApp.name %>/templates/*' {
3-
import { TemplateFactory } from 'ember-cli-htmlbars';
4-
5-
const tmpl: TemplateFactory;
6-
export default tmpl;
7-
}
1+
<% if (options.packages.addon.hasGlint) { %>import '@glint/environment-ember-loose';
2+
import '@glint/environment-ember-template-imports';
3+
<% } %>

src/blueprints/ember-addon/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"lint": "npm run lint --workspaces --if-present",
1515
"lint:fix": "npm run lint:fix --workspaces --if-present",
1616
"prepare": "npm run build",
17-
"start": "concurrently 'npm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
17+
"start": "concurrently \"npm:start:*\" --restart-after 5000 --prefix-colors cyan,white,yellow",
1818
"start:addon": "npm start --workspace <%= options.packages.addon.name %>",
1919
"start:test-app": "npm start --workspace <%= options.packages.testApp.name %>",
2020
"test": "npm run test --workspaces --if-present"
@@ -31,13 +31,13 @@
3131
"author": "",
3232
"scripts": {
3333
"build": "pnpm --filter <%= options.packages.addon.name %> build",
34-
"lint": "pnpm --filter '*' lint",
35-
"lint:fix": "pnpm --filter '*' lint:fix",
34+
"lint": "pnpm --filter \"*\" lint",
35+
"lint:fix": "pnpm --filter \"*\" lint:fix",
3636
"prepare": "pnpm build",
37-
"start": "concurrently 'pnpm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
37+
"start": "concurrently \"pnpm:start:*\" --restart-after 5000 --prefix-colors cyan,white,yellow",
3838
"start:addon": "pnpm --filter <%= options.packages.addon.name %> start",
3939
"start:test-app": "pnpm --filter <%= options.packages.testApp.name %> start",
40-
"test": "pnpm --filter '*' test"
40+
"test": "pnpm --filter \"*\" test"
4141
},
4242
"devDependencies": {
4343
"concurrently": "<%= context.projectRoot.devDependencies['concurrently'] %>"
@@ -58,7 +58,7 @@
5858
"lint": "yarn workspaces run lint",
5959
"lint:fix": "yarn workspaces run lint:fix",
6060
"prepare": "yarn build",
61-
"start": "concurrently 'yarn:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
61+
"start": "concurrently \"yarn:start:*\" --restart-after 5000 --prefix-colors cyan,white,yellow",
6262
"start:addon": "yarn workspace <%= options.packages.addon.name %> run start",
6363
"start:test-app": "yarn workspace <%= options.packages.testApp.name %> run start",
6464
"test": "yarn workspaces run test"

src/steps/update-addon-package-json/update-scripts.ts

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ export function updateScripts(
1616
*/
1717
scripts.clear();
1818

19+
scripts.set('build', 'rollup --config');
1920
scripts.set(
2021
'lint',
21-
`concurrently '${packageManager}:lint:*(!fix)' --names 'lint:'`,
22+
// eslint-disable-next-line no-useless-escape
23+
`concurrently \"${packageManager}:lint:*(!fix)\" --names \"lint:\"`,
2224
);
2325
scripts.set(
2426
'lint:fix',
25-
`concurrently '${packageManager}:lint:*:fix' --names 'fix:'`,
27+
// eslint-disable-next-line no-useless-escape
28+
`concurrently \"${packageManager}:lint:*:fix\" --names \"fix:\"`,
2629
);
2730
scripts.set(
2831
'lint:hbs',
@@ -34,32 +37,22 @@ export function updateScripts(
3437
);
3538
scripts.set('lint:js', 'eslint . --cache');
3639
scripts.set('lint:js:fix', 'eslint . --fix');
40+
scripts.set('prepack', 'rollup --config');
41+
scripts.set('start', 'rollup --config --watch');
3742
scripts.set(
3843
'test',
39-
`echo 'A v2 addon does not have tests, run tests in ${locations.testApp}'`,
44+
// eslint-disable-next-line no-useless-escape
45+
`echo \"A v2 addon does not have tests, run tests in ${locations.testApp}\"`,
4046
);
4147

4248
if (packages.addon.hasTypeScript) {
43-
scripts.set('build', `concurrently '${packageManager}:build:*'`);
44-
scripts.set('build:js', 'rollup --config');
4549
scripts.delete('postpack');
46-
scripts.set('prepack', `concurrently '${packageManager}:build:*'`);
47-
scripts.set('start', `concurrently '${packageManager}:start:*'`);
48-
scripts.set('start:js', 'rollup --config --watch --no-watch.clearScreen');
4950

5051
if (packages.addon.hasGlint) {
51-
scripts.set('build:types', 'glint --declaration');
5252
scripts.set('lint:types', 'glint');
53-
scripts.set('start:types', 'glint --declaration --watch');
5453
} else {
55-
scripts.set('build:types', 'tsc');
5654
scripts.set('lint:types', 'tsc --emitDeclarationOnly false --noEmit');
57-
scripts.set('start:types', 'tsc --watch');
5855
}
59-
} else {
60-
scripts.set('build', 'rollup --config');
61-
scripts.set('prepack', 'rollup --config');
62-
scripts.set('start', 'rollup --config --watch');
6356
}
6457

6558
packageJson['scripts'] = convertToObject(scripts);

src/utils/blueprints/get-version.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,38 @@ import type { Options } from '../../types/index.js';
44

55
const latestVersions = new Map([
66
['@babel/core', '7.26.0'],
7-
['@babel/eslint-parser', '7.25.9'],
8-
['@babel/plugin-transform-typescript', '7.26.3'],
7+
['@babel/eslint-parser', '7.26.5'],
8+
['@babel/plugin-transform-typescript', '7.26.5'],
99
['@babel/runtime', '7.26.0'],
1010
['@embroider/addon-dev', '7.1.1'],
1111
['@embroider/addon-shim', '1.9.0'],
1212
['@embroider/test-setup', '4.0.0'],
13-
['@glint/core', '1.5.0'],
14-
['@glint/environment-ember-loose', '1.5.0'],
15-
['@glint/environment-ember-template-imports', '1.5.0'],
16-
['@glint/template', '1.5.0'],
13+
['@glint/core', '1.5.1'],
14+
['@glint/environment-ember-loose', '1.5.1'],
15+
['@glint/environment-ember-template-imports', '1.5.1'],
16+
['@glint/template', '1.5.1'],
1717
['@rollup/plugin-babel', '6.0.4'],
1818
['@tsconfig/ember', '3.0.8'],
19-
['@typescript-eslint/eslint-plugin', '8.18.2'],
20-
['@typescript-eslint/parser', '8.18.2'],
19+
['@typescript-eslint/eslint-plugin', '8.20.0'],
20+
['@typescript-eslint/parser', '8.20.0'],
2121
['babel-plugin-ember-template-compilation', '2.3.0'],
22-
['concurrently', '9.1.0'],
22+
['concurrently', '9.1.2'],
2323
['decorator-transforms', '2.3.0'],
2424
['ember-auto-import', '2.10.0'],
2525
['ember-cli-babel', '8.2.0'],
2626
['ember-cli-htmlbars', '6.3.0'],
2727
['ember-source', '6.1.0'],
2828
['ember-template-lint', '6.0.0'],
2929
['eslint', '8.57.1'],
30-
['eslint-config-prettier', '9.1.0'],
30+
['eslint-config-prettier', '10.0.1'],
3131
['eslint-plugin-ember', '12.3.3'],
3232
['eslint-plugin-import', '2.31.0'],
3333
['eslint-plugin-n', '17.15.1'],
34-
['eslint-plugin-prettier', '5.2.1'],
34+
['eslint-plugin-prettier', '5.2.2'],
3535
['prettier', '3.4.2'],
36-
['rollup', '4.29.1'],
36+
['rollup', '4.30.1'],
3737
['rollup-plugin-copy', '3.5.0'],
38-
['typescript', '5.7.2'],
38+
['typescript', '5.7.3'],
3939
]);
4040

4141
export function getLatestVersion(packageName: string): string {
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
1-
// Types for compiled templates
2-
declare module 'demo-app-for-ember-container-query/templates/*' {
3-
import { TemplateFactory } from 'ember-cli-htmlbars';
4-
5-
const tmpl: TemplateFactory;
6-
export default tmpl;
7-
}
1+
import '@glint/environment-ember-loose';
2+
import '@glint/environment-ember-template-imports';

tests/fixtures/ember-container-query-customizations/output/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"lint": "yarn workspaces run lint",
1515
"lint:fix": "yarn workspaces run lint:fix",
1616
"prepare": "yarn build",
17-
"start": "concurrently 'yarn:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
17+
"start": "concurrently \"yarn:start:*\" --restart-after 5000 --prefix-colors cyan,white,yellow",
1818
"start:addon": "yarn workspace ember-container-query run start",
1919
"start:test-app": "yarn workspace demo-app-for-ember-container-query run start",
2020
"test": "yarn workspaces run test"

tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/package.json

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,17 @@
2424
"test": "tests"
2525
},
2626
"scripts": {
27-
"build": "concurrently 'yarn:build:*'",
28-
"build:js": "rollup --config",
29-
"build:types": "glint --declaration",
30-
"lint": "concurrently 'yarn:lint:*(!fix)' --names 'lint:'",
31-
"lint:fix": "concurrently 'yarn:lint:*:fix' --names 'fix:'",
27+
"build": "rollup --config",
28+
"lint": "concurrently \"yarn:lint:*(!fix)\" --names \"lint:\"",
29+
"lint:fix": "concurrently \"yarn:lint:*:fix\" --names \"fix:\"",
3230
"lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
3331
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
3432
"lint:js": "eslint . --cache",
3533
"lint:js:fix": "eslint . --fix",
3634
"lint:types": "glint",
37-
"prepack": "concurrently 'yarn:build:*'",
38-
"start": "concurrently 'yarn:start:*'",
39-
"start:js": "rollup --config --watch --no-watch.clearScreen",
40-
"start:types": "glint --declaration --watch",
41-
"test": "echo 'A v2 addon does not have tests, run tests in demo-app'"
35+
"prepack": "rollup --config",
36+
"start": "rollup --config --watch",
37+
"test": "echo \"A v2 addon does not have tests, run tests in demo-app\""
4238
},
4339
"changelog": {
4440
"labels": {
@@ -60,31 +56,31 @@
6056
},
6157
"devDependencies": {
6258
"@babel/core": "^7.26.0",
63-
"@babel/plugin-transform-typescript": "^7.26.3",
59+
"@babel/plugin-transform-typescript": "^7.26.5",
6460
"@babel/runtime": "^7.26.0",
6561
"@embroider/addon-dev": "^7.1.1",
66-
"@glint/core": "^1.5.0",
67-
"@glint/environment-ember-loose": "^1.5.0",
68-
"@glint/environment-ember-template-imports": "^1.5.0",
69-
"@glint/template": "^1.5.0",
62+
"@glint/core": "^1.5.1",
63+
"@glint/environment-ember-loose": "^1.5.1",
64+
"@glint/environment-ember-template-imports": "^1.5.1",
65+
"@glint/template": "^1.5.1",
7066
"@rollup/plugin-babel": "^6.0.4",
7167
"@tsconfig/ember": "^3.0.8",
72-
"@typescript-eslint/eslint-plugin": "^8.18.2",
73-
"@typescript-eslint/parser": "^8.18.2",
68+
"@typescript-eslint/eslint-plugin": "^8.20.0",
69+
"@typescript-eslint/parser": "^8.20.0",
7470
"babel-plugin-ember-template-compilation": "^2.3.0",
75-
"concurrently": "^9.1.0",
71+
"concurrently": "^9.1.2",
7672
"ember-source": "^6.1.0",
7773
"ember-template-lint": "^6.0.0",
7874
"eslint": "^8.57.1",
79-
"eslint-config-prettier": "^9.1.0",
75+
"eslint-config-prettier": "^10.0.1",
8076
"eslint-plugin-ember": "^12.3.3",
8177
"eslint-plugin-import": "^2.31.0",
8278
"eslint-plugin-n": "^17.15.1",
83-
"eslint-plugin-prettier": "^5.2.1",
79+
"eslint-plugin-prettier": "^5.2.2",
8480
"prettier": "^3.4.2",
85-
"rollup": "^4.29.1",
81+
"rollup": "^4.30.1",
8682
"rollup-plugin-copy": "^3.5.0",
87-
"typescript": "^5.7.2"
83+
"typescript": "^5.7.3"
8884
},
8985
"engines": {
9086
"node": "14.* || 16.* || >= 18"

0 commit comments

Comments
 (0)