@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,70 @@
|
|
|
1
|
+
import { type ModulePackage } from './module-packages.js';
|
|
2
|
+
/** Does a path exist? Injected so a proof enters at the top of the analysis. */
|
|
3
|
+
export type PathProbe = (path: string) => boolean;
|
|
4
|
+
/** The "do not edit" header this repository's own generator writes. */
|
|
5
|
+
export declare const COMPOSER_REGISTRY_HEADER: string;
|
|
6
|
+
/** The same, for the stylesheet, whose comment syntax is CSS's. */
|
|
7
|
+
export declare const COMPOSER_STYLESHEET_HEADER: string;
|
|
8
|
+
/** One module package's admin contribution, as the artefact names it. */
|
|
9
|
+
export interface AdminContributionEntry {
|
|
10
|
+
/** `endora.id`, the identity of record (D-142). */
|
|
11
|
+
readonly moduleId: string;
|
|
12
|
+
/** The bare specifier, derived from the package's own `exports` map (D-149). */
|
|
13
|
+
readonly specifier: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Every module package that ships an admin layer, sorted by module id.
|
|
17
|
+
*
|
|
18
|
+
* **Discovery is the package's own statement about itself** (R2): the `endora`
|
|
19
|
+
* block says it is a module, and the presence of `src/admin/index.ts` says it
|
|
20
|
+
* contributes. Nothing keys on a directory name and `packages/modules` is
|
|
21
|
+
* spelled nowhere (D-100).
|
|
22
|
+
*
|
|
23
|
+
* **A module with the layer and no `./admin` subpath is refused, not skipped**
|
|
24
|
+
* (R4). `packageSpecifierFor` raises `ModulePackageError` naming the file and
|
|
25
|
+
* the declared subpaths, because a skip is how a whole layer goes missing
|
|
26
|
+
* without a word — the same reason a packaged migration covered by no declared
|
|
27
|
+
* subpath is refused rather than dropped.
|
|
28
|
+
*/
|
|
29
|
+
export declare function collectAdminContributions(packages: readonly ModulePackage[], exists?: PathProbe): readonly AdminContributionEntry[];
|
|
30
|
+
/** Pure render of the admin registry, exported so a test can drive it. */
|
|
31
|
+
export declare function emitAdminRegistry(entries: readonly AdminContributionEntry[], header?: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Where the registry lands: the source root of the workspace member declaring
|
|
34
|
+
* the `"@/*"` alias.
|
|
35
|
+
*
|
|
36
|
+
* Derived rather than spelled, for the reason `lib/admin-surfaces.ts` gives at
|
|
37
|
+
* length: that alias is what `tsc` and Vite both resolve the admin's own
|
|
38
|
+
* imports through, so it is a live declaration, and zero or two members
|
|
39
|
+
* declaring it is a refusal rather than a walk narrowed to whichever sorted
|
|
40
|
+
* first.
|
|
41
|
+
*/
|
|
42
|
+
export declare function adminRegistryOutputPathIn(root: string): string;
|
|
43
|
+
/** One package whose `./tailwind.css` the host imports. */
|
|
44
|
+
export interface TailwindSourceEntry {
|
|
45
|
+
/** The npm name, which is also the sort key (R2.1). */
|
|
46
|
+
readonly name: string;
|
|
47
|
+
/** The specifier the artefact writes — `<name>/tailwind.css`. */
|
|
48
|
+
readonly specifier: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Every package the host imports a source declaration from, sorted by name.
|
|
52
|
+
*
|
|
53
|
+
* **The population is FR-005's widened by one predicate** (R2.2): the admin
|
|
54
|
+
* contribution registry's is *"declares `./admin`"*, this one's is *"declares
|
|
55
|
+
* `./tailwind.css`"* — a superset, because it also holds the shell and the kit
|
|
56
|
+
* family, which contribute UI and contribute no registry entry.
|
|
57
|
+
*
|
|
58
|
+
* That superset relation is asserted rather than assumed: a package the registry
|
|
59
|
+
* imports and this does not is a **refusal**. It is the one state in which the
|
|
60
|
+
* whole mechanism fails silently in the direction it exists to prevent — the
|
|
61
|
+
* screen is registered, the bundle builds, and every class only that module
|
|
62
|
+
* declares is dropped. `manifests:generate` renders both halves from one layer
|
|
63
|
+
* inventory, so this state means the two artefacts were committed apart.
|
|
64
|
+
*/
|
|
65
|
+
export declare function collectTailwindSources(root: string, packages: readonly ModulePackage[], exists?: PathProbe): readonly TailwindSourceEntry[];
|
|
66
|
+
/** Pure render of the generated stylesheet, exported so a test can drive it. */
|
|
67
|
+
export declare function emitTailwindRegistry(entries: readonly TailwindSourceEntry[], header?: string): string;
|
|
68
|
+
/** Where the generated stylesheet lands: beside the admin contribution registry. */
|
|
69
|
+
export declare function tailwindRegistryOutputPathIn(root: string): string;
|
|
70
|
+
//# sourceMappingURL=admin-artefacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-artefacts.d.ts","sourceRoot":"","sources":["../../src/lib/admin-artefacts.ts"],"names":[],"mappings":"AAyCA,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAK9B,gFAAgF;AAChF,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;AAElD,uEAAuE;AACvE,eAAO,MAAM,wBAAwB,QAImC,CAAC;AAEzE,mEAAmE;AACnE,eAAO,MAAM,0BAA0B,QAIiC,CAAC;AAazE,yEAAyE;AACzE,MAAM,WAAW,sBAAsB;IACrC,mDAAmD;IACnD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,gFAAgF;IAChF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,SAAS,aAAa,EAAE,EAClC,MAAM,GAAE,SAAsB,GAC7B,SAAS,sBAAsB,EAAE,CAQnC;AAwED,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,SAAS,sBAAsB,EAAE,EAC1C,MAAM,GAAE,MAAiC,GACxC,MAAM,CAwDR;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI9D;AAID,2DAA2D;AAC3D,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAoED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,SAAS,aAAa,EAAE,EAClC,MAAM,GAAE,SAAsB,GAC7B,SAAS,mBAAmB,EAAE,CAqBhC;AAQD,gFAAgF;AAChF,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,mBAAmB,EAAE,EACvC,MAAM,GAAE,MAAmC,GAC1C,MAAM,CAsBR;AAED,oFAAoF;AACpF,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIjE"}
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two artefacts an admin project cannot be built without, and the one
|
|
3
|
+
* derivation that renders them for **both** trees.
|
|
4
|
+
*
|
|
5
|
+
* ## Why they are here rather than in `composer:generate`
|
|
6
|
+
*
|
|
7
|
+
* `contracts/instance-repository.md` R3.5 and `contracts/instance-tree.md` §2.6:
|
|
8
|
+
* the population is a parameter — this repository's workspace members when
|
|
9
|
+
* `composer:generate` asks, the packages `node_modules` holds when a client's
|
|
10
|
+
* instance asks — and the *renderer* is one program either way. Until this move
|
|
11
|
+
* the renderer lived in `backend/scripts/generate-composer.ts`, which no client
|
|
12
|
+
* can reach: `backend` is not a published package, so an instance's admin member
|
|
13
|
+
* had a file manifest (§2.4) and no way to produce the two files that manifest
|
|
14
|
+
* says are generated. A second implementation inside the CLI would have been two
|
|
15
|
+
* answers to one population — the shape D-100 is about, and the one
|
|
16
|
+
* `admin-stylesheet-composition.md` R2.2 already refuses between the renderer
|
|
17
|
+
* and its guard.
|
|
18
|
+
*
|
|
19
|
+
* ## What each is for, in one sentence each
|
|
20
|
+
*
|
|
21
|
+
* * **the admin contribution registry** — Vite is a static build, so the
|
|
22
|
+
* module set has to enter the bundle from the project being built; a package
|
|
23
|
+
* cannot name a file in the project that consumes it (R3.2).
|
|
24
|
+
* * **the admin stylesheet enumeration** — Tailwind is a static scan, and a
|
|
25
|
+
* package's utilities are dropped **in silence** when it is not scanned
|
|
26
|
+
* (`admin-stylesheet-composition.md` R2, M12). Same walk, one predicate
|
|
27
|
+
* wider: *declares `./tailwind.css`* rather than *declares `./admin`*.
|
|
28
|
+
*
|
|
29
|
+
* ## The header is a parameter, and that is not decoration
|
|
30
|
+
*
|
|
31
|
+
* The two artefacts carry a "regenerate me with" line, and the command that
|
|
32
|
+
* regenerates them is not the same one in the two trees —
|
|
33
|
+
* `pnpm --filter backend run composer:generate` here, `endora generate` in an
|
|
34
|
+
* instance. A header written into the renderer would send a client to a script
|
|
35
|
+
* their tree does not have. The defaults are this repository's, so
|
|
36
|
+
* `composer:generate`'s committed bytes are unchanged by the move and
|
|
37
|
+
* `overlay:check` is what says so.
|
|
38
|
+
*/
|
|
39
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
40
|
+
import { dirname, join, resolve } from 'node:path';
|
|
41
|
+
import { absolutePathInPackage, ModulePackageError, packageSpecifierFor, } from './module-packages.js';
|
|
42
|
+
import { ADMIN_REGISTRY_ARTEFACT, findAliasMember } from './admin-surfaces.js';
|
|
43
|
+
import { nodeWorkspaceFs, workspaceMembers } from './workspace-packages.js';
|
|
44
|
+
import { TAILWIND_REGISTRY_ARTEFACT, TAILWIND_SOURCE_SUBPATH } from './tailwind-sources.js';
|
|
45
|
+
/** The "do not edit" header this repository's own generator writes. */
|
|
46
|
+
export const COMPOSER_REGISTRY_HEADER = `// AUTO-GENERATED by scripts/generate-composer.ts — DO NOT EDIT.\n` +
|
|
47
|
+
`// Run \`pnpm --filter backend run composer:generate\` (or rebuild the backend)\n` +
|
|
48
|
+
`// to refresh. Editing this file by hand is undone by the next build, and\n` +
|
|
49
|
+
`// \`pnpm --filter backend run overlay:check\` fails on the drift.\n`;
|
|
50
|
+
/** The same, for the stylesheet, whose comment syntax is CSS's. */
|
|
51
|
+
export const COMPOSER_STYLESHEET_HEADER = `/* AUTO-GENERATED by scripts/generate-composer.ts — DO NOT EDIT.\n` +
|
|
52
|
+
` * Run \`pnpm --filter backend run composer:generate\` to refresh. Editing this\n` +
|
|
53
|
+
` * file by hand is undone by the next build, and\n` +
|
|
54
|
+
` * \`pnpm --filter backend run overlay:check\` fails on the drift.\n`;
|
|
55
|
+
// ── the admin contribution registry ─────────────────────────────────────────
|
|
56
|
+
/** The layer a module package publishes its admin contributions from. */
|
|
57
|
+
const ADMIN_LAYER = 'admin';
|
|
58
|
+
/** Where a module package that ships **sources** keeps that layer. */
|
|
59
|
+
const ADMIN_LAYER_ENTRY = `src/${ADMIN_LAYER}/index.ts`;
|
|
60
|
+
/** Where a module package that ships **sources** keeps them at all. */
|
|
61
|
+
const PACKAGE_SOURCE_ROOT = 'src';
|
|
62
|
+
/**
|
|
63
|
+
* Every module package that ships an admin layer, sorted by module id.
|
|
64
|
+
*
|
|
65
|
+
* **Discovery is the package's own statement about itself** (R2): the `endora`
|
|
66
|
+
* block says it is a module, and the presence of `src/admin/index.ts` says it
|
|
67
|
+
* contributes. Nothing keys on a directory name and `packages/modules` is
|
|
68
|
+
* spelled nowhere (D-100).
|
|
69
|
+
*
|
|
70
|
+
* **A module with the layer and no `./admin` subpath is refused, not skipped**
|
|
71
|
+
* (R4). `packageSpecifierFor` raises `ModulePackageError` naming the file and
|
|
72
|
+
* the declared subpaths, because a skip is how a whole layer goes missing
|
|
73
|
+
* without a word — the same reason a packaged migration covered by no declared
|
|
74
|
+
* subpath is refused rather than dropped.
|
|
75
|
+
*/
|
|
76
|
+
export function collectAdminContributions(packages, exists = existsSync) {
|
|
77
|
+
const found = [];
|
|
78
|
+
for (const pkg of packages) {
|
|
79
|
+
const specifier = adminLayerSpecifierOf(pkg, exists);
|
|
80
|
+
if (specifier === null)
|
|
81
|
+
continue;
|
|
82
|
+
found.push({ moduleId: pkg.moduleId, specifier });
|
|
83
|
+
}
|
|
84
|
+
return found.sort((a, b) => a.moduleId.localeCompare(b.moduleId));
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The bare specifier of one package's admin layer, or `null` when it ships none.
|
|
88
|
+
*
|
|
89
|
+
* **Two shapes of package, one question, and the evidence decides which is
|
|
90
|
+
* being asked** (`specs/110-instance-repository/` FR-005). A package this
|
|
91
|
+
* repository holds ships its sources, so the layer is a source file and the
|
|
92
|
+
* specifier comes from taking that file through the package's emit layout and
|
|
93
|
+
* its `exports` map, exactly as it always has. A package an **instance**
|
|
94
|
+
* installed ships `dist` and nothing else — its `files` list carries no `src/`
|
|
95
|
+
* — so the only evidence it can offer is its own `exports` map, and the layer
|
|
96
|
+
* is the subpath whose target covers a directory named {@link ADMIN_LAYER}.
|
|
97
|
+
*
|
|
98
|
+
* **Which question is asked is decided by the package's own declaration, not by
|
|
99
|
+
* a fallback.** A package that declares a build layout — `tsconfig.build.json`,
|
|
100
|
+
* which is in no published package's `files` list — ships sources and is judged
|
|
101
|
+
* by its sources, full stop. Without that clause a member whose admin layer was
|
|
102
|
+
* **deleted** would go on contributing out of a stale `dist/admin/`, because
|
|
103
|
+
* `tsc` does not remove what it no longer emits, and the registry would name a
|
|
104
|
+
* screen whose source is gone. The `src/` probe is the same statement for a
|
|
105
|
+
* package that ships sources and declares no build at all.
|
|
106
|
+
*
|
|
107
|
+
* A source layer the `exports` map does not cover is still a refusal, and
|
|
108
|
+
* `packageSpecifierFor` is what raises it (R4): a skip is how a whole layer
|
|
109
|
+
* goes missing without a word.
|
|
110
|
+
*/
|
|
111
|
+
function adminLayerSpecifierOf(pkg, exists) {
|
|
112
|
+
const shipsSources = pkg.emit !== null || exists(absolutePathInPackage(pkg, PACKAGE_SOURCE_ROOT));
|
|
113
|
+
if (shipsSources) {
|
|
114
|
+
return exists(absolutePathInPackage(pkg, ADMIN_LAYER_ENTRY))
|
|
115
|
+
? packageSpecifierFor(pkg, ADMIN_LAYER_ENTRY)
|
|
116
|
+
: null;
|
|
117
|
+
}
|
|
118
|
+
return publishedAdminLayerSpecifierOf(pkg, exists);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The declared subpath serving an installed package's admin layer, or `null`.
|
|
122
|
+
*
|
|
123
|
+
* The subpath's **name** is not read — a package may call it anything — and
|
|
124
|
+
* neither is `dist`. What is read is where its target lands: the directory a
|
|
125
|
+
* barrel covers, whose last segment is the layer's. A subpath whose target file
|
|
126
|
+
* is not in the package is a **refusal**, because the registry would import it
|
|
127
|
+
* and Vite would fail to resolve it at bundle time, which is a failure a client
|
|
128
|
+
* cannot attribute to anything.
|
|
129
|
+
*/
|
|
130
|
+
function publishedAdminLayerSpecifierOf(pkg, exists) {
|
|
131
|
+
for (const [subpath, target] of pkg.exports) {
|
|
132
|
+
if (subpath === './package.json')
|
|
133
|
+
continue;
|
|
134
|
+
const relativePath = target.replace(/^\.\//, '');
|
|
135
|
+
const directory = dirname(relativePath);
|
|
136
|
+
if (directory.split('/').pop() !== ADMIN_LAYER)
|
|
137
|
+
continue;
|
|
138
|
+
if (!exists(absolutePathInPackage(pkg, relativePath))) {
|
|
139
|
+
throw new ModulePackageError(`[composer] ${pkg.name} exports '${subpath}' as ${target}, and that file is not in ` +
|
|
140
|
+
`the package. The admin registry imports the layer by that specifier, so an entry ` +
|
|
141
|
+
`for it would break the bundle; dropping it instead is how a client loses a screen ` +
|
|
142
|
+
`they installed with no error anywhere.`);
|
|
143
|
+
}
|
|
144
|
+
return `${pkg.name}/${subpath.replace(/^\.\//, '')}`;
|
|
145
|
+
}
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
/** A JS identifier for one entry's import binding — `import_export` → `contributions0`. */
|
|
149
|
+
function adminBindingOf(index) {
|
|
150
|
+
return `contributions${index}`;
|
|
151
|
+
}
|
|
152
|
+
/** Pure render of the admin registry, exported so a test can drive it. */
|
|
153
|
+
export function emitAdminRegistry(entries, header = COMPOSER_REGISTRY_HEADER) {
|
|
154
|
+
const imports = entries
|
|
155
|
+
.map((entry, index) => `import { contributions as ${adminBindingOf(index)} } from '${entry.specifier}';`)
|
|
156
|
+
.join('\n');
|
|
157
|
+
const body = entries
|
|
158
|
+
.map((entry, index) => ` { moduleId: '${entry.moduleId}', contributions: ${adminBindingOf(index)} },`)
|
|
159
|
+
.join('\n');
|
|
160
|
+
return `${header}//
|
|
161
|
+
// The admin contribution registry — every module package's \`./admin\` layer,
|
|
162
|
+
// named by the bare specifier its own \`exports\` map declares (feature 091,
|
|
163
|
+
// \`contracts/admin-registry.md\`).
|
|
164
|
+
//
|
|
165
|
+
// It exists because \`admin/src/App.tsx\` and \`admin/src/components/AppShell.tsx\`
|
|
166
|
+
// were the last two registries a module author had to hand-edit. Measured over
|
|
167
|
+
// the twelve most recently added modules, 11 of 12 edited each of them, while
|
|
168
|
+
// every backend registration point they also used to edit — the composition,
|
|
169
|
+
// the two \`db/\` registries, the manifest index, the permission inventory — had
|
|
170
|
+
// already been converted to a generator or a derivation. This is that remedy,
|
|
171
|
+
// applied to the two that were left.
|
|
172
|
+
//
|
|
173
|
+
// **Enumerable without being executed.** Every route and zone component in a
|
|
174
|
+
// contribution is a \`() => import('…')\` factory, so importing this file costs
|
|
175
|
+
// the declarations and none of the screens: Vite splits one chunk per module
|
|
176
|
+
// and an operator downloads only what their role can reach.
|
|
177
|
+
//
|
|
178
|
+
// **The registry answers "what could be here", never "what is here now".**
|
|
179
|
+
// Presence and permission are applied at render by \`isSurfaceVisible\`, the one
|
|
180
|
+
// predicate the sidebar, the palette and the dashboard already share — an
|
|
181
|
+
// operator's activation flip must take effect without a rebuild (Principle XVII
|
|
182
|
+
// item 5), and a registry that filtered would make it a restart.
|
|
183
|
+
//
|
|
184
|
+
// **Bare core under every value of \`DEPLOYMENT\`** (D-104), like the manifest
|
|
185
|
+
// index: a deployment's overlay modules are discovered at runtime and
|
|
186
|
+
// contribute to no committed artefact.
|
|
187
|
+
|
|
188
|
+
import type { AdminContributions } from '@endora-commerce/admin-kit/contributions';
|
|
189
|
+
|
|
190
|
+
${imports}
|
|
191
|
+
|
|
192
|
+
/** One module's contribution set, keyed by the module id that shipped it. */
|
|
193
|
+
export interface AdminRegistryEntry {
|
|
194
|
+
readonly moduleId: string;
|
|
195
|
+
readonly contributions: AdminContributions;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export const MODULE_ADMIN_CONTRIBUTIONS: readonly AdminRegistryEntry[] = [
|
|
199
|
+
${body}
|
|
200
|
+
];
|
|
201
|
+
`;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Where the registry lands: the source root of the workspace member declaring
|
|
205
|
+
* the `"@/*"` alias.
|
|
206
|
+
*
|
|
207
|
+
* Derived rather than spelled, for the reason `lib/admin-surfaces.ts` gives at
|
|
208
|
+
* length: that alias is what `tsc` and Vite both resolve the admin's own
|
|
209
|
+
* imports through, so it is a live declaration, and zero or two members
|
|
210
|
+
* declaring it is a refusal rather than a walk narrowed to whichever sorted
|
|
211
|
+
* first.
|
|
212
|
+
*/
|
|
213
|
+
export function adminRegistryOutputPathIn(root) {
|
|
214
|
+
const members = workspaceMembers(root, nodeWorkspaceFs());
|
|
215
|
+
const { member, target } = findAliasMember(members);
|
|
216
|
+
return join(resolve(member.dir, target), ADMIN_REGISTRY_ARTEFACT);
|
|
217
|
+
}
|
|
218
|
+
/** Every dependency name one manifest declares, or `[]` when it is not there. */
|
|
219
|
+
function declaredDependencyNames(manifestPath, exists) {
|
|
220
|
+
if (!exists(manifestPath))
|
|
221
|
+
return [];
|
|
222
|
+
const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
|
|
223
|
+
const declared = manifest['dependencies'];
|
|
224
|
+
if (typeof declared !== 'object' || declared === null || Array.isArray(declared))
|
|
225
|
+
return [];
|
|
226
|
+
return Object.keys(declared);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* The packages this tree composes, resolved to their directories.
|
|
230
|
+
*
|
|
231
|
+
* **A declared dependency is the population**, and it is the one derivation
|
|
232
|
+
* that answers identically in both trees: a bare specifier resolves only
|
|
233
|
+
* through a declared dependency, so a package nothing declares is a package
|
|
234
|
+
* whose stylesheet could not be imported anyway (M10). Nothing keys on a scope,
|
|
235
|
+
* a `mod-` prefix or a directory (D-100).
|
|
236
|
+
*
|
|
237
|
+
* **Two manifests, unioned, because the two trees put the declaration in
|
|
238
|
+
* different places and both are correct.** Here `manifests:generate` reconciles
|
|
239
|
+
* every contributing module into `admin/package.json`, so the admin's own
|
|
240
|
+
* manifest is the complete answer. An instance is scaffolded as a workspace
|
|
241
|
+
* whose *root* holds the module dependencies and whose admin project is a
|
|
242
|
+
* member of it — pnpm links a root dependency into the root `node_modules`,
|
|
243
|
+
* where the admin's own resolution reaches it. Reading only the admin's
|
|
244
|
+
* manifest there would render an artefact naming nothing, which is the silence
|
|
245
|
+
* this whole contract exists to remove.
|
|
246
|
+
*/
|
|
247
|
+
function composedPackageDirectories(root, exists) {
|
|
248
|
+
const members = workspaceMembers(root, nodeWorkspaceFs());
|
|
249
|
+
const { member } = findAliasMember(members);
|
|
250
|
+
const names = [
|
|
251
|
+
...declaredDependencyNames(join(member.dir, 'package.json'), exists),
|
|
252
|
+
...declaredDependencyNames(join(root, 'package.json'), exists),
|
|
253
|
+
];
|
|
254
|
+
const byName = new Map(members.map((entry) => [entry.name, entry.dir]));
|
|
255
|
+
const found = new Map();
|
|
256
|
+
for (const name of names) {
|
|
257
|
+
// A workspace member first, then the installed copy. The order is the one
|
|
258
|
+
// `check:module-boundary` and `overlay:check` already take: a member's own
|
|
259
|
+
// directory is the declaration this repository can change, and following
|
|
260
|
+
// the link instead would answer from whichever checkout `node_modules` was
|
|
261
|
+
// wired to (issue #255).
|
|
262
|
+
const memberDir = byName.get(name);
|
|
263
|
+
const dir = memberDir ?? join(root, 'node_modules', name);
|
|
264
|
+
if (!exists(join(dir, 'package.json')))
|
|
265
|
+
continue;
|
|
266
|
+
found.set(name, dir);
|
|
267
|
+
}
|
|
268
|
+
return found;
|
|
269
|
+
}
|
|
270
|
+
/** Does the package at `dir` declare `./tailwind.css`? R2.1's predicate, off the map. */
|
|
271
|
+
function declaresTailwindSubpath(dir) {
|
|
272
|
+
const text = readFileSync(join(dir, 'package.json'), 'utf8');
|
|
273
|
+
let manifest;
|
|
274
|
+
try {
|
|
275
|
+
manifest = JSON.parse(text);
|
|
276
|
+
}
|
|
277
|
+
catch {
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
280
|
+
return manifest.exports?.[TAILWIND_SOURCE_SUBPATH] !== undefined;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Every package the host imports a source declaration from, sorted by name.
|
|
284
|
+
*
|
|
285
|
+
* **The population is FR-005's widened by one predicate** (R2.2): the admin
|
|
286
|
+
* contribution registry's is *"declares `./admin`"*, this one's is *"declares
|
|
287
|
+
* `./tailwind.css`"* — a superset, because it also holds the shell and the kit
|
|
288
|
+
* family, which contribute UI and contribute no registry entry.
|
|
289
|
+
*
|
|
290
|
+
* That superset relation is asserted rather than assumed: a package the registry
|
|
291
|
+
* imports and this does not is a **refusal**. It is the one state in which the
|
|
292
|
+
* whole mechanism fails silently in the direction it exists to prevent — the
|
|
293
|
+
* screen is registered, the bundle builds, and every class only that module
|
|
294
|
+
* declares is dropped. `manifests:generate` renders both halves from one layer
|
|
295
|
+
* inventory, so this state means the two artefacts were committed apart.
|
|
296
|
+
*/
|
|
297
|
+
export function collectTailwindSources(root, packages, exists = existsSync) {
|
|
298
|
+
const composed = composedPackageDirectories(root, exists);
|
|
299
|
+
const declaring = new Set();
|
|
300
|
+
for (const [name, dir] of composed) {
|
|
301
|
+
if (declaresTailwindSubpath(dir))
|
|
302
|
+
declaring.add(name);
|
|
303
|
+
}
|
|
304
|
+
for (const entry of collectAdminContributions(packages, exists)) {
|
|
305
|
+
const name = packageNameOf(entry.specifier);
|
|
306
|
+
if (declaring.has(name))
|
|
307
|
+
continue;
|
|
308
|
+
throw new ModulePackageError(`[composer] ${name} contributes an admin layer and declares no ` +
|
|
309
|
+
`'${TAILWIND_SOURCE_SUBPATH}'. The generated stylesheet imports one per package, so ` +
|
|
310
|
+
`this module's screens would build and render with none of the utility classes only ` +
|
|
311
|
+
`it declares — silently, because Tailwind reports nothing about a source it never ` +
|
|
312
|
+
`had. Run \`pnpm --filter backend run manifests:generate\`: the subpath is rendered ` +
|
|
313
|
+
`from the same layer inventory as './admin'.`);
|
|
314
|
+
}
|
|
315
|
+
return [...declaring]
|
|
316
|
+
.sort((left, right) => (left < right ? -1 : left > right ? 1 : 0))
|
|
317
|
+
.map((name) => ({ name, specifier: `${name}/tailwind.css` }));
|
|
318
|
+
}
|
|
319
|
+
/** `@endora-commerce/mod-blog/tailwind.css` → `@endora-commerce/mod-blog`. */
|
|
320
|
+
function packageNameOf(specifier) {
|
|
321
|
+
const segments = specifier.split('/');
|
|
322
|
+
return specifier.startsWith('@') ? segments.slice(0, 2).join('/') : segments[0];
|
|
323
|
+
}
|
|
324
|
+
/** Pure render of the generated stylesheet, exported so a test can drive it. */
|
|
325
|
+
export function emitTailwindRegistry(entries, header = COMPOSER_STYLESHEET_HEADER) {
|
|
326
|
+
const imports = entries.map((entry) => `@import "${entry.specifier}";`).join('\n');
|
|
327
|
+
return `${header} *
|
|
328
|
+
* The admin stylesheet composition — one import per package that declares
|
|
329
|
+
* \`./tailwind.css\`, which is where that package's own \`@source\` directives
|
|
330
|
+
* live (\`specs/110-instance-repository/contracts/admin-stylesheet-composition.md\`
|
|
331
|
+
* R2.1).
|
|
332
|
+
*
|
|
333
|
+
* It replaces \`@source "../../packages/**"\`, which was correct here and named a
|
|
334
|
+
* directory that does not exist in a client's instance — where the shell and
|
|
335
|
+
* every module are installed under \`node_modules\`. Tailwind says nothing about a
|
|
336
|
+
* source that matches nothing (M12), so that instance's admin built green and
|
|
337
|
+
* rendered unstyled. Here every failure is a build error instead: a package that
|
|
338
|
+
* is not installed is \`Can't resolve\`, and one whose tarball omits the file is
|
|
339
|
+
* \`ERR_PACKAGE_PATH_NOT_EXPORTED\`.
|
|
340
|
+
*
|
|
341
|
+
* An \`@source\` **adds** to Tailwind's automatic detection rather than replacing
|
|
342
|
+
* it, and that detection is rooted at this Vite project — so the admin's own
|
|
343
|
+
* sources need no directive here (R2.3).
|
|
344
|
+
*/
|
|
345
|
+
${imports}
|
|
346
|
+
`;
|
|
347
|
+
}
|
|
348
|
+
/** Where the generated stylesheet lands: beside the admin contribution registry. */
|
|
349
|
+
export function tailwindRegistryOutputPathIn(root) {
|
|
350
|
+
const members = workspaceMembers(root, nodeWorkspaceFs());
|
|
351
|
+
const { member, target } = findAliasMember(members);
|
|
352
|
+
return join(resolve(member.dir, target), TAILWIND_REGISTRY_ARTEFACT);
|
|
353
|
+
}
|
|
354
|
+
//# sourceMappingURL=admin-artefacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-artefacts.js","sourceRoot":"","sources":["../../src/lib/admin-artefacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,GAEpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EA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