ember-codemod-v1-to-v2 2.1.7 → 2.2.1
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/steps/analyze-addon.js +3 -2
- package/dist/src/steps/update-addon-package-json/update-dependencies.js +1 -1
- package/dist/src/steps/update-addon-package-json/update-dev-dependencies.js +1 -1
- package/dist/src/steps/update-addon-package-json.js +2 -1
- package/dist/src/steps/update-test-app-package-json/move-dev-dependencies-to-dependencies.js +1 -1
- package/dist/src/steps/update-test-app-package-json/update-dev-dependencies.js +1 -1
- package/dist/src/steps/update-test-app-package-json.js +2 -1
- package/package.json +13 -14
- package/dist/src/utils/json/sanitize-json.js +0 -6
- package/dist/src/utils/json.js +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { relative, sep } from 'node:path';
|
|
1
2
|
import { findFiles } from '@codemod-utils/files';
|
|
2
3
|
import { getVersion } from '../utils/blueprints.js';
|
|
3
4
|
function getProjectRootDevDependencies(options) {
|
|
@@ -11,8 +12,8 @@ function getPublicAssets(options) {
|
|
|
11
12
|
projectRoot,
|
|
12
13
|
});
|
|
13
14
|
return filePaths.reduce((accumulator, filePath) => {
|
|
14
|
-
const from = `./${filePath}`;
|
|
15
|
-
const to = `/${packages.addon.name}/${filePath.
|
|
15
|
+
const from = `./${filePath.replaceAll(sep, '/')}`;
|
|
16
|
+
const to = `/${packages.addon.name}/${relative('public', filePath).replaceAll(sep, '/')}`;
|
|
16
17
|
accumulator[from] = to;
|
|
17
18
|
return accumulator;
|
|
18
19
|
}, {});
|
|
@@ -11,7 +11,7 @@ export function updateDependencies(packageJson, options) {
|
|
|
11
11
|
if (options.packages.addon.hasTypeScript) {
|
|
12
12
|
packagesToDelete.add('ember-cli-typescript');
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
packagesToDelete.forEach((packageName) => {
|
|
15
15
|
dependencies.delete(packageName);
|
|
16
16
|
});
|
|
17
17
|
const packagesToInstall = ['@embroider/addon-shim', 'decorator-transforms'];
|
|
@@ -36,7 +36,7 @@ export function updateDevDependencies(packageJson, options) {
|
|
|
36
36
|
packagesToInstall.add('@glint/environment-ember-template-imports');
|
|
37
37
|
packagesToInstall.add('@glint/template');
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
packagesToInstall.forEach((packageName) => {
|
|
40
40
|
const version = getLatestVersion(packageName);
|
|
41
41
|
devDependencies.set(packageName, version);
|
|
42
42
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { writeFileSync } from 'node:fs';
|
|
2
|
+
import { EOL } from 'node:os';
|
|
2
3
|
import { join } from 'node:path';
|
|
3
4
|
import { readPackageJson } from '@codemod-utils/package-json';
|
|
4
5
|
import { updateDependencies, updateDevDependencies, updateOtherFields, updateScripts, } from './update-addon-package-json/index.js';
|
|
@@ -12,6 +13,6 @@ export function updateAddonPackageJson(context, options) {
|
|
|
12
13
|
updateScripts(packageJson, options);
|
|
13
14
|
updateOtherFields(packageJson, context, options);
|
|
14
15
|
const destination = join(projectRoot, locations.addon, 'package.json');
|
|
15
|
-
const file = JSON.stringify(packageJson, null, 2)
|
|
16
|
+
const file = JSON.stringify(packageJson, null, 2).replaceAll('\n', EOL) + EOL;
|
|
16
17
|
writeFileSync(destination, file, 'utf8');
|
|
17
18
|
}
|
package/dist/src/steps/update-test-app-package-json/move-dev-dependencies-to-dependencies.js
CHANGED
|
@@ -12,7 +12,7 @@ export function moveDependenciesToDevDependencies(packageJson, options) {
|
|
|
12
12
|
if (packages.addon.hasTypeScript) {
|
|
13
13
|
packagesToMove.add('ember-cli-typescript');
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
packagesToMove.forEach((packageName) => {
|
|
16
16
|
if (!dependencies.has(packageName)) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
@@ -29,7 +29,7 @@ export function updateDevDependencies(packageJson, options) {
|
|
|
29
29
|
packagesToInstall.add('@glint/environment-ember-template-imports');
|
|
30
30
|
packagesToInstall.add('@glint/template');
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
packagesToInstall.forEach((packageName) => {
|
|
33
33
|
const version = getLatestVersion(packageName);
|
|
34
34
|
devDependencies.set(packageName, version);
|
|
35
35
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { writeFileSync } from 'node:fs';
|
|
2
|
+
import { EOL } from 'node:os';
|
|
2
3
|
import { join } from 'node:path';
|
|
3
4
|
import { readPackageJson } from '@codemod-utils/package-json';
|
|
4
5
|
import { moveDependenciesToDevDependencies, updateDependencies, updateDevDependencies, updateOtherFields, updateScripts, } from './update-test-app-package-json/index.js';
|
|
@@ -13,6 +14,6 @@ export function updateTestAppPackageJson(options) {
|
|
|
13
14
|
updateScripts(packageJson, options);
|
|
14
15
|
updateOtherFields(packageJson, options);
|
|
15
16
|
const destination = join(projectRoot, locations.testApp, 'package.json');
|
|
16
|
-
const file = JSON.stringify(packageJson, null, 2)
|
|
17
|
+
const file = JSON.stringify(packageJson, null, 2).replaceAll('\n', EOL) + EOL;
|
|
17
18
|
writeFileSync(destination, file, 'utf8');
|
|
18
19
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-codemod-v1-to-v2",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Codemod to convert Ember addons to v2 addon format",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codemod",
|
|
@@ -27,33 +27,32 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@codemod-utils/blueprints": "^2.0
|
|
31
|
-
"@codemod-utils/files": "^3.
|
|
32
|
-
"@codemod-utils/package-json": "^3.
|
|
33
|
-
"strip-json-comments": "^5.0.3",
|
|
30
|
+
"@codemod-utils/blueprints": "^2.1.0",
|
|
31
|
+
"@codemod-utils/files": "^3.2.1",
|
|
32
|
+
"@codemod-utils/package-json": "^3.3.1",
|
|
34
33
|
"yargs": "^18.0.0"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
|
-
"@changesets/cli": "^2.29.
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"@ijlee2-frontend-configs/eslint-config-node": "^2.
|
|
41
|
-
"@ijlee2-frontend-configs/prettier": "^2.
|
|
36
|
+
"@changesets/cli": "^2.29.8",
|
|
37
|
+
"@codemod-utils/tests": "^2.2.0",
|
|
38
|
+
"@ijlee2-frontend-configs/changesets": "^1.0.0",
|
|
39
|
+
"@ijlee2-frontend-configs/eslint-config-node": "^2.3.1",
|
|
40
|
+
"@ijlee2-frontend-configs/prettier": "^2.3.1",
|
|
42
41
|
"@sondr3/minitest": "^0.1.2",
|
|
43
42
|
"@tsconfig/node20": "^20.1.8",
|
|
44
43
|
"@tsconfig/strictest": "^2.0.8",
|
|
45
|
-
"@types/node": "^20.19.
|
|
44
|
+
"@types/node": "^20.19.26",
|
|
46
45
|
"@types/yargs": "^17.0.35",
|
|
47
46
|
"concurrently": "^9.2.1",
|
|
48
47
|
"eslint": "^9.39.1",
|
|
49
|
-
"prettier": "^3.
|
|
48
|
+
"prettier": "^3.7.4",
|
|
50
49
|
"typescript": "^5.9.3"
|
|
51
50
|
},
|
|
52
51
|
"engines": {
|
|
53
52
|
"node": "20.* || >= 22"
|
|
54
53
|
},
|
|
55
54
|
"scripts": {
|
|
56
|
-
"build": "
|
|
55
|
+
"build": "sh build.sh --production",
|
|
57
56
|
"format": "prettier . --cache --write",
|
|
58
57
|
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"",
|
|
59
58
|
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" && pnpm format",
|
|
@@ -63,6 +62,6 @@
|
|
|
63
62
|
"lint:types": "tsc --noEmit",
|
|
64
63
|
"release:prepare": "changeset version",
|
|
65
64
|
"release:publish": "pnpm build && changeset publish",
|
|
66
|
-
"test": "
|
|
65
|
+
"test": "sh build.sh --test && mt dist-for-testing --quiet"
|
|
67
66
|
}
|
|
68
67
|
}
|
package/dist/src/utils/json.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './json/sanitize-json.js';
|