ember-codemod-v1-to-v2 0.10.0 → 1.0.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/README.md +1 -1
- package/dist/src/blueprints/ember-addon/__testAppLocation__/ember-cli-build.js +4 -1
- package/dist/src/steps/update-addon-tsconfig-json.js +2 -0
- package/dist/src/steps/update-test-app-tsconfig-json.js +3 -3
- package/dist/src/utils/blueprints/get-version.js +9 -8
- package/package.json +20 -21
package/README.md
CHANGED
|
@@ -7,7 +7,10 @@ module.exports = function (defaults) {
|
|
|
7
7
|
// Add options here
|
|
8
8
|
autoImport: {
|
|
9
9
|
watchDependencies: ['<%= options.packages.addon.name %>'],
|
|
10
|
-
}
|
|
10
|
+
},<% if (options.packages.addon.hasTypeScript) { %>
|
|
11
|
+
'ember-cli-babel': {
|
|
12
|
+
enableTypeScriptTransform: true,
|
|
13
|
+
},<% } %>
|
|
11
14
|
});
|
|
12
15
|
|
|
13
16
|
const { maybeEmbroider } = require('@embroider/test-setup');
|
|
@@ -9,10 +9,12 @@ function updateCompilerOptions(tsConfigJson, options) {
|
|
|
9
9
|
compilerOptions.delete('paths');
|
|
10
10
|
if (packages.addon.hasGlint) {
|
|
11
11
|
compilerOptions.set('allowImportingTsExtensions', true);
|
|
12
|
+
compilerOptions.set('allowJs', true);
|
|
12
13
|
compilerOptions.set('declarationDir', 'declarations');
|
|
13
14
|
}
|
|
14
15
|
else {
|
|
15
16
|
compilerOptions.set('allowImportingTsExtensions', true);
|
|
17
|
+
compilerOptions.set('allowJs', true);
|
|
16
18
|
compilerOptions.set('declaration', true);
|
|
17
19
|
compilerOptions.set('declarationDir', 'declarations');
|
|
18
20
|
compilerOptions.set('emitDeclarationOnly', true);
|
|
@@ -12,8 +12,8 @@ function updateCompilerOptions(tsConfigJson, options) {
|
|
|
12
12
|
});
|
|
13
13
|
tsConfigJson['compilerOptions'] = convertToObject(compilerOptions);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
tsConfigJson['include']
|
|
15
|
+
function removeInclude(tsConfigJson) {
|
|
16
|
+
delete tsConfigJson['include'];
|
|
17
17
|
}
|
|
18
18
|
export function updateTestAppTsConfigJson(options) {
|
|
19
19
|
const { locations, packages, projectRoot } = options;
|
|
@@ -24,7 +24,7 @@ export function updateTestAppTsConfigJson(options) {
|
|
|
24
24
|
const oldFile = readFileSync(oldPath, 'utf8');
|
|
25
25
|
const tsConfigJson = JSON.parse(sanitizeJson(oldFile));
|
|
26
26
|
updateCompilerOptions(tsConfigJson, options);
|
|
27
|
-
|
|
27
|
+
removeInclude(tsConfigJson);
|
|
28
28
|
const newFile = JSON.stringify(tsConfigJson, null, 2) + '\n';
|
|
29
29
|
writeFileSync(oldPath, newFile, 'utf8');
|
|
30
30
|
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { decideVersion } from '@codemod-utils/blueprints';
|
|
2
2
|
const latestVersions = new Map([
|
|
3
|
-
['@babel/core', '7.22.
|
|
4
|
-
['@babel/plugin-proposal-decorators', '7.22.
|
|
3
|
+
['@babel/core', '7.22.17'],
|
|
4
|
+
['@babel/plugin-proposal-decorators', '7.22.15'],
|
|
5
5
|
['@babel/plugin-transform-class-properties', '7.22.5'],
|
|
6
|
-
['@babel/preset-typescript', '7.22.
|
|
7
|
-
['@babel/runtime', '7.22.
|
|
6
|
+
['@babel/preset-typescript', '7.22.15'],
|
|
7
|
+
['@babel/runtime', '7.22.15'],
|
|
8
8
|
['@embroider/addon-dev', '4.1.0'],
|
|
9
9
|
['@embroider/addon-shim', '1.8.6'],
|
|
10
|
+
['@embroider/test-setup', '3.0.1'],
|
|
10
11
|
['@rollup/plugin-babel', '6.0.3'],
|
|
11
|
-
['concurrently', '8.2.
|
|
12
|
+
['concurrently', '8.2.1'],
|
|
12
13
|
['ember-auto-import', '2.6.3'],
|
|
13
|
-
['ember-cli-babel', '
|
|
14
|
+
['ember-cli-babel', '8.0.0'],
|
|
14
15
|
['ember-cli-htmlbars', '6.3.0'],
|
|
15
|
-
['rollup', '3.
|
|
16
|
-
['rollup-plugin-copy', '3.
|
|
16
|
+
['rollup', '3.29.1'],
|
|
17
|
+
['rollup-plugin-copy', '3.5.0'],
|
|
17
18
|
]);
|
|
18
19
|
export function getVersion(packageName, options) {
|
|
19
20
|
const { packages } = options;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-codemod-v1-to-v2",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Codemod to convert Ember addons to v2 addon format",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codemod",
|
|
@@ -27,38 +27,37 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@codemod-utils/blueprints": "^0.
|
|
31
|
-
"@codemod-utils/files": "^0.
|
|
32
|
-
"@codemod-utils/json": "^0.
|
|
30
|
+
"@codemod-utils/blueprints": "^1.0.0",
|
|
31
|
+
"@codemod-utils/files": "^1.0.0",
|
|
32
|
+
"@codemod-utils/json": "^1.0.0",
|
|
33
33
|
"strip-json-comments": "^5.0.1",
|
|
34
34
|
"yargs": "^17.7.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@babel/core": "^7.22.
|
|
38
|
-
"@codemod-utils/tests": "^0.
|
|
39
|
-
"@sondr3/minitest": "^0.1.
|
|
40
|
-
"@tsconfig/
|
|
41
|
-
"@tsconfig/
|
|
42
|
-
"@
|
|
43
|
-
"@types/node": "^16.18.40",
|
|
37
|
+
"@babel/core": "^7.22.17",
|
|
38
|
+
"@codemod-utils/tests": "^1.0.0",
|
|
39
|
+
"@sondr3/minitest": "^0.1.2",
|
|
40
|
+
"@tsconfig/node18": "^18.2.2",
|
|
41
|
+
"@tsconfig/strictest": "^2.0.2",
|
|
42
|
+
"@types/node": "^18.17.15",
|
|
44
43
|
"@types/yargs": "^17.0.24",
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
46
|
-
"@typescript-eslint/parser": "^6.
|
|
47
|
-
"concurrently": "^8.2.
|
|
48
|
-
"eslint": "^8.
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
|
45
|
+
"@typescript-eslint/parser": "^6.7.0",
|
|
46
|
+
"concurrently": "^8.2.1",
|
|
47
|
+
"eslint": "^8.49.0",
|
|
49
48
|
"eslint-config-prettier": "^9.0.0",
|
|
50
49
|
"eslint-import-resolver-typescript": "^3.6.0",
|
|
51
|
-
"eslint-plugin-import": "^2.28.
|
|
52
|
-
"eslint-plugin-n": "^16.0
|
|
50
|
+
"eslint-plugin-import": "^2.28.1",
|
|
51
|
+
"eslint-plugin-n": "^16.1.0",
|
|
53
52
|
"eslint-plugin-prettier": "^5.0.0",
|
|
54
53
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
55
|
-
"eslint-plugin-typescript-sort-keys": "^
|
|
54
|
+
"eslint-plugin-typescript-sort-keys": "^3.0.0",
|
|
56
55
|
"lerna-changelog": "^2.2.0",
|
|
57
|
-
"prettier": "^3.0.
|
|
58
|
-
"typescript": "^5.
|
|
56
|
+
"prettier": "^3.0.3",
|
|
57
|
+
"typescript": "^5.2.2"
|
|
59
58
|
},
|
|
60
59
|
"engines": {
|
|
61
|
-
"node": "
|
|
60
|
+
"node": "18.* || >= 20"
|
|
62
61
|
},
|
|
63
62
|
"changelog": {
|
|
64
63
|
"labels": {
|