@vc-shell/migrate 2.0.0-alpha.32 → 2.0.0-alpha.33-pr220.455e322

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 (88) hide show
  1. package/CHANGELOG.md +61 -45
  2. package/README.md +65 -40
  3. package/dist/baseline-versions.d.ts +11 -0
  4. package/dist/baseline-versions.js +52 -0
  5. package/dist/baseline-versions.js.map +1 -0
  6. package/dist/cli.js +2 -0
  7. package/dist/cli.js.map +1 -1
  8. package/dist/dep-updater.d.ts +8 -0
  9. package/dist/dep-updater.js +60 -0
  10. package/dist/dep-updater.js.map +1 -0
  11. package/dist/file-scanner.d.ts +3 -0
  12. package/dist/file-scanner.js +102 -0
  13. package/dist/file-scanner.js.map +1 -0
  14. package/dist/report-generator.d.ts +2 -0
  15. package/dist/report-generator.js +311 -0
  16. package/dist/report-generator.js.map +1 -0
  17. package/dist/runner.d.ts +6 -0
  18. package/dist/runner.js +184 -269
  19. package/dist/runner.js.map +1 -1
  20. package/dist/sfc-processor.d.ts +12 -0
  21. package/dist/sfc-processor.js +54 -0
  22. package/dist/sfc-processor.js.map +1 -0
  23. package/dist/transforms/blade-events-cleanup.d.ts +4 -0
  24. package/dist/transforms/blade-events-cleanup.js +50 -0
  25. package/dist/transforms/blade-events-cleanup.js.map +1 -0
  26. package/dist/transforms/blade-props-simplification.js +10 -2
  27. package/dist/transforms/blade-props-simplification.js.map +1 -1
  28. package/dist/transforms/define-app-module.js +8 -4
  29. package/dist/transforms/define-app-module.js.map +1 -1
  30. package/dist/transforms/define-expose-to-children.d.ts +4 -0
  31. package/dist/transforms/define-expose-to-children.js +97 -0
  32. package/dist/transforms/define-expose-to-children.js.map +1 -0
  33. package/dist/transforms/dynamic-properties-refactor.js +1 -1
  34. package/dist/transforms/dynamic-properties-refactor.js.map +1 -1
  35. package/dist/transforms/icon-audit.js +20 -24
  36. package/dist/transforms/icon-audit.js.map +1 -1
  37. package/dist/transforms/icon-replace.d.ts +4 -0
  38. package/dist/transforms/icon-replace.js +108 -0
  39. package/dist/transforms/icon-replace.js.map +1 -0
  40. package/dist/transforms/locale-imports.d.ts +4 -0
  41. package/dist/transforms/locale-imports.js +23 -0
  42. package/dist/transforms/locale-imports.js.map +1 -0
  43. package/dist/transforms/registry.js +134 -4
  44. package/dist/transforms/registry.js.map +1 -1
  45. package/dist/transforms/remove-app-module-options.d.ts +16 -0
  46. package/dist/transforms/remove-app-module-options.js +50 -0
  47. package/dist/transforms/remove-app-module-options.js.map +1 -0
  48. package/dist/transforms/remove-deprecated-aliases.js +12 -1
  49. package/dist/transforms/remove-deprecated-aliases.js.map +1 -1
  50. package/dist/transforms/remove-expose-title.d.ts +4 -0
  51. package/dist/transforms/remove-expose-title.js +52 -0
  52. package/dist/transforms/remove-expose-title.js.map +1 -0
  53. package/dist/transforms/remove-global-components.d.ts +8 -0
  54. package/dist/transforms/remove-global-components.js +236 -0
  55. package/dist/transforms/remove-global-components.js.map +1 -0
  56. package/dist/transforms/remove-pathmatch-route.d.ts +17 -0
  57. package/dist/transforms/remove-pathmatch-route.js +74 -0
  58. package/dist/transforms/remove-pathmatch-route.js.map +1 -0
  59. package/dist/transforms/remove-release-config.d.ts +4 -0
  60. package/dist/transforms/remove-release-config.js +58 -0
  61. package/dist/transforms/remove-release-config.js.map +1 -0
  62. package/dist/transforms/replace-cover-method.d.ts +4 -0
  63. package/dist/transforms/replace-cover-method.js +77 -0
  64. package/dist/transforms/replace-cover-method.js.map +1 -0
  65. package/dist/transforms/types.d.ts +2 -0
  66. package/dist/transforms/use-assets-migration.js +12 -12
  67. package/dist/transforms/use-assets-migration.js.map +1 -1
  68. package/dist/transforms/use-blade-form.js +23 -129
  69. package/dist/transforms/use-blade-form.js.map +1 -1
  70. package/dist/transforms/use-blade-migration.js +14 -2
  71. package/dist/transforms/use-blade-migration.js.map +1 -1
  72. package/dist/transforms/use-data-table-pagination-audit.d.ts +4 -0
  73. package/dist/transforms/use-data-table-pagination-audit.js +42 -0
  74. package/dist/transforms/use-data-table-pagination-audit.js.map +1 -0
  75. package/dist/transforms/vc-blade-loading-prop.d.ts +4 -0
  76. package/dist/transforms/vc-blade-loading-prop.js +89 -0
  77. package/dist/transforms/vc-blade-loading-prop.js.map +1 -0
  78. package/dist/transforms/vctable-audit.d.ts +4 -0
  79. package/dist/transforms/vctable-audit.js +14 -0
  80. package/dist/transforms/vctable-audit.js.map +1 -0
  81. package/dist/transforms/widgets-migration.js +20 -23
  82. package/dist/transforms/widgets-migration.js.map +1 -1
  83. package/dist/transforms/window-globals.d.ts +4 -0
  84. package/dist/transforms/window-globals.js +24 -0
  85. package/dist/transforms/window-globals.js.map +1 -0
  86. package/dist/utils/import-dedup.js +1 -1
  87. package/dist/utils/import-dedup.js.map +1 -1
  88. package/package.json +1 -1
