@open-mercato/cli 0.11.1-develop.8784.1.e9d95a72f5 → 0.11.1-develop.8805.1.6357054d1a
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 +4 -2
- package/AGENTS.md +2 -0
- package/dist/agentic/guides/architecture.md +1 -0
- package/dist/agentic/guides/module-facts.json +2014 -1099
- package/dist/agentic/guides/module-facts.v2.json +2014 -1099
- 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/ai_assistant/owned-contract-module-metadata.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/assisted_selling/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/auth/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/availability/index.md +1 -1
- package/dist/agentic/guides/modules/backups/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/cart/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/catalog/di-registrations-rich.md +11 -8
- package/dist/agentic/guides/modules/catalog/di-service-tokens.md +5 -5
- package/dist/agentic/guides/modules/catalog/exact-override-targets.md +11 -8
- package/dist/agentic/guides/modules/catalog/index.md +2 -2
- package/dist/agentic/guides/modules/catalog/owned-contract-module-metadata.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_gmail/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
- package/dist/agentic/guides/modules/channel_imap/owned-contract-module-metadata.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/exact-override-targets.md +1 -1
- package/dist/agentic/guides/modules/communication_channels/index.md +1 -1
- package/dist/agentic/guides/modules/communication_channels/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/communication_channels/workers.md +1 -1
- package/dist/agentic/guides/modules/configs/acl-features.md +2 -1
- package/dist/agentic/guides/modules/configs/backend-pages.md +1 -0
- package/dist/agentic/guides/modules/configs/exact-override-targets.md +2 -0
- package/dist/agentic/guides/modules/configs/host-extension-points.md +10 -0
- package/dist/agentic/guides/modules/configs/index.md +5 -3
- package/dist/agentic/guides/modules/configs/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/configs/setup.md +1 -1
- package/dist/agentic/guides/modules/configs/umes-diagnostics.md +9 -0
- package/dist/agentic/guides/modules/configs/umes-hosts.md +9 -0
- 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/active-extension-bindings.md +2 -0
- package/dist/agentic/guides/modules/customers/contribution-resolutions.md +2 -0
- package/dist/agentic/guides/modules/customers/di-registrations-rich.md +8 -5
- package/dist/agentic/guides/modules/customers/exact-override-targets.md +10 -5
- package/dist/agentic/guides/modules/customers/index.md +5 -5
- package/dist/agentic/guides/modules/customers/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/customers/umes-contributions.md +2 -0
- package/dist/agentic/guides/modules/dashboards/active-extension-bindings.md +0 -10
- package/dist/agentic/guides/modules/dashboards/contribution-resolutions.md +0 -10
- package/dist/agentic/guides/modules/dashboards/exact-override-targets.md +0 -10
- package/dist/agentic/guides/modules/dashboards/index.md +5 -5
- package/dist/agentic/guides/modules/dashboards/umes-contributions.md +0 -10
- 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/entities/owned-contract-module-metadata.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/events/owned-contract-module-metadata.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/integrations/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/ledger/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/active-extension-bindings.md +8 -0
- package/dist/agentic/guides/modules/sales/contribution-resolutions.md +8 -0
- package/dist/agentic/guides/modules/sales/di-registrations-rich.md +31 -30
- package/dist/agentic/guides/modules/sales/di-service-tokens.md +5 -5
- package/dist/agentic/guides/modules/sales/exact-override-targets.md +39 -30
- package/dist/agentic/guides/modules/sales/index.md +5 -5
- package/dist/agentic/guides/modules/sales/owned-contract-module-metadata.md +1 -1
- package/dist/agentic/guides/modules/sales/umes-contributions.md +8 -0
- 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/search/owned-contract-module-metadata.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/active-extension-bindings.md +2 -1
- package/dist/agentic/guides/modules/staff/contribution-resolutions.md +1 -0
- package/dist/agentic/guides/modules/staff/exact-override-targets.md +1 -0
- package/dist/agentic/guides/modules/staff/index.md +8 -8
- package/dist/agentic/guides/modules/staff/umes-contributions.md +1 -0
- 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/upgrade_actions/contribution-resolutions.md +12 -0
- package/dist/agentic/guides/modules/upgrade_actions/exact-override-targets.md +11 -0
- package/dist/agentic/guides/modules/upgrade_actions/index.md +15 -0
- package/dist/agentic/guides/modules/upgrade_actions/owned-contract-module-metadata.md +11 -0
- package/dist/agentic/guides/modules/upgrade_actions/umes-contributions.md +12 -0
- 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/lib/generators/extensions/dashboard-widgets.js +46 -4
- package/dist/lib/generators/extensions/dashboard-widgets.js.map +2 -2
- package/dist/lib/generators/extensions/workflows.js +25 -2
- package/dist/lib/generators/extensions/workflows.js.map +2 -2
- package/dist/lib/generators/module-facts.js +2 -0
- package/dist/lib/generators/module-facts.js.map +2 -2
- package/dist/lib/generators/module-registry.js +7 -6
- package/dist/lib/generators/module-registry.js.map +2 -2
- package/dist/lib/module-coupling/analyze.js +391 -0
- package/dist/lib/module-coupling/analyze.js.map +7 -0
- package/dist/lib/module-diagnostics.js +160 -0
- package/dist/lib/module-diagnostics.js.map +7 -0
- package/dist/lib/module-index.js +103 -0
- package/dist/lib/module-index.js.map +7 -0
- package/dist/lib/testing/integration-discovery.js +20 -15
- package/dist/lib/testing/integration-discovery.js.map +3 -3
- package/dist/mercato.js +19 -2
- package/dist/mercato.js.map +2 -2
- package/package.json +7 -7
- package/src/__tests__/rotation-json-output.test.ts +13 -0
- package/src/lib/__tests__/module-diagnostics.test.ts +207 -0
- package/src/lib/generators/__tests__/module-facts.owned-contracts.test.ts +2 -2
- package/src/lib/generators/__tests__/output-snapshots.test.ts +19 -0
- package/src/lib/generators/__tests__/structural-contracts.test.ts +18 -0
- package/src/lib/generators/extensions/dashboard-widgets.ts +49 -3
- package/src/lib/generators/extensions/workflows.ts +26 -2
- package/src/lib/generators/module-facts.ts +2 -0
- package/src/lib/generators/module-registry.ts +11 -7
- package/src/lib/module-coupling/analyze.ts +464 -0
- package/src/lib/module-diagnostics.ts +182 -0
- package/src/lib/module-index.ts +133 -0
- package/src/lib/testing/__tests__/integration-discovery.test.ts +26 -2
- package/src/lib/testing/integration-discovery.ts +19 -11
- package/src/mercato.ts +21 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# upgrade_actions — Owned contract — module metadata
|
|
2
|
+
|
|
3
|
+
[Back to module index](index.md)
|
|
4
|
+
|
|
5
|
+
## Owned contract — module metadata
|
|
6
|
+
|
|
7
|
+
| ID | Metadata | Source |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| upgrade_actions | name=upgrade_actions; requires=configs, directory; version=0.1.0 | [index.ts:3](../../../../node_modules/@open-mercato/upgrade-actions/src/modules/upgrade_actions/index.ts#L3) |
|
|
10
|
+
|
|
11
|
+
<!-- end module facts section: upgrade_actions/owned-contract-module-metadata -->
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# upgrade_actions — UMES contributions
|
|
2
|
+
|
|
3
|
+
[Back to module index](index.md)
|
|
4
|
+
|
|
5
|
+
## UMES contributions
|
|
6
|
+
|
|
7
|
+
| ID | Kind | Target | Phase / operations | Contract | Resolution | Source |
|
|
8
|
+
|---|---|---|---|---|---|---|
|
|
9
|
+
| upgrade_actions.injection.banner@backend:layout:top | widget | backend:layout:top | — | executionGuard=host; payload=render; registryKey=upgrade_actions.injection.banner | optional-external | [widgets/injection-table.ts](../../../../node_modules/@open-mercato/upgrade-actions/src/modules/upgrade_actions/widgets/injection-table.ts) |
|
|
10
|
+
| upgrade_actions.injection.banner@backend:upgrade-actions:legacy-banner | widget | backend:upgrade-actions:legacy-banner | — | executionGuard=host; payload=render; registryKey=upgrade_actions.injection.banner | optional-external | [widgets/injection-table.ts](../../../../node_modules/@open-mercato/upgrade-actions/src/modules/upgrade_actions/widgets/injection-table.ts) |
|
|
11
|
+
|
|
12
|
+
<!-- end module facts section: upgrade_actions/umes-contributions -->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# warranty_claims — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.11.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.11.1-develop.8805.1.6357054d1a; core 0.11.1-develop.8805.1.6357054d1a — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/warranty_claims
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# webhooks — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/webhooks 0.11.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/webhooks 0.11.1-develop.8805.1.6357054d1a; core 0.11.1-develop.8805.1.6357054d1a — 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.11.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.11.1-develop.8805.1.6357054d1a; core 0.11.1-develop.8805.1.6357054d1a — 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.11.1-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.11.1-develop.8805.1.6357054d1a; core 0.11.1-develop.8805.1.6357054d1a — R1 staleness stamp -->
|
|
3
3
|
Source root: node_modules/@open-mercato/core/src/modules/workflows
|
|
4
4
|
|
|
5
5
|
## Sections
|
|
@@ -1191,7 +1191,7 @@
|
|
|
1191
1191
|
"facts": {
|
|
1192
1192
|
"title": "Example Module",
|
|
1193
1193
|
"description": "Demonstrates pages, APIs, entities and DI.",
|
|
1194
|
-
"coreVersion": "0.11.1-develop.
|
|
1194
|
+
"coreVersion": "0.11.1-develop.8805.1.6357054d1a",
|
|
1195
1195
|
"sourcePackage": null,
|
|
1196
1196
|
"sourceVersion": null,
|
|
1197
1197
|
"sourceRoot": "src/modules/example",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"generator": "@open-mercato/cli@0.11.1-develop.
|
|
3
|
+
"generator": "@open-mercato/cli@0.11.1-develop.8805.1.6357054d1a",
|
|
4
4
|
"files": {
|
|
5
5
|
"AGENTS.md": "f3a580d0f65b39721211f1edfccb6a22e3a494250d0aaa24804c3f75e4aa9d30",
|
|
6
6
|
"BACKWARD_COMPATIBILITY.md": "8ebefa11331da3d62d740b34b5f1c650b0f1e5b384fc64e5518c2a9bae0c35e7"
|
|
@@ -1,7 +1,48 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import ts from "typescript-js";
|
|
1
4
|
import { VariableDeclarationKind } from "ts-morph";
|
|
2
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
MODULE_CODE_EXTENSIONS,
|
|
7
|
+
resolveStandaloneSourceMirrorBase,
|
|
8
|
+
scanModuleDir,
|
|
9
|
+
SCAN_CONFIGS,
|
|
10
|
+
stripModuleCodeExtension
|
|
11
|
+
} from "../scanner.js";
|
|
3
12
|
import { arrayLiteral, arrowFunction, identifier, methodCall, nullishCoalesce, objectLiteral, propertyAccess, writeValue } from "../ast/index.js";
|
|
4
13
|
import { dynamicImportExpression, renderGeneratedTsSource } from "./shared.js";
|
|
14
|
+
function readRegisteredWidgetKey(absolutePath) {
|
|
15
|
+
if (!fs.existsSync(absolutePath)) return void 0;
|
|
16
|
+
const source = ts.createSourceFile(absolutePath, fs.readFileSync(absolutePath, "utf8"), ts.ScriptTarget.Latest, true);
|
|
17
|
+
const values = /* @__PURE__ */ new Map();
|
|
18
|
+
let exportName;
|
|
19
|
+
for (const statement of source.statements) {
|
|
20
|
+
if (ts.isVariableStatement(statement)) {
|
|
21
|
+
const exported = statement.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword);
|
|
22
|
+
for (const declaration of statement.declarationList.declarations) {
|
|
23
|
+
if (!ts.isIdentifier(declaration.name) || !declaration.initializer) continue;
|
|
24
|
+
if (!ts.isStringLiteralLike(declaration.initializer) || !declaration.initializer.text) continue;
|
|
25
|
+
values.set(declaration.name.text, declaration.initializer.text);
|
|
26
|
+
if (exported && declaration.name.text === "dashboardWidgetKey") exportName = declaration.name.text;
|
|
27
|
+
}
|
|
28
|
+
} else if (ts.isExportDeclaration(statement) && !statement.moduleSpecifier && statement.exportClause && ts.isNamedExports(statement.exportClause)) {
|
|
29
|
+
const key = statement.exportClause.elements.find((item) => item.name.text === "dashboardWidgetKey");
|
|
30
|
+
if (key) exportName = (key.propertyName ?? key.name).text;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return exportName ? values.get(exportName) : void 0;
|
|
34
|
+
}
|
|
35
|
+
function resolveDashboardWidgetKey(moduleId, roots, file) {
|
|
36
|
+
const relative = path.join("widgets", "dashboard", file.relPath);
|
|
37
|
+
const fallback = [moduleId, ...stripModuleCodeExtension(file.relPath).split("/")].join(":");
|
|
38
|
+
const packageBase = resolveStandaloneSourceMirrorBase(roots.pkgBase) ?? roots.pkgBase;
|
|
39
|
+
if (!file.fromApp) return readRegisteredWidgetKey(path.join(packageBase, relative)) ?? fallback;
|
|
40
|
+
const appKey = readRegisteredWidgetKey(path.join(roots.appBase, relative));
|
|
41
|
+
if (appKey) return appKey;
|
|
42
|
+
const packagePath = stripModuleCodeExtension(path.join(packageBase, relative));
|
|
43
|
+
const packageExtension = MODULE_CODE_EXTENSIONS.find((extension) => fs.existsSync(packagePath + extension));
|
|
44
|
+
return (packageExtension && readRegisteredWidgetKey(packagePath + packageExtension)) ?? fallback;
|
|
45
|
+
}
|
|
5
46
|
function createDashboardWidgetsExtension() {
|
|
6
47
|
const widgetEntries = /* @__PURE__ */ new Map();
|
|
7
48
|
return {
|
|
@@ -12,11 +53,11 @@ function createDashboardWidgetsExtension() {
|
|
|
12
53
|
for (const { relPath, fromApp } of files) {
|
|
13
54
|
const segments = relPath.split("/");
|
|
14
55
|
const file = segments.pop() ?? "";
|
|
15
|
-
const base = file
|
|
56
|
+
const base = stripModuleCodeExtension(file);
|
|
16
57
|
const importPath = ctx.sanitizeGeneratedModuleSpecifier(
|
|
17
58
|
`${fromApp ? ctx.imps.appBase : ctx.imps.pkgBase}/widgets/dashboard/${[...segments, base].join("/")}`
|
|
18
59
|
);
|
|
19
|
-
const key =
|
|
60
|
+
const key = resolveDashboardWidgetKey(ctx.moduleId, ctx.roots, { relPath, fromApp });
|
|
20
61
|
const entry = {
|
|
21
62
|
moduleId: ctx.moduleId,
|
|
22
63
|
key,
|
|
@@ -75,6 +116,7 @@ function createDashboardWidgetsExtension() {
|
|
|
75
116
|
};
|
|
76
117
|
}
|
|
77
118
|
export {
|
|
78
|
-
createDashboardWidgetsExtension
|
|
119
|
+
createDashboardWidgetsExtension,
|
|
120
|
+
resolveDashboardWidgetKey
|
|
79
121
|
};
|
|
80
122
|
//# sourceMappingURL=dashboard-widgets.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/lib/generators/extensions/dashboard-widgets.ts"],
|
|
4
|
-
"sourcesContent": ["import { VariableDeclarationKind } from 'ts-morph'\nimport type { GeneratorExtension } from '../extension'\nimport {
|
|
5
|
-
"mappings": "AAAA,SAAS,+BAA+B;AAExC,
|
|
4
|
+
"sourcesContent": ["import fs from 'node:fs'\nimport path from 'node:path'\nimport ts from 'typescript-js'\nimport { VariableDeclarationKind } from 'ts-morph'\nimport type { GeneratorExtension } from '../extension'\nimport {\n MODULE_CODE_EXTENSIONS,\n resolveStandaloneSourceMirrorBase,\n scanModuleDir,\n SCAN_CONFIGS,\n stripModuleCodeExtension,\n type ModuleRoots,\n type ScannedFile,\n} from '../scanner'\nimport { arrayLiteral, arrowFunction, identifier, methodCall, nullishCoalesce, objectLiteral, propertyAccess, writeValue } from '../ast'\nimport { dynamicImportExpression, renderGeneratedTsSource } from './shared'\n\ntype DashboardWidgetEntry = {\n moduleId: string\n key: string\n source: 'app' | 'package'\n importPath: string\n}\n\nfunction readRegisteredWidgetKey(absolutePath: string): string | undefined {\n if (!fs.existsSync(absolutePath)) return undefined\n const source = ts.createSourceFile(absolutePath, fs.readFileSync(absolutePath, 'utf8'), ts.ScriptTarget.Latest, true)\n const values = new Map<string, string>()\n let exportName: string | undefined\n for (const statement of source.statements) {\n if (ts.isVariableStatement(statement)) {\n const exported = statement.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword)\n for (const declaration of statement.declarationList.declarations) {\n if (!ts.isIdentifier(declaration.name) || !declaration.initializer) continue\n if (!ts.isStringLiteralLike(declaration.initializer) || !declaration.initializer.text) continue\n values.set(declaration.name.text, declaration.initializer.text)\n if (exported && declaration.name.text === 'dashboardWidgetKey') exportName = declaration.name.text\n }\n } else if (ts.isExportDeclaration(statement) && !statement.moduleSpecifier && statement.exportClause\n && ts.isNamedExports(statement.exportClause)) {\n const key = statement.exportClause.elements.find((item) => item.name.text === 'dashboardWidgetKey')\n if (key) exportName = (key.propertyName ?? key.name).text\n }\n }\n return exportName ? values.get(exportName) : undefined\n}\n\nexport function resolveDashboardWidgetKey(moduleId: string, roots: ModuleRoots, file: ScannedFile): string {\n const relative = path.join('widgets', 'dashboard', file.relPath)\n const fallback = [moduleId, ...stripModuleCodeExtension(file.relPath).split('/')].join(':')\n const packageBase = resolveStandaloneSourceMirrorBase(roots.pkgBase) ?? roots.pkgBase\n if (!file.fromApp) return readRegisteredWidgetKey(path.join(packageBase, relative)) ?? fallback\n const appKey = readRegisteredWidgetKey(path.join(roots.appBase, relative))\n if (appKey) return appKey\n const packagePath = stripModuleCodeExtension(path.join(packageBase, relative))\n const packageExtension = MODULE_CODE_EXTENSIONS.find((extension) => fs.existsSync(packagePath + extension))\n return (packageExtension && readRegisteredWidgetKey(packagePath + packageExtension)) ?? fallback\n}\n\nexport function createDashboardWidgetsExtension(): GeneratorExtension {\n const widgetEntries = new Map<string, DashboardWidgetEntry>()\n\n return {\n id: 'registry.dashboard-widgets',\n outputFiles: ['dashboard-widgets.generated.ts'],\n scanModule(ctx) {\n const files = scanModuleDir(ctx.roots, SCAN_CONFIGS.dashboardWidgets)\n for (const { relPath, fromApp } of files) {\n const segments = relPath.split('/')\n const file = segments.pop() ?? ''\n const base = stripModuleCodeExtension(file)\n const importPath = ctx.sanitizeGeneratedModuleSpecifier(\n `${fromApp ? ctx.imps.appBase : ctx.imps.pkgBase}/widgets/dashboard/${[...segments, base].join('/')}`\n )\n const key = resolveDashboardWidgetKey(ctx.moduleId, ctx.roots, { relPath, fromApp })\n const entry: DashboardWidgetEntry = {\n moduleId: ctx.moduleId,\n key,\n source: fromApp ? 'app' : 'package',\n importPath,\n }\n const existing = widgetEntries.get(key)\n if (!existing || (existing.source !== 'app' && entry.source === 'app')) {\n widgetEntries.set(key, entry)\n }\n }\n },\n generateOutput() {\n const entries = Array.from(widgetEntries.entries())\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([, entry]) =>\n objectLiteral([\n { name: 'moduleId', value: entry.moduleId },\n { name: 'key', value: entry.key },\n { name: 'source', value: entry.source },\n {\n name: 'loader',\n value: arrowFunction({\n body: methodCall(dynamicImportExpression(entry.importPath), 'then', [\n arrowFunction({\n parameters: ['mod'],\n body: nullishCoalesce([\n propertyAccess(identifier('mod'), 'default'),\n identifier('mod'),\n ]),\n }),\n ]),\n }),\n },\n ]),\n )\n\n const output = renderGeneratedTsSource({\n fileName: 'dashboard-widgets.generated.ts',\n imports: [\n { namedImports: [{ name: 'ModuleDashboardWidgetEntry', isTypeOnly: true }], moduleSpecifier: '@open-mercato/shared/modules/registry' },\n ],\n build(sourceFile) {\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n isExported: true,\n declarations: [\n {\n name: 'dashboardWidgetEntries',\n type: 'ModuleDashboardWidgetEntry[]',\n initializer: arrayLiteral(entries, writeValue),\n },\n ],\n })\n },\n })\n\n return new Map([['dashboard-widgets.generated.ts', output]])\n },\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,SAAS,+BAA+B;AAExC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,cAAc,eAAe,YAAY,YAAY,iBAAiB,eAAe,gBAAgB,kBAAkB;AAChI,SAAS,yBAAyB,+BAA+B;AASjE,SAAS,wBAAwB,cAA0C;AACzE,MAAI,CAAC,GAAG,WAAW,YAAY,EAAG,QAAO;AACzC,QAAM,SAAS,GAAG,iBAAiB,cAAc,GAAG,aAAa,cAAc,MAAM,GAAG,GAAG,aAAa,QAAQ,IAAI;AACpH,QAAM,SAAS,oBAAI,IAAoB;AACvC,MAAI;AACJ,aAAW,aAAa,OAAO,YAAY;AACzC,QAAI,GAAG,oBAAoB,SAAS,GAAG;AACrC,YAAM,WAAW,UAAU,WAAW,KAAK,CAAC,aAAa,SAAS,SAAS,GAAG,WAAW,aAAa;AACtG,iBAAW,eAAe,UAAU,gBAAgB,cAAc;AAChE,YAAI,CAAC,GAAG,aAAa,YAAY,IAAI,KAAK,CAAC,YAAY,YAAa;AACpE,YAAI,CAAC,GAAG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,kBAClB,MAAM,gBAAgB;AAAA,oBACpB,eAAe,WAAW,KAAK,GAAG,SAAS;AAAA,oBAC3C,WAAW,KAAK;AAAA,kBAClB,CAAC;AAAA,gBACH,CAAC;AAAA,cACH,CAAC;AAAA,YACH,CAAC;AAAA,UACH;AAAA,QACF,CAAC;AAAA,MACH;AAEF,YAAM,SAAS,wBAAwB;AAAA,QACrC,UAAU;AAAA,QACV,SAAS;AAAA,UACP,EAAE,cAAc,CAAC,EAAE,MAAM,8BAA8B,YAAY,KAAK,CAAC,GAAG,iBAAiB,wCAAwC;AAAA,QACvI;AAAA,QACA,MAAM,YAAY;AAChB,qBAAW,qBAAqB;AAAA,YAC9B,iBAAiB,wBAAwB;AAAA,YACzC,YAAY;AAAA,YACZ,cAAc;AAAA,cACZ;AAAA,gBACE,MAAM;AAAA,gBACN,MAAM;AAAA,gBACN,aAAa,aAAa,SAAS,UAAU;AAAA,cAC/C;AAAA,YACF;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF,CAAC;AAED,aAAO,oBAAI,IAAI,CAAC,CAAC,kCAAkC,MAAM,CAAC,CAAC;AAAA,IAC7D;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,10 +17,15 @@ import {
|
|
|
17
17
|
function createWorkflowsExtension() {
|
|
18
18
|
const imports = [];
|
|
19
19
|
const entries = [];
|
|
20
|
+
let registrarImport;
|
|
20
21
|
return {
|
|
21
22
|
id: "registry.workflows",
|
|
22
|
-
outputFiles: ["workflows.generated.ts"],
|
|
23
|
+
outputFiles: ["workflows.generated.ts", "workflow-registrations.generated.ts"],
|
|
23
24
|
scanModule(ctx) {
|
|
25
|
+
if (ctx.moduleId === "workflows") {
|
|
26
|
+
const registrar = ctx.resolveModuleFile(ctx.roots, ctx.imps, "lib/code-registry.ts");
|
|
27
|
+
if (registrar) registrarImport = ctx.sanitizeGeneratedModuleSpecifier(registrar.importPath);
|
|
28
|
+
}
|
|
24
29
|
ctx.processStandaloneConfig({
|
|
25
30
|
roots: ctx.roots,
|
|
26
31
|
imps: ctx.imps,
|
|
@@ -129,7 +134,25 @@ function createWorkflowsExtension() {
|
|
|
129
134
|
});
|
|
130
135
|
}
|
|
131
136
|
});
|
|
132
|
-
|
|
137
|
+
const registrationOutput = renderGeneratedTsSource({
|
|
138
|
+
fileName: "workflow-registrations.generated.ts",
|
|
139
|
+
imports: registrarImport ? [
|
|
140
|
+
{ namedImports: [{ name: "allCodeWorkflows" }], moduleSpecifier: "./workflows.generated" },
|
|
141
|
+
{ namedImports: [{ name: "registerCodeWorkflows" }], moduleSpecifier: registrarImport }
|
|
142
|
+
] : [],
|
|
143
|
+
build(sourceFile) {
|
|
144
|
+
sourceFile.addFunction({
|
|
145
|
+
name: "registerGeneratedCodeWorkflows",
|
|
146
|
+
isExported: true,
|
|
147
|
+
returnType: "void",
|
|
148
|
+
statements: registrarImport ? ["registerCodeWorkflows(allCodeWorkflows)"] : []
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
return /* @__PURE__ */ new Map([
|
|
153
|
+
["workflows.generated.ts", output],
|
|
154
|
+
["workflow-registrations.generated.ts", registrationOutput]
|
|
155
|
+
]);
|
|
133
156
|
}
|
|
134
157
|
};
|
|
135
158
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/lib/generators/extensions/workflows.ts"],
|
|
4
|
-
"sourcesContent": ["import { VariableDeclarationKind, type WriterFunction } from 'ts-morph'\nimport type { GeneratorExtension } from '../extension'\nimport {\n asExpression,\n arrayLiteral,\n arrowFunction,\n binaryExpression,\n identifier,\n methodCall,\n propertyAccess,\n writeValue,\n} from '../ast'\nimport {\n moduleEntry,\n namespaceFallback,\n namespaceImportSpec,\n renderGeneratedTsSource,\n} from './shared'\n\nexport function createWorkflowsExtension(): GeneratorExtension {\n const imports: Array<ReturnType<typeof namespaceImportSpec>> = []\n const entries: WriterFunction[] = []\n\n return {\n id: 'registry.workflows',\n outputFiles: ['workflows.generated.ts'],\n scanModule(ctx) {\n ctx.processStandaloneConfig({\n roots: ctx.roots,\n imps: ctx.imps,\n modId: ctx.moduleId,\n relativePath: 'workflows.ts',\n prefix: 'WORKFLOWS',\n importIdRef: ctx.importIdRef,\n standaloneImports: imports,\n standaloneEntries: entries,\n sharedImports: ctx.sharedImports,\n writeConfig: ({ importName, moduleId }) =>\n moduleEntry(moduleId, [\n {\n name: 'config',\n value: namespaceFallback({\n importName,\n members: ['default', 'workflowsConfig'],\n fallback: identifier('null'),\n castType: 'WorkflowsModuleConfig | null',\n }),\n },\n ]),\n })\n },\n getModuleDeclContribution() {\n return null\n },\n generateOutput() {\n const output = renderGeneratedTsSource({\n fileName: 'workflows.generated.ts',\n imports: [\n {\n namedImports: [\n { name: 'WorkflowsModuleConfig', isTypeOnly: true },\n { name: 'CodeWorkflowDefinition', isTypeOnly: true },\n ],\n moduleSpecifier: '@open-mercato/shared/modules/workflows',\n },\n ...imports,\n ],\n build(sourceFile) {\n sourceFile.addTypeAlias({\n name: 'WorkflowsConfigEntry',\n type: '{ moduleId: string; config: WorkflowsModuleConfig | null }',\n })\n sourceFile.addTypeAlias({\n name: 'ResolvedWorkflowsConfigEntry',\n type: '{ moduleId: string; config: WorkflowsModuleConfig }',\n })\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n declarations: [\n {\n name: 'entriesRaw',\n type: 'WorkflowsConfigEntry[]',\n initializer: arrayLiteral(entries, writeValue),\n },\n ],\n })\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n declarations: [\n {\n name: 'entries',\n type: 'ResolvedWorkflowsConfigEntry[]',\n initializer: asExpression(\n methodCall(identifier('entriesRaw'), 'filter', [\n arrowFunction({\n parameters: ['entry'],\n body: binaryExpression(propertyAccess(identifier('entry'), 'config'), '!=', null),\n }),\n ]),\n 'ResolvedWorkflowsConfigEntry[]',\n ),\n },\n ],\n })\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n isExported: true,\n declarations: [\n {\n name: 'workflowModuleConfigEntries',\n initializer: identifier('entries'),\n },\n {\n name: 'workflowModuleConfigs',\n type: 'WorkflowsModuleConfig[]',\n initializer: methodCall(identifier('entries'), 'map', [\n arrowFunction({\n parameters: ['entry'],\n body: propertyAccess(identifier('entry'), 'config'),\n }),\n ]),\n },\n {\n name: 'allCodeWorkflows',\n type: 'CodeWorkflowDefinition[]',\n initializer: methodCall(identifier('entries'), 'flatMap', [\n arrowFunction({\n parameters: ['entry'],\n body: propertyAccess(propertyAccess(identifier('entry'), 'config'), 'workflows'),\n }),\n ]),\n },\n ],\n })\n },\n })\n\n return new Map([['workflows.generated.ts', output]])\n },\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,+BAAoD;AAE7D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AAEA,SAAS,2BAA+C;AAC7D,QAAM,UAAyD,CAAC;AAChE,QAAM,UAA4B,CAAC;
|
|
4
|
+
"sourcesContent": ["import { VariableDeclarationKind, type WriterFunction } from 'ts-morph'\nimport type { GeneratorExtension } from '../extension'\nimport {\n asExpression,\n arrayLiteral,\n arrowFunction,\n binaryExpression,\n identifier,\n methodCall,\n propertyAccess,\n writeValue,\n} from '../ast'\nimport {\n moduleEntry,\n namespaceFallback,\n namespaceImportSpec,\n renderGeneratedTsSource,\n} from './shared'\n\nexport function createWorkflowsExtension(): GeneratorExtension {\n const imports: Array<ReturnType<typeof namespaceImportSpec>> = []\n const entries: WriterFunction[] = []\n let registrarImport: string | undefined\n\n return {\n id: 'registry.workflows',\n outputFiles: ['workflows.generated.ts', 'workflow-registrations.generated.ts'],\n scanModule(ctx) {\n if (ctx.moduleId === 'workflows') {\n const registrar = ctx.resolveModuleFile(ctx.roots, ctx.imps, 'lib/code-registry.ts')\n if (registrar) registrarImport = ctx.sanitizeGeneratedModuleSpecifier(registrar.importPath)\n }\n ctx.processStandaloneConfig({\n roots: ctx.roots,\n imps: ctx.imps,\n modId: ctx.moduleId,\n relativePath: 'workflows.ts',\n prefix: 'WORKFLOWS',\n importIdRef: ctx.importIdRef,\n standaloneImports: imports,\n standaloneEntries: entries,\n sharedImports: ctx.sharedImports,\n writeConfig: ({ importName, moduleId }) =>\n moduleEntry(moduleId, [\n {\n name: 'config',\n value: namespaceFallback({\n importName,\n members: ['default', 'workflowsConfig'],\n fallback: identifier('null'),\n castType: 'WorkflowsModuleConfig | null',\n }),\n },\n ]),\n })\n },\n getModuleDeclContribution() {\n return null\n },\n generateOutput() {\n const output = renderGeneratedTsSource({\n fileName: 'workflows.generated.ts',\n imports: [\n {\n namedImports: [\n { name: 'WorkflowsModuleConfig', isTypeOnly: true },\n { name: 'CodeWorkflowDefinition', isTypeOnly: true },\n ],\n moduleSpecifier: '@open-mercato/shared/modules/workflows',\n },\n ...imports,\n ],\n build(sourceFile) {\n sourceFile.addTypeAlias({\n name: 'WorkflowsConfigEntry',\n type: '{ moduleId: string; config: WorkflowsModuleConfig | null }',\n })\n sourceFile.addTypeAlias({\n name: 'ResolvedWorkflowsConfigEntry',\n type: '{ moduleId: string; config: WorkflowsModuleConfig }',\n })\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n declarations: [\n {\n name: 'entriesRaw',\n type: 'WorkflowsConfigEntry[]',\n initializer: arrayLiteral(entries, writeValue),\n },\n ],\n })\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n declarations: [\n {\n name: 'entries',\n type: 'ResolvedWorkflowsConfigEntry[]',\n initializer: asExpression(\n methodCall(identifier('entriesRaw'), 'filter', [\n arrowFunction({\n parameters: ['entry'],\n body: binaryExpression(propertyAccess(identifier('entry'), 'config'), '!=', null),\n }),\n ]),\n 'ResolvedWorkflowsConfigEntry[]',\n ),\n },\n ],\n })\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n isExported: true,\n declarations: [\n {\n name: 'workflowModuleConfigEntries',\n initializer: identifier('entries'),\n },\n {\n name: 'workflowModuleConfigs',\n type: 'WorkflowsModuleConfig[]',\n initializer: methodCall(identifier('entries'), 'map', [\n arrowFunction({\n parameters: ['entry'],\n body: propertyAccess(identifier('entry'), 'config'),\n }),\n ]),\n },\n {\n name: 'allCodeWorkflows',\n type: 'CodeWorkflowDefinition[]',\n initializer: methodCall(identifier('entries'), 'flatMap', [\n arrowFunction({\n parameters: ['entry'],\n body: propertyAccess(propertyAccess(identifier('entry'), 'config'), 'workflows'),\n }),\n ]),\n },\n ],\n })\n },\n })\n\n const registrationOutput = renderGeneratedTsSource({\n fileName: 'workflow-registrations.generated.ts',\n imports: registrarImport ? [\n { namedImports: [{ name: 'allCodeWorkflows' }], moduleSpecifier: './workflows.generated' },\n { namedImports: [{ name: 'registerCodeWorkflows' }], moduleSpecifier: registrarImport },\n ] : [],\n build(sourceFile) {\n sourceFile.addFunction({\n name: 'registerGeneratedCodeWorkflows',\n isExported: true,\n returnType: 'void',\n statements: registrarImport ? ['registerCodeWorkflows(allCodeWorkflows)'] : [],\n })\n },\n })\n\n return new Map([\n ['workflows.generated.ts', output],\n ['workflow-registrations.generated.ts', registrationOutput],\n ])\n },\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,+BAAoD;AAE7D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AAEA,SAAS,2BAA+C;AAC7D,QAAM,UAAyD,CAAC;AAChE,QAAM,UAA4B,CAAC;AACnC,MAAI;AAEJ,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,aAAa,CAAC,0BAA0B,qCAAqC;AAAA,IA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CAAC;AAED,YAAM,qBAAqB,wBAAwB;AAAA,QACjD,UAAU;AAAA,QACV,SAAS,kBAAkB;AAAA,UACzB,EAAE,cAAc,CAAC,EAAE,MAAM,mBAAmB,CAAC,GAAG,iBAAiB,wBAAwB;AAAA,UACzF,EAAE,cAAc,CAAC,EAAE,MAAM,wBAAwB,CAAC,GAAG,iBAAiB,gBAAgB;AAAA,QACxF,IAAI,CAAC;AAAA,QACL,MAAM,YAAY;AAChB,qBAAW,YAAY;AAAA,YACrB,MAAM;AAAA,YACN,YAAY;AAAA,YACZ,YAAY;AAAA,YACZ,YAAY,kBAAkB,CAAC,yCAAyC,IAAI,CAAC;AAAA,UAC/E,CAAC;AAAA,QACH;AAAA,MACF,CAAC;AAED,aAAO,oBAAI,IAAI;AAAA,QACb,CAAC,0BAA0B,MAAM;AAAA,QACjC,CAAC,uCAAuC,kBAAkB;AAAA,MAC5D,CAAC;AAAA,IACH;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1042,6 +1042,8 @@ function extractModuleMetadataContract(indexFilePath, moduleId, sourcePath) {
|
|
|
1042
1042
|
if (version) facts.version = version;
|
|
1043
1043
|
const requires = readStringArrayPropertyInitializer(metadata, "requires");
|
|
1044
1044
|
if (requires && requires.length > 0) facts.requires = requires;
|
|
1045
|
+
const optionalRequires = readStringArrayPropertyInitializer(metadata, "optionalRequires");
|
|
1046
|
+
if (optionalRequires && optionalRequires.length > 0) facts.optionalRequires = optionalRequires;
|
|
1045
1047
|
const ejectable = readBooleanPropertyInitializer(metadata, "ejectable");
|
|
1046
1048
|
if (ejectable !== void 0) facts.ejectable = ejectable;
|
|
1047
1049
|
return {
|