@open-mercato/cli 0.10.1-develop.8098.1.f4decc8a57 → 0.10.1-develop.8111.1.6c779bc21b
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 +169 -169
- package/dist/agentic/guides/module-facts.v2.json +169 -169
- 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/exact-override-targets.md +5 -5
- package/dist/agentic/guides/modules/warranty_claims/index.md +1 -1
- package/dist/agentic/guides/modules/warranty_claims/setup.md +1 -1
- package/dist/agentic/guides/modules/warranty_claims/workers.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/lib/generators/module-registry.js +133 -72
- package/dist/lib/generators/module-registry.js.map +2 -2
- package/package.json +7 -7
- package/src/lib/generators/__tests__/module-registry-requires-enforcement.test.ts +3 -3
- package/src/lib/generators/__tests__/module-requires.test.ts +242 -0
- package/src/lib/generators/module-registry.ts +192 -77
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# staff — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.10.1-develop.8111.1.6c779bc21b; core 0.10.1-develop.8111.1.6c779bc21b — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/staff
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# storage_s3 — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/storage-s3 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/storage-s3 0.10.1-develop.8111.1.6c779bc21b; core 0.10.1-develop.8111.1.6c779bc21b — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/storage-s3/src/modules/storage_s3
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sync_akeneo — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/sync-akeneo 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/sync-akeneo 0.10.1-develop.8111.1.6c779bc21b; core 0.10.1-develop.8111.1.6c779bc21b — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/sync-akeneo/src/modules/sync_akeneo
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sync_excel — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.10.1-develop.8111.1.6c779bc21b; core 0.10.1-develop.8111.1.6c779bc21b — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/sync_excel
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# system_status_overlays — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/enterprise 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/enterprise 0.10.1-develop.8111.1.6c779bc21b; core 0.10.1-develop.8111.1.6c779bc21b — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/enterprise/src/modules/system_status_overlays
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# telemetry — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/telemetry 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/telemetry 0.10.1-develop.8111.1.6c779bc21b; core 0.10.1-develop.8111.1.6c779bc21b — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/telemetry/src/modules/telemetry
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# tillio — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/tillio 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/tillio 0.10.1-develop.8111.1.6c779bc21b; core 0.10.1-develop.8111.1.6c779bc21b — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/tillio/src/modules/tillio
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# translations — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.10.1-develop.8111.1.6c779bc21b; core 0.10.1-develop.8111.1.6c779bc21b — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/translations
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -73,14 +73,14 @@
|
|
|
73
73
|
| routes | `overrides.routes.pages["frontend:/[orgSlug]/portal/claims"]` | disable-replace | frontendPages:/[orgSlug]/portal/claims | [frontend/[orgSlug]/portal/claims/page.tsx](../../../../node_modules/@open-mercato/core/src/modules/warranty_claims/frontend/[orgSlug]/portal/claims/page.tsx) |
|
|
74
74
|
| routes | `overrides.routes.pages["frontend:/[orgSlug]/portal/claims/[id]"]` | disable-replace | frontendPages:/[orgSlug]/portal/claims/[id] | [frontend/[orgSlug]/portal/claims/[id]/page.tsx](../../../../node_modules/@open-mercato/core/src/modules/warranty_claims/frontend/[orgSlug]/portal/claims/[id]/page.tsx) |
|
|
75
75
|
| routes | `overrides.routes.pages["frontend:/[orgSlug]/portal/claims/new"]` | disable-replace | frontendPages:/[orgSlug]/portal/claims/new | [frontend/[orgSlug]/portal/claims/new/page.tsx](../../../../node_modules/@open-mercato/core/src/modules/warranty_claims/frontend/[orgSlug]/portal/claims/new/page.tsx) |
|
|
76
|
-
| setup | `overrides.setup.defaultRoleFeatures` | replace | ownedContracts.setup:warranty_claims:setup | [setup.ts:
|
|
77
|
-
| setup | `overrides.setup.onOrganizationCreated` | replace | ownedContracts.setup:warranty_claims:setup | [setup.ts:
|
|
78
|
-
| setup | `overrides.setup.onTenantCreated` | replace | ownedContracts.setup:warranty_claims:setup | [setup.ts:
|
|
79
|
-
| setup | `overrides.setup.seedDefaults` | replace | ownedContracts.setup:warranty_claims:setup | [setup.ts:
|
|
76
|
+
| setup | `overrides.setup.defaultRoleFeatures` | replace | ownedContracts.setup:warranty_claims:setup | [setup.ts:116](../../../../node_modules/@open-mercato/core/src/modules/warranty_claims/setup.ts#L116) |
|
|
77
|
+
| setup | `overrides.setup.onOrganizationCreated` | replace | ownedContracts.setup:warranty_claims:setup | [setup.ts:116](../../../../node_modules/@open-mercato/core/src/modules/warranty_claims/setup.ts#L116) |
|
|
78
|
+
| setup | `overrides.setup.onTenantCreated` | replace | ownedContracts.setup:warranty_claims:setup | [setup.ts:116](../../../../node_modules/@open-mercato/core/src/modules/warranty_claims/setup.ts#L116) |
|
|
79
|
+
| setup | `overrides.setup.seedDefaults` | replace | ownedContracts.setup:warranty_claims:setup | [setup.ts:116](../../../../node_modules/@open-mercato/core/src/modules/warranty_claims/setup.ts#L116) |
|
|
80
80
|
| widgets | `overrides.widgets.dashboard["warranty_claims.dashboard.claimsQueue"]` | disable-replace | extensionSurfaces.contributions:dashboard:warranty_claims.dashboard.claimsQueue | [widgets/dashboard/claims-queue/widget.ts](../../../../node_modules/@open-mercato/core/src/modules/warranty_claims/widgets/dashboard/claims-queue/widget.ts) |
|
|
81
81
|
| widgets | `overrides.widgets.injection["warranty_claims.injection.claims-ai-trigger"]` | disable-replace | extensionSurfaces.contributions:warranty_claims.injection.claims-ai-trigger@data-table:warranty_claims.claims.list:search-trailing | [widgets/injection-table.ts](../../../../node_modules/@open-mercato/core/src/modules/warranty_claims/widgets/injection-table.ts) |
|
|
82
82
|
| widgets | `overrides.widgets.injection["warranty_claims.injection.customer-claims-tab"]` | disable-replace | extensionSurfaces.contributions:warranty_claims.injection.customer-claims-tab@detail:customers.company:tabs | [widgets/injection-table.ts](../../../../node_modules/@open-mercato/core/src/modules/warranty_claims/widgets/injection-table.ts) |
|
|
83
83
|
| widgets | `overrides.widgets.injection["warranty_claims.injection.order-claims-tab"]` | disable-replace | extensionSurfaces.contributions:warranty_claims.injection.order-claims-tab@sales.document.detail.order:tabs | [widgets/injection-table.ts](../../../../node_modules/@open-mercato/core/src/modules/warranty_claims/widgets/injection-table.ts) |
|
|
84
|
-
| workers | `overrides.workers["warranty_claims:sla-escalation-sweep"]` | disable-replace | ownedContracts.worker:warranty_claims:sla-escalation-sweep | [workers/sla-escalation-sweep.ts:
|
|
84
|
+
| workers | `overrides.workers["warranty_claims:sla-escalation-sweep"]` | disable-replace | ownedContracts.worker:warranty_claims:sla-escalation-sweep | [workers/sla-escalation-sweep.ts:93](../../../../node_modules/@open-mercato/core/src/modules/warranty_claims/workers/sla-escalation-sweep.ts#L93) |
|
|
85
85
|
|
|
86
86
|
<!-- end module facts section: warranty_claims/exact-override-targets -->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# warranty_claims — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.10.1-develop.8111.1.6c779bc21b; core 0.10.1-develop.8111.1.6c779bc21b — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/warranty_claims
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
| ID | Metadata | Source |
|
|
8
8
|
|---|---|---|
|
|
9
|
-
| warranty_claims:setup | hooks=onOrganizationCreated, onTenantCreated, seedDefaults; roles=admin, employee, owner | [setup.ts:
|
|
9
|
+
| warranty_claims:setup | hooks=onOrganizationCreated, onTenantCreated, seedDefaults; roles=admin, employee, owner | [setup.ts:116](../../../../node_modules/@open-mercato/core/src/modules/warranty_claims/setup.ts#L116) |
|
|
10
10
|
|
|
11
11
|
<!-- end module facts section: warranty_claims/setup -->
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
| ID | Metadata | Source |
|
|
8
8
|
|---|---|---|
|
|
9
|
-
| warranty_claims:sla-escalation-sweep | concurrency=1; queue=warranty_claims.sla_sweep | [workers/sla-escalation-sweep.ts:
|
|
9
|
+
| warranty_claims:sla-escalation-sweep | concurrency=1; queue=warranty_claims.sla_sweep | [workers/sla-escalation-sweep.ts:93](../../../../node_modules/@open-mercato/core/src/modules/warranty_claims/workers/sla-escalation-sweep.ts#L93) |
|
|
10
10
|
|
|
11
11
|
<!-- end module facts section: warranty_claims/workers -->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# webhooks — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/webhooks 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/webhooks 0.10.1-develop.8111.1.6c779bc21b; core 0.10.1-develop.8111.1.6c779bc21b — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/webhooks/src/modules/webhooks
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# wms — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.10.1-develop.8111.1.6c779bc21b; core 0.10.1-develop.8111.1.6c779bc21b — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/wms
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# workflows — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.10.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.10.1-develop.8111.1.6c779bc21b; core 0.10.1-develop.8111.1.6c779bc21b — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/workflows
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1185,7 +1185,7 @@
|
|
|
1185
1185
|
"facts": {
|
|
1186
1186
|
"title": "Example Module",
|
|
1187
1187
|
"description": "Demonstrates pages, APIs, entities and DI.",
|
|
1188
|
-
"coreVersion": "0.10.1-develop.
|
|
1188
|
+
"coreVersion": "0.10.1-develop.8111.1.6c779bc21b",
|
|
1189
1189
|
"sourcePackage": null,
|
|
1190
1190
|
"sourceVersion": null,
|
|
1191
1191
|
"sourceRoot": "src/modules/example",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"generator": "@open-mercato/cli@0.10.1-develop.
|
|
3
|
+
"generator": "@open-mercato/cli@0.10.1-develop.8111.1.6c779bc21b",
|
|
4
4
|
"files": {
|
|
5
5
|
"AGENTS.md": "35c948a32e06ca64b4706970c55ec60946412b410938b22478233a2c5c43df56",
|
|
6
6
|
"BACKWARD_COMPATIBILITY.md": "4e85dfc08b0e9542c78415e25a020e06e4ec3c3bb664b278b5aa3faa3523d873"
|
|
@@ -259,6 +259,102 @@ function extractNamedObjectLiteralSource(sourceFile, exportName) {
|
|
|
259
259
|
}
|
|
260
260
|
return null;
|
|
261
261
|
}
|
|
262
|
+
function isCommonJsMetadataTarget(expression) {
|
|
263
|
+
if (!ts.isPropertyAccessExpression(expression) || expression.name.text !== "metadata") return false;
|
|
264
|
+
const target = expression.expression;
|
|
265
|
+
if (ts.isIdentifier(target)) return target.text === "exports";
|
|
266
|
+
return ts.isPropertyAccessExpression(target) && target.name.text === "exports" && ts.isIdentifier(target.expression) && target.expression.text === "module";
|
|
267
|
+
}
|
|
268
|
+
function findExportedMetadataSource(parsed) {
|
|
269
|
+
const localNamesExportedAsMetadata = /* @__PURE__ */ new Set();
|
|
270
|
+
for (const statement of parsed.statements) {
|
|
271
|
+
if (ts.isExportDeclaration(statement) && !statement.isTypeOnly && statement.exportClause && ts.isNamedExports(statement.exportClause)) {
|
|
272
|
+
for (const element of statement.exportClause.elements) {
|
|
273
|
+
if (element.name.text !== "metadata" || element.isTypeOnly) continue;
|
|
274
|
+
if (statement.moduleSpecifier) return { kind: "re-export" };
|
|
275
|
+
localNamesExportedAsMetadata.add(element.propertyName?.text ?? element.name.text);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
let commonJsInitializer;
|
|
280
|
+
for (const statement of parsed.statements) {
|
|
281
|
+
if (ts.isVariableStatement(statement)) {
|
|
282
|
+
const exportsDirectly = (ts.canHaveModifiers(statement) ? ts.getModifiers(statement) : void 0)?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword) ?? false;
|
|
283
|
+
for (const declaration of statement.declarationList.declarations) {
|
|
284
|
+
if (!ts.isIdentifier(declaration.name)) continue;
|
|
285
|
+
const localName = declaration.name.text;
|
|
286
|
+
const exported = exportsDirectly && localName === "metadata" || localNamesExportedAsMetadata.has(localName);
|
|
287
|
+
if (!exported) continue;
|
|
288
|
+
return declaration.initializer ? { kind: "initializer", expression: declaration.initializer } : { kind: "no-initializer" };
|
|
289
|
+
}
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
if (ts.isExpressionStatement(statement) && ts.isBinaryExpression(statement.expression) && statement.expression.operatorToken.kind === ts.SyntaxKind.EqualsToken && isCommonJsMetadataTarget(statement.expression.left) && !ts.isVoidExpression(statement.expression.right)) {
|
|
293
|
+
commonJsInitializer = statement.expression.right;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (commonJsInitializer) return { kind: "initializer", expression: commonJsInitializer };
|
|
297
|
+
if (localNamesExportedAsMetadata.size > 0) return { kind: "re-export" };
|
|
298
|
+
return void 0;
|
|
299
|
+
}
|
|
300
|
+
function extractModuleRequiresFromSource(sourceFile) {
|
|
301
|
+
let source = "";
|
|
302
|
+
try {
|
|
303
|
+
source = fs.readFileSync(sourceFile, "utf8");
|
|
304
|
+
} catch {
|
|
305
|
+
return { status: "absent" };
|
|
306
|
+
}
|
|
307
|
+
const parsed = ts.createSourceFile(
|
|
308
|
+
sourceFile,
|
|
309
|
+
source,
|
|
310
|
+
ts.ScriptTarget.Latest,
|
|
311
|
+
true,
|
|
312
|
+
inferScriptKind(sourceFile)
|
|
313
|
+
);
|
|
314
|
+
const metadataSource = findExportedMetadataSource(parsed);
|
|
315
|
+
if (!metadataSource) return { status: "absent" };
|
|
316
|
+
if (metadataSource.kind === "re-export") {
|
|
317
|
+
return { status: "unresolvable", reason: "exported metadata is re-exported from another file" };
|
|
318
|
+
}
|
|
319
|
+
if (metadataSource.kind === "no-initializer") {
|
|
320
|
+
return { status: "unresolvable", reason: "exported metadata has no initializer" };
|
|
321
|
+
}
|
|
322
|
+
const metadata = unwrapExpression(metadataSource.expression);
|
|
323
|
+
if (!ts.isObjectLiteralExpression(metadata)) {
|
|
324
|
+
return { status: "unresolvable", reason: "exported metadata is not an object literal" };
|
|
325
|
+
}
|
|
326
|
+
let requiresInitializer;
|
|
327
|
+
for (const property of metadata.properties) {
|
|
328
|
+
if (ts.isSpreadAssignment(property)) {
|
|
329
|
+
return { status: "unresolvable", reason: "exported metadata uses a spread" };
|
|
330
|
+
}
|
|
331
|
+
const name = property.name;
|
|
332
|
+
if (!name) continue;
|
|
333
|
+
if (ts.isComputedPropertyName(name)) {
|
|
334
|
+
return { status: "unresolvable", reason: "exported metadata uses a computed key" };
|
|
335
|
+
}
|
|
336
|
+
const key = ts.isIdentifier(name) || ts.isStringLiteral(name) ? name.text : null;
|
|
337
|
+
if (key !== "requires") continue;
|
|
338
|
+
if (!ts.isPropertyAssignment(property)) {
|
|
339
|
+
return { status: "unresolvable", reason: "metadata.requires is not a property assignment" };
|
|
340
|
+
}
|
|
341
|
+
requiresInitializer = property.initializer;
|
|
342
|
+
}
|
|
343
|
+
if (!requiresInitializer) return { status: "absent" };
|
|
344
|
+
const requiresArray = unwrapExpression(requiresInitializer);
|
|
345
|
+
if (!ts.isArrayLiteralExpression(requiresArray)) {
|
|
346
|
+
return { status: "unresolvable", reason: "metadata.requires is not an array literal" };
|
|
347
|
+
}
|
|
348
|
+
const requires = [];
|
|
349
|
+
for (const element of requiresArray.elements) {
|
|
350
|
+
const value = unwrapExpression(element);
|
|
351
|
+
if (!ts.isStringLiteral(value) && !ts.isNoSubstitutionTemplateLiteral(value)) {
|
|
352
|
+
return { status: "unresolvable", reason: "metadata.requires contains a non-literal entry" };
|
|
353
|
+
}
|
|
354
|
+
requires.push(value.text);
|
|
355
|
+
}
|
|
356
|
+
return { status: "declared", requires };
|
|
357
|
+
}
|
|
262
358
|
function resolveLocalStringConstants(parsed) {
|
|
263
359
|
const constants = /* @__PURE__ */ new Map();
|
|
264
360
|
for (const statement of parsed.statements) {
|
|
@@ -1066,6 +1162,35 @@ function alreadyWarned(sourcePath) {
|
|
|
1066
1162
|
warnedConventionPaths.add(sourcePath);
|
|
1067
1163
|
return false;
|
|
1068
1164
|
}
|
|
1165
|
+
function findMissingModuleRequires(modules, requiresByModule) {
|
|
1166
|
+
const problems = [];
|
|
1167
|
+
for (const [moduleId, requires] of requiresByModule.entries()) {
|
|
1168
|
+
const missing = requires.filter((requirement) => !resolveModuleRequirement(requirement, modules));
|
|
1169
|
+
if (missing.length) problems.push({ moduleId, missing });
|
|
1170
|
+
}
|
|
1171
|
+
return problems;
|
|
1172
|
+
}
|
|
1173
|
+
function exitOnMissingModuleRequires(modules, requiresByModule) {
|
|
1174
|
+
const problems = findMissingModuleRequires(modules, requiresByModule);
|
|
1175
|
+
if (!problems.length) return;
|
|
1176
|
+
console.error("\nModule dependency check failed:");
|
|
1177
|
+
for (const problem of problems) console.error(`- Module "${problem.moduleId}" requires: ${problem.missing.join(", ")}`);
|
|
1178
|
+
const missingRequirements = new Set(problems.flatMap((problem) => problem.missing));
|
|
1179
|
+
for (const requirement of missingRequirements) console.error(`Fix: ${getModuleRequirementHint(requirement)}`);
|
|
1180
|
+
process.exit(1);
|
|
1181
|
+
}
|
|
1182
|
+
function collectDeclaredModuleRequires(moduleId, indexPath, requiresByModule, quiet) {
|
|
1183
|
+
const extraction = extractModuleRequiresFromSource(indexPath);
|
|
1184
|
+
if (extraction.status === "declared") {
|
|
1185
|
+
if (extraction.requires.length) requiresByModule.set(moduleId, extraction.requires);
|
|
1186
|
+
return;
|
|
1187
|
+
}
|
|
1188
|
+
if (extraction.status === "unresolvable" && !quiet && !alreadyWarned(`requires:${indexPath}`)) {
|
|
1189
|
+
console.warn(
|
|
1190
|
+
`[generate] \u26A0 Module "${moduleId}" declares metadata.requires that cannot be read statically (${extraction.reason}); its dependency check is skipped. Use an array of string literals: ${indexPath}`
|
|
1191
|
+
);
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1069
1194
|
function warnIfPageMetaMissingMetadataExport(metaPath, quiet = false) {
|
|
1070
1195
|
if (!metaPath || quiet) return;
|
|
1071
1196
|
if (hasNamedExport(metaPath, "metadata")) return;
|
|
@@ -1139,18 +1264,6 @@ function resolveApiPathFromMetadata(metadata, fallbackPath) {
|
|
|
1139
1264
|
const candidate = metadata.path;
|
|
1140
1265
|
return typeof candidate === "string" && candidate.length > 0 ? candidate : fallbackPath;
|
|
1141
1266
|
}
|
|
1142
|
-
function resolveModuleRequiresFromMetadata(metadata) {
|
|
1143
|
-
if (!metadata || typeof metadata !== "object") return void 0;
|
|
1144
|
-
const requires = metadata.requires;
|
|
1145
|
-
if (!Array.isArray(requires)) return void 0;
|
|
1146
|
-
const resolved = requires.filter((value) => typeof value === "string");
|
|
1147
|
-
return resolved.length > 0 ? resolved : void 0;
|
|
1148
|
-
}
|
|
1149
|
-
async function resolveModuleRequiresFromIndexFile(indexFileAbsolutePath) {
|
|
1150
|
-
const loadedModule = await loadModuleExportsFromSource(indexFileAbsolutePath);
|
|
1151
|
-
const metadata = loadedModule?.metadata ?? extractNamedObjectLiteralExport(indexFileAbsolutePath, "metadata");
|
|
1152
|
-
return resolveModuleRequiresFromMetadata(metadata);
|
|
1153
|
-
}
|
|
1154
1267
|
function detectExportedHttpMethods(sourceFile) {
|
|
1155
1268
|
try {
|
|
1156
1269
|
return sourceExportedHttpMethods(fs.readFileSync(sourceFile, "utf8"));
|
|
@@ -2751,8 +2864,7 @@ async function generateModuleRegistryFromDiscovery(options) {
|
|
|
2751
2864
|
const importPath = sanitizeGeneratedModuleSpecifier(indexResolved.importPath);
|
|
2752
2865
|
imports.push(buildImportStatement(`* as ${infoImportName}`, importPath));
|
|
2753
2866
|
runtimeImports.push(buildImportStatement(`* as ${infoImportName}`, importPath));
|
|
2754
|
-
|
|
2755
|
-
if (reqs && reqs.length) requiresByModule.set(modId, reqs);
|
|
2867
|
+
collectDeclaredModuleRequires(modId, indexResolved.absolutePath, requiresByModule, quiet);
|
|
2756
2868
|
}
|
|
2757
2869
|
{
|
|
2758
2870
|
const feApp = path.join(roots.appBase, "frontend");
|
|
@@ -3228,24 +3340,7 @@ async function generateModuleRegistryFromDiscovery(options) {
|
|
|
3228
3340
|
})
|
|
3229
3341
|
])
|
|
3230
3342
|
});
|
|
3231
|
-
|
|
3232
|
-
const identities = discovery.identities;
|
|
3233
|
-
const problems = [];
|
|
3234
|
-
const missingRequirements = /* @__PURE__ */ new Set();
|
|
3235
|
-
for (const [modId, reqs] of requiresByModule.entries()) {
|
|
3236
|
-
const missing = reqs.filter((requirement) => !resolveModuleRequirement(requirement, identities));
|
|
3237
|
-
for (const requirement of missing) missingRequirements.add(requirement);
|
|
3238
|
-
if (missing.length) {
|
|
3239
|
-
problems.push(`- Module "${modId}" requires: ${missing.join(", ")}`);
|
|
3240
|
-
}
|
|
3241
|
-
}
|
|
3242
|
-
if (problems.length) {
|
|
3243
|
-
console.error("\nModule dependency check failed:");
|
|
3244
|
-
for (const p of problems) console.error(p);
|
|
3245
|
-
for (const requirement of missingRequirements) console.error(`Fix: ${getModuleRequirementHint(requirement)}`);
|
|
3246
|
-
process.exit(1);
|
|
3247
|
-
}
|
|
3248
|
-
}
|
|
3343
|
+
exitOnMissingModuleRequires(discovery.identities, requiresByModule);
|
|
3249
3344
|
const structureChecksum = discovery.getStructureChecksum();
|
|
3250
3345
|
writeGeneratedFile({ outFile, checksumFile, content: output, structureChecksum, result, quiet });
|
|
3251
3346
|
writeGeneratedFile({ outFile: runtimeOutFile, checksumFile: runtimeChecksumFile, content: runtimeOutput, structureChecksum, result, quiet });
|
|
@@ -3392,8 +3487,7 @@ async function generateModuleRegistryAppFromDiscovery(options) {
|
|
|
3392
3487
|
const importPath = sanitizeGeneratedModuleSpecifier(indexResolved.importPath);
|
|
3393
3488
|
imports.push(buildImportStatement(`* as ${infoImportName}`, importPath));
|
|
3394
3489
|
bootstrapImports.push(buildImportStatement(`* as ${infoImportName}`, importPath));
|
|
3395
|
-
|
|
3396
|
-
if (reqs && reqs.length) requiresByModule.set(modId, reqs);
|
|
3490
|
+
collectDeclaredModuleRequires(modId, indexResolved.absolutePath, requiresByModule, quiet);
|
|
3397
3491
|
}
|
|
3398
3492
|
{
|
|
3399
3493
|
const setup = resolveConventionFile(discovered.resolve("setup.ts"), "SETUP", modId, importIdRef, imports);
|
|
@@ -3667,24 +3761,7 @@ async function generateModuleRegistryAppFromDiscovery(options) {
|
|
|
3667
3761
|
sourceFileName: "modules.bootstrap.generated.ts",
|
|
3668
3762
|
initializer: identifier("modules")
|
|
3669
3763
|
});
|
|
3670
|
-
|
|
3671
|
-
const identities = discovery.identities;
|
|
3672
|
-
const problems = [];
|
|
3673
|
-
const missingRequirements = /* @__PURE__ */ new Set();
|
|
3674
|
-
for (const [modId, reqs] of requiresByModule.entries()) {
|
|
3675
|
-
const missing = reqs.filter((requirement) => !resolveModuleRequirement(requirement, identities));
|
|
3676
|
-
for (const requirement of missing) missingRequirements.add(requirement);
|
|
3677
|
-
if (missing.length) {
|
|
3678
|
-
problems.push(`- Module "${modId}" requires: ${missing.join(", ")}`);
|
|
3679
|
-
}
|
|
3680
|
-
}
|
|
3681
|
-
if (problems.length) {
|
|
3682
|
-
console.error("\nModule dependency check failed:");
|
|
3683
|
-
for (const p of problems) console.error(p);
|
|
3684
|
-
for (const requirement of missingRequirements) console.error(`Fix: ${getModuleRequirementHint(requirement)}`);
|
|
3685
|
-
process.exit(1);
|
|
3686
|
-
}
|
|
3687
|
-
}
|
|
3764
|
+
exitOnMissingModuleRequires(discovery.identities, requiresByModule);
|
|
3688
3765
|
const structureChecksum = discovery.getStructureChecksum();
|
|
3689
3766
|
writeGeneratedFile({ outFile, checksumFile, content: output, structureChecksum, result, quiet });
|
|
3690
3767
|
writeGeneratedFile({ outFile: bootstrapOutFile, checksumFile: bootstrapChecksumFile, content: bootstrapOutput, structureChecksum, result, quiet });
|
|
@@ -3777,8 +3854,7 @@ async function generateModuleRegistryCliFromDiscovery(options) {
|
|
|
3777
3854
|
infoImportName = `I${importIdRef.value++}_${toVar(modId)}`;
|
|
3778
3855
|
const importPath = sanitizeGeneratedModuleSpecifier(indexResolved.importPath);
|
|
3779
3856
|
imports.push(buildImportStatement(`* as ${infoImportName}`, importPath));
|
|
3780
|
-
|
|
3781
|
-
if (reqs && reqs.length) requiresByModule.set(modId, reqs);
|
|
3857
|
+
collectDeclaredModuleRequires(modId, indexResolved.absolutePath, requiresByModule, quiet);
|
|
3782
3858
|
}
|
|
3783
3859
|
{
|
|
3784
3860
|
const setup = resolveConventionFile(discovered.resolve("setup.ts"), "SETUP", modId, importIdRef, imports);
|
|
@@ -3998,24 +4074,7 @@ async function generateModuleRegistryCliFromDiscovery(options) {
|
|
|
3998
4074
|
})
|
|
3999
4075
|
])
|
|
4000
4076
|
});
|
|
4001
|
-
|
|
4002
|
-
const identities = discovery.identities;
|
|
4003
|
-
const problems = [];
|
|
4004
|
-
const missingRequirements = /* @__PURE__ */ new Set();
|
|
4005
|
-
for (const [modId, reqs] of requiresByModule.entries()) {
|
|
4006
|
-
const missing = reqs.filter((requirement) => !resolveModuleRequirement(requirement, identities));
|
|
4007
|
-
for (const requirement of missing) missingRequirements.add(requirement);
|
|
4008
|
-
if (missing.length) {
|
|
4009
|
-
problems.push(`- Module "${modId}" requires: ${missing.join(", ")}`);
|
|
4010
|
-
}
|
|
4011
|
-
}
|
|
4012
|
-
if (problems.length) {
|
|
4013
|
-
console.error("\nModule dependency check failed:");
|
|
4014
|
-
for (const p of problems) console.error(p);
|
|
4015
|
-
for (const requirement of missingRequirements) console.error(`Fix: ${getModuleRequirementHint(requirement)}`);
|
|
4016
|
-
process.exit(1);
|
|
4017
|
-
}
|
|
4018
|
-
}
|
|
4077
|
+
exitOnMissingModuleRequires(discovery.identities, requiresByModule);
|
|
4019
4078
|
const structureChecksum = discovery.getStructureChecksum();
|
|
4020
4079
|
writeGeneratedFile({ outFile, checksumFile, content: output, structureChecksum, result, quiet });
|
|
4021
4080
|
writeGeneratedFile({ outFile: legacyOutFile, checksumFile: legacyChecksumFile, content: legacyOutput, structureChecksum, result, quiet });
|
|
@@ -4060,7 +4119,9 @@ async function generateModuleRegistries(options) {
|
|
|
4060
4119
|
}
|
|
4061
4120
|
export {
|
|
4062
4121
|
extractCommandIdsFromSource,
|
|
4122
|
+
extractModuleRequiresFromSource,
|
|
4063
4123
|
extractNamedObjectLiteralExport,
|
|
4124
|
+
findMissingModuleRequires,
|
|
4064
4125
|
generateModuleRegistries,
|
|
4065
4126
|
generateModuleRegistry,
|
|
4066
4127
|
generateModuleRegistryApp,
|