@vc-shell/create-vc-app 2.4.0-pr311.5130191 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import P from "prompts";
8
8
  import i from "node:fs";
9
9
  import F from "ejs";
10
10
  import I from "prettier";
11
- const q = "2.4.0-pr311.5130191", W = {
11
+ const q = "2.5.0", W = {
12
12
  version: q
13
13
  };
14
14
  function v(e) {
@@ -297,16 +297,16 @@ async function se(e, t) {
297
297
  console.log(f.message), process.exit(1);
298
298
  }
299
299
  }
300
- const p = m.resolve(n, a);
301
- i.existsSync(p) && !T(p) ? ee(p) : i.existsSync(p) || i.mkdirSync(p, { recursive: !0 }), console.log(`
302
- Scaffolding ${r.cyan(d.projectType)} in ${r.green(p)}...
300
+ const u = m.resolve(n, a);
301
+ i.existsSync(u) && !T(u) ? ee(u) : i.existsSync(u) || i.mkdirSync(u, { recursive: !0 }), console.log(`
302
+ Scaffolding ${r.cyan(d.projectType)} in ${r.green(u)}...
303
303
  `);
304
- const u = U(d);
305
- if (j(m.join(t, d.projectType), p, u), d.moduleName) {
306
- const y = v(d.moduleName), f = d.projectType === "dynamic-module" ? m.join(p, "src/modules") : m.join(p, "src/modules", y);
307
- j(m.join(t, "module"), f, u);
304
+ const p = U(d);
305
+ if (j(m.join(t, d.projectType), u, p), d.moduleName) {
306
+ const y = v(d.moduleName), f = d.projectType === "dynamic-module" ? m.join(u, "src/modules") : m.join(u, "src/modules", y);
307
+ j(m.join(t, "module"), f, p);
308
308
  }
309
- d.mocks && j(m.join(t, "sample-module"), m.join(p, "src/modules/sample"), u), await z([p]), oe(d);
309
+ d.mocks && j(m.join(t, "sample-module"), m.join(u, "src/modules/sample"), p), await z([u]), oe(d);
310
310
  }
311
311
  function k(e, { strings: t = !0 } = {}) {
312
312
  const n = e.split("");
@@ -421,29 +421,29 @@ ${e}` : C(e, [{ at: a, text: `
421
421
  ${o}` }]);
422
422
  }
423
423
  function de(e, t) {
424
- const n = v(t), o = O(t), a = me(i.readFileSync(e, "utf-8")), l = k(a), s = (u) => [
425
- `${u}addMenuItem({`,
426
- `${u} title: "${o}.MENU.TITLE",`,
427
- `${u} icon: "lucide-box",`,
428
- `${u} priority: 10,`,
429
- `${u} url: "/${n}",`,
430
- `${u}});`
424
+ const n = v(t), o = O(t), a = me(i.readFileSync(e, "utf-8")), l = k(a), s = (p) => [
425
+ `${p}addMenuItem({`,
426
+ `${p} title: "${o}.MENU.TITLE",`,
427
+ `${p} icon: "lucide-box",`,
428
+ `${p} priority: 10,`,
429
+ `${p} url: "/${n}",`,
430
+ `${p}});`
431
431
  ].join(`
432
432
  `), c = ce(l, "addMenuItem"), d = c[c.length - 1];
433
433
  if (d) {
434
- const u = V(a, d.start);
434
+ const p = V(a, d.start);
435
435
  i.writeFileSync(e, C(a, [{ at: d.end, text: `
436
436
 
437
- ${s(u)}` }]));
437
+ ${s(p)}` }]));
438
438
  return;
439
439
  }
440
- const p = l.lastIndexOf("}");
441
- if (p === -1)
440
+ const u = l.lastIndexOf("}");
441
+ if (u === -1)
442
442
  throw new Error("Could not find the bootstrap function body in bootstrap.ts");
443
- i.writeFileSync(e, C(a, [{ at: p, text: `${s(" ")}
443
+ i.writeFileSync(e, C(a, [{ at: u, text: `${s(" ")}
444
444
  ` }]));
445
445
  }
446
- async function pe(e, t) {
446
+ async function ue(e, t) {
447
447
  const n = process.cwd(), o = e._?.[1], a = m.join(n, "package.json");
448
448
  i.existsSync(a) || (console.error(r.red("Error: No package.json found. Run this command from a vc-shell project root.")), process.exit(1));
449
449
  const l = JSON.parse(i.readFileSync(a, "utf-8"));
@@ -455,16 +455,16 @@ async function pe(e, t) {
455
455
  message: "Module name:",
456
456
  validate: (S) => S.trim().length > 0 || "Module name is required"
457
457
  })).moduleName), c || (console.error(r.red("Module name is required.")), process.exit(1));
458
- const d = v(c), p = M(c), u = m.join(n, "src/modules"), y = m.join(u, d);
459
- i.existsSync(u) || i.mkdirSync(u, { recursive: !0 }), i.existsSync(y) && (console.error(r.red(`Error: Module "${d}" already exists at ${m.relative(n, y)}`)), process.exit(1));
458
+ const d = v(c), u = M(c), p = m.join(n, "src/modules"), y = m.join(p, d);
459
+ i.existsSync(p) || i.mkdirSync(p, { recursive: !0 }), i.existsSync(y) && (console.error(r.red(`Error: Module "${d}" already exists at ${m.relative(n, y)}`)), process.exit(1));
460
460
  const f = U({ moduleName: c, projectName: m.basename(n) });
461
461
  j(m.join(t, "module"), y, f), console.log(r.green(` ✔ Created ${m.relative(n, y)}/`));
462
462
  const h = m.join(n, "src/main.ts");
463
463
  if (i.existsSync(h))
464
464
  try {
465
- le(h, c), console.log(r.green(` ✔ Updated src/main.ts — added import & app.use(${p})`));
465
+ le(h, c), console.log(r.green(` ✔ Updated src/main.ts — added import & app.use(${u})`));
466
466
  } catch {
467
- console.warn(r.yellow(" ⚠ Could not auto-update src/main.ts. Add manually:")), console.warn(r.yellow(` import ${p} from "./modules/${d}";`)), console.warn(r.yellow(` app.use(${p}, { router });`));
467
+ console.warn(r.yellow(" ⚠ Could not auto-update src/main.ts. Add manually:")), console.warn(r.yellow(` import ${u} from "./modules/${d}";`)), console.warn(r.yellow(` app.use(${u}, { router });`));
468
468
  }
469
469
  const g = m.join(n, "src/bootstrap.ts");
470
470
  if (i.existsSync(g))
@@ -478,7 +478,7 @@ async function pe(e, t) {
478
478
  `);
479
479
  }
480
480
  const R = m.resolve(Z(import.meta.url), "..", "templates");
481
- function ue() {
481
+ function pe() {
482
482
  console.log(`
483
483
  ${r.bold(r.green("create-vc-app"))} — Create VC Shell applications and modules
484
484
 
@@ -516,14 +516,14 @@ async function fe() {
516
516
  string: ["type", "name", "app-name", "package-name", "module-name", "base-path"]
517
517
  });
518
518
  if (e.help) {
519
- ue();
519
+ pe();
520
520
  return;
521
521
  }
522
522
  if (e.version) {
523
523
  console.log(`create-vc-app v${W.version}`);
524
524
  return;
525
525
  }
526
- e._[0] === "add-module" ? await pe(e, R) : await se(e, R);
526
+ e._[0] === "add-module" ? await ue(e, R) : await se(e, R);
527
527
  }
528
528
  fe().catch((e) => {
529
529
  console.error(r.red(e.message || String(e))), J(1);
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "devDependencies": {
12
12
  "@types/node": "^20.10.5",
13
- "@vc-shell/ts-config": "^2.4.0",
13
+ "@vc-shell/ts-config": "^2.5.0",
14
14
  "cross-env": "^7.0.3",
15
15
  "sass": "^1.87.0",
16
16
  "typescript": "^5.8.3",
@@ -18,8 +18,8 @@
18
18
  "vue-tsc": "^3.2.5"
19
19
  },
20
20
  "dependencies": {
21
- "@vc-shell/config-generator": "^2.4.0",
22
- "@vc-shell/framework": "^2.4.0",
21
+ "@vc-shell/config-generator": "^2.5.0",
22
+ "@vc-shell/framework": "^2.5.0",
23
23
  "vue": "^3.5.30",
24
24
  "vue-router": "^5.0.3"
25
25
  }
@@ -22,8 +22,8 @@
22
22
  "@types/node": "^20.10.5",
23
23
  "@typescript-eslint/eslint-plugin": "^8.43.0",
24
24
  "@typescript-eslint/parser": "^8.43.0",
25
- "@vc-shell/api-client-generator": "^2.4.0",
26
- "@vc-shell/ts-config": "^2.4.0",
25
+ "@vc-shell/api-client-generator": "^2.5.0",
26
+ "@vc-shell/ts-config": "^2.5.0",
27
27
  "@vitejs/plugin-vue": "^5.2.3",
28
28
  "@vue/eslint-config-prettier": "^10.2.0",
29
29
  "@vue/eslint-config-typescript": "^14.6.0",
@@ -51,8 +51,8 @@
51
51
  "vue-tsc": "^3.2.5"
52
52
  },
53
53
  "dependencies": {
54
- "@vc-shell/config-generator": "^2.4.0",
55
- "@vc-shell/framework": "^2.4.0",
54
+ "@vc-shell/config-generator": "^2.5.0",
55
+ "@vc-shell/framework": "^2.5.0",
56
56
  "@vueuse/core": "^10.7.1",
57
57
  "@vueuse/integrations": "^10.7.1",
58
58
  "vee-validate": "^4.12.4",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vc-shell/create-vc-app",
3
3
  "description": "Application scaffolding",
4
- "version": "2.4.0-pr311.5130191",
4
+ "version": "2.5.0",
5
5
  "type": "module",
6
6
  "bin": "./dist/index.js",
7
7
  "files": [
@@ -16,7 +16,7 @@
16
16
  "devDependencies": {
17
17
  "@types/ejs": "^3.1.5",
18
18
  "@types/prompts": "^2.4.4",
19
- "@vc-shell/ts-config": "2.4.0-pr311.5130191",
19
+ "@vc-shell/ts-config": "2.5.0",
20
20
  "copyfiles": "^2.4.1",
21
21
  "cross-env": "^7.0.3",
22
22
  "shx": "^0.3.4",