ember-codemod-pod-to-octane 1.1.3 → 1.1.4

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.
Files changed (40) hide show
  1. package/package.json +13 -12
  2. package/src/migration/ember-addon/addon/component-classes.js +6 -6
  3. package/src/migration/ember-addon/addon/component-stylesheets.js +6 -6
  4. package/src/migration/ember-addon/addon/component-templates.js +6 -6
  5. package/src/migration/ember-addon/app/component-classes.js +6 -6
  6. package/src/migration/ember-addon/app/component-stylesheets.js +6 -6
  7. package/src/migration/ember-addon/app/component-templates.js +6 -6
  8. package/src/migration/ember-addon/steps/create-options.js +3 -36
  9. package/src/migration/ember-addon/tests/components.js +6 -6
  10. package/src/migration/ember-app/app/component-classes.js +6 -6
  11. package/src/migration/ember-app/app/component-stylesheets.js +6 -6
  12. package/src/migration/ember-app/app/component-templates.js +6 -6
  13. package/src/migration/ember-app/app/route-adapters.js +6 -6
  14. package/src/migration/ember-app/app/route-controllers.js +10 -7
  15. package/src/migration/ember-app/app/route-models.js +6 -6
  16. package/src/migration/ember-app/app/route-routes.js +6 -6
  17. package/src/migration/ember-app/app/route-serializers.js +10 -7
  18. package/src/migration/ember-app/app/route-stylesheets.js +6 -6
  19. package/src/migration/ember-app/app/route-templates.js +6 -6
  20. package/src/migration/ember-app/app/services.js +6 -6
  21. package/src/migration/ember-app/steps/create-options.js +3 -36
  22. package/src/migration/ember-app/tests/components.js +6 -6
  23. package/src/migration/ember-app/tests/route-controllers.js +12 -12
  24. package/src/migration/ember-app/tests/route-routes.js +12 -12
  25. package/src/migration/ember-app/tests/services.js +6 -6
  26. package/src/migration/ember-engine/addon/component-classes.js +6 -6
  27. package/src/migration/ember-engine/addon/component-stylesheets.js +6 -6
  28. package/src/migration/ember-engine/addon/component-templates.js +6 -6
  29. package/src/migration/ember-engine/addon/route-controllers.js +6 -6
  30. package/src/migration/ember-engine/addon/route-routes.js +6 -6
  31. package/src/migration/ember-engine/addon/route-stylesheets.js +6 -6
  32. package/src/migration/ember-engine/addon/route-templates.js +6 -6
  33. package/src/migration/ember-engine/steps/create-options.js +3 -36
  34. package/src/migration/ember-engine/steps/update-absolute-paths.js +1 -1
  35. package/src/migration/ember-engine/steps/use-absolute-paths.js +1 -1
  36. package/src/migration/ember-engine/steps/use-relative-paths.js +3 -3
  37. package/src/migration/ember-engine/tests/components.js +6 -6
  38. package/src/migration/ember-engine/tests/route-controllers.js +12 -12
  39. package/src/migration/ember-engine/tests/route-routes.js +12 -12
  40. package/src/utils/ember-addon/app/components.js +9 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-codemod-pod-to-octane",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Codemod to un-pod Ember apps, addons, and engines",
5
5
  "keywords": [
6
6
  "codemod",
@@ -24,14 +24,21 @@
24
24
  "bin/",
25
25
  "src/"
26
26
  ],
27
+ "scripts": {
28
+ "changelog": "lerna-changelog",
29
+ "lint": "eslint . --cache",
30
+ "lint:fix": "eslint . --fix",
31
+ "test": "mt tests --quiet"
32
+ },
27
33
  "dependencies": {
28
- "@codemod-utils/files": "^0.2.0",
34
+ "@codemod-utils/files": "^0.3.1",
35
+ "@codemod-utils/json": "^0.1.2",
29
36
  "yargs": "^17.7.2"
30
37
  },
31
38
  "devDependencies": {
32
- "@babel/core": "^7.22.1",
33
- "@babel/eslint-parser": "^7.21.8",
34
- "@codemod-utils/tests": "^0.1.1",
39
+ "@babel/core": "^7.22.5",
40
+ "@babel/eslint-parser": "^7.22.5",
41
+ "@codemod-utils/tests": "^0.1.2",
35
42
  "@sondr3/minitest": "^0.1.1",
36
43
  "eslint": "^8.42.0",
37
44
  "eslint-config-prettier": "^8.8.0",
@@ -54,11 +61,5 @@
54
61
  "enhance: documentation": "Documentation",
55
62
  "user feedback": "User Feedback"
56
63
  }
57
- },
58
- "scripts": {
59
- "changelog": "lerna-changelog",
60
- "lint": "eslint . --cache",
61
- "lint:fix": "eslint . --fix",
62
- "test": "mt tests --quiet"
63
64
  }
64
- }
65
+ }
@@ -1,14 +1,14 @@
1
- import { findFiles, renameFile } from '@codemod-utils/files';
1
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
2
2
 
3
3
  export function migrationStrategyForComponentClasses(options) {
4
4
  const { projectRoot } = options;
5
5
 
6
- const oldPaths = findFiles('addon/components/**/component.{d.ts,js,ts}', {
7
- cwd: projectRoot,
6
+ const filePaths = findFiles('addon/components/**/component.{d.ts,js,ts}', {
7
+ projectRoot,
8
8
  });
9
9
 
10
- return oldPaths.map((oldPath) => {
11
- const newPath = renameFile(oldPath, {
10
+ return filePaths.map((oldFilePath) => {
11
+ const newFilePath = renamePathByFile(oldFilePath, {
12
12
  find: {
13
13
  directory: 'addon/components',
14
14
  file: 'component',
@@ -18,6 +18,6 @@ export function migrationStrategyForComponentClasses(options) {
18
18
  },
19
19
  });
20
20
 
21
- return [oldPath, newPath];
21
+ return [oldFilePath, newFilePath];
22
22
  });
23
23
  }
@@ -1,14 +1,14 @@
1
- import { findFiles, renameFile } from '@codemod-utils/files';
1
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
2
2
 
3
3
  export function migrationStrategyForComponentStylesheets(options) {
4
4
  const { projectRoot } = options;
5
5
 
6
- const oldPaths = findFiles('addon/components/**/styles.{css,scss}', {
7
- cwd: projectRoot,
6
+ const filePaths = findFiles('addon/components/**/styles.{css,scss}', {
7
+ projectRoot,
8
8
  });
9
9
 
10
- return oldPaths.map((oldPath) => {
11
- const newPath = renameFile(oldPath, {
10
+ return filePaths.map((oldFilePath) => {
11
+ const newFilePath = renamePathByFile(oldFilePath, {
12
12
  find: {
13
13
  directory: 'addon/components',
14
14
  file: 'styles',
@@ -18,6 +18,6 @@ export function migrationStrategyForComponentStylesheets(options) {
18
18
  },
19
19
  });
20
20
 
21
- return [oldPath, newPath];
21
+ return [oldFilePath, newFilePath];
22
22
  });
23
23
  }
@@ -1,14 +1,14 @@
1
- import { findFiles, renameFile } from '@codemod-utils/files';
1
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
2
2
 
3
3
  export function migrationStrategyForComponentTemplates(options) {
4
4
  const { projectRoot } = options;
5
5
 
6
- const oldPaths = findFiles('addon/components/**/template.hbs', {
7
- cwd: projectRoot,
6
+ const filePaths = findFiles('addon/components/**/template.hbs', {
7
+ projectRoot,
8
8
  });
9
9
 
10
- return oldPaths.map((oldPath) => {
11
- const newPath = renameFile(oldPath, {
10
+ return filePaths.map((oldFilePath) => {
11
+ const newFilePath = renamePathByFile(oldFilePath, {
12
12
  find: {
13
13
  directory: 'addon/components',
14
14
  file: 'template',
@@ -18,6 +18,6 @@ export function migrationStrategyForComponentTemplates(options) {
18
18
  },
19
19
  });
20
20
 
21
- return [oldPath, newPath];
21
+ return [oldFilePath, newFilePath];
22
22
  });
23
23
  }
@@ -1,14 +1,14 @@
1
- import { findFiles, renameFile } from '@codemod-utils/files';
1
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
2
2
 
3
3
  export function migrationStrategyForComponentClasses(options) {
4
4
  const { projectRoot } = options;
5
5
 
6
- const oldPaths = findFiles('app/components/**/component.js', {
7
- cwd: projectRoot,
6
+ const filePaths = findFiles('app/components/**/component.js', {
7
+ projectRoot,
8
8
  });
9
9
 
10
- return oldPaths.map((oldPath) => {
11
- const newPath = renameFile(oldPath, {
10
+ return filePaths.map((oldFilePath) => {
11
+ const newFilePath = renamePathByFile(oldFilePath, {
12
12
  find: {
13
13
  directory: 'app/components',
14
14
  file: 'component',
@@ -18,6 +18,6 @@ export function migrationStrategyForComponentClasses(options) {
18
18
  },
19
19
  });
20
20
 
21
- return [oldPath, newPath];
21
+ return [oldFilePath, newFilePath];
22
22
  });
23
23
  }
@@ -1,14 +1,14 @@
1
- import { findFiles, renameFile } from '@codemod-utils/files';
1
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
2
2
 
3
3
  export function migrationStrategyForComponentStylesheets(options) {
4
4
  const { projectRoot } = options;
5
5
 
6
- const oldPaths = findFiles('app/components/**/styles.js', {
7
- cwd: projectRoot,
6
+ const filePaths = findFiles('app/components/**/styles.js', {
7
+ projectRoot,
8
8
  });
9
9
 
10
- return oldPaths.map((oldPath) => {
11
- const newPath = renameFile(oldPath, {
10
+ return filePaths.map((oldFilePath) => {
11
+ const newFilePath = renamePathByFile(oldFilePath, {
12
12
  find: {
13
13
  directory: 'app/components',
14
14
  file: 'styles',
@@ -18,6 +18,6 @@ export function migrationStrategyForComponentStylesheets(options) {
18
18
  },
19
19
  });
20
20
 
21
- return [oldPath, newPath];
21
+ return [oldFilePath, newFilePath];
22
22
  });
23
23
  }
@@ -1,14 +1,14 @@
1
- import { findFiles, renameFile } from '@codemod-utils/files';
1
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
2
2
 
3
3
  export function migrationStrategyForComponentTemplates(options) {
4
4
  const { projectRoot } = options;
5
5
 
6
- const oldPaths = findFiles('app/components/**/template.js', {
7
- cwd: projectRoot,
6
+ const filePaths = findFiles('app/components/**/template.js', {
7
+ projectRoot,
8
8
  });
9
9
 
10
- return oldPaths.map((oldPath) => {
11
- const newPath = renameFile(oldPath, {
10
+ return filePaths.map((oldFilePath) => {
11
+ const newFilePath = renamePathByFile(oldFilePath, {
12
12
  find: {
13
13
  directory: 'app/components',
14
14
  file: 'template',
@@ -18,6 +18,6 @@ export function migrationStrategyForComponentTemplates(options) {
18
18
  },
19
19
  });
20
20
 
21
- return [oldPath, newPath];
21
+ return [oldFilePath, newFilePath];
22
22
  });
23
23
  }
@@ -1,44 +1,11 @@
1
- import { readFileSync } from 'node:fs';
2
- import { join } from 'node:path';
3
-
4
- function analyzePackageJson(codemodOptions) {
5
- const { projectRoot } = codemodOptions;
6
-
7
- try {
8
- const packageJsonFile = readFileSync(
9
- join(projectRoot, 'package.json'),
10
- 'utf8',
11
- );
12
-
13
- const { name } = JSON.parse(packageJsonFile);
14
-
15
- if (!name) {
16
- throw new SyntaxError('Package name is missing.');
17
- }
18
-
19
- if (name.includes('/')) {
20
- // eslint-disable-next-line no-unused-vars
21
- const [scope, packageName] = name.split('/');
22
-
23
- if (!packageName) {
24
- throw new SyntaxError('Package name is missing.');
25
- }
26
- }
27
-
28
- return name;
29
- } catch (e) {
30
- throw new SyntaxError(
31
- `ERROR: package.json is missing or is not valid. (${e.message})\n`,
32
- );
33
- }
34
- }
1
+ import { readPackageJson } from '@codemod-utils/json';
35
2
 
36
3
  export function createOptions(codemodOptions) {
37
- const projectName = analyzePackageJson(codemodOptions);
4
+ const { name } = readPackageJson(codemodOptions);
38
5
 
39
6
  return {
40
7
  podPath: codemodOptions.podPath,
41
- projectName,
8
+ projectName: name,
42
9
  projectRoot: codemodOptions.projectRoot,
43
10
  projectType: codemodOptions.projectType,
44
11
  testRun: codemodOptions.testRun,
@@ -1,17 +1,17 @@
1
- import { findFiles, renameFile } from '@codemod-utils/files';
1
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
2
2
 
3
3
  export function migrationStrategyForComponents(options) {
4
4
  const { projectRoot } = options;
5
5
 
6
- const oldPaths = findFiles(
6
+ const filePaths = findFiles(
7
7
  'tests/integration/components/**/component-test.{js,ts}',
8
8
  {
9
- cwd: projectRoot,
9
+ projectRoot,
10
10
  },
11
11
  );
12
12
 
13
- return oldPaths.map((oldPath) => {
14
- const newPath = renameFile(oldPath, {
13
+ return filePaths.map((oldFilePath) => {
14
+ const newFilePath = renamePathByFile(oldFilePath, {
15
15
  find: {
16
16
  directory: 'tests/integration/components',
17
17
  file: 'component-test',
@@ -21,6 +21,6 @@ export function migrationStrategyForComponents(options) {
21
21
  },
22
22
  });
23
23
 
24
- return [oldPath, newPath];
24
+ return [oldFilePath, newFilePath];
25
25
  });
26
26
  }
@@ -1,19 +1,19 @@
1
1
  import { join } from 'node:path';
2
2
 
3
- import { findFiles, renameFile } from '@codemod-utils/files';
3
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
4
4
 
5
5
  export function migrationStrategyForComponentClasses(options) {
6
6
  const { podPath, projectRoot } = options;
7
7
 
8
- const oldPaths = findFiles(
8
+ const filePaths = findFiles(
9
9
  join('app', podPath, 'components', '**', 'component.{d.ts,js,ts}'),
10
10
  {
11
- cwd: projectRoot,
11
+ projectRoot,
12
12
  },
13
13
  );
14
14
 
15
- return oldPaths.map((oldPath) => {
16
- const newPath = renameFile(oldPath, {
15
+ return filePaths.map((oldFilePath) => {
16
+ const newFilePath = renamePathByFile(oldFilePath, {
17
17
  find: {
18
18
  directory: join('app', podPath, 'components'),
19
19
  file: 'component',
@@ -23,6 +23,6 @@ export function migrationStrategyForComponentClasses(options) {
23
23
  },
24
24
  });
25
25
 
26
- return [oldPath, newPath];
26
+ return [oldFilePath, newFilePath];
27
27
  });
28
28
  }
@@ -1,19 +1,19 @@
1
1
  import { join } from 'node:path';
2
2
 
3
- import { findFiles, renameFile } from '@codemod-utils/files';
3
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
4
4
 
5
5
  export function migrationStrategyForComponentStylesheets(options) {
6
6
  const { podPath, projectRoot } = options;
7
7
 
8
- const oldPaths = findFiles(
8
+ const filePaths = findFiles(
9
9
  join('app', podPath, 'components', '**', 'styles.{css,scss}'),
10
10
  {
11
- cwd: projectRoot,
11
+ projectRoot,
12
12
  },
13
13
  );
14
14
 
15
- return oldPaths.map((oldPath) => {
16
- const newPath = renameFile(oldPath, {
15
+ return filePaths.map((oldFilePath) => {
16
+ const newFilePath = renamePathByFile(oldFilePath, {
17
17
  find: {
18
18
  directory: join('app', podPath, 'components'),
19
19
  file: 'styles',
@@ -23,6 +23,6 @@ export function migrationStrategyForComponentStylesheets(options) {
23
23
  },
24
24
  });
25
25
 
26
- return [oldPath, newPath];
26
+ return [oldFilePath, newFilePath];
27
27
  });
28
28
  }
@@ -1,19 +1,19 @@
1
1
  import { join } from 'node:path';
2
2
 
3
- import { findFiles, renameFile } from '@codemod-utils/files';
3
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
4
4
 
5
5
  export function migrationStrategyForComponentTemplates(options) {
6
6
  const { podPath, projectRoot } = options;
7
7
 
8
- const oldPaths = findFiles(
8
+ const filePaths = findFiles(
9
9
  join('app', podPath, 'components', '**', 'template.hbs'),
10
10
  {
11
- cwd: projectRoot,
11
+ projectRoot,
12
12
  },
13
13
  );
14
14
 
15
- return oldPaths.map((oldPath) => {
16
- const newPath = renameFile(oldPath, {
15
+ return filePaths.map((oldFilePath) => {
16
+ const newFilePath = renamePathByFile(oldFilePath, {
17
17
  find: {
18
18
  directory: join('app', podPath, 'components'),
19
19
  file: 'template',
@@ -23,6 +23,6 @@ export function migrationStrategyForComponentTemplates(options) {
23
23
  },
24
24
  });
25
25
 
26
- return [oldPath, newPath];
26
+ return [oldFilePath, newFilePath];
27
27
  });
28
28
  }
@@ -1,16 +1,16 @@
1
1
  import { join } from 'node:path';
2
2
 
3
- import { findFiles, renameFile } from '@codemod-utils/files';
3
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
4
4
 
5
5
  export function migrationStrategyForRouteAdapters(options) {
6
6
  const { podPath, projectRoot } = options;
7
7
 
8
- const oldPaths = findFiles(join('app', podPath, '**', 'adapter.{js,ts}'), {
9
- cwd: projectRoot,
8
+ const filePaths = findFiles(join('app', podPath, '**', 'adapter.{js,ts}'), {
9
+ projectRoot,
10
10
  });
11
11
 
12
- return oldPaths.map((oldPath) => {
13
- const newPath = renameFile(oldPath, {
12
+ return filePaths.map((oldFilePath) => {
13
+ const newFilePath = renamePathByFile(oldFilePath, {
14
14
  find: {
15
15
  directory: join('app', podPath),
16
16
  file: 'adapter',
@@ -20,6 +20,6 @@ export function migrationStrategyForRouteAdapters(options) {
20
20
  },
21
21
  });
22
22
 
23
- return [oldPath, newPath];
23
+ return [oldFilePath, newFilePath];
24
24
  });
25
25
  }
@@ -1,16 +1,19 @@
1
1
  import { join } from 'node:path';
2
2
 
3
- import { findFiles, renameFile } from '@codemod-utils/files';
3
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
4
4
 
5
5
  export function migrationStrategyForRouteControllers(options) {
6
6
  const { podPath, projectRoot } = options;
7
7
 
8
- const oldPaths = findFiles(join('app', podPath, '**', 'controller.{js,ts}'), {
9
- cwd: projectRoot,
10
- });
8
+ const filePaths = findFiles(
9
+ join('app', podPath, '**', 'controller.{js,ts}'),
10
+ {
11
+ projectRoot,
12
+ },
13
+ );
11
14
 
12
- return oldPaths.map((oldPath) => {
13
- const newPath = renameFile(oldPath, {
15
+ return filePaths.map((oldFilePath) => {
16
+ const newFilePath = renamePathByFile(oldFilePath, {
14
17
  find: {
15
18
  directory: join('app', podPath),
16
19
  file: 'controller',
@@ -20,6 +23,6 @@ export function migrationStrategyForRouteControllers(options) {
20
23
  },
21
24
  });
22
25
 
23
- return [oldPath, newPath];
26
+ return [oldFilePath, newFilePath];
24
27
  });
25
28
  }
@@ -1,16 +1,16 @@
1
1
  import { join } from 'node:path';
2
2
 
3
- import { findFiles, renameFile } from '@codemod-utils/files';
3
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
4
4
 
5
5
  export function migrationStrategyForRouteModels(options) {
6
6
  const { podPath, projectRoot } = options;
7
7
 
8
- const oldPaths = findFiles(join('app', podPath, '**', 'model.{js,ts}'), {
9
- cwd: projectRoot,
8
+ const filePaths = findFiles(join('app', podPath, '**', 'model.{js,ts}'), {
9
+ projectRoot,
10
10
  });
11
11
 
12
- return oldPaths.map((oldPath) => {
13
- const newPath = renameFile(oldPath, {
12
+ return filePaths.map((oldFilePath) => {
13
+ const newFilePath = renamePathByFile(oldFilePath, {
14
14
  find: {
15
15
  directory: join('app', podPath),
16
16
  file: 'model',
@@ -20,6 +20,6 @@ export function migrationStrategyForRouteModels(options) {
20
20
  },
21
21
  });
22
22
 
23
- return [oldPath, newPath];
23
+ return [oldFilePath, newFilePath];
24
24
  });
25
25
  }
@@ -1,16 +1,16 @@
1
1
  import { join } from 'node:path';
2
2
 
3
- import { findFiles, renameFile } from '@codemod-utils/files';
3
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
4
4
 
5
5
  export function migrationStrategyForRouteRoutes(options) {
6
6
  const { podPath, projectRoot } = options;
7
7
 
8
- const oldPaths = findFiles(join('app', podPath, '**', 'route.{js,ts}'), {
9
- cwd: projectRoot,
8
+ const filePaths = findFiles(join('app', podPath, '**', 'route.{js,ts}'), {
9
+ projectRoot,
10
10
  });
11
11
 
12
- return oldPaths.map((oldPath) => {
13
- const newPath = renameFile(oldPath, {
12
+ return filePaths.map((oldFilePath) => {
13
+ const newFilePath = renamePathByFile(oldFilePath, {
14
14
  find: {
15
15
  directory: join('app', podPath),
16
16
  file: 'route',
@@ -20,6 +20,6 @@ export function migrationStrategyForRouteRoutes(options) {
20
20
  },
21
21
  });
22
22
 
23
- return [oldPath, newPath];
23
+ return [oldFilePath, newFilePath];
24
24
  });
25
25
  }
@@ -1,16 +1,19 @@
1
1
  import { join } from 'node:path';
2
2
 
3
- import { findFiles, renameFile } from '@codemod-utils/files';
3
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
4
4
 
5
5
  export function migrationStrategyForRouteSerializers(options) {
6
6
  const { podPath, projectRoot } = options;
7
7
 
8
- const oldPaths = findFiles(join('app', podPath, '**', 'serializer.{js,ts}'), {
9
- cwd: projectRoot,
10
- });
8
+ const filePaths = findFiles(
9
+ join('app', podPath, '**', 'serializer.{js,ts}'),
10
+ {
11
+ projectRoot,
12
+ },
13
+ );
11
14
 
12
- return oldPaths.map((oldPath) => {
13
- const newPath = renameFile(oldPath, {
15
+ return filePaths.map((oldFilePath) => {
16
+ const newFilePath = renamePathByFile(oldFilePath, {
14
17
  find: {
15
18
  directory: join('app', podPath),
16
19
  file: 'serializer',
@@ -20,6 +23,6 @@ export function migrationStrategyForRouteSerializers(options) {
20
23
  },
21
24
  });
22
25
 
23
- return [oldPath, newPath];
26
+ return [oldFilePath, newFilePath];
24
27
  });
25
28
  }
@@ -1,19 +1,19 @@
1
1
  import { join } from 'node:path';
2
2
 
3
- import { findFiles, renameFile } from '@codemod-utils/files';
3
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
4
4
 
5
5
  export function migrationStrategyForRouteStylesheets(options) {
6
6
  const { podPath, projectRoot } = options;
7
7
 
8
- const oldPaths = findFiles(
8
+ const filePaths = findFiles(
9
9
  join('app', podPath, '!(components)', '**', 'styles.{css,scss}'),
10
10
  {
11
- cwd: projectRoot,
11
+ projectRoot,
12
12
  },
13
13
  );
14
14
 
15
- return oldPaths.map((oldPath) => {
16
- const newPath = renameFile(oldPath, {
15
+ return filePaths.map((oldFilePath) => {
16
+ const newFilePath = renamePathByFile(oldFilePath, {
17
17
  find: {
18
18
  directory: join('app', podPath),
19
19
  file: 'styles',
@@ -23,6 +23,6 @@ export function migrationStrategyForRouteStylesheets(options) {
23
23
  },
24
24
  });
25
25
 
26
- return [oldPath, newPath];
26
+ return [oldFilePath, newFilePath];
27
27
  });
28
28
  }
@@ -1,19 +1,19 @@
1
1
  import { join } from 'node:path';
2
2
 
3
- import { findFiles, renameFile } from '@codemod-utils/files';
3
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
4
4
 
5
5
  export function migrationStrategyForRouteTemplates(options) {
6
6
  const { podPath, projectRoot } = options;
7
7
 
8
- const oldPaths = findFiles(
8
+ const filePaths = findFiles(
9
9
  join('app', podPath, '!(components)', '**', 'template.hbs'),
10
10
  {
11
- cwd: projectRoot,
11
+ projectRoot,
12
12
  },
13
13
  );
14
14
 
15
- return oldPaths.map((oldPath) => {
16
- const newPath = renameFile(oldPath, {
15
+ return filePaths.map((oldFilePath) => {
16
+ const newFilePath = renamePathByFile(oldFilePath, {
17
17
  find: {
18
18
  directory: join('app', podPath),
19
19
  file: 'template',
@@ -23,6 +23,6 @@ export function migrationStrategyForRouteTemplates(options) {
23
23
  },
24
24
  });
25
25
 
26
- return [oldPath, newPath];
26
+ return [oldFilePath, newFilePath];
27
27
  });
28
28
  }
@@ -1,16 +1,16 @@
1
1
  import { join } from 'node:path';
2
2
 
3
- import { findFiles, renameFile } from '@codemod-utils/files';
3
+ import { findFiles, renamePathByFile } from '@codemod-utils/files';
4
4
 
5
5
  export function migrationStrategyForServices(options) {
6
6
  const { podPath, projectRoot } = options;
7
7
 
8
- const oldPaths = findFiles(join('app', podPath, '**', 'service.{js,ts}'), {
9
- cwd: projectRoot,
8
+ const filePaths = findFiles(join('app', podPath, '**', 'service.{js,ts}'), {
9
+ projectRoot,
10
10
  });
11
11
 
12
- return oldPaths.map((oldPath) => {
13
- const newPath = renameFile(oldPath, {
12
+ return filePaths.map((oldFilePath) => {
13
+ const newFilePath = renamePathByFile(oldFilePath, {
14
14
  find: {
15
15
  directory: join('app', podPath),
16
16
  file: 'service',
@@ -20,6 +20,6 @@ export function migrationStrategyForServices(options) {
20
20
  },
21
21
  });
22
22
 
23
- return [oldPath, newPath];
23
+ return [oldFilePath, newFilePath];
24
24
  });
25
25
  }