@vc-shell/create-vc-app 2.0.1 → 2.0.3-pr222.ba0d3c5

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 (62) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +19 -23
  3. package/dist/commands/add-module.d.ts +3 -1
  4. package/dist/commands/add-module.d.ts.map +1 -1
  5. package/dist/commands/init.d.ts +3 -1
  6. package/dist/commands/init.d.ts.map +1 -1
  7. package/dist/index.js +145 -138
  8. package/dist/templates/dynamic-module/_package.json.ejs +3 -3
  9. package/dist/templates/standalone/_package.json.ejs +4 -4
  10. package/dist/types.d.ts +16 -0
  11. package/dist/types.d.ts.map +1 -1
  12. package/package.json +2 -2
  13. package/dist/templates/host-app/LICENSE +0 -12
  14. package/dist/templates/host-app/README.md +0 -54
  15. package/dist/templates/host-app/_browserslistrc +0 -3
  16. package/dist/templates/host-app/_commitlintrc.json +0 -3
  17. package/dist/templates/host-app/_editorconfig +0 -22
  18. package/dist/templates/host-app/_env.ejs +0 -3
  19. package/dist/templates/host-app/_env.local.ejs +0 -1
  20. package/dist/templates/host-app/_eslintignore +0 -3
  21. package/dist/templates/host-app/_eslintrc.js +0 -41
  22. package/dist/templates/host-app/_github/COMMIT_CONVENTION.md +0 -91
  23. package/dist/templates/host-app/_github/PULL_REQUEST_TEMPLATE.md +0 -8
  24. package/dist/templates/host-app/_gitignore +0 -71
  25. package/dist/templates/host-app/_package.json.ejs +0 -67
  26. package/dist/templates/host-app/_prettierignore +0 -4
  27. package/dist/templates/host-app/_prettierrc +0 -4
  28. package/dist/templates/host-app/_vscode/extensions.json +0 -14
  29. package/dist/templates/host-app/_vscode/settings.json +0 -14
  30. package/dist/templates/host-app/_yarn/releases/yarn-4.9.1.cjs +0 -948
  31. package/dist/templates/host-app/_yarnrc.yml +0 -7
  32. package/dist/templates/host-app/index.html.ejs +0 -26
  33. package/dist/templates/host-app/postcss.config.cjs +0 -6
  34. package/dist/templates/host-app/public/assets/background.jpg +0 -0
  35. package/dist/templates/host-app/public/assets/logo-white.svg +0 -21
  36. package/dist/templates/host-app/public/assets/logo.svg +0 -8
  37. package/dist/templates/host-app/public/assets/welcome.png +0 -0
  38. package/dist/templates/host-app/public/img/icons/apple-touch-icon.png +0 -0
  39. package/dist/templates/host-app/public/img/icons/favicon-16x16.png +0 -0
  40. package/dist/templates/host-app/public/img/icons/favicon-32x32.png +0 -0
  41. package/dist/templates/host-app/public/img/icons/favicon.ico +0 -0
  42. package/dist/templates/host-app/public/img/icons/mstile-150x150.png +0 -0
  43. package/dist/templates/host-app/public/img/icons/safari-pinned-tab.svg +0 -32
  44. package/dist/templates/host-app/src/api_client/README.md +0 -199
  45. package/dist/templates/host-app/src/bootstrap.ts.ejs +0 -26
  46. package/dist/templates/host-app/src/components/dashboard-widgets/Welcome.vue +0 -51
  47. package/dist/templates/host-app/src/composables/index.ts +0 -1
  48. package/dist/templates/host-app/src/env.d.ts +0 -9
  49. package/dist/templates/host-app/src/locales/en.json +0 -16
  50. package/dist/templates/host-app/src/locales/index.ts +0 -2
  51. package/dist/templates/host-app/src/main.ts.ejs +0 -59
  52. package/dist/templates/host-app/src/pages/App.vue.ejs +0 -41
  53. package/dist/templates/host-app/src/pages/Dashboard.vue.ejs +0 -7
  54. package/dist/templates/host-app/src/pages/Platform.vue +0 -19
  55. package/dist/templates/host-app/src/router/index.ts +0 -10
  56. package/dist/templates/host-app/src/router/routes.ts.ejs +0 -98
  57. package/dist/templates/host-app/src/styles/custom.scss +0 -116
  58. package/dist/templates/host-app/src/styles/index.scss +0 -8
  59. package/dist/templates/host-app/tailwind.config.ts +0 -7
  60. package/dist/templates/host-app/tsconfig.json +0 -17
  61. package/dist/templates/host-app/vite.config.mts.ejs +0 -4
  62. package/dist/templates/host-app/yarn.lock +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.3](https://github.com/VirtoCommerce/vc-shell/compare/v2.0.2...v2.0.3) (2026-04-30)
4
+
5
+ **Note:** Version bump only for package @vc-shell/create-vc-app
6
+
7
+ ## [2.0.2](https://github.com/VirtoCommerce/vc-shell/compare/v2.0.1...v2.0.2) (2026-04-27)
8
+
9
+ **Note:** Version bump only for package @vc-shell/create-vc-app
10
+
3
11
  ## [2.0.1](https://github.com/VirtoCommerce/vc-shell/compare/v2.0.0...v2.0.1) (2026-04-24)
4
12
 
5
13
  ### Features
package/README.md CHANGED
@@ -5,16 +5,15 @@ Scaffolding tool for VC Shell applications and modules.
5
5
  ## Create a New Project
6
6
 
7
7
  ```bash
8
- npx create-vc-app [project-name]
8
+ npx @vc-shell/create-vc-app [project-name]
9
9
  ```
10
10
 
11
- Interactive prompts guide you through project setup. Three project types are available:
11
+ Interactive prompts guide you through project setup. Two project types are available:
12
12
 
13
13
  | Type | Description |
14
14
  | ------------------ | -------------------------------------------------- |
15
15
  | **Standalone App** | Full application with bundled modules |
16
16
  | **Dynamic Module** | Remote module loaded by host via Module Federation |
17
- | **Host App** | Shell that loads dynamic modules at runtime |
18
17
 
19
18
  ### Non-Interactive Mode
20
19
 
@@ -22,38 +21,35 @@ Pass flags to skip prompts:
22
21
 
23
22
  ```bash
24
23
  # Standalone app with dashboard and sample data
25
- npx create-vc-app my-app --type standalone --module-name "Products" --dashboard --mocks
24
+ npx @vc-shell/create-vc-app my-app --type standalone --module-name "Products" --dashboard --mocks
26
25
 
27
26
  # Dynamic module
28
- npx create-vc-app my-module --type dynamic-module --module-name "Reviews"
29
-
30
- # Host app with tenant routing and AI agent
31
- npx create-vc-app my-shell --type host-app --dashboard --tenant-routes --ai-agent
27
+ npx @vc-shell/create-vc-app my-module --type dynamic-module --module-name "Reviews"
32
28
  ```
33
29
 
34
30
  ### Options
35
31
 
36
- | Option | Description | Default |
37
- | ---------------------- | ------------------------------------------------------------ | ---------------------- |
38
- | `--type <type>` | Project type: `standalone` \| `dynamic-module` \| `host-app` | _(prompted)_ |
39
- | `--name`, `--app-name` | Application name | Directory name |
40
- | `--package-name` | npm package name | App name (validated) |
41
- | `--module-name` | Initial module name | App name in title case |
42
- | `--base-path` | Base path for the application | `/apps/<name>/` |
43
- | `--tenant-routes` | Include tenant routing (`/:tenantId` prefix) | `false` |
44
- | `--ai-agent` | Include AI Agent configuration | `false` |
45
- | `--dashboard` | Include Dashboard with widgets | `false` |
46
- | `--mocks` | Include sample module with mock data | `false` |
47
- | `--overwrite` | Overwrite existing files without confirmation | `false` |
48
- | `--help`, `-h` | Show help | — |
49
- | `--version`, `-v` | Show version | — |
32
+ | Option | Description | Default |
33
+ | ---------------------- | ------------------------------------------------ | ---------------------- |
34
+ | `--type <type>` | Project type: `standalone` \| `dynamic-module` ` | _(prompted)_ |
35
+ | `--name`, `--app-name` | Application name | Directory name |
36
+ | `--package-name` | npm package name | App name (validated) |
37
+ | `--module-name` | Initial module name | App name in title case |
38
+ | `--base-path` | Base path for the application | `/apps/<name>/` |
39
+ | `--tenant-routes` | Include tenant routing (`/:tenantId` prefix) | `false` |
40
+ | `--ai-agent` | Include AI Agent configuration | `false` |
41
+ | `--dashboard` | Include Dashboard with widgets | `false` |
42
+ | `--mocks` | Include sample module with mock data | `false` |
43
+ | `--overwrite` | Overwrite existing files without confirmation | `false` |
44
+ | `--help`, `-h` | Show help | — |
45
+ | `--version`, `-v` | Show version | — |
50
46
 
51
47
  ## Add a Module to Existing Project
52
48
 
53
49
  From your project root:
54
50
 
55
51
  ```bash
56
- npx create-vc-app add-module <module-name>
52
+ npx @vc-shell/create-vc-app add-module <module-name>
57
53
  ```
58
54
 
59
55
  This will:
@@ -1,2 +1,4 @@
1
- export declare function addModuleCommand(args: Record<string, unknown>, templateRoot: string): Promise<void>;
1
+ import { CLIArgs } from '../types.js';
2
+
3
+ export declare function addModuleCommand(args: CLIArgs, templateRoot: string): Promise<void>;
2
4
  //# sourceMappingURL=add-module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-module.d.ts","sourceRoot":"","sources":["../../src/commands/add-module.ts"],"names":[],"mappings":"AAQA,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgFzG"}
1
+ {"version":3,"file":"add-module.d.ts","sourceRoot":"","sources":["../../src/commands/add-module.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgFzF"}
@@ -1,2 +1,4 @@
1
- export declare function initCommand(args: Record<string, unknown>, templateRoot: string): Promise<void>;
1
+ import { CLIArgs } from '../types.js';
2
+
3
+ export declare function initCommand(args: CLIArgs, templateRoot: string): Promise<void>;
2
4
  //# sourceMappingURL=init.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAqBA,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkNpG"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAA+B,MAAM,aAAa,CAAC;AAqBxE,wBAAsB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAuNpF"}
package/dist/index.js CHANGED
@@ -1,30 +1,30 @@
1
1
  #!/usr/bin/env node
2
2
  import z from "mri";
3
- import t from "picocolors";
3
+ import n from "picocolors";
4
4
  import c from "node:path";
5
- import { exit as U, argv as L } from "node:process";
6
- import { fileURLToPath as B } from "node:url";
5
+ import { exit as L, argv as B } from "node:process";
6
+ import { fileURLToPath as F } from "node:url";
7
7
  import A from "prompts";
8
8
  import r from "node:fs";
9
- import T from "ejs";
10
- const F = "2.0.0", O = {
11
- version: F
9
+ import E from "ejs";
10
+ const O = "2.0.3", V = {
11
+ version: O
12
12
  };
13
13
  function h(e) {
14
14
  return e.trim().replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase().replace(/[^a-z0-9-]/g, "");
15
15
  }
16
16
  function x(e) {
17
- return e.replace(/[-_\s]+(.)?/g, (n, a) => a ? a.toUpperCase() : "").replace(/^(.)/, (n, a) => a.toUpperCase());
17
+ return e.replace(/[-_\s]+(.)?/g, (a, t) => t ? t.toUpperCase() : "").replace(/^(.)/, (a, t) => t.toUpperCase());
18
18
  }
19
- function V(e) {
20
- const n = x(e);
21
- return n.charAt(0).toLowerCase() + n.slice(1);
19
+ function Z(e) {
20
+ const a = x(e);
21
+ return a.charAt(0).toLowerCase() + a.slice(1);
22
22
  }
23
- function E(e) {
23
+ function D(e) {
24
24
  return e.replace(/[-\s]+/g, "_").replace(/([a-z])([A-Z])/g, "$1_$2").toUpperCase();
25
25
  }
26
26
  function S(e) {
27
- return e.replace(/[-_]+/g, " ").replace(/\b\w/g, (n) => n.toUpperCase());
27
+ return e.replace(/[-_]+/g, " ").replace(/\b\w/g, (a) => a.toUpperCase());
28
28
  }
29
29
  function k(e) {
30
30
  return /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(e);
@@ -35,19 +35,19 @@ function C(e) {
35
35
  function _(e) {
36
36
  return e.trim().toLowerCase().replace(/\/+/g, "/").replace(/[^a-z0-9/-]+/g, "/").replace(/\/?$/, "/");
37
37
  }
38
- function D(e) {
39
- const n = e.moduleName || "", a = n ? h(n) : "", s = {
38
+ function R(e) {
39
+ const a = e.moduleName || "", t = a ? h(a) : "", s = {
40
40
  hasModule: !!e.moduleName,
41
- ModuleName: a,
42
- ModuleNamePascalCase: n ? x(n) : "",
43
- ModuleNameCamelCase: n ? V(n) : "",
44
- ModuleNameUppercase: a.toUpperCase(),
45
- ModuleNameScreamingSnake: n ? E(n) : "",
46
- ModuleNameSentenceCase: n ? S(n) : ""
41
+ ModuleName: t,
42
+ ModuleNamePascalCase: a ? x(a) : "",
43
+ ModuleNameCamelCase: a ? Z(a) : "",
44
+ ModuleNameUppercase: t.toUpperCase(),
45
+ ModuleNameScreamingSnake: a ? D(a) : "",
46
+ ModuleNameSentenceCase: a ? S(a) : ""
47
47
  };
48
48
  return e.projectName && (s.AppName = h(e.projectName), s.AppNameSentenceCase = S(e.projectName)), e.packageName !== void 0 && (s.PackageName = e.packageName || "", s.BasePath = e.basePath || "", s.tenantRoutes = e.tenantRoutes || !1, s.aiAgent = e.aiAgent || !1, s.dashboard = e.dashboard || !1, s.mocks = e.mocks || !1), s;
49
49
  }
50
- const Z = /* @__PURE__ */ new Set([".png", ".jpg", ".jpeg", ".gif", ".bmp", ".ico", ".pdf", ".zip"]), J = {
50
+ const J = /* @__PURE__ */ new Set([".png", ".jpg", ".jpeg", ".gif", ".bmp", ".ico", ".pdf", ".zip"]), K = {
51
51
  _gitignore: ".gitignore",
52
52
  "_yarnrc.yml": ".yarnrc.yml",
53
53
  _browserslistrc: ".browserslistrc",
@@ -62,90 +62,97 @@ const Z = /* @__PURE__ */ new Set([".png", ".jpg", ".jpeg", ".gif", ".bmp", ".ic
62
62
  _yarn: ".yarn",
63
63
  "_package.json": "package.json"
64
64
  };
65
- function K(e, n, a) {
66
- n.endsWith(".ejs") && (n = n.slice(0, -4));
67
- const s = c.dirname(n);
65
+ function Y(e, a, t) {
66
+ a.endsWith(".ejs") && (a = a.slice(0, -4));
67
+ const s = c.dirname(a);
68
68
  r.existsSync(s) || r.mkdirSync(s, { recursive: !0 });
69
69
  const o = c.extname(e.replace(/\.ejs$/, "")).toLowerCase();
70
- if (Z.has(o))
71
- r.copyFileSync(e, n);
70
+ if (J.has(o))
71
+ r.copyFileSync(e, a);
72
72
  else {
73
- const d = r.readFileSync(e, "utf-8"), p = T.render(d, a, { filename: e });
74
- r.writeFileSync(n, p);
73
+ const d = r.readFileSync(e, "utf-8"), p = E.render(d, t, { filename: e });
74
+ r.writeFileSync(a, p);
75
75
  }
76
76
  }
77
- function b(e, n, a) {
77
+ function j(e, a, t) {
78
78
  if (!r.existsSync(e)) return;
79
79
  const s = r.readdirSync(e);
80
80
  for (const o of s) {
81
81
  const d = c.join(e, o), p = o.endsWith(".ejs") ? o.slice(0, -4) : o;
82
- let m = J[p] ?? p;
82
+ let m = K[p] ?? p;
83
83
  try {
84
- m = T.render(m, a);
84
+ m = E.render(m, t);
85
85
  } catch {
86
86
  }
87
- const l = c.join(n, m);
88
- r.statSync(d).isDirectory() ? (r.existsSync(l) || r.mkdirSync(l, { recursive: !0 }), b(d, l, a)) : K(d, l, a);
87
+ const l = c.join(a, m);
88
+ r.statSync(d).isDirectory() ? (r.existsSync(l) || r.mkdirSync(l, { recursive: !0 }), j(d, l, t)) : Y(d, l, t);
89
89
  }
90
90
  }
91
- function Y(e) {
91
+ function q(e) {
92
92
  if (r.existsSync(e))
93
- for (const n of r.readdirSync(e)) {
94
- if (n === ".git") continue;
95
- const a = c.join(e, n);
96
- r.statSync(a).isDirectory() ? r.rmSync(a, { recursive: !0, force: !0 }) : r.unlinkSync(a);
93
+ for (const a of r.readdirSync(e)) {
94
+ if (a === ".git") continue;
95
+ const t = c.join(e, a);
96
+ r.statSync(t).isDirectory() ? r.rmSync(t, { recursive: !0, force: !0 }) : r.unlinkSync(t);
97
97
  }
98
98
  }
99
99
  function I(e) {
100
100
  if (!r.existsSync(e)) return !0;
101
- const n = r.readdirSync(e);
102
- return n.length === 0 || n.length === 1 && n[0] === ".git";
101
+ const a = r.readdirSync(e);
102
+ return a.length === 0 || a.length === 1 && a[0] === ".git";
103
103
  }
104
- const q = {
104
+ const W = {
105
105
  standalone: "Standalone App",
106
106
  "dynamic-module": "Dynamic Module"
107
107
  };
108
- function W(e) {
109
- const n = q[e.projectType], a = !!e.moduleName;
108
+ function H(e) {
109
+ const a = W[e.projectType] ?? e.projectType, t = !!e.moduleName;
110
110
  console.log(`
111
- ${t.green("╭─────────────────────────────────────────╮")}
112
- ${t.green("│")} ${t.green("│")}
113
- ${t.green("│")} ${t.bold("VC Shell App created successfully!")} ${t.green("│")}
114
- ${t.green("│")} ${t.green("│")}
115
- ${t.green("│")} Project: ${t.cyan(e.projectName.padEnd(28))}${t.green("│")}
116
- ${t.green("│")} Type: ${t.cyan(n.padEnd(28))}${t.green("│")}
117
- ${a && e.moduleName ? ` ${t.green("│")} Module: ${t.cyan(e.moduleName.padEnd(28))}${t.green("│")}
118
- ` : ""} ${t.green("│")} ${t.green("│")}
119
- ${t.green("╰─────────────────────────────────────────╯")}
111
+ ${n.green("╭─────────────────────────────────────────╮")}
112
+ ${n.green("│")} ${n.green("│")}
113
+ ${n.green("│")} ${n.bold("VC Shell App created successfully!")} ${n.green("│")}
114
+ ${n.green("│")} ${n.green("│")}
115
+ ${n.green("│")} Project: ${n.cyan(e.projectName.padEnd(28))}${n.green("│")}
116
+ ${n.green("│")} Type: ${n.cyan(a.padEnd(28))}${n.green("│")}
117
+ ${t && e.moduleName ? ` ${n.green("│")} Module: ${n.cyan(e.moduleName.padEnd(28))}${n.green("│")}
118
+ ` : ""} ${n.green("│")} ${n.green("│")}
119
+ ${n.green("╰─────────────────────────────────────────╯")}
120
120
 
121
- ${t.bold("Next steps:")}
121
+ ${n.bold("Next steps:")}
122
122
 
123
123
  1. cd ${e.projectName}
124
124
  2. yarn install
125
125
  3. yarn serve
126
- ${a && e.moduleName ? `
126
+ ${t && e.moduleName ? `
127
127
  Module is ready at:
128
- src/modules/${H(e.moduleName)}/
128
+ src/modules/${X(e.moduleName)}/
129
129
  ` : ""}
130
- ${t.dim("Docs: https://docs.virtocommerce.org/platform/developer-guide/latest/custom-apps-development/vc-shell/vc-shell-overview/")}
130
+ ${n.dim("Docs: https://docs.virtocommerce.org/platform/developer-guide/latest/custom-apps-development/vc-shell/vc-shell-overview/")}
131
131
  `);
132
132
  }
133
- function H(e) {
133
+ function X(e) {
134
134
  return e.trim().replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase().replace(/[^a-z0-9-]/g, "");
135
135
  }
136
- const X = [
136
+ const P = [
137
137
  { title: "Standalone App — full application with bundled modules", value: "standalone" },
138
138
  { title: "Dynamic Module — remote module loaded by host via Module Federation", value: "dynamic-module" }
139
139
  ];
140
- async function G(e, n) {
141
- const a = process.cwd();
140
+ function G(e) {
141
+ return typeof e == "string" && P.some((a) => a.value === e);
142
+ }
143
+ async function Q(e, a) {
144
+ const t = process.cwd();
142
145
  let o = e._?.[0] || e.name || e["app-name"];
143
146
  const d = o || "vc-app", p = () => o === "." ? c.basename(c.resolve()) : o, m = !!(o && e.type);
144
147
  let l;
145
148
  if (m) {
146
149
  o = o || d;
147
- const f = c.resolve(a, o);
148
- r.existsSync(f) && !I(f) && !e.overwrite && (console.error(t.red(`Target directory "${o}" is not empty. Use --overwrite to overwrite.`)), process.exit(1));
150
+ const f = c.resolve(t, o);
151
+ if (!G(e.type)) {
152
+ const b = P.map(($) => $.value).join(", ");
153
+ console.error(n.red(`Unknown project type: "${e.type}". Valid types: ${b}`)), process.exit(1);
154
+ }
155
+ r.existsSync(f) && !I(f) && !e.overwrite && (console.error(n.red(`Target directory "${o}" is not empty. Use --overwrite to overwrite.`)), process.exit(1));
149
156
  const u = p(), y = e.type, g = e["module-name"], N = y === "dynamic-module" ? g || S(u) : g || void 0;
150
157
  l = {
151
158
  projectName: h(u),
@@ -160,7 +167,7 @@ async function G(e, n) {
160
167
  };
161
168
  } else {
162
169
  const f = () => {
163
- throw new Error(t.red("✖") + " Creation cancelled");
170
+ throw new Error(n.red("✖") + " Creation cancelled");
164
171
  };
165
172
  try {
166
173
  const u = await A(
@@ -168,7 +175,7 @@ async function G(e, n) {
168
175
  {
169
176
  name: "projectName",
170
177
  type: o ? null : "text",
171
- message: t.reset("Project name:"),
178
+ message: n.reset("Project name:"),
172
179
  initial: d,
173
180
  onState: (w) => {
174
181
  o = h(String(w.value).trim()) || d;
@@ -176,14 +183,14 @@ async function G(e, n) {
176
183
  format: (w) => h(String(w).trim())
177
184
  },
178
185
  {
179
- type: () => !r.existsSync(c.resolve(a, o)) || I(c.resolve(a, o)) ? null : "confirm",
186
+ type: () => !r.existsSync(c.resolve(t, o)) || I(c.resolve(t, o)) ? null : "confirm",
180
187
  name: "overwrite",
181
188
  message: () => (o === "." ? "Current directory" : `Target directory "${o}"`) + " is not empty. Remove existing files and continue?"
182
189
  },
183
190
  {
184
191
  type: (w, { overwrite: M }) => {
185
192
  if (M === !1)
186
- throw new Error(t.red("✖") + " Operation cancelled");
193
+ throw new Error(n.red("✖") + " Operation cancelled");
187
194
  return null;
188
195
  },
189
196
  name: "overwriteChecker"
@@ -191,19 +198,19 @@ async function G(e, n) {
191
198
  {
192
199
  name: "packageName",
193
200
  type: () => k(p()) ? null : "text",
194
- message: t.reset("Package name:"),
201
+ message: n.reset("Package name:"),
195
202
  initial: () => C(p()),
196
203
  validate: (w) => k(w) || "Invalid package.json name"
197
204
  },
198
205
  {
199
206
  type: "select",
200
207
  name: "projectType",
201
- message: t.reset("Project type:"),
202
- choices: X
208
+ message: n.reset("Project type:"),
209
+ choices: P
203
210
  }
204
211
  ],
205
212
  { onCancel: f }
206
- ), y = o ? h(o) : u.projectName, g = u.projectType || "standalone", N = S(y), j = "/apps/" + h(y) + "/", $ = await A(
213
+ ), y = o ? h(o) : u.projectName, g = u.projectType || "standalone", N = S(y), b = "/apps/" + h(y) + "/", $ = await A(
207
214
  [
208
215
  {
209
216
  name: "includeModule",
@@ -214,15 +221,15 @@ async function G(e, n) {
214
221
  {
215
222
  name: "moduleName",
216
223
  type: (w, M) => g === "standalone" && !M.includeModule ? null : "text",
217
- message: t.reset("Module name:"),
224
+ message: n.reset("Module name:"),
218
225
  initial: N,
219
226
  format: (w) => String(w).trim()
220
227
  },
221
228
  {
222
229
  name: "basePath",
223
230
  type: g === "dynamic-module" ? null : "text",
224
- message: t.reset("Base path:"),
225
- initial: j,
231
+ message: n.reset("Base path:"),
232
+ initial: b,
226
233
  format: (w) => _(String(w).trim())
227
234
  },
228
235
  {
@@ -257,7 +264,7 @@ async function G(e, n) {
257
264
  packageName: u.packageName || (k(y) ? y : C(y)),
258
265
  projectType: g,
259
266
  moduleName: $.moduleName || ($.includeModule !== !1 ? N : void 0),
260
- basePath: $.basePath || _(j),
267
+ basePath: $.basePath || _(b),
261
268
  tenantRoutes: $.tenantRoutes || !1,
262
269
  aiAgent: $.aiAgent || !1,
263
270
  dashboard: $.dashboard ?? !0,
@@ -267,59 +274,59 @@ async function G(e, n) {
267
274
  console.log(u.message), process.exit(1);
268
275
  }
269
276
  }
270
- const i = c.resolve(a, o);
271
- r.existsSync(i) && !I(i) ? Y(i) : r.existsSync(i) || r.mkdirSync(i, { recursive: !0 }), console.log(`
272
- Scaffolding ${t.cyan(l.projectType)} in ${t.green(i)}...
277
+ const i = c.resolve(t, o);
278
+ r.existsSync(i) && !I(i) ? q(i) : r.existsSync(i) || r.mkdirSync(i, { recursive: !0 }), console.log(`
279
+ Scaffolding ${n.cyan(l.projectType)} in ${n.green(i)}...
273
280
  `);
274
- const v = D(l);
275
- if (b(c.join(n, l.projectType), i, v), l.moduleName) {
281
+ const v = R(l);
282
+ if (j(c.join(a, l.projectType), i, v), l.moduleName) {
276
283
  const f = h(l.moduleName), u = l.projectType === "dynamic-module" ? c.join(i, "src/modules") : c.join(i, "src/modules", f);
277
- b(c.join(n, "module"), u, v);
284
+ j(c.join(a, "module"), u, v);
278
285
  }
279
- l.mocks && b(c.join(n, "sample-module"), c.join(i, "src/modules/sample"), v), W(l);
286
+ l.mocks && j(c.join(a, "sample-module"), c.join(i, "src/modules/sample"), v), H(l);
280
287
  }
281
- function R(e, n) {
282
- const a = /^import\s.+$/gm;
288
+ function U(e, a) {
289
+ const t = /^import\s.+$/gm;
283
290
  let s = null, o;
284
- for (; (o = a.exec(e)) !== null; )
291
+ for (; (o = t.exec(e)) !== null; )
285
292
  s = o;
286
293
  if (s) {
287
294
  const d = s.index + s[0].length;
288
295
  return e.slice(0, d) + `
289
- ` + n + e.slice(d);
296
+ ` + a + e.slice(d);
290
297
  }
291
- return n + `
298
+ return a + `
292
299
  ` + e;
293
300
  }
294
- function Q(e, n) {
295
- let a = r.readFileSync(e, "utf-8");
296
- const s = x(n), o = h(n);
297
- a = R(a, `import ${s} from "./modules/${o}";`);
301
+ function ee(e, a) {
302
+ let t = r.readFileSync(e, "utf-8");
303
+ const s = x(a), o = h(a);
304
+ t = U(t, `import ${s} from "./modules/${o}";`);
298
305
  const d = /\.use\([A-Z]\w+,\s*\{\s*router\s*\}\)/g;
299
306
  let p = null, m;
300
- for (; (m = d.exec(a)) !== null; )
307
+ for (; (m = d.exec(t)) !== null; )
301
308
  p = m;
302
309
  if (p) {
303
310
  const l = p.index + p[0].length, i = `
304
311
  .use(${s}, { router })`;
305
- a = a.slice(0, l) + i + a.slice(l);
312
+ t = t.slice(0, l) + i + t.slice(l);
306
313
  }
307
- r.writeFileSync(e, a);
314
+ r.writeFileSync(e, t);
308
315
  }
309
- function ee(e, n) {
310
- let a = r.readFileSync(e, "utf-8");
311
- const s = h(n), o = E(n);
312
- if (!a.includes("addMenuItem")) {
313
- const v = /import\s*\{([^}]+)\}\s*from\s*["']@vc-shell\/framework["']/.exec(a);
316
+ function te(e, a) {
317
+ let t = r.readFileSync(e, "utf-8");
318
+ const s = h(a), o = D(a);
319
+ if (!t.includes("addMenuItem")) {
320
+ const v = /import\s*\{([^}]+)\}\s*from\s*["']@vc-shell\/framework["']/.exec(t);
314
321
  if (v) {
315
322
  const f = v[1].trim() + ", addMenuItem";
316
- a = a.replace(v[0], `import { ${f} } from "@vc-shell/framework"`);
323
+ t = t.replace(v[0], `import { ${f} } from "@vc-shell/framework"`);
317
324
  } else
318
- a = R(a, 'import { addMenuItem } from "@vc-shell/framework";');
325
+ t = U(t, 'import { addMenuItem } from "@vc-shell/framework";');
319
326
  }
320
327
  const d = /addMenuItem\(\{[\s\S]*?\}\);/g;
321
328
  let p = null, m;
322
- for (; (m = d.exec(a)) !== null; )
329
+ for (; (m = d.exec(t)) !== null; )
323
330
  p = m;
324
331
  const l = `
325
332
  addMenuItem({
@@ -330,59 +337,59 @@ function ee(e, n) {
330
337
  });`;
331
338
  if (p) {
332
339
  const i = p.index + p[0].length;
333
- a = a.slice(0, i) + `
334
- ` + l + a.slice(i);
340
+ t = t.slice(0, i) + `
341
+ ` + l + t.slice(i);
335
342
  } else {
336
- const i = a.lastIndexOf("}");
337
- i !== -1 && (a = a.slice(0, i) + l + `
338
- ` + a.slice(i));
343
+ const i = t.lastIndexOf("}");
344
+ i !== -1 && (t = t.slice(0, i) + l + `
345
+ ` + t.slice(i));
339
346
  }
340
- r.writeFileSync(e, a);
347
+ r.writeFileSync(e, t);
341
348
  }
342
- async function ae(e, n) {
343
- const a = process.cwd(), s = e._?.[1], o = c.join(a, "package.json");
344
- r.existsSync(o) || (console.error(t.red("Error: No package.json found. Run this command from a vc-shell project root.")), process.exit(1));
349
+ async function ae(e, a) {
350
+ const t = process.cwd(), s = e._?.[1], o = c.join(t, "package.json");
351
+ r.existsSync(o) || (console.error(n.red("Error: No package.json found. Run this command from a vc-shell project root.")), process.exit(1));
345
352
  const d = JSON.parse(r.readFileSync(o, "utf-8"));
346
- ({ ...d.dependencies, ...d.devDependencies })["@vc-shell/framework"] || (console.error(t.red("Error: Not a vc-shell project (@vc-shell/framework not found in dependencies).")), process.exit(1));
353
+ ({ ...d.dependencies, ...d.devDependencies })["@vc-shell/framework"] || (console.error(n.red("Error: Not a vc-shell project (@vc-shell/framework not found in dependencies).")), process.exit(1));
347
354
  let m = s;
348
355
  m || (m = (await A({
349
356
  type: "text",
350
357
  name: "moduleName",
351
358
  message: "Module name:",
352
- validate: (j) => j.trim().length > 0 || "Module name is required"
353
- })).moduleName), m || (console.error(t.red("Module name is required.")), process.exit(1));
354
- const l = h(m), i = x(m), v = c.join(a, "src/modules"), f = c.join(v, l);
355
- r.existsSync(v) || r.mkdirSync(v, { recursive: !0 }), r.existsSync(f) && (console.error(t.red(`Error: Module "${l}" already exists at ${c.relative(a, f)}`)), process.exit(1));
356
- const u = D({ moduleName: m, projectName: c.basename(a) });
357
- b(c.join(n, "module"), f, u), console.log(t.green(` ✔ Created ${c.relative(a, f)}/`));
358
- const y = c.join(a, "src/main.ts");
359
+ validate: (b) => b.trim().length > 0 || "Module name is required"
360
+ })).moduleName), m || (console.error(n.red("Module name is required.")), process.exit(1));
361
+ const l = h(m), i = x(m), v = c.join(t, "src/modules"), f = c.join(v, l);
362
+ r.existsSync(v) || r.mkdirSync(v, { recursive: !0 }), r.existsSync(f) && (console.error(n.red(`Error: Module "${l}" already exists at ${c.relative(t, f)}`)), process.exit(1));
363
+ const u = R({ moduleName: m, projectName: c.basename(t) });
364
+ j(c.join(a, "module"), f, u), console.log(n.green(` ✔ Created ${c.relative(t, f)}/`));
365
+ const y = c.join(t, "src/main.ts");
359
366
  if (r.existsSync(y))
360
367
  try {
361
- Q(y, m), console.log(t.green(` ✔ Updated src/main.ts — added import & app.use(${i})`));
368
+ ee(y, m), console.log(n.green(` ✔ Updated src/main.ts — added import & app.use(${i})`));
362
369
  } catch {
363
- console.warn(t.yellow(" ⚠ Could not auto-update src/main.ts. Add manually:")), console.warn(t.yellow(` import ${i} from "./modules/${l}";`)), console.warn(t.yellow(` app.use(${i}, { router });`));
370
+ console.warn(n.yellow(" ⚠ Could not auto-update src/main.ts. Add manually:")), console.warn(n.yellow(` import ${i} from "./modules/${l}";`)), console.warn(n.yellow(` app.use(${i}, { router });`));
364
371
  }
365
- const g = c.join(a, "src/bootstrap.ts");
372
+ const g = c.join(t, "src/bootstrap.ts");
366
373
  if (r.existsSync(g))
367
374
  try {
368
- ee(g, m), console.log(t.green(` ✔ Updated src/bootstrap.ts — added menu item "${S(m)}"`));
375
+ te(g, m), console.log(n.green(` ✔ Updated src/bootstrap.ts — added menu item "${S(m)}"`));
369
376
  } catch {
370
- console.warn(t.yellow(" ⚠ Could not auto-update src/bootstrap.ts. Add addMenuItem() manually."));
377
+ console.warn(n.yellow(" ⚠ Could not auto-update src/bootstrap.ts. Add addMenuItem() manually."));
371
378
  }
372
379
  console.log(`
373
- Module "${l}" is ready! Run ${t.bold(t.green("yarn serve"))} to see it.
380
+ Module "${l}" is ready! Run ${n.bold(n.green("yarn serve"))} to see it.
374
381
  `);
375
382
  }
376
- const P = c.resolve(B(import.meta.url), "..", "templates");
377
- function te() {
383
+ const T = c.resolve(F(import.meta.url), "..", "templates");
384
+ function ne() {
378
385
  console.log(`
379
- ${t.bold(t.green("create-vc-app"))} — Create VC Shell applications and modules
386
+ ${n.bold(n.green("create-vc-app"))} — Create VC Shell applications and modules
380
387
 
381
- ${t.bold("Usage:")}
388
+ ${n.bold("Usage:")}
382
389
  create-vc-app [project-name] [options] Create a new project
383
390
  create-vc-app add-module <module-name> Add a module to existing project
384
391
 
385
- ${t.bold("Options (create):")}
392
+ ${n.bold("Options (create):")}
386
393
  --type <type> Project type: standalone | dynamic-module
387
394
  --name, --app-name <name> Application name
388
395
  --package-name <name> npm package name
@@ -396,31 +403,31 @@ ${t.bold("Options (create):")}
396
403
  --help, -h Show this help
397
404
  --version, -v Show version
398
405
 
399
- ${t.bold("Examples:")}
406
+ ${n.bold("Examples:")}
400
407
  create-vc-app my-app
401
408
  create-vc-app my-app --type standalone --dashboard --mocks
402
409
  create-vc-app my-module --type dynamic-module --module-name "Reviews"
403
410
  create-vc-app add-module orders
404
411
 
405
- ${t.bold("Docs:")} https://docs.virtocommerce.org/platform/developer-guide/latest/custom-apps-development/vc-shell/vc-shell-overview/
412
+ ${n.bold("Docs:")} https://docs.virtocommerce.org/platform/developer-guide/latest/custom-apps-development/vc-shell/vc-shell-overview/
406
413
  `);
407
414
  }
408
- async function ne() {
409
- const e = z(L.slice(2), {
415
+ async function oe() {
416
+ const e = z(B.slice(2), {
410
417
  alias: { h: "help", v: "version" },
411
418
  boolean: ["help", "version", "mocks", "overwrite", "tenant-routes", "ai-agent", "dashboard"],
412
419
  string: ["type", "name", "app-name", "package-name", "module-name", "base-path"]
413
420
  });
414
421
  if (e.help) {
415
- te();
422
+ ne();
416
423
  return;
417
424
  }
418
425
  if (e.version) {
419
- console.log(`create-vc-app v${O.version}`);
426
+ console.log(`create-vc-app v${V.version}`);
420
427
  return;
421
428
  }
422
- e._[0] === "add-module" ? await ae(e, P) : await G(e, P);
429
+ e._[0] === "add-module" ? await ae(e, T) : await Q(e, T);
423
430
  }
424
- ne().catch((e) => {
425
- console.error(t.red(e.message || String(e))), U(1);
431
+ oe().catch((e) => {
432
+ console.error(n.red(e.message || String(e))), L(1);
426
433
  });