ember-codemod-pod-to-octane 1.2.8 → 1.2.9

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
@@ -32,9 +32,9 @@ Step 3. Update references originating from, as well as pointing to, the moved fi
32
32
  You must pass `--type` to indicate what type of project you have.
33
33
 
34
34
  ```sh
35
- npx ember-codemod-pod-to-octane --type=app
36
- npx ember-codemod-pod-to-octane --type=addon
37
- npx ember-codemod-pod-to-octane --type=engine
35
+ npx ember-codemod-pod-to-octane --type app
36
+ npx ember-codemod-pod-to-octane --type addon
37
+ npx ember-codemod-pod-to-octane --type engine
38
38
  ```
39
39
 
40
40
 
@@ -56,14 +56,14 @@ npx ember-codemod-pod-to-octane --test
56
56
  Pass `--root` to run the codemod on a project somewhere else (i.e. not in the current directory).
57
57
 
58
58
  ```sh
59
- npx ember-codemod-pod-to-octane --root=<path/to/your/project>
59
+ npx ember-codemod-pod-to-octane --root <path/to/your/project>
60
60
  ```
61
61
 
62
62
  Note, you can use `--root` to un-pod the demo app of an Ember addon.
63
63
 
64
64
  ```sh
65
65
  # If the current directory is the addon root
66
- npx ember-codemod-pod-to-octane --type=app --root=tests/dummy
66
+ npx ember-codemod-pod-to-octane --type app --root tests/dummy
67
67
  ```
68
68
 
69
69
  </details>
@@ -76,7 +76,7 @@ Pass `--pod-path` if `podModulePrefix` has been set in `config/environment.js`.
76
76
 
77
77
  ```sh
78
78
  # If modulePrefix is 'my-app' and podModulePrefix is 'my-app/pods'
79
- npx ember-codemod-pod-to-octane --pod-path=pods
79
+ npx ember-codemod-pod-to-octane --pod-path pods
80
80
  ```
81
81
 
82
82
  </details>
@@ -120,7 +120,7 @@ cd <path/to/cloned/repo>
120
120
  pnpm build
121
121
 
122
122
  # Run codemod
123
- ./dist/bin/ember-codemod-pod-to-octane.js --root=<path/to/your/project>
123
+ ./dist/bin/ember-codemod-pod-to-octane.js --root <path/to/your/project>
124
124
  ```
125
125
 
126
126
 
package/dist/src/index.js CHANGED
@@ -13,8 +13,5 @@ export function runCodemod(codemodOptions) {
13
13
  migrateEmberEngine(codemodOptions);
14
14
  break;
15
15
  }
16
- default: {
17
- console.error(`Unknown project type: ${codemodOptions.projectType}`);
18
- }
19
16
  }
20
17
  }
@@ -1,19 +1,13 @@
1
1
  import { readFileSync, writeFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
- export function updatePathsInAppFolder(migrationStrategy, options) {
3
+ export function updatePathsInAppFolder(filePathMap, options) {
4
4
  const { projectRoot } = options;
5
- migrationStrategy.forEach((newFilePath, oldFilePath) => {
6
- // Read file
5
+ filePathMap.forEach((newFilePath, oldFilePath) => {
7
6
  const newAbsolutePath = join(projectRoot, newFilePath);
8
7
  const file = readFileSync(newAbsolutePath, 'utf8');
9
- // Update file
10
- const oldRelativePath = oldFilePath
11
- .replace(/^app\//, '')
12
- .replace(/\.js$/, '');
13
- const newRelativePath = newFilePath
14
- .replace(/^app\//, '')
15
- .replace(/\.js$/, '');
16
- const newFile = file.replace(new RegExp(oldRelativePath), newRelativePath);
8
+ const text = oldFilePath.replace(/^app\//, '').replace(/\.js$/, '');
9
+ const newText = newFilePath.replace(/^app\//, '').replace(/\.js$/, '');
10
+ const newFile = file.replace(new RegExp(text), newText);
17
11
  writeFileSync(newAbsolutePath, newFile, 'utf8');
18
12
  });
19
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-codemod-pod-to-octane",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "description": "Codemod to un-pod Ember apps, addons, and engines",
5
5
  "keywords": [
6
6
  "codemod",
@@ -24,31 +24,31 @@
24
24
  "dist"
25
25
  ],
26
26
  "dependencies": {
27
- "@codemod-utils/files": "^0.5.1",
27
+ "@codemod-utils/files": "^0.5.2",
28
28
  "yargs": "^17.7.2"
29
29
  },
30
30
  "devDependencies": {
31
- "@babel/core": "^7.22.6",
32
- "@codemod-utils/tests": "^0.2.4",
31
+ "@babel/core": "^7.22.8",
32
+ "@codemod-utils/tests": "^0.2.5",
33
33
  "@sondr3/minitest": "^0.1.1",
34
34
  "@tsconfig/esm": "^1.0.4",
35
35
  "@tsconfig/node16": "^16.1.0",
36
36
  "@tsconfig/strictest": "^2.0.1",
37
37
  "@types/node": "^16.11.7",
38
38
  "@types/yargs": "^17.0.24",
39
- "@typescript-eslint/eslint-plugin": "^5.61.0",
40
- "@typescript-eslint/parser": "^5.61.0",
39
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
40
+ "@typescript-eslint/parser": "^6.0.0",
41
41
  "concurrently": "^8.2.0",
42
42
  "eslint": "^8.44.0",
43
43
  "eslint-config-prettier": "^8.8.0",
44
44
  "eslint-import-resolver-typescript": "^3.5.5",
45
45
  "eslint-plugin-import": "^2.27.5",
46
46
  "eslint-plugin-n": "^16.0.1",
47
- "eslint-plugin-prettier": "^4.2.1",
47
+ "eslint-plugin-prettier": "^5.0.0",
48
48
  "eslint-plugin-simple-import-sort": "^10.0.0",
49
49
  "eslint-plugin-typescript-sort-keys": "^2.3.0",
50
50
  "lerna-changelog": "^2.2.0",
51
- "prettier": "^2.8.8",
51
+ "prettier": "^3.0.0",
52
52
  "typescript": "^5.1.6"
53
53
  },
54
54
  "engines": {