@@ -4,6 +4,13 @@ import { resolve, dirname } from "node:path";
4
4
  const __dirname = dirname(fileURLToPath(import.meta.url));
5
5
  const t = (name) => resolve(__dirname, `${name}.js`);
6
6
  export const transforms = [
7
+ {
8
+ name: "remove-release-config",
9
+ description: "Remove deprecated @vc-shell/release-config and scripts/release.ts",
10
+ introducedIn: "2.0.0",
11
+ scope: "project",
12
+ transformPath: t("remove-release-config"),
13
+ },
7
14
  {
8
15
  name: "define-app-module",
9
16
  description: "createAppModule(pages, locales) → defineAppModule({...})",
@@ -42,6 +49,24 @@ export const transforms = [
42
49
  description: "Remove boilerplate expanded/closable props and blade event emits",
43
50
  introducedIn: "2.0.0",
44
51
  transformPath: t("blade-props-simplification"),
52
+ after: ["define-options-to-blade"],
53
+ },
54
+ {
55
+ name: "define-expose-to-children",
56
+ description: "defineExpose() → exposeToChildren() from useBlade() in blade pages",
57
+ introducedIn: "2.0.0",
58
+ migrationGuideSection: "Guide 11",
59
+ transformPath: t("define-expose-to-children"),
60
+ fileExtensions: [".vue"],
61
+ after: ["define-options-to-blade"],
62
+ },
63
+ {
64
+ name: "blade-events-cleanup",
65
+ description: "Remove @parent:call, @close:blade, @collapse:blade, @expand:blade from all .vue files",
66
+ introducedIn: "2.0.0",
67
+ transformPath: t("blade-events-cleanup"),
68
+ fileExtensions: [".vue"],
69
+ after: ["blade-props-simplification"],
45
70
  },
46
71
  {
47
72
  name: "define-options-to-blade",
@@ -50,14 +75,22 @@ export const transforms = [
50
75
  migrationGuideSection: "defineBlade macro",
51
76
  transformPath: t("define-options-to-blade"),
52
77
  fileExtensions: [".vue"],
78
+ after: ["use-blade-migration"],
79
+ },
80
+ {
81
+ name: "icon-replace",
82
+ description: "Replace well-known material-/bi-/fa- icons with lucide equivalents",
83
+ introducedIn: "2.0.0",
84
+ transformPath: t("icon-replace"),
53
85
  },
54
86
  {
55
87
  name: "icon-audit",
56
- description: "Detect Font Awesome icons, report with suggested replacements (diagnostic-only)",
88
+ description: "Detect non-lucide icons (material-/bi-/fa-) and suggest lucide replacements (diagnostic-only)",
57
89
  introducedIn: "2.0.0",
58
90
  diagnosticOnly: true,
59
91
  migrationGuideSection: "Section 2",
60
92
  transformPath: t("icon-audit"),
93
+ after: ["icon-replace"],
61
94
  },
62
95
  {
63
96
  name: "scss-safe-use",
@@ -133,6 +166,15 @@ export const transforms = [
133
166
  diagnosticOnly: true,
134
167
  transformPath: t("manual-migration-audit"),
135
168
  },
169
+ {
170
+ name: "vctable-audit",
171
+ description: "Detect <VcTable> usage for migration to <VcDataTable> (diagnostic-only)",
172
+ introducedIn: "2.0.0",
173
+ diagnosticOnly: true,
174
+ migrationGuideSection: "VcTable → VcDataTable",
175
+ transformPath: t("vctable-audit"),
176
+ fileExtensions: [".vue"],
177
+ },
136
178
  {
137
179
  name: "nswag-class-to-interface",
138
180
  description: "Migrate consumer code from NSwag class-based to interface-based DTOs",
@@ -147,6 +189,14 @@ export const transforms = [
147
189
  migrationGuideSection: "Guide 32",
148
190
  transformPath: t("use-assets-migration"),
149
191
  },
192
+ {
193
+ name: "replace-cover-method",
194
+ description: "openBlade({ replaceCurrentBlade: true }) → coverWith()",
195
+ introducedIn: "2.0.0",
196
+ migrationGuideSection: "Guide 12",
197
+ transformPath: t("replace-cover-method"),
198
+ fileExtensions: [".vue", ".ts"],
199
+ },
150
200
  {
151
201
  name: "app-hub-rename",
152
202
  description: "disableAppSwitcher → disableAppHub, #app-switcher → #app-hub, useAppSwitcher → useAppHub",
@@ -165,12 +215,28 @@ export const transforms = [
165
215
  },
166
216
  {
167
217
  name: "use-blade-form",
168
- description: "Detect useForm + useBeforeUnload patterns for migration to useBladeForm()",
218
+ description: "Detect useForm + useBeforeUnload + useModificationTracker patterns for migration to useBladeForm()",
169
219
  introducedIn: "2.0.0-alpha.31",
170
220
  diagnosticOnly: true,
171
221
  migrationGuideSection: "Guide 37",
172
222
  transformPath: t("use-blade-form"),
173
- fileExtensions: [".vue"],
223
+ fileExtensions: [".vue", ".ts"],
224
+ },
225
+ {
226
+ name: "remove-pathmatch-route",
227
+ description: "Remove /:pathMatch(.*)* catch-all route (now built into framework)",
228
+ introducedIn: "2.0.0",
229
+ transformPath: t("remove-pathmatch-route"),
230
+ fileExtensions: [".ts"],
231
+ after: ["use-blade-migration"],
232
+ },
233
+ {
234
+ name: "locale-imports",
235
+ description: "@vc-shell/framework/dist/locales/*.json → @vc-shell/framework/locales/*",
236
+ introducedIn: "2.0.0",
237
+ migrationGuideSection: "Guide 33",
238
+ transformPath: t("locale-imports"),
239
+ fileExtensions: [".ts"],
174
240
  },
175
241
  {
176
242
  name: "dynamic-properties-refactor",
@@ -180,6 +246,54 @@ export const transforms = [
180
246
  transformPath: t("dynamic-properties-refactor"),
181
247
  fileExtensions: [".vue"],
182
248
  },
249
+ {
250
+ name: "window-globals",
251
+ description: "Detect removed window.Vue/window._/window.moment globals",
252
+ introducedIn: "2.0.0",
253
+ diagnosticOnly: true,
254
+ migrationGuideSection: "Guide 04",
255
+ transformPath: t("window-globals"),
256
+ },
257
+ {
258
+ name: "remove-global-components",
259
+ description: "Add explicit imports for globally registered Vc* components and directives",
260
+ introducedIn: "2.0.0-alpha.32",
261
+ migrationGuideSection: "Guide 40",
262
+ transformPath: t("remove-global-components"),
263
+ fileExtensions: [".vue"],
264
+ },
265
+ {
266
+ name: "remove-expose-title",
267
+ description: "Remove deprecated `title` from exposeToChildren({...}) — computed refs no longer allowed",
268
+ introducedIn: "2.0.0-alpha.33",
269
+ transformPath: t("remove-expose-title"),
270
+ fileExtensions: [".vue", ".ts"],
271
+ after: ["define-expose-to-children"],
272
+ },
273
+ {
274
+ name: "remove-app-module-options",
275
+ description: "Remove `{ router }` second argument from .use(AppModule, { router }) — defineAppModule takes no options",
276
+ introducedIn: "2.0.0-alpha.33",
277
+ transformPath: t("remove-app-module-options"),
278
+ fileExtensions: [".ts"],
279
+ after: ["define-app-module"],
280
+ },
281
+ {
282
+ name: "vc-blade-loading-prop",
283
+ description: 'Convert <VcBlade v-loading="X"> to <VcBlade :loading="X"> — use built-in blade loading prop',
284
+ introducedIn: "2.0.0-alpha.33",
285
+ transformPath: t("vc-blade-loading-prop"),
286
+ fileExtensions: [".vue"],
287
+ },
288
+ {
289
+ name: "use-data-table-pagination-audit",
290
+ description: "Detect manual pagination boilerplate (totalCount/pages/currentPage triple, onPaginationClick) — migrate to useDataTablePagination",
291
+ introducedIn: "2.0.0-alpha.33",
292
+ diagnosticOnly: true,
293
+ migrationGuideSection: "Guide 41",
294
+ transformPath: t("use-data-table-pagination-audit"),
295
+ fileExtensions: [".ts", ".vue"],
296
+ },
183
297
  ];
184
298
  export function selectTransforms(currentVersion, targetVersion) {
185
299
  const current = semver.parse(currentVersion);
@@ -192,7 +306,23 @@ export function selectTransforms(currentVersion, targetVersion) {
192
306
  const introduced = semver.parse(t.introducedIn);
193
307
  if (!introduced)
194
308
  return false;
195
- return semver.lt(currentVersion, t.introducedIn) && semver.lte(t.introducedIn, targetVersion);
309
+ if (!semver.lt(currentVersion, t.introducedIn))
310
+ return false;
311
+ // Normal case: introducedIn <= targetVersion
312
+ if (semver.lte(t.introducedIn, targetVersion))
313
+ return true;
314
+ // Special case: target is a prerelease (e.g. 2.0.0-alpha.32) and introducedIn
315
+ // is the corresponding stable release (e.g. 2.0.0) with no prerelease tag.
316
+ // Prereleases are on the path to that release, so include the transform.
317
+ // Without this, semver.lte("2.0.0", "2.0.0-alpha.32") returns false.
318
+ if (target.prerelease.length > 0 &&
319
+ introduced.prerelease.length === 0 &&
320
+ target.major === introduced.major &&
321
+ target.minor === introduced.minor &&
322
+ target.patch === introduced.patch) {
323
+ return true;
324
+ }
325
+ return false;
196
326
  });
197
327
  }
198
328
  //# sourceMappingURL=registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/transforms/registry.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG7C,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,IAAI,KAAK,CAAC,CAAC;AAE7D,MAAM,CAAC,MAAM,UAAU,GAAyB;IAC9C;QACE,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,0DAA0D;QACvE,YAAY,EAAE,eAAe;QAC7B,qBAAqB,EAAE,8BAA8B;QACrD,aAAa,EAAE,CAAC,CAAC,mBAAmB,CAAC;KACtC;IACD;QACE,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,qEAAqE;QAClF,YAAY,EAAE,eAAe;QAC7B,qBAAqB,EAAE,YAAY;QACnC,aAAa,EAAE,CAAC,CAAC,qBAAqB,CAAC;KACxC;IACD;QACE,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,0CAA0C;QACvD,YAAY,EAAE,gBAAgB;QAC9B,qBAAqB,EAAE,+B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CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;QAChD,IAAI,CAAC,UAAU;YAAE,OAAO,KAAK,CAAC;QAC9B,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC,YAAY,CAAC;YAAE,OAAO,KAAK,CAAC;QAE7D,6CAA6C;QAC7C,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,EAAE,aAAa,CAAC;YAAE,OAAO,IAAI,CAAC;QAE3D,8EAA8E;QAC9E,2EAA2E;QAC3E,yEAAyE;QACzE,qEAAqE;QACrE,IACE,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;YAC5B,UAAU,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;YAClC,MAAM,CAAC,KAAK,KAAK,UAAU,CAAC,KAAK;YACjC,MAAM,CAAC,KAAK,KAAK,UAAU,CAAC,KAAK;YACjC,MAAM,CAAC,KAAK,KAAK,UAAU,CAAC,KAAK,EACjC,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { Transform } from "./types.js";
2
+ /**
3
+ * Remove `{ router }` second argument from `.use(SomeAppModule, { router })`.
4
+ *
5
+ * `defineAppModule()` in v2 returns `{ install(app: App): void }` — it takes
6
+ * NO options. The legacy `{ router }` argument is a leftover from the older
7
+ * module shape and now causes a TS2769 overload error.
8
+ *
9
+ * Narrow match: only when the second argument is an ObjectExpression with a
10
+ * single property named `router` (shorthand or explicit). This avoids
11
+ * touching framework-style calls like `.use(VirtoShellFramework, { router, i18n: {...} })`
12
+ * which legitimately accept multi-key options.
13
+ */
14
+ declare const transform: Transform;
15
+ export default transform;
16
+ export declare const parser = "tsx";
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Remove `{ router }` second argument from `.use(SomeAppModule, { router })`.
3
+ *
4
+ * `defineAppModule()` in v2 returns `{ install(app: App): void }` — it takes
5
+ * NO options. The legacy `{ router }` argument is a leftover from the older
6
+ * module shape and now causes a TS2769 overload error.
7
+ *
8
+ * Narrow match: only when the second argument is an ObjectExpression with a
9
+ * single property named `router` (shorthand or explicit). This avoids
10
+ * touching framework-style calls like `.use(VirtoShellFramework, { router, i18n: {...} })`
11
+ * which legitimately accept multi-key options.
12
+ */
13
+ const transform = (fileInfo, api, _options) => {
14
+ if (!fileInfo.path.endsWith(".ts"))
15
+ return null;
16
+ const j = api.jscodeshift;
17
+ const root = j(fileInfo.source);
18
+ let modified = false;
19
+ root.find(j.CallExpression).forEach((path) => {
20
+ const callee = path.node.callee;
21
+ // Match `<something>.use(X, Y)` — callee is MemberExpression with property `.use`
22
+ if (callee.type !== "MemberExpression")
23
+ return;
24
+ if (callee.property.type !== "Identifier" || callee.property.name !== "use")
25
+ return;
26
+ const args = path.node.arguments;
27
+ if (args.length !== 2)
28
+ return;
29
+ const secondArg = args[1];
30
+ if (secondArg.type !== "ObjectExpression")
31
+ return;
32
+ if (secondArg.properties.length !== 1)
33
+ return;
34
+ const prop = secondArg.properties[0];
35
+ const isProperty = prop.type === "ObjectProperty" || prop.type === "Property";
36
+ if (!isProperty)
37
+ return;
38
+ if (prop.key?.type !== "Identifier" || prop.key.name !== "router")
39
+ return;
40
+ // Remove the second argument — .use(X, { router }) → .use(X)
41
+ path.node.arguments = [args[0]];
42
+ modified = true;
43
+ });
44
+ if (!modified)
45
+ return null;
46
+ return root.toSource();
47
+ };
48
+ export default transform;
49
+ export const parser = "tsx";
50
+ //# sourceMappingURL=remove-app-module-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-app-module-options.js","sourceRoot":"","sources":["../../src/transforms/remove-app-module-options.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AAEH,MAAM,SAAS,GAAc,CAAC,QAAkB,EAAE,GAAQ,EAAE,QAAiB,EAAiB,EAAE;IAC9F,IAAI,CAAC,QAAQ,CAAC,IAAI,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CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAChC,QAAQ,GAAG,IAAI,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3B,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;AACzB,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC;AACzB,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC"}
@@ -1,10 +1,14 @@
1
1
  import { wrapForSFC } from "../utils/vue-sfc-wrapper.js";
2
2
  const RENAME_MAP = {
3
3
  navigationViewLocation: "NavigationViewLocationKey",
4
- BladeInstance: "BladeInstanceKey",
5
4
  BLADE_BACK_BUTTON: "BladeBackButtonKey",
6
5
  TOOLBAR_SERVICE: "ToolbarServiceKey",
7
6
  EMBEDDED_MODE: "EmbeddedModeKey",
7
+ NotificationTemplatesSymbol: "NotificationTemplatesKey",
8
+ };
9
+ // Symbols that require manual migration (API changed, not just renamed)
10
+ const MANUAL_MIGRATION = {
11
+ BladeInstance: "inject(BladeInstance) removed. Use `useBlade()` composable instead — blade context is now provided by useBlade(). See migration guide.",
8
12
  };
9
13
  function coreTransform(fileInfo, api, _options) {
10
14
  const j = api.jscodeshift;
@@ -21,6 +25,13 @@ function coreTransform(fileInfo, api, _options) {
21
25
  renames.push({ old: name, new: RENAME_MAP[name] });
22
26
  }
23
27
  });
28
+ // Check for symbols requiring manual migration
29
+ frameworkImports.find(j.ImportSpecifier).forEach((path) => {
30
+ const name = path.node.imported.type === "Identifier" ? path.node.imported.name : "";
31
+ if (MANUAL_MIGRATION[name]) {
32
+ api.report(`${fileInfo.path}: ${MANUAL_MIGRATION[name]}`);
33
+ }
34
+ });
24
35
  if (renames.length === 0)
25
36
  return null;
26
37
  for (const r of renames) {
@@ -1 +1 @@
1
- {"version":3,"file":"remove-deprecated-aliases.js","sourceRoot":"","sources":["../../src/transforms/remove-deprecated-aliases.ts"],"names":[],"mappings":"AACA,OAA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GAAG,CAAC,CAAC,GAAG,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;AACzB,CAAC;AAED,eAAe,UAAU,CAAC,aAAa,CAAc,CAAC;AACtD,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Transform } from "./types.js";
2
+ declare const _default: Transform;
3
+ export default _default;
4
+ export declare const parser = "tsx";
@@ -0,0 +1,52 @@
1
+ import { wrapForSFC } from "../utils/vue-sfc-wrapper.js";
2
+ /**
3
+ * Remove `title` property from `exposeToChildren({...})` calls.
4
+ *
5
+ * In v2, exposeToChildren is function-only — it registers callable methods in
6
+ * the blade messaging system. Passing a reactive `title` (ComputedRef<string>)
7
+ * trips the TS signature `(...args: any[]) => any` check, and the value is no
8
+ * longer used by the blade chrome anyway.
9
+ *
10
+ * If `title` is the only property, the entire exposeToChildren() call is
11
+ * removed. Otherwise, only the `title` key is stripped.
12
+ */
13
+ function coreTransform(fileInfo, api, _options) {
14
+ const j = api.jscodeshift;
15
+ const root = j(fileInfo.source);
16
+ const calls = root.find(j.CallExpression, { callee: { name: "exposeToChildren" } });
17
+ if (calls.size() === 0)
18
+ return null;
19
+ let modified = false;
20
+ calls.forEach((path) => {
21
+ const args = path.node.arguments;
22
+ if (args.length === 0)
23
+ return;
24
+ const arg = args[0];
25
+ if (arg.type !== "ObjectExpression")
26
+ return;
27
+ const titleIdx = arg.properties.findIndex((p) => (p.type === "ObjectProperty" || p.type === "Property") &&
28
+ p.key?.type === "Identifier" &&
29
+ p.key.name === "title");
30
+ if (titleIdx === -1)
31
+ return;
32
+ arg.properties.splice(titleIdx, 1);
33
+ modified = true;
34
+ // If nothing else remains, remove the whole statement
35
+ if (arg.properties.length === 0) {
36
+ // Walk up to the enclosing ExpressionStatement (if any) and remove it
37
+ let parent = path.parent;
38
+ while (parent && parent.node.type !== "ExpressionStatement" && parent.node.type !== "Program") {
39
+ parent = parent.parent;
40
+ }
41
+ if (parent && parent.node.type === "ExpressionStatement") {
42
+ j(parent).remove();
43
+ }
44
+ }
45
+ });
46
+ if (!modified)
47
+ return null;
48
+ return root.toSource();
49
+ }
50
+ export default wrapForSFC(coreTransform);
51
+ export const parser = "tsx";
52
+ //# sourceMappingURL=remove-expose-title.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-expose-title.js","sourceRoot":"","sources":["../../src/transforms/remove-expose-title.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGzD;;;;;;;;;;GAUG;AAEH,SAAS,aAAa,CAAC,QAAkB,EAAE,GAAQ,EAAE,QAAiB;IACpE,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC;IAC1B,MAAM,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEhC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACpF,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEpC,IAAI,QAAQ,GAAG,KAAK,CAAC;IAErB,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;QACjC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAE9B,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,GAAG,CAAC,IAAI,KAAK,kBAAkB;YAAE,OAAO;QAE5C,MAAM,QAAQ,GAAG,GAAG,CAAC,UAAU,CAAC,SAAS,CACvC,CAAC,CAAM,EAAE,EAAE,CACT,CAAC,CAAC,CAAC,IAAI,KAAK,gBAAgB,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC;YACtD,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,YAAY;YAC5B,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,OAAO,CACzB,CAAC;QAEF,IAAI,QAAQ,KAAK,CAAC,CAAC;YAAE,OAAO;QAE5B,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QACnC,QAAQ,GAAG,IAAI,CAAC;QAEhB,sDAAsD;QACtD,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,sEAAsE;YACtE,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YACzB,OAAO,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,qBAAqB,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;gBAC9F,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;YACzB,CAAC;YACD,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,qBAAqB,EAAE,CAAC;gBACzD,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;YACrB,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3B,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;AACzB,CAAC;AAED,eAAe,UAAU,CAAC,aAAa,CAAc,CAAC;AACtD,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Transform } from "./types.js";
2
+ /**
3
+ * Codemod: add explicit imports for globally registered Vc* components and directives.
4
+ * Also moves component/directive imports from @vc-shell/framework to @vc-shell/framework/ui.
5
+ */
6
+ declare const transform: Transform;
7
+ export default transform;
8
+ export declare const parser = "tsx";
@@ -0,0 +1,236 @@
1
+ import { parse as parseSFC } from "@vue/compiler-sfc";
2
+ /**
3
+ * All Vc* component names exported from @vc-shell/framework/ui.
4
+ * Used to detect usage in templates and add explicit imports.
5
+ */
6
+ const UI_COMPONENTS = new Set([
7
+ // Atoms
8
+ "VcBadge",
9
+ "VcBanner",
10
+ "VcButton",
11
+ "VcButtonGroup",
12
+ "VcCard",
13
+ "VcCol",
14
+ "VcContainer",
15
+ "VcHint",
16
+ "VcIcon",
17
+ "VcImage",
18
+ "VcLabel",
19
+ "VcLink",
20
+ "VcLoading",
21
+ "VcProgress",
22
+ "VcRow",
23
+ "VcScrollableContainer",
24
+ "VcSkeleton",
25
+ "VcStatus",
26
+ "VcStatusIcon",
27
+ "VcTooltip",
28
+ "VcVideo",
29
+ "VcWidget",
30
+ // Molecules
31
+ "VcLanguageSelector",
32
+ "VcAccordion",
33
+ "VcAccordionItem",
34
+ "VcBreadcrumbs",
35
+ "VcCheckbox",
36
+ "VcCheckboxGroup",
37
+ "VcColorInput",
38
+ "VcDatePicker",
39
+ "VcDropdown",
40
+ "VcDropdownItem",
41
+ "VcDropdownPanel",
42
+ "VcEditor",
43
+ "VcField",
44
+ "VcFileUpload",
45
+ "VcForm",
46
+ "VcImageTile",
47
+ "VcInput",
48
+ "VcInputCurrency",
49
+ "VcInputGroup",
50
+ "VcMenu",
51
+ "VcMenuItem",
52
+ "VcMenuGroup",
53
+ "VcMultivalue",
54
+ "VcPagination",
55
+ "VcRadioButton",
56
+ "VcRadioGroup",
57
+ "VcRating",
58
+ "VcSelect",
59
+ "VcSlider",
60
+ "VcSwitch",
61
+ "VcTextarea",
62
+ "VcToast",
63
+ // Organisms
64
+ "VcApp",
65
+ "VcAuthLayout",
66
+ "VcBlade",
67
+ "VcTable",
68
+ "VcDataTable",
69
+ "VcColumn",
70
+ "VcDynamicProperty",
71
+ "VcGallery",
72
+ "VcImageUpload",
73
+ "VcPopup",
74
+ "VcSidebar",
75
+ ]);
76
+ /**
77
+ * Directives exported from @vc-shell/framework/ui.
78
+ * Template directive name (without v-) -> script variable name.
79
+ */
80
+ const DIRECTIVES = {
81
+ loading: "vLoading",
82
+ autofocus: "vAutofocus",
83
+ };
84
+ const FRAMEWORK_UI_SOURCE = "@vc-shell/framework/ui";
85
+ const FRAMEWORK_MAIN_SOURCE = "@vc-shell/framework";
86
+ /** Convert kebab-case to PascalCase: "vc-button" -> "VcButton" */
87
+ function kebabToPascal(name) {
88
+ return name
89
+ .split("-")
90
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
91
+ .join("");
92
+ }
93
+ /**
94
+ * Scan template string for Vc* component tags and framework directives.
95
+ */
96
+ function scanTemplate(templateContent) {
97
+ const components = new Set();
98
+ const directives = new Set();
99
+ // Match <VcFoo or <vc-foo (self-closing and open tags)
100
+ const tagRegex = /<(Vc[A-Z]\w+|vc-[\w-]+)[\s/>]/g;
101
+ let match;
102
+ while ((match = tagRegex.exec(templateContent)) !== null) {
103
+ let name = match[1];
104
+ if (name.includes("-")) {
105
+ name = kebabToPascal(name);
106
+ }
107
+ if (UI_COMPONENTS.has(name)) {
108
+ components.add(name);
109
+ }
110
+ }
111
+ // Match v-loading, v-autofocus
112
+ for (const [directiveName, varName] of Object.entries(DIRECTIVES)) {
113
+ const re = new RegExp(`v-${directiveName}(?=[\\s=>/"'])`, "g");
114
+ if (re.test(templateContent)) {
115
+ directives.add(varName);
116
+ }
117
+ }
118
+ return { components, directives };
119
+ }
120
+ /** Set of all names that belong in @vc-shell/framework/ui */
121
+ const UI_NAMES = new Set([...UI_COMPONENTS, ...Object.values(DIRECTIVES)]);
122
+ /**
123
+ * Codemod: add explicit imports for globally registered Vc* components and directives.
124
+ * Also moves component/directive imports from @vc-shell/framework to @vc-shell/framework/ui.
125
+ */
126
+ const transform = (fileInfo, api, _options) => {
127
+ if (!fileInfo.path.endsWith(".vue"))
128
+ return null;
129
+ const { descriptor } = parseSFC(fileInfo.source, { filename: fileInfo.path });
130
+ const scriptBlock = descriptor.scriptSetup ?? descriptor.script;
131
+ if (!scriptBlock)
132
+ return null;
133
+ const templateContent = descriptor.template?.content;
134
+ if (!templateContent)
135
+ return null;
136
+ const { components: usedComponents, directives: usedDirectives } = scanTemplate(templateContent);
137
+ if (usedComponents.size === 0 && usedDirectives.size === 0)
138
+ return null;
139
+ const j = api.jscodeshift;
140
+ const root = j(scriptBlock.content);
141
+ let changed = false;
142
+ // Track what is already imported (from any source)
143
+ const alreadyImported = new Set();
144
+ root.find(j.ImportDeclaration).forEach((path) => {
145
+ for (const spec of path.node.specifiers || []) {
146
+ if (spec.type === "ImportSpecifier" && spec.imported.type === "Identifier") {
147
+ alreadyImported.add(spec.imported.name);
148
+ }
149
+ }
150
+ });
151
+ // Track UI names that need to be moved from @vc-shell/framework to /ui
152
+ const movedToUi = new Set();
153
+ // Move component/directive imports from @vc-shell/framework -> /ui
154
+ root.find(j.ImportDeclaration).forEach((path) => {
155
+ if (path.node.source.value !== FRAMEWORK_MAIN_SOURCE)
156
+ return;
157
+ const specifiers = path.node.specifiers || [];
158
+ const uiSpecs = specifiers.filter((s) => s.type === "ImportSpecifier" && s.imported.type === "Identifier" && UI_NAMES.has(s.imported.name));
159
+ if (uiSpecs.length === 0)
160
+ return;
161
+ // Track moved specifiers — they need to go into /ui import
162
+ for (const s of uiSpecs) {
163
+ if (s.type === "ImportSpecifier" && s.imported.type === "Identifier") {
164
+ movedToUi.add(s.imported.name);
165
+ }
166
+ }
167
+ const nonUiSpecs = specifiers.filter((s) => !(s.type === "ImportSpecifier" && s.imported.type === "Identifier" && UI_NAMES.has(s.imported.name)));
168
+ if (nonUiSpecs.length === 0) {
169
+ // All specifiers are UI -> rewrite source
170
+ path.node.source = j.literal(FRAMEWORK_UI_SOURCE);
171
+ }
172
+ else {
173
+ // Split: keep non-UI in original, UI will be added to /ui import below
174
+ path.node.specifiers = nonUiSpecs;
175
+ }
176
+ changed = true;
177
+ });
178
+ // Determine what still needs to be added to /ui
179
+ const missingComponents = [...usedComponents].filter((c) => !alreadyImported.has(c));
180
+ const missingDirectives = [...usedDirectives].filter((d) => !alreadyImported.has(d));
181
+ // Include moved specifiers (split from main entry) that weren't rewritten in-place
182
+ const splitNames = [...movedToUi].filter((name) => {
183
+ // Only add if not already in a /ui import (rewrite-all case rewrites in-place)
184
+ const uiImportExists = root
185
+ .find(j.ImportDeclaration)
186
+ .filter((p) => p.node.source.value === FRAMEWORK_UI_SOURCE)
187
+ .some((p) => (p.node.specifiers || []).some((s) => s.type === "ImportSpecifier" && s.imported.type === "Identifier" && s.imported.name === name));
188
+ return !uiImportExists;
189
+ });
190
+ const toAdd = [...new Set([...missingComponents, ...missingDirectives, ...splitNames])].sort();
191
+ if (toAdd.length > 0 || changed) {
192
+ // Find or create @vc-shell/framework/ui import
193
+ const uiImports = root.find(j.ImportDeclaration).filter((path) => path.node.source.value === FRAMEWORK_UI_SOURCE);
194
+ if (uiImports.length > 0) {
195
+ // Merge into existing
196
+ const existingSpecs = uiImports.get().node.specifiers || [];
197
+ const existingNames = new Set(existingSpecs.filter((s) => s.type === "ImportSpecifier").map((s) => s.imported.name));
198
+ for (const name of toAdd) {
199
+ if (!existingNames.has(name)) {
200
+ existingSpecs.push(j.importSpecifier(j.identifier(name)));
201
+ }
202
+ }
203
+ // Sort specifiers alphabetically
204
+ existingSpecs.sort((a, b) => {
205
+ const aName = a.imported?.name || "";
206
+ const bName = b.imported?.name || "";
207
+ return aName.localeCompare(bName);
208
+ });
209
+ changed = true;
210
+ }
211
+ else if (toAdd.length > 0) {
212
+ // Create new import
213
+ const importDecl = j.importDeclaration(toAdd.map((name) => j.importSpecifier(j.identifier(name))), j.literal(FRAMEWORK_UI_SOURCE));
214
+ const imports = root.find(j.ImportDeclaration);
215
+ if (imports.length > 0) {
216
+ j(imports.at(-1).get()).insertAfter(importDecl);
217
+ }
218
+ else {
219
+ root.find(j.Program).get("body").unshift(importDecl);
220
+ }
221
+ changed = true;
222
+ }
223
+ }
224
+ if (!changed)
225
+ return null;
226
+ // Splice script back into SFC
227
+ const newScriptContent = root.toSource();
228
+ if (newScriptContent === scriptBlock.content)
229
+ return null;
230
+ const scriptStart = scriptBlock.loc.start.offset;
231
+ const scriptEnd = scriptBlock.loc.end.offset;
232
+ return fileInfo.source.substring(0, scriptStart) + newScriptContent + fileInfo.source.substring(scriptEnd);
233
+ };
234
+ export default transform;
235
+ export const parser = "tsx";
236
+ //# sourceMappingURL=remove-global-components.js.map