ember-codemod-v1-to-v2 1.4.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/blueprints/ember-addon/__addonLocation__/rollup.config.mjs +1 -1
- package/dist/src/blueprints/ember-addon/__addonLocation__/tsconfig.json +2 -1
- package/dist/src/blueprints/ember-addon/__addonLocation__/unpublished-development-types/index.d.ts +10 -8
- package/dist/src/steps/move-addon-files.js +10 -1
- package/dist/src/steps/update-addon-package-json/update-dev-dependencies.js +2 -3
- package/dist/src/utils/blueprints/get-version.js +25 -26
- package/package.json +17 -17
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
// up your addon's public API. Also make sure your package.json#exports
|
|
21
21
|
// is aligned to the config here.
|
|
22
22
|
// See https://github.com/embroider-build/embroider/blob/main/docs/v2-faq.md#how-can-i-define-the-public-exports-of-my-addon
|
|
23
|
-
addon.publicEntrypoints(['**/*.js', 'index.
|
|
23
|
+
<% if (options.packages.addon.hasTypeScript) { %>addon.publicEntrypoints(['**/*.js', 'index.ts'<% if (options.packages.addon.hasGlint) {%>, 'template-registry.ts'<% } %>]),<% } else { %>addon.publicEntrypoints(['**/*.js', 'index.js']),<% } %>
|
|
24
24
|
|
|
25
25
|
// These are the modules that should get reexported into the traditional
|
|
26
26
|
// "app" tree. Things in here should also be in publicEntrypoints above, but
|
package/dist/src/blueprints/ember-addon/__addonLocation__/unpublished-development-types/index.d.ts
CHANGED
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
// These will *not* be published as part of your addon, so be careful that your published code does not rely on them!
|
|
3
3
|
<% if (options.packages.addon.hasGlint) { %>
|
|
4
4
|
import '@glint/environment-ember-loose';
|
|
5
|
+
import '@glint/environment-ember-template-imports';
|
|
6
|
+
import 'ember-source/types';
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
8
|
+
// Uncomment if you need to support consuming projects in loose mode
|
|
9
|
+
//
|
|
10
|
+
// declare module '@glint/environment-ember-loose/registry' {
|
|
11
|
+
// export default interface Registry {
|
|
12
|
+
// // Add any registry entries from other addons here that your addon itself uses (in non-strict mode templates)
|
|
13
|
+
// // See https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons
|
|
14
|
+
// }
|
|
15
|
+
// }
|
|
14
16
|
<% } %>
|
|
@@ -12,7 +12,16 @@ function moveAddonFolder(options) {
|
|
|
12
12
|
}
|
|
13
13
|
function moveAddonTestSupportFolder(options) {
|
|
14
14
|
const { locations, projectRoot } = options;
|
|
15
|
-
|
|
15
|
+
let filePaths = findFiles('addon-test-support/index.{js,ts}', {
|
|
16
|
+
projectRoot,
|
|
17
|
+
});
|
|
18
|
+
if (filePaths.length === 1) {
|
|
19
|
+
const oldPath = filePaths[0];
|
|
20
|
+
const newPath = `${locations.addon}/src/test-support${oldPath.endsWith('.ts') ? '.ts' : 'js'}`;
|
|
21
|
+
moveFiles(new Map([[oldPath, newPath]]), options);
|
|
22
|
+
}
|
|
23
|
+
filePaths = findFiles('addon-test-support/**/*', {
|
|
24
|
+
ignoreList: ['addon-test-support/index.{js,ts}'],
|
|
16
25
|
projectRoot,
|
|
17
26
|
});
|
|
18
27
|
const filePathMap = mapFilePaths(filePaths, {
|
|
@@ -31,9 +31,6 @@ export function updateDevDependencies(packageJson, options) {
|
|
|
31
31
|
packagesToInstall.delete('@babel/eslint-parser');
|
|
32
32
|
packagesToInstall.add('@babel/plugin-transform-typescript');
|
|
33
33
|
packagesToInstall.add('@tsconfig/ember');
|
|
34
|
-
packagesToInstall.add('@types/ember__component');
|
|
35
|
-
packagesToInstall.add('@types/ember__object');
|
|
36
|
-
packagesToInstall.add('@types/ember__service');
|
|
37
34
|
packagesToInstall.add('@typescript-eslint/eslint-plugin');
|
|
38
35
|
packagesToInstall.add('@typescript-eslint/parser');
|
|
39
36
|
packagesToInstall.add('typescript');
|
|
@@ -41,7 +38,9 @@ export function updateDevDependencies(packageJson, options) {
|
|
|
41
38
|
if (packages.addon.hasGlint) {
|
|
42
39
|
packagesToInstall.add('@glint/core');
|
|
43
40
|
packagesToInstall.add('@glint/environment-ember-loose');
|
|
41
|
+
packagesToInstall.add('@glint/environment-ember-template-imports');
|
|
44
42
|
packagesToInstall.add('@glint/template');
|
|
43
|
+
packagesToInstall.add('ember-source');
|
|
45
44
|
}
|
|
46
45
|
Array.from(packagesToInstall).forEach((packageName) => {
|
|
47
46
|
const version = getLatestVersion(packageName);
|
|
@@ -1,39 +1,38 @@
|
|
|
1
1
|
import { decideVersion } from '@codemod-utils/blueprints';
|
|
2
2
|
const latestVersions = new Map([
|
|
3
|
-
['@babel/core', '7.
|
|
4
|
-
['@babel/eslint-parser', '7.25.
|
|
5
|
-
['@babel/plugin-transform-typescript', '7.
|
|
6
|
-
['@babel/runtime', '7.
|
|
7
|
-
['@embroider/addon-dev', '
|
|
8
|
-
['@embroider/addon-shim', '1.
|
|
3
|
+
['@babel/core', '7.26.0'],
|
|
4
|
+
['@babel/eslint-parser', '7.25.9'],
|
|
5
|
+
['@babel/plugin-transform-typescript', '7.26.3'],
|
|
6
|
+
['@babel/runtime', '7.26.0'],
|
|
7
|
+
['@embroider/addon-dev', '7.1.1'],
|
|
8
|
+
['@embroider/addon-shim', '1.9.0'],
|
|
9
9
|
['@embroider/test-setup', '4.0.0'],
|
|
10
|
-
['@glint/core', '1.
|
|
11
|
-
['@glint/environment-ember-loose', '1.
|
|
12
|
-
['@glint/template', '1.
|
|
10
|
+
['@glint/core', '1.5.0'],
|
|
11
|
+
['@glint/environment-ember-loose', '1.5.0'],
|
|
12
|
+
['@glint/environment-ember-template-imports', '1.5.0'],
|
|
13
|
+
['@glint/template', '1.5.0'],
|
|
13
14
|
['@rollup/plugin-babel', '6.0.4'],
|
|
14
15
|
['@tsconfig/ember', '3.0.8'],
|
|
15
|
-
['@
|
|
16
|
-
['@
|
|
17
|
-
['
|
|
18
|
-
['
|
|
19
|
-
['
|
|
20
|
-
['
|
|
21
|
-
['
|
|
22
|
-
['decorator-transforms', '2.0.0'],
|
|
23
|
-
['ember-auto-import', '2.7.4'],
|
|
24
|
-
['ember-cli-babel', '8.1.0'],
|
|
16
|
+
['@typescript-eslint/eslint-plugin', '8.18.2'],
|
|
17
|
+
['@typescript-eslint/parser', '8.18.2'],
|
|
18
|
+
['babel-plugin-ember-template-compilation', '2.3.0'],
|
|
19
|
+
['concurrently', '9.1.0'],
|
|
20
|
+
['decorator-transforms', '2.3.0'],
|
|
21
|
+
['ember-auto-import', '2.10.0'],
|
|
22
|
+
['ember-cli-babel', '8.2.0'],
|
|
25
23
|
['ember-cli-htmlbars', '6.3.0'],
|
|
24
|
+
['ember-source', '6.1.0'],
|
|
26
25
|
['ember-template-lint', '6.0.0'],
|
|
27
|
-
['eslint', '8.57.
|
|
26
|
+
['eslint', '8.57.1'],
|
|
28
27
|
['eslint-config-prettier', '9.1.0'],
|
|
29
|
-
['eslint-plugin-ember', '12.
|
|
30
|
-
['eslint-plugin-import', '2.
|
|
31
|
-
['eslint-plugin-n', '17.
|
|
28
|
+
['eslint-plugin-ember', '12.3.3'],
|
|
29
|
+
['eslint-plugin-import', '2.31.0'],
|
|
30
|
+
['eslint-plugin-n', '17.15.1'],
|
|
32
31
|
['eslint-plugin-prettier', '5.2.1'],
|
|
33
|
-
['prettier', '3.
|
|
34
|
-
['rollup', '4.
|
|
32
|
+
['prettier', '3.4.2'],
|
|
33
|
+
['rollup', '4.29.1'],
|
|
35
34
|
['rollup-plugin-copy', '3.5.0'],
|
|
36
|
-
['typescript', '5.
|
|
35
|
+
['typescript', '5.7.2'],
|
|
37
36
|
]);
|
|
38
37
|
export function getLatestVersion(packageName) {
|
|
39
38
|
if (!latestVersions.has(packageName)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-codemod-v1-to-v2",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Codemod to convert Ember addons to v2 addon format",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codemod",
|
|
@@ -27,34 +27,34 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@codemod-utils/blueprints": "^1.1.
|
|
31
|
-
"@codemod-utils/files": "^2.0.
|
|
32
|
-
"@codemod-utils/json": "^1.1.
|
|
30
|
+
"@codemod-utils/blueprints": "^1.1.6",
|
|
31
|
+
"@codemod-utils/files": "^2.0.5",
|
|
32
|
+
"@codemod-utils/json": "^1.1.10",
|
|
33
33
|
"strip-json-comments": "^5.0.1",
|
|
34
34
|
"yargs": "^17.7.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@babel/core": "^7.
|
|
38
|
-
"@codemod-utils/tests": "^1.1.
|
|
37
|
+
"@babel/core": "^7.26.0",
|
|
38
|
+
"@codemod-utils/tests": "^1.1.8",
|
|
39
39
|
"@sondr3/minitest": "^0.1.2",
|
|
40
40
|
"@tsconfig/node18": "^18.2.4",
|
|
41
41
|
"@tsconfig/strictest": "^2.0.5",
|
|
42
|
-
"@types/node": "^18.19.
|
|
42
|
+
"@types/node": "^18.19.68",
|
|
43
43
|
"@types/yargs": "^17.0.33",
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
45
|
-
"@typescript-eslint/parser": "^8.
|
|
46
|
-
"concurrently": "^
|
|
47
|
-
"eslint": "^8.57.
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "^8.18.2",
|
|
45
|
+
"@typescript-eslint/parser": "^8.18.2",
|
|
46
|
+
"concurrently": "^9.1.0",
|
|
47
|
+
"eslint": "^8.57.1",
|
|
48
48
|
"eslint-config-prettier": "^9.1.0",
|
|
49
|
-
"eslint-import-resolver-typescript": "^3.
|
|
50
|
-
"eslint-plugin-import": "^2.
|
|
51
|
-
"eslint-plugin-n": "^17.
|
|
49
|
+
"eslint-import-resolver-typescript": "^3.7.0",
|
|
50
|
+
"eslint-plugin-import": "^2.31.0",
|
|
51
|
+
"eslint-plugin-n": "^17.15.1",
|
|
52
52
|
"eslint-plugin-prettier": "^5.2.1",
|
|
53
53
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
54
|
-
"eslint-plugin-typescript-sort-keys": "^3.
|
|
54
|
+
"eslint-plugin-typescript-sort-keys": "^3.3.0",
|
|
55
55
|
"lerna-changelog": "^2.2.0",
|
|
56
|
-
"prettier": "^3.
|
|
57
|
-
"typescript": "^5.
|
|
56
|
+
"prettier": "^3.4.2",
|
|
57
|
+
"typescript": "^5.7.2"
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|
|
60
60
|
"node": "18.* || >= 20"
|