@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 @@
|
|
|
1
|
+
{"version":3,"file":"module-docs.js","sourceRoot":"","sources":["../../src/lib/module-docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAwB,MAAM,yBAAyB,CAAC;AAElG;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAE1C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,+BAA+B,CAAC;AAErE,wEAAwE;AACxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,yBAAyB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,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IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;KACjF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type SourceReader } from './emitted-exports.js';
|
|
2
|
+
/** What a subpath a module reached turned out to be. */
|
|
3
|
+
export interface SubpathSurface {
|
|
4
|
+
/**
|
|
5
|
+
* `contract` — the emitted module exports nothing, so the reach is a reach
|
|
6
|
+
* into published contract surface and is not cross-module debt.
|
|
7
|
+
* `runtime` — it exports at least one binding.
|
|
8
|
+
* `undeclared` — the package declares no such subpath.
|
|
9
|
+
* `not-a-module` — it declares one and the target is not JavaScript
|
|
10
|
+
* (`"./package.json": "./package.json"`, which every module package ships).
|
|
11
|
+
*
|
|
12
|
+
* Only `contract` exempts a reach. The other three are fail-closed and differ
|
|
13
|
+
* only so that a message can say which it was.
|
|
14
|
+
*/
|
|
15
|
+
readonly kind: 'contract' | 'runtime' | 'undeclared' | 'not-a-module';
|
|
16
|
+
/** The bindings the emitted module exports; empty for the other two kinds. */
|
|
17
|
+
readonly runtimeExports: readonly string[];
|
|
18
|
+
}
|
|
19
|
+
/** A declared subpath whose emitted module could not be read (issue #113). */
|
|
20
|
+
export declare class UnreadableSubpathError extends Error {
|
|
21
|
+
readonly name = "UnreadableSubpathError";
|
|
22
|
+
readonly packageName: string;
|
|
23
|
+
readonly subpath: string;
|
|
24
|
+
constructor(packageName: string, subpath: string, detail: string);
|
|
25
|
+
}
|
|
26
|
+
/** Answers, per `(package name, subpath)`, whether the subpath is contract surface. */
|
|
27
|
+
export interface ModulePackageSurfaces {
|
|
28
|
+
/**
|
|
29
|
+
* The surface a subpath publishes.
|
|
30
|
+
*
|
|
31
|
+
* @throws {UnreadableSubpathError} when the subpath is declared and its
|
|
32
|
+
* emitted module cannot be read.
|
|
33
|
+
*/
|
|
34
|
+
readonly surfaceOfSubpath: (packageName: string, subpath: string) => SubpathSurface;
|
|
35
|
+
/** How many files the answers above have opened, for the `read:` line. */
|
|
36
|
+
readonly filesRead: () => number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The default: every subpath is a reach.
|
|
40
|
+
*
|
|
41
|
+
* It is what a caller that supplies no package directories gets, and it is the
|
|
42
|
+
* behaviour that shipped before D-171 — an exemption is granted only by a
|
|
43
|
+
* measurement, never by the absence of one.
|
|
44
|
+
*/
|
|
45
|
+
export declare const EVERY_SUBPATH_IS_A_REACH: ModulePackageSurfaces;
|
|
46
|
+
/**
|
|
47
|
+
* The surfaces reader for a set of module packages.
|
|
48
|
+
*
|
|
49
|
+
* `directories` maps each package's npm name to its directory and `reader` is
|
|
50
|
+
* how files are read, both parameters for the reason `readPortsSurface` takes
|
|
51
|
+
* them: a fixture enters at the top of the analysis — a real `package.json` and
|
|
52
|
+
* a real emitted module — rather than as a pre-classified record handed to the
|
|
53
|
+
* last function in the chain (issue #130).
|
|
54
|
+
*/
|
|
55
|
+
export declare function modulePackageSurfaces(directories: ReadonlyMap<string, string>, reader?: SourceReader): ModulePackageSurfaces;
|
|
56
|
+
//# sourceMappingURL=module-package-subpaths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-package-subpaths.d.ts","sourceRoot":"","sources":["../../src/lib/module-package-subpaths.ts"],"names":[],"mappings":"AAwEA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAE9B,wDAAwD;AACxD,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,cAAc,CAAC;IACtE,8EAA8E;IAC9E,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5C;AAED,8EAA8E;AAC9E,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,SAAkB,IAAI,4BAA4B;IAClD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEb,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAWjE;AAED,uFAAuF;AACvF,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,QAAQ,CAAC,gBAAgB,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,cAAc,CAAC;IACpF,0EAA0E;IAC1E,QAAQ,CAAC,SAAS,EAAE,MAAM,MAAM,CAAC;CAClC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,EAAE,qBAGtC,CAAC;AA4BF;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACxC,MAAM,GAAE,YAA+B,GACtC,qBAAqB,CAmGvB"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which of a module package's declared subpaths are **contract surface**
|
|
3
|
+
* (D-171).
|
|
4
|
+
*
|
|
5
|
+
* **The rule, in one sentence:** a subpath is contract surface iff the module it
|
|
6
|
+
* resolves to exports no runtime binding.
|
|
7
|
+
*
|
|
8
|
+
* T050 (!928) gave a module package a type-only `./ports` subpath so that a
|
|
9
|
+
* published port interface has a home — `packages/contracts` is compiled by
|
|
10
|
+
* `admin` and `storefront` and holds zero `@mikro-orm` imports on purpose, so an
|
|
11
|
+
* `EntityManager`-taking signature cannot live there (D-169). What T050
|
|
12
|
+
* correctly declined to take is the consequence: `check-module-boundary.ts` went
|
|
13
|
+
* on counting `import type { X } from '@endora-commerce/mod-y/ports'` as a
|
|
14
|
+
* cross-module reach, exactly as it counts `<pkg>/backend`. Publishing an
|
|
15
|
+
* interface therefore gave it a supported name and did **not** retire the
|
|
16
|
+
* consumer's ledger entry, which is precisely what D-169 says the conversion
|
|
17
|
+
* removes.
|
|
18
|
+
*
|
|
19
|
+
* ## Why the designation is derived and not written down
|
|
20
|
+
*
|
|
21
|
+
* Two alternatives were measured and refused, and both are worth stating here
|
|
22
|
+
* because each looks simpler than this file:
|
|
23
|
+
*
|
|
24
|
+
* - **A named list of subpaths in the layout contract.** That is D-100 exactly:
|
|
25
|
+
* the contract says it and the check holds a copy, with neither reading the
|
|
26
|
+
* other. The copy goes stale in silence, and the silence is an exemption.
|
|
27
|
+
* - **A field in the package's own `endora` block.** That is a self-certified
|
|
28
|
+
* exemption from our own debt ledger, issued by the measured party. A module
|
|
29
|
+
* wanting its `./backend` reach to stop counting would simply add it.
|
|
30
|
+
* `endora.type` / `endora.id` answer *"what is this?"*, which the platform
|
|
31
|
+
* must ask a stranger; *"which of my subpaths are exempt from your
|
|
32
|
+
* bookkeeping?"* is not a question to hand one.
|
|
33
|
+
*
|
|
34
|
+
* So it is re-derived every run from the artefact, and it **fails closed**: put a
|
|
35
|
+
* `const` on `./ports` and the exemption evaporates in the same run T050's guard
|
|
36
|
+
* goes red. A later `./types` is exempt automatically and correctly; a
|
|
37
|
+
* `./services` is not.
|
|
38
|
+
*
|
|
39
|
+
* Measured against the real set: `./ports` emits `export {};` → contract;
|
|
40
|
+
* `./backend` exports `registerModule` and `entities` → reach; `./migrations`
|
|
41
|
+
* exports `migrations` plus the named classes → reach; the package root exports
|
|
42
|
+
* `manifest` → reach.
|
|
43
|
+
*
|
|
44
|
+
* ## What is a refusal and what is a reach
|
|
45
|
+
*
|
|
46
|
+
* The two failure directions are not symmetric and are deliberately answered
|
|
47
|
+
* differently.
|
|
48
|
+
*
|
|
49
|
+
* - A subpath the package **does not declare** — no `exports` map, no matching
|
|
50
|
+
* key, or a key this cannot resolve to a runtime target because the
|
|
51
|
+
* specifier's shape is outside the rule (a wildcard entry such as
|
|
52
|
+
* `"./i18n/*"`) — is a **reach**. So is a declared subpath whose target is
|
|
53
|
+
* not JavaScript at all (`"./package.json"`, which every module package
|
|
54
|
+
* ships): parsing JSON as a module finds no export and would call it contract
|
|
55
|
+
* surface, which is an exemption granted by a wrong reading. That is the
|
|
56
|
+
* fail-closed direction: the reach keeps counting as debt, which is what it
|
|
57
|
+
* did before this file existed.
|
|
58
|
+
* - A subpath whose **emitted module cannot be read** — the runtime target is
|
|
59
|
+
* declared and the file behind it is missing, unreadable, or the entry
|
|
60
|
+
* declares `types` and no runtime condition at all — is a **refusal**
|
|
61
|
+
* ({@link UnreadableSubpathError}), which the CLI turns into exit 2. A file
|
|
62
|
+
* the check cannot read must never become an exemption; that is issue #113's
|
|
63
|
+
* shape, and it is the one direction in which a silence would grant standing
|
|
64
|
+
* rather than withhold it.
|
|
65
|
+
*
|
|
66
|
+
* A package directory this cannot find a `package.json` in, or whose manifest
|
|
67
|
+
* does not parse, is also a refusal: the directory came from the layout's own
|
|
68
|
+
* derivation, so its absence is a broken derivation and not a statement about
|
|
69
|
+
* the package.
|
|
70
|
+
*/
|
|
71
|
+
import { isAbsolute, join, normalize } from 'node:path';
|
|
72
|
+
import { nodeSourceReader, runtimeExportsOfEmittedModule, } from './emitted-exports.js';
|
|
73
|
+
/** A declared subpath whose emitted module could not be read (issue #113). */
|
|
74
|
+
export class UnreadableSubpathError extends Error {
|
|
75
|
+
name = 'UnreadableSubpathError';
|
|
76
|
+
packageName;
|
|
77
|
+
subpath;
|
|
78
|
+
constructor(packageName, subpath, detail) {
|
|
79
|
+
super(`the module package '${packageName}' declares '${subpath === '' ? '.' : `./${subpath}`}' ` +
|
|
80
|
+
`and its emitted module could not be read (${detail}). A subpath is contract surface ` +
|
|
81
|
+
'iff the module it resolves to exports no runtime binding (D-171), and a file this ' +
|
|
82
|
+
'check cannot read must never become an exemption — build the packages ' +
|
|
83
|
+
'(`pnpm run build:packages`) or repair the `exports` entry');
|
|
84
|
+
this.packageName = packageName;
|
|
85
|
+
this.subpath = subpath;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The default: every subpath is a reach.
|
|
90
|
+
*
|
|
91
|
+
* It is what a caller that supplies no package directories gets, and it is the
|
|
92
|
+
* behaviour that shipped before D-171 — an exemption is granted only by a
|
|
93
|
+
* measurement, never by the absence of one.
|
|
94
|
+
*/
|
|
95
|
+
export const EVERY_SUBPATH_IS_A_REACH = {
|
|
96
|
+
surfaceOfSubpath: () => ({ kind: 'runtime', runtimeExports: [] }),
|
|
97
|
+
filesRead: () => 0,
|
|
98
|
+
};
|
|
99
|
+
/** The conditions a runtime resolution may take, in the order Node takes them. */
|
|
100
|
+
const RUNTIME_CONDITIONS = ['default', 'import', 'node', 'require'];
|
|
101
|
+
/**
|
|
102
|
+
* The runtime target an `exports` value names, or `null` when it names none.
|
|
103
|
+
*
|
|
104
|
+
* `types` is skipped deliberately: a declaration file says what a consumer's
|
|
105
|
+
* compiler sees and never what its bundler loads, and the whole predicate is
|
|
106
|
+
* about the second. An entry that offers `types` and nothing else therefore
|
|
107
|
+
* resolves to `null`, which the caller reports as unreadable rather than as
|
|
108
|
+
* contract surface — that shape is the broken subpath D-169's own test names
|
|
109
|
+
* (`ERR_PACKAGE_PATH_NOT_EXPORTED` for every consumer whose toolchain emits the
|
|
110
|
+
* import), not a subpath that publishes nothing.
|
|
111
|
+
*/
|
|
112
|
+
function runtimeTargetOf(value) {
|
|
113
|
+
if (typeof value === 'string')
|
|
114
|
+
return value;
|
|
115
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
116
|
+
return null;
|
|
117
|
+
const conditions = value;
|
|
118
|
+
for (const condition of RUNTIME_CONDITIONS) {
|
|
119
|
+
if (!Object.prototype.hasOwnProperty.call(conditions, condition))
|
|
120
|
+
continue;
|
|
121
|
+
const resolved = runtimeTargetOf(conditions[condition]);
|
|
122
|
+
if (resolved !== null)
|
|
123
|
+
return resolved;
|
|
124
|
+
}
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* The surfaces reader for a set of module packages.
|
|
129
|
+
*
|
|
130
|
+
* `directories` maps each package's npm name to its directory and `reader` is
|
|
131
|
+
* how files are read, both parameters for the reason `readPortsSurface` takes
|
|
132
|
+
* them: a fixture enters at the top of the analysis — a real `package.json` and
|
|
133
|
+
* a real emitted module — rather than as a pre-classified record handed to the
|
|
134
|
+
* last function in the chain (issue #130).
|
|
135
|
+
*/
|
|
136
|
+
export function modulePackageSurfaces(directories, reader = nodeSourceReader) {
|
|
137
|
+
const manifests = new Map();
|
|
138
|
+
const answers = new Map();
|
|
139
|
+
let filesRead = 0;
|
|
140
|
+
const manifestOf = (packageName, directory) => {
|
|
141
|
+
const cached = manifests.get(packageName);
|
|
142
|
+
if (cached !== undefined)
|
|
143
|
+
return cached;
|
|
144
|
+
const path = join(directory, 'package.json');
|
|
145
|
+
let parsed = null;
|
|
146
|
+
if (reader.exists(path)) {
|
|
147
|
+
filesRead += 1;
|
|
148
|
+
try {
|
|
149
|
+
const value = JSON.parse(reader.read(path));
|
|
150
|
+
if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
|
|
151
|
+
parsed = value;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
parsed = null;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
manifests.set(packageName, parsed);
|
|
159
|
+
return parsed;
|
|
160
|
+
};
|
|
161
|
+
const surfaceOfSubpath = (packageName, subpath) => {
|
|
162
|
+
// The separator is spelled as an escape: a raw NUL makes git call the file
|
|
163
|
+
// binary and every diff of it unreviewable (issue #190).
|
|
164
|
+
const key = `${packageName}\0${subpath}`;
|
|
165
|
+
const cached = answers.get(key);
|
|
166
|
+
if (cached !== undefined)
|
|
167
|
+
return cached;
|
|
168
|
+
const answer = measure(packageName, subpath);
|
|
169
|
+
answers.set(key, answer);
|
|
170
|
+
return answer;
|
|
171
|
+
};
|
|
172
|
+
function measure(packageName, subpath) {
|
|
173
|
+
const directory = directories.get(packageName);
|
|
174
|
+
// A package this reader was not given is one nobody asked it to measure;
|
|
175
|
+
// the caller's own map decided that, so the fail-closed answer is a reach.
|
|
176
|
+
if (directory === undefined)
|
|
177
|
+
return { kind: 'undeclared', runtimeExports: [] };
|
|
178
|
+
const manifest = manifestOf(packageName, directory);
|
|
179
|
+
if (manifest === null) {
|
|
180
|
+
throw new UnreadableSubpathError(packageName, subpath, `no readable package manifest at ${join(directory, 'package.json')}`);
|
|
181
|
+
}
|
|
182
|
+
const exports = manifest.exports;
|
|
183
|
+
if (exports === null || typeof exports !== 'object' || Array.isArray(exports)) {
|
|
184
|
+
return { kind: 'undeclared', runtimeExports: [] };
|
|
185
|
+
}
|
|
186
|
+
const entries = exports;
|
|
187
|
+
const declaredKey = subpath === '' ? '.' : `./${subpath}`;
|
|
188
|
+
if (!Object.prototype.hasOwnProperty.call(entries, declaredKey)) {
|
|
189
|
+
// Includes every wildcard entry (`"./i18n/*"`), which is outside the rule:
|
|
190
|
+
// one key stands for a family of files with no single emitted module to
|
|
191
|
+
// measure, so it stays a reach.
|
|
192
|
+
return { kind: 'undeclared', runtimeExports: [] };
|
|
193
|
+
}
|
|
194
|
+
const target = runtimeTargetOf(entries[declaredKey]);
|
|
195
|
+
if (target === null) {
|
|
196
|
+
throw new UnreadableSubpathError(packageName, subpath, `its '${declaredKey}' entry declares no runtime condition, so there is no emitted ` +
|
|
197
|
+
'module to measure');
|
|
198
|
+
}
|
|
199
|
+
const resolved = isAbsolute(target) ? target : join(directory, normalize(target));
|
|
200
|
+
// `"./package.json": "./package.json"` is a declared subpath of every module
|
|
201
|
+
// package and is not an emitted module. Parsing it as one would find no
|
|
202
|
+
// export and call it contract surface, which is an exemption granted by a
|
|
203
|
+
// wrong reading rather than by a measurement.
|
|
204
|
+
if (!/\.(js|mjs|cjs)$/.test(resolved))
|
|
205
|
+
return { kind: 'not-a-module', runtimeExports: [] };
|
|
206
|
+
if (!reader.exists(resolved)) {
|
|
207
|
+
throw new UnreadableSubpathError(packageName, subpath, `${resolved} does not exist`);
|
|
208
|
+
}
|
|
209
|
+
let runtimeExports;
|
|
210
|
+
filesRead += 1;
|
|
211
|
+
try {
|
|
212
|
+
runtimeExports = runtimeExportsOfEmittedModule(resolved, reader);
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
throw new UnreadableSubpathError(packageName, subpath, `${resolved} could not be read (${error instanceof Error ? error.message : String(error)})`);
|
|
216
|
+
}
|
|
217
|
+
return runtimeExports.length === 0
|
|
218
|
+
? { kind: 'contract', runtimeExports: [] }
|
|
219
|
+
: { kind: 'runtime', runtimeExports };
|
|
220
|
+
}
|
|
221
|
+
return { surfaceOfSubpath, filesRead: () => filesRead };
|
|
222
|
+
}
|
|
223
|
+
//# sourceMappingURL=module-package-subpaths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-package-subpaths.js","sourceRoot":"","sources":["../../src/lib/module-package-subpaths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAExD,OAAO,EACL,gBAAgB,EAChB,6BAA6B,GAE9B,MAAM,sBAAsB,CAAC;AAoB9B,8EAA8E;AAC9E,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC7B,IAAI,GAAG,wBAAwB,CAAC;IACzC,WAAW,CAAS;IACpB,OAAO,CAAS;IAEzB,YAAY,WAAmB,EAAE,OAAe,EAAE,MAAc;QAC9D,KAAK,CACH,uBAAuB,WAAW,eAAe,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,IAAI;YACxF,6CAA6C,MAAM,mCAAmC;YACtF,oFAAoF;YACpF,wEAAwE;YACxE,2DAA2D,CAC9D,CAAC;QACF,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAeD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAA0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@
|
|
|
1
|
+
import { type WorkspaceFs } from './workspace-packages.js';
|
|
2
|
+
/** One workspace member that declares itself a module. */
|
|
3
|
+
export interface ModulePackage {
|
|
4
|
+
/** `endora.id` — the module id, never the directory name (D-142). */
|
|
5
|
+
readonly moduleId: string;
|
|
6
|
+
/** The npm package name; the head of every specifier emitted for it. */
|
|
7
|
+
readonly name: string;
|
|
8
|
+
/** Its directory, absolute. */
|
|
9
|
+
readonly dir: string;
|
|
10
|
+
/** `exports` subpath → target, as declared. Wildcard subpaths are dropped. */
|
|
11
|
+
readonly exports: ReadonlyMap<string, string>;
|
|
12
|
+
/**
|
|
13
|
+
* Where this package's build puts the sources the walk reads, or `null` when
|
|
14
|
+
* it declares no build and therefore publishes them where they are.
|
|
15
|
+
*
|
|
16
|
+
* Both paths are package-relative and `/`-separated, with no trailing slash.
|
|
17
|
+
*/
|
|
18
|
+
readonly emit: EmitLayout | null;
|
|
19
|
+
}
|
|
20
|
+
/** `tsconfig.build.json`'s `rootDir` and `outDir`, package-relative. */
|
|
21
|
+
export interface EmitLayout {
|
|
22
|
+
readonly rootDir: string;
|
|
23
|
+
readonly outDir: string;
|
|
24
|
+
}
|
|
25
|
+
/** Raised when a package cannot be turned into artefact entries. Never skipped. */
|
|
26
|
+
export declare class ModulePackageError extends Error {
|
|
27
|
+
readonly name = "ModulePackageError";
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* `tsconfig.build.json`'s emit layout for one package, or `null` when it has no
|
|
31
|
+
* build configuration at all.
|
|
32
|
+
*
|
|
33
|
+
* Follows a relative `extends` for the same reason `check-release-intent.ts`
|
|
34
|
+
* does: !891's two-config split puts `rootDir` in the build file and everything
|
|
35
|
+
* else in the file it extends, so a reader of one alone finds half an answer.
|
|
36
|
+
* The **nearest** declaration of each key wins, which is what `tsc` itself does.
|
|
37
|
+
*
|
|
38
|
+
* A non-relative `extends` (`"@scope/tsconfig/base"`) is a refusal rather than a
|
|
39
|
+
* stop: this repository has none, and treating one as "no more to read" would
|
|
40
|
+
* silently answer with whatever half of the layout had been found so far.
|
|
41
|
+
*/
|
|
42
|
+
export declare function readEmitLayout(packageDir: string, packageName: string, fs: WorkspaceFs): EmitLayout | null;
|
|
43
|
+
/**
|
|
44
|
+
* Where a source file the walk read ends up in the published artefact.
|
|
45
|
+
*
|
|
46
|
+
* Package-relative in, package-relative out. Without a build layout the answer
|
|
47
|
+
* is the input — a source-shipping package publishes what was walked. With one,
|
|
48
|
+
* a file under `rootDir` moves to the same position under `outDir` and its
|
|
49
|
+
* TypeScript extension becomes the emitted `.js`; a file **outside** `rootDir`
|
|
50
|
+
* is returned unchanged, so it goes on to fail the `exports` match with the
|
|
51
|
+
* message that names the file, rather than being silently relocated to a path
|
|
52
|
+
* the build never writes.
|
|
53
|
+
*/
|
|
54
|
+
export declare function emittedPathOf(pkg: ModulePackage, packageRelativePath: string): string;
|
|
55
|
+
/** The declared, non-wildcard subpaths of a manifest's `exports` block. */
|
|
56
|
+
export declare function declaredExports(manifest: Readonly<Record<string, unknown>>): ReadonlyMap<string, string>;
|
|
57
|
+
/**
|
|
58
|
+
* Every module package this repository declares, sorted by module id.
|
|
59
|
+
*
|
|
60
|
+
* Unlike `lib/module-roots.ts` this does **not** filter by the registered set:
|
|
61
|
+
* the generator is what *produces* the registered set, so filtering by it would
|
|
62
|
+
* make a newly packaged module invisible to the artefact that is supposed to
|
|
63
|
+
* register it — the instrument reading its own output.
|
|
64
|
+
*/
|
|
65
|
+
export declare function discoverModulePackages(repoRoot: string, fs?: WorkspaceFs): readonly ModulePackage[];
|
|
66
|
+
/**
|
|
67
|
+
* How a committed artefact names one file of a module package (D-149).
|
|
68
|
+
*
|
|
69
|
+
* `packageRelativePath` is the file's path inside the package, `/`-separated.
|
|
70
|
+
* The answer is the **longest** covering target's subpath, so a package that
|
|
71
|
+
* declares both `./backend` and a narrower `./backend/entities` gets the
|
|
72
|
+
* narrower one — the same "most specific wins" rule Node's own resolver applies
|
|
73
|
+
* to an `exports` map.
|
|
74
|
+
*/
|
|
75
|
+
export declare function packageSpecifierFor(pkg: ModulePackage, packageRelativePath: string): string;
|
|
76
|
+
/**
|
|
77
|
+
* A **published** package's own entry point — the file `import '<name>'` loads.
|
|
78
|
+
*
|
|
79
|
+
* The source-tree locators search text for a marker, because a source tree
|
|
80
|
+
* declares nowhere which of its files is the manifest. A published package does
|
|
81
|
+
* declare it: the `.` subpath of its `exports` map is the package's statement
|
|
82
|
+
* about its own entry point, so the marker search is not merely unavailable
|
|
83
|
+
* here (there is no `.ts` to search), it is the wrong question. A third-party
|
|
84
|
+
* author's published manifest is a plain object literal and names
|
|
85
|
+
* `defineModuleManifest` nowhere.
|
|
86
|
+
*
|
|
87
|
+
* A package declaring no `.` subpath, or one whose target is not on disk, is a
|
|
88
|
+
* **refusal**: an artefact would name a specifier the package refuses with
|
|
89
|
+
* `ERR_PACKAGE_PATH_NOT_EXPORTED`, and skipping it is how a module drops out of
|
|
90
|
+
* a client's admin bundle or documentation with no error anywhere.
|
|
91
|
+
*/
|
|
92
|
+
export declare function publishedManifestEntryOf(pkg: ModulePackage): {
|
|
93
|
+
manifestPath: string;
|
|
94
|
+
manifestSpecifier: string;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Is this source file the one a declared subpath points **at** — a barrel?
|
|
98
|
+
*
|
|
99
|
+
* `module-package-layout.md` §1 puts a module package's migrations under
|
|
100
|
+
* `src/migrations/`, and the `./migrations` subpath has to name a file, so the
|
|
101
|
+
* directory holds one that is not a migration: the barrel re-exporting the
|
|
102
|
+
* classes, which is what makes `import { Migration… } from
|
|
103
|
+
* '<pkg>/migrations'` resolve. `collectMigrations` refuses an unrecognised
|
|
104
|
+
* `.ts` in a migrations directory — correctly, because skipping one is how a
|
|
105
|
+
* migration goes missing without a word — so it needs to tell the barrel from
|
|
106
|
+
* a misnamed migration.
|
|
107
|
+
*
|
|
108
|
+
* It is answered from the **package's own `exports` map** rather than from
|
|
109
|
+
* `contracts/naming-convention.md` §4's allow-list, which is keyed on
|
|
110
|
+
* application paths and would have to grow an entry per package. A file a
|
|
111
|
+
* subpath points at is an entry point by declaration; a file that merely sits
|
|
112
|
+
* beside it is not.
|
|
113
|
+
*/
|
|
114
|
+
export declare function isDeclaredEntryPoint(pkg: ModulePackage, packageRelativePath: string): boolean;
|
|
115
|
+
/** A file's path inside its package, `/`-separated. */
|
|
116
|
+
export declare function packageRelativePathOf(pkg: ModulePackage, absolutePath: string): string;
|
|
117
|
+
/** The absolute path a package-relative path names. */
|
|
118
|
+
export declare function absolutePathInPackage(pkg: ModulePackage, packageRelativePath: string): string;
|
|
119
|
+
/** The filesystem questions the installed walk asks beyond {@link WorkspaceFs}. */
|
|
120
|
+
export interface InstanceFs extends WorkspaceFs {
|
|
121
|
+
/**
|
|
122
|
+
* The real path of a directory, or `null` when it cannot be resolved.
|
|
123
|
+
*
|
|
124
|
+
* Required rather than optional: without it the linked-package rule below
|
|
125
|
+
* cannot be decided, and a walk that cannot decide it would report a
|
|
126
|
+
* workspace link as an installed package — the one shape whose consequence is
|
|
127
|
+
* an admin bundle naming a module the backend never composed.
|
|
128
|
+
*/
|
|
129
|
+
readonly realPath: (path: string) => string | null;
|
|
130
|
+
}
|
|
131
|
+
/** The real filesystem behind {@link InstanceFs}. Absence is `null`, never a throw. */
|
|
132
|
+
export declare function nodeInstanceFs(): InstanceFs;
|
|
133
|
+
/** A candidate the installed walk read and did not accept, with the reason. */
|
|
134
|
+
export type SkippedInstalledPackage = {
|
|
135
|
+
/**
|
|
136
|
+
* A **linked** package — `link:`, `file:`, or a pnpm workspace member —
|
|
137
|
+
* whose real directory is outside the `node_modules` it was reached
|
|
138
|
+
* through.
|
|
139
|
+
*
|
|
140
|
+
* It is excluded rather than refused because the running platform excludes
|
|
141
|
+
* it too, and for the same reason: the two must agree about which modules
|
|
142
|
+
* an instance has. An artefact naming it would put a screen in the admin
|
|
143
|
+
* bundle for a module the backend never composes.
|
|
144
|
+
* `specs/110-instance-repository/contracts/instance-repository.md` §8 is
|
|
145
|
+
* what a client does instead.
|
|
146
|
+
*/
|
|
147
|
+
readonly kind: 'links-out-of-node-modules';
|
|
148
|
+
readonly name: string;
|
|
149
|
+
readonly at: string;
|
|
150
|
+
readonly realPath: string;
|
|
151
|
+
} | {
|
|
152
|
+
readonly kind: 'unreadable';
|
|
153
|
+
readonly at: string;
|
|
154
|
+
readonly reason: string;
|
|
155
|
+
};
|
|
156
|
+
/** What one walk of an instance's `node_modules` found. */
|
|
157
|
+
export interface InstalledModulePackageScan {
|
|
158
|
+
/** Accepted packages, sorted by module id — the same order the workspace walk uses. */
|
|
159
|
+
readonly packages: readonly ModulePackage[];
|
|
160
|
+
/** Candidates that claimed to be modules and were not taken, each with a reason. */
|
|
161
|
+
readonly skipped: readonly SkippedInstalledPackage[];
|
|
162
|
+
/** The `node_modules` root that was read. Empty when there is none. */
|
|
163
|
+
readonly root: string | null;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Every module package an instance installed, with what was skipped and why.
|
|
167
|
+
*
|
|
168
|
+
* `instanceRoot` is the directory whose `node_modules` holds them — the client's
|
|
169
|
+
* repository root. A root with no `node_modules` reads as *nothing to read*
|
|
170
|
+
* (`root: null`) rather than as *no module installed*, so a caller can tell an
|
|
171
|
+
* uninstalled instance from a module-less one.
|
|
172
|
+
*/
|
|
173
|
+
export declare function scanInstalledModulePackages(instanceRoot: string, fs?: InstanceFs): InstalledModulePackageScan;
|
|
174
|
+
/** {@link scanInstalledModulePackages}' accepted half. */
|
|
175
|
+
export declare function installedModulePackages(instanceRoot: string, fs?: InstanceFs): readonly ModulePackage[];
|
|
176
|
+
/** The installed host package, as this walk can see it. */
|
|
177
|
+
export interface InstalledPlatformPackage {
|
|
178
|
+
readonly name: string;
|
|
179
|
+
/** Its directory in the instance's `node_modules`, absolute. */
|
|
180
|
+
readonly dir: string;
|
|
181
|
+
/** `exports` subpath → target, as declared. Wildcard subpaths are dropped. */
|
|
182
|
+
readonly exports: ReadonlyMap<string, string>;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* The platform an instance installed, or `null` when none resolves.
|
|
186
|
+
*
|
|
187
|
+
* The same walk and the same three rules as {@link scanInstalledModulePackages},
|
|
188
|
+
* one `endora.type` value over: the discriminator is the package's own
|
|
189
|
+
* declaration and never its name, which is `platform-root.ts`' rule applied to
|
|
190
|
+
* an installed tree rather than to a workspace. The scope was `@b2b/` until
|
|
191
|
+
* D-161 and a name written into a tool is a rename away from a walk that
|
|
192
|
+
* silently sees nothing.
|
|
193
|
+
*
|
|
194
|
+
* Two installed packages declaring it is an error rather than a first-one-wins,
|
|
195
|
+
* for the reason `platform-root.ts` refuses the same state in a workspace: the
|
|
196
|
+
* walk would narrow to whichever sorted first and report on it as if it were the
|
|
197
|
+
* platform.
|
|
198
|
+
*/
|
|
199
|
+
export declare function scanInstalledPlatformPackage(instanceRoot: string, fs?: InstanceFs): InstalledPlatformPackage | null;
|
|
200
|
+
//# sourceMappingURL=module-packages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-packages.d.ts","sourceRoot":"","sources":["../../src/lib/module-packages.ts"],"names":[],"mappings":"AAmFA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAEjC,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;CAClC;AAED,wEAAwE;AACxE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OA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