@vc-shell/migrate 2.0.0-alpha.31 → 2.0.0-alpha.33
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/CHANGELOG.md +25 -0
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/dep-updater.d.ts +1 -0
- package/dist/dep-updater.js +31 -0
- package/dist/dep-updater.js.map +1 -0
- package/dist/file-scanner.d.ts +3 -0
- package/dist/file-scanner.js +102 -0
- package/dist/file-scanner.js.map +1 -0
- package/dist/report-generator.d.ts +2 -0
- package/dist/report-generator.js +271 -0
- package/dist/report-generator.js.map +1 -0
- package/dist/runner.d.ts +6 -0
- package/dist/runner.js +72 -171
- package/dist/runner.js.map +1 -1
- package/dist/sfc-processor.d.ts +12 -0
- package/dist/sfc-processor.js +54 -0
- package/dist/sfc-processor.js.map +1 -0
- package/dist/transforms/blade-props-simplification.js +10 -2
- package/dist/transforms/blade-props-simplification.js.map +1 -1
- package/dist/transforms/define-app-module.js +8 -4
- package/dist/transforms/define-app-module.js.map +1 -1
- package/dist/transforms/define-expose-to-children.d.ts +4 -0
- package/dist/transforms/define-expose-to-children.js +83 -0
- package/dist/transforms/define-expose-to-children.js.map +1 -0
- package/dist/transforms/dynamic-properties-refactor.js +1 -1
- package/dist/transforms/dynamic-properties-refactor.js.map +1 -1
- package/dist/transforms/icon-audit.js +20 -24
- package/dist/transforms/icon-audit.js.map +1 -1
- package/dist/transforms/locale-imports.d.ts +4 -0
- package/dist/transforms/locale-imports.js +23 -0
- package/dist/transforms/locale-imports.js.map +1 -0
- package/dist/transforms/registry.js +77 -2
- package/dist/transforms/registry.js.map +1 -1
- package/dist/transforms/remove-deprecated-aliases.js +12 -2
- package/dist/transforms/remove-deprecated-aliases.js.map +1 -1
- package/dist/transforms/remove-pathmatch-route.d.ts +17 -0
- package/dist/transforms/remove-pathmatch-route.js +74 -0
- package/dist/transforms/remove-pathmatch-route.js.map +1 -0
- package/dist/transforms/remove-release-config.d.ts +4 -0
- package/dist/transforms/remove-release-config.js +58 -0
- package/dist/transforms/remove-release-config.js.map +1 -0
- package/dist/transforms/replace-cover-method.d.ts +4 -0
- package/dist/transforms/replace-cover-method.js +81 -0
- package/dist/transforms/replace-cover-method.js.map +1 -0
- package/dist/transforms/types.d.ts +2 -0
- package/dist/transforms/use-assets-migration.js +12 -12
- package/dist/transforms/use-assets-migration.js.map +1 -1
- package/dist/transforms/use-blade-form.js +21 -127
- package/dist/transforms/use-blade-form.js.map +1 -1
- package/dist/transforms/use-blade-migration.js +14 -2
- package/dist/transforms/use-blade-migration.js.map +1 -1
- package/dist/transforms/vctable-audit.d.ts +4 -0
- package/dist/transforms/vctable-audit.js +14 -0
- package/dist/transforms/vctable-audit.js.map +1 -0
- package/dist/transforms/widgets-migration.js +19 -23
- package/dist/transforms/widgets-migration.js.map +1 -1
- package/dist/transforms/window-globals.d.ts +4 -0
- package/dist/transforms/window-globals.js +24 -0
- package/dist/transforms/window-globals.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
# [2.0.0-alpha.33](https://github.com/VirtoCommerce/vc-shell/compare/v2.0.0-alpha.32...v2.0.0-alpha.33) (2026-04-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **migrate:** fix 7 critical bugs found during real-app testing ([41688a1](https://github.com/VirtoCommerce/vc-shell/commit/41688a164250d397c51b6007953bc112f63ee4b9))
|
|
7
|
+
* **migrate:** improve useBladeForm diagnostic — onBeforeClose must be removed, show closeConfirmMessage example ([274bf9a](https://github.com/VirtoCommerce/vc-shell/commit/274bf9aac965b8c8cecada58d7959d547da7f52b))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **migrate:** add 4 new transforms (injection-keys, replace-cover, locale-imports, window-globals) ([bbcbc79](https://github.com/VirtoCommerce/vc-shell/commit/bbcbc79530ad237ed4d9bd4519ba164559b125a5))
|
|
13
|
+
* **migrate:** add after field to VersionedTransform for dependency ordering ([a854662](https://github.com/VirtoCommerce/vc-shell/commit/a85466259f908c585161e6db43337c1b1e5d2ece))
|
|
14
|
+
* **migrate:** add defineExpose → exposeToChildren transform + improve widgets diagnostic ([d73352c](https://github.com/VirtoCommerce/vc-shell/commit/d73352c02630f3cf2b046f524769ac8d4cec1f0f))
|
|
15
|
+
* **migrate:** add release-config cleanup and VcTable audits ([23118dd](https://github.com/VirtoCommerce/vc-shell/commit/23118dd74e9bd4387b166bd5e35a341ad81cd6be))
|
|
16
|
+
* **migrate:** declare after dependencies for blade-props, define-options, remove-pathmatch ([90167af](https://github.com/VirtoCommerce/vc-shell/commit/90167afbe8d07fc88a9543eb431edf6b29e5aba9))
|
|
17
|
+
* **migrate:** generate MIGRATION_REPORT.md with automated/manual/uncovered sections ([3d9d2a1](https://github.com/VirtoCommerce/vc-shell/commit/3d9d2a10844ffe940e96a3f74bf40c24ff6e7a71))
|
|
18
|
+
* **migrate:** idempotency guard — second run produces zero modifications ([cd91b25](https://github.com/VirtoCommerce/vc-shell/commit/cd91b250a8a5235543f6a5fe4330a86d530b250a))
|
|
19
|
+
* **migrate:** replace-cover-method — openBlade({ replaceCurrentBlade: true }) → coverWith() ([cb24cd8](https://github.com/VirtoCommerce/vc-shell/commit/cb24cd8353847fd9c7ddc91927f726cba3ada00b))
|
|
20
|
+
* **migrate:** structured migration report with before/after examples and guide links ([2f5c2da](https://github.com/VirtoCommerce/vc-shell/commit/2f5c2da289abb9977464fb8772ddcfe2c3daa17d))
|
|
21
|
+
* **migrate:** topological sort for transform dependency ordering ([24a4446](https://github.com/VirtoCommerce/vc-shell/commit/24a44463fd9e114401b989114aacfc07ddb5250f))
|
|
22
|
+
# [2.0.0-alpha.32](https://github.com/VirtoCommerce/vc-shell/compare/v2.0.0-alpha.31...v2.0.0-alpha.32) (2026-04-02)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @vc-shell/migrate
|
|
25
|
+
|
|
1
26
|
# [2.0.0-alpha.31](https://github.com/VirtoCommerce/vc-shell/compare/v2.0.0-alpha.30...v2.0.0-alpha.31) (2026-04-01)
|
|
2
27
|
|
|
3
28
|
|
package/dist/cli.js
CHANGED
|
@@ -15,6 +15,7 @@ program
|
|
|
15
15
|
.option("--cwd <path>", "Working directory", ".")
|
|
16
16
|
.option("--update-deps", "Also update dependency versions in package.json", false)
|
|
17
17
|
.option("--exclude <patterns...>", "Additional exclude patterns for files/directories", [])
|
|
18
|
+
.option("--no-report", "Skip MIGRATION_REPORT.md generation", false)
|
|
18
19
|
.action(async (options) => {
|
|
19
20
|
const cwd = resolve(options.cwd);
|
|
20
21
|
// Pre-flight: dirty working tree check
|
|
@@ -42,6 +43,7 @@ program
|
|
|
42
43
|
list: options.list,
|
|
43
44
|
updateDeps: options.updateDeps,
|
|
44
45
|
exclude: options.exclude ?? [],
|
|
46
|
+
noReport: options.noReport ?? false,
|
|
45
47
|
});
|
|
46
48
|
});
|
|
47
49
|
program.parse();
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,kBAAkB,CAAC;KACxB,WAAW,CAAC,6DAA6D,CAAC;KAC1E,OAAO,CAAC,OAAO,CAAC;KAChB,MAAM,CAAC,gBAAgB,EAAE,4CAA4C,CAAC;KACtE,MAAM,CAAC,oBAAoB,EAAE,+BAA+B,CAAC;KAC7D,MAA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BAC5D,GAAG;gBACH,QAAQ,EAAE,OAAO;aAClB,CAAC,CAAC;YACH,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC7B,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CACV,yCAAyC;oBACvC,gEAAgE,CACnE,CACF,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,mDAAmD;QACrD,CAAC;IACH,CAAC;IAED,MAAM,GAAG,CAAC;QACR,GAAG;QACH,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE;QAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,KAAK;KACpC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function updateDependencyVersions(cwd: string, targetVersion: string, dryRun: boolean): string[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { readFileSync, existsSync } from "node:fs";
|
|
3
|
+
import writeFileAtomic from "write-file-atomic";
|
|
4
|
+
export function updateDependencyVersions(cwd, targetVersion, dryRun) {
|
|
5
|
+
const pkgPath = join(cwd, "package.json");
|
|
6
|
+
if (!existsSync(pkgPath))
|
|
7
|
+
return [];
|
|
8
|
+
const pkgRaw = readFileSync(pkgPath, "utf-8");
|
|
9
|
+
const pkg = JSON.parse(pkgRaw);
|
|
10
|
+
const changes = [];
|
|
11
|
+
for (const depType of ["dependencies", "devDependencies"]) {
|
|
12
|
+
const deps = pkg[depType];
|
|
13
|
+
if (!deps)
|
|
14
|
+
continue;
|
|
15
|
+
for (const name of Object.keys(deps)) {
|
|
16
|
+
if (name.startsWith("@vc-shell/")) {
|
|
17
|
+
const oldVersion = deps[name];
|
|
18
|
+
const newVersion = `^${targetVersion}`;
|
|
19
|
+
if (oldVersion !== newVersion) {
|
|
20
|
+
changes.push(`${name}: ${oldVersion} → ${newVersion}`);
|
|
21
|
+
deps[name] = newVersion;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (changes.length > 0 && !dryRun) {
|
|
27
|
+
writeFileAtomic.sync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
28
|
+
}
|
|
29
|
+
return changes;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=dep-updater.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dep-updater.js","sourceRoot":"","sources":["../src/dep-updater.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,MAAM,UAAU,wBAAwB,CAAC,GAAW,EAAE,aAAqB,EAAE,MAAe;IAC1F,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAC1C,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC;IAEpC,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9C,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,KAAK,MAAM,OAAO,IAAI,CAAC,cAAc,EAAE,iBAAiB,CAAU,EAAE,CAAC;QACnE,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI;YAAE,SAAS;QACpB,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACrC,IAAI,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;gBAClC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC9B,MAAM,UAAU,GAAG,IAAI,aAAa,EAAE,CAAC;gBACvC,IAAI,UAAU,KAAK,UAAU,EAAE,CAAC;oBAC9B,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,KAAK,UAAU,MAAM,UAAU,EAAE,CAAC,CAAC;oBACvD,IAAI,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC;gBAC1B,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QAClC,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { readFileSync, readdirSync, statSync, existsSync } from "node:fs";
|
|
3
|
+
import { parse as parseSFC } from "@vue/compiler-sfc";
|
|
4
|
+
export const DEFAULT_EXCLUDES = ["api_client", "*.generated.ts", "*.d.ts"];
|
|
5
|
+
export function findFiles(dir, extensions, excludes) {
|
|
6
|
+
const results = [];
|
|
7
|
+
let entries;
|
|
8
|
+
try {
|
|
9
|
+
entries = readdirSync(dir, { encoding: "utf-8" });
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return results;
|
|
13
|
+
}
|
|
14
|
+
for (const entry of entries) {
|
|
15
|
+
if (entry === "node_modules" || entry.startsWith(".") || entry === "dist")
|
|
16
|
+
continue;
|
|
17
|
+
if (excludes.includes(entry))
|
|
18
|
+
continue;
|
|
19
|
+
const full = join(dir, entry);
|
|
20
|
+
try {
|
|
21
|
+
const stat = statSync(full);
|
|
22
|
+
if (stat.isDirectory()) {
|
|
23
|
+
results.push(...findFiles(full, extensions, excludes));
|
|
24
|
+
}
|
|
25
|
+
else if (extensions.some((ext) => entry.endsWith(ext))) {
|
|
26
|
+
const excluded = excludes.some((pattern) => {
|
|
27
|
+
if (pattern.startsWith("*")) {
|
|
28
|
+
return entry.endsWith(pattern.slice(1));
|
|
29
|
+
}
|
|
30
|
+
return entry === pattern;
|
|
31
|
+
});
|
|
32
|
+
if (!excluded) {
|
|
33
|
+
results.push(full);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return results;
|
|
42
|
+
}
|
|
43
|
+
// Scan src/modules/{module}/components/notifications/{file}.vue to build a mapping
|
|
44
|
+
// of notifyType event names to file names, keyed by module directory.
|
|
45
|
+
export function collectNotifyTypeMap(srcDir) {
|
|
46
|
+
const result = new Map();
|
|
47
|
+
const modulesDir = join(srcDir, "modules");
|
|
48
|
+
if (!existsSync(modulesDir))
|
|
49
|
+
return result;
|
|
50
|
+
let moduleEntries;
|
|
51
|
+
try {
|
|
52
|
+
moduleEntries = readdirSync(modulesDir, { encoding: "utf-8" });
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
for (const moduleEntry of moduleEntries) {
|
|
58
|
+
const moduleDir = join(modulesDir, moduleEntry);
|
|
59
|
+
try {
|
|
60
|
+
if (!statSync(moduleDir).isDirectory())
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const notifDir = join(moduleDir, "components", "notifications");
|
|
67
|
+
if (!existsSync(notifDir))
|
|
68
|
+
continue;
|
|
69
|
+
const notifications = {};
|
|
70
|
+
let files;
|
|
71
|
+
try {
|
|
72
|
+
files = readdirSync(notifDir, { encoding: "utf-8" });
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
for (const file of files) {
|
|
78
|
+
if (!file.endsWith(".vue"))
|
|
79
|
+
continue;
|
|
80
|
+
try {
|
|
81
|
+
const filePath = join(notifDir, file);
|
|
82
|
+
const source = readFileSync(filePath, "utf-8");
|
|
83
|
+
const { descriptor } = parseSFC(source, { filename: filePath });
|
|
84
|
+
const scriptBlock = descriptor.scriptSetup ?? descriptor.script;
|
|
85
|
+
if (!scriptBlock)
|
|
86
|
+
continue;
|
|
87
|
+
const match = scriptBlock.content.match(/(?:defineOptions|defineBlade)\s*\(\s*\{[^}]*notifyType\s*:\s*["']([^"']+)["']/s);
|
|
88
|
+
if (match) {
|
|
89
|
+
notifications[match[1]] = file;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (Object.keys(notifications).length > 0) {
|
|
97
|
+
result.set(moduleDir, { "./components/notifications": notifications });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=file-scanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-scanner.js","sourceRoot":"","sources":["../src/file-scanner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAW,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,YAAY,EAAE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E,CAAC,CAAC;QACvD,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAAE,SAAS;YACrC,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;gBACtC,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;gBAC/C,MAAM,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;gBAChE,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,IAAI,UAAU,CAAC,MAAM,CAAC;gBAChE,IAAI,CAAC,WAAW;oBAAE,SAAS;gBAE3B,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,CACrC,gFAAgF,CACjF,CAAC;gBACF,IAAI,KAAK,EAAE,CAAC;oBACV,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;gBACjC,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;QACH,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1C,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,4BAA4B,EAAE,aAAa,EAAE,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { join, relative } from "node:path";
|
|
3
|
+
import writeFileAtomic from "write-file-atomic";
|
|
4
|
+
/** Migration guides without automated transforms — for "Not Covered" section */
|
|
5
|
+
const UNCOVERED_GUIDES = [
|
|
6
|
+
{ guide: "03-moment-to-datefns", grep: "moment", description: "moment.js → date-fns migration" },
|
|
7
|
+
{
|
|
8
|
+
guide: "08-dynamic-views-removal",
|
|
9
|
+
grep: "DynamicBladeList|DynamicBladeForm",
|
|
10
|
+
description: "Remove DynamicBladeList/DynamicBladeForm",
|
|
11
|
+
},
|
|
12
|
+
{ guide: "16-login-form", grep: "useLogin", description: "useLogin composable API changes" },
|
|
13
|
+
{ guide: "29-vc-table-to-data-table", grep: "VcTable\\b", description: "Old VcTable → VcDataTable migration" },
|
|
14
|
+
];
|
|
15
|
+
const MANUAL_TOPICS = {
|
|
16
|
+
"widgets-migration": {
|
|
17
|
+
title: "Widget System Rewrite",
|
|
18
|
+
description: "The old imperative `registerWidget()`/`unregisterWidget()` API is replaced by a declarative `useBladeWidgets()` composable. " +
|
|
19
|
+
"Widget `.vue` files for standard sidebar items are no longer needed — use headless config objects instead. " +
|
|
20
|
+
"Create a `useXxxWidgets.ts` composable in your module's `widgets/` directory.",
|
|
21
|
+
example: `\`\`\`ts
|
|
22
|
+
// OLD: imperative registration in blade page
|
|
23
|
+
const { registerWidget, clearBladeWidgets } = useWidgets();
|
|
24
|
+
const blade = inject(BladeInstance);
|
|
25
|
+
registerWidget({ id: "MyWidget", component: MyWidgetVue, props: { item } }, blade.id);
|
|
26
|
+
onUnmounted(() => clearBladeWidgets(blade.id));
|
|
27
|
+
|
|
28
|
+
// NEW: declarative composable (create widgets/useMyWidgets.ts)
|
|
29
|
+
import { useBladeWidgets, useBlade } from "@vc-shell/framework";
|
|
30
|
+
|
|
31
|
+
export function useMyWidgets(options: { item: Ref<MyItem>; isVisible: ComputedRef<boolean> }) {
|
|
32
|
+
const { openBlade } = useBlade();
|
|
33
|
+
return useBladeWidgets([
|
|
34
|
+
{
|
|
35
|
+
id: "MyWidget",
|
|
36
|
+
icon: "lucide-tag",
|
|
37
|
+
title: "MY_MODULE.WIDGETS.MY_WIDGET.TITLE",
|
|
38
|
+
badge: computed(() => options.item.value?.count ?? 0),
|
|
39
|
+
isVisible: options.isVisible,
|
|
40
|
+
onClick: () => openBlade({ name: "MyWidgetBlade" }),
|
|
41
|
+
onRefresh: () => loadData(),
|
|
42
|
+
},
|
|
43
|
+
]);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// In blade page: const { refreshAll } = useMyWidgets({ item, isVisible: computed(() => !!param.value) });
|
|
47
|
+
\`\`\``,
|
|
48
|
+
guide: "migration/13-widgets.md",
|
|
49
|
+
},
|
|
50
|
+
"use-blade-form": {
|
|
51
|
+
title: "Form Management with useBladeForm()",
|
|
52
|
+
description: "`useForm()` (vee-validate) + manual `onBeforeClose()` + `modified` tracking are replaced by a single `useBladeForm()` composable. " +
|
|
53
|
+
"Remove all three and replace with one call. `useBladeForm` handles close confirmation, modification tracking, and form validation automatically.",
|
|
54
|
+
example: `\`\`\`ts
|
|
55
|
+
// OLD:
|
|
56
|
+
import { useForm } from "vee-validate";
|
|
57
|
+
const { meta } = useForm({ validateOnMount: false });
|
|
58
|
+
const isModified = computed(() => meta.value.dirty);
|
|
59
|
+
onBeforeClose(async () => {
|
|
60
|
+
if (isModified.value) {
|
|
61
|
+
return !(await showConfirmation(t("CLOSE_CONFIRMATION")));
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// NEW:
|
|
66
|
+
import { useBladeForm } from "@vc-shell/framework";
|
|
67
|
+
const form = useBladeForm({
|
|
68
|
+
data: item, // your reactive data ref
|
|
69
|
+
closeConfirmMessage: computed(() => t("CLOSE_CONFIRMATION")),
|
|
70
|
+
});
|
|
71
|
+
// form.modified, form.isValid, form.validate(), form.resetForm(), form.setBaseline()
|
|
72
|
+
// onBeforeClose is handled automatically — DELETE it
|
|
73
|
+
\`\`\``,
|
|
74
|
+
guide: "migration/37-use-blade-form.md",
|
|
75
|
+
},
|
|
76
|
+
"remove-deprecated-aliases": {
|
|
77
|
+
title: "Injection Key Migration",
|
|
78
|
+
description: "`inject(BladeInstance)` is removed. Blade context is now provided by `useBlade()` composable — it gives you `param`, `options`, `callParent`, `closeSelf`, etc.",
|
|
79
|
+
example: `\`\`\`ts
|
|
80
|
+
// OLD:
|
|
81
|
+
const blade = inject(BladeInstance);
|
|
82
|
+
|
|
83
|
+
// NEW:
|
|
84
|
+
const { param, options, callParent, closeSelf } = useBlade();
|
|
85
|
+
\`\`\``,
|
|
86
|
+
guide: "migration/21-injection-keys.md",
|
|
87
|
+
},
|
|
88
|
+
"nswag-class-to-interface": {
|
|
89
|
+
title: "NSwag DTO Class → Interface Migration",
|
|
90
|
+
description: "API client DTOs changed from classes (with `new DtoClass()`) to interfaces (with `{} as DtoClass`). " +
|
|
91
|
+
"The migrator handles simple cases automatically. Clone-then-mutate patterns (`new X(); x.field = value;`) require manual rewrite.",
|
|
92
|
+
example: `\`\`\`ts
|
|
93
|
+
// Clone-then-mutate (manual migration):
|
|
94
|
+
// OLD:
|
|
95
|
+
const criteria = new SearchCriteria();
|
|
96
|
+
criteria.take = 20;
|
|
97
|
+
criteria.sort = "name:ASC";
|
|
98
|
+
|
|
99
|
+
// NEW:
|
|
100
|
+
const criteria = { take: 20, sort: "name:ASC" } as SearchCriteria;
|
|
101
|
+
\`\`\``,
|
|
102
|
+
guide: "migration/nswag-class-to-interface.md",
|
|
103
|
+
},
|
|
104
|
+
"blade-props-simplification": {
|
|
105
|
+
title: "Reusable Blade Components",
|
|
106
|
+
description: "Components with blade props (expanded/closable) but no `defineBlade()` were skipped — they are reusable components, not blade pages. " +
|
|
107
|
+
"If these components pass blade props to child blades, remove the forwarding — child blades should call `useBlade()` directly.",
|
|
108
|
+
example: `\`\`\`vue
|
|
109
|
+
<!-- OLD: wrapper forwarding blade props -->
|
|
110
|
+
<MyBlade :expanded="expanded" :closable="closable" :param="param"
|
|
111
|
+
@close:blade="$emit('close:blade')" />
|
|
112
|
+
|
|
113
|
+
<!-- NEW: wrapper passes only domain props, child calls useBlade() -->
|
|
114
|
+
<MyBlade :config="config" />
|
|
115
|
+
\`\`\``,
|
|
116
|
+
guide: "migration/11-blade-props.md",
|
|
117
|
+
},
|
|
118
|
+
"replace-cover-method": {
|
|
119
|
+
title: "replaceWith() Semantics Change",
|
|
120
|
+
description: "`replaceWith()` now truly destroys the old blade. If you relied on the old blade staying alive underneath, use `coverWith()` instead.",
|
|
121
|
+
example: `\`\`\`ts
|
|
122
|
+
// If old blade should stay alive (e.g. preview):
|
|
123
|
+
const { coverWith } = useBlade();
|
|
124
|
+
await coverWith({ name: "Preview", param: id });
|
|
125
|
+
|
|
126
|
+
// If old blade should be destroyed (e.g. create → edit):
|
|
127
|
+
const { replaceWith } = useBlade();
|
|
128
|
+
await replaceWith({ name: "EditOrder", param: order.id });
|
|
129
|
+
\`\`\``,
|
|
130
|
+
guide: "migration/12-replace-cover.md",
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Classify api.report() messages as informational vs actionable.
|
|
135
|
+
* Informational messages (stats, "modified", "Found N files") go to a separate section.
|
|
136
|
+
*/
|
|
137
|
+
function isInformational(msg) {
|
|
138
|
+
return (/^Registry: \d+/.test(msg) ||
|
|
139
|
+
/^Found \d+ consumer files/.test(msg) ||
|
|
140
|
+
/: modified$/.test(msg) ||
|
|
141
|
+
/^Done\. \d+ file/.test(msg) ||
|
|
142
|
+
/added .* to compilerOptions/.test(msg) ||
|
|
143
|
+
/standard boilerplate — deleted/.test(msg));
|
|
144
|
+
}
|
|
145
|
+
/** Extract file path from a report message if it starts with one */
|
|
146
|
+
function extractFilePath(msg, cwd) {
|
|
147
|
+
// Matches absolute paths or src/-relative paths at the start
|
|
148
|
+
const absMatch = msg.match(/^(\/[^\s:]+)/);
|
|
149
|
+
if (absMatch)
|
|
150
|
+
return relative(cwd, absMatch[1]);
|
|
151
|
+
const relMatch = msg.match(/^(src\/[^\s:]+)/);
|
|
152
|
+
if (relMatch)
|
|
153
|
+
return relMatch[1];
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
export function generateMigrationReport(cwd, currentVersion, targetVersion, allReports, depChanges, sourceFiles) {
|
|
157
|
+
const lines = [];
|
|
158
|
+
const date = new Date().toISOString().split("T")[0];
|
|
159
|
+
lines.push(`# Migration Report: ${currentVersion} → ${targetVersion}`);
|
|
160
|
+
lines.push(`Generated: ${date}\n`);
|
|
161
|
+
// --- Automated changes ---
|
|
162
|
+
const modified = allReports.filter((r) => r.filesModified.length > 0);
|
|
163
|
+
const totalModified = allReports.reduce((sum, r) => sum + r.filesModified.length, 0);
|
|
164
|
+
lines.push(`## Automated Changes (${totalModified} files)\n`);
|
|
165
|
+
if (modified.length > 0) {
|
|
166
|
+
for (const r of modified) {
|
|
167
|
+
lines.push(`- ✅ **${r.name}** — ${r.filesModified.length} file(s)`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
lines.push("_No automated changes applied._");
|
|
172
|
+
}
|
|
173
|
+
// --- Manual migration required (structured by topic) ---
|
|
174
|
+
// Group actionable messages by transform name
|
|
175
|
+
const actionableByTransform = new Map();
|
|
176
|
+
const informational = [];
|
|
177
|
+
for (const r of allReports) {
|
|
178
|
+
for (const msg of r.reports) {
|
|
179
|
+
if (isInformational(msg)) {
|
|
180
|
+
informational.push(msg);
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
if (!actionableByTransform.has(r.name))
|
|
184
|
+
actionableByTransform.set(r.name, []);
|
|
185
|
+
actionableByTransform.get(r.name).push(msg);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (actionableByTransform.size > 0) {
|
|
189
|
+
lines.push(`\n## Manual Migration Required\n`);
|
|
190
|
+
for (const [transformName, messages] of actionableByTransform) {
|
|
191
|
+
const topic = MANUAL_TOPICS[transformName];
|
|
192
|
+
if (topic) {
|
|
193
|
+
// Structured topic with description and example
|
|
194
|
+
lines.push(`### ${topic.title}\n`);
|
|
195
|
+
lines.push(topic.description + "\n");
|
|
196
|
+
// List affected files
|
|
197
|
+
const files = new Set();
|
|
198
|
+
for (const msg of messages) {
|
|
199
|
+
const fp = extractFilePath(msg, cwd);
|
|
200
|
+
if (fp)
|
|
201
|
+
files.add(fp);
|
|
202
|
+
}
|
|
203
|
+
if (files.size > 0) {
|
|
204
|
+
lines.push("**Affected files:**");
|
|
205
|
+
for (const f of files) {
|
|
206
|
+
lines.push(`- \`${f}\``);
|
|
207
|
+
}
|
|
208
|
+
lines.push("");
|
|
209
|
+
}
|
|
210
|
+
// Before/after example
|
|
211
|
+
lines.push(topic.example + "\n");
|
|
212
|
+
if (topic.guide) {
|
|
213
|
+
lines.push(`> See: [${topic.guide}](${topic.guide})\n`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
// Unknown topic — fallback to raw messages
|
|
218
|
+
lines.push(`### ${transformName}\n`);
|
|
219
|
+
for (const msg of messages) {
|
|
220
|
+
lines.push(`- ${msg}`);
|
|
221
|
+
}
|
|
222
|
+
lines.push("");
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
// --- Rolled back ---
|
|
227
|
+
const rolledBack = allReports.flatMap((r) => r.filesRolledBack.map((f) => ({ transform: r.name, ...f })));
|
|
228
|
+
if (rolledBack.length > 0) {
|
|
229
|
+
lines.push(`\n## Rolled Back (parse errors)\n`);
|
|
230
|
+
for (const item of rolledBack) {
|
|
231
|
+
lines.push(`- ⟲ **${item.transform}** — \`${item.path}\`: ${item.error}`);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
// --- Dependencies updated ---
|
|
235
|
+
if (depChanges.length > 0) {
|
|
236
|
+
lines.push(`## Dependencies Updated\n`);
|
|
237
|
+
for (const c of depChanges) {
|
|
238
|
+
lines.push(`- ${c}`);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
// --- Not covered by migrator ---
|
|
242
|
+
const allSource = sourceFiles
|
|
243
|
+
.map((f) => {
|
|
244
|
+
try {
|
|
245
|
+
return readFileSync(f, "utf-8");
|
|
246
|
+
}
|
|
247
|
+
catch {
|
|
248
|
+
return "";
|
|
249
|
+
}
|
|
250
|
+
})
|
|
251
|
+
.join("\n");
|
|
252
|
+
const relevant = UNCOVERED_GUIDES.filter((g) => new RegExp(g.grep).test(allSource));
|
|
253
|
+
if (relevant.length > 0) {
|
|
254
|
+
lines.push(`\n## Not Covered by Migrator\n`);
|
|
255
|
+
lines.push("_These migration guides may be relevant — check manually:_\n");
|
|
256
|
+
for (const g of relevant) {
|
|
257
|
+
lines.push(`- **${g.guide}** — ${g.description}`);
|
|
258
|
+
lines.push(` Check: \`grep -rn "${g.grep}" src/\``);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// --- Informational log ---
|
|
262
|
+
if (informational.length > 0) {
|
|
263
|
+
lines.push(`\n<details>\n<summary>Transform Log (${informational.length} entries)</summary>\n`);
|
|
264
|
+
for (const msg of informational) {
|
|
265
|
+
lines.push(`- ${msg}`);
|
|
266
|
+
}
|
|
267
|
+
lines.push(`\n</details>`);
|
|
268
|
+
}
|
|
269
|
+
writeFileAtomic.sync(join(cwd, "MIGRATION_REPORT.md"), lines.join("\n") + "\n");
|
|
270
|
+
}
|
|
271
|
+
//# sourceMappingURL=report-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-generator.js","sourceRoot":"","sources":["../src/report-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAGhD,gFAAgF;AAChF,MAAM,gBAAgB,GAAG;IACvB,EAAE,KAAK,EAAE,sBAAsB,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE;IAChG;QACE,KAAK,EAAE,0BAA0B;QACjC,IAAI,EAAE,mCAAmC;QACzC,WAAW,EAAE,0CA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
|
3
4
|
to?: string;
|
|
4
5
|
transform?: string;
|
|
5
6
|
dryRun: boolean;
|
|
6
7
|
list: boolean;
|
|
8
|
+
noReport?: boolean;
|
|
7
9
|
updateDeps?: boolean;
|
|
8
10
|
exclude?: string[];
|
|
9
11
|
}
|
|
10
12
|
export declare function run(options: RunOptions): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Kahn's algorithm: topological sort with stable ordering for unrelated nodes.
|
|
15
|
+
*/
|
|
16
|
+
export declare function topologicalSort(transforms: VersionedTransform[]): VersionedTransform[];
|