@open-mercato/cli 0.10.1-develop.7983.1.fd91207efe → 0.10.1-develop.7994.1.c9f31972aa
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/.turbo/turbo-build.log +1 -1
- package/dist/agentic/guides/module-facts.json +162 -162
- package/dist/agentic/guides/module-facts.v2.json +162 -162
- package/dist/agentic/guides/module-tool.md +21 -0
- package/dist/agentic/guides/modules/agent_orchestrator/index.md +1 -1
- package/dist/agentic/guides/modules/ai_assistant/index.md +1 -1
- package/dist/agentic/guides/modules/api_docs/index.md +1 -1
- package/dist/agentic/guides/modules/api_keys/index.md +1 -1
- package/dist/agentic/guides/modules/attachments/index.md +1 -1
- package/dist/agentic/guides/modules/audit_logs/index.md +1 -1
- package/dist/agentic/guides/modules/auth/index.md +1 -1
- package/dist/agentic/guides/modules/availability/index.md +1 -1
- package/dist/agentic/guides/modules/business_rules/index.md +1 -1
- package/dist/agentic/guides/modules/carrier_inpost/index.md +1 -1
- package/dist/agentic/guides/modules/cart/index.md +1 -1
- package/dist/agentic/guides/modules/catalog/index.md +1 -1
- package/dist/agentic/guides/modules/channel_apns/index.md +1 -1
- package/dist/agentic/guides/modules/channel_discord/index.md +1 -1
- package/dist/agentic/guides/modules/channel_expo/index.md +1 -1
- package/dist/agentic/guides/modules/channel_fcm/index.md +1 -1
- package/dist/agentic/guides/modules/channel_gmail/index.md +1 -1
- package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
- package/dist/agentic/guides/modules/channel_resend/index.md +1 -1
- package/dist/agentic/guides/modules/channel_ses/index.md +1 -1
- package/dist/agentic/guides/modules/channel_smtp/index.md +1 -1
- package/dist/agentic/guides/modules/checkout/index.md +1 -1
- package/dist/agentic/guides/modules/communication_channels/index.md +1 -1
- package/dist/agentic/guides/modules/configs/index.md +1 -1
- package/dist/agentic/guides/modules/content/index.md +1 -1
- package/dist/agentic/guides/modules/currencies/index.md +1 -1
- package/dist/agentic/guides/modules/customer_accounts/index.md +1 -1
- package/dist/agentic/guides/modules/customer_groups/index.md +1 -1
- package/dist/agentic/guides/modules/customers/index.md +1 -1
- package/dist/agentic/guides/modules/dashboards/index.md +1 -1
- package/dist/agentic/guides/modules/data_sync/index.md +1 -1
- package/dist/agentic/guides/modules/design_system/index.md +1 -1
- package/dist/agentic/guides/modules/devices/index.md +1 -1
- package/dist/agentic/guides/modules/dictionaries/index.md +1 -1
- package/dist/agentic/guides/modules/directory/index.md +1 -1
- package/dist/agentic/guides/modules/documents/index.md +1 -1
- package/dist/agentic/guides/modules/ecommerce/index.md +1 -1
- package/dist/agentic/guides/modules/entities/index.md +1 -1
- package/dist/agentic/guides/modules/eudr/index.md +1 -1
- package/dist/agentic/guides/modules/events/index.md +1 -1
- package/dist/agentic/guides/modules/feature_toggles/index.md +1 -1
- package/dist/agentic/guides/modules/forms/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_autopay/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_tpay/index.md +1 -1
- package/dist/agentic/guides/modules/generators/index.md +1 -1
- package/dist/agentic/guides/modules/inbox_ops/index.md +1 -1
- package/dist/agentic/guides/modules/integrations/index.md +1 -1
- package/dist/agentic/guides/modules/messages/index.md +1 -1
- package/dist/agentic/guides/modules/notifications/index.md +1 -1
- package/dist/agentic/guides/modules/onboarding/index.md +1 -1
- package/dist/agentic/guides/modules/payment_gateways/index.md +1 -1
- package/dist/agentic/guides/modules/perspectives/index.md +1 -1
- package/dist/agentic/guides/modules/phone_calls/index.md +1 -1
- package/dist/agentic/guides/modules/planner/index.md +1 -1
- package/dist/agentic/guides/modules/portal/index.md +1 -1
- package/dist/agentic/guides/modules/progress/index.md +1 -1
- package/dist/agentic/guides/modules/promotions/index.md +1 -1
- package/dist/agentic/guides/modules/push_notifications/index.md +1 -1
- package/dist/agentic/guides/modules/query_index/index.md +1 -1
- package/dist/agentic/guides/modules/record_locks/index.md +1 -1
- package/dist/agentic/guides/modules/resources/index.md +1 -1
- package/dist/agentic/guides/modules/sales/index.md +1 -1
- package/dist/agentic/guides/modules/scheduler/index.md +1 -1
- package/dist/agentic/guides/modules/search/index.md +1 -1
- package/dist/agentic/guides/modules/security/index.md +1 -1
- package/dist/agentic/guides/modules/seeds/index.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers/index.md +1 -1
- package/dist/agentic/guides/modules/sso/index.md +1 -1
- package/dist/agentic/guides/modules/staff/index.md +1 -1
- package/dist/agentic/guides/modules/storage_s3/index.md +1 -1
- package/dist/agentic/guides/modules/sync_akeneo/index.md +1 -1
- package/dist/agentic/guides/modules/sync_excel/index.md +1 -1
- package/dist/agentic/guides/modules/system_status_overlays/index.md +1 -1
- package/dist/agentic/guides/modules/telemetry/index.md +1 -1
- package/dist/agentic/guides/modules/tillio/index.md +1 -1
- package/dist/agentic/guides/modules/translations/index.md +1 -1
- package/dist/agentic/guides/modules/warranty_claims/index.md +1 -1
- package/dist/agentic/guides/modules/webhooks/index.md +1 -1
- package/dist/agentic/guides/modules/wms/index.md +1 -1
- package/dist/agentic/guides/modules/workflows/index.md +1 -1
- package/dist/agentic/guides/reference-module-facts.json +1 -1
- package/dist/agentic/guides/upstream/manifest.json +1 -1
- package/dist/agentic/shared/ai/harness/cases.json +23 -9
- package/dist/agentic/shared/ai/harness/source-link-inventory.json +90 -4
- package/dist/lib/__integration__/TC-INT-007.spec.js +207 -19
- package/dist/lib/__integration__/TC-INT-007.spec.js.map +2 -2
- package/dist/lib/__integration__/TC-INT-009.spec.js +267 -0
- package/dist/lib/__integration__/TC-INT-009.spec.js.map +7 -0
- package/dist/lib/eject.js +25 -9
- package/dist/lib/eject.js.map +2 -2
- package/dist/lib/generators/entity-ids.js +2 -0
- package/dist/lib/generators/entity-ids.js.map +2 -2
- package/dist/lib/generators/module-di.js +2 -0
- package/dist/lib/generators/module-di.js.map +2 -2
- package/dist/lib/generators/module-entities.js +2 -0
- package/dist/lib/generators/module-entities.js.map +2 -2
- package/dist/lib/generators/module-package-sources.js +6 -4
- package/dist/lib/generators/module-package-sources.js.map +2 -2
- package/dist/lib/generators/module-registry.js +32 -86
- package/dist/lib/generators/module-registry.js.map +2 -2
- package/dist/lib/generators/openapi.js +2 -0
- package/dist/lib/generators/openapi.js.map +2 -2
- package/dist/lib/generators/source-exports.js +73 -0
- package/dist/lib/generators/source-exports.js.map +7 -0
- package/dist/lib/init-summary.js +44 -0
- package/dist/lib/init-summary.js.map +7 -0
- package/dist/lib/module-github.js +98 -0
- package/dist/lib/module-github.js.map +7 -0
- package/dist/lib/module-identity.js +131 -0
- package/dist/lib/module-identity.js.map +7 -0
- package/dist/lib/module-inspection.js +124 -0
- package/dist/lib/module-inspection.js.map +7 -0
- package/dist/lib/module-install.js +150 -21
- package/dist/lib/module-install.js.map +3 -3
- package/dist/lib/module-package.js +205 -15
- package/dist/lib/module-package.js.map +2 -2
- package/dist/lib/modules-config.js +69 -30
- package/dist/lib/modules-config.js.map +2 -2
- package/dist/lib/resolver.js +33 -34
- package/dist/lib/resolver.js.map +2 -2
- package/dist/mercato.js +14 -23
- package/dist/mercato.js.map +2 -2
- package/package.json +7 -7
- package/src/__tests__/mercato.test.ts +14 -4
- package/src/lib/__fixtures__/official-module-package/dist/modules/test_package/widgets/injection/test/widget.js +1 -0
- package/src/lib/__integration__/TC-INT-007.spec.ts +219 -19
- package/src/lib/__integration__/TC-INT-009.spec.ts +279 -0
- package/src/lib/__tests__/eject.test.ts +98 -4
- package/src/lib/__tests__/init-summary.test.ts +50 -0
- package/src/lib/__tests__/module-github.test.ts +108 -0
- package/src/lib/__tests__/module-identity.test.ts +144 -0
- package/src/lib/__tests__/module-inspection.test.ts +195 -0
- package/src/lib/__tests__/module-install.test.ts +399 -10
- package/src/lib/__tests__/module-package.test.ts +154 -0
- package/src/lib/__tests__/modules-config.test.ts +55 -0
- package/src/lib/__tests__/resolver.packages.test.ts +29 -0
- package/src/lib/eject.ts +28 -10
- package/src/lib/generators/__tests__/module-id-collisions.test.ts +146 -0
- package/src/lib/generators/__tests__/module-package-sources.test.ts +19 -2
- package/src/lib/generators/__tests__/module-requirements.test.ts +56 -0
- package/src/lib/generators/entity-ids.ts +2 -0
- package/src/lib/generators/module-di.ts +2 -0
- package/src/lib/generators/module-entities.ts +2 -0
- package/src/lib/generators/module-package-sources.ts +7 -5
- package/src/lib/generators/module-registry.ts +33 -115
- package/src/lib/generators/openapi.ts +3 -0
- package/src/lib/generators/source-exports.ts +93 -0
- package/src/lib/init-summary.ts +54 -0
- package/src/lib/module-github.ts +109 -0
- package/src/lib/module-identity.ts +145 -0
- package/src/lib/module-inspection.ts +133 -0
- package/src/lib/module-install.ts +170 -22
- package/src/lib/module-package.ts +243 -16
- package/src/lib/modules-config.ts +80 -32
- package/src/lib/resolver.ts +35 -39
- package/src/mercato.ts +14 -24
- package/src/types/cross-spawn.d.ts +2 -2
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { sourceHasDefaultExport, sourceExportedHttpMethods } from "./source-exports.js";
|
|
1
2
|
import fs from "node:fs";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { pathToFileURL } from "node:url";
|
|
4
5
|
import { VariableDeclarationKind } from "ts-morph";
|
|
5
6
|
import ts from "typescript-js";
|
|
7
|
+
import { getEnabledModuleIdentities } from "../module-identity.js";
|
|
8
|
+
import { getModuleRequirementHint, resolveModuleRequirement } from "@open-mercato/shared/modules/module-locators";
|
|
6
9
|
import {
|
|
7
10
|
DEV_SUPERVISOR_MANIFEST_FILE,
|
|
8
11
|
DEV_SUPERVISOR_MANIFEST_VERSION
|
|
@@ -738,34 +741,11 @@ function inferScriptKind(filePath) {
|
|
|
738
741
|
return ts.ScriptKind.TS;
|
|
739
742
|
}
|
|
740
743
|
function hasDefaultExport(sourceFile) {
|
|
741
|
-
let source = "";
|
|
742
744
|
try {
|
|
743
|
-
|
|
745
|
+
return sourceHasDefaultExport(sourceFile, fs.readFileSync(sourceFile, "utf8"));
|
|
744
746
|
} catch {
|
|
745
747
|
return false;
|
|
746
748
|
}
|
|
747
|
-
const parsed = ts.createSourceFile(
|
|
748
|
-
sourceFile,
|
|
749
|
-
source,
|
|
750
|
-
ts.ScriptTarget.Latest,
|
|
751
|
-
true,
|
|
752
|
-
inferScriptKind(sourceFile)
|
|
753
|
-
);
|
|
754
|
-
for (const statement of parsed.statements) {
|
|
755
|
-
if (ts.isExportAssignment(statement) && !statement.isExportEquals) {
|
|
756
|
-
return true;
|
|
757
|
-
}
|
|
758
|
-
if (ts.isExportDeclaration(statement) && statement.exportClause && ts.isNamedExports(statement.exportClause) && statement.exportClause.elements.some(
|
|
759
|
-
(element) => element.name.text === "default" || element.propertyName?.text === "default"
|
|
760
|
-
)) {
|
|
761
|
-
return true;
|
|
762
|
-
}
|
|
763
|
-
const modifiers = ts.canHaveModifiers(statement) ? ts.getModifiers(statement) : void 0;
|
|
764
|
-
if (modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.DefaultKeyword)) {
|
|
765
|
-
return true;
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
return false;
|
|
769
749
|
}
|
|
770
750
|
function requiresRuntimePageMetadataFromSourceFile(sourceFile) {
|
|
771
751
|
const literal = extractNamedObjectLiteralSource(sourceFile, "metadata");
|
|
@@ -1172,53 +1152,11 @@ async function resolveModuleRequiresFromIndexFile(indexFileAbsolutePath) {
|
|
|
1172
1152
|
return resolveModuleRequiresFromMetadata(metadata);
|
|
1173
1153
|
}
|
|
1174
1154
|
function detectExportedHttpMethods(sourceFile) {
|
|
1175
|
-
let source = "";
|
|
1176
1155
|
try {
|
|
1177
|
-
|
|
1156
|
+
return sourceExportedHttpMethods(fs.readFileSync(sourceFile, "utf8"));
|
|
1178
1157
|
} catch {
|
|
1179
1158
|
return [];
|
|
1180
1159
|
}
|
|
1181
|
-
const knownMethods = ["GET", "POST", "PUT", "PATCH", "DELETE"];
|
|
1182
|
-
const exportedMethods = /* @__PURE__ */ new Set();
|
|
1183
|
-
const collectKnownMethods = (rawSpecifiers, opts) => {
|
|
1184
|
-
for (const specifier of rawSpecifiers) {
|
|
1185
|
-
const trimmed = specifier.trim();
|
|
1186
|
-
if (!trimmed) continue;
|
|
1187
|
-
let candidate = trimmed;
|
|
1188
|
-
if (opts?.useExportedAlias) {
|
|
1189
|
-
candidate = trimmed.split(/\s+as\s+/i).pop()?.trim() ?? trimmed;
|
|
1190
|
-
}
|
|
1191
|
-
if (opts?.useDestructuredProperty) {
|
|
1192
|
-
candidate = trimmed.split(":")[0]?.trim() ?? trimmed;
|
|
1193
|
-
}
|
|
1194
|
-
if (knownMethods.includes(candidate)) {
|
|
1195
|
-
exportedMethods.add(candidate);
|
|
1196
|
-
}
|
|
1197
|
-
}
|
|
1198
|
-
};
|
|
1199
|
-
for (const method of knownMethods) {
|
|
1200
|
-
const pattern = new RegExp(`export\\s+(?:async\\s+)?function\\s+${method}\\b|export\\s+(?:const|let|var)\\s+${method}\\b`);
|
|
1201
|
-
if (pattern.test(source)) {
|
|
1202
|
-
exportedMethods.add(method);
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
const reExportPattern = /export\s*{([^}]+)}/g;
|
|
1206
|
-
for (const match of source.matchAll(reExportPattern)) {
|
|
1207
|
-
const exportBlock = match[1] ?? "";
|
|
1208
|
-
collectKnownMethods(
|
|
1209
|
-
exportBlock.split(",").map((part) => part.trim()).filter((part) => part.length > 0),
|
|
1210
|
-
{ useExportedAlias: true }
|
|
1211
|
-
);
|
|
1212
|
-
}
|
|
1213
|
-
const destructuredExportPattern = /export\s+(?:const|let|var)\s*{([^}]+)}/g;
|
|
1214
|
-
for (const match of source.matchAll(destructuredExportPattern)) {
|
|
1215
|
-
const exportBlock = match[1] ?? "";
|
|
1216
|
-
collectKnownMethods(
|
|
1217
|
-
exportBlock.split(",").map((part) => part.trim()).filter((part) => part.length > 0),
|
|
1218
|
-
{ useDestructuredProperty: true }
|
|
1219
|
-
);
|
|
1220
|
-
}
|
|
1221
|
-
return knownMethods.filter((method) => exportedMethods.has(method));
|
|
1222
1160
|
}
|
|
1223
1161
|
function buildPageRouteProps(metaExpr, routePath) {
|
|
1224
1162
|
return `pattern: ${toLiteral(routePath || "/")}, requireAuth: (${metaExpr})?.requireAuth, requireRoles: (${metaExpr})?.requireRoles, requireFeatures: (${metaExpr})?.requireFeatures, requireCustomerAuth: (${metaExpr})?.requireCustomerAuth, requireCustomerFeatures: (${metaExpr})?.requireCustomerFeatures, nav: (${metaExpr})?.nav, title: (${metaExpr})?.pageTitle ?? (${metaExpr})?.title, titleKey: (${metaExpr})?.pageTitleKey ?? (${metaExpr})?.titleKey, group: (${metaExpr})?.pageGroup ?? (${metaExpr})?.group, groupKey: (${metaExpr})?.pageGroupKey ?? (${metaExpr})?.groupKey, icon: (${metaExpr})?.icon, order: (${metaExpr})?.pageOrder ?? (${metaExpr})?.order, priority: (${metaExpr})?.pagePriority ?? (${metaExpr})?.priority, navHidden: (${metaExpr})?.navHidden, visible: (${metaExpr})?.visible, enabled: (${metaExpr})?.enabled, breadcrumb: (${metaExpr})?.breadcrumb, pageContext: (${metaExpr})?.pageContext, placement: (${metaExpr})?.placement`;
|
|
@@ -1447,11 +1385,21 @@ function discoverTranslations(roots) {
|
|
|
1447
1385
|
async function createModuleRegistryDiscovery(resolver, quiet = false) {
|
|
1448
1386
|
resetConventionWarnings();
|
|
1449
1387
|
const enabled = resolver.loadEnabledModules();
|
|
1388
|
+
const rootsByEntry = /* @__PURE__ */ new Map();
|
|
1389
|
+
const getModulePaths = (entry) => {
|
|
1390
|
+
let roots = rootsByEntry.get(entry);
|
|
1391
|
+
if (!roots) {
|
|
1392
|
+
roots = resolver.getModulePaths(entry);
|
|
1393
|
+
rootsByEntry.set(entry, roots);
|
|
1394
|
+
}
|
|
1395
|
+
return roots;
|
|
1396
|
+
};
|
|
1397
|
+
const identities = getEnabledModuleIdentities({ ...resolver, getModulePaths }, enabled);
|
|
1450
1398
|
const modules = [];
|
|
1451
1399
|
const trackedRoots = /* @__PURE__ */ new Set();
|
|
1452
1400
|
for (const entry of enabled) {
|
|
1453
1401
|
const modId = entry.id;
|
|
1454
|
-
const roots =
|
|
1402
|
+
const roots = getModulePaths(entry);
|
|
1455
1403
|
verifyThirdPartyModuleShape(entry, roots.pkgBase);
|
|
1456
1404
|
const rawImps = resolver.getModuleImportBase(entry);
|
|
1457
1405
|
const appImportBase = entry.from === "@app" ? `../../src/modules/${modId}` : rawImps.appBase;
|
|
@@ -1492,6 +1440,7 @@ async function createModuleRegistryDiscovery(resolver, quiet = false) {
|
|
|
1492
1440
|
return {
|
|
1493
1441
|
enabled,
|
|
1494
1442
|
modules,
|
|
1443
|
+
identities,
|
|
1495
1444
|
getStructureChecksum: () => structureChecksum ??= calculateStructureChecksum(Array.from(trackedRoots))
|
|
1496
1445
|
};
|
|
1497
1446
|
}
|
|
@@ -3280,10 +3229,12 @@ async function generateModuleRegistryFromDiscovery(options) {
|
|
|
3280
3229
|
])
|
|
3281
3230
|
});
|
|
3282
3231
|
{
|
|
3283
|
-
const
|
|
3232
|
+
const identities = discovery.identities;
|
|
3284
3233
|
const problems = [];
|
|
3234
|
+
const missingRequirements = /* @__PURE__ */ new Set();
|
|
3285
3235
|
for (const [modId, reqs] of requiresByModule.entries()) {
|
|
3286
|
-
const missing = reqs.filter((
|
|
3236
|
+
const missing = reqs.filter((requirement) => !resolveModuleRequirement(requirement, identities));
|
|
3237
|
+
for (const requirement of missing) missingRequirements.add(requirement);
|
|
3287
3238
|
if (missing.length) {
|
|
3288
3239
|
problems.push(`- Module "${modId}" requires: ${missing.join(", ")}`);
|
|
3289
3240
|
}
|
|
@@ -3291,10 +3242,7 @@ async function generateModuleRegistryFromDiscovery(options) {
|
|
|
3291
3242
|
if (problems.length) {
|
|
3292
3243
|
console.error("\nModule dependency check failed:");
|
|
3293
3244
|
for (const p of problems) console.error(p);
|
|
3294
|
-
|
|
3295
|
-
console.error(
|
|
3296
|
-
" export const enabledModules = [ { id: '" + Array.from(new Set(requiresByModule.values()).values()).join("' }, { id: '") + "' } ]"
|
|
3297
|
-
);
|
|
3245
|
+
for (const requirement of missingRequirements) console.error(`Fix: ${getModuleRequirementHint(requirement)}`);
|
|
3298
3246
|
process.exit(1);
|
|
3299
3247
|
}
|
|
3300
3248
|
}
|
|
@@ -3720,10 +3668,12 @@ async function generateModuleRegistryAppFromDiscovery(options) {
|
|
|
3720
3668
|
initializer: identifier("modules")
|
|
3721
3669
|
});
|
|
3722
3670
|
{
|
|
3723
|
-
const
|
|
3671
|
+
const identities = discovery.identities;
|
|
3724
3672
|
const problems = [];
|
|
3673
|
+
const missingRequirements = /* @__PURE__ */ new Set();
|
|
3725
3674
|
for (const [modId, reqs] of requiresByModule.entries()) {
|
|
3726
|
-
const missing = reqs.filter((
|
|
3675
|
+
const missing = reqs.filter((requirement) => !resolveModuleRequirement(requirement, identities));
|
|
3676
|
+
for (const requirement of missing) missingRequirements.add(requirement);
|
|
3727
3677
|
if (missing.length) {
|
|
3728
3678
|
problems.push(`- Module "${modId}" requires: ${missing.join(", ")}`);
|
|
3729
3679
|
}
|
|
@@ -3731,10 +3681,7 @@ async function generateModuleRegistryAppFromDiscovery(options) {
|
|
|
3731
3681
|
if (problems.length) {
|
|
3732
3682
|
console.error("\nModule dependency check failed:");
|
|
3733
3683
|
for (const p of problems) console.error(p);
|
|
3734
|
-
|
|
3735
|
-
console.error(
|
|
3736
|
-
" export const enabledModules = [ { id: '" + Array.from(new Set(requiresByModule.values()).values()).join("' }, { id: '") + "' } ]"
|
|
3737
|
-
);
|
|
3684
|
+
for (const requirement of missingRequirements) console.error(`Fix: ${getModuleRequirementHint(requirement)}`);
|
|
3738
3685
|
process.exit(1);
|
|
3739
3686
|
}
|
|
3740
3687
|
}
|
|
@@ -4052,10 +3999,12 @@ async function generateModuleRegistryCliFromDiscovery(options) {
|
|
|
4052
3999
|
])
|
|
4053
4000
|
});
|
|
4054
4001
|
{
|
|
4055
|
-
const
|
|
4002
|
+
const identities = discovery.identities;
|
|
4056
4003
|
const problems = [];
|
|
4004
|
+
const missingRequirements = /* @__PURE__ */ new Set();
|
|
4057
4005
|
for (const [modId, reqs] of requiresByModule.entries()) {
|
|
4058
|
-
const missing = reqs.filter((
|
|
4006
|
+
const missing = reqs.filter((requirement) => !resolveModuleRequirement(requirement, identities));
|
|
4007
|
+
for (const requirement of missing) missingRequirements.add(requirement);
|
|
4059
4008
|
if (missing.length) {
|
|
4060
4009
|
problems.push(`- Module "${modId}" requires: ${missing.join(", ")}`);
|
|
4061
4010
|
}
|
|
@@ -4063,10 +4012,7 @@ async function generateModuleRegistryCliFromDiscovery(options) {
|
|
|
4063
4012
|
if (problems.length) {
|
|
4064
4013
|
console.error("\nModule dependency check failed:");
|
|
4065
4014
|
for (const p of problems) console.error(p);
|
|
4066
|
-
|
|
4067
|
-
console.error(
|
|
4068
|
-
" export const enabledModules = [ { id: '" + Array.from(new Set(requiresByModule.values()).values()).join("' }, { id: '") + "' } ]"
|
|
4069
|
-
);
|
|
4015
|
+
for (const requirement of missingRequirements) console.error(`Fix: ${getModuleRequirementHint(requirement)}`);
|
|
4070
4016
|
process.exit(1);
|
|
4071
4017
|
}
|
|
4072
4018
|
}
|