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 CHANGED
@@ -121,7 +121,7 @@ You can also look at another codemod called [`ember-addon-migrator`](https://git
121
121
 
122
122
  ## Compatibility
123
123
 
124
- - Node.js v16 or above
124
+ - Node.js v18 or above
125
125
 
126
126
 
127
127
  ## Contributing
@@ -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 updateInclude(tsConfigJson) {
16
- tsConfigJson['include'] = ['app/**/*', 'tests/**/*', 'types/**/*'];
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
- updateInclude(tsConfigJson);
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.10'],
4
- ['@babel/plugin-proposal-decorators', '7.22.10'],
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.5'],
7
- ['@babel/runtime', '7.22.10'],
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.0'],
12
+ ['concurrently', '8.2.1'],
12
13
  ['ember-auto-import', '2.6.3'],
13
- ['ember-cli-babel', '7.26.11'],
14
+ ['ember-cli-babel', '8.0.0'],
14
15
  ['ember-cli-htmlbars', '6.3.0'],
15
- ['rollup', '3.28.0'],
16
- ['rollup-plugin-copy', '3.4.0'],
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.10.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.2.1",
31
- "@codemod-utils/files": "^0.5.2",
32
- "@codemod-utils/json": "^0.4.1",
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.10",
38
- "@codemod-utils/tests": "^0.3.0",
39
- "@sondr3/minitest": "^0.1.1",
40
- "@tsconfig/esm": "^1.0.4",
41
- "@tsconfig/node16": "^16.1.0",
42
- "@tsconfig/strictest": "^2.0.1",
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.3.0",
46
- "@typescript-eslint/parser": "^6.3.0",
47
- "concurrently": "^8.2.0",
48
- "eslint": "^8.47.0",
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.0",
52
- "eslint-plugin-n": "^16.0.1",
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": "^2.3.0",
54
+ "eslint-plugin-typescript-sort-keys": "^3.0.0",
56
55
  "lerna-changelog": "^2.2.0",
57
- "prettier": "^3.0.1",
58
- "typescript": "^5.1.6"
56
+ "prettier": "^3.0.3",
57
+ "typescript": "^5.2.2"
59
58
  },
60
59
  "engines": {
61
- "node": "16.* || >= 18"
60
+ "node": "18.* || >= 20"
62
61
  },
63
62
  "changelog": {
64
63
  "labels": {