@open-mercato/cli 0.6.7-develop.6631.1.9d64b49ddc → 0.6.7-develop.6646.1.be515f3d49
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/agentic/guides/module-facts.json +53 -53
- package/dist/agentic/guides/modules/ai_assistant.md +1 -1
- package/dist/agentic/guides/modules/api_docs.md +1 -1
- package/dist/agentic/guides/modules/api_keys.md +1 -1
- package/dist/agentic/guides/modules/attachments.md +1 -1
- package/dist/agentic/guides/modules/audit_logs.md +1 -1
- package/dist/agentic/guides/modules/auth.md +1 -1
- package/dist/agentic/guides/modules/business_rules.md +1 -1
- package/dist/agentic/guides/modules/catalog.md +1 -1
- package/dist/agentic/guides/modules/channel_gmail.md +1 -1
- package/dist/agentic/guides/modules/channel_imap.md +1 -1
- package/dist/agentic/guides/modules/checkout.md +1 -1
- package/dist/agentic/guides/modules/communication_channels.md +1 -1
- package/dist/agentic/guides/modules/configs.md +1 -1
- package/dist/agentic/guides/modules/content.md +1 -1
- package/dist/agentic/guides/modules/currencies.md +1 -1
- package/dist/agentic/guides/modules/customer_accounts.md +1 -1
- package/dist/agentic/guides/modules/customers.md +1 -1
- package/dist/agentic/guides/modules/dashboards.md +1 -1
- package/dist/agentic/guides/modules/data_sync.md +1 -1
- package/dist/agentic/guides/modules/dictionaries.md +1 -1
- package/dist/agentic/guides/modules/directory.md +1 -1
- package/dist/agentic/guides/modules/entities.md +1 -1
- package/dist/agentic/guides/modules/events.md +1 -1
- package/dist/agentic/guides/modules/feature_toggles.md +1 -1
- package/dist/agentic/guides/modules/gateway_stripe.md +1 -1
- package/dist/agentic/guides/modules/generators.md +1 -1
- package/dist/agentic/guides/modules/inbox_ops.md +1 -1
- package/dist/agentic/guides/modules/integrations.md +1 -1
- package/dist/agentic/guides/modules/messages.md +1 -1
- package/dist/agentic/guides/modules/notifications.md +1 -1
- package/dist/agentic/guides/modules/onboarding.md +1 -1
- package/dist/agentic/guides/modules/payment_gateways.md +1 -1
- package/dist/agentic/guides/modules/perspectives.md +1 -1
- package/dist/agentic/guides/modules/planner.md +1 -1
- package/dist/agentic/guides/modules/portal.md +1 -1
- package/dist/agentic/guides/modules/progress.md +1 -1
- package/dist/agentic/guides/modules/query_index.md +1 -1
- package/dist/agentic/guides/modules/record_locks.md +1 -1
- package/dist/agentic/guides/modules/resources.md +1 -1
- package/dist/agentic/guides/modules/sales.md +1 -1
- package/dist/agentic/guides/modules/scheduler.md +1 -1
- package/dist/agentic/guides/modules/search.md +1 -1
- package/dist/agentic/guides/modules/security.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers.md +1 -1
- package/dist/agentic/guides/modules/sso.md +1 -1
- package/dist/agentic/guides/modules/staff.md +1 -1
- package/dist/agentic/guides/modules/storage_s3.md +1 -1
- package/dist/agentic/guides/modules/sync_akeneo.md +1 -1
- package/dist/agentic/guides/modules/sync_excel.md +1 -1
- package/dist/agentic/guides/modules/system_status_overlays.md +1 -1
- package/dist/agentic/guides/modules/translations.md +1 -1
- package/dist/agentic/guides/modules/webhooks.md +1 -1
- package/dist/agentic/guides/modules/workflows.md +1 -1
- package/dist/lib/generators/module-registry.js +32 -6
- package/dist/lib/generators/module-registry.js.map +2 -2
- package/package.json +5 -5
- package/src/lib/generators/__tests__/route-collision-guard.test.ts +123 -0
- package/src/lib/generators/module-registry.ts +46 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# feature_toggles — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6646.1.be515f3d49 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# gateway_stripe — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6646.1.be515f3d49 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# payment_gateways — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6646.1.be515f3d49 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# shipping_carriers — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6646.1.be515f3d49 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# system_status_overlays — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6646.1.be515f3d49 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -58,6 +58,16 @@ import {
|
|
|
58
58
|
resolveStandaloneSourceMirrorBase
|
|
59
59
|
} from "./scanner.js";
|
|
60
60
|
import { loadGeneratorExtensions } from "./extensions/index.js";
|
|
61
|
+
function assertUniqueBackendRoutePattern(seen, moduleId, pattern) {
|
|
62
|
+
if (!pattern.startsWith("/backend/")) return;
|
|
63
|
+
const previous = seen.get(pattern);
|
|
64
|
+
if (previous && previous !== moduleId) {
|
|
65
|
+
throw new Error(
|
|
66
|
+
`[generate] Duplicate backend route pattern "${pattern}" generated by modules "${previous}" and "${moduleId}". Each backend page must resolve to a unique URL \u2014 nest the page under a module-specific folder (e.g. backend/${moduleId}/...) so it does not silently shadow another module.`
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
seen.set(pattern, moduleId);
|
|
70
|
+
}
|
|
61
71
|
function scanDashboardWidgetEntries(options) {
|
|
62
72
|
const { modId, roots, appImportBase, pkgImportBase } = options;
|
|
63
73
|
const files = scanModuleDir(roots, SCAN_CONFIGS.dashboardWidgets);
|
|
@@ -1230,6 +1240,7 @@ async function processPageFiles(options) {
|
|
|
1230
1240
|
const eagerRoutes = [];
|
|
1231
1241
|
const runtimeRoutes = [];
|
|
1232
1242
|
const manifestRoutes = [];
|
|
1243
|
+
const routePatterns = [];
|
|
1233
1244
|
for (const { relPath, fromApp } of files.filter(({ relPath: f }) => isModulePageFile(path.basename(f)))) {
|
|
1234
1245
|
const segs = relPath.split("/");
|
|
1235
1246
|
const pageFile = segs.pop();
|
|
@@ -1297,6 +1308,7 @@ async function processPageFiles(options) {
|
|
|
1297
1308
|
eagerRoutes.push(`{ ${baseProps}, Component: ${buildLazyRouteComponentExpression(importPath)} }`);
|
|
1298
1309
|
runtimeRoutes.push(`{ ${runtimeBaseProps}, Component: ${buildLazyRouteComponentExpression(importPath)} }`);
|
|
1299
1310
|
manifestRoutes.push(`{ moduleId: ${toLiteral(modId)}, ${manifestBaseProps}, load: async () => { const mod = await ${buildDynamicImportExpression(importPath)}; return (mod.default ?? mod) as any } }`);
|
|
1311
|
+
routePatterns.push(routePath);
|
|
1300
1312
|
}
|
|
1301
1313
|
for (const { relPath, fromApp } of files.filter(({ relPath: f }) => !isModulePageFile(path.basename(f)))) {
|
|
1302
1314
|
const segs = relPath.split("/");
|
|
@@ -1369,11 +1381,13 @@ async function processPageFiles(options) {
|
|
|
1369
1381
|
eagerRoutes.push(`{ ${baseProps}, Component: ${buildLazyRouteComponentExpression(importPath)} }`);
|
|
1370
1382
|
runtimeRoutes.push(`{ ${runtimeBaseProps}, Component: ${buildLazyRouteComponentExpression(importPath)} }`);
|
|
1371
1383
|
manifestRoutes.push(`{ moduleId: ${toLiteral(modId)}, ${manifestBaseProps}, load: async () => { const mod = await ${buildDynamicImportExpression(importPath)}; return (mod.default ?? mod) as any } }`);
|
|
1384
|
+
routePatterns.push(routePath);
|
|
1372
1385
|
}
|
|
1373
1386
|
return {
|
|
1374
1387
|
eagerRoutes,
|
|
1375
1388
|
runtimeRoutes,
|
|
1376
|
-
manifestRoutes
|
|
1389
|
+
manifestRoutes,
|
|
1390
|
+
routePatterns
|
|
1377
1391
|
};
|
|
1378
1392
|
}
|
|
1379
1393
|
async function processApiRoutes(options) {
|
|
@@ -1939,6 +1953,7 @@ async function processPageFilesAst(options) {
|
|
|
1939
1953
|
importIdRef
|
|
1940
1954
|
} = options;
|
|
1941
1955
|
const routes = [];
|
|
1956
|
+
const routePatterns = [];
|
|
1942
1957
|
const metaPrefix = type === "frontend" ? "MRuntime" : "BMRuntime";
|
|
1943
1958
|
const addRoute = (params) => {
|
|
1944
1959
|
routes.push(
|
|
@@ -1950,6 +1965,7 @@ async function processPageFilesAst(options) {
|
|
|
1950
1965
|
}
|
|
1951
1966
|
])
|
|
1952
1967
|
);
|
|
1968
|
+
routePatterns.push(params.routePath);
|
|
1953
1969
|
};
|
|
1954
1970
|
for (const { relPath, fromApp } of files.filter(({ relPath: filePath }) => isModulePageFile(path.basename(filePath)))) {
|
|
1955
1971
|
const segs = relPath.split("/");
|
|
@@ -2031,7 +2047,7 @@ async function processPageFilesAst(options) {
|
|
|
2031
2047
|
metaExpr: rawExpression(staticMetadata.manifestExpr)
|
|
2032
2048
|
});
|
|
2033
2049
|
}
|
|
2034
|
-
return routes;
|
|
2050
|
+
return { routes, routePatterns };
|
|
2035
2051
|
}
|
|
2036
2052
|
function processSubscribersAst(discovered) {
|
|
2037
2053
|
const subscribers = [];
|
|
@@ -2190,6 +2206,7 @@ async function generateModuleRegistryFromDiscovery(options) {
|
|
|
2190
2206
|
const commandLoaderEntries = [];
|
|
2191
2207
|
let hasRouteComponents = false;
|
|
2192
2208
|
const umesConflictSources = [];
|
|
2209
|
+
const seenBackendRoutePatterns = /* @__PURE__ */ new Map();
|
|
2193
2210
|
for (const discovered of discovery.modules) {
|
|
2194
2211
|
const { modId, roots, imps, appImportBase } = discovered;
|
|
2195
2212
|
commandLoaderEntries.push(...discovered.commandLoaderEntries);
|
|
@@ -2348,6 +2365,9 @@ async function generateModuleRegistryFromDiscovery(options) {
|
|
|
2348
2365
|
backendRoutes.push(...generatedBackendRoutes.eagerRoutes);
|
|
2349
2366
|
runtimeBackendRoutes.push(...generatedBackendRoutes.runtimeRoutes);
|
|
2350
2367
|
backendRouteManifestDecls.push(...generatedBackendRoutes.manifestRoutes);
|
|
2368
|
+
for (const pattern of generatedBackendRoutes.routePatterns) {
|
|
2369
|
+
assertUniqueBackendRoutePattern(seenBackendRoutePatterns, modId, pattern);
|
|
2370
|
+
}
|
|
2351
2371
|
hasRouteComponents = true;
|
|
2352
2372
|
}
|
|
2353
2373
|
}
|
|
@@ -2690,6 +2710,7 @@ async function generateModuleRegistryAppFromDiscovery(options) {
|
|
|
2690
2710
|
const requiresByModule = /* @__PURE__ */ new Map();
|
|
2691
2711
|
const commandLoaderEntries = [];
|
|
2692
2712
|
let hasRouteComponents = false;
|
|
2713
|
+
const seenBackendRoutePatterns = /* @__PURE__ */ new Map();
|
|
2693
2714
|
for (const discovered of discovery.modules) {
|
|
2694
2715
|
const { modId, roots, imps, appImportBase } = discovered;
|
|
2695
2716
|
commandLoaderEntries.push(...discovered.commandLoaderEntries);
|
|
@@ -2766,7 +2787,7 @@ async function generateModuleRegistryAppFromDiscovery(options) {
|
|
|
2766
2787
|
const fePkg = path.join(roots.pkgBase, "frontend");
|
|
2767
2788
|
const feFiles = discovered.frontendFiles;
|
|
2768
2789
|
if (feFiles.length > 0) {
|
|
2769
|
-
|
|
2790
|
+
const feAst = await processPageFilesAst({
|
|
2770
2791
|
files: feFiles,
|
|
2771
2792
|
type: "frontend",
|
|
2772
2793
|
modId,
|
|
@@ -2776,7 +2797,8 @@ async function generateModuleRegistryAppFromDiscovery(options) {
|
|
|
2776
2797
|
pkgImportBase: imps.pkgBase,
|
|
2777
2798
|
imports,
|
|
2778
2799
|
importIdRef
|
|
2779
|
-
})
|
|
2800
|
+
});
|
|
2801
|
+
frontendRoutes.push(...feAst.routes);
|
|
2780
2802
|
hasRouteComponents = true;
|
|
2781
2803
|
}
|
|
2782
2804
|
}
|
|
@@ -2785,7 +2807,7 @@ async function generateModuleRegistryAppFromDiscovery(options) {
|
|
|
2785
2807
|
const bePkg = path.join(roots.pkgBase, "backend");
|
|
2786
2808
|
const beFiles = discovered.backendFiles;
|
|
2787
2809
|
if (beFiles.length > 0) {
|
|
2788
|
-
|
|
2810
|
+
const beAst = await processPageFilesAst({
|
|
2789
2811
|
files: beFiles,
|
|
2790
2812
|
type: "backend",
|
|
2791
2813
|
modId,
|
|
@@ -2795,7 +2817,11 @@ async function generateModuleRegistryAppFromDiscovery(options) {
|
|
|
2795
2817
|
pkgImportBase: imps.pkgBase,
|
|
2796
2818
|
imports,
|
|
2797
2819
|
importIdRef
|
|
2798
|
-
})
|
|
2820
|
+
});
|
|
2821
|
+
backendRoutes.push(...beAst.routes);
|
|
2822
|
+
for (const pattern of beAst.routePatterns) {
|
|
2823
|
+
assertUniqueBackendRoutePattern(seenBackendRoutePatterns, modId, pattern);
|
|
2824
|
+
}
|
|
2799
2825
|
hasRouteComponents = true;
|
|
2800
2826
|
}
|
|
2801
2827
|
}
|