ember-codemod-pod-to-octane 1.1.3 → 1.1.5
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 +13 -12
- package/src/migration/ember-addon/addon/component-classes.js +6 -6
- package/src/migration/ember-addon/addon/component-stylesheets.js +6 -6
- package/src/migration/ember-addon/addon/component-templates.js +6 -6
- package/src/migration/ember-addon/app/component-classes.js +6 -6
- package/src/migration/ember-addon/app/component-stylesheets.js +6 -6
- package/src/migration/ember-addon/app/component-templates.js +6 -6
- package/src/migration/ember-addon/steps/create-options.js +3 -30
- package/src/migration/ember-addon/tests/components.js +6 -6
- package/src/migration/ember-app/app/component-classes.js +6 -6
- package/src/migration/ember-app/app/component-stylesheets.js +6 -6
- package/src/migration/ember-app/app/component-templates.js +6 -6
- package/src/migration/ember-app/app/route-adapters.js +6 -6
- package/src/migration/ember-app/app/route-controllers.js +10 -7
- package/src/migration/ember-app/app/route-models.js +6 -6
- package/src/migration/ember-app/app/route-routes.js +6 -6
- package/src/migration/ember-app/app/route-serializers.js +10 -7
- package/src/migration/ember-app/app/route-stylesheets.js +6 -6
- package/src/migration/ember-app/app/route-templates.js +6 -6
- package/src/migration/ember-app/app/services.js +6 -6
- package/src/migration/ember-app/steps/create-options.js +3 -30
- package/src/migration/ember-app/tests/components.js +6 -6
- package/src/migration/ember-app/tests/route-controllers.js +12 -12
- package/src/migration/ember-app/tests/route-routes.js +12 -12
- package/src/migration/ember-app/tests/services.js +6 -6
- package/src/migration/ember-engine/addon/component-classes.js +6 -6
- package/src/migration/ember-engine/addon/component-stylesheets.js +6 -6
- package/src/migration/ember-engine/addon/component-templates.js +6 -6
- package/src/migration/ember-engine/addon/route-controllers.js +6 -6
- package/src/migration/ember-engine/addon/route-routes.js +6 -6
- package/src/migration/ember-engine/addon/route-stylesheets.js +6 -6
- package/src/migration/ember-engine/addon/route-templates.js +6 -6
- package/src/migration/ember-engine/steps/create-options.js +4 -29
- package/src/migration/ember-engine/steps/update-absolute-paths.js +1 -1
- package/src/migration/ember-engine/steps/use-absolute-paths.js +1 -1
- package/src/migration/ember-engine/steps/use-relative-paths.js +3 -3
- package/src/migration/ember-engine/tests/components.js +6 -6
- package/src/migration/ember-engine/tests/route-controllers.js +12 -12
- package/src/migration/ember-engine/tests/route-routes.js +12 -12
- 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
|
+
"version": "1.1.5",
|
|
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.
|
|
34
|
+
"@codemod-utils/files": "^0.3.1",
|
|
35
|
+
"@codemod-utils/json": "^0.2.0",
|
|
29
36
|
"yargs": "^17.7.2"
|
|
30
37
|
},
|
|
31
38
|
"devDependencies": {
|
|
32
|
-
"@babel/core": "^7.22.
|
|
33
|
-
"@babel/eslint-parser": "^7.
|
|
34
|
-
"@codemod-utils/tests": "^0.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,
|
|
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
|
|
7
|
-
|
|
6
|
+
const filePaths = findFiles('addon/components/**/component.{d.ts,js,ts}', {
|
|
7
|
+
projectRoot,
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
return
|
|
11
|
-
const
|
|
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 [
|
|
21
|
+
return [oldFilePath, newFilePath];
|
|
22
22
|
});
|
|
23
23
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { findFiles,
|
|
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
|
|
7
|
-
|
|
6
|
+
const filePaths = findFiles('addon/components/**/styles.{css,scss}', {
|
|
7
|
+
projectRoot,
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
return
|
|
11
|
-
const
|
|
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 [
|
|
21
|
+
return [oldFilePath, newFilePath];
|
|
22
22
|
});
|
|
23
23
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { findFiles,
|
|
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
|
|
7
|
-
|
|
6
|
+
const filePaths = findFiles('addon/components/**/template.hbs', {
|
|
7
|
+
projectRoot,
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
return
|
|
11
|
-
const
|
|
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 [
|
|
21
|
+
return [oldFilePath, newFilePath];
|
|
22
22
|
});
|
|
23
23
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { findFiles,
|
|
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
|
|
7
|
-
|
|
6
|
+
const filePaths = findFiles('app/components/**/component.js', {
|
|
7
|
+
projectRoot,
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
return
|
|
11
|
-
const
|
|
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 [
|
|
21
|
+
return [oldFilePath, newFilePath];
|
|
22
22
|
});
|
|
23
23
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { findFiles,
|
|
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
|
|
7
|
-
|
|
6
|
+
const filePaths = findFiles('app/components/**/styles.js', {
|
|
7
|
+
projectRoot,
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
return
|
|
11
|
-
const
|
|
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 [
|
|
21
|
+
return [oldFilePath, newFilePath];
|
|
22
22
|
});
|
|
23
23
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { findFiles,
|
|
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
|
|
7
|
-
|
|
6
|
+
const filePaths = findFiles('app/components/**/template.js', {
|
|
7
|
+
projectRoot,
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
return
|
|
11
|
-
const
|
|
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 [
|
|
21
|
+
return [oldFilePath, newFilePath];
|
|
22
22
|
});
|
|
23
23
|
}
|
|
@@ -1,36 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { join } from 'node:path';
|
|
1
|
+
import { readPackageJson } from '@codemod-utils/json';
|
|
3
2
|
|
|
4
3
|
function analyzePackageJson(codemodOptions) {
|
|
5
|
-
const
|
|
4
|
+
const packageJson = readPackageJson(codemodOptions);
|
|
6
5
|
|
|
7
|
-
|
|
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
|
-
}
|
|
6
|
+
return packageJson.name;
|
|
34
7
|
}
|
|
35
8
|
|
|
36
9
|
export function createOptions(codemodOptions) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { findFiles,
|
|
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
|
|
6
|
+
const filePaths = findFiles(
|
|
7
7
|
'tests/integration/components/**/component-test.{js,ts}',
|
|
8
8
|
{
|
|
9
|
-
|
|
9
|
+
projectRoot,
|
|
10
10
|
},
|
|
11
11
|
);
|
|
12
12
|
|
|
13
|
-
return
|
|
14
|
-
const
|
|
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 [
|
|
24
|
+
return [oldFilePath, newFilePath];
|
|
25
25
|
});
|
|
26
26
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
|
|
3
|
-
import { findFiles,
|
|
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
|
|
8
|
+
const filePaths = findFiles(
|
|
9
9
|
join('app', podPath, 'components', '**', 'component.{d.ts,js,ts}'),
|
|
10
10
|
{
|
|
11
|
-
|
|
11
|
+
projectRoot,
|
|
12
12
|
},
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
-
return
|
|
16
|
-
const
|
|
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 [
|
|
26
|
+
return [oldFilePath, newFilePath];
|
|
27
27
|
});
|
|
28
28
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
|
|
3
|
-
import { findFiles,
|
|
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
|
|
8
|
+
const filePaths = findFiles(
|
|
9
9
|
join('app', podPath, 'components', '**', 'styles.{css,scss}'),
|
|
10
10
|
{
|
|
11
|
-
|
|
11
|
+
projectRoot,
|
|
12
12
|
},
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
-
return
|
|
16
|
-
const
|
|
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 [
|
|
26
|
+
return [oldFilePath, newFilePath];
|
|
27
27
|
});
|
|
28
28
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
|
|
3
|
-
import { findFiles,
|
|
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
|
|
8
|
+
const filePaths = findFiles(
|
|
9
9
|
join('app', podPath, 'components', '**', 'template.hbs'),
|
|
10
10
|
{
|
|
11
|
-
|
|
11
|
+
projectRoot,
|
|
12
12
|
},
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
-
return
|
|
16
|
-
const
|
|
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 [
|
|
26
|
+
return [oldFilePath, newFilePath];
|
|
27
27
|
});
|
|
28
28
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
|
|
3
|
-
import { findFiles,
|
|
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
|
|
9
|
-
|
|
8
|
+
const filePaths = findFiles(join('app', podPath, '**', 'adapter.{js,ts}'), {
|
|
9
|
+
projectRoot,
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
return
|
|
13
|
-
const
|
|
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 [
|
|
23
|
+
return [oldFilePath, newFilePath];
|
|
24
24
|
});
|
|
25
25
|
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
|
|
3
|
-
import { findFiles,
|
|
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
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const filePaths = findFiles(
|
|
9
|
+
join('app', podPath, '**', 'controller.{js,ts}'),
|
|
10
|
+
{
|
|
11
|
+
projectRoot,
|
|
12
|
+
},
|
|
13
|
+
);
|
|
11
14
|
|
|
12
|
-
return
|
|
13
|
-
const
|
|
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 [
|
|
26
|
+
return [oldFilePath, newFilePath];
|
|
24
27
|
});
|
|
25
28
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
|
|
3
|
-
import { findFiles,
|
|
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
|
|
9
|
-
|
|
8
|
+
const filePaths = findFiles(join('app', podPath, '**', 'model.{js,ts}'), {
|
|
9
|
+
projectRoot,
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
return
|
|
13
|
-
const
|
|
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 [
|
|
23
|
+
return [oldFilePath, newFilePath];
|
|
24
24
|
});
|
|
25
25
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
|
|
3
|
-
import { findFiles,
|
|
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
|
|
9
|
-
|
|
8
|
+
const filePaths = findFiles(join('app', podPath, '**', 'route.{js,ts}'), {
|
|
9
|
+
projectRoot,
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
return
|
|
13
|
-
const
|
|
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 [
|
|
23
|
+
return [oldFilePath, newFilePath];
|
|
24
24
|
});
|
|
25
25
|
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
|
|
3
|
-
import { findFiles,
|
|
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
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const filePaths = findFiles(
|
|
9
|
+
join('app', podPath, '**', 'serializer.{js,ts}'),
|
|
10
|
+
{
|
|
11
|
+
projectRoot,
|
|
12
|
+
},
|
|
13
|
+
);
|
|
11
14
|
|
|
12
|
-
return
|
|
13
|
-
const
|
|
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 [
|
|
26
|
+
return [oldFilePath, newFilePath];
|
|
24
27
|
});
|
|
25
28
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
|
|
3
|
-
import { findFiles,
|
|
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
|
|
8
|
+
const filePaths = findFiles(
|
|
9
9
|
join('app', podPath, '!(components)', '**', 'styles.{css,scss}'),
|
|
10
10
|
{
|
|
11
|
-
|
|
11
|
+
projectRoot,
|
|
12
12
|
},
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
-
return
|
|
16
|
-
const
|
|
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 [
|
|
26
|
+
return [oldFilePath, newFilePath];
|
|
27
27
|
});
|
|
28
28
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
|
|
3
|
-
import { findFiles,
|
|
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
|
|
8
|
+
const filePaths = findFiles(
|
|
9
9
|
join('app', podPath, '!(components)', '**', 'template.hbs'),
|
|
10
10
|
{
|
|
11
|
-
|
|
11
|
+
projectRoot,
|
|
12
12
|
},
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
-
return
|
|
16
|
-
const
|
|
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 [
|
|
26
|
+
return [oldFilePath, newFilePath];
|
|
27
27
|
});
|
|
28
28
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
|
|
3
|
-
import { findFiles,
|
|
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
|
|
9
|
-
|
|
8
|
+
const filePaths = findFiles(join('app', podPath, '**', 'service.{js,ts}'), {
|
|
9
|
+
projectRoot,
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
return
|
|
13
|
-
const
|
|
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 [
|
|
23
|
+
return [oldFilePath, newFilePath];
|
|
24
24
|
});
|
|
25
25
|
}
|