@endora-commerce/cli 0.100.0
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/LICENSE +21 -0
- package/README.md +37 -0
- package/dist/bin/endora.d.ts +28 -0
- package/dist/bin/endora.d.ts.map +1 -0
- package/dist/bin/endora.js +926 -0
- package/dist/bin/endora.js.map +1 -0
- package/dist/check/estate.d.ts +189 -0
- package/dist/check/estate.d.ts.map +1 -0
- package/dist/check/estate.js +1037 -0
- package/dist/check/estate.js.map +1 -0
- package/dist/check/hosts.d.ts +25 -0
- package/dist/check/hosts.d.ts.map +1 -0
- package/dist/check/hosts.js +1347 -0
- package/dist/check/hosts.js.map +1 -0
- package/dist/check/index.d.ts +60 -0
- package/dist/check/index.d.ts.map +1 -0
- package/dist/check/index.js +111 -0
- package/dist/check/index.js.map +1 -0
- package/dist/check/layout.d.ts +136 -0
- package/dist/check/layout.d.ts.map +1 -0
- package/dist/check/layout.js +262 -0
- package/dist/check/layout.js.map +1 -0
- package/dist/check/ledger.d.ts +98 -0
- package/dist/check/ledger.d.ts.map +1 -0
- package/dist/check/ledger.js +173 -0
- package/dist/check/ledger.js.map +1 -0
- package/dist/check/peer-owners.d.ts +116 -0
- package/dist/check/peer-owners.d.ts.map +1 -0
- package/dist/check/peer-owners.js +225 -0
- package/dist/check/peer-owners.js.map +1 -0
- package/dist/check/report.d.ts +33 -0
- package/dist/check/report.d.ts.map +1 -0
- package/dist/check/report.js +107 -0
- package/dist/check/report.js.map +1 -0
- package/dist/check/run.d.ts +147 -0
- package/dist/check/run.d.ts.map +1 -0
- package/dist/check/run.js +111 -0
- package/dist/check/run.js.map +1 -0
- package/dist/checks.d.ts +17 -0
- package/dist/checks.d.ts.map +1 -0
- package/dist/checks.js +17 -0
- package/dist/checks.js.map +1 -0
- package/dist/dev/index.d.ts +83 -0
- package/dist/dev/index.d.ts.map +1 -0
- package/dist/dev/index.js +298 -0
- package/dist/dev/index.js.map +1 -0
- package/dist/generate/divergence.d.ts +38 -0
- package/dist/generate/divergence.d.ts.map +1 -0
- package/dist/generate/divergence.js +237 -0
- package/dist/generate/divergence.js.map +1 -0
- package/dist/generate/index.d.ts +90 -0
- package/dist/generate/index.d.ts.map +1 -0
- package/dist/generate/index.js +369 -0
- package/dist/generate/index.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/inputs/declaration.d.ts +18 -0
- package/dist/inputs/declaration.d.ts.map +1 -0
- package/dist/inputs/declaration.js +64 -0
- package/dist/inputs/declaration.js.map +1 -0
- package/dist/inputs/env-file.d.ts +73 -0
- package/dist/inputs/env-file.d.ts.map +1 -0
- package/dist/inputs/env-file.js +134 -0
- package/dist/inputs/env-file.js.map +1 -0
- package/dist/inputs/prompt.d.ts +21 -0
- package/dist/inputs/prompt.d.ts.map +1 -0
- package/dist/inputs/prompt.js +59 -0
- package/dist/inputs/prompt.js.map +1 -0
- package/dist/inputs/resolve.d.ts +163 -0
- package/dist/inputs/resolve.d.ts.map +1 -0
- package/dist/inputs/resolve.js +290 -0
- package/dist/inputs/resolve.js.map +1 -0
- package/dist/install/host.d.ts +27 -0
- package/dist/install/host.d.ts.map +1 -0
- package/dist/install/host.js +90 -0
- package/dist/install/host.js.map +1 -0
- package/dist/install/index.d.ts +173 -0
- package/dist/install/index.d.ts.map +1 -0
- package/dist/install/index.js +793 -0
- package/dist/install/index.js.map +1 -0
- package/dist/install/wizard.d.ts +144 -0
- package/dist/install/wizard.d.ts.map +1 -0
- package/dist/install/wizard.js +362 -0
- package/dist/install/wizard.js.map +1 -0
- package/dist/lib/admin-artefacts.d.ts +70 -0
- package/dist/lib/admin-artefacts.d.ts.map +1 -0
- package/dist/lib/admin-artefacts.js +354 -0
- package/dist/lib/admin-artefacts.js.map +1 -0
- package/dist/lib/admin-surfaces.d.ts +298 -0
- package/dist/lib/admin-surfaces.d.ts.map +1 -0
- package/dist/lib/admin-surfaces.js +669 -0
- package/dist/lib/admin-surfaces.js.map +1 -0
- package/dist/lib/delegated-composer.d.ts +85 -0
- package/dist/lib/delegated-composer.d.ts.map +1 -0
- package/dist/lib/delegated-composer.js +241 -0
- package/dist/lib/delegated-composer.js.map +1 -0
- package/dist/lib/divergence-artefacts.d.ts +305 -0
- package/dist/lib/divergence-artefacts.d.ts.map +1 -0
- package/dist/lib/divergence-artefacts.js +828 -0
- package/dist/lib/divergence-artefacts.js.map +1 -0
- package/dist/lib/divergence.d.ts +337 -0
- package/dist/lib/divergence.d.ts.map +1 -0
- package/dist/lib/divergence.js +1005 -0
- package/dist/lib/divergence.js.map +1 -0
- package/dist/lib/docs-artefacts.d.ts +395 -0
- package/dist/lib/docs-artefacts.d.ts.map +1 -0
- package/dist/lib/docs-artefacts.js +781 -0
- package/dist/lib/docs-artefacts.js.map +1 -0
- package/dist/lib/emitted-exports.d.ts +21 -0
- package/dist/lib/emitted-exports.d.ts.map +1 -0
- package/dist/lib/emitted-exports.js +96 -0
- package/dist/lib/emitted-exports.js.map +1 -0
- package/dist/lib/emitted-freshness.d.ts +112 -0
- package/dist/lib/emitted-freshness.d.ts.map +1 -0
- package/dist/lib/emitted-freshness.js +288 -0
- package/dist/lib/emitted-freshness.js.map +1 -0
- package/dist/lib/entity-index-artefact.d.ts +95 -0
- package/dist/lib/entity-index-artefact.d.ts.map +1 -0
- package/dist/lib/entity-index-artefact.js +210 -0
- package/dist/lib/entity-index-artefact.js.map +1 -0
- package/dist/lib/instance-build-inputs.d.ts +108 -0
- package/dist/lib/instance-build-inputs.d.ts.map +1 -0
- package/dist/lib/instance-build-inputs.js +165 -0
- package/dist/lib/instance-build-inputs.js.map +1 -0
- package/dist/lib/module-docs.d.ts +473 -0
- package/dist/lib/module-docs.d.ts.map +1 -0
- package/dist/lib/module-docs.js +711 -0
- package/dist/lib/module-docs.js.map +1 -0
- package/dist/lib/module-package-subpaths.d.ts +56 -0
- package/dist/lib/module-package-subpaths.d.ts.map +1 -0
- package/dist/lib/module-package-subpaths.js +223 -0
- package/dist/lib/module-package-subpaths.js.map +1 -0
- package/dist/lib/module-packages.d.ts +200 -0
- package/dist/lib/module-packages.d.ts.map +1 -0
- package/dist/lib/module-packages.js +580 -0
- package/dist/lib/module-packages.js.map +1 -0
- package/dist/lib/module-population.d.ts +129 -0
- package/dist/lib/module-population.d.ts.map +1 -0
- package/dist/lib/module-population.js +172 -0
- package/dist/lib/module-population.js.map +1 -0
- package/dist/lib/module-roots.d.ts +337 -0
- package/dist/lib/module-roots.d.ts.map +1 -0
- package/dist/lib/module-roots.js +586 -0
- package/dist/lib/module-roots.js.map +1 -0
- package/dist/lib/nested-checkouts.d.ts +33 -0
- package/dist/lib/nested-checkouts.d.ts.map +1 -0
- package/dist/lib/nested-checkouts.js +160 -0
- package/dist/lib/nested-checkouts.js.map +1 -0
- package/dist/lib/platform-root.d.ts +43 -0
- package/dist/lib/platform-root.d.ts.map +1 -0
- package/dist/lib/platform-root.js +134 -0
- package/dist/lib/platform-root.js.map +1 -0
- package/dist/lib/platform-surface.d.ts +235 -0
- package/dist/lib/platform-surface.d.ts.map +1 -0
- package/dist/lib/platform-surface.js +393 -0
- package/dist/lib/platform-surface.js.map +1 -0
- package/dist/lib/port-registrations.d.ts +223 -0
- package/dist/lib/port-registrations.d.ts.map +1 -0
- package/dist/lib/port-registrations.js +532 -0
- package/dist/lib/port-registrations.js.map +1 -0
- package/dist/lib/read-size.d.ts +154 -0
- package/dist/lib/read-size.d.ts.map +1 -0
- package/dist/lib/read-size.js +182 -0
- package/dist/lib/read-size.js.map +1 -0
- package/dist/lib/registration-owners.d.ts +79 -0
- package/dist/lib/registration-owners.d.ts.map +1 -0
- package/dist/lib/registration-owners.js +77 -0
- package/dist/lib/registration-owners.js.map +1 -0
- package/dist/lib/release-index.d.ts +53 -0
- package/dist/lib/release-index.d.ts.map +1 -0
- package/dist/lib/release-index.js +162 -0
- package/dist/lib/release-index.js.map +1 -0
- package/dist/lib/repeating-timers.d.ts +79 -0
- package/dist/lib/repeating-timers.d.ts.map +1 -0
- package/dist/lib/repeating-timers.js +189 -0
- package/dist/lib/repeating-timers.js.map +1 -0
- package/dist/lib/source-text.d.ts +34 -0
- package/dist/lib/source-text.d.ts.map +1 -0
- package/dist/lib/source-text.js +80 -0
- package/dist/lib/source-text.js.map +1 -0
- package/dist/lib/specifiers.d.ts +20 -0
- package/dist/lib/specifiers.d.ts.map +1 -0
- package/dist/lib/specifiers.js +130 -0
- package/dist/lib/specifiers.js.map +1 -0
- package/dist/lib/sql-tables.d.ts +166 -0
- package/dist/lib/sql-tables.d.ts.map +1 -0
- package/dist/lib/sql-tables.js +464 -0
- package/dist/lib/sql-tables.js.map +1 -0
- package/dist/lib/switchable-modules.d.ts +54 -0
- package/dist/lib/switchable-modules.d.ts.map +1 -0
- package/dist/lib/switchable-modules.js +104 -0
- package/dist/lib/switchable-modules.js.map +1 -0
- package/dist/lib/tailwind-sources.d.ts +136 -0
- package/dist/lib/tailwind-sources.d.ts.map +1 -0
- package/dist/lib/tailwind-sources.js +307 -0
- package/dist/lib/tailwind-sources.js.map +1 -0
- package/dist/lib/ui-layer.d.ts +54 -0
- package/dist/lib/ui-layer.d.ts.map +1 -0
- package/dist/lib/ui-layer.js +57 -0
- package/dist/lib/ui-layer.js.map +1 -0
- package/dist/lib/workspace-packages.d.ts +186 -0
- package/dist/lib/workspace-packages.d.ts.map +1 -0
- package/dist/lib/workspace-packages.js +351 -0
- package/dist/lib/workspace-packages.js.map +1 -0
- package/dist/new-instance/deploy.d.ts +211 -0
- package/dist/new-instance/deploy.d.ts.map +1 -0
- package/dist/new-instance/deploy.js +1381 -0
- package/dist/new-instance/deploy.js.map +1 -0
- package/dist/new-instance/docs-toolchain.d.ts +66 -0
- package/dist/new-instance/docs-toolchain.d.ts.map +1 -0
- package/dist/new-instance/docs-toolchain.js +69 -0
- package/dist/new-instance/docs-toolchain.js.map +1 -0
- package/dist/new-instance/host.d.ts +124 -0
- package/dist/new-instance/host.d.ts.map +1 -0
- package/dist/new-instance/host.js +276 -0
- package/dist/new-instance/host.js.map +1 -0
- package/dist/new-instance/index.d.ts +118 -0
- package/dist/new-instance/index.d.ts.map +1 -0
- package/dist/new-instance/index.js +567 -0
- package/dist/new-instance/index.js.map +1 -0
- package/dist/new-instance/modules.d.ts +188 -0
- package/dist/new-instance/modules.d.ts.map +1 -0
- package/dist/new-instance/modules.js +392 -0
- package/dist/new-instance/modules.js.map +1 -0
- package/dist/new-instance/template.d.ts +505 -0
- package/dist/new-instance/template.d.ts.map +1 -0
- package/dist/new-instance/template.js +1886 -0
- package/dist/new-instance/template.js.map +1 -0
- package/dist/new-module/emit.d.ts +67 -0
- package/dist/new-module/emit.d.ts.map +1 -0
- package/dist/new-module/emit.js +1393 -0
- package/dist/new-module/emit.js.map +1 -0
- package/dist/new-module/host.d.ts +67 -0
- package/dist/new-module/host.d.ts.map +1 -0
- package/dist/new-module/host.js +224 -0
- package/dist/new-module/host.js.map +1 -0
- package/dist/new-module/index.d.ts +32 -0
- package/dist/new-module/index.d.ts.map +1 -0
- package/dist/new-module/index.js +193 -0
- package/dist/new-module/index.js.map +1 -0
- package/dist/new-module/spec.d.ts +188 -0
- package/dist/new-module/spec.d.ts.map +1 -0
- package/dist/new-module/spec.js +404 -0
- package/dist/new-module/spec.js.map +1 -0
- package/dist/new-module/text.d.ts +15 -0
- package/dist/new-module/text.d.ts.map +1 -0
- package/dist/new-module/text.js +22 -0
- package/dist/new-module/text.js.map +1 -0
- package/dist/new-storefront/dockerfile.d.ts +20 -0
- package/dist/new-storefront/dockerfile.d.ts.map +1 -0
- package/dist/new-storefront/dockerfile.js +131 -0
- package/dist/new-storefront/dockerfile.js.map +1 -0
- package/dist/new-storefront/gitignore.d.ts +23 -0
- package/dist/new-storefront/gitignore.d.ts.map +1 -0
- package/dist/new-storefront/gitignore.js +39 -0
- package/dist/new-storefront/gitignore.js.map +1 -0
- package/dist/new-storefront/index.d.ts +93 -0
- package/dist/new-storefront/index.d.ts.map +1 -0
- package/dist/new-storefront/index.js +329 -0
- package/dist/new-storefront/index.js.map +1 -0
- package/dist/new-storefront/npmrc.d.ts +98 -0
- package/dist/new-storefront/npmrc.d.ts.map +1 -0
- package/dist/new-storefront/npmrc.js +217 -0
- package/dist/new-storefront/npmrc.js.map +1 -0
- package/dist/new-storefront/reference.d.ts +189 -0
- package/dist/new-storefront/reference.d.ts.map +1 -0
- package/dist/new-storefront/reference.js +430 -0
- package/dist/new-storefront/reference.js.map +1 -0
- package/dist/new-storefront/rewrite.d.ts +171 -0
- package/dist/new-storefront/rewrite.d.ts.map +1 -0
- package/dist/new-storefront/rewrite.js +701 -0
- package/dist/new-storefront/rewrite.js.map +1 -0
- package/dist/release-index.json +284 -0
- package/dist/rules/action-route-permissions.d.ts +141 -0
- package/dist/rules/action-route-permissions.d.ts.map +1 -0
- package/dist/rules/action-route-permissions.js +556 -0
- package/dist/rules/action-route-permissions.js.map +1 -0
- package/dist/rules/bundle-pairing.d.ts +74 -0
- package/dist/rules/bundle-pairing.d.ts.map +1 -0
- package/dist/rules/bundle-pairing.js +281 -0
- package/dist/rules/bundle-pairing.js.map +1 -0
- package/dist/rules/channel-resolution.d.ts +17 -0
- package/dist/rules/channel-resolution.d.ts.map +1 -0
- package/dist/rules/channel-resolution.js +382 -0
- package/dist/rules/channel-resolution.js.map +1 -0
- package/dist/rules/command-coverage.d.ts +210 -0
- package/dist/rules/command-coverage.d.ts.map +1 -0
- package/dist/rules/command-coverage.js +714 -0
- package/dist/rules/command-coverage.js.map +1 -0
- package/dist/rules/container-imports.d.ts +60 -0
- package/dist/rules/container-imports.d.ts.map +1 -0
- package/dist/rules/container-imports.js +158 -0
- package/dist/rules/container-imports.js.map +1 -0
- package/dist/rules/default-language-prose.d.ts +212 -0
- package/dist/rules/default-language-prose.d.ts.map +1 -0
- package/dist/rules/default-language-prose.js +710 -0
- package/dist/rules/default-language-prose.js.map +1 -0
- package/dist/rules/diacritic-folds.d.ts +238 -0
- package/dist/rules/diacritic-folds.d.ts.map +1 -0
- package/dist/rules/diacritic-folds.js +681 -0
- package/dist/rules/diacritic-folds.js.map +1 -0
- package/dist/rules/entity-tenant-classification.d.ts +171 -0
- package/dist/rules/entity-tenant-classification.d.ts.map +1 -0
- package/dist/rules/entity-tenant-classification.js +323 -0
- package/dist/rules/entity-tenant-classification.js.map +1 -0
- package/dist/rules/entry-presence.d.ts +142 -0
- package/dist/rules/entry-presence.d.ts.map +1 -0
- package/dist/rules/entry-presence.js +339 -0
- package/dist/rules/entry-presence.js.map +1 -0
- package/dist/rules/entry-scope.d.ts +91 -0
- package/dist/rules/entry-scope.d.ts.map +1 -0
- package/dist/rules/entry-scope.js +404 -0
- package/dist/rules/entry-scope.js.map +1 -0
- package/dist/rules/env-inputs.d.ts +222 -0
- package/dist/rules/env-inputs.d.ts.map +1 -0
- package/dist/rules/env-inputs.js +951 -0
- package/dist/rules/env-inputs.js.map +1 -0
- package/dist/rules/kernel-boundary.d.ts +37 -0
- package/dist/rules/kernel-boundary.d.ts.map +1 -0
- package/dist/rules/kernel-boundary.js +195 -0
- package/dist/rules/kernel-boundary.js.map +1 -0
- package/dist/rules/nul-bytes.d.ts +233 -0
- package/dist/rules/nul-bytes.d.ts.map +1 -0
- package/dist/rules/nul-bytes.js +332 -0
- package/dist/rules/nul-bytes.js.map +1 -0
- package/dist/rules/platform-surface.d.ts +479 -0
- package/dist/rules/platform-surface.d.ts.map +1 -0
- package/dist/rules/platform-surface.js +749 -0
- package/dist/rules/platform-surface.js.map +1 -0
- package/dist/rules/port-catches.d.ts +225 -0
- package/dist/rules/port-catches.d.ts.map +1 -0
- package/dist/rules/port-catches.js +1374 -0
- package/dist/rules/port-catches.js.map +1 -0
- package/dist/rules/port-shape.d.ts +213 -0
- package/dist/rules/port-shape.d.ts.map +1 -0
- package/dist/rules/port-shape.js +670 -0
- package/dist/rules/port-shape.js.map +1 -0
- package/dist/rules/queue-names.d.ts +108 -0
- package/dist/rules/queue-names.d.ts.map +1 -0
- package/dist/rules/queue-names.js +395 -0
- package/dist/rules/queue-names.js.map +1 -0
- package/dist/rules/singleton-identity.d.ts +205 -0
- package/dist/rules/singleton-identity.d.ts.map +1 -0
- package/dist/rules/singleton-identity.js +830 -0
- package/dist/rules/singleton-identity.js.map +1 -0
- package/dist/rules/subscribe-seam.d.ts +121 -0
- package/dist/rules/subscribe-seam.d.ts.map +1 -0
- package/dist/rules/subscribe-seam.js +594 -0
- package/dist/rules/subscribe-seam.js.map +1 -0
- package/dist/rules/transaction-context.d.ts +40 -0
- package/dist/rules/transaction-context.d.ts.map +1 -0
- package/dist/rules/transaction-context.js +294 -0
- package/dist/rules/transaction-context.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { type EnvironmentInput } from '@endora-commerce/contracts';
|
|
2
|
+
import { type ResolvedPackage } from './host.js';
|
|
3
|
+
/** One module package, as this command needs it. */
|
|
4
|
+
export interface ModuleCandidate {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly packageName: string;
|
|
7
|
+
/**
|
|
8
|
+
* The version **this package** declares about itself, and the source of the
|
|
9
|
+
* `^` range the instance's manifest carries for it.
|
|
10
|
+
*
|
|
11
|
+
* It was read here and dropped on the way to the template, which had the
|
|
12
|
+
* platform's version in scope and wrote that onto every module. That is
|
|
13
|
+
* correct only while a release moves every package together, and a release
|
|
14
|
+
* does not — see {@link PlannedModulePackage} in `template.ts`.
|
|
15
|
+
*/
|
|
16
|
+
readonly version: string;
|
|
17
|
+
/** The manifest's own `dependencies`, which the closure walks. */
|
|
18
|
+
readonly dependencies: readonly string[];
|
|
19
|
+
/**
|
|
20
|
+
* The module ids of the manifest's `acknowledgedDependencies`, which the
|
|
21
|
+
* closure walks **exactly as** `dependencies` — because the platform does.
|
|
22
|
+
*
|
|
23
|
+
* The two spellings differ in one thing only: `acknowledgedDependencies`
|
|
24
|
+
* withdraws the *install ordering* a `dependencies` entry claims, for an edge
|
|
25
|
+
* whose ordering would close a cycle. `carts` names `promotions` there for
|
|
26
|
+
* that reason and no other, and its own manifest says the edge *"is a real
|
|
27
|
+
* bind: a cart that cannot resolve its discount must not quote a figure it
|
|
28
|
+
* cannot justify"*. `assertLockedModulesPresent` agrees and makes no
|
|
29
|
+
* distinction: a module named in **either** array that the deployment does
|
|
30
|
+
* not ship is `ReducedDeploymentError`, thrown out of `loadModulePresence`
|
|
31
|
+
* before anything listens.
|
|
32
|
+
*
|
|
33
|
+
* So a set derived over `dependencies` alone is a set the platform refuses
|
|
34
|
+
* to boot, and that is not a hypothesis — it is what the instance acceptance
|
|
35
|
+
* criterion's A4 and A15 were, measured on 2026-09-14 with a registry
|
|
36
|
+
* install's discovery shape: *"promotions — not shipped by this deployment,
|
|
37
|
+
* and it is needed: carts — acknowledgedDependencies, port
|
|
38
|
+
* `promotionService`"*. Both assertions are the same failure, because
|
|
39
|
+
* `pnpm run start` and the instance's own `admin:create` both compose.
|
|
40
|
+
*
|
|
41
|
+
* **Why it was invisible until an instance installed from a registry.** The
|
|
42
|
+
* criterion's `tarball` mode pins every auto-installed peer as a real
|
|
43
|
+
* dependency of the instance — `mod-promotions` among them, because
|
|
44
|
+
* `mod-carts` peer-depends on it — which puts it at the top level of
|
|
45
|
+
* `node_modules`, where the platform's package discovery looks. A registry
|
|
46
|
+
* install leaves it inside `.pnpm`, where that walk deliberately does not.
|
|
47
|
+
* The tarball tree was therefore wider than any client's, and it was the only
|
|
48
|
+
* tree this had ever been measured on. **Since 2026-09-15 it is not**: the
|
|
49
|
+
* criterion still has to pin those peers for the install to resolve at all,
|
|
50
|
+
* and it takes the module packages among them back off the top level once it
|
|
51
|
+
* has, so the tree it measures is the tree a registry install produces. Its
|
|
52
|
+
* A16 is the assertion over that, in either supply mode.
|
|
53
|
+
*
|
|
54
|
+
* It stays a separate field rather than being folded into `dependencies` so
|
|
55
|
+
* the ordering the manifest withdrew is still withdrawn here, and so the F2
|
|
56
|
+
* refusal can keep naming the module that asked.
|
|
57
|
+
*/
|
|
58
|
+
readonly acknowledged: readonly string[];
|
|
59
|
+
/** `activation.nonDeactivatable` — the required predicate's subject. */
|
|
60
|
+
readonly required: boolean;
|
|
61
|
+
/** The manifest's `activation.reason`, which the refusal prints (§3.3). */
|
|
62
|
+
readonly reason: string | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* The `license` the **package** declares, verbatim — or, for a module the
|
|
65
|
+
* platform carries ({@link carriedByHost}), the platform's own.
|
|
66
|
+
*
|
|
67
|
+
* The install verb's default set excludes a separately licensed module
|
|
68
|
+
* ({@link separatelyLicensed}, D-270), and a package's licence is a fact about
|
|
69
|
+
* the package rather than about the manifest inside it — the convention
|
|
70
|
+
* `check-release-intent`'s header states for a paid package. Absent when the
|
|
71
|
+
* package declares none, which is not a claim of separate terms.
|
|
72
|
+
*/
|
|
73
|
+
readonly license?: string | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* True when the **platform package itself** carries this module.
|
|
76
|
+
*
|
|
77
|
+
* `_lifecycle` is the one today (D-160.11: *"it is the one module the
|
|
78
|
+
* packaging sweep does not turn into a package"*), and §3.2 counts it that
|
|
79
|
+
* way — *"25 are packages and `_lifecycle` arrives with the platform"*. Such
|
|
80
|
+
* a module is in the set and gets **no `dependencies` entry**: an instance
|
|
81
|
+
* that named it would be asking a registry for a package nobody publishes.
|
|
82
|
+
*
|
|
83
|
+
* Derived, never a list: it is a module the platform's **own `exports` map**
|
|
84
|
+
* publishes a manifest through, so a second host-carried module needs no edit
|
|
85
|
+
* here and one that becomes a package stops being carried in the same run.
|
|
86
|
+
*/
|
|
87
|
+
readonly carriedByHost: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The manifest's own `env` — what this module reads from the environment.
|
|
90
|
+
*
|
|
91
|
+
* Read here because this is the one place in the run where the **installed**
|
|
92
|
+
* manifests are in hand, and a module's declaration reaches a client's
|
|
93
|
+
* `.env.example` only through them (`specs/123-oss-install-experience/` T3-B).
|
|
94
|
+
* A manifest whose `env` is not a declaration contributes nothing rather than
|
|
95
|
+
* refusing the run: it is a published artefact of another version of the
|
|
96
|
+
* platform, and this file already reads one loosely for that reason.
|
|
97
|
+
*/
|
|
98
|
+
readonly env: readonly EnvironmentInput[];
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Is this licence one of **separate terms** — the paid tier's convention?
|
|
102
|
+
*
|
|
103
|
+
* The `SEE LICENSE IN <file>` form and `UNLICENSED`: the two npm spellings of
|
|
104
|
+
* "these terms are not an open-source licence", and the ones D-270 names. Any
|
|
105
|
+
* other value, and no value at all, is not: the open core's packages declare
|
|
106
|
+
* `MIT`, and a package that declares nothing has claimed no terms of its own.
|
|
107
|
+
*/
|
|
108
|
+
export declare function separatelyLicensed(license: string | undefined): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Which modules a default is seeded with when no `--module` was given.
|
|
111
|
+
*
|
|
112
|
+
* - `required` — `instance-tree.md` R3.2's smallest set that composes: the
|
|
113
|
+
* modules declaring `activation.nonDeactivatable`. `endora new instance`'s.
|
|
114
|
+
* - `available` — every module the run resolved whose package is not
|
|
115
|
+
* {@link separatelyLicensed}: the install verb's (D-270). The required set is
|
|
116
|
+
* the floor either way; the closure and its refusals are the same code.
|
|
117
|
+
*
|
|
118
|
+
* A policy rather than a list, so the install verb names no module (125 FR-143)
|
|
119
|
+
* and the population moves with the packages resolved (D-100).
|
|
120
|
+
*/
|
|
121
|
+
export type ModuleSeedPolicy = 'required' | 'available';
|
|
122
|
+
/** What a resolution decided, before a single file is planned. */
|
|
123
|
+
export interface ModuleSetResolution {
|
|
124
|
+
/** Every id in the set, sorted, so the manifest a run writes is reproducible. */
|
|
125
|
+
readonly ids: readonly string[];
|
|
126
|
+
/** The ids the operator asked for, before the closure. Empty for the default. */
|
|
127
|
+
readonly requested: readonly string[];
|
|
128
|
+
/** The ids the closure added on top of `requested` (or of the required set). */
|
|
129
|
+
readonly closure: readonly string[];
|
|
130
|
+
/**
|
|
131
|
+
* True when no `--module` was given and a default was written — §3.2's
|
|
132
|
+
* smallest set, or the install verb's `available` seed (D-270).
|
|
133
|
+
*/
|
|
134
|
+
readonly defaulted: boolean;
|
|
135
|
+
readonly candidates: ReadonlyMap<string, ModuleCandidate>;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* The required set — the predicate `requiredModulesFrom` implements.
|
|
139
|
+
*
|
|
140
|
+
* See the file header: this is the one derived fact this file states a second
|
|
141
|
+
* time, and T134 replaces it with the platform's own function.
|
|
142
|
+
*/
|
|
143
|
+
export declare function requiredModuleIds(candidates: ReadonlyMap<string, ModuleCandidate>): readonly string[];
|
|
144
|
+
/** What one resolution read off the packages installed beside the target. */
|
|
145
|
+
export interface LoadedCandidates {
|
|
146
|
+
readonly candidates: ReadonlyMap<string, ModuleCandidate>;
|
|
147
|
+
/**
|
|
148
|
+
* The platform's own environment-input declaration, or empty.
|
|
149
|
+
*
|
|
150
|
+
* It comes back beside the candidates because it is read in the same pass
|
|
151
|
+
* over the same entry points ({@link HostDeclarations}), and because the two
|
|
152
|
+
* are the two halves of one answer: what a scaffolded instance reads from its
|
|
153
|
+
* environment is the platform's declaration unioned with the manifests of the
|
|
154
|
+
* modules it installed, and a caller holding one half without the other would
|
|
155
|
+
* write a file that is short by the other.
|
|
156
|
+
*/
|
|
157
|
+
readonly platformEnv: readonly EnvironmentInput[];
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Every module package this run resolved, with its own manifest read.
|
|
161
|
+
*
|
|
162
|
+
* A package whose manifest cannot be imported, or whose manifest declares no
|
|
163
|
+
* `id`, is **F7** and never a skip: a module set short by however many
|
|
164
|
+
* manifests failed to load is a manifest the client installs and a set the
|
|
165
|
+
* platform then composes differently, with nothing in either tree to say so.
|
|
166
|
+
*/
|
|
167
|
+
export declare function loadModuleCandidates(packages: ReadonlyMap<string, ResolvedPackage>, host?: ResolvedPackage | undefined): Promise<LoadedCandidates>;
|
|
168
|
+
/**
|
|
169
|
+
* What a scaffolded instance reads from its environment — the whole population,
|
|
170
|
+
* derived and never listed (`specs/123-oss-install-experience/` FR-010).
|
|
171
|
+
*
|
|
172
|
+
* The platform's declaration first, then each **installed** module's, in module
|
|
173
|
+
* order, so a name that has migrated between the two carries the platform's
|
|
174
|
+
* sentence (`unionEnvironmentInputs`). The set of modules is this run's, so a
|
|
175
|
+
* different `--module` set is a different population with nothing here edited.
|
|
176
|
+
*/
|
|
177
|
+
export declare function instanceEnvironmentInputs(platformEnv: readonly EnvironmentInput[], modules: readonly ModuleCandidate[]): readonly EnvironmentInput[];
|
|
178
|
+
/**
|
|
179
|
+
* The set, closed and refused (§3.1, §3.2, §3.4).
|
|
180
|
+
*
|
|
181
|
+
* Pure over its two inputs, so its proofs enter at the top of the analysis
|
|
182
|
+
* (issue #130) — a fixture supplies candidates and a request, never a
|
|
183
|
+
* pre-computed set.
|
|
184
|
+
*/
|
|
185
|
+
export declare function resolveModuleSet(requested: readonly string[], candidates: ReadonlyMap<string, ModuleCandidate>, options?: {
|
|
186
|
+
readonly seed?: ModuleSeedPolicy | undefined;
|
|
187
|
+
}): ModuleSetResolution;
|
|
188
|
+
//# sourceMappingURL=modules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/new-instance/modules.ts"],"names":[],"mappings":"AA2CA,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAExF,oDAAoD;AACpD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,kEAAkE;IAClE,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAC,CAAC;IAC1D;;;;;;;;;OASG;IACH,QAAQ,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACnD;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,EAC9C,IAAI,CAAC,EAAE,eAAe,GAAG,SAAS,GACjC,OAAO,CAAC,gBAAgB,CAAC,CAqD3B;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,SAAS,gBAAgB,EAAE,EACxC,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,SAAS,gBAAgB,EAAE,CAK7B;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,EAChD,OAAO,GAAE;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAA;CAAO,GAC7D,mBAAmB,CA6IrB"}
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The module set an instance installs — derived, closed, and refused before
|
|
3
|
+
* anything is written (`contracts/instance-tree.md` §3).
|
|
4
|
+
*
|
|
5
|
+
* ## It is never a list
|
|
6
|
+
*
|
|
7
|
+
* §3.2: with no `--module` the command writes **the smallest set that
|
|
8
|
+
* composes** — the modules declaring `activation.nonDeactivatable`, closed over
|
|
9
|
+
* the manifests' `dependencies` **and their `acknowledgedDependencies`**, which
|
|
10
|
+
* bind exactly as hard and which {@link ModuleCandidate.acknowledged} explains.
|
|
11
|
+
* The number is derived on every run and appears in no source file (D-100):
|
|
12
|
+
* un-locking a module changes the default in the same run, and nothing here has
|
|
13
|
+
* to be edited for it.
|
|
14
|
+
*
|
|
15
|
+
* That is `endora new instance`'s default. `endora install`'s is wider (D-270):
|
|
16
|
+
* every module package the run resolved that is not separately licensed,
|
|
17
|
+
* closed the same way. Both are {@link resolveModuleSet} with a
|
|
18
|
+
* {@link ModuleSeedPolicy}, so there is one derivation and not two.
|
|
19
|
+
*
|
|
20
|
+
* ## Where the manifests come from
|
|
21
|
+
*
|
|
22
|
+
* §3.4: from the packages the command **resolved** — a module package publishes
|
|
23
|
+
* its manifest as its root export (`"." -> ./dist/manifest.js`), so the
|
|
24
|
+
* declaration this reads is the one the platform will read when it composes
|
|
25
|
+
* that same install. It is imported through the package's own `exports` map
|
|
26
|
+
* rather than by a path into it, so a package that lays its build out
|
|
27
|
+
* differently is followed rather than missed.
|
|
28
|
+
*
|
|
29
|
+
* ## The required predicate, and the one thing this file owes T134
|
|
30
|
+
*
|
|
31
|
+
* {@link requiredModuleIds} is the predicate `requiredModulesFrom` implements
|
|
32
|
+
* in `@endora-commerce/platform/composition` — *a manifest whose `activation`
|
|
33
|
+
* carries `nonDeactivatable`* — and it is written here rather than imported
|
|
34
|
+
* because this package depends on `@endora-commerce/contracts` and not on the
|
|
35
|
+
* platform. **That is a second copy of a derived fact and it is exactly what
|
|
36
|
+
* T134 closes** (`tasks.md` Phase 4: *"using `requiredModulesFrom(manifests)`
|
|
37
|
+
* and the platform's own message. Never a second list (D-100)"*). It is
|
|
38
|
+
* confined to one four-line function, with the reason on it, so the replacement
|
|
39
|
+
* is a deletion rather than a search.
|
|
40
|
+
*/
|
|
41
|
+
import { join } from 'node:path';
|
|
42
|
+
import { pathToFileURL } from 'node:url';
|
|
43
|
+
import { EnvironmentInputsSchema, unionEnvironmentInputs, } from '@endora-commerce/contracts';
|
|
44
|
+
import { InstanceHostError, InstanceInputError } from './host.js';
|
|
45
|
+
/**
|
|
46
|
+
* Is this licence one of **separate terms** — the paid tier's convention?
|
|
47
|
+
*
|
|
48
|
+
* The `SEE LICENSE IN <file>` form and `UNLICENSED`: the two npm spellings of
|
|
49
|
+
* "these terms are not an open-source licence", and the ones D-270 names. Any
|
|
50
|
+
* other value, and no value at all, is not: the open core's packages declare
|
|
51
|
+
* `MIT`, and a package that declares nothing has claimed no terms of its own.
|
|
52
|
+
*/
|
|
53
|
+
export function separatelyLicensed(license) {
|
|
54
|
+
if (license === undefined)
|
|
55
|
+
return false;
|
|
56
|
+
const value = license.trim();
|
|
57
|
+
return /^SEE LICENSE IN\b/i.test(value) || value === 'UNLICENSED';
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The environment inputs a manifest declares, or none.
|
|
61
|
+
*
|
|
62
|
+
* Parsed rather than trusted, and a declaration this build cannot read is
|
|
63
|
+
* **dropped rather than refused** — see {@link RawManifest}. The consequence of
|
|
64
|
+
* dropping one is a name missing from a client's `.env.example`, which is the
|
|
65
|
+
* defect this feature closes; the consequence of refusing would be an instance
|
|
66
|
+
* that cannot be scaffolded at all because one installed package ships a field
|
|
67
|
+
* shape from a newer platform. The second is worse, and `check:env-inputs`
|
|
68
|
+
* refuses a malformed declaration in the tree that authored it, which is where
|
|
69
|
+
* the finding belongs.
|
|
70
|
+
*/
|
|
71
|
+
function environmentInputsOf(value) {
|
|
72
|
+
if (!Array.isArray(value))
|
|
73
|
+
return [];
|
|
74
|
+
const parsed = EnvironmentInputsSchema.safeParse(value);
|
|
75
|
+
return parsed.success ? parsed.data : [];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The required set — the predicate `requiredModulesFrom` implements.
|
|
79
|
+
*
|
|
80
|
+
* See the file header: this is the one derived fact this file states a second
|
|
81
|
+
* time, and T134 replaces it with the platform's own function.
|
|
82
|
+
*/
|
|
83
|
+
export function requiredModuleIds(candidates) {
|
|
84
|
+
return [...candidates.values()].filter((entry) => entry.required).map((entry) => entry.id);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The file a package's **own `exports` map** publishes as its root export.
|
|
88
|
+
*
|
|
89
|
+
* Derived from the package's declaration rather than guessed at, for the reason
|
|
90
|
+
* feature 080's T041a gives about specifiers: nothing in the tree spells
|
|
91
|
+
* `dist/manifest.js`, and a package that lays its build out differently is
|
|
92
|
+
* followed rather than missed. A package that publishes no root export is F7 —
|
|
93
|
+
* its manifest is not reachable by name, which is how the platform will reach
|
|
94
|
+
* it too.
|
|
95
|
+
*/
|
|
96
|
+
function conditionTarget(entry) {
|
|
97
|
+
if (typeof entry === 'string')
|
|
98
|
+
return entry;
|
|
99
|
+
if (entry === null || typeof entry !== 'object')
|
|
100
|
+
return undefined;
|
|
101
|
+
const record = entry;
|
|
102
|
+
const candidate = record['import'] ?? record['default'] ?? record['node'];
|
|
103
|
+
return typeof candidate === 'string' ? candidate : undefined;
|
|
104
|
+
}
|
|
105
|
+
function rootEntryOf(pkg) {
|
|
106
|
+
const exports = pkg.manifest['exports'];
|
|
107
|
+
const root = typeof exports === 'string'
|
|
108
|
+
? exports
|
|
109
|
+
: exports !== null && typeof exports === 'object'
|
|
110
|
+
? exports['.']
|
|
111
|
+
: undefined;
|
|
112
|
+
const target = conditionTarget(root) ?? conditionTarget(pkg.manifest['main']);
|
|
113
|
+
if (target === undefined) {
|
|
114
|
+
throw new InstanceHostError('F7', `${pkg.name} publishes no root export, so its manifest — the \`dependencies\` the ` +
|
|
115
|
+
`module set is closed over and the \`activation\` the required set is derived from — ` +
|
|
116
|
+
`cannot be read by name. Nothing is written.`);
|
|
117
|
+
}
|
|
118
|
+
return join(pkg.dir, target);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Every JavaScript entry point a package's own `exports` map publishes.
|
|
122
|
+
*
|
|
123
|
+
* Used to ask the **host** which modules it carries: a subpath is a candidate
|
|
124
|
+
* because the package declares it, never because a name was written here. A
|
|
125
|
+
* wildcard subpath and a non-`.js` target (`./theme.css`, `./package.json`) are
|
|
126
|
+
* outside the question by construction — neither can carry a manifest.
|
|
127
|
+
*/
|
|
128
|
+
function exportedEntriesOf(pkg) {
|
|
129
|
+
const exports = pkg.manifest['exports'];
|
|
130
|
+
if (exports === null || typeof exports !== 'object')
|
|
131
|
+
return [];
|
|
132
|
+
const entries = [];
|
|
133
|
+
for (const [subpath, entry] of Object.entries(exports)) {
|
|
134
|
+
if (subpath.includes('*'))
|
|
135
|
+
continue;
|
|
136
|
+
const target = conditionTarget(entry);
|
|
137
|
+
if (target === undefined || !target.endsWith('.js'))
|
|
138
|
+
continue;
|
|
139
|
+
entries.push([subpath, join(pkg.dir, target)]);
|
|
140
|
+
}
|
|
141
|
+
return entries;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* What the **host package itself** declares, off its own `exports` map.
|
|
145
|
+
*
|
|
146
|
+
* See {@link ModuleCandidate.carriedByHost}. An entry point that will not
|
|
147
|
+
* import is **F7** and never a skip: a host-carried module the run could not
|
|
148
|
+
* see is a required module the set will then be missing, and the operator would
|
|
149
|
+
* be sent to install a package that does not exist.
|
|
150
|
+
*
|
|
151
|
+
* One pass, two answers: every entry point is imported exactly once, and both
|
|
152
|
+
* the carried manifests and the platform's environment declaration are taken
|
|
153
|
+
* from it. Two loops would import the same modules twice.
|
|
154
|
+
*/
|
|
155
|
+
async function hostDeclarations(host) {
|
|
156
|
+
const carried = [];
|
|
157
|
+
let env = [];
|
|
158
|
+
for (const [subpath, file] of exportedEntriesOf(host)) {
|
|
159
|
+
let loaded;
|
|
160
|
+
try {
|
|
161
|
+
loaded = (await import(pathToFileURL(file).href));
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
throw new InstanceHostError('F7', `${host.name}${subpath.slice(1)} could not be imported ` +
|
|
165
|
+
`(${error instanceof Error ? error.message : String(error)}), so this run cannot say ` +
|
|
166
|
+
`which modules the platform itself carries. One of them is required by every ` +
|
|
167
|
+
`instance, so a run that guessed would write a module set the platform then refuses ` +
|
|
168
|
+
`to compose. Nothing is written; rebuild the platform package and try again.`);
|
|
169
|
+
}
|
|
170
|
+
const manifest = loaded.manifest;
|
|
171
|
+
if (manifest !== undefined && typeof manifest.id === 'string' && manifest.id.length > 0) {
|
|
172
|
+
carried.push([manifest.id, manifest]);
|
|
173
|
+
}
|
|
174
|
+
if (env.length === 0)
|
|
175
|
+
env = environmentInputsOf(loaded.PLATFORM_ENVIRONMENT_INPUTS);
|
|
176
|
+
}
|
|
177
|
+
return { carried, env };
|
|
178
|
+
}
|
|
179
|
+
/** One candidate, from a manifest and the package it came out of. */
|
|
180
|
+
function candidateFrom(id, manifest, packageName, version, carriedByHost, license) {
|
|
181
|
+
const activation = manifest.activation;
|
|
182
|
+
return {
|
|
183
|
+
id,
|
|
184
|
+
packageName,
|
|
185
|
+
version,
|
|
186
|
+
dependencies: Array.isArray(manifest.dependencies)
|
|
187
|
+
? manifest.dependencies.filter((entry) => typeof entry === 'string')
|
|
188
|
+
: [],
|
|
189
|
+
// Read as loosely as everything else here: this manifest is a published
|
|
190
|
+
// artefact of another version of the platform, and an entry whose shape
|
|
191
|
+
// this build cannot read is dropped rather than refused (see
|
|
192
|
+
// {@link RawManifest}). One id per entry, de-duplicated, because `carts`
|
|
193
|
+
// names `promotions` once per port.
|
|
194
|
+
acknowledged: Array.isArray(manifest.acknowledgedDependencies)
|
|
195
|
+
? [
|
|
196
|
+
...new Set(manifest.acknowledgedDependencies
|
|
197
|
+
.map((entry) => typeof entry === 'object' && entry !== null
|
|
198
|
+
? entry.moduleId
|
|
199
|
+
: undefined)
|
|
200
|
+
.filter((id) => typeof id === 'string')),
|
|
201
|
+
]
|
|
202
|
+
: [],
|
|
203
|
+
env: environmentInputsOf(manifest.env),
|
|
204
|
+
required: activation !== undefined &&
|
|
205
|
+
typeof activation === 'object' &&
|
|
206
|
+
'nonDeactivatable' in activation,
|
|
207
|
+
reason: typeof activation?.reason === 'string' ? activation.reason : undefined,
|
|
208
|
+
carriedByHost,
|
|
209
|
+
license: typeof license === 'string' ? license : undefined,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Every module package this run resolved, with its own manifest read.
|
|
214
|
+
*
|
|
215
|
+
* A package whose manifest cannot be imported, or whose manifest declares no
|
|
216
|
+
* `id`, is **F7** and never a skip: a module set short by however many
|
|
217
|
+
* manifests failed to load is a manifest the client installs and a set the
|
|
218
|
+
* platform then composes differently, with nothing in either tree to say so.
|
|
219
|
+
*/
|
|
220
|
+
export async function loadModuleCandidates(packages, host) {
|
|
221
|
+
const candidates = new Map();
|
|
222
|
+
for (const pkg of [...packages.values()].sort((a, b) => a.name.localeCompare(b.name))) {
|
|
223
|
+
if (pkg.endora?.type !== 'module')
|
|
224
|
+
continue;
|
|
225
|
+
const declaredId = pkg.endora.id;
|
|
226
|
+
if (typeof declaredId !== 'string' || declaredId.length === 0) {
|
|
227
|
+
throw new InstanceHostError('F7', `${pkg.name} declares \`endora.type: "module"\` and no \`endora.id\`, so this run ` +
|
|
228
|
+
`cannot say which module it is. Nothing is written.`);
|
|
229
|
+
}
|
|
230
|
+
// Resolved outside the `try` deliberately: its own F7 says the package
|
|
231
|
+
// publishes no root export, which is a different finding from a root export
|
|
232
|
+
// that failed to load, and a `catch` here would report the first as the
|
|
233
|
+
// second.
|
|
234
|
+
const entry = rootEntryOf(pkg);
|
|
235
|
+
let manifest;
|
|
236
|
+
try {
|
|
237
|
+
const loaded = (await import(pathToFileURL(entry).href));
|
|
238
|
+
manifest = (loaded.manifest ?? {});
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
throw new InstanceHostError('F7', `${pkg.name}'s manifest could not be read from ${pkg.dir} ` +
|
|
242
|
+
`(${error instanceof Error ? error.message : String(error)}). Its \`dependencies\` ` +
|
|
243
|
+
`are what the module set is closed over, so a run that skipped it would write a set ` +
|
|
244
|
+
`that is short by whatever that module needs. Nothing is written; build or reinstall ` +
|
|
245
|
+
`the package and try again.`);
|
|
246
|
+
}
|
|
247
|
+
candidates.set(declaredId, candidateFrom(declaredId, manifest, pkg.name, pkg.version, false, pkg.manifest['license']));
|
|
248
|
+
}
|
|
249
|
+
// The host's own, last: a package that has been extracted out of the platform
|
|
250
|
+
// wins over the copy still inside it, which is the direction that follows a
|
|
251
|
+
// module *leaving* the host rather than the one that pins it there.
|
|
252
|
+
if (host === undefined)
|
|
253
|
+
return { candidates, platformEnv: [] };
|
|
254
|
+
const declarations = await hostDeclarations(host);
|
|
255
|
+
for (const [id, manifest] of declarations.carried) {
|
|
256
|
+
if (candidates.has(id))
|
|
257
|
+
continue;
|
|
258
|
+
// A module the platform carries is published under the platform's terms.
|
|
259
|
+
candidates.set(id, candidateFrom(id, manifest, host.name, host.version, true, host.manifest['license']));
|
|
260
|
+
}
|
|
261
|
+
return { candidates, platformEnv: declarations.env };
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* What a scaffolded instance reads from its environment — the whole population,
|
|
265
|
+
* derived and never listed (`specs/123-oss-install-experience/` FR-010).
|
|
266
|
+
*
|
|
267
|
+
* The platform's declaration first, then each **installed** module's, in module
|
|
268
|
+
* order, so a name that has migrated between the two carries the platform's
|
|
269
|
+
* sentence (`unionEnvironmentInputs`). The set of modules is this run's, so a
|
|
270
|
+
* different `--module` set is a different population with nothing here edited.
|
|
271
|
+
*/
|
|
272
|
+
export function instanceEnvironmentInputs(platformEnv, modules) {
|
|
273
|
+
return unionEnvironmentInputs([
|
|
274
|
+
platformEnv,
|
|
275
|
+
...[...modules].sort((a, b) => a.id.localeCompare(b.id)).map((module) => module.env),
|
|
276
|
+
]);
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* The set, closed and refused (§3.1, §3.2, §3.4).
|
|
280
|
+
*
|
|
281
|
+
* Pure over its two inputs, so its proofs enter at the top of the analysis
|
|
282
|
+
* (issue #130) — a fixture supplies candidates and a request, never a
|
|
283
|
+
* pre-computed set.
|
|
284
|
+
*/
|
|
285
|
+
export function resolveModuleSet(requested, candidates, options = {}) {
|
|
286
|
+
const policy = options.seed ?? 'required';
|
|
287
|
+
const asked = [...new Set(requested.map((entry) => entry.trim()).filter((e) => e.length > 0))];
|
|
288
|
+
// F3 — an id no resolvable package declares. Named before the closure, so
|
|
289
|
+
// the operator sees their own typo rather than a dependency that "cannot be
|
|
290
|
+
// satisfied" three modules downstream.
|
|
291
|
+
const unknown = asked.filter((id) => !candidates.has(id));
|
|
292
|
+
if (unknown.length > 0) {
|
|
293
|
+
throw new InstanceInputError('F3', `\`--module\` names ${unknown.join(', ')}, which no package resolvable from here ` +
|
|
294
|
+
`declares. This run resolved ${String(candidates.size)} module ` +
|
|
295
|
+
`${candidates.size === 1 ? 'package' : 'packages'}; install the one you meant beside ` +
|
|
296
|
+
`the target directory, or drop the name. Nothing is written.`);
|
|
297
|
+
}
|
|
298
|
+
const defaulted = asked.length === 0;
|
|
299
|
+
// Only a default is licence-filtered: a module the operator named is theirs
|
|
300
|
+
// to name, which is `--module` unchanged (D-270 clause 1).
|
|
301
|
+
const licenceFiltered = defaulted && policy === 'available';
|
|
302
|
+
const seed = !defaulted
|
|
303
|
+
? asked
|
|
304
|
+
: policy === 'available'
|
|
305
|
+
? [...candidates.values()]
|
|
306
|
+
.filter((entry) => !separatelyLicensed(entry.license))
|
|
307
|
+
.map((entry) => entry.id)
|
|
308
|
+
.sort()
|
|
309
|
+
: requiredModuleIds(candidates);
|
|
310
|
+
if (seed.length === 0) {
|
|
311
|
+
throw new InstanceInputError('F2', `no module set could be derived: no \`--module\` was given and ` +
|
|
312
|
+
(policy === 'available'
|
|
313
|
+
? `every resolvable module package is separately licensed, so there is no set of `
|
|
314
|
+
: `no resolvable package declares \`activation.nonDeactivatable\`, so there is no ` +
|
|
315
|
+
`smallest set that composes `) +
|
|
316
|
+
`to fall back to. Name the modules with \`--module <id>\` (repeatable, ` +
|
|
317
|
+
`comma-splittable). Nothing is written.`);
|
|
318
|
+
}
|
|
319
|
+
// The closure over the manifests' own `dependencies` **and**
|
|
320
|
+
// `acknowledgedDependencies` — see {@link ModuleCandidate.acknowledged} for
|
|
321
|
+
// why the two are one population here and for the boot this walk used to
|
|
322
|
+
// write a set the platform refused. The F2 refusal for an edge nothing
|
|
323
|
+
// satisfies is unchanged. Breadth-first so the refusal can name the module
|
|
324
|
+
// that asked, which is the fact the operator can act on.
|
|
325
|
+
const chosen = new Set();
|
|
326
|
+
const queue = [...seed];
|
|
327
|
+
const unsatisfied = [];
|
|
328
|
+
const licensed = [];
|
|
329
|
+
while (queue.length > 0) {
|
|
330
|
+
const id = queue.shift();
|
|
331
|
+
if (chosen.has(id))
|
|
332
|
+
continue;
|
|
333
|
+
chosen.add(id);
|
|
334
|
+
const candidate = candidates.get(id);
|
|
335
|
+
for (const dependency of [...candidate.dependencies, ...candidate.acknowledged]) {
|
|
336
|
+
if (chosen.has(dependency))
|
|
337
|
+
continue;
|
|
338
|
+
if (!candidates.has(dependency)) {
|
|
339
|
+
unsatisfied.push({ from: id, to: dependency });
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
// D-270 clause 4 — a default never installs paid code by way of an
|
|
343
|
+
// edge: a free module that needs a separately licensed one is a defect in
|
|
344
|
+
// the free module (D-265 clause 3), so it is named rather than followed.
|
|
345
|
+
if (licenceFiltered && separatelyLicensed(candidates.get(dependency).license)) {
|
|
346
|
+
licensed.push({ from: id, to: dependency });
|
|
347
|
+
continue;
|
|
348
|
+
}
|
|
349
|
+
queue.push(dependency);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
if (licensed.length > 0) {
|
|
353
|
+
const lines = [
|
|
354
|
+
'the default module set cannot be written, so nothing was written.',
|
|
355
|
+
'',
|
|
356
|
+
];
|
|
357
|
+
for (const edge of licensed) {
|
|
358
|
+
lines.push(` ${edge.from} declares a dependency on ${edge.to}, which is separately licensed.`);
|
|
359
|
+
}
|
|
360
|
+
lines.push('', 'With no `--module`, this command installs every module that is not separately', 'licensed, and a module in that set may not need one that is — the edge is a defect', 'in the module that declares it, and installing the other module to satisfy it would', 'put code under separate terms into an instance nobody chose it for.', 'remedy: name the modules you want with `--module <id>` (repeatable), and report the', 'edge to the maintainers of the module that declares it.');
|
|
361
|
+
throw new InstanceInputError('F2', lines.join('\n'));
|
|
362
|
+
}
|
|
363
|
+
// F2 — the required half, which is R5.6's and whose message T134 replaces
|
|
364
|
+
// with the platform's own. It is asked after the closure because a required
|
|
365
|
+
// module is very often already pulled in by one the operator named.
|
|
366
|
+
const missingRequired = requiredModuleIds(candidates).filter((id) => !chosen.has(id));
|
|
367
|
+
if (unsatisfied.length > 0 || missingRequired.length > 0) {
|
|
368
|
+
const lines = [
|
|
369
|
+
`the module set you asked for cannot compose, so nothing was written.`,
|
|
370
|
+
'',
|
|
371
|
+
];
|
|
372
|
+
for (const edge of unsatisfied) {
|
|
373
|
+
lines.push(` ${edge.from} declares a dependency on ${edge.to}, and no package resolvable from`, ` here declares that module.`, ` remedy: install it beside the target directory, or drop --module ${edge.from}.`, '');
|
|
374
|
+
}
|
|
375
|
+
for (const id of missingRequired) {
|
|
376
|
+
const candidate = candidates.get(id);
|
|
377
|
+
lines.push(` ${id} is missing, and the platform cannot run without it:`, ` ${candidate.reason ?? 'its manifest declares `activation.nonDeactivatable`.'}`, ` remedy: --module ${id}`, '');
|
|
378
|
+
}
|
|
379
|
+
lines.push('A module whose manifest declares `activation.nonDeactivatable` is required to be', 'present, not merely un-switch-off-able. An instance written without one does not', 'degrade: it exits, in the boot hook of whichever module happens to need it first.');
|
|
380
|
+
throw new InstanceInputError('F2', lines.join('\n'));
|
|
381
|
+
}
|
|
382
|
+
const ids = [...chosen].sort();
|
|
383
|
+
const seeded = new Set(seed);
|
|
384
|
+
return {
|
|
385
|
+
ids,
|
|
386
|
+
requested: defaulted ? [] : asked,
|
|
387
|
+
closure: ids.filter((id) => !seeded.has(id)),
|
|
388
|
+
defaulted,
|
|
389
|
+
candidates,
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
//# sourceMappingURL=modules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules.js","sourceRoot":"","sources":["../../src/new-instance/modules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,W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