ember-codemod-v1-to-v2 0.6.0 → 0.6.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-codemod-v1-to-v2",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Codemod to convert Ember addons to v2 addon format",
5
5
  "keywords": [
6
6
  "codemod",
@@ -27,19 +27,25 @@
27
27
  "bin/",
28
28
  "src/"
29
29
  ],
30
+ "scripts": {
31
+ "changelog": "lerna-changelog",
32
+ "lint": "eslint . --cache",
33
+ "lint:fix": "eslint . --fix",
34
+ "test": "mt tests --quiet"
35
+ },
30
36
  "dependencies": {
31
- "@codemod-utils/blueprints": "^0.1.1",
32
- "@codemod-utils/files": "^0.1.0",
33
- "@codemod-utils/json": "^0.1.1",
37
+ "@codemod-utils/blueprints": "^0.1.2",
38
+ "@codemod-utils/files": "^0.3.1",
39
+ "@codemod-utils/json": "^0.1.2",
34
40
  "strip-json-comments": "^5.0.0",
35
41
  "yargs": "^17.7.2"
36
42
  },
37
43
  "devDependencies": {
38
- "@babel/core": "^7.21.8",
39
- "@babel/eslint-parser": "^7.21.8",
40
- "@codemod-utils/tests": "^0.1.0",
44
+ "@babel/core": "^7.22.5",
45
+ "@babel/eslint-parser": "^7.22.5",
46
+ "@codemod-utils/tests": "^0.1.2",
41
47
  "@sondr3/minitest": "^0.1.1",
42
- "eslint": "^8.40.0",
48
+ "eslint": "^8.42.0",
43
49
  "eslint-config-prettier": "^8.8.0",
44
50
  "eslint-plugin-import": "^2.27.5",
45
51
  "eslint-plugin-n": "^16.0.0",
@@ -60,11 +66,5 @@
60
66
  "enhance: documentation": "Documentation",
61
67
  "user feedback": "User Feedback"
62
68
  }
63
- },
64
- "scripts": {
65
- "changelog": "lerna-changelog",
66
- "lint": "eslint . --cache",
67
- "lint:fix": "eslint . --fix",
68
- "test": "mt tests --quiet"
69
69
  }
70
- }
70
+ }
@@ -3,7 +3,7 @@
3
3
  <% } %> "plugins": [
4
4
  "@embroider/addon-dev/template-colocation-plugin",<% if (options.packages.addon.hasTypeScript) { %>
5
5
  ["@babel/plugin-transform-typescript", { "allowDeclareFields": true }],<% } %>
6
- ["@babel/plugin-proposal-decorators", { "legacy": true }],
6
+ ["@babel/plugin-proposal-decorators", { "version": "legacy" }],
7
7
  "@babel/plugin-proposal-class-properties"
8
8
  ]
9
9
  }
@@ -1,4 +1,4 @@
1
- import { findFiles, renameDirectory } from '@codemod-utils/files';
1
+ import { findFiles, renamePathByDirectory } from '@codemod-utils/files';
2
2
 
3
3
  import { getVersion } from '../../../utils/blueprints.js';
4
4
 
@@ -6,12 +6,12 @@ function getAppReexports(options) {
6
6
  const { projectRoot } = options;
7
7
 
8
8
  const filePaths = findFiles('app/**/*.js', {
9
- cwd: projectRoot,
9
+ projectRoot,
10
10
  });
11
11
 
12
12
  return filePaths
13
13
  .map((filePath) => {
14
- return renameDirectory(filePath, {
14
+ return renamePathByDirectory(filePath, {
15
15
  from: 'app',
16
16
  to: '',
17
17
  });
@@ -29,12 +29,12 @@ function getPublicAssets(options) {
29
29
  const { projectRoot } = options;
30
30
 
31
31
  const filePaths = findFiles('public/**/*', {
32
- cwd: projectRoot,
32
+ projectRoot,
33
33
  });
34
34
 
35
35
  return filePaths
36
36
  .map((filePath) => {
37
- return renameDirectory(filePath, {
37
+ return renamePathByDirectory(filePath, {
38
38
  from: 'public',
39
39
  to: '',
40
40
  });
@@ -46,18 +46,18 @@ function getPublicEntrypoints(options) {
46
46
  const { projectRoot } = options;
47
47
 
48
48
  const filePaths = findFiles('{addon,addon-test-support}/**/*.{js,ts}', {
49
- cwd: projectRoot,
49
+ projectRoot,
50
50
  });
51
51
 
52
52
  return filePaths
53
53
  .map((filePath) => {
54
- return renameDirectory(filePath, {
54
+ return renamePathByDirectory(filePath, {
55
55
  from: 'addon',
56
56
  to: '',
57
57
  });
58
58
  })
59
59
  .map((filePath) => {
60
- return renameDirectory(filePath, {
60
+ return renamePathByDirectory(filePath, {
61
61
  from: 'addon-test-support',
62
62
  to: 'test-support',
63
63
  });
@@ -37,8 +37,8 @@ export function createFilesFromBlueprint(context, options) {
37
37
  const cwd = join(blueprintsRoot, 'ember-addon');
38
38
 
39
39
  const blueprintFilePaths = findFiles('**/*', {
40
- cwd,
41
40
  ignoreList: filesToSkip,
41
+ projectRoot: cwd,
42
42
  });
43
43
 
44
44
  const fileMap = new Map(
@@ -37,7 +37,7 @@ function analyzePackageManager(codemodOptions) {
37
37
  const lockFiles = [...mapping.keys()];
38
38
 
39
39
  const filePaths = findFiles(unionize(lockFiles), {
40
- cwd: projectRoot,
40
+ projectRoot,
41
41
  });
42
42
 
43
43
  if (filePaths.length !== 1) {
@@ -9,7 +9,7 @@ function moveAddonFolder(options) {
9
9
  const { locations, projectRoot } = options;
10
10
 
11
11
  const filePaths = findFiles('addon/**/*', {
12
- cwd: projectRoot,
12
+ projectRoot,
13
13
  });
14
14
 
15
15
  const filePathMap = mapFilePaths(filePaths, {
@@ -24,7 +24,7 @@ function moveAddonTestSupportFolder(options) {
24
24
  const { locations, projectRoot } = options;
25
25
 
26
26
  const filePaths = findFiles('addon-test-support/**/*', {
27
- cwd: projectRoot,
27
+ projectRoot,
28
28
  });
29
29
 
30
30
  const filePathMap = mapFilePaths(filePaths, {
@@ -39,7 +39,7 @@ function moveBlueprintsFolder(options) {
39
39
  const { locations, projectRoot } = options;
40
40
 
41
41
  const filePaths = findFiles('blueprints/**/*', {
42
- cwd: projectRoot,
42
+ projectRoot,
43
43
  });
44
44
 
45
45
  const filePathMap = mapFilePaths(filePaths, {
@@ -54,7 +54,7 @@ function movePublicFolder(options) {
54
54
  const { locations, projectRoot } = options;
55
55
 
56
56
  const filePaths = findFiles('public/**/*', {
57
- cwd: projectRoot,
57
+ projectRoot,
58
58
  });
59
59
 
60
60
  const filePathMap = mapFilePaths(filePaths, {
@@ -69,7 +69,7 @@ function removeAppFolder(options) {
69
69
  const { projectRoot } = options;
70
70
 
71
71
  const filePaths = findFiles('app/**/*', {
72
- cwd: projectRoot,
72
+ projectRoot,
73
73
  });
74
74
 
75
75
  removeFiles(filePaths, options);
@@ -13,7 +13,7 @@ function copyToAddon(options) {
13
13
  const files = ['LICENSE.md', 'README.md'];
14
14
 
15
15
  const filePaths = findFiles(unionize(files), {
16
- cwd: projectRoot,
16
+ projectRoot,
17
17
  });
18
18
 
19
19
  const filePathMap = mapFilePaths(filePaths, {
@@ -48,7 +48,7 @@ function moveToAddonAndTestApp(options) {
48
48
  }
49
49
 
50
50
  const filePaths = findFiles(unionize([...files]), {
51
- cwd: projectRoot,
51
+ projectRoot,
52
52
  });
53
53
 
54
54
  let filePathMap = mapFilePaths(filePaths, {
@@ -79,7 +79,7 @@ function moveToTestApp(options) {
79
79
  ];
80
80
 
81
81
  const filePaths = findFiles(unionize(files), {
82
- cwd: projectRoot,
82
+ projectRoot,
83
83
  });
84
84
 
85
85
  const filePathMap = mapFilePaths(filePaths, {
@@ -96,7 +96,7 @@ function removeFromProjectRoot(options) {
96
96
  const files = ['.npmignore', 'index.js'];
97
97
 
98
98
  const filePaths = findFiles(unionize(files), {
99
- cwd: projectRoot,
99
+ projectRoot,
100
100
  });
101
101
 
102
102
  removeFiles(filePaths, options);
@@ -7,7 +7,7 @@ function moveTestsFolder(options) {
7
7
  const { locations, projectRoot } = options;
8
8
 
9
9
  let filePaths = findFiles('tests/dummy/**/*', {
10
- cwd: projectRoot,
10
+ projectRoot,
11
11
  });
12
12
 
13
13
  let filePathMap = mapFilePaths(filePaths, {
@@ -18,8 +18,8 @@ function moveTestsFolder(options) {
18
18
  moveFiles(filePathMap, options);
19
19
 
20
20
  filePaths = findFiles('tests/**/*', {
21
- cwd: projectRoot,
22
21
  ignoreList: ['tests/dummy/**/*'],
22
+ projectRoot,
23
23
  });
24
24
 
25
25
  filePathMap = mapFilePaths(filePaths, {
@@ -38,7 +38,7 @@ function moveTypesFolder(options) {
38
38
  }
39
39
 
40
40
  let filePaths = findFiles('types/dummy/**/*', {
41
- cwd: projectRoot,
41
+ projectRoot,
42
42
  });
43
43
 
44
44
  let filePathMap = mapFilePaths(filePaths, {
@@ -49,8 +49,8 @@ function moveTypesFolder(options) {
49
49
  moveFiles(filePathMap, options);
50
50
 
51
51
  filePaths = findFiles('types/**/*', {
52
- cwd: projectRoot,
53
52
  ignoreList: ['types/dummy/**/*'],
53
+ projectRoot,
54
54
  });
55
55
 
56
56
  filePathMap = mapFilePaths(filePaths, {
@@ -67,7 +67,7 @@ function renameDummy(options) {
67
67
  // File extensions had been specified, partly to encode assumptions
68
68
  // about Ember, and partly to avoid corrupting non-text files
69
69
  const filePaths = findFiles(`${locations.testApp}/**/*.{d.ts,html,js,ts}`, {
70
- cwd: projectRoot,
70
+ projectRoot,
71
71
  });
72
72
 
73
73
  filePaths.forEach((filePath) => {
@@ -1,19 +1,19 @@
1
1
  import { decideVersion } from '@codemod-utils/blueprints';
2
2
 
3
3
  const latestVersions = new Map([
4
- ['@babel/core', '7.21.8'],
4
+ ['@babel/core', '7.22.5'],
5
5
  ['@babel/plugin-proposal-class-properties', '7.18.6'],
6
- ['@babel/plugin-proposal-decorators', '7.21.0'],
7
- ['@babel/preset-typescript', '7.21.5'],
8
- ['@babel/runtime', '7.21.5'],
9
- ['@embroider/addon-dev', '3.0.0'],
10
- ['@embroider/addon-shim', '1.8.4'],
6
+ ['@babel/plugin-proposal-decorators', '7.22.5'],
7
+ ['@babel/preset-typescript', '7.22.5'],
8
+ ['@babel/runtime', '7.22.5'],
9
+ ['@embroider/addon-dev', '3.1.1'],
10
+ ['@embroider/addon-shim', '1.8.5'],
11
11
  ['@rollup/plugin-babel', '6.0.3'],
12
- ['concurrently', '8.0.1'],
12
+ ['concurrently', '8.2.0'],
13
13
  ['ember-auto-import', '2.6.3'],
14
14
  ['ember-cli-babel', '7.26.11'],
15
15
  ['ember-cli-htmlbars', '6.2.0'],
16
- ['rollup', '3.21.3'],
16
+ ['rollup', '3.24.1'],
17
17
  ['rollup-plugin-copy', '3.4.0'],
18
18
  ['rollup-plugin-ts', '3.2.0'],
19
19
  ]);