@open-mercato/cli 0.6.8-develop.6931.1.4a1e1c786b → 0.6.8-develop.6940.1.177ea30c6e
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 +65 -1
- package/build.mjs +57 -7
- package/dist/agentic/guides/backend-ui.md +7 -1
- package/dist/agentic/guides/module-facts.json +565 -224
- package/dist/agentic/guides/module-facts.v2.json +122933 -0
- package/dist/agentic/guides/modules/ai_assistant.md +2 -2
- package/dist/agentic/guides/modules/api_docs.md +2 -2
- package/dist/agentic/guides/modules/api_keys.md +2 -2
- package/dist/agentic/guides/modules/attachments.md +2 -2
- package/dist/agentic/guides/modules/audit_logs.md +2 -2
- package/dist/agentic/guides/modules/auth.md +2 -2
- package/dist/agentic/guides/modules/business_rules.md +2 -2
- package/dist/agentic/guides/modules/catalog.md +11 -4
- package/dist/agentic/guides/modules/channel_gmail.md +2 -2
- package/dist/agentic/guides/modules/channel_imap.md +2 -2
- package/dist/agentic/guides/modules/checkout.md +8 -2
- package/dist/agentic/guides/modules/communication_channels.md +6 -6
- package/dist/agentic/guides/modules/configs.md +2 -2
- package/dist/agentic/guides/modules/content.md +2 -2
- package/dist/agentic/guides/modules/currencies.md +2 -2
- package/dist/agentic/guides/modules/customer_accounts.md +2 -2
- package/dist/agentic/guides/modules/customers.md +8 -8
- package/dist/agentic/guides/modules/dashboards.md +12 -12
- package/dist/agentic/guides/modules/data_sync.md +4 -4
- package/dist/agentic/guides/modules/design_system.md +2 -2
- package/dist/agentic/guides/modules/dictionaries.md +2 -2
- package/dist/agentic/guides/modules/directory.md +2 -2
- package/dist/agentic/guides/modules/entities.md +3 -3
- package/dist/agentic/guides/modules/eudr.md +3 -3
- package/dist/agentic/guides/modules/events.md +2 -2
- package/dist/agentic/guides/modules/feature_toggles.md +2 -2
- package/dist/agentic/guides/modules/gateway_stripe.md +2 -2
- package/dist/agentic/guides/modules/generators.md +2 -2
- package/dist/agentic/guides/modules/inbox_ops.md +2 -2
- package/dist/agentic/guides/modules/integrations.md +5 -2
- package/dist/agentic/guides/modules/messages.md +2 -2
- package/dist/agentic/guides/modules/notifications.md +2 -2
- package/dist/agentic/guides/modules/onboarding.md +2 -2
- package/dist/agentic/guides/modules/payment_gateways.md +7 -3
- package/dist/agentic/guides/modules/perspectives.md +2 -2
- package/dist/agentic/guides/modules/planner.md +2 -2
- package/dist/agentic/guides/modules/portal.md +2 -2
- package/dist/agentic/guides/modules/progress.md +2 -2
- package/dist/agentic/guides/modules/query_index.md +2 -2
- package/dist/agentic/guides/modules/record_locks.md +3 -3
- package/dist/agentic/guides/modules/resources.md +2 -2
- package/dist/agentic/guides/modules/sales.md +13 -4
- package/dist/agentic/guides/modules/scheduler.md +2 -2
- package/dist/agentic/guides/modules/search.md +4 -4
- package/dist/agentic/guides/modules/security.md +3 -3
- package/dist/agentic/guides/modules/shipping_carriers.md +2 -2
- package/dist/agentic/guides/modules/sso.md +2 -2
- package/dist/agentic/guides/modules/staff.md +7 -4
- package/dist/agentic/guides/modules/storage_s3.md +2 -2
- package/dist/agentic/guides/modules/sync_akeneo.md +4 -4
- package/dist/agentic/guides/modules/sync_excel.md +2 -2
- package/dist/agentic/guides/modules/system_status_overlays.md +2 -2
- package/dist/agentic/guides/modules/translations.md +2 -2
- package/dist/agentic/guides/modules/webhooks.md +2 -2
- package/dist/agentic/guides/modules/wms.md +31 -4
- package/dist/agentic/guides/modules/workflows.md +2 -2
- package/dist/agentic/guides/reference-module-facts.json +8335 -0
- package/dist/agentic/guides/reference-modules/example.md +489 -0
- package/dist/agentic/guides/spec-delivery.md +34 -0
- package/dist/agentic/guides/testing-debugging.md +2 -1
- package/dist/agentic/guides/upstream/BACKWARD_COMPATIBILITY.md +3 -2
- package/dist/agentic/guides/upstream/manifest.json +2 -2
- package/dist/agentic/shared/AGENTS.md.template +10 -14
- package/dist/agentic/shared/ai/harness/README.md +4 -4
- package/dist/agentic/shared/ai/harness/RELEASE.md +4 -4
- package/dist/agentic/shared/ai/harness/cases.json +11350 -5088
- package/dist/agentic/shared/ai/harness/cases.schema.json +70 -7
- package/dist/agentic/shared/ai/harness/design-system-inventory.json +6697 -0
- package/dist/agentic/shared/ai/harness/fixtures/index.json +3 -1
- package/dist/agentic/shared/ai/harness/fixtures/seeds.json +4 -0
- package/dist/agentic/shared/ai/harness/knowledge-change.schema.json +228 -0
- package/dist/agentic/shared/ai/harness/release-matrix.json +9 -4
- package/dist/agentic/shared/ai/harness/result.schema.json +60 -0
- package/dist/agentic/shared/ai/harness/routing-response.schema.json +10 -0
- package/dist/agentic/shared/ai/harness/source-link-inventory.json +3231 -0
- package/dist/agentic/shared/ai/harness/validators.json +8 -4
- package/dist/agentic/shared/ai/harness/writable-ast-oracles.mjs +5 -2
- package/dist/agentic/shared/ai/harness/writable-behavior-oracles.mjs +3 -0
- package/dist/agentic/shared/ai/harness/writable-spec-oracles.mjs +879 -0
- package/dist/agentic/shared/ai/skills/om-auto-upgrade-0.6.7-to-0.7.0/SKILL.md +102 -0
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/SKILL.md +1 -0
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/crud-surfaces.md +15 -0
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/frontend-and-design-system.md +6 -0
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/page-and-navigation.md +4 -0
- package/dist/agentic/shared/ai/skills/om-data-model-design/SKILL.md +1 -0
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/integrity-and-concurrency.md +2 -0
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/migration-workflow.md +2 -0
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/schema-design.md +3 -1
- package/dist/agentic/shared/ai/skills/om-eject-and-customize/SKILL.md +1 -0
- package/dist/agentic/shared/ai/skills/om-eject-and-customize/references/decision-and-procedure.md +2 -0
- package/dist/agentic/shared/ai/skills/om-evolve-harness/SKILL.md +2 -0
- package/dist/agentic/shared/ai/skills/om-evolve-harness/references/case-template.md +3 -3
- package/dist/agentic/shared/ai/skills/om-evolve-harness/references/case-workflow.md +1 -1
- package/dist/agentic/shared/ai/skills/om-evolve-harness/references/knowledge-change.md +133 -0
- package/dist/agentic/shared/ai/skills/om-integration-builder/SKILL.md +1 -0
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/provider-families.md +11 -0
- package/dist/agentic/shared/ai/skills/om-judge-agent-session/references/judge-workflow.md +1 -1
- package/dist/agentic/shared/ai/skills/om-module-scaffold/SKILL.md +2 -2
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/api-and-domain.md +14 -1
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/data-and-migrations.md +2 -0
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/module-surfaces.md +19 -0
- package/dist/agentic/shared/ai/skills/om-share-this-session/scripts/prepare-share-bundle.mjs +1 -4
- package/dist/agentic/shared/ai/skills/om-system-extension/SKILL.md +1 -0
- package/dist/agentic/shared/ai/skills/om-system-extension/references/extension-branches.md +24 -0
- package/dist/agentic/shared/ai/skills/om-system-extension/references/unified-overrides.md +3 -1
- package/dist/agentic/shared/ai/skills/om-troubleshooter/SKILL.md +1 -0
- package/dist/agentic/shared/ai/skills/om-troubleshooter/references/diagnosis-map.md +13 -0
- package/dist/agentic/shared/ai/skills/tiers.json +2 -1
- package/dist/agentic/shared/ai/specs/2026-08-06-reference-module-activation.md +248 -0
- package/dist/agentic/shared/scripts/agent-harness-tool-server.mjs +39 -2
- package/dist/agentic/shared/scripts/design-source-contract.mjs +108 -0
- package/dist/agentic/shared/scripts/evaluate-agent-harness.mjs +935 -28
- package/dist/agentic/shared/scripts/framework-context.mjs +4 -1
- package/dist/agentic/shared/scripts/run-agent-harness-release.mjs +1 -1
- package/dist/agentic/shared/scripts/validate-knowledge-change.mjs +1511 -0
- package/dist/lib/__integration__/TC-INT-008.spec.js +1 -0
- package/dist/lib/__integration__/TC-INT-008.spec.js.map +2 -2
- package/dist/lib/agentic-setup.js +9 -1
- package/dist/lib/agentic-setup.js.map +2 -2
- package/dist/lib/generators/module-extension-facts.js +93 -26
- package/dist/lib/generators/module-extension-facts.js.map +3 -3
- package/dist/lib/generators/module-facts-discovery.js +23 -0
- package/dist/lib/generators/module-facts-discovery.js.map +2 -2
- package/dist/lib/generators/module-facts.js +969 -41
- package/dist/lib/generators/module-facts.js.map +2 -2
- package/dist/lib/generators/module-override-targets.js +35 -11
- package/dist/lib/generators/module-override-targets.js.map +2 -2
- package/dist/lib/generators/module-registry.js +105 -2
- package/dist/lib/generators/module-registry.js.map +2 -2
- package/dist/lib/resolver.js +5 -0
- package/dist/lib/resolver.js.map +2 -2
- package/dist/lib/testing/integration-discovery.js +34 -0
- package/dist/lib/testing/integration-discovery.js.map +2 -2
- package/dist/lib/testing/integration.js +0 -2
- package/dist/lib/testing/integration.js.map +2 -2
- package/dist/mercato.js +4 -4
- package/dist/mercato.js.map +2 -2
- package/package.json +6 -6
- package/src/lib/__integration__/TC-INT-008.spec.ts +4 -2
- package/src/lib/__tests__/resolve-environment.test.ts +18 -0
- package/src/lib/agentic-setup.ts +10 -2
- package/src/lib/generators/__tests__/helpers/override-target-diagnostic-fixtures.ts +150 -0
- package/src/lib/generators/__tests__/module-extension-facts.test.ts +290 -0
- package/src/lib/generators/__tests__/module-facts.bc-guard.test.ts +72 -7
- package/src/lib/generators/__tests__/module-facts.computed-di-token.test.ts +88 -0
- package/src/lib/generators/__tests__/module-facts.example-fact-coverage.test.ts +502 -0
- package/src/lib/generators/__tests__/module-facts.local-reference.test.ts +414 -0
- package/src/lib/generators/__tests__/module-facts.search-entity-id.test.ts +151 -0
- package/src/lib/generators/__tests__/module-facts.source-links.test.ts +42 -1
- package/src/lib/generators/__tests__/module-override-targets.diagnostic-wiring.test.ts +92 -0
- package/src/lib/generators/__tests__/module-override-targets.test.ts +24 -0
- package/src/lib/generators/__tests__/module-override-targets.unknown-mode.test.ts +117 -0
- package/src/lib/generators/__tests__/module-subset.test.ts +60 -0
- package/src/lib/generators/module-extension-facts.ts +181 -25
- package/src/lib/generators/module-facts-discovery.ts +46 -0
- package/src/lib/generators/module-facts.ts +1330 -86
- package/src/lib/generators/module-override-targets.ts +70 -26
- package/src/lib/generators/module-registry.ts +135 -2
- package/src/lib/resolver.ts +6 -1
- package/src/lib/testing/__tests__/integration-discovery.test.ts +35 -0
- package/src/lib/testing/integration-discovery.ts +50 -0
- package/src/lib/testing/integration.ts +0 -2
- package/src/mercato.ts +3 -3
|
@@ -121,7 +121,7 @@ function propertyName(node) {
|
|
|
121
121
|
if (ts.isIdentifier(node) || ts.isStringLiteralLike(node) || ts.isNumericLiteral(node)) return node.text;
|
|
122
122
|
return null;
|
|
123
123
|
}
|
|
124
|
-
function buildStaticContext(file) {
|
|
124
|
+
function buildStaticContext(file, factsContractVersion = 2) {
|
|
125
125
|
const initializers = /* @__PURE__ */ new Map();
|
|
126
126
|
const visit = (node) => {
|
|
127
127
|
if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {
|
|
@@ -133,7 +133,7 @@ function buildStaticContext(file) {
|
|
|
133
133
|
node.forEachChild(visit);
|
|
134
134
|
};
|
|
135
135
|
file.forEachChild(visit);
|
|
136
|
-
return { initializers, sourceFile: file, resolving: /* @__PURE__ */ new Set() };
|
|
136
|
+
return { initializers, sourceFile: file, resolving: /* @__PURE__ */ new Set(), factsContractVersion };
|
|
137
137
|
}
|
|
138
138
|
function entityRegistryValue(expression) {
|
|
139
139
|
const parts = [];
|
|
@@ -153,6 +153,16 @@ function staticTemplate(expression, context) {
|
|
|
153
153
|
}
|
|
154
154
|
return value;
|
|
155
155
|
}
|
|
156
|
+
function isFunctionLikeInitializer(expression, context) {
|
|
157
|
+
const current = unwrap(expression);
|
|
158
|
+
if (ts.isArrowFunction(current) || ts.isFunctionExpression(current)) return true;
|
|
159
|
+
if (!ts.isIdentifier(current)) return false;
|
|
160
|
+
const initializer = context.initializers.get(current.text);
|
|
161
|
+
if (!initializer) return false;
|
|
162
|
+
if (ts.isFunctionDeclaration(initializer)) return true;
|
|
163
|
+
const resolved = unwrap(initializer);
|
|
164
|
+
return ts.isArrowFunction(resolved) || ts.isFunctionExpression(resolved);
|
|
165
|
+
}
|
|
156
166
|
function staticObject(expression, context) {
|
|
157
167
|
const result = {};
|
|
158
168
|
for (const property of expression.properties) {
|
|
@@ -161,6 +171,7 @@ function staticObject(expression, context) {
|
|
|
161
171
|
if (!name) continue;
|
|
162
172
|
const value = staticValue(property.initializer, context);
|
|
163
173
|
if (value !== void 0) result[name] = value;
|
|
174
|
+
else if (context.factsContractVersion === 2 && isFunctionLikeInitializer(property.initializer, context)) result[name] = true;
|
|
164
175
|
continue;
|
|
165
176
|
}
|
|
166
177
|
if (ts.isShorthandPropertyAssignment(property)) {
|
|
@@ -212,6 +223,12 @@ function staticValue(expression, context) {
|
|
|
212
223
|
return value;
|
|
213
224
|
}
|
|
214
225
|
if (ts.isCallExpression(current)) {
|
|
226
|
+
const handle = componentReplacementHandle(current, context);
|
|
227
|
+
if (handle) {
|
|
228
|
+
if (context.factsContractVersion === 2) return handle.resolved;
|
|
229
|
+
const firstArgument2 = current.arguments[0];
|
|
230
|
+
return firstArgument2 ? staticValue(firstArgument2, context) : void 0;
|
|
231
|
+
}
|
|
215
232
|
if (ts.isIdentifier(current.expression)) {
|
|
216
233
|
const callable = context.initializers.get(current.expression.text);
|
|
217
234
|
if (callable && (ts.isArrowFunction(callable) || ts.isFunctionExpression(callable) || ts.isFunctionDeclaration(callable))) {
|
|
@@ -224,7 +241,8 @@ function staticValue(expression, context) {
|
|
|
224
241
|
const childContext = {
|
|
225
242
|
initializers,
|
|
226
243
|
sourceFile: context.sourceFile,
|
|
227
|
-
resolving: new Set(context.resolving)
|
|
244
|
+
resolving: new Set(context.resolving),
|
|
245
|
+
factsContractVersion: context.factsContractVersion
|
|
228
246
|
};
|
|
229
247
|
if (callable.body && ts.isExpression(callable.body)) return staticValue(callable.body, childContext);
|
|
230
248
|
const returnStatement = callable.body?.statements.find(ts.isReturnStatement);
|
|
@@ -232,7 +250,7 @@ function staticValue(expression, context) {
|
|
|
232
250
|
}
|
|
233
251
|
}
|
|
234
252
|
const firstArgument = current.arguments[0];
|
|
235
|
-
if (firstArgument) {
|
|
253
|
+
if (firstArgument && (context.factsContractVersion === 1 || ts.isIdentifier(current.expression))) {
|
|
236
254
|
const value = staticValue(firstArgument, context);
|
|
237
255
|
if (!isStaticObject(value) || !ts.isIdentifier(current.expression)) return value;
|
|
238
256
|
if (current.expression.text === "dataTableExtensionHost") return { family: "data-table", ...value };
|
|
@@ -248,6 +266,21 @@ function staticValue(expression, context) {
|
|
|
248
266
|
}
|
|
249
267
|
return void 0;
|
|
250
268
|
}
|
|
269
|
+
const COMPONENT_REPLACEMENT_HANDLE_BUILDERS = {
|
|
270
|
+
page: ([routePath]) => routePath ? `page:${routePath}` : void 0,
|
|
271
|
+
dataTable: ([tableId]) => tableId ? `data-table:${tableId}` : void 0,
|
|
272
|
+
crudForm: ([entityId]) => entityId ? `crud-form:${entityId}` : void 0,
|
|
273
|
+
section: ([scope, sectionId]) => scope && sectionId ? `section:${scope}.${sectionId}` : void 0
|
|
274
|
+
};
|
|
275
|
+
function componentReplacementHandle(expression, context) {
|
|
276
|
+
if (!ts.isPropertyAccessExpression(expression.expression)) return null;
|
|
277
|
+
const callee = expression.expression;
|
|
278
|
+
if (!ts.isIdentifier(callee.expression) || callee.expression.text !== "ComponentReplacementHandles") return null;
|
|
279
|
+
const builder = COMPONENT_REPLACEMENT_HANDLE_BUILDERS[callee.name.text];
|
|
280
|
+
if (!builder) return { resolved: void 0 };
|
|
281
|
+
const args = expression.arguments.map((argument) => stringValue(staticValue(argument, context)));
|
|
282
|
+
return { resolved: builder(args) };
|
|
283
|
+
}
|
|
251
284
|
function isStaticObject(value) {
|
|
252
285
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
253
286
|
}
|
|
@@ -277,19 +310,22 @@ function conventionPath(moduleRoot, relativePath) {
|
|
|
277
310
|
}
|
|
278
311
|
return null;
|
|
279
312
|
}
|
|
280
|
-
function
|
|
313
|
+
function readConventionObjectArrayForContract(filePath, exportName, factsContractVersion) {
|
|
281
314
|
const file = sourceFile(filePath);
|
|
282
315
|
if (!file) return [];
|
|
283
|
-
const context = buildStaticContext(file);
|
|
316
|
+
const context = buildStaticContext(file, factsContractVersion);
|
|
284
317
|
const initializer = context.initializers.get(exportName);
|
|
285
318
|
if (!initializer || ts.isFunctionDeclaration(initializer)) return [];
|
|
286
319
|
const value = staticValue(initializer, context);
|
|
287
320
|
return Array.isArray(value) ? value.filter(isStaticObject) : [];
|
|
288
321
|
}
|
|
289
|
-
function
|
|
322
|
+
function readConventionObjectArray(filePath, exportName) {
|
|
323
|
+
return readConventionObjectArrayForContract(filePath, exportName, 2);
|
|
324
|
+
}
|
|
325
|
+
function readRootObject(filePath, variableName, factsContractVersion = 2) {
|
|
290
326
|
const file = sourceFile(filePath);
|
|
291
327
|
if (!file) return null;
|
|
292
|
-
const context = buildStaticContext(file);
|
|
328
|
+
const context = buildStaticContext(file, factsContractVersion);
|
|
293
329
|
const initializer = context.initializers.get(variableName);
|
|
294
330
|
if (!initializer || ts.isFunctionDeclaration(initializer)) return null;
|
|
295
331
|
const value = staticValue(initializer, context);
|
|
@@ -776,27 +812,33 @@ function contributionBase(id, sourcePath, sourceSymbol) {
|
|
|
776
812
|
source: { path: sourcePath, ...sourceSymbol ? { symbol: sourceSymbol } : {} }
|
|
777
813
|
};
|
|
778
814
|
}
|
|
815
|
+
function injectionTableSlots(value) {
|
|
816
|
+
if (value === void 0) return [];
|
|
817
|
+
return Array.isArray(value) ? value : [value];
|
|
818
|
+
}
|
|
779
819
|
function extractInjectionTable(options) {
|
|
780
820
|
const filePath = conventionPath(options.moduleRoot, "widgets/injection-table.ts");
|
|
781
821
|
if (!filePath) return [];
|
|
782
|
-
const table = readRootObject(filePath, "injectionTable");
|
|
822
|
+
const table = readRootObject(filePath, "injectionTable", options.factsContractVersion ?? 2);
|
|
783
823
|
if (!table) return [];
|
|
784
824
|
const sourcePath = portablePath(options.moduleRoot, options.sourceRoot, filePath);
|
|
785
825
|
const facts = [];
|
|
786
826
|
for (const targetId of Object.keys(table).sort((left, right) => left.localeCompare(right))) {
|
|
787
|
-
const entries = table[targetId];
|
|
788
|
-
if (!Array.isArray(entries)) continue;
|
|
827
|
+
const entries = options.factsContractVersion === 1 ? Array.isArray(table[targetId]) ? table[targetId] : [] : injectionTableSlots(table[targetId]);
|
|
789
828
|
for (const entry of entries) {
|
|
790
|
-
if (!isStaticObject(entry)) continue;
|
|
791
|
-
const
|
|
829
|
+
if (options.factsContractVersion === 1 && !isStaticObject(entry)) continue;
|
|
830
|
+
const slot = isStaticObject(entry) ? entry : null;
|
|
831
|
+
const widgetId = typeof entry === "string" ? entry : slot ? stringValue(slot.widgetId) : void 0;
|
|
792
832
|
if (!widgetId) continue;
|
|
833
|
+
const features = slot ? strings(slot.features) : [];
|
|
834
|
+
const priority = slot ? numberValue(slot.priority) : void 0;
|
|
793
835
|
const payload = targetId.endsWith(":columns") ? "column" : targetId.endsWith(":row-actions") ? "row-action" : targetId.endsWith(":bulk-actions") ? "bulk-action" : targetId.endsWith(":filters") ? "filter" : targetId.endsWith(":fields") ? "field" : "render";
|
|
794
836
|
const base = contributionBase(`${widgetId}@${targetId}`, sourcePath, "injectionTable");
|
|
795
837
|
const shared = {
|
|
796
838
|
...base,
|
|
797
839
|
targets: [target(targetId)],
|
|
798
|
-
features
|
|
799
|
-
placement:
|
|
840
|
+
features,
|
|
841
|
+
placement: priority !== void 0 ? { priority } : void 0
|
|
800
842
|
};
|
|
801
843
|
if (targetId.startsWith("data-table:")) {
|
|
802
844
|
facts.push({
|
|
@@ -805,7 +847,7 @@ function extractInjectionTable(options) {
|
|
|
805
847
|
details: {
|
|
806
848
|
payload: payload === "field" ? "render" : payload,
|
|
807
849
|
tableId: targetId.replace(/^data-table:/, "").replace(/:(?:columns|row-actions|bulk-actions|filters|toolbar|header|footer|search-trailing)$/, ""),
|
|
808
|
-
executionGuard:
|
|
850
|
+
executionGuard: features.length > 0 ? "both" : "host"
|
|
809
851
|
}
|
|
810
852
|
});
|
|
811
853
|
} else if (targetId.startsWith("crud-form:")) {
|
|
@@ -825,7 +867,7 @@ function extractInjectionTable(options) {
|
|
|
825
867
|
details: {
|
|
826
868
|
payload: "render",
|
|
827
869
|
registryKey: widgetId,
|
|
828
|
-
executionGuard:
|
|
870
|
+
executionGuard: features.length > 0 ? "both" : "host"
|
|
829
871
|
}
|
|
830
872
|
});
|
|
831
873
|
}
|
|
@@ -837,7 +879,7 @@ function extractObjectConvention(options) {
|
|
|
837
879
|
const filePath = conventionPath(options.module.moduleRoot, options.relativePath);
|
|
838
880
|
if (!filePath) return [];
|
|
839
881
|
const exportNames = [options.exportName, ...options.exportAliases ?? []];
|
|
840
|
-
const entries = exportNames.reduce((found, exportName) => found.length > 0 ? found :
|
|
882
|
+
const entries = exportNames.reduce((found, exportName) => found.length > 0 ? found : readConventionObjectArrayForContract(filePath, exportName, options.module.factsContractVersion ?? 2), []);
|
|
841
883
|
const sourcePath = portablePath(options.module.moduleRoot, options.module.sourceRoot, filePath);
|
|
842
884
|
return entries.flatMap((entry, index) => options.build(entry, sourcePath, index) ?? []);
|
|
843
885
|
}
|
|
@@ -1075,7 +1117,7 @@ function extractComponentOverrides(options) {
|
|
|
1075
1117
|
const targetDefinition = isStaticObject(entry.target) ? entry.target : null;
|
|
1076
1118
|
const handle = targetDefinition ? stringValue(targetDefinition.componentId) : void 0;
|
|
1077
1119
|
if (!handle) return null;
|
|
1078
|
-
const mode = entry.wrapper !== void 0 ? "wrapper" : entry.props !== void 0 ? "props" : "replace";
|
|
1120
|
+
const mode = options.factsContractVersion === 1 ? entry.wrapper !== void 0 ? "wrapper" : entry.props !== void 0 ? "props" : "replace" : entry.wrapper !== void 0 ? "wrapper" : entry.propsTransform !== void 0 ? "props" : "replace";
|
|
1079
1121
|
const id = `${options.moduleId}.component-override.${index}:${handle}`;
|
|
1080
1122
|
const contribution = contributionBase(id, sourcePath, "componentOverrides");
|
|
1081
1123
|
return {
|
|
@@ -1378,6 +1420,20 @@ function targetModuleId(targetId) {
|
|
|
1378
1420
|
const match = /^([a-z][a-z0-9_]*)[.:]/.exec(withoutPrefix);
|
|
1379
1421
|
return match?.[1] ?? null;
|
|
1380
1422
|
}
|
|
1423
|
+
function normalizedEntityId(value) {
|
|
1424
|
+
return value.replace(/^([a-z][a-z0-9_]*):/, "$1.");
|
|
1425
|
+
}
|
|
1426
|
+
function entityFactKeyForTarget(targetId, entityIds) {
|
|
1427
|
+
const normalizedTarget = normalizedEntityId(targetId);
|
|
1428
|
+
for (const entityId of entityIds) {
|
|
1429
|
+
const normalizedEntity = normalizedEntityId(entityId);
|
|
1430
|
+
if (normalizedTarget === normalizedEntity) return entityId;
|
|
1431
|
+
if (normalizedTarget.startsWith(`${normalizedEntity}.`) && /\.(?:creating|created|updating|updated|deleting|deleted)$/.test(normalizedTarget)) {
|
|
1432
|
+
return entityId;
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
return null;
|
|
1436
|
+
}
|
|
1381
1437
|
function correlateExtensionTarget(targetFact, options) {
|
|
1382
1438
|
if (targetFact.resolution !== "unresolved") return targetFact;
|
|
1383
1439
|
const allHosts = Object.values(options.surfacesByModule).flatMap((surface) => surface.hosts);
|
|
@@ -1401,8 +1457,9 @@ function correlateExtensionTarget(targetFact, options) {
|
|
|
1401
1457
|
if (patterned) return { id: targetFact.id, resolution: "pattern" };
|
|
1402
1458
|
const framework = allFrameworkHosts().find((host) => patternMatches(host.id, targetFact.id)) ?? (FRAMEWORK_PREFIXES.some((prefix) => targetFact.id.startsWith(prefix)) ? FRAMEWORK_HOSTS[0] : void 0);
|
|
1403
1459
|
if (framework) return { id: targetFact.id, resolution: "framework" };
|
|
1404
|
-
|
|
1405
|
-
|
|
1460
|
+
const entityFactKey = options.factsContractVersion === 1 ? options.entityIds.has(targetFact.id) ? targetFact.id : null : entityFactKeyForTarget(targetFact.id, options.entityIds);
|
|
1461
|
+
if (entityFactKey) {
|
|
1462
|
+
return { id: targetFact.id, resolution: "fact-ref", factRef: { factSection: "entities", factKey: entityFactKey } };
|
|
1406
1463
|
}
|
|
1407
1464
|
if (options.eventIds.has(targetFact.id)) {
|
|
1408
1465
|
return { id: targetFact.id, resolution: "fact-ref", factRef: { factSection: "events", factKey: targetFact.id } };
|
|
@@ -1789,15 +1846,24 @@ function assertNoUnresolvedExtensionTargets(surfacesByModule) {
|
|
|
1789
1846
|
throw new Error(`[module-facts] unresolved first-party extension targets: ${unresolved.join(", ")}`);
|
|
1790
1847
|
}
|
|
1791
1848
|
}
|
|
1792
|
-
function getFrameworkOverrideModes() {
|
|
1849
|
+
function getFrameworkOverrideModes(hosts = FRAMEWORK_OVERRIDE_HOSTS) {
|
|
1793
1850
|
const modes = {};
|
|
1794
|
-
for (const
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1851
|
+
for (const [dotted, operation] of Object.entries(getFrameworkOverrideHostOperations(hosts))) {
|
|
1852
|
+
if (operation === "disable-replace" || operation === "replace" || operation === "additive") {
|
|
1853
|
+
modes[dotted] = operation;
|
|
1854
|
+
}
|
|
1798
1855
|
}
|
|
1799
1856
|
return modes;
|
|
1800
1857
|
}
|
|
1858
|
+
function getFrameworkOverrideHostOperations(hosts = FRAMEWORK_OVERRIDE_HOSTS) {
|
|
1859
|
+
const operations = {};
|
|
1860
|
+
for (const host of hosts) {
|
|
1861
|
+
const dotted = host.key.replace(/^framework\.module-override\./, "");
|
|
1862
|
+
const operation = host.operations?.[0];
|
|
1863
|
+
if (typeof operation === "string") operations[dotted] = operation;
|
|
1864
|
+
}
|
|
1865
|
+
return operations;
|
|
1866
|
+
}
|
|
1801
1867
|
function getFrameworkExtensionHosts() {
|
|
1802
1868
|
return sortHosts(allFrameworkHosts().map((host) => ({
|
|
1803
1869
|
...host,
|
|
@@ -1832,6 +1898,7 @@ export {
|
|
|
1832
1898
|
extractKnownCommandIds,
|
|
1833
1899
|
extractModuleExtensionFacts,
|
|
1834
1900
|
getFrameworkExtensionHosts,
|
|
1901
|
+
getFrameworkOverrideHostOperations,
|
|
1835
1902
|
getFrameworkOverrideModes,
|
|
1836
1903
|
readConventionObjectArray,
|
|
1837
1904
|
renderFrameworkExtensionPointsMarkdown,
|