@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,205 @@
|
|
|
1
|
+
/** One module package, as the analysis needs it. */
|
|
2
|
+
export interface ModulePackageSurface {
|
|
3
|
+
/** The module id of record — `endora.id`, never a path segment (D-142). */
|
|
4
|
+
readonly moduleId: string;
|
|
5
|
+
/** The npm name its published artefact is reached by. */
|
|
6
|
+
readonly npmName: string;
|
|
7
|
+
/** Its directory, as a key in the same namespace as {@link SingletonIdentityInput.sources}. */
|
|
8
|
+
readonly root: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Everything the analysis reads, and nothing it computes.
|
|
12
|
+
*
|
|
13
|
+
* Specifier resolution happens *inside* the analysis over this key set rather
|
|
14
|
+
* than through an injected resolver, so a red proof drives the resolution too
|
|
15
|
+
* (issue #130): a fixture that handed in pre-resolved targets would prove the
|
|
16
|
+
* predicates and leave the step that finds them unproven, which is where a
|
|
17
|
+
* `.js` → `.ts` rewrite or an `index.ts` directory target goes wrong.
|
|
18
|
+
*/
|
|
19
|
+
export interface SingletonIdentityInput {
|
|
20
|
+
/** Repo-relative key → source text, for every file the walk opened. */
|
|
21
|
+
readonly sources: ReadonlyMap<string, string>;
|
|
22
|
+
readonly packages: readonly ModulePackageSurface[];
|
|
23
|
+
}
|
|
24
|
+
export type SingletonIdentityFindingKind = 'composed-singleton-reach' | 'chain-parent-reach' | 'whole-file-reach' | 'stale-allowance';
|
|
25
|
+
export interface SingletonIdentityFinding {
|
|
26
|
+
readonly kind: SingletonIdentityFindingKind;
|
|
27
|
+
/** The file holding the second copy, or the ledger key for a stale entry. */
|
|
28
|
+
readonly file: string;
|
|
29
|
+
readonly line: number;
|
|
30
|
+
/** The package whose source is reached. */
|
|
31
|
+
readonly moduleId: string;
|
|
32
|
+
/** The reached source file, in the same key namespace. */
|
|
33
|
+
readonly target: string;
|
|
34
|
+
/** The duplicated binding, where the finding names one. */
|
|
35
|
+
readonly binding: string | null;
|
|
36
|
+
/** Why the platform holds the other copy — printed to the author. */
|
|
37
|
+
readonly why: string;
|
|
38
|
+
}
|
|
39
|
+
export interface SingletonIdentityResult {
|
|
40
|
+
readonly findings: readonly SingletonIdentityFinding[];
|
|
41
|
+
/** Reaches into a module package's source that the run examined. */
|
|
42
|
+
readonly sites: number;
|
|
43
|
+
/** Composed singletons derived from the packages' own sources. */
|
|
44
|
+
readonly singletons: number;
|
|
45
|
+
/** Module packages the derivation found at least one entity class for. */
|
|
46
|
+
readonly packagesWithEntities: readonly string[];
|
|
47
|
+
/**
|
|
48
|
+
* The tenant-chain parents this walk named, and which of them it resolved to
|
|
49
|
+
* a classified entity class — the `tenant-chains` reconciliation.
|
|
50
|
+
*
|
|
51
|
+
* Two authors answer it: the `@TransitivelyScoped` decorator on the *child*
|
|
52
|
+
* (which module owns the child is nobody's choice but the chain's) and the
|
|
53
|
+
* `@Entity()` class declaration of the *parent*, in another module and, since
|
|
54
|
+
* batch four, in another workspace member. A walk that stopped reading one of
|
|
55
|
+
* the two roots leaves a parent named and unresolved, which is #215 over this
|
|
56
|
+
* population.
|
|
57
|
+
*/
|
|
58
|
+
readonly chainParentNames: readonly string[];
|
|
59
|
+
readonly resolvedChainParentNames: readonly string[];
|
|
60
|
+
/** `@TransitivelyScoped` sites whose parent argument is not a string literal. */
|
|
61
|
+
readonly unreadableChainParents: readonly string[];
|
|
62
|
+
/** Chain parents that live in a module package — the signal's actual subject. */
|
|
63
|
+
readonly chainParentSubjects: readonly ChainParentSubject[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Which walked file a relative specifier written in `fromKey` names, or `null`.
|
|
67
|
+
*
|
|
68
|
+
* Only relative specifiers: a bare one is a package boundary and is conjunct 1's
|
|
69
|
+
* business, not conjunct 2's.
|
|
70
|
+
*/
|
|
71
|
+
export declare function resolveRelative(fromKey: string, specifier: string, keys: ReadonlySet<string>): string | null;
|
|
72
|
+
type ExportKind = 'value' | 'class' | 'entity' | 'function';
|
|
73
|
+
/**
|
|
74
|
+
* What each name a file exports *is*, at module scope.
|
|
75
|
+
*
|
|
76
|
+
* The distinction that matters is `value` (one object, created when the module
|
|
77
|
+
* evaluates) against `function` / `class` (code, re-created identically by a
|
|
78
|
+
* second evaluation and only identity-bearing where somebody compares it —
|
|
79
|
+
* which is `identity-comparison`'s job). `entity` is a class the ORM keys its
|
|
80
|
+
* metadata on, so a second one is a lookup miss.
|
|
81
|
+
*/
|
|
82
|
+
export declare function exportedKinds(key: string, text: string): Map<string, ExportKind>;
|
|
83
|
+
/** `<file>#<name>` — the identity of a binding, in one namespace. */
|
|
84
|
+
export declare function bindingKey(file: string, name: string): string;
|
|
85
|
+
/**
|
|
86
|
+
* Every binding the platform holds exactly one of, derived from the packages'
|
|
87
|
+
* own sources.
|
|
88
|
+
*
|
|
89
|
+
* Two derivations and no third, each naming the thing that holds the other copy:
|
|
90
|
+
* the **container** (`asValue` / `asFunction(() => x)` / `asClass`) and the
|
|
91
|
+
* **ORM** (a member of the `entities` array). Both are read as literal AST
|
|
92
|
+
* nodes, so a mention in a comment contributes nothing.
|
|
93
|
+
*/
|
|
94
|
+
export declare function composedSingletons(input: SingletonIdentityInput): Map<string, string>;
|
|
95
|
+
/**
|
|
96
|
+
* Every class name a `@TransitivelyScoped` decorator names as a tenant parent,
|
|
97
|
+
* and the persisted children that name it.
|
|
98
|
+
*
|
|
99
|
+
* Read as literal AST nodes — a decorator on a class declaration, whose callee
|
|
100
|
+
* is that identifier and whose first argument is a string literal — so the files
|
|
101
|
+
* that merely *mention* the decorator in prose, in a contract's doc block or in
|
|
102
|
+
* a string fixture contribute nothing.
|
|
103
|
+
*
|
|
104
|
+
* **The child must also be `@Entity()`, and that conjunct is the population
|
|
105
|
+
* rather than a tidy-up.** Feature 050's classification is total over
|
|
106
|
+
* *persisted* entities, so a real chain's child is one; a `@TransitivelyScoped`
|
|
107
|
+
* on a plain class registers into the same in-process registry and never
|
|
108
|
+
* reaches ORM discovery. Measured on this tree, dropping the conjunct yields 31
|
|
109
|
+
* parent names of which 29 are the tenancy suite's own synthetic fixtures
|
|
110
|
+
* (`CycleA`, `DeepGlobalTerminus`, `AnEntityThisPlatformDoesNotHave`), each of
|
|
111
|
+
* which would put a name nothing declares into the reconciliation below. It is
|
|
112
|
+
* derived from the decorator rather than from a path exclusion on `test/` on
|
|
113
|
+
* purpose: a rule keyed on where a file sits stops being true the day a tree
|
|
114
|
+
* moves, which is what `moved-module-tree.test.ts` exists to refuse.
|
|
115
|
+
*
|
|
116
|
+
* `unreadable` is the other outcome and it is a refusal rather than a skip: a
|
|
117
|
+
* computed first argument (`@TransitivelyScoped(PARENT, 'fk')`) is a chain this
|
|
118
|
+
* walk cannot name, and a population quietly one shorter than it should be is
|
|
119
|
+
* the whole of issue #113.
|
|
120
|
+
*/
|
|
121
|
+
export interface TransitiveParentScan {
|
|
122
|
+
/** Parent class name → the child class names scoped through it. */
|
|
123
|
+
readonly parents: ReadonlyMap<string, readonly string[]>;
|
|
124
|
+
/** `<file>:<line>` for every decorator whose parent argument is not a literal. */
|
|
125
|
+
readonly unreadable: readonly string[];
|
|
126
|
+
}
|
|
127
|
+
export declare function transitiveParents(sources: ReadonlyMap<string, string>): TransitiveParentScan;
|
|
128
|
+
/**
|
|
129
|
+
* Where each `@Entity()` class the walk read is declared, by class name.
|
|
130
|
+
*
|
|
131
|
+
* The independent half of the `tenant-chains` reconciliation: the decorator on
|
|
132
|
+
* the child names a parent, and this says whether the walk reached the file that
|
|
133
|
+
* declares it. Pre-filtered on the decorator's own text, so it parses the ~230
|
|
134
|
+
* files that hold an entity rather than all 3200.
|
|
135
|
+
*/
|
|
136
|
+
export declare function entityClassLocations(sources: ReadonlyMap<string, string>): Map<string, string[]>;
|
|
137
|
+
/**
|
|
138
|
+
* A class whose duplication the platform **refuses** rather than tolerates.
|
|
139
|
+
*
|
|
140
|
+
* The intersection of two derivations, both off the artefacts: a class the ORM
|
|
141
|
+
* registered from a package's own `entities` array (conjunct 2, exactly as the
|
|
142
|
+
* named-binding signal asks it), and a class name some `@TransitivelyScoped`
|
|
143
|
+
* decorator names as a parent. `resolveTransitiveParent` keys the tenancy
|
|
144
|
+
* registry on the class **name** and refuses an ambiguous one rather than
|
|
145
|
+
* guessing (D-170), so a second registration of that name is
|
|
146
|
+
* `UnresolvableTenantParentError` at ORM init.
|
|
147
|
+
*/
|
|
148
|
+
export interface ChainParentSubject {
|
|
149
|
+
/** The file declaring the class — what a reach has to load to duplicate it. */
|
|
150
|
+
readonly file: string;
|
|
151
|
+
readonly className: string;
|
|
152
|
+
/** The package whose published artefact holds the first copy. */
|
|
153
|
+
readonly moduleId: string;
|
|
154
|
+
/** The `@TransitivelyScoped` children that name it, for the message. */
|
|
155
|
+
readonly children: readonly string[];
|
|
156
|
+
}
|
|
157
|
+
export declare function chainParentSubjects(input: SingletonIdentityInput, scan?: TransitiveParentScan, composed?: ReadonlyMap<string, string>): ChainParentSubject[];
|
|
158
|
+
/** How a file reaches a chain parent: the hop count and the path it took. */
|
|
159
|
+
export interface ChainParentHit {
|
|
160
|
+
readonly subject: ChainParentSubject;
|
|
161
|
+
/** Value-import hops from this file to the declaring one. 0 = it *is* it. */
|
|
162
|
+
readonly hops: number;
|
|
163
|
+
/** The shortest path, declaring file last. */
|
|
164
|
+
readonly via: readonly string[];
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* For every walked file, the chain parents its own value-import closure loads.
|
|
168
|
+
*
|
|
169
|
+
* A **reverse** breadth-first walk from each subject rather than a forward one
|
|
170
|
+
* per reach: the subjects are few and the reaches are many, so this is one BFS
|
|
171
|
+
* per duplicated class over the whole edge set instead of one per site, and it
|
|
172
|
+
* yields the *shortest* path for free — which is what the message prints, and
|
|
173
|
+
* what makes the depth question answerable rather than assumed.
|
|
174
|
+
*
|
|
175
|
+
* **No depth limit**, and the measurement rather than the taste is the reason:
|
|
176
|
+
* over this repository the real hits sit at 1 and 2 hops, and the walk to
|
|
177
|
+
* exhaustion costs 0.1 s of a 13 s run (feature 080, T061a). A cap would be a
|
|
178
|
+
* number written down that the next service extraction — one more file between
|
|
179
|
+
* the test and the entity — would silently step past, which is the failure mode
|
|
180
|
+
* this check's own header spends four paragraphs on.
|
|
181
|
+
*/
|
|
182
|
+
export declare function chainParentReaches(edges: ReadonlyMap<string, readonly string[]>, subjects: readonly ChainParentSubject[]): Map<string, ChainParentHit[]>;
|
|
183
|
+
/** The whole analysis, pure over {@link SingletonIdentityInput}. */
|
|
184
|
+
export declare function checkSingletonIdentity(input: SingletonIdentityInput, allowed: Readonly<Record<string, string>>): SingletonIdentityResult;
|
|
185
|
+
/**
|
|
186
|
+
* Every TypeScript source under `dir`, with the rule's own directory prunes.
|
|
187
|
+
*
|
|
188
|
+
* Exported because the population is part of the rule: two hosts computing
|
|
189
|
+
* "which files this check reads" two ways is the shape that lets one of them go
|
|
190
|
+
* half-blind.
|
|
191
|
+
*/
|
|
192
|
+
export declare function collectSingletonSources(dir: string, out?: string[]): string[];
|
|
193
|
+
/**
|
|
194
|
+
* Which module packages the committed ORM registry imports an `entities` array
|
|
195
|
+
* from — the independent derivation the walk is reconciled against (issue #244).
|
|
196
|
+
*
|
|
197
|
+
* It is a second author's answer to the same question: the registry is generated
|
|
198
|
+
* from a filesystem walk of the packages' `exports` maps and names each package
|
|
199
|
+
* by its bare specifier, while this check derives entities from each package's
|
|
200
|
+
* own source. A walk that stopped reading a package's sources makes the two
|
|
201
|
+
* disagree in the same run.
|
|
202
|
+
*/
|
|
203
|
+
export declare function packagesInEntitiesRegistry(source: string, npmNames: ReadonlySet<string>): string[];
|
|
204
|
+
export {};
|
|
205
|
+
//# sourceMappingURL=singleton-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singleton-identity.d.ts","sourceRoot":"","sources":["../../src/rules/singleton-identity.ts"],"names":[],"mappings":"AA2MA,oDAAoD;AACpD,MAAM,WAAW,oBAAoB;IACnC,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,+FAA+F;IAC/F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACrC,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,QAAQ,CAAC,QAAQ,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACpD;AAED,MAAM,MAAM,4BAA4B,GACpC,0BAA0B,GAC1B,oBAAoB,GACpB,kBAAkB,GAClB,iBAAiB,CAAC;AAEtB,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,4BAA4B,CAAC;IAC5C,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,2DAA2D;IAC3D,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,qEAAqE;IACrE,QAAQ,CAAC,GAAG,EAAE,M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