@vc-shell/create-vc-app 2.5.0-pr320.75ed0de → 2.5.0-pr321.e2a103c
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/README.md +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/engine/helpers.d.ts +1 -0
- package/dist/engine/helpers.d.ts.map +1 -1
- package/dist/index.js +54 -45
- package/dist/templates/standalone/_package.json.ejs +3 -0
- package/dist/templates/standalone/src/main.ts.ejs +10 -0
- package/dist/templates/standalone/vite.config.mts.ejs +6 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -39,6 +39,7 @@ npx @vc-shell/create-vc-app my-module --type dynamic-module --module-name "Revie
|
|
|
39
39
|
| `--tenant-routes` | Include tenant routing (`/:tenantId` prefix) | `false` |
|
|
40
40
|
| `--ai-agent` | Include AI Agent configuration | `false` |
|
|
41
41
|
| `--dashboard` | Include Dashboard with widgets | `false` |
|
|
42
|
+
| `--module-federation` | Include Module Federation host runtime | `false` |
|
|
42
43
|
| `--mocks` | Include sample module with mock data | `false` |
|
|
43
44
|
| `--overwrite` | Overwrite existing files without confirmation | `false` |
|
|
44
45
|
| `--help`, `-h` | Show help | — |
|
|
@@ -1 +1 @@
|
|
|
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;AAsBxE,wBAAsB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
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;AAsBxE,wBAAsB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoOpF"}
|
package/dist/engine/helpers.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/engine/helpers.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKxD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOvD;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAOxD;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/engine/helpers.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKxD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOvD;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAOxD;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CA8BnC"}
|
package/dist/index.js
CHANGED
|
@@ -6,9 +6,9 @@ import { exit as J, argv as Y } from "node:process";
|
|
|
6
6
|
import { fileURLToPath as Z } from "node:url";
|
|
7
7
|
import P from "prompts";
|
|
8
8
|
import i from "node:fs";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
const q = "2.5.0-
|
|
9
|
+
import R from "ejs";
|
|
10
|
+
import _ from "prettier";
|
|
11
|
+
const q = "2.5.0-pr321.e2a103c", W = {
|
|
12
12
|
version: q
|
|
13
13
|
};
|
|
14
14
|
function v(e) {
|
|
@@ -46,7 +46,7 @@ function U(e) {
|
|
|
46
46
|
ModuleNameScreamingSnake: t ? O(t) : "",
|
|
47
47
|
ModuleNameSentenceCase: t ? x(t) : ""
|
|
48
48
|
};
|
|
49
|
-
return e.projectName && (o.AppName = v(e.projectName), o.AppNameSentenceCase = x(e.projectName)), e.packageName !== void 0 && (o.PackageName = e.packageName || "", o.BasePath = e.basePath || "", o.tenantRoutes = e.tenantRoutes || !1, o.aiAgent = e.aiAgent || !1, o.dashboard = e.dashboard || !1, o.mocks = e.mocks || !1), o;
|
|
49
|
+
return e.projectName && (o.AppName = v(e.projectName), o.AppNameSentenceCase = x(e.projectName)), e.packageName !== void 0 && (o.PackageName = e.packageName || "", o.BasePath = e.basePath || "", o.tenantRoutes = e.tenantRoutes || !1, o.aiAgent = e.aiAgent || !1, o.dashboard = e.dashboard || !1, o.moduleFederation = e.moduleFederation || !1, o.mocks = e.mocks || !1), o;
|
|
50
50
|
}
|
|
51
51
|
const H = /* @__PURE__ */ new Set([".png", ".jpg", ".jpeg", ".gif", ".bmp", ".ico", ".pdf", ".zip"]), X = {
|
|
52
52
|
_gitignore: ".gitignore",
|
|
@@ -71,7 +71,7 @@ function Q(e, t, n) {
|
|
|
71
71
|
if (H.has(a))
|
|
72
72
|
i.copyFileSync(e, t);
|
|
73
73
|
else {
|
|
74
|
-
const l = i.readFileSync(e, "utf-8"), s =
|
|
74
|
+
const l = i.readFileSync(e, "utf-8"), s = R.render(l, n, { filename: e });
|
|
75
75
|
i.writeFileSync(t, s);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
@@ -82,7 +82,7 @@ function j(e, t, n) {
|
|
|
82
82
|
const l = m.join(e, a), s = a.endsWith(".ejs") ? a.slice(0, -4) : a;
|
|
83
83
|
let c = X[s] ?? s;
|
|
84
84
|
try {
|
|
85
|
-
c =
|
|
85
|
+
c = R.render(c, n);
|
|
86
86
|
} catch {
|
|
87
87
|
}
|
|
88
88
|
const d = m.join(t, c);
|
|
@@ -116,9 +116,9 @@ async function z(e) {
|
|
|
116
116
|
let n = 0;
|
|
117
117
|
for (const o of t)
|
|
118
118
|
try {
|
|
119
|
-
const a = await
|
|
119
|
+
const a = await _.getFileInfo(o, { resolveConfig: !0 });
|
|
120
120
|
if (!a.inferredParser || a.ignored) continue;
|
|
121
|
-
const l = i.readFileSync(o, "utf-8"), s = await
|
|
121
|
+
const l = i.readFileSync(o, "utf-8"), s = await _.resolveConfig(o, { editorconfig: !0 }), c = await _.format(l, { ...s, filepath: o });
|
|
122
122
|
c !== l && (i.writeFileSync(o, c), n++);
|
|
123
123
|
} catch {
|
|
124
124
|
}
|
|
@@ -156,12 +156,12 @@ ${n && e.moduleName ? `
|
|
|
156
156
|
function ae(e) {
|
|
157
157
|
return e.trim().replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase().replace(/[^a-z0-9-]/g, "");
|
|
158
158
|
}
|
|
159
|
-
const
|
|
159
|
+
const F = [
|
|
160
160
|
{ title: "Standalone App — full application with bundled modules", value: "standalone" },
|
|
161
161
|
{ title: "Dynamic Module — remote module loaded by host via Module Federation", value: "dynamic-module" }
|
|
162
162
|
];
|
|
163
163
|
function re(e) {
|
|
164
|
-
return typeof e == "string" &&
|
|
164
|
+
return typeof e == "string" && F.some((t) => t.value === e);
|
|
165
165
|
}
|
|
166
166
|
async function se(e, t) {
|
|
167
167
|
const n = process.cwd();
|
|
@@ -172,7 +172,7 @@ async function se(e, t) {
|
|
|
172
172
|
a = a || l;
|
|
173
173
|
const y = m.resolve(n, a);
|
|
174
174
|
if (!re(e.type)) {
|
|
175
|
-
const S =
|
|
175
|
+
const S = F.map(($) => $.value).join(", ");
|
|
176
176
|
console.error(r.red(`Unknown project type: "${e.type}". Valid types: ${S}`)), process.exit(1);
|
|
177
177
|
}
|
|
178
178
|
i.existsSync(y) && !T(y) && !e.overwrite && (console.error(r.red(`Target directory "${a}" is not empty. Use --overwrite to overwrite.`)), process.exit(1));
|
|
@@ -186,6 +186,7 @@ async function se(e, t) {
|
|
|
186
186
|
tenantRoutes: e["tenant-routes"] || !1,
|
|
187
187
|
aiAgent: e["ai-agent"] || !1,
|
|
188
188
|
dashboard: e.dashboard || !1,
|
|
189
|
+
moduleFederation: e["module-federation"] || !1,
|
|
189
190
|
mocks: e.mocks || !1
|
|
190
191
|
};
|
|
191
192
|
} else {
|
|
@@ -211,8 +212,8 @@ async function se(e, t) {
|
|
|
211
212
|
message: () => (a === "." ? "Current directory" : `Target directory "${a}"`) + " is not empty. Remove existing files and continue?"
|
|
212
213
|
},
|
|
213
214
|
{
|
|
214
|
-
type: (w, { overwrite:
|
|
215
|
-
if (
|
|
215
|
+
type: (w, { overwrite: I }) => {
|
|
216
|
+
if (I === !1)
|
|
216
217
|
throw new Error(r.red("✖") + " Operation cancelled");
|
|
217
218
|
return null;
|
|
218
219
|
},
|
|
@@ -229,7 +230,7 @@ async function se(e, t) {
|
|
|
229
230
|
type: "select",
|
|
230
231
|
name: "projectType",
|
|
231
232
|
message: r.reset("Project type:"),
|
|
232
|
-
choices:
|
|
233
|
+
choices: F
|
|
233
234
|
}
|
|
234
235
|
],
|
|
235
236
|
{ onCancel: y }
|
|
@@ -243,7 +244,7 @@ async function se(e, t) {
|
|
|
243
244
|
},
|
|
244
245
|
{
|
|
245
246
|
name: "moduleName",
|
|
246
|
-
type: (w,
|
|
247
|
+
type: (w, I) => g === "standalone" && !I.includeModule ? null : "text",
|
|
247
248
|
message: r.reset("Module name:"),
|
|
248
249
|
initial: b,
|
|
249
250
|
format: (w) => String(w).trim()
|
|
@@ -273,6 +274,12 @@ async function se(e, t) {
|
|
|
273
274
|
message: "Include Dashboard with widgets?",
|
|
274
275
|
initial: !0
|
|
275
276
|
},
|
|
277
|
+
{
|
|
278
|
+
type: g === "dynamic-module" ? null : "confirm",
|
|
279
|
+
name: "moduleFederation",
|
|
280
|
+
message: "Include Module Federation host (load remote modules)?",
|
|
281
|
+
initial: !1
|
|
282
|
+
},
|
|
276
283
|
{
|
|
277
284
|
name: "mocks",
|
|
278
285
|
type: "confirm",
|
|
@@ -291,22 +298,23 @@ async function se(e, t) {
|
|
|
291
298
|
tenantRoutes: $.tenantRoutes || !1,
|
|
292
299
|
aiAgent: $.aiAgent || !1,
|
|
293
300
|
dashboard: $.dashboard ?? !0,
|
|
301
|
+
moduleFederation: $.moduleFederation || !1,
|
|
294
302
|
mocks: $.mocks || !1
|
|
295
303
|
};
|
|
296
304
|
} catch (f) {
|
|
297
305
|
console.log(f.message), process.exit(1);
|
|
298
306
|
}
|
|
299
307
|
}
|
|
300
|
-
const
|
|
301
|
-
i.existsSync(
|
|
302
|
-
Scaffolding ${r.cyan(d.projectType)} in ${r.green(
|
|
308
|
+
const u = m.resolve(n, a);
|
|
309
|
+
i.existsSync(u) && !T(u) ? ee(u) : i.existsSync(u) || i.mkdirSync(u, { recursive: !0 }), console.log(`
|
|
310
|
+
Scaffolding ${r.cyan(d.projectType)} in ${r.green(u)}...
|
|
303
311
|
`);
|
|
304
|
-
const
|
|
305
|
-
if (j(m.join(t, d.projectType),
|
|
306
|
-
const y = v(d.moduleName), f = d.projectType === "dynamic-module" ? m.join(
|
|
307
|
-
j(m.join(t, "module"), f,
|
|
312
|
+
const p = U(d);
|
|
313
|
+
if (j(m.join(t, d.projectType), u, p), d.moduleName) {
|
|
314
|
+
const y = v(d.moduleName), f = d.projectType === "dynamic-module" ? m.join(u, "src/modules") : m.join(u, "src/modules", y);
|
|
315
|
+
j(m.join(t, "module"), f, p);
|
|
308
316
|
}
|
|
309
|
-
d.mocks && j(m.join(t, "sample-module"), m.join(
|
|
317
|
+
d.mocks && j(m.join(t, "sample-module"), m.join(u, "src/modules/sample"), p), await z([u]), oe(d);
|
|
310
318
|
}
|
|
311
319
|
function k(e, { strings: t = !0 } = {}) {
|
|
312
320
|
const n = e.split("");
|
|
@@ -421,29 +429,29 @@ ${e}` : C(e, [{ at: a, text: `
|
|
|
421
429
|
${o}` }]);
|
|
422
430
|
}
|
|
423
431
|
function de(e, t) {
|
|
424
|
-
const n = v(t), o = O(t), a = me(i.readFileSync(e, "utf-8")), l = k(a), s = (
|
|
425
|
-
`${
|
|
426
|
-
`${
|
|
427
|
-
`${
|
|
428
|
-
`${
|
|
429
|
-
`${
|
|
430
|
-
`${
|
|
432
|
+
const n = v(t), o = O(t), a = me(i.readFileSync(e, "utf-8")), l = k(a), s = (p) => [
|
|
433
|
+
`${p}addMenuItem({`,
|
|
434
|
+
`${p} title: "${o}.MENU.TITLE",`,
|
|
435
|
+
`${p} icon: "lucide-box",`,
|
|
436
|
+
`${p} priority: 10,`,
|
|
437
|
+
`${p} url: "/${n}",`,
|
|
438
|
+
`${p}});`
|
|
431
439
|
].join(`
|
|
432
440
|
`), c = ce(l, "addMenuItem"), d = c[c.length - 1];
|
|
433
441
|
if (d) {
|
|
434
|
-
const
|
|
442
|
+
const p = V(a, d.start);
|
|
435
443
|
i.writeFileSync(e, C(a, [{ at: d.end, text: `
|
|
436
444
|
|
|
437
|
-
${s(
|
|
445
|
+
${s(p)}` }]));
|
|
438
446
|
return;
|
|
439
447
|
}
|
|
440
|
-
const
|
|
441
|
-
if (
|
|
448
|
+
const u = l.lastIndexOf("}");
|
|
449
|
+
if (u === -1)
|
|
442
450
|
throw new Error("Could not find the bootstrap function body in bootstrap.ts");
|
|
443
|
-
i.writeFileSync(e, C(a, [{ at:
|
|
451
|
+
i.writeFileSync(e, C(a, [{ at: u, text: `${s(" ")}
|
|
444
452
|
` }]));
|
|
445
453
|
}
|
|
446
|
-
async function
|
|
454
|
+
async function ue(e, t) {
|
|
447
455
|
const n = process.cwd(), o = e._?.[1], a = m.join(n, "package.json");
|
|
448
456
|
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
457
|
const l = JSON.parse(i.readFileSync(a, "utf-8"));
|
|
@@ -455,16 +463,16 @@ async function pe(e, t) {
|
|
|
455
463
|
message: "Module name:",
|
|
456
464
|
validate: (S) => S.trim().length > 0 || "Module name is required"
|
|
457
465
|
})).moduleName), c || (console.error(r.red("Module name is required.")), process.exit(1));
|
|
458
|
-
const d = v(c),
|
|
459
|
-
i.existsSync(
|
|
466
|
+
const d = v(c), u = M(c), p = m.join(n, "src/modules"), y = m.join(p, d);
|
|
467
|
+
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
468
|
const f = U({ moduleName: c, projectName: m.basename(n) });
|
|
461
469
|
j(m.join(t, "module"), y, f), console.log(r.green(` ✔ Created ${m.relative(n, y)}/`));
|
|
462
470
|
const h = m.join(n, "src/main.ts");
|
|
463
471
|
if (i.existsSync(h))
|
|
464
472
|
try {
|
|
465
|
-
le(h, c), console.log(r.green(` ✔ Updated src/main.ts — added import & app.use(${
|
|
473
|
+
le(h, c), console.log(r.green(` ✔ Updated src/main.ts — added import & app.use(${u})`));
|
|
466
474
|
} catch {
|
|
467
|
-
console.warn(r.yellow(" ⚠ Could not auto-update src/main.ts. Add manually:")), console.warn(r.yellow(` import ${
|
|
475
|
+
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
476
|
}
|
|
469
477
|
const g = m.join(n, "src/bootstrap.ts");
|
|
470
478
|
if (i.existsSync(g))
|
|
@@ -477,8 +485,8 @@ async function pe(e, t) {
|
|
|
477
485
|
Module "${d}" is ready! Run ${r.bold(r.green("yarn serve"))} to see it.
|
|
478
486
|
`);
|
|
479
487
|
}
|
|
480
|
-
const
|
|
481
|
-
function
|
|
488
|
+
const D = m.resolve(Z(import.meta.url), "..", "templates");
|
|
489
|
+
function pe() {
|
|
482
490
|
console.log(`
|
|
483
491
|
${r.bold(r.green("create-vc-app"))} — Create VC Shell applications and modules
|
|
484
492
|
|
|
@@ -495,6 +503,7 @@ ${r.bold("Options (create):")}
|
|
|
495
503
|
--tenant-routes Include tenant routing (/:tenantId prefix)
|
|
496
504
|
--ai-agent Include AI Agent configuration
|
|
497
505
|
--dashboard Include Dashboard with widgets
|
|
506
|
+
--module-federation Include Module Federation host runtime
|
|
498
507
|
--mocks Include sample module with mock data
|
|
499
508
|
--overwrite Overwrite existing files
|
|
500
509
|
--help, -h Show this help
|
|
@@ -512,18 +521,18 @@ ${r.bold("Docs:")} https://docs.virtocommerce.org/platform/developer-guide/lates
|
|
|
512
521
|
async function fe() {
|
|
513
522
|
const e = K(Y.slice(2), {
|
|
514
523
|
alias: { h: "help", v: "version" },
|
|
515
|
-
boolean: ["help", "version", "mocks", "overwrite", "tenant-routes", "ai-agent", "dashboard"],
|
|
524
|
+
boolean: ["help", "version", "mocks", "overwrite", "tenant-routes", "ai-agent", "dashboard", "module-federation"],
|
|
516
525
|
string: ["type", "name", "app-name", "package-name", "module-name", "base-path"]
|
|
517
526
|
});
|
|
518
527
|
if (e.help) {
|
|
519
|
-
|
|
528
|
+
pe();
|
|
520
529
|
return;
|
|
521
530
|
}
|
|
522
531
|
if (e.version) {
|
|
523
532
|
console.log(`create-vc-app v${W.version}`);
|
|
524
533
|
return;
|
|
525
534
|
}
|
|
526
|
-
e._[0] === "add-module" ? await
|
|
535
|
+
e._[0] === "add-module" ? await ue(e, D) : await se(e, D);
|
|
527
536
|
}
|
|
528
537
|
fe().catch((e) => {
|
|
529
538
|
console.error(r.red(e.message || String(e))), J(1);
|
|
@@ -53,6 +53,9 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@vc-shell/config-generator": "^2.5.0",
|
|
55
55
|
"@vc-shell/framework": "^2.5.0",
|
|
56
|
+
<%_ if (moduleFederation) { _%>
|
|
57
|
+
"@vc-shell/mf-host": "^2.5.0",
|
|
58
|
+
<%_ } _%>
|
|
56
59
|
"@vueuse/core": "^10.7.1",
|
|
57
60
|
"@vueuse/integrations": "^10.7.1",
|
|
58
61
|
"vee-validate": "^4.12.4",
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import VirtoShellFramework, { notification, useUser, useLanguages } from "@vc-shell/framework";
|
|
2
|
+
<% if (moduleFederation) { -%>
|
|
3
|
+
import { registerRemoteModules } from "@vc-shell/mf-host";
|
|
4
|
+
<% } -%>
|
|
2
5
|
import { createApp } from "vue";
|
|
3
6
|
import { router } from "./router";
|
|
4
7
|
import * as locales from "./locales";
|
|
@@ -63,6 +66,13 @@ async function startApp() {
|
|
|
63
66
|
});
|
|
64
67
|
};
|
|
65
68
|
|
|
69
|
+
<% if (moduleFederation) { -%>
|
|
70
|
+
// Register remote modules BEFORE mount so the provide/inject keys
|
|
71
|
+
// (ModulesReadyKey, ModulesLoadErrorKey) are available to mounted components.
|
|
72
|
+
// Fire-and-forget — sets modulesReady/modulesLoadError when complete.
|
|
73
|
+
registerRemoteModules(app, { router, appName: "<%- AppName %>" });
|
|
74
|
+
|
|
75
|
+
<% } -%>
|
|
66
76
|
await router.isReady();
|
|
67
77
|
|
|
68
78
|
app.mount("#app");
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { getApplicationConfiguration } from "@vc-shell/config-generator";
|
|
2
|
+
<%_ if (moduleFederation) { _%>
|
|
3
|
+
import { mfHostConfig } from "@vc-shell/mf-host/vite";
|
|
4
|
+
<%_ } _%>
|
|
2
5
|
|
|
3
6
|
export default getApplicationConfiguration({
|
|
7
|
+
<%_ if (moduleFederation) { _%>
|
|
8
|
+
...mfHostConfig(),
|
|
9
|
+
<%_ } _%>
|
|
4
10
|
// Add you extra Vite configuration here
|
|
5
11
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface ProjectOptions {
|
|
|
8
8
|
tenantRoutes: boolean;
|
|
9
9
|
aiAgent: boolean;
|
|
10
10
|
dashboard: boolean;
|
|
11
|
+
moduleFederation: boolean;
|
|
11
12
|
mocks: boolean;
|
|
12
13
|
}
|
|
13
14
|
export interface ModuleOptions {
|
|
@@ -35,5 +36,6 @@ export interface CLIArgs {
|
|
|
35
36
|
"tenant-routes"?: boolean;
|
|
36
37
|
"ai-agent"?: boolean;
|
|
37
38
|
dashboard?: boolean;
|
|
39
|
+
"module-federation"?: boolean;
|
|
38
40
|
}
|
|
39
41
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAE1D,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,cAAc,CAAC;IACxB,cAAc,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACnG,SAAS,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC7F;AAED,MAAM,WAAW,OAAO;IACtB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAE1D,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,cAAc,CAAC;IACxB,cAAc,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACnG,SAAS,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC7F;AAED,MAAM,WAAW,OAAO;IACtB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B"}
|
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.5.0-
|
|
4
|
+
"version": "2.5.0-pr321.e2a103c",
|
|
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.5.0-
|
|
19
|
+
"@vc-shell/ts-config": "2.5.0-pr321.e2a103c",
|
|
20
20
|
"copyfiles": "^2.4.1",
|
|
21
21
|
"cross-env": "^7.0.3",
|
|
22
22
|
"shx": "^0.3.4",
|