@open-mercato/cli 0.6.7-develop.6862.1.c11a64ce0a → 0.6.7
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 -4
- package/build.mjs +7 -24
- package/dist/agentic/claude-code/hooks/entity-migration-check.ts +88 -32
- package/dist/agentic/codex/enforcement-rules.md +16 -2
- package/dist/agentic/cursor/hooks/entity-migration-check.mjs +50 -19
- package/dist/agentic/cursor/rules/entity-guard.mdc +21 -9
- package/dist/agentic/cursor/rules/generated-guard.mdc +5 -3
- package/dist/agentic/cursor/rules/open-mercato.mdc +29 -3
- package/dist/agentic/guides/cache.md +45 -0
- package/dist/agentic/guides/core.md +453 -0
- package/dist/agentic/guides/events.md +117 -0
- package/dist/agentic/guides/module-facts.json +3833 -115419
- package/dist/agentic/guides/module-system.md +127 -12
- package/dist/agentic/guides/modules/ai_assistant.md +28 -227
- package/dist/agentic/guides/modules/api_docs.md +2 -58
- package/dist/agentic/guides/modules/api_keys.md +7 -92
- package/dist/agentic/guides/modules/attachments.md +14 -119
- package/dist/agentic/guides/modules/audit_logs.md +10 -131
- package/dist/agentic/guides/modules/auth.md +33 -276
- package/dist/agentic/guides/modules/business_rules.md +14 -149
- package/dist/agentic/guides/modules/catalog.md +43 -475
- package/dist/agentic/guides/modules/channel_gmail.md +3 -82
- package/dist/agentic/guides/modules/channel_imap.md +3 -82
- package/dist/agentic/guides/modules/checkout.md +27 -299
- package/dist/agentic/guides/modules/communication_channels.md +33 -315
- package/dist/agentic/guides/modules/configs.md +8 -104
- package/dist/agentic/guides/modules/content.md +2 -57
- package/dist/agentic/guides/modules/currencies.md +17 -152
- package/dist/agentic/guides/modules/customer_accounts.md +45 -387
- package/dist/agentic/guides/modules/customers.md +85 -746
- package/dist/agentic/guides/modules/dashboards.md +10 -155
- package/dist/agentic/guides/modules/data_sync.md +16 -149
- package/dist/agentic/guides/modules/dictionaries.md +12 -107
- package/dist/agentic/guides/modules/directory.md +15 -148
- package/dist/agentic/guides/modules/entities.md +13 -145
- package/dist/agentic/guides/modules/events.md +2 -59
- package/dist/agentic/guides/modules/feature_toggles.md +9 -119
- package/dist/agentic/guides/modules/gateway_stripe.md +4 -92
- package/dist/agentic/guides/modules/generators.md +2 -45
- package/dist/agentic/guides/modules/inbox_ops.md +27 -207
- package/dist/agentic/guides/modules/integrations.md +16 -146
- package/dist/agentic/guides/modules/messages.md +24 -223
- package/dist/agentic/guides/modules/notifications.md +8 -96
- package/dist/agentic/guides/modules/onboarding.md +6 -77
- package/dist/agentic/guides/modules/payment_gateways.md +21 -164
- package/dist/agentic/guides/modules/perspectives.md +7 -77
- package/dist/agentic/guides/modules/planner.md +18 -136
- package/dist/agentic/guides/modules/portal.md +2 -93
- package/dist/agentic/guides/modules/progress.md +14 -104
- package/dist/agentic/guides/modules/query_index.md +15 -154
- package/dist/agentic/guides/modules/record_locks.md +21 -206
- package/dist/agentic/guides/modules/resources.md +30 -197
- package/dist/agentic/guides/modules/sales.md +84 -678
- package/dist/agentic/guides/modules/scheduler.md +14 -133
- package/dist/agentic/guides/modules/search.md +6 -170
- package/dist/agentic/guides/modules/security.md +35 -294
- package/dist/agentic/guides/modules/shipping_carriers.md +18 -134
- package/dist/agentic/guides/modules/sso.md +26 -151
- package/dist/agentic/guides/modules/staff.md +57 -369
- package/dist/agentic/guides/modules/storage_s3.md +5 -95
- package/dist/agentic/guides/modules/sync_akeneo.md +3 -85
- package/dist/agentic/guides/modules/sync_excel.md +6 -75
- package/dist/agentic/guides/modules/system_status_overlays.md +2 -60
- package/dist/agentic/guides/modules/translations.md +10 -104
- package/dist/agentic/guides/modules/webhooks.md +24 -203
- package/dist/agentic/guides/modules/wms.md +46 -441
- package/dist/agentic/guides/modules/workflows.md +43 -302
- package/dist/agentic/guides/queue.md +53 -0
- package/dist/agentic/guides/search.md +115 -0
- package/dist/agentic/guides/shared.md +108 -0
- package/dist/agentic/guides/ui.md +347 -0
- package/dist/agentic/shared/AGENTS.md.template +311 -124
- package/dist/agentic/shared/ai/agentic.config.json +0 -2
- package/dist/agentic/shared/ai/lessons.md +3 -26
- package/dist/agentic/shared/ai/skills/om-auto-continue-pr-loop/SKILL.md +27 -0
- package/dist/agentic/shared/ai/skills/om-auto-create-pr-loop/SKILL.md +27 -0
- package/dist/agentic/shared/ai/skills/om-auto-review-pr/SKILL.md +0 -4
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/SKILL.md +241 -20
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/ui-components.md +260 -0
- package/dist/agentic/shared/ai/skills/om-data-model-design/SKILL.md +601 -16
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/mikro-orm-cheatsheet.md +146 -0
- package/dist/agentic/shared/ai/skills/om-eject-and-customize/SKILL.md +310 -14
- package/dist/agentic/shared/ai/skills/om-help/SKILL.md +97 -15
- package/dist/agentic/shared/ai/skills/om-help/references/skills-catalog.md +84 -0
- package/dist/agentic/shared/ai/skills/om-help/references/workflow-sequences.md +193 -0
- package/dist/agentic/shared/ai/skills/om-implement-spec/SKILL.md +152 -33
- package/dist/agentic/shared/ai/skills/om-integration-builder/SKILL.md +708 -24
- package/dist/agentic/shared/ai/skills/om-integration-builder/STANDALONE.md +34 -0
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/adapter-contracts.md +762 -0
- package/dist/agentic/shared/ai/skills/om-module-scaffold/SKILL.md +820 -20
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/naming-conventions.md +50 -0
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/navigation-patterns.md +97 -0
- package/dist/agentic/shared/ai/skills/om-system-extension/SKILL.md +843 -19
- package/dist/agentic/shared/ai/skills/om-system-extension/references/extension-contracts.md +271 -0
- package/dist/agentic/shared/ai/skills/om-trim-unused-modules/SKILL.md +63 -15
- package/dist/agentic/shared/ai/skills/om-troubleshooter/SKILL.md +467 -16
- package/dist/agentic/shared/ai/skills/om-troubleshooter/references/diagnostic-commands.md +101 -0
- package/dist/agentic/shared/ai/skills/tiers.json +21 -143
- package/dist/agentic/shared/ai/skills/tiers.schema.json +40 -52
- package/dist/agentic/shared/ai/specs/README.md +3 -4
- package/dist/agentic/shared/ai/specs/SPEC-000-template.md +10 -226
- package/dist/agentic/shared/ai/trackers/github.md +4 -108
- package/dist/agentic/shared/scripts/install-skills.sh +694 -4
- package/dist/bin.js +1 -13
- package/dist/bin.js.map +2 -2
- package/dist/lib/__integration__/TC-INT-008.spec.js +8 -88
- package/dist/lib/__integration__/TC-INT-008.spec.js.map +2 -2
- package/dist/lib/agentic-init.js +3 -13
- package/dist/lib/agentic-init.js.map +2 -2
- package/dist/lib/agentic-setup.js +186 -418
- package/dist/lib/agentic-setup.js.map +2 -2
- package/dist/lib/generators/extensions/injection-widgets.js +0 -20
- package/dist/lib/generators/extensions/injection-widgets.js.map +2 -2
- package/dist/lib/generators/module-facts-discovery.js +7 -41
- package/dist/lib/generators/module-facts-discovery.js.map +2 -2
- package/dist/lib/generators/module-facts.js +45 -1387
- package/dist/lib/generators/module-facts.js.map +3 -3
- package/dist/lib/generators/module-registry.js +5 -11
- package/dist/lib/generators/module-registry.js.map +2 -2
- package/dist/lib/resolver.js +0 -2
- package/dist/lib/resolver.js.map +2 -2
- package/dist/lib/testing/integration.js +0 -5
- package/dist/lib/testing/integration.js.map +2 -2
- package/dist/mercato.js +1 -23
- package/dist/mercato.js.map +2 -2
- package/package.json +11 -13
- package/src/bin.ts +1 -33
- package/src/lib/__integration__/TC-INT-008.spec.ts +9 -107
- package/src/lib/__tests__/agentic-init.test.ts +5 -41
- package/src/lib/agentic-init.ts +3 -15
- package/src/lib/agentic-setup.ts +224 -530
- package/src/lib/generators/__tests__/module-facts.bc-guard.test.ts +2 -88
- package/src/lib/generators/__tests__/module-facts.customers.fixture.test.ts +0 -1
- package/src/lib/generators/__tests__/module-facts.discovery.test.ts +10 -54
- package/src/lib/generators/__tests__/module-subset.test.ts +0 -18
- package/src/lib/generators/extensions/injection-widgets.ts +0 -51
- package/src/lib/generators/module-facts-discovery.ts +7 -58
- package/src/lib/generators/module-facts.ts +46 -1851
- package/src/lib/generators/module-registry.ts +6 -16
- package/src/lib/resolver.ts +0 -3
- package/src/lib/testing/__tests__/integration.test.ts +0 -4
- package/src/lib/testing/integration.ts +0 -5
- package/src/mercato.ts +1 -26
- package/dist/agentic/guides/ai-workflows.md +0 -76
- package/dist/agentic/guides/architecture.md +0 -107
- package/dist/agentic/guides/backend-ui.md +0 -80
- package/dist/agentic/guides/contracts.md +0 -92
- package/dist/agentic/guides/extensions.md +0 -121
- package/dist/agentic/guides/framework-extension-points.md +0 -36
- package/dist/agentic/guides/integrations.md +0 -81
- package/dist/agentic/guides/modules/design_system.md +0 -102
- package/dist/agentic/guides/spec-delivery.md +0 -22
- package/dist/agentic/guides/testing-debugging.md +0 -80
- package/dist/agentic/guides/upstream/AGENTS.md +0 -298
- package/dist/agentic/guides/upstream/BACKWARD_COMPATIBILITY.md +0 -316
- package/dist/agentic/guides/upstream/manifest.json +0 -8
- package/dist/agentic/shared/ai/harness/README.md +0 -50
- package/dist/agentic/shared/ai/harness/RELEASE.md +0 -57
- package/dist/agentic/shared/ai/harness/cases.json +0 -13680
- package/dist/agentic/shared/ai/harness/cases.schema.json +0 -133
- package/dist/agentic/shared/ai/harness/fixtures/index.json +0 -49
- package/dist/agentic/shared/ai/harness/fixtures/seeds.json +0 -162
- package/dist/agentic/shared/ai/harness/generated-code-review-policy.md +0 -21
- package/dist/agentic/shared/ai/harness/generated-code-review-response.schema.json +0 -96
- package/dist/agentic/shared/ai/harness/generated-code-review-result.schema.json +0 -172
- package/dist/agentic/shared/ai/harness/release-matrix.json +0 -158
- package/dist/agentic/shared/ai/harness/release-result.schema.json +0 -219
- package/dist/agentic/shared/ai/harness/result.schema.json +0 -76
- package/dist/agentic/shared/ai/harness/routing-response.schema.json +0 -12
- package/dist/agentic/shared/ai/harness/target-validation-result.schema.json +0 -73
- package/dist/agentic/shared/ai/harness/validators.json +0 -78
- package/dist/agentic/shared/ai/harness/writable-ast-oracles.mjs +0 -2121
- package/dist/agentic/shared/ai/harness/writable-behavior-oracles.mjs +0 -1096
- package/dist/agentic/shared/ai/lessons/_template.md +0 -16
- package/dist/agentic/shared/ai/review-checklist.md +0 -36
- package/dist/agentic/shared/ai/skills/om-auto-implement-spec/SKILL.md +0 -21
- package/dist/agentic/shared/ai/skills/om-auto-upgrade-0.6.6-to-0.6.7/SKILL.md +0 -98
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/crud-surfaces.md +0 -16
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/frontend-and-design-system.md +0 -53
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/page-and-navigation.md +0 -13
- package/dist/agentic/shared/ai/skills/om-backend-ui-design/references/quality-states.md +0 -11
- package/dist/agentic/shared/ai/skills/om-build-workflow/SKILL.md +0 -30
- package/dist/agentic/shared/ai/skills/om-build-workflow/references/activity-contracts.md +0 -12
- package/dist/agentic/shared/ai/skills/om-build-workflow/references/durability-and-progress.md +0 -13
- package/dist/agentic/shared/ai/skills/om-build-workflow/references/workflow-design.md +0 -14
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/SKILL.md +0 -28
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/references/attachments-and-overrides.md +0 -12
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/references/module-agents-and-tools.md +0 -22
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/references/orchestrator-agents.md +0 -12
- package/dist/agentic/shared/ai/skills/om-create-ai-agent/references/surface-selector.md +0 -19
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/integrity-and-concurrency.md +0 -19
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/migration-workflow.md +0 -13
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/schema-design.md +0 -14
- package/dist/agentic/shared/ai/skills/om-data-model-design/references/sensitive-data.md +0 -10
- package/dist/agentic/shared/ai/skills/om-eject-and-customize/references/decision-and-procedure.md +0 -17
- package/dist/agentic/shared/ai/skills/om-evolve-harness/SKILL.md +0 -29
- package/dist/agentic/shared/ai/skills/om-evolve-harness/references/case-template.md +0 -100
- package/dist/agentic/shared/ai/skills/om-evolve-harness/references/case-workflow.md +0 -16
- package/dist/agentic/shared/ai/skills/om-evolve-harness/references/owner-selection.md +0 -17
- package/dist/agentic/shared/ai/skills/om-framework-context/SKILL.md +0 -25
- package/dist/agentic/shared/ai/skills/om-framework-context/references/resolver-procedure.md +0 -11
- package/dist/agentic/shared/ai/skills/om-framework-context/references/skew-and-escalation.md +0 -13
- package/dist/agentic/shared/ai/skills/om-help/references/delivery-workflows.md +0 -18
- package/dist/agentic/shared/ai/skills/om-help/references/task-families.md +0 -20
- package/dist/agentic/shared/ai/skills/om-implement-spec/references/phases-and-gates.md +0 -33
- package/dist/agentic/shared/ai/skills/om-implement-spec/references/planning-and-progress.md +0 -40
- package/dist/agentic/shared/ai/skills/om-implement-spec/references/report-templates.md +0 -27
- package/dist/agentic/shared/ai/skills/om-implement-spec/references/spec-resolution.md +0 -24
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/package-and-activation.md +0 -16
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/provider-families.md +0 -14
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/security-and-reliability.md +0 -15
- package/dist/agentic/shared/ai/skills/om-integration-builder/references/sync-and-files.md +0 -12
- package/dist/agentic/shared/ai/skills/om-judge-agent-session/SKILL.md +0 -34
- package/dist/agentic/shared/ai/skills/om-judge-agent-session/agents/openai.yaml +0 -4
- package/dist/agentic/shared/ai/skills/om-judge-agent-session/references/agentic-setup.md +0 -11
- package/dist/agentic/shared/ai/skills/om-judge-agent-session/references/input-normalization.md +0 -31
- package/dist/agentic/shared/ai/skills/om-judge-agent-session/references/judge-workflow.md +0 -39
- package/dist/agentic/shared/ai/skills/om-judge-agent-session/references/report-template.md +0 -43
- package/dist/agentic/shared/ai/skills/om-judge-agent-session/references/rules.md +0 -11
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/api-and-domain.md +0 -19
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/business-one-shot-blueprints.md +0 -172
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/data-and-migrations.md +0 -12
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/discovery-surface-catalog.md +0 -83
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/module-surfaces.md +0 -21
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/planning.md +0 -11
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/runtime-cache-and-queues.md +0 -22
- package/dist/agentic/shared/ai/skills/om-module-scaffold/references/verification.md +0 -13
- package/dist/agentic/shared/ai/skills/om-share-this-session/SKILL.md +0 -41
- package/dist/agentic/shared/ai/skills/om-share-this-session/references/agentic-setup.md +0 -19
- package/dist/agentic/shared/ai/skills/om-share-this-session/references/bundle-preparation.md +0 -44
- package/dist/agentic/shared/ai/skills/om-share-this-session/references/consent-and-review.md +0 -39
- package/dist/agentic/shared/ai/skills/om-share-this-session/references/publication.md +0 -20
- package/dist/agentic/shared/ai/skills/om-share-this-session/references/report-templates.md +0 -57
- package/dist/agentic/shared/ai/skills/om-share-this-session/references/rules.md +0 -11
- package/dist/agentic/shared/ai/skills/om-share-this-session/scripts/prepare-share-bundle.mjs +0 -486
- package/dist/agentic/shared/ai/skills/om-system-extension/references/extension-branches.md +0 -18
- package/dist/agentic/shared/ai/skills/om-system-extension/references/mechanism-selector.md +0 -27
- package/dist/agentic/shared/ai/skills/om-system-extension/references/read-write-roundtrip.md +0 -13
- package/dist/agentic/shared/ai/skills/om-system-extension/references/unified-overrides.md +0 -41
- package/dist/agentic/shared/ai/skills/om-system-extension/references/verification.md +0 -11
- package/dist/agentic/shared/ai/skills/om-trim-unused-modules/references/dependency-and-redirect.md +0 -15
- package/dist/agentic/shared/ai/skills/om-troubleshooter/references/diagnosis-map.md +0 -16
- package/dist/agentic/shared/ai/skills/om-troubleshooter/references/regression-oracles.md +0 -14
- package/dist/agentic/shared/scripts/agent-harness-tool-server.mjs +0 -187
- package/dist/agentic/shared/scripts/check-lessons.mjs +0 -178
- package/dist/agentic/shared/scripts/evaluate-agent-harness.mjs +0 -2958
- package/dist/agentic/shared/scripts/execution-sandbox.mjs +0 -329
- package/dist/agentic/shared/scripts/framework-context.mjs +0 -888
- package/dist/agentic/shared/scripts/install-skills.mjs +0 -1029
- package/dist/agentic/shared/scripts/prepare-agent-harness-fixture.mjs +0 -222
- package/dist/agentic/shared/scripts/run-agent-harness-release.mjs +0 -1774
- package/dist/lib/generators/module-extension-facts.js +0 -1840
- package/dist/lib/generators/module-extension-facts.js.map +0 -7
- package/dist/lib/generators/module-fact-sources.js +0 -70
- package/dist/lib/generators/module-fact-sources.js.map +0 -7
- package/dist/lib/generators/module-override-targets.js +0 -688
- package/dist/lib/generators/module-override-targets.js.map +0 -7
- package/dist/lib/load-env.js +0 -24
- package/dist/lib/load-env.js.map +0 -7
- package/dist/lib/telemetry-init.js +0 -358
- package/dist/lib/telemetry-init.js.map +0 -7
- package/src/lib/__tests__/agentic-setup.ownership.test.ts +0 -386
- package/src/lib/__tests__/injection-widget-id-validation.test.ts +0 -184
- package/src/lib/__tests__/load-env.test.ts +0 -65
- package/src/lib/__tests__/telemetry-init.test.ts +0 -298
- package/src/lib/generators/__tests__/activation-adapter-coverage.test.ts +0 -92
- package/src/lib/generators/__tests__/module-extension-activations.test.ts +0 -762
- package/src/lib/generators/__tests__/module-extension-facts.test.ts +0 -404
- package/src/lib/generators/__tests__/module-facts.extension-hosts.test.ts +0 -108
- package/src/lib/generators/__tests__/module-facts.owned-contracts.test.ts +0 -561
- package/src/lib/generators/__tests__/module-facts.source-links.test.ts +0 -119
- package/src/lib/generators/__tests__/module-override-targets.roundtrip.test.ts +0 -149
- package/src/lib/generators/__tests__/module-override-targets.test.ts +0 -304
- package/src/lib/generators/module-extension-facts.ts +0 -2365
- package/src/lib/generators/module-fact-sources.ts +0 -108
- package/src/lib/generators/module-override-targets.ts +0 -863
- package/src/lib/load-env.ts +0 -30
- package/src/lib/telemetry-init.ts +0 -461
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs'
|
|
2
2
|
import path from 'node:path'
|
|
3
|
-
import { extractAllModuleFacts
|
|
3
|
+
import { extractAllModuleFacts } from '../module-facts'
|
|
4
4
|
import { discoverPackageModuleSources } from '../module-facts-discovery'
|
|
5
5
|
import { createResolver } from '../../resolver'
|
|
6
6
|
|
|
@@ -20,77 +20,7 @@ function isUnique(values: string[]): boolean {
|
|
|
20
20
|
describe('module-facts BC resolve guard (T2)', () => {
|
|
21
21
|
const repoRoot = findRepoRoot()
|
|
22
22
|
const sources = discoverPackageModuleSources(createResolver(repoRoot))
|
|
23
|
-
const
|
|
24
|
-
const { factsByModule, markdownByModule, frameworkMarkdown } = extractAllModuleFacts({ sources })
|
|
25
|
-
const extractionCpuUsage = process.cpuUsage(extractionStartedAt)
|
|
26
|
-
const extractionCpuDurationMs = (extractionCpuUsage.user + extractionCpuUsage.system) / 1_000
|
|
27
|
-
|
|
28
|
-
it('emits complete, deterministic extension catalogs for every resolved module', () => {
|
|
29
|
-
const repeated = extractAllModuleFacts({ sources })
|
|
30
|
-
expect(renderModuleFactsJson(repeated.factsByModule)).toBe(renderModuleFactsJson(factsByModule))
|
|
31
|
-
expect(repeated.markdownByModule).toEqual(markdownByModule)
|
|
32
|
-
expect(repeated.frameworkMarkdown).toBe(frameworkMarkdown)
|
|
33
|
-
for (const facts of Object.values(factsByModule)) {
|
|
34
|
-
expect(facts.extensionSurfaces).toBeDefined()
|
|
35
|
-
expect(facts.extensionSurfaces?.unresolved).toEqual([])
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
it('keeps generated extension facts within bounded build-time and context budgets', () => {
|
|
40
|
-
const completeJson = renderModuleFactsJson(factsByModule)
|
|
41
|
-
const legacyJson = renderModuleFactsJson(Object.fromEntries(
|
|
42
|
-
Object.entries(factsByModule).map(([moduleId, facts]) => [moduleId, { ...facts, extensionSurfaces: undefined }]),
|
|
43
|
-
))
|
|
44
|
-
const markdownBytes = Object.values(markdownByModule)
|
|
45
|
-
.reduce((total, markdown) => total + Buffer.byteLength(markdown), Buffer.byteLength(frameworkMarkdown))
|
|
46
|
-
|
|
47
|
-
// Budget raised by the bidirectional-topology spec
|
|
48
|
-
// (2026-08-02-module-facts-extension-activation-and-incoming-index): the
|
|
49
|
-
// additive `activations`, cross-module `incoming`, and per-contribution
|
|
50
|
-
// `contributionResolutions` layers add ~210KB of compact references (no
|
|
51
|
-
// contribution payloads are duplicated). Incoming rows are cross-module only;
|
|
52
|
-
// resolution rows are required one-per-contribution by the spec's acceptance
|
|
53
|
-
// criteria and are the dominant term.
|
|
54
|
-
//
|
|
55
|
-
// JSON cap raised again by the exact-override-targets spec
|
|
56
|
-
// (2026-08-02-module-facts-exact-override-targets): the additive per-module
|
|
57
|
-
// `overrideTargets` project one exact key per real override entry (acl
|
|
58
|
-
// features, di tokens, subscribers, pages, workers, encryption, widgets,
|
|
59
|
-
// notifications, cli, setup, ai, interceptors/enrichers, page guards). These
|
|
60
|
-
// are required exhaustively by the spec's acceptance criteria; targets carry
|
|
61
|
-
// only compact structured path/key/factRef/source refs (no runtime values or
|
|
62
|
-
// contribution payloads). The delta cap is unchanged because `overrideTargets`
|
|
63
|
-
// live in both the complete and legacy renders (only `extensionSurfaces` is
|
|
64
|
-
// stripped for the legacy comparison).
|
|
65
|
-
//
|
|
66
|
-
// JSON cap raised a third time by the uniform provenance index
|
|
67
|
-
// (2026-08-02-module-facts-source-provenance-and-contract-inventory): every
|
|
68
|
-
// proven `(kind, id)` now reaches `factSources` (~630KB across the repo), so a
|
|
69
|
-
// consumer resolves any fact's origin through one lookup. Entries whose
|
|
70
|
-
// declaration site is already serialized inline (routes, pages, CLI commands,
|
|
71
|
-
// AI tools/agents, owned contracts, hosts, contributions) emit a typed
|
|
72
|
-
// `factRef` pointer instead of a duplicated source ref, and `factKey` is
|
|
73
|
-
// omitted when it equals the entry `id` — so the index costs references, never
|
|
74
|
-
// copied provenance payloads. The cap also covers the newly reachable
|
|
75
|
-
// framework-host activations (dashboard/menu/notification contributions now
|
|
76
|
-
// resolve as bound instead of silently falling back to capability-only).
|
|
77
|
-
// This is a blow-up detector, not a performance target. It measures CPU time
|
|
78
|
-
// for a whole-repo extraction, and CPU time for fixed work varies with the
|
|
79
|
-
// machine: the same extraction measures ~7.3s on a developer workstation and
|
|
80
|
-
// ~30.0s on a CI runner. At the previous 30s cap CI sat exactly on the line
|
|
81
|
-
// (an observed failure at 30,052.8ms), so the guard could not tell a genuine
|
|
82
|
-
// pathological regression from ordinary hardware variance and failed
|
|
83
|
-
// unrelated PRs at random. 90s keeps it meaningful — a real blow-up here is
|
|
84
|
-
// multiplicative, not a few percent — while leaving CI roughly 3x headroom.
|
|
85
|
-
expect(extractionCpuDurationMs).toBeLessThan(90_000)
|
|
86
|
-
expect(Buffer.byteLength(completeJson)).toBeLessThan(3_500_000)
|
|
87
|
-
expect(Buffer.byteLength(completeJson) - Buffer.byteLength(legacyJson)).toBeLessThan(1_800_000)
|
|
88
|
-
// Markdown cap raised with the source-link contract: entities, events, ACL
|
|
89
|
-
// features, DI tokens, search entities, notifications, UMES hosts and UMES
|
|
90
|
-
// contributions all render a resolved Source cell, and contribution
|
|
91
|
-
// resolutions render as their own source-linked section.
|
|
92
|
-
expect(markdownBytes).toBeLessThan(1_550_000)
|
|
93
|
-
})
|
|
23
|
+
const { factsByModule } = extractAllModuleFacts({ sources })
|
|
94
24
|
|
|
95
25
|
it('discovers a superset of the historical core modules', () => {
|
|
96
26
|
const discovered = new Set(Object.keys(factsByModule))
|
|
@@ -100,27 +30,11 @@ describe('module-facts BC resolve guard (T2)', () => {
|
|
|
100
30
|
expect(discovered.size).toBeGreaterThan(9)
|
|
101
31
|
})
|
|
102
32
|
|
|
103
|
-
it('keeps factory-built and generated-registry enricher contributions visible', () => {
|
|
104
|
-
expect(factsByModule.sales.extensionSurfaces?.contributions).toEqual(expect.arrayContaining([
|
|
105
|
-
expect.objectContaining({ id: 'sales.catalog-image:sales:sales_quote_line', kind: 'response-enricher' }),
|
|
106
|
-
expect.objectContaining({ id: 'sales.catalog-image:sales:sales_order_line', kind: 'response-enricher' }),
|
|
107
|
-
]))
|
|
108
|
-
expect(factsByModule.wms.extensionSurfaces?.contributions).toEqual(expect.arrayContaining([
|
|
109
|
-
expect.objectContaining({ id: 'wms.sales-order-inventory', kind: 'response-enricher' }),
|
|
110
|
-
]))
|
|
111
|
-
})
|
|
112
|
-
|
|
113
33
|
for (const source of sources) {
|
|
114
34
|
const moduleId = source.moduleId
|
|
115
35
|
describe(`${moduleId}`, () => {
|
|
116
36
|
const facts = factsByModule[moduleId]
|
|
117
37
|
|
|
118
|
-
it('stamps the exact providing package and version without removing coreVersion', () => {
|
|
119
|
-
expect(facts.sourcePackage).toBe(source.from ?? null)
|
|
120
|
-
expect(facts.sourceVersion).toBe(source.packageVersion ?? null)
|
|
121
|
-
expect(facts).toHaveProperty('coreVersion')
|
|
122
|
-
})
|
|
123
|
-
|
|
124
38
|
// Entity / search / host ids are colon-namespaced under the module by construction
|
|
125
39
|
// and convention; drift here means the builder or a module's data model broke.
|
|
126
40
|
it('colon-namespaces entity / search / host ids under the module and keeps ids unique', () => {
|
|
@@ -52,7 +52,6 @@ describe('module-facts customers fixture (T1 anti-drift guard)', () => {
|
|
|
52
52
|
'customers.companies.list',
|
|
53
53
|
'customers.deals.list',
|
|
54
54
|
'customers.people.list',
|
|
55
|
-
'customers.todos.list',
|
|
56
55
|
])
|
|
57
56
|
expect(facts.hostTokens.entityIds).toEqual(['customers:customer_entity'])
|
|
58
57
|
expect(facts.diTokens).toEqual([])
|
|
@@ -4,13 +4,11 @@ import path from 'node:path'
|
|
|
4
4
|
import type { PackageResolver } from '../../resolver'
|
|
5
5
|
import { discoverPackageModuleSources, hasReadableModuleSource } from '../module-facts-discovery'
|
|
6
6
|
|
|
7
|
-
type FakePackage = { name: string;
|
|
8
|
-
type FakeModuleEntry = { id: string; from?: string }
|
|
7
|
+
type FakePackage = { name: string; path: string; modulesPath: string }
|
|
9
8
|
|
|
10
|
-
function makeResolver(packages: FakePackage[]
|
|
9
|
+
function makeResolver(packages: FakePackage[]): PackageResolver {
|
|
11
10
|
return {
|
|
12
11
|
discoverPackages: () => packages,
|
|
13
|
-
loadEnabledModules: () => enabledModules,
|
|
14
12
|
} as unknown as PackageResolver
|
|
15
13
|
}
|
|
16
14
|
|
|
@@ -64,69 +62,27 @@ describe('module-facts discovery (T1)', () => {
|
|
|
64
62
|
writeModule(path.join(pkgSrc, 'src', 'modules'), 'gamma', 'events.ts')
|
|
65
63
|
|
|
66
64
|
const resolver = makeResolver([
|
|
67
|
-
{ name: '@open-mercato/tagged',
|
|
65
|
+
{ name: '@open-mercato/tagged', path: pkgSrc, modulesPath: path.join(pkgSrc, 'src', 'modules') },
|
|
68
66
|
])
|
|
69
67
|
|
|
70
68
|
const [source] = discoverPackageModuleSources(resolver)
|
|
71
|
-
expect(source).toMatchObject({
|
|
72
|
-
moduleId: 'gamma',
|
|
73
|
-
from: '@open-mercato/tagged',
|
|
74
|
-
packageVersion: '0.6.6',
|
|
75
|
-
})
|
|
69
|
+
expect(source).toMatchObject({ moduleId: 'gamma', from: '@open-mercato/tagged' })
|
|
76
70
|
expect(source.moduleRoot).toBe(path.join(pkgSrc, 'src', 'modules', 'gamma'))
|
|
77
71
|
})
|
|
78
72
|
|
|
79
|
-
it('
|
|
73
|
+
it('dedupes duplicate module ids first-wins', () => {
|
|
80
74
|
const pkgA = path.join(tmp, 'dup-a')
|
|
81
75
|
writeModule(path.join(pkgA, 'src', 'modules'), 'shared', 'index.ts')
|
|
82
76
|
const pkgB = path.join(tmp, 'dup-b')
|
|
83
77
|
writeModule(path.join(pkgB, 'src', 'modules'), 'shared', 'index.ts')
|
|
84
78
|
|
|
85
|
-
const
|
|
86
|
-
{ name: '@open-mercato/dup-a', path: pkgA, modulesPath: path.join(pkgA, 'src', 'modules') },
|
|
87
|
-
{ name: '@open-mercato/dup-b', path: pkgB, modulesPath: path.join(pkgB, 'src', 'modules') },
|
|
88
|
-
]
|
|
89
|
-
const expected = '[module-facts] duplicate module id "shared" is provided by '
|
|
90
|
-
+ '@open-mercato/dup-a, @open-mercato/dup-b; src/modules.ts does not select a provider. '
|
|
91
|
-
+ 'Select exactly one matching provider in src/modules.ts.'
|
|
92
|
-
|
|
93
|
-
expect(() => discoverPackageModuleSources(makeResolver(packages))).toThrow(expected)
|
|
94
|
-
expect(() => discoverPackageModuleSources(makeResolver([...packages].reverse()))).toThrow(expected)
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
it('uses the exact src/modules.ts provider even when package discovery order is reversed', () => {
|
|
98
|
-
const pkgA = path.join(tmp, 'selected-a')
|
|
99
|
-
writeModule(path.join(pkgA, 'src', 'modules'), 'shared', 'index.ts')
|
|
100
|
-
const pkgB = path.join(tmp, 'selected-b')
|
|
101
|
-
writeModule(path.join(pkgB, 'src', 'modules'), 'shared', 'index.ts')
|
|
102
|
-
|
|
103
|
-
const packages = [
|
|
104
|
-
{ name: '@open-mercato/selected-a', path: pkgA, modulesPath: path.join(pkgA, 'src', 'modules') },
|
|
105
|
-
{ name: '@open-mercato/selected-b', path: pkgB, modulesPath: path.join(pkgB, 'src', 'modules') },
|
|
106
|
-
]
|
|
107
|
-
const enabled = [{ id: 'shared', from: '@open-mercato/selected-b' }]
|
|
108
|
-
|
|
109
|
-
for (const discoveredPackages of [packages, [...packages].reverse()]) {
|
|
110
|
-
const sources = discoverPackageModuleSources(makeResolver(discoveredPackages, enabled))
|
|
111
|
-
expect(sources).toHaveLength(1)
|
|
112
|
-
expect(sources[0]).toMatchObject({ moduleId: 'shared', from: '@open-mercato/selected-b' })
|
|
113
|
-
expect(sources[0].moduleRoot).toBe(path.join(pkgB, 'src', 'modules', 'shared'))
|
|
114
|
-
}
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
it('explains that an omitted provider implicitly selects core', () => {
|
|
118
|
-
const pkgA = path.join(tmp, 'implicit-a')
|
|
119
|
-
writeModule(path.join(pkgA, 'src', 'modules'), 'shared', 'index.ts')
|
|
120
|
-
const pkgB = path.join(tmp, 'implicit-b')
|
|
121
|
-
writeModule(path.join(pkgB, 'src', 'modules'), 'shared', 'index.ts')
|
|
122
|
-
|
|
123
|
-
const packages = [
|
|
79
|
+
const resolver = makeResolver([
|
|
124
80
|
{ name: '@open-mercato/dup-a', path: pkgA, modulesPath: path.join(pkgA, 'src', 'modules') },
|
|
125
81
|
{ name: '@open-mercato/dup-b', path: pkgB, modulesPath: path.join(pkgB, 'src', 'modules') },
|
|
126
|
-
]
|
|
82
|
+
])
|
|
127
83
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
)
|
|
84
|
+
const sources = discoverPackageModuleSources(resolver)
|
|
85
|
+
expect(sources).toHaveLength(1)
|
|
86
|
+
expect(sources[0].moduleRoot).toBe(path.join(pkgA, 'src', 'modules', 'shared'))
|
|
131
87
|
})
|
|
132
88
|
})
|
|
@@ -702,24 +702,6 @@ export function GET() {
|
|
|
702
702
|
expect(output).toContain('features:')
|
|
703
703
|
})
|
|
704
704
|
|
|
705
|
-
it('normalizes singular app-owned integration exports without requiring plural properties', async () => {
|
|
706
|
-
touchFile(
|
|
707
|
-
path.join(tmpDir, 'app', 'src', 'modules', 'mailbox', 'integration.ts'),
|
|
708
|
-
"export const integration = { id: 'mailbox' }\nexport default integration\n",
|
|
709
|
-
)
|
|
710
|
-
const resolver = createMockResolver(tmpDir, [{ id: 'mailbox', from: '@app' }])
|
|
711
|
-
const result = await generateModuleRegistry({ resolver, quiet: true })
|
|
712
|
-
|
|
713
|
-
expect(result.errors).toEqual([])
|
|
714
|
-
for (const file of ['modules.generated.ts', 'modules.runtime.generated.ts']) {
|
|
715
|
-
const output = readGenerated(tmpDir, file)!
|
|
716
|
-
expect(output).toContain('as unknown as { integrations?:')
|
|
717
|
-
expect(output).toContain('.integration ? [')
|
|
718
|
-
expect(output).not.toMatch(/INTEGRATION_[A-Za-z0-9_]+\.integrations/)
|
|
719
|
-
expect(output).not.toMatch(/INTEGRATION_[A-Za-z0-9_]+\.bundles/)
|
|
720
|
-
}
|
|
721
|
-
})
|
|
722
|
-
|
|
723
705
|
it('escapes generated module specifiers for lazy imports', async () => {
|
|
724
706
|
touchFile(
|
|
725
707
|
path.join(tmpDir, 'packages', 'core', 'src', 'modules', 'safe_mod', 'subscribers', `o'hare.ts`),
|
|
@@ -183,52 +183,9 @@ function resolveScannedWidgetPath(roots: ModuleRoots, fromApp: boolean, relPath:
|
|
|
183
183
|
return path.join(base, 'widgets', 'injection', ...relPath.split('/'))
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
/**
|
|
187
|
-
* A widget's `metadata.id` and the injection-table entry that mounts it are two hand-typed string
|
|
188
|
-
* literals in two different files, and nothing links them. A typo in either fails silently: the spot
|
|
189
|
-
* resolves to no widget and nothing is logged, so it only surfaces as "why isn't my widget
|
|
190
|
-
* rendering" during manual QA.
|
|
191
|
-
*
|
|
192
|
-
* Reports table entries whose `widgetId` no scanned widget declares. Diagnostics only — generated
|
|
193
|
-
* output is unchanged and the build is not failed, since a table entry may legitimately point at a
|
|
194
|
-
* widget supplied by a module that is not enabled in this app.
|
|
195
|
-
*
|
|
196
|
-
* Deliberately one-directional. The mirror check ("a widget nothing references is never mounted")
|
|
197
|
-
* cannot be done reliably yet: `extractInjectionTableWidgetIds` only reads statically-analyzable
|
|
198
|
-
* object literals, so a table assembled by composition or computation contributes **no** visible
|
|
199
|
-
* ids — `example` exports `cond ? { ...a, ...b } : a` and `translations` exports
|
|
200
|
-
* `buildInjectionTable()`, and both would have every one of their widgets reported as unreferenced.
|
|
201
|
-
* Under-reporting is harmless in the direction implemented here (a reference the extractor never saw
|
|
202
|
-
* cannot produce a warning) but fatal in the other. Teaching the extractor to resolve spreads,
|
|
203
|
-
* conditionals and call expressions is the prerequisite for adding it.
|
|
204
|
-
*/
|
|
205
|
-
function reportUnresolvableWidgetReferences(
|
|
206
|
-
widgetEntries: Map<string, InjectionWidgetEntry>,
|
|
207
|
-
tableWidgetRefs: Map<string, Set<string>>,
|
|
208
|
-
): void {
|
|
209
|
-
const declaredIds = new Set<string>()
|
|
210
|
-
for (const entry of widgetEntries.values()) {
|
|
211
|
-
if (entry.widgetId) declaredIds.add(entry.widgetId)
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
for (const [widgetId, modules] of Array.from(tableWidgetRefs.entries()).sort(([a], [b]) => a.localeCompare(b))) {
|
|
215
|
-
if (declaredIds.has(widgetId)) continue
|
|
216
|
-
const owners = Array.from(modules).sort((left, right) => left.localeCompare(right)).join(', ')
|
|
217
|
-
console.warn(
|
|
218
|
-
`[generate] ⚠ Injection table in "${owners}" references widget id "${widgetId}", but no scanned ` +
|
|
219
|
-
'widget declares it — that spot will render nothing. Check the id against the widget\'s ' +
|
|
220
|
-
'metadata.id, and that the widget lives in a file the scanner reads ' +
|
|
221
|
-
'(widgets/injection/**/widget.ts|tsx — note that widget.client.tsx alone is not scanned).',
|
|
222
|
-
)
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
186
|
export function createInjectionWidgetsExtension(): GeneratorExtension {
|
|
227
187
|
const widgetEntries = new Map<string, InjectionWidgetEntry>()
|
|
228
188
|
const tableEntries: InjectionTableEntry[] = []
|
|
229
|
-
// widgetId -> module ids whose injection table references it. Collected across every module so a
|
|
230
|
-
// table may legitimately reference a widget another module owns.
|
|
231
|
-
const tableWidgetRefs = new Map<string, Set<string>>()
|
|
232
189
|
|
|
233
190
|
return {
|
|
234
191
|
id: 'registry.injection-widgets',
|
|
@@ -260,12 +217,6 @@ export function createInjectionWidgetsExtension(): GeneratorExtension {
|
|
|
260
217
|
moduleWidgetEntries[0].widgetId = tableWidgetIds[0]
|
|
261
218
|
}
|
|
262
219
|
|
|
263
|
-
for (const widgetId of tableWidgetIds) {
|
|
264
|
-
const modules = tableWidgetRefs.get(widgetId) ?? new Set<string>()
|
|
265
|
-
modules.add(ctx.moduleId)
|
|
266
|
-
tableWidgetRefs.set(widgetId, modules)
|
|
267
|
-
}
|
|
268
|
-
|
|
269
220
|
for (const entry of moduleWidgetEntries) {
|
|
270
221
|
const existing = widgetEntries.get(entry.key)
|
|
271
222
|
if (!existing || (existing.source !== 'app' && entry.source === 'app')) {
|
|
@@ -282,8 +233,6 @@ export function createInjectionWidgetsExtension(): GeneratorExtension {
|
|
|
282
233
|
}
|
|
283
234
|
},
|
|
284
235
|
generateOutput() {
|
|
285
|
-
reportUnresolvableWidgetReferences(widgetEntries, tableWidgetRefs)
|
|
286
|
-
|
|
287
236
|
const widgetDecls = Array.from(widgetEntries.entries())
|
|
288
237
|
.sort(([left], [right]) => left.localeCompare(right))
|
|
289
238
|
.map(([, entry]) =>
|
|
@@ -29,59 +29,13 @@ export function hasReadableModuleSource(moduleRoot: string): boolean {
|
|
|
29
29
|
return false
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
resolver: PackageResolver,
|
|
35
|
-
): ModuleFactSource[] {
|
|
36
|
-
const sourcesByModule = new Map<string, ModuleFactSource[]>()
|
|
37
|
-
for (const source of sources) {
|
|
38
|
-
const matches = sourcesByModule.get(source.moduleId) ?? []
|
|
39
|
-
matches.push(source)
|
|
40
|
-
sourcesByModule.set(source.moduleId, matches)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const duplicates = [...sourcesByModule.entries()].filter(([, matches]) => matches.length > 1)
|
|
44
|
-
if (duplicates.length === 0) return sources
|
|
45
|
-
|
|
46
|
-
const selectedProviders = new Map<string, Set<string>>()
|
|
47
|
-
const implicitCoreSelections = new Set<string>()
|
|
48
|
-
for (const entry of resolver.loadEnabledModules()) {
|
|
49
|
-
const providers = selectedProviders.get(entry.id) ?? new Set<string>()
|
|
50
|
-
providers.add(entry.from ?? '@open-mercato/core')
|
|
51
|
-
selectedProviders.set(entry.id, providers)
|
|
52
|
-
if (entry.from === undefined) implicitCoreSelections.add(entry.id)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const selectedSources = new Map<string, ModuleFactSource>()
|
|
56
|
-
for (const [moduleId, matches] of duplicates) {
|
|
57
|
-
const providers = [...new Set(matches.map((source) => source.from ?? '<unknown>'))]
|
|
58
|
-
.sort((left, right) => left.localeCompare(right))
|
|
59
|
-
const configuredProviders = [...(selectedProviders.get(moduleId) ?? [])]
|
|
60
|
-
.sort((left, right) => left.localeCompare(right))
|
|
61
|
-
const selected = configuredProviders.length === 1
|
|
62
|
-
? matches.filter((source) => source.from === configuredProviders[0])
|
|
63
|
-
: []
|
|
64
|
-
|
|
65
|
-
if (selected.length !== 1) {
|
|
66
|
-
const configured = configuredProviders.length > 0
|
|
67
|
-
? implicitCoreSelections.has(moduleId)
|
|
68
|
-
? '; src/modules.ts omits "from", which defaults to @open-mercato/core'
|
|
69
|
-
: `; src/modules.ts selects ${configuredProviders.join(', ')}`
|
|
70
|
-
: '; src/modules.ts does not select a provider'
|
|
71
|
-
throw new Error(
|
|
72
|
-
`[module-facts] duplicate module id "${moduleId}" is provided by ${providers.join(', ')}${configured}. `
|
|
73
|
-
+ 'Select exactly one matching provider in src/modules.ts.',
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
selectedSources.set(moduleId, selected[0])
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const emitted = new Set<string>()
|
|
32
|
+
function dedupeById(sources: ModuleFactSource[]): ModuleFactSource[] {
|
|
33
|
+
const seen = new Set<string>()
|
|
80
34
|
const result: ModuleFactSource[] = []
|
|
81
35
|
for (const source of sources) {
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
result.push(
|
|
36
|
+
if (seen.has(source.moduleId)) continue
|
|
37
|
+
seen.add(source.moduleId)
|
|
38
|
+
result.push(source)
|
|
85
39
|
}
|
|
86
40
|
return result
|
|
87
41
|
}
|
|
@@ -97,13 +51,8 @@ export function discoverPackageModuleSources(resolver: PackageResolver): ModuleF
|
|
|
97
51
|
for (const discovered of discoverModulesInPackage(pkg.path)) {
|
|
98
52
|
const moduleRoot = path.join(pkg.modulesPath, discovered.moduleId)
|
|
99
53
|
if (!hasReadableModuleSource(moduleRoot)) continue
|
|
100
|
-
sources.push({
|
|
101
|
-
moduleId: discovered.moduleId,
|
|
102
|
-
moduleRoot,
|
|
103
|
-
from: pkg.name,
|
|
104
|
-
packageVersion: pkg.version ?? null,
|
|
105
|
-
})
|
|
54
|
+
sources.push({ moduleId: discovered.moduleId, moduleRoot, from: pkg.name })
|
|
106
55
|
}
|
|
107
56
|
}
|
|
108
|
-
return
|
|
57
|
+
return dedupeById(sources)
|
|
109
58
|
}
|