ember-codemod-pod-to-octane 1.0.0 → 1.1.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/LICENSE.md +1 -1
- package/README.md +4 -4
- package/bin/ember-codemod-pod-to-octane.js +2 -2
- package/package.json +26 -24
- package/src/index.js +6 -6
- package/src/migration/ember-addon/addon/component-classes.js +4 -4
- package/src/migration/ember-addon/addon/component-stylesheets.js +3 -3
- package/src/migration/ember-addon/addon/component-templates.js +2 -2
- package/src/migration/ember-addon/app/component-classes.js +2 -2
- package/src/migration/ember-addon/app/component-stylesheets.js +2 -2
- package/src/migration/ember-addon/app/component-templates.js +2 -2
- package/src/migration/ember-addon/index.js +7 -4
- package/src/migration/ember-addon/steps/create-options.js +46 -0
- package/src/migration/ember-addon/steps/index.js +1 -0
- package/src/migration/ember-addon/tests/components.js +3 -3
- package/src/migration/ember-app/app/component-classes.js +4 -4
- package/src/migration/ember-app/app/component-stylesheets.js +3 -3
- package/src/migration/ember-app/app/component-templates.js +2 -2
- package/src/migration/ember-app/app/route-adapters.js +3 -3
- package/src/migration/ember-app/app/route-controllers.js +3 -3
- package/src/migration/ember-app/app/route-models.js +3 -3
- package/src/migration/ember-app/app/route-routes.js +3 -3
- package/src/migration/ember-app/app/route-serializers.js +3 -3
- package/src/migration/ember-app/app/route-stylesheets.js +3 -3
- package/src/migration/ember-app/app/route-templates.js +2 -2
- package/src/migration/ember-app/app/services.js +3 -3
- package/src/migration/ember-app/index.js +5 -2
- package/src/migration/ember-app/steps/create-options.js +46 -0
- package/src/migration/ember-app/steps/index.js +1 -0
- package/src/migration/ember-app/tests/components.js +3 -3
- package/src/migration/ember-app/tests/route-controllers.js +5 -5
- package/src/migration/ember-app/tests/route-routes.js +5 -5
- package/src/migration/ember-app/tests/services.js +3 -3
- package/src/migration/ember-engine/addon/component-classes.js +4 -4
- package/src/migration/ember-engine/addon/component-stylesheets.js +3 -3
- package/src/migration/ember-engine/addon/component-templates.js +2 -2
- package/src/migration/ember-engine/addon/route-controllers.js +3 -3
- package/src/migration/ember-engine/addon/route-routes.js +3 -3
- package/src/migration/ember-engine/addon/route-stylesheets.js +3 -3
- package/src/migration/ember-engine/addon/route-templates.js +2 -2
- package/src/migration/ember-engine/index.js +24 -6
- package/src/migration/ember-engine/steps/create-options.js +46 -0
- package/src/migration/ember-engine/steps/index.js +4 -0
- package/src/migration/ember-engine/steps/update-absolute-paths.js +104 -0
- package/src/migration/ember-engine/steps/use-absolute-paths.js +60 -0
- package/src/migration/ember-engine/steps/use-relative-paths.js +116 -0
- package/src/migration/ember-engine/tests/components.js +3 -3
- package/src/migration/ember-engine/tests/route-controllers.js +5 -5
- package/src/migration/ember-engine/tests/route-routes.js +5 -5
- package/src/utils/ember-addon/app/components.js +1 -1
- package/src/utils/{map-paths.js → files/map-file-path.js} +4 -2
- package/src/utils/files/move-files.js +22 -0
- package/src/utils/files/remove-directory-if-empty.js +19 -0
- package/src/utils/files.js +3 -0
- package/src/utils/move-files.js +0 -44
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2023 Isaac J. Lee
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ npx ember-codemod-pod-to-octane --test
|
|
|
47
47
|
<details>
|
|
48
48
|
<summary>Optional: Specify the project root</summary>
|
|
49
49
|
|
|
50
|
-
Pass `--root` to run the codemod
|
|
50
|
+
Pass `--root` to run the codemod on a project somewhere else (i.e. not in the current directory).
|
|
51
51
|
|
|
52
52
|
```sh
|
|
53
53
|
npx ember-codemod-pod-to-octane --root=<your/project/path>
|
|
@@ -105,11 +105,11 @@ The codemod assumes that an engine is used to define routes and route-specific c
|
|
|
105
105
|
</details>
|
|
106
106
|
|
|
107
107
|
|
|
108
|
-
To better meet your needs, consider
|
|
108
|
+
To better meet your needs, consider cloning the repo and running the codemod locally.
|
|
109
109
|
|
|
110
110
|
```sh
|
|
111
|
-
cd <your/
|
|
112
|
-
./bin/ember-codemod-pod-to-octane.js
|
|
111
|
+
cd <your/cloned/repo>
|
|
112
|
+
./bin/ember-codemod-pod-to-octane.js --root=<your/project/path>
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
|
|
@@ -32,11 +32,11 @@ const { argv } = yargs(hideBin(process.argv))
|
|
|
32
32
|
type: 'string',
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
const
|
|
35
|
+
const codemodOptions = {
|
|
36
36
|
podPath: argv['pod-path'],
|
|
37
37
|
projectRoot: argv['root'] ?? process.cwd(),
|
|
38
38
|
projectType: argv['type'],
|
|
39
39
|
testRun: argv['test'],
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
runCodemod(
|
|
42
|
+
runCodemod(codemodOptions);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-codemod-pod-to-octane",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Codemod to un-pod Ember apps, addons, and engines",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-codemod",
|
|
@@ -13,50 +13,52 @@
|
|
|
13
13
|
},
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"author": "Isaac J. Lee",
|
|
16
|
-
"main": "src/index.js",
|
|
17
16
|
"type": "module",
|
|
17
|
+
"main": "src/index.js",
|
|
18
18
|
"bin": "./bin/ember-codemod-pod-to-octane.js",
|
|
19
|
+
"directories": {
|
|
20
|
+
"test": "tests"
|
|
21
|
+
},
|
|
19
22
|
"files": [
|
|
20
23
|
"bin/",
|
|
21
24
|
"src/"
|
|
22
25
|
],
|
|
23
|
-
"directories": {
|
|
24
|
-
"test": "tests"
|
|
25
|
-
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"changelog": "lerna-changelog",
|
|
28
|
-
"lint": "eslint . --cache
|
|
28
|
+
"lint": "eslint . --cache",
|
|
29
29
|
"lint:fix": "eslint . --fix",
|
|
30
30
|
"start": "node ./src/index.js",
|
|
31
31
|
"test": "mt tests --quiet"
|
|
32
32
|
},
|
|
33
|
-
"changelog": {
|
|
34
|
-
"labels": {
|
|
35
|
-
"breaking": "Breaking Change",
|
|
36
|
-
"bug": "Bug Fix",
|
|
37
|
-
"enhance: code": "Enhancement",
|
|
38
|
-
"enhance: dependency": "Internal",
|
|
39
|
-
"enhance: documentation": "Documentation",
|
|
40
|
-
"user feedback": "User Feedback"
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
33
|
"dependencies": {
|
|
44
|
-
"@babel/core": "^7.
|
|
34
|
+
"@babel/core": "^7.21.0",
|
|
45
35
|
"@babel/eslint-parser": "^7.19.1",
|
|
46
|
-
"glob": "^8.0
|
|
47
|
-
"yargs": "^17.
|
|
36
|
+
"glob": "^8.1.0",
|
|
37
|
+
"yargs": "^17.7.1"
|
|
48
38
|
},
|
|
49
39
|
"devDependencies": {
|
|
50
40
|
"@sondr3/minitest": "^0.1.1",
|
|
51
|
-
"eslint": "^8.
|
|
52
|
-
"eslint-config-prettier": "^8.
|
|
41
|
+
"eslint": "^8.34.0",
|
|
42
|
+
"eslint-config-prettier": "^8.6.0",
|
|
43
|
+
"eslint-plugin-import": "^2.27.5",
|
|
44
|
+
"eslint-plugin-n": "^15.6.1",
|
|
53
45
|
"eslint-plugin-prettier": "^4.2.1",
|
|
54
|
-
"eslint-plugin-simple-import-sort": "^
|
|
55
|
-
"fixturify": "^
|
|
46
|
+
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
47
|
+
"fixturify": "^3.0.0",
|
|
56
48
|
"lerna-changelog": "^2.2.0",
|
|
57
|
-
"prettier": "^2.
|
|
49
|
+
"prettier": "^2.8.4"
|
|
58
50
|
},
|
|
59
51
|
"engines": {
|
|
60
52
|
"node": ">= 16"
|
|
53
|
+
},
|
|
54
|
+
"changelog": {
|
|
55
|
+
"labels": {
|
|
56
|
+
"breaking": "Breaking Change",
|
|
57
|
+
"bug": "Bug Fix",
|
|
58
|
+
"enhance: code": "Enhancement",
|
|
59
|
+
"enhance: dependency": "Internal",
|
|
60
|
+
"enhance: documentation": "Documentation",
|
|
61
|
+
"user feedback": "User Feedback"
|
|
62
|
+
}
|
|
61
63
|
}
|
|
62
64
|
}
|
package/src/index.js
CHANGED
|
@@ -4,25 +4,25 @@ import {
|
|
|
4
4
|
migrateEmberEngine,
|
|
5
5
|
} from './migration/index.js';
|
|
6
6
|
|
|
7
|
-
export function runCodemod(
|
|
8
|
-
switch (
|
|
7
|
+
export function runCodemod(codemodOptions) {
|
|
8
|
+
switch (codemodOptions.projectType) {
|
|
9
9
|
case 'addon': {
|
|
10
|
-
migrateEmberAddon(
|
|
10
|
+
migrateEmberAddon(codemodOptions);
|
|
11
11
|
break;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
case 'app': {
|
|
15
|
-
migrateEmberApp(
|
|
15
|
+
migrateEmberApp(codemodOptions);
|
|
16
16
|
break;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
case 'engine': {
|
|
20
|
-
migrateEmberEngine(
|
|
20
|
+
migrateEmberEngine(codemodOptions);
|
|
21
21
|
break;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
default: {
|
|
25
|
-
console.error(`Unknown project type: ${
|
|
25
|
+
console.error(`Unknown project type: ${codemodOptions.projectType}`);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import glob from 'glob';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
4
4
|
|
|
5
5
|
export function migrationStrategyForComponentClasses(options) {
|
|
6
6
|
const { projectRoot } = options;
|
|
@@ -11,7 +11,7 @@ export function migrationStrategyForComponentClasses(options) {
|
|
|
11
11
|
|
|
12
12
|
return oldPaths.map((oldPath) => {
|
|
13
13
|
if (oldPath.endsWith('.d.ts')) {
|
|
14
|
-
return
|
|
14
|
+
return mapFilePath(oldPath, {
|
|
15
15
|
find: {
|
|
16
16
|
directory: 'addon/components',
|
|
17
17
|
file: 'component.d.ts',
|
|
@@ -23,7 +23,7 @@ export function migrationStrategyForComponentClasses(options) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
if (oldPath.endsWith('.ts')) {
|
|
26
|
-
return
|
|
26
|
+
return mapFilePath(oldPath, {
|
|
27
27
|
find: {
|
|
28
28
|
directory: 'addon/components',
|
|
29
29
|
file: 'component.ts',
|
|
@@ -34,7 +34,7 @@ export function migrationStrategyForComponentClasses(options) {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
return
|
|
37
|
+
return mapFilePath(oldPath, {
|
|
38
38
|
find: {
|
|
39
39
|
directory: 'addon/components',
|
|
40
40
|
file: 'component.js',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import glob from 'glob';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
4
4
|
|
|
5
5
|
export function migrationStrategyForComponentStylesheets(options) {
|
|
6
6
|
const { projectRoot } = options;
|
|
@@ -11,7 +11,7 @@ export function migrationStrategyForComponentStylesheets(options) {
|
|
|
11
11
|
|
|
12
12
|
return oldPaths.map((oldPath) => {
|
|
13
13
|
if (oldPath.endsWith('.scss')) {
|
|
14
|
-
return
|
|
14
|
+
return mapFilePath(oldPath, {
|
|
15
15
|
find: {
|
|
16
16
|
directory: 'addon/components',
|
|
17
17
|
file: 'styles.scss',
|
|
@@ -22,7 +22,7 @@ export function migrationStrategyForComponentStylesheets(options) {
|
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
return
|
|
25
|
+
return mapFilePath(oldPath, {
|
|
26
26
|
find: {
|
|
27
27
|
directory: 'addon/components',
|
|
28
28
|
file: 'styles.css',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import glob from 'glob';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
4
4
|
|
|
5
5
|
export function migrationStrategyForComponentTemplates(options) {
|
|
6
6
|
const { projectRoot } = options;
|
|
@@ -10,7 +10,7 @@ export function migrationStrategyForComponentTemplates(options) {
|
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
return oldPaths.map((oldPath) => {
|
|
13
|
-
return
|
|
13
|
+
return mapFilePath(oldPath, {
|
|
14
14
|
find: {
|
|
15
15
|
directory: 'addon/components',
|
|
16
16
|
file: 'template.hbs',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import glob from 'glob';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
4
4
|
|
|
5
5
|
export function migrationStrategyForComponentClasses(options) {
|
|
6
6
|
const { projectRoot } = options;
|
|
@@ -10,7 +10,7 @@ export function migrationStrategyForComponentClasses(options) {
|
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
return oldPaths.map((oldPath) => {
|
|
13
|
-
return
|
|
13
|
+
return mapFilePath(oldPath, {
|
|
14
14
|
find: {
|
|
15
15
|
directory: 'app/components',
|
|
16
16
|
file: 'component.js',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import glob from 'glob';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
4
4
|
|
|
5
5
|
export function migrationStrategyForComponentStylesheets(options) {
|
|
6
6
|
const { projectRoot } = options;
|
|
@@ -10,7 +10,7 @@ export function migrationStrategyForComponentStylesheets(options) {
|
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
return oldPaths.map((oldPath) => {
|
|
13
|
-
return
|
|
13
|
+
return mapFilePath(oldPath, {
|
|
14
14
|
find: {
|
|
15
15
|
directory: 'app/components',
|
|
16
16
|
file: 'styles.js',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import glob from 'glob';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
4
4
|
|
|
5
5
|
export function migrationStrategyForComponentTemplates(options) {
|
|
6
6
|
const { projectRoot } = options;
|
|
@@ -10,7 +10,7 @@ export function migrationStrategyForComponentTemplates(options) {
|
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
return oldPaths.map((oldPath) => {
|
|
13
|
-
return
|
|
13
|
+
return mapFilePath(oldPath, {
|
|
14
14
|
find: {
|
|
15
15
|
directory: 'app/components',
|
|
16
16
|
file: 'template.js',
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { moveFiles } from '../../utils/
|
|
1
|
+
import { updatePathsInAppFolder } from '../../utils/ember-addon/app/components.js';
|
|
2
|
+
import { moveFiles } from '../../utils/files.js';
|
|
3
3
|
import { migrationStrategyForAddonFolder } from './addon/index.js';
|
|
4
4
|
import { migrationStrategyForAppFolder } from './app/index.js';
|
|
5
|
+
import { createOptions } from './steps/index.js';
|
|
5
6
|
import { migrationStrategyForTestsFolder } from './tests/index.js';
|
|
6
7
|
|
|
7
|
-
export function migrateEmberAddon(
|
|
8
|
+
export function migrateEmberAddon(codemodOptions) {
|
|
9
|
+
const options = createOptions(codemodOptions);
|
|
10
|
+
|
|
8
11
|
const migrationStrategyAddon = migrationStrategyForAddonFolder(options);
|
|
9
12
|
const migrationStrategyApp = migrationStrategyForAppFolder(options);
|
|
10
13
|
const migrationStrategyTests = migrationStrategyForTestsFolder(options);
|
|
@@ -23,5 +26,5 @@ export function migrateEmberAddon(options) {
|
|
|
23
26
|
moveFiles(migrationStrategyApp, options);
|
|
24
27
|
moveFiles(migrationStrategyTests, options);
|
|
25
28
|
|
|
26
|
-
|
|
29
|
+
updatePathsInAppFolder(migrationStrategyApp, options);
|
|
27
30
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
}
|
|
35
|
+
|
|
36
|
+
export function createOptions(codemodOptions) {
|
|
37
|
+
const projectName = analyzePackageJson(codemodOptions);
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
podPath: codemodOptions.podPath,
|
|
41
|
+
projectName,
|
|
42
|
+
projectRoot: codemodOptions.projectRoot,
|
|
43
|
+
projectType: codemodOptions.projectType,
|
|
44
|
+
testRun: codemodOptions.testRun,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './create-options.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import glob from 'glob';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
4
4
|
|
|
5
5
|
export function migrationStrategyForComponents(options) {
|
|
6
6
|
const { projectRoot } = options;
|
|
@@ -14,7 +14,7 @@ export function migrationStrategyForComponents(options) {
|
|
|
14
14
|
|
|
15
15
|
return oldPaths.map((oldPath) => {
|
|
16
16
|
if (oldPath.endsWith('.ts')) {
|
|
17
|
-
return
|
|
17
|
+
return mapFilePath(oldPath, {
|
|
18
18
|
find: {
|
|
19
19
|
directory: 'tests/integration/components',
|
|
20
20
|
file: 'component-test.ts',
|
|
@@ -25,7 +25,7 @@ export function migrationStrategyForComponents(options) {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
return
|
|
28
|
+
return mapFilePath(oldPath, {
|
|
29
29
|
find: {
|
|
30
30
|
directory: 'tests/integration/components',
|
|
31
31
|
file: 'component-test.js',
|
|
@@ -2,7 +2,7 @@ import { join } from 'node:path';
|
|
|
2
2
|
|
|
3
3
|
import glob from 'glob';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
6
6
|
|
|
7
7
|
export function migrationStrategyForComponentClasses(options) {
|
|
8
8
|
const { podPath, projectRoot } = options;
|
|
@@ -16,7 +16,7 @@ export function migrationStrategyForComponentClasses(options) {
|
|
|
16
16
|
|
|
17
17
|
return oldPaths.map((oldPath) => {
|
|
18
18
|
if (oldPath.endsWith('.d.ts')) {
|
|
19
|
-
return
|
|
19
|
+
return mapFilePath(oldPath, {
|
|
20
20
|
find: {
|
|
21
21
|
directory: join('app', podPath, 'components'),
|
|
22
22
|
file: 'component.d.ts',
|
|
@@ -28,7 +28,7 @@ export function migrationStrategyForComponentClasses(options) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
if (oldPath.endsWith('.ts')) {
|
|
31
|
-
return
|
|
31
|
+
return mapFilePath(oldPath, {
|
|
32
32
|
find: {
|
|
33
33
|
directory: join('app', podPath, 'components'),
|
|
34
34
|
file: 'component.ts',
|
|
@@ -39,7 +39,7 @@ export function migrationStrategyForComponentClasses(options) {
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
return
|
|
42
|
+
return mapFilePath(oldPath, {
|
|
43
43
|
find: {
|
|
44
44
|
directory: join('app', podPath, 'components'),
|
|
45
45
|
file: 'component.js',
|
|
@@ -2,7 +2,7 @@ import { join } from 'node:path';
|
|
|
2
2
|
|
|
3
3
|
import glob from 'glob';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
6
6
|
|
|
7
7
|
export function migrationStrategyForComponentStylesheets(options) {
|
|
8
8
|
const { podPath, projectRoot } = options;
|
|
@@ -16,7 +16,7 @@ export function migrationStrategyForComponentStylesheets(options) {
|
|
|
16
16
|
|
|
17
17
|
return oldPaths.map((oldPath) => {
|
|
18
18
|
if (oldPath.endsWith('.scss')) {
|
|
19
|
-
return
|
|
19
|
+
return mapFilePath(oldPath, {
|
|
20
20
|
find: {
|
|
21
21
|
directory: join('app', podPath, 'components'),
|
|
22
22
|
file: 'styles.scss',
|
|
@@ -27,7 +27,7 @@ export function migrationStrategyForComponentStylesheets(options) {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
return
|
|
30
|
+
return mapFilePath(oldPath, {
|
|
31
31
|
find: {
|
|
32
32
|
directory: join('app', podPath, 'components'),
|
|
33
33
|
file: 'styles.css',
|
|
@@ -2,7 +2,7 @@ import { join } from 'node:path';
|
|
|
2
2
|
|
|
3
3
|
import glob from 'glob';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
6
6
|
|
|
7
7
|
export function migrationStrategyForComponentTemplates(options) {
|
|
8
8
|
const { podPath, projectRoot } = options;
|
|
@@ -15,7 +15,7 @@ export function migrationStrategyForComponentTemplates(options) {
|
|
|
15
15
|
);
|
|
16
16
|
|
|
17
17
|
return oldPaths.map((oldPath) => {
|
|
18
|
-
return
|
|
18
|
+
return mapFilePath(oldPath, {
|
|
19
19
|
find: {
|
|
20
20
|
directory: join('app', podPath, 'components'),
|
|
21
21
|
file: 'template.hbs',
|
|
@@ -2,7 +2,7 @@ import { join } from 'node:path';
|
|
|
2
2
|
|
|
3
3
|
import glob from 'glob';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
6
6
|
|
|
7
7
|
export function migrationStrategyForRouteAdapters(options) {
|
|
8
8
|
const { podPath, projectRoot } = options;
|
|
@@ -13,7 +13,7 @@ export function migrationStrategyForRouteAdapters(options) {
|
|
|
13
13
|
|
|
14
14
|
return oldPaths.map((oldPath) => {
|
|
15
15
|
if (oldPath.endsWith('.ts')) {
|
|
16
|
-
return
|
|
16
|
+
return mapFilePath(oldPath, {
|
|
17
17
|
find: {
|
|
18
18
|
directory: join('app', podPath),
|
|
19
19
|
file: 'adapter.ts',
|
|
@@ -24,7 +24,7 @@ export function migrationStrategyForRouteAdapters(options) {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
return
|
|
27
|
+
return mapFilePath(oldPath, {
|
|
28
28
|
find: {
|
|
29
29
|
directory: join('app', podPath),
|
|
30
30
|
file: 'adapter.js',
|
|
@@ -2,7 +2,7 @@ import { join } from 'node:path';
|
|
|
2
2
|
|
|
3
3
|
import glob from 'glob';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
6
6
|
|
|
7
7
|
export function migrationStrategyForRouteControllers(options) {
|
|
8
8
|
const { podPath, projectRoot } = options;
|
|
@@ -13,7 +13,7 @@ export function migrationStrategyForRouteControllers(options) {
|
|
|
13
13
|
|
|
14
14
|
return oldPaths.map((oldPath) => {
|
|
15
15
|
if (oldPath.endsWith('.ts')) {
|
|
16
|
-
return
|
|
16
|
+
return mapFilePath(oldPath, {
|
|
17
17
|
find: {
|
|
18
18
|
directory: join('app', podPath),
|
|
19
19
|
file: 'controller.ts',
|
|
@@ -24,7 +24,7 @@ export function migrationStrategyForRouteControllers(options) {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
return
|
|
27
|
+
return mapFilePath(oldPath, {
|
|
28
28
|
find: {
|
|
29
29
|
directory: join('app', podPath),
|
|
30
30
|
file: 'controller.js',
|
|
@@ -2,7 +2,7 @@ import { join } from 'node:path';
|
|
|
2
2
|
|
|
3
3
|
import glob from 'glob';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
6
6
|
|
|
7
7
|
export function migrationStrategyForRouteModels(options) {
|
|
8
8
|
const { podPath, projectRoot } = options;
|
|
@@ -13,7 +13,7 @@ export function migrationStrategyForRouteModels(options) {
|
|
|
13
13
|
|
|
14
14
|
return oldPaths.map((oldPath) => {
|
|
15
15
|
if (oldPath.endsWith('.ts')) {
|
|
16
|
-
return
|
|
16
|
+
return mapFilePath(oldPath, {
|
|
17
17
|
find: {
|
|
18
18
|
directory: join('app', podPath),
|
|
19
19
|
file: 'model.ts',
|
|
@@ -24,7 +24,7 @@ export function migrationStrategyForRouteModels(options) {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
return
|
|
27
|
+
return mapFilePath(oldPath, {
|
|
28
28
|
find: {
|
|
29
29
|
directory: join('app', podPath),
|
|
30
30
|
file: 'model.js',
|
|
@@ -2,7 +2,7 @@ import { join } from 'node:path';
|
|
|
2
2
|
|
|
3
3
|
import glob from 'glob';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
6
6
|
|
|
7
7
|
export function migrationStrategyForRouteRoutes(options) {
|
|
8
8
|
const { podPath, projectRoot } = options;
|
|
@@ -13,7 +13,7 @@ export function migrationStrategyForRouteRoutes(options) {
|
|
|
13
13
|
|
|
14
14
|
return oldPaths.map((oldPath) => {
|
|
15
15
|
if (oldPath.endsWith('.ts')) {
|
|
16
|
-
return
|
|
16
|
+
return mapFilePath(oldPath, {
|
|
17
17
|
find: {
|
|
18
18
|
directory: join('app', podPath),
|
|
19
19
|
file: 'route.ts',
|
|
@@ -24,7 +24,7 @@ export function migrationStrategyForRouteRoutes(options) {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
return
|
|
27
|
+
return mapFilePath(oldPath, {
|
|
28
28
|
find: {
|
|
29
29
|
directory: join('app', podPath),
|
|
30
30
|
file: 'route.js',
|
|
@@ -2,7 +2,7 @@ import { join } from 'node:path';
|
|
|
2
2
|
|
|
3
3
|
import glob from 'glob';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
6
6
|
|
|
7
7
|
export function migrationStrategyForRouteSerializers(options) {
|
|
8
8
|
const { podPath, projectRoot } = options;
|
|
@@ -13,7 +13,7 @@ export function migrationStrategyForRouteSerializers(options) {
|
|
|
13
13
|
|
|
14
14
|
return oldPaths.map((oldPath) => {
|
|
15
15
|
if (oldPath.endsWith('.ts')) {
|
|
16
|
-
return
|
|
16
|
+
return mapFilePath(oldPath, {
|
|
17
17
|
find: {
|
|
18
18
|
directory: join('app', podPath),
|
|
19
19
|
file: 'serializer.ts',
|
|
@@ -24,7 +24,7 @@ export function migrationStrategyForRouteSerializers(options) {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
return
|
|
27
|
+
return mapFilePath(oldPath, {
|
|
28
28
|
find: {
|
|
29
29
|
directory: join('app', podPath),
|
|
30
30
|
file: 'serializer.js',
|
|
@@ -2,7 +2,7 @@ import { join } from 'node:path';
|
|
|
2
2
|
|
|
3
3
|
import glob from 'glob';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
6
6
|
|
|
7
7
|
export function migrationStrategyForRouteStylesheets(options) {
|
|
8
8
|
const { podPath, projectRoot } = options;
|
|
@@ -16,7 +16,7 @@ export function migrationStrategyForRouteStylesheets(options) {
|
|
|
16
16
|
|
|
17
17
|
return oldPaths.map((oldPath) => {
|
|
18
18
|
if (oldPath.endsWith('.scss')) {
|
|
19
|
-
return
|
|
19
|
+
return mapFilePath(oldPath, {
|
|
20
20
|
find: {
|
|
21
21
|
directory: join('app', podPath),
|
|
22
22
|
file: 'styles.scss',
|
|
@@ -27,7 +27,7 @@ export function migrationStrategyForRouteStylesheets(options) {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
return
|
|
30
|
+
return mapFilePath(oldPath, {
|
|
31
31
|
find: {
|
|
32
32
|
directory: join('app', podPath),
|
|
33
33
|
file: 'styles.css',
|
|
@@ -2,7 +2,7 @@ import { join } from 'node:path';
|
|
|
2
2
|
|
|
3
3
|
import glob from 'glob';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { mapFilePath } from '../../../utils/files.js';
|
|
6
6
|
|
|
7
7
|
export function migrationStrategyForRouteTemplates(options) {
|
|
8
8
|
const { podPath, projectRoot } = options;
|
|
@@ -15,7 +15,7 @@ export function migrationStrategyForRouteTemplates(options) {
|
|
|
15
15
|
);
|
|
16
16
|
|
|
17
17
|
return oldPaths.map((oldPath) => {
|
|
18
|
-
return
|
|
18
|
+
return mapFilePath(oldPath, {
|
|
19
19
|
find: {
|
|
20
20
|
directory: join('app', podPath),
|
|
21
21
|
file: 'template.hbs',
|