@wildo-ai/platform-config-lib 1.1.11 → 1.1.12
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/dist/esm/_unimplemented/soft-warn.d.ts +24 -49
- package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
- package/dist/esm/_unimplemented/soft-warn.js +24 -49
- package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
- package/dist/esm/blueprint/anchored-region.d.ts.map +1 -1
- package/dist/esm/blueprint/anchored-region.js.map +1 -1
- package/dist/esm/blueprint/blueprint.schemas.d.ts +0 -89
- package/dist/esm/blueprint/blueprint.schemas.d.ts.map +1 -1
- package/dist/esm/blueprint/blueprint.schemas.js.map +1 -1
- package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts +8 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js +15 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +10 -2
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js +10 -2
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/platform-store-preconnect.d.ts +21 -0
- package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-store-preconnect.js +25 -0
- package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts +80 -0
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts.map +1 -0
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js +81 -0
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js.map +1 -0
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +41 -9
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-backing-service-access.js +77 -28
- package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
- package/dist/esm/bootstrap/runtime-network-policy.d.ts +117 -12
- package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-policy.js +222 -23
- package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.d.ts +31 -4
- package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.js +43 -2
- package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
- package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +40 -2
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-principal.contracts.js +66 -3
- package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
- package/dist/esm/bootstrap/runtime-response-integrity.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-response-integrity.js +3 -3
- package/dist/esm/bootstrap/runtime-response-integrity.js.map +1 -1
- package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-secret-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
- package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts.map +1 -1
- package/dist/esm/canonical-json/rfc8785-canonical-json.js.map +1 -1
- package/dist/esm/config-authoring.entry.d.ts.map +1 -1
- package/dist/esm/config-authoring.entry.js.map +1 -1
- package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
- package/dist/esm/credentials/credential-generator.service.js.map +1 -1
- package/dist/esm/index.d.ts +5 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts +119 -0
- package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/application-legacy-envelope-key.contracts.js +109 -0
- package/dist/esm/key-management/application-legacy-envelope-key.contracts.js.map +1 -0
- package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts +182 -0
- package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/application-signing-key-rotation.contracts.js +145 -0
- package/dist/esm/key-management/application-signing-key-rotation.contracts.js.map +1 -0
- package/dist/esm/key-management/approval-seal-manifested-copy.d.ts +156 -0
- package/dist/esm/key-management/approval-seal-manifested-copy.d.ts.map +1 -0
- package/dist/esm/key-management/approval-seal-manifested-copy.js +617 -0
- package/dist/esm/key-management/approval-seal-manifested-copy.js.map +1 -0
- package/dist/esm/key-management/approval-seal-verifier.d.ts +101 -39
- package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -1
- package/dist/esm/key-management/approval-seal-verifier.js +134 -12
- package/dist/esm/key-management/approval-seal-verifier.js.map +1 -1
- package/dist/esm/key-management/approval-seal.contracts.d.ts +12 -15
- package/dist/esm/key-management/approval-seal.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/approval-seal.contracts.js +20 -0
- package/dist/esm/key-management/approval-seal.contracts.js.map +1 -1
- package/dist/esm/key-management/data-key.contracts.d.ts +0 -2
- package/dist/esm/key-management/data-key.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/data-key.contracts.js.map +1 -1
- package/dist/esm/key-management/es256-jws.d.ts.map +1 -1
- package/dist/esm/key-management/es256-jws.js.map +1 -1
- package/dist/esm/key-management/key-provider.spi.d.ts +8 -1
- package/dist/esm/key-management/key-provider.spi.d.ts.map +1 -1
- package/dist/esm/key-management/key-provider.spi.js.map +1 -1
- package/dist/esm/key-management/keyring-rotation.contracts.d.ts +2 -12
- package/dist/esm/key-management/keyring-rotation.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/keyring-rotation.contracts.js +3 -3
- package/dist/esm/key-management/keyring-rotation.contracts.js.map +1 -1
- package/dist/esm/key-management/keyring-status.contracts.d.ts +0 -7
- package/dist/esm/key-management/keyring-status.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/keyring-status.contracts.js.map +1 -1
- package/dist/esm/key-management/pdf-incremental-update.d.ts +158 -0
- package/dist/esm/key-management/pdf-incremental-update.d.ts.map +1 -0
- package/dist/esm/key-management/pdf-incremental-update.js +730 -0
- package/dist/esm/key-management/pdf-incremental-update.js.map +1 -0
- package/dist/esm/key-management/pdf-truetype-font.d.ts +35 -0
- package/dist/esm/key-management/pdf-truetype-font.d.ts.map +1 -0
- package/dist/esm/key-management/pdf-truetype-font.js +152 -0
- package/dist/esm/key-management/pdf-truetype-font.js.map +1 -0
- package/dist/esm/key-management/qr-code.d.ts +38 -0
- package/dist/esm/key-management/qr-code.d.ts.map +1 -0
- package/dist/esm/key-management/qr-code.js +325 -0
- package/dist/esm/key-management/qr-code.js.map +1 -0
- package/dist/esm/key-management/signature-request.contracts.d.ts +0 -4
- package/dist/esm/key-management/signature-request.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/signature-request.contracts.js.map +1 -1
- package/dist/esm/key-management/signing-log-export.contracts.d.ts +0 -1
- package/dist/esm/key-management/signing-log-export.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/signing-log-export.contracts.js.map +1 -1
- package/dist/esm/key-management/vault-custody.contracts.d.ts +43 -0
- package/dist/esm/key-management/vault-custody.contracts.d.ts.map +1 -1
- package/dist/esm/key-management/vault-custody.contracts.js +66 -0
- package/dist/esm/key-management/vault-custody.contracts.js.map +1 -1
- package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
- package/dist/esm/lockfile/build-parallelism.js.map +1 -1
- package/dist/esm/lockfile/canonical-json.d.ts +1 -1
- package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
- package/dist/esm/lockfile/canonical-json.js +1 -1
- package/dist/esm/lockfile/canonical-json.js.map +1 -1
- package/dist/esm/lockfile/file-lock-hold.d.ts.map +1 -1
- package/dist/esm/lockfile/file-lock-hold.js +2 -1
- package/dist/esm/lockfile/file-lock-hold.js.map +1 -1
- package/dist/esm/lockfile/lockfile-io.d.ts +6 -8
- package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
- package/dist/esm/lockfile/lockfile-io.js +6 -8
- package/dist/esm/lockfile/lockfile-io.js.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.d.ts +5 -6
- package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.js +4 -5
- package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +1 -247
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
- package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts +146 -0
- package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts.map +1 -0
- package/dist/esm/pnpm-settings/application-pnpm-settings.js +573 -0
- package/dist/esm/pnpm-settings/application-pnpm-settings.js.map +1 -0
- package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
- package/dist/esm/project-config/application-public-pricing-catalog.loader.js +15 -3
- package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
- package/dist/esm/project-config/application-served-public-documents.loader.d.ts.map +1 -1
- package/dist/esm/project-config/application-served-public-documents.loader.js +16 -8
- package/dist/esm/project-config/application-served-public-documents.loader.js.map +1 -1
- package/dist/esm/project-config/backend-compliance-section.reader.d.ts +35 -0
- package/dist/esm/project-config/backend-compliance-section.reader.d.ts.map +1 -0
- package/dist/esm/project-config/backend-compliance-section.reader.js +123 -0
- package/dist/esm/project-config/backend-compliance-section.reader.js.map +1 -0
- package/dist/esm/project-config/backend-compliance-section.worker.d.ts +20 -0
- package/dist/esm/project-config/backend-compliance-section.worker.d.ts.map +1 -0
- package/dist/esm/project-config/backend-compliance-section.worker.js +78 -0
- package/dist/esm/project-config/backend-compliance-section.worker.js.map +1 -0
- package/dist/esm/project-config/config-module-resolution.d.ts +32 -0
- package/dist/esm/project-config/config-module-resolution.d.ts.map +1 -0
- package/dist/esm/project-config/config-module-resolution.js +33 -0
- package/dist/esm/project-config/config-module-resolution.js.map +1 -0
- package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-framework-config.js.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.d.ts +109 -55
- package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.js +108 -70
- package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/define-minion-config.d.ts +26 -36
- package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-minion-config.js +64 -25
- package/dist/esm/project-config/define-minion-config.js.map +1 -1
- package/dist/esm/project-config/define-saas-config.d.ts +41 -437
- package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-saas-config.js +102 -94
- package/dist/esm/project-config/define-saas-config.js.map +1 -1
- package/dist/esm/project-config/define-worker-config.d.ts +10 -20
- package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-worker-config.js +10 -12
- package/dist/esm/project-config/define-worker-config.js.map +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.js +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/index.d.ts +2 -0
- package/dist/esm/project-config/index.d.ts.map +1 -1
- package/dist/esm/project-config/index.js +2 -0
- package/dist/esm/project-config/index.js.map +1 -1
- package/dist/esm/project-config/loader-instances-zod.d.ts +19 -0
- package/dist/esm/project-config/loader-instances-zod.d.ts.map +1 -0
- package/dist/esm/project-config/loader-instances-zod.js +40 -0
- package/dist/esm/project-config/loader-instances-zod.js.map +1 -0
- package/dist/esm/project-config/loader.d.ts +131 -14
- package/dist/esm/project-config/loader.d.ts.map +1 -1
- package/dist/esm/project-config/loader.js +226 -12
- package/dist/esm/project-config/loader.js.map +1 -1
- package/dist/esm/project-config/minion-liveness.contracts.d.ts +131 -0
- package/dist/esm/project-config/minion-liveness.contracts.d.ts.map +1 -0
- package/dist/esm/project-config/minion-liveness.contracts.js +167 -0
- package/dist/esm/project-config/minion-liveness.contracts.js.map +1 -0
- package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
- package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
- package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
- package/dist/esm/project-config/npm-version-range.js.map +1 -1
- package/dist/esm/project-config/owning-package-tsconfig.d.ts +7 -7
- package/dist/esm/project-config/owning-package-tsconfig.d.ts.map +1 -1
- package/dist/esm/project-config/owning-package-tsconfig.js +7 -7
- package/dist/esm/project-config/owning-package-tsconfig.js.map +1 -1
- package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
- package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.js +3 -1
- package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts +71 -46
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.js +150 -4
- package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +0 -2
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.d.ts +0 -17
- package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts +9 -10
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.js +13 -15
- package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/cdn.schemas.d.ts +0 -51
- package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.d.ts +34 -6
- package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.js +52 -8
- package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.d.ts +60 -13
- package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.js +77 -24
- package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.d.ts +72 -84
- package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.js +40 -12
- package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/data-services.schemas.d.ts +0 -8
- package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.d.ts +95 -8
- package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.js +122 -10
- package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +10 -4
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +20 -0
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.js +21 -2
- package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
- package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
- package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
- package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts +62 -36
- package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-key-management.schemas.js +105 -3
- package/dist/esm/project-config/shared/platform-key-management.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +2 -2
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-storage.schemas.js +16 -2
- package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +21 -23
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/service-definitions.schemas.js +4 -5
- package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +0 -18
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
- package/dist/esm/project-config/static-asset-import-noop.d.ts +20 -3
- package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
- package/dist/esm/project-config/static-asset-import-noop.js +36 -20
- package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
- package/dist/esm/registry/artifact-domain.schemas.d.ts +0 -5
- package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
- package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
- package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/digest.schemas.js.map +1 -1
- package/dist/esm/registry/index.d.ts +2 -3
- package/dist/esm/registry/index.d.ts.map +1 -1
- package/dist/esm/registry/index.js +2 -3
- package/dist/esm/registry/index.js.map +1 -1
- package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
- package/dist/esm/registry/local-checkout-source.js.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +1 -98
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.js +1 -2
- package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
- package/dist/esm/registry/module-artifact.schemas.d.ts +17 -17
- package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.d.ts +151 -219
- package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.js +145 -13
- package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
- package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-search.schemas.js.map +1 -1
- package/dist/esm/registry/registry-config.schemas.d.ts +0 -18
- package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
- package/dist/esm/registry/registry-config.schemas.js.map +1 -1
- package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
- package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
- package/dist/esm/registry/registry-errors.d.ts +81 -3
- package/dist/esm/registry/registry-errors.d.ts.map +1 -1
- package/dist/esm/registry/registry-errors.js +185 -4
- package/dist/esm/registry/registry-errors.js.map +1 -1
- package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -1
- package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
- package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
- package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
- package/dist/esm/registry/registry-url-resolution.d.ts.map +1 -1
- package/dist/esm/registry/registry-url-resolution.js.map +1 -1
- package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
- package/dist/esm/release/framework-release.constants.js.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.d.ts +0 -7
- package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.d.ts +2 -2
- package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
- package/dist/esm/workspace-scope/index.d.ts.map +1 -1
- package/dist/esm/workspace-scope/index.js.map +1 -1
- package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
- package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/dist/esm/_unimplemented/index.d.ts +0 -3
- package/dist/esm/_unimplemented/index.d.ts.map +0 -1
- package/dist/esm/_unimplemented/index.js +0 -3
- package/dist/esm/_unimplemented/index.js.map +0 -1
- package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +0 -137
- package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +0 -1
- package/dist/esm/_unimplemented/unimplemented-field-warning.js +0 -153
- package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +0 -1
- package/dist/esm/project-config/shared/cdn.example.d.ts +0 -14
- package/dist/esm/project-config/shared/cdn.example.d.ts.map +0 -1
- package/dist/esm/project-config/shared/cdn.example.js +0 -38
- package/dist/esm/project-config/shared/cdn.example.js.map +0 -1
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts +0 -15
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +0 -1
- package/dist/esm/project-config/shared/schema-version.schemas.js +0 -40
- package/dist/esm/project-config/shared/schema-version.schemas.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application-pnpm-settings.js","sourceRoot":"","sources":["../../../src/pnpm-settings/application-pnpm-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,+DAA+D;AAC/D,MAAM,CAAN,IAAY,kB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UAAU,8BAA8B,CAAC,eAAuB;IACpE,MAAM,QAAQ,GAAG,2BAA2B,CAAC,eAAe,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAkC,EAAE,CAAC;IACjD,IAAI,QAAQ,CAAC,OAAO,CAAC,SAAS,KAAK,kBAAkB,CAAC,YAAY;QAAE,MAAM,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,IAAI,EAAE,CAAC;IAChH,IAAI,QAAQ,CAAC,OAAO,CAAC,qBAAqB,KAAK,kBAAkB,CAAC,YAAY;QAAE,MAAM,CAAC,qBAAqB,GAAG,QAAQ,CAAC,qBAAqB,IAAI,EAAE,CAAC;IACpJ,IAAI,QAAQ,CAAC,OAAO,CAAC,sBAAsB,KAAK,kBAAkB,CAAC,YAAY;QAAE,MAAM,CAAC,sBAAsB,GAAG,QAAQ,CAAC,sBAAsB,IAAI,EAAE,CAAC;IACvJ,IAAI,QAAQ,CAAC,OAAO,CAAC,mBAAmB,KAAK,kBAAkB,CAAC,YAAY;QAAE,MAAM,CAAC,mBAAmB,GAAG,QAAQ,CAAC,mBAAmB,IAAI,EAAE,CAAC;IAC9I,MAAM,MAAM,GAAG,4BAA4B,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IACrE,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;AAC5G,CAAC","sourcesContent":["import { existsSync, readFileSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\n\n/**\n * The ONE place that decides where an application's pnpm settings live, how they are read and how they are written\n * (#2808). Its twin for the repository's dependency-free scripts is `scripts/pnpm-workspace-settings.mjs`: the same\n * grammar, the same precedence and the same rendering, held byte-for-byte equal by `application-pnpm-settings.parity.test.ts`.\n *\n * ## Where the settings live, measured rather than assumed (2026-11-09, scratch workspaces with local tarballs)\n *\n * | setting | pnpm 10.6.4 (the pin) | pnpm 11.20.0 |\n * |---|---|---|\n * | `overrides` in `pnpm-workspace.yaml` | read | read |\n * | `overrides` in `package.json` → `pnpm` | read, and it REPLACES the YAML block whole (a `package.json` block holding one unrelated key switched off every YAML override) | ignored, with a warning naming the key |\n * | `onlyBuiltDependencies` in `pnpm-workspace.yaml` | read | ignored silently: pnpm 11 REMOVED the setting (`allowBuilds` replaces it) |\n * | `onlyBuiltDependencies` in `package.json` | read, and it replaces the YAML list | ignored, with a warning |\n * | `neverBuiltDependencies`, either file | read; beside an `onlyBuiltDependencies` list in EITHER file, `ERR_PNPM_CONFIG_CONFLICT_BUILT_DEPENDENCIES` | ignored (removed) |\n * | `allowBuilds` in `pnpm-workspace.yaml` | not read (the 10.6.4 binary does not know the key) | read |\n * | `patchedDependencies`, `packageExtensions` in `pnpm-workspace.yaml` | read | read |\n * | the same in `package.json` → `pnpm` | read (a `package.json` `patchedDependencies` is applied in place of the YAML one) | ignored, with a warning |\n *\n * So `pnpm-workspace.yaml` is the one file both versions read, and it is where every writer puts the settings it owns.\n * The two build lists are carried there for the pnpm 10 pin; pnpm 11 needs them restated as `allowBuilds`, which is the\n * pnpm-major bump's own work and is refused by `pnpm check:app-deps` until it is done.\n *\n * ## The precedence a reader must honour\n *\n * pnpm 10.6.4 takes each setting from `package.json` → `pnpm` when that key is present there, and from the workspace\n * file otherwise. {@link readApplicationPnpmSettings} returns exactly that view, with each key's source, so a reader\n * sees what the installed pnpm sees whichever file an older application still keeps its settings in.\n *\n * ## What a write does\n *\n * {@link writeApplicationPnpmSettings} writes each given key into the workspace file and REMOVES the same key from\n * `package.json` → `pnpm` (dropping the field when it empties). Leaving the old copy would be worse than not writing:\n * under pnpm 10 it would keep replacing the new one. Keys a call does not name stay where they are, so a writer that\n * owns one setting never moves another.\n *\n * ## Why the workspace file is parsed by hand\n *\n * This package and the scripts beside the repository must read the file with no YAML dependency (the scripts run with\n * nothing installed; see `scripts/pnpm-workspace-members.mjs`). The grammar of the blocks owned here is small:\n * a map of scalar to scalar, or a list of scalars, plus comments. Anything else inside an owned block (a nested map, a\n * flow collection, a multi-line scalar) is REFUSED with its line number rather than guessed at, and every block this\n * module does not own is kept byte for byte.\n */\n\n/** The application root files that can carry pnpm settings. */\nexport enum PnpmSettingsSource {\n /** `package.json` → `pnpm`: read by pnpm 10, ignored by pnpm 11 (#2808). Never written by Wildo any more. */\n PACKAGE_JSON = 'package.json',\n /** `pnpm-workspace.yaml`: read by pnpm 10 and pnpm 11. Every Wildo writer writes here. */\n WORKSPACE_FILE = 'pnpm-workspace.yaml',\n}\n\n/** The pnpm settings Wildo reads and writes in an application, each a top-level key of the workspace file. */\nexport enum PnpmOwnedSetting {\n /** Version pins: the framework's propagated pins, its `file:` links, provider vendor pins, security floors. */\n OVERRIDES = 'overrides',\n /** The dependencies whose install scripts pnpm 10 runs. A provider module's vendor packages enter here (#2801). */\n ONLY_BUILT_DEPENDENCIES = 'onlyBuiltDependencies',\n /** The dependencies whose install scripts pnpm 10 never runs. Wildo never writes it; it only reads it, since pnpm refuses both lists. */\n NEVER_BUILT_DEPENDENCIES = 'neverBuiltDependencies',\n /** `<name>@<exact version>` → the root-relative patch file pnpm applies after installing that package (#3522). */\n PATCHED_DEPENDENCIES = 'patchedDependencies',\n}\n\n/** The owned settings in the order a workspace file renders them when it has to append them. */\nexport const PNPM_OWNED_SETTINGS: readonly PnpmOwnedSetting[] = [\n PnpmOwnedSetting.OVERRIDES,\n PnpmOwnedSetting.ONLY_BUILT_DEPENDENCIES,\n PnpmOwnedSetting.NEVER_BUILT_DEPENDENCIES,\n PnpmOwnedSetting.PATCHED_DEPENDENCIES,\n];\n\n/** One application's effective pnpm settings, as pnpm 10.6.4 resolves them. */\nexport interface ApplicationPnpmSettings {\n /** `overrides`, or `undefined` when neither file declares the setting. */\n overrides?: Record<string, string>;\n onlyBuiltDependencies?: string[];\n neverBuiltDependencies?: string[];\n patchedDependencies?: Record<string, string>;\n /** Where each declared setting was read from. A setting absent here is declared nowhere. */\n sources: Partial<Record<PnpmOwnedSetting, PnpmSettingsSource>>;\n /**\n * Every key of `package.json` → `pnpm`, owned or not. Non-empty means the application still keeps settings where pnpm 11\n * does not read them: an owned key is moved by the next write of it (or by {@link migrateApplicationPnpmSettings}); an\n * unowned one (`packageExtensions`, `patchedDependencies`, …) is the application's to move.\n */\n packageJsonKeys: string[];\n}\n\n/** A change to an application's settings: a value replaces the setting, `null` removes it, an absent key is left alone. */\nexport interface ApplicationPnpmSettingsUpdate {\n overrides?: Record<string, string> | null;\n onlyBuiltDependencies?: readonly string[] | null;\n neverBuiltDependencies?: readonly string[] | null;\n patchedDependencies?: Record<string, string> | null;\n}\n\n/** What {@link writeApplicationPnpmSettings} changed, so a caller can report it or stay quiet. */\nexport interface ApplicationPnpmSettingsWriteResult {\n /** True when either file's bytes changed. */\n changed: boolean;\n /** The owned keys removed from `package.json` → `pnpm` by this write. */\n movedFromPackageJson: PnpmOwnedSetting[];\n}\n\n/** Thrown for a workspace file or manifest this module cannot read faithfully. The message names the file and line. */\nexport class PnpmSettingsFormatError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'PnpmSettingsFormatError';\n }\n}\n\nconst OWNED_KEYS: ReadonlySet<string> = new Set<string>(PNPM_OWNED_SETTINGS);\nconst MAP_SETTINGS: ReadonlySet<string> = new Set<string>([PnpmOwnedSetting.OVERRIDES, PnpmOwnedSetting.PATCHED_DEPENDENCIES]);\n\n/** One entry of an owned block, with the comment lines written directly above it, which travel with it. */\ninterface OwnedEntry {\n key: string;\n value: string;\n leadingComments: string[];\n}\n\n/** One parsed owned block. `trailingComments` are indented comments after the last entry. */\ninterface OwnedBlock {\n setting: PnpmOwnedSetting;\n entries: OwnedEntry[];\n trailingComments: string[];\n /** The block's own lines as read, rendered back unchanged unless a write replaces the block. */\n raw?: string[];\n}\n\n/** A workspace file split into top-level segments. An owned block is parsed; everything else is kept verbatim. */\ntype WorkspaceSegment = { kind: 'verbatim'; lines: string[] } | { kind: 'owned'; block: OwnedBlock };\n\n// A top-level key, plain or quoted (`\"onlyBuiltDependencies\": [...]` is valid YAML and pnpm reads it).\nconst TOP_LEVEL_KEY = /^(?:\"([A-Za-z_][\\w-]*)\"|'([A-Za-z_][\\w-]*)'|([A-Za-z_][\\w-]*))\\s*:(.*)$/;\n\nfunction stripTrailingComment(text: string): string {\n // Only a ` #` outside quotes starts a comment; the scalar parser below handles quoted text first.\n const index = text.search(/\\s#/);\n return (index === -1 ? text : text.slice(0, index)).trim();\n}\n\n/** Parse one scalar at the start of `text`; returns the value and the rest of the text after it. */\nfunction parseScalar(text: string, where: string): { value: string; rest: string } {\n if (text.startsWith(\"'\")) {\n let value = '';\n let i = 1;\n for (;;) {\n if (i >= text.length) throw new PnpmSettingsFormatError(`${where}: unterminated single-quoted scalar.`);\n if (text[i] === \"'\") {\n if (text[i + 1] === \"'\") {\n value += \"'\";\n i += 2;\n continue;\n }\n return { value, rest: text.slice(i + 1) };\n }\n value += text[i];\n i += 1;\n }\n }\n if (text.startsWith('\"')) {\n let value = '';\n let i = 1;\n for (;;) {\n if (i >= text.length) throw new PnpmSettingsFormatError(`${where}: unterminated double-quoted scalar.`);\n const char = text[i];\n if (char === '\\\\') {\n const next = text[i + 1];\n if (next !== '\"' && next !== '\\\\') throw new PnpmSettingsFormatError(`${where}: escape \\\\${next ?? ''} is not supported; use single quotes.`);\n value += next;\n i += 2;\n continue;\n }\n if (char === '\"') return { value, rest: text.slice(i + 1) };\n value += char;\n i += 1;\n }\n }\n return { value: '', rest: text };\n}\n\n/** Parse a whole scalar that must make up `text` (a list item, or a map value), refusing what this grammar does not hold. */\nfunction parseWholeScalar(text: string, where: string): string {\n const trimmed = text.trim();\n if (trimmed.startsWith(\"'\") || trimmed.startsWith('\"')) {\n const { value, rest } = parseScalar(trimmed, where);\n if (stripTrailingComment(rest) !== '') throw new PnpmSettingsFormatError(`${where}: unexpected text after a quoted scalar.`);\n return value;\n }\n const plain = stripTrailingComment(trimmed);\n if (plain === '' || /^[[{|>&*!%@`]/.test(plain) || plain.includes(': ')) {\n throw new PnpmSettingsFormatError(`${where}: '${plain}' is not a scalar this reader supports; quote it with single quotes.`);\n }\n return plain;\n}\n\n/** The items of a flow list's inside, split at commas outside quotes; nested collections are refused. */\nfunction splitFlowItems(inside: string, where: string): string[] {\n const items: string[] = [];\n let current = '';\n let quote: string | null = null;\n for (const char of inside) {\n if (quote !== null) {\n current += char;\n if (char === quote) quote = null;\n } else if (char === \"'\" || char === '\"') {\n quote = char;\n current += char;\n } else if (char === ',') {\n items.push(current);\n current = '';\n } else if (char === '[' || char === '{') {\n throw new PnpmSettingsFormatError(`${where}: a nested collection is not supported in a flow list.`);\n } else {\n current += char;\n }\n }\n if (current.trim() !== '' || items.length > 0) items.push(current);\n return items.map((item) => item.trim());\n}\n\nfunction parseOwnedBlock(setting: PnpmOwnedSetting, headerRest: string, body: string[], firstLine: number, file: string): OwnedBlock {\n const block: OwnedBlock = { setting, entries: [], trailingComments: [] };\n const header = stripTrailingComment(headerRest);\n if (header === '{}' || (header.startsWith('[') && header.endsWith(']') && !MAP_SETTINGS.has(setting))) {\n if (body.some((line) => line.trim() !== '' && !line.trim().startsWith('#'))) {\n throw new PnpmSettingsFormatError(`${file}:${firstLine}: '${setting}: ${header}' is followed by entries.`);\n }\n // A flow list (`[esbuild, 'sharp']`): its items, split at the commas outside quotes.\n for (const item of splitFlowItems(header.slice(1, -1), `${file}:${firstLine}`)) {\n block.entries.push({ key: parseWholeScalar(item, `${file}:${firstLine}`), value: '', leadingComments: [] });\n }\n return block;\n }\n if (header !== '') throw new PnpmSettingsFormatError(`${file}:${firstLine}: '${setting}' must be a block (one entry per line), not '${header}'.`);\n const isMap = MAP_SETTINGS.has(setting);\n let pending: string[] = [];\n body.forEach((line, offset) => {\n const where = `${file}:${firstLine + 1 + offset}`;\n const trimmed = line.trim();\n if (trimmed === '') return;\n if (trimmed.startsWith('#')) {\n pending.push(line);\n return;\n }\n if (isMap) {\n const { value: quotedKey, rest } = parseScalar(trimmed, where);\n let key: string;\n let afterKey: string;\n if (trimmed.startsWith(\"'\") || trimmed.startsWith('\"')) {\n key = quotedKey;\n afterKey = rest;\n } else {\n const colon = trimmed.indexOf(': ');\n if (colon === -1) throw new PnpmSettingsFormatError(`${where}: '${trimmed}' is not a 'name: value' entry.`);\n key = trimmed.slice(0, colon).trim();\n afterKey = trimmed.slice(colon);\n }\n const match = /^\\s*:\\s(.*)$/.exec(afterKey);\n if (!match) throw new PnpmSettingsFormatError(`${where}: '${trimmed}' is not a 'name: value' entry.`);\n block.entries.push({ key, value: parseWholeScalar(match[1] ?? '', where), leadingComments: pending });\n } else {\n if (!trimmed.startsWith('- ')) throw new PnpmSettingsFormatError(`${where}: '${trimmed}' is not a '- name' list item.`);\n block.entries.push({ key: parseWholeScalar(trimmed.slice(2), where), value: '', leadingComments: pending });\n }\n pending = [];\n });\n block.trailingComments = pending;\n return block;\n}\n\n/** Split a workspace file into segments. Lines between top-level keys that start at column 0 open a verbatim segment. */\nfunction parseWorkspaceFile(text: string, file: string): WorkspaceSegment[] {\n const lines = text.split('\\n');\n if (lines.length > 0 && lines[lines.length - 1] === '') lines.pop();\n const segments: WorkspaceSegment[] = [];\n const seen = new Set<string>();\n let i = 0;\n const pushVerbatim = (line: string): void => {\n const last = segments[segments.length - 1];\n if (last?.kind === 'verbatim') last.lines.push(line);\n else segments.push({ kind: 'verbatim', lines: [line] });\n };\n while (i < lines.length) {\n const line = lines[i] ?? '';\n const match = TOP_LEVEL_KEY.exec(line);\n const key = match ? (match[1] ?? match[2] ?? match[3] ?? '') : '';\n if (match && OWNED_KEYS.has(key)) {\n const setting = key as PnpmOwnedSetting;\n if (seen.has(setting)) throw new PnpmSettingsFormatError(`${file}:${i + 1}: '${setting}' is declared twice.`);\n seen.add(setting);\n const body: string[] = [];\n let j = i + 1;\n // A block runs over blank and indented lines; the first non-blank line at column 0 ends it.\n while (j < lines.length && ((lines[j] ?? '').trim() === '' || /^\\s/.test(lines[j] ?? ''))) {\n body.push(lines[j] ?? '');\n j += 1;\n }\n // Blank lines closing the block belong to the file's layout, not to the block.\n let trailingBlank = 0;\n while (body.length > 0 && (body[body.length - 1] ?? '').trim() === '') {\n body.pop();\n trailingBlank += 1;\n }\n segments.push({ kind: 'owned', block: { ...parseOwnedBlock(setting, match[4] ?? '', body, i + 1, file), raw: [line, ...body] } });\n for (let k = 0; k < trailingBlank; k += 1) pushVerbatim('');\n i = j;\n continue;\n }\n pushVerbatim(line);\n i += 1;\n }\n return segments;\n}\n\n/** Quote a scalar the one way this module writes them: single quotes, a quote doubled. */\nfunction quote(value: string): string {\n return `'${value.replace(/'/g, \"''\")}'`;\n}\n\nfunction renderOwnedBlock(block: OwnedBlock): string[] {\n if (block.raw !== undefined) return block.raw;\n if (block.entries.length === 0 && block.trailingComments.length === 0) {\n return [`${block.setting}: ${MAP_SETTINGS.has(block.setting) ? '{}' : '[]'}`];\n }\n const lines = [`${block.setting}:`];\n for (const entry of block.entries) {\n lines.push(...entry.leadingComments);\n lines.push(MAP_SETTINGS.has(block.setting) ? ` ${quote(entry.key)}: ${quote(entry.value)}` : ` - ${quote(entry.key)}`);\n }\n lines.push(...block.trailingComments);\n return lines;\n}\n\nfunction renderWorkspaceFile(segments: readonly WorkspaceSegment[]): string {\n const lines: string[] = [];\n for (const segment of segments) {\n if (segment.kind === 'verbatim') lines.push(...segment.lines);\n else lines.push(...renderOwnedBlock(segment.block));\n }\n return lines.length === 0 ? '' : `${lines.join('\\n')}\\n`;\n}\n\n/** Code-unit order, the order every Wildo writer of these settings has always used. */\nfunction compareKeys(a: string, b: string): number {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\n/** Whether a block already holds `next`: the same pairs, or the same names, whatever their order. A no-op write writes nothing. */\nfunction sameContents(current: Record<string, string> | string[], next: Record<string, string> | readonly string[]): boolean {\n const pairs = (value: Record<string, string> | readonly string[]): string[] =>\n (Array.isArray(value) ? [...new Set(value as readonly string[])] : Object.entries(value as Record<string, string>).map(([k, v]) => `${k}\\u0000${v}`)).sort();\n return JSON.stringify(pairs(current)) === JSON.stringify(pairs(next));\n}\n\n/** Rebuild a block from new contents, keeping each surviving entry's comments. */\nfunction rebuildBlock(setting: PnpmOwnedSetting, previous: OwnedBlock | undefined, next: Record<string, string> | readonly string[]): OwnedBlock {\n const commentsByKey = new Map((previous?.entries ?? []).map((entry) => [entry.key, entry.leadingComments] as const));\n const pairs: Array<[string, string]> = Array.isArray(next)\n ? [...new Set(next as readonly string[])].map((name) => [name, ''] as [string, string])\n : Object.entries(next as Record<string, string>);\n pairs.sort(([a], [b]) => compareKeys(a, b));\n return {\n setting,\n entries: pairs.map(([key, value]) => ({ key, value, leadingComments: commentsByKey.get(key) ?? [] })),\n trailingComments: previous?.trailingComments ?? [],\n };\n}\n\nfunction blockValue(block: OwnedBlock): Record<string, string> | string[] {\n return MAP_SETTINGS.has(block.setting)\n ? Object.fromEntries(block.entries.map((entry) => [entry.key, entry.value]))\n : block.entries.map((entry) => entry.key);\n}\n\nfunction readManifest(applicationRoot: string): Record<string, unknown> | undefined {\n const path = join(applicationRoot, PnpmSettingsSource.PACKAGE_JSON);\n if (!existsSync(path)) return undefined;\n const parsed: unknown = JSON.parse(readFileSync(path, 'utf8'));\n if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {\n throw new PnpmSettingsFormatError(`${path}: not a JSON object.`);\n }\n return parsed as Record<string, unknown>;\n}\n\nfunction manifestPnpmField(manifest: Record<string, unknown> | undefined, path: string): Record<string, unknown> | undefined {\n const field = manifest?.pnpm;\n if (field === undefined) return undefined;\n if (field === null || typeof field !== 'object' || Array.isArray(field)) {\n throw new PnpmSettingsFormatError(`${path}: the 'pnpm' field is not an object.`);\n }\n return field as Record<string, unknown>;\n}\n\nfunction manifestSetting(field: Record<string, unknown>, setting: PnpmOwnedSetting, path: string): Record<string, string> | string[] {\n const value = field[setting];\n if (MAP_SETTINGS.has(setting)) {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) throw new PnpmSettingsFormatError(`${path}: pnpm.${setting} is not an object.`);\n return Object.fromEntries(Object.entries(value as Record<string, unknown>).map(([key, entry]) => [key, String(entry)]));\n }\n if (!Array.isArray(value)) throw new PnpmSettingsFormatError(`${path}: pnpm.${setting} is not a list.`);\n return value.map(String);\n}\n\n/**\n * The application's effective pnpm settings, as pnpm 10.6.4 reads them: each owned setting from `package.json` → `pnpm`\n * when that key is present there, else from `pnpm-workspace.yaml`. Throws {@link PnpmSettingsFormatError} for a file it\n * cannot read faithfully, never a partial answer.\n */\nexport function readApplicationPnpmSettings(applicationRoot: string): ApplicationPnpmSettings {\n const manifestPath = join(applicationRoot, PnpmSettingsSource.PACKAGE_JSON);\n const workspacePath = join(applicationRoot, PnpmSettingsSource.WORKSPACE_FILE);\n return resolveApplicationPnpmSettingsText({\n manifestText: existsSync(manifestPath) ? readFileSync(manifestPath, 'utf8') : null,\n manifestPath,\n workspaceText: existsSync(workspacePath) ? readFileSync(workspacePath, 'utf8') : null,\n workspacePath,\n });\n}\n\n/**\n * {@link readApplicationPnpmSettings} over the two files' TEXT (`null` for an absent file), for a caller previewing\n * contents it has not written yet (the provider-link reconciliation inside a composition plan).\n */\nexport function resolveApplicationPnpmSettingsText(input: {\n manifestText: string | null;\n manifestPath: string;\n workspaceText: string | null;\n workspacePath: string;\n}): ApplicationPnpmSettings {\n let manifest: Record<string, unknown> | undefined;\n if (input.manifestText !== null) {\n const parsed: unknown = JSON.parse(input.manifestText);\n if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) throw new PnpmSettingsFormatError(`${input.manifestPath}: not a JSON object.`);\n manifest = parsed as Record<string, unknown>;\n }\n const field = manifestPnpmField(manifest, input.manifestPath);\n const workspace = new Map<PnpmOwnedSetting, OwnedBlock>();\n for (const segment of input.workspaceText === null ? [] : parseWorkspaceFile(input.workspaceText, input.workspacePath)) {\n if (segment.kind === 'owned') workspace.set(segment.block.setting, segment.block);\n }\n const settings: ApplicationPnpmSettings = { sources: {}, packageJsonKeys: Object.keys(field ?? {}) };\n const assign = (setting: PnpmOwnedSetting, value: Record<string, string> | string[]): void => {\n if (setting === PnpmOwnedSetting.OVERRIDES) settings.overrides = value as Record<string, string>;\n else if (setting === PnpmOwnedSetting.ONLY_BUILT_DEPENDENCIES) settings.onlyBuiltDependencies = value as string[];\n else if (setting === PnpmOwnedSetting.PATCHED_DEPENDENCIES) settings.patchedDependencies = value as Record<string, string>;\n else settings.neverBuiltDependencies = value as string[];\n };\n for (const setting of PNPM_OWNED_SETTINGS) {\n if (field !== undefined && Object.hasOwn(field, setting)) {\n assign(setting, manifestSetting(field, setting, input.manifestPath));\n settings.sources[setting] = PnpmSettingsSource.PACKAGE_JSON;\n } else if (workspace.has(setting)) {\n assign(setting, blockValue(workspace.get(setting) as OwnedBlock));\n settings.sources[setting] = PnpmSettingsSource.WORKSPACE_FILE;\n }\n }\n return settings;\n}\n\n/**\n * `package.json` text with the given owned settings removed from its `pnpm` field (the field dropped when it empties),\n * formatted as every Wildo writer formats a manifest. Returns `text` itself when none of them is there.\n */\nexport function removePackageJsonPnpmSettingsText(text: string, path: string, settings: readonly PnpmOwnedSetting[]): string {\n const parsed: unknown = JSON.parse(text);\n if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) throw new PnpmSettingsFormatError(`${path}: not a JSON object.`);\n const manifest = parsed as Record<string, unknown>;\n const field = manifestPnpmField(manifest, path);\n if (field === undefined || !settings.some((setting) => Object.hasOwn(field, setting))) return text;\n for (const setting of settings) delete field[setting];\n if (Object.keys(field).length === 0) delete manifest.pnpm;\n return `${JSON.stringify(manifest, null, 2)}\\n`;\n}\n\n/**\n * Place a block the file did not have. Directly ABOVE the `packages:` block (and the column-0 comments written over it)\n * when there is one, because every scenario and provider install adds a workspace member by appending a line at the\n * END of the file: an owned block after `packages:` would receive those member lines as entries. At the end otherwise.\n */\nfunction insertNewBlock(segments: WorkspaceSegment[], block: OwnedBlock): void {\n for (let index = 0; index < segments.length; index += 1) {\n const segment = segments[index];\n if (segment?.kind !== 'verbatim') continue;\n const packagesLine = segment.lines.findIndex((line) => /^packages\\s*:/.test(line));\n if (packagesLine === -1) continue;\n let at = packagesLine;\n while (at > 0 && /^#/.test(segment.lines[at - 1] ?? '')) at -= 1;\n const before = segment.lines.slice(0, at);\n const after = segment.lines.slice(at);\n const inserted: WorkspaceSegment[] = [];\n if (before.length > 0) inserted.push({ kind: 'verbatim', lines: (before[before.length - 1] ?? '') === '' ? before : [...before, ''] });\n else if (segments[index - 1]?.kind === 'owned') inserted.push({ kind: 'verbatim', lines: [''] });\n inserted.push({ kind: 'owned', block }, { kind: 'verbatim', lines: ['', ...after] });\n segments.splice(index, 1, ...inserted);\n return;\n }\n const last = segments[segments.length - 1];\n if (last?.kind === 'verbatim' && (last.lines[last.lines.length - 1] ?? '') !== '') last.lines.push('');\n else if (last?.kind === 'owned') segments.push({ kind: 'verbatim', lines: [''] });\n segments.push({ kind: 'owned', block });\n}\n\n/**\n * The owned settings a workspace file's TEXT declares, for a caller that holds the bytes rather than the file (the\n * composition planner, which edits files in memory before writing any). Same grammar, same refusals, as the file\n * readers above.\n */\nexport function readPnpmWorkspaceSettingsText(text: string, file: string): Partial<Record<PnpmOwnedSetting, Record<string, string> | string[]>> {\n const declared: Partial<Record<PnpmOwnedSetting, Record<string, string> | string[]>> = {};\n for (const segment of parseWorkspaceFile(text, file)) {\n if (segment.kind === 'owned') declared[segment.block.setting] = blockValue(segment.block);\n }\n return declared;\n}\n\n/**\n * A workspace file's text with the given settings replaced (`null` removes one). Untouched blocks, comments and every\n * block this module does not own keep their bytes; a setting whose contents do not change keeps its bytes too, so a\n * no-op update returns `text` itself.\n */\nexport function updatePnpmWorkspaceSettingsText(text: string, file: string, update: ApplicationPnpmSettingsUpdate): string {\n const segments = parseWorkspaceFile(text, file);\n for (const setting of PNPM_OWNED_SETTINGS) {\n if (!Object.hasOwn(update, setting)) continue;\n const next = update[setting as keyof ApplicationPnpmSettingsUpdate];\n const index = segments.findIndex((segment) => segment.kind === 'owned' && segment.block.setting === setting);\n const previous = index === -1 ? undefined : (segments[index] as { kind: 'owned'; block: OwnedBlock }).block;\n if (next === null || next === undefined) {\n if (index !== -1) {\n segments.splice(index, 1);\n // The blank line that separated the block goes with it, so removing a block a write inserted gives the file back.\n const before = segments[index - 1];\n const after = segments[index];\n if (after?.kind === 'verbatim' && after.lines[0] === '' && (before === undefined || (before.kind === 'verbatim' && before.lines[before.lines.length - 1] === ''))) {\n after.lines.shift();\n }\n }\n } else if (previous === undefined || !sameContents(blockValue(previous), next as Record<string, string> | readonly string[])) {\n const block = rebuildBlock(setting, previous, next as Record<string, string> | readonly string[]);\n if (index !== -1) segments[index] = { kind: 'owned', block };\n else insertNewBlock(segments, block);\n }\n }\n const rendered = renderWorkspaceFile(segments);\n return rendered === renderWorkspaceFile(parseWorkspaceFile(text, file)) ? text : rendered;\n}\n\n/**\n * Write the given settings into the application's `pnpm-workspace.yaml` and remove the same keys from `package.json` →\n * `pnpm` (see the module comment for why both). A setting the update does not name is left exactly where it is. Writes\n * a file only when its bytes change; formats the manifest as every Wildo writer does (two-space JSON, final newline).\n */\nexport function writeApplicationPnpmSettings(applicationRoot: string, update: ApplicationPnpmSettingsUpdate): ApplicationPnpmSettingsWriteResult {\n const workspacePath = join(applicationRoot, PnpmSettingsSource.WORKSPACE_FILE);\n const manifestPath = join(applicationRoot, PnpmSettingsSource.PACKAGE_JSON);\n const originalWorkspace = existsSync(workspacePath) ? readFileSync(workspacePath, 'utf8') : '';\n const manifest = readManifest(applicationRoot);\n const field = manifestPnpmField(manifest, manifestPath);\n const movedFromPackageJson: PnpmOwnedSetting[] = [];\n for (const setting of PNPM_OWNED_SETTINGS) {\n if (Object.hasOwn(update, setting) && field !== undefined && Object.hasOwn(field, setting)) {\n delete field[setting];\n movedFromPackageJson.push(setting);\n }\n }\n let changed = false;\n const after = updatePnpmWorkspaceSettingsText(originalWorkspace, workspacePath, update);\n if (after !== originalWorkspace) {\n writeFileSync(workspacePath, after, 'utf8');\n changed = true;\n }\n if (manifest !== undefined && movedFromPackageJson.length > 0) {\n if (field !== undefined && Object.keys(field).length === 0) delete manifest.pnpm;\n writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}\\n`, 'utf8');\n changed = true;\n }\n return { changed, movedFromPackageJson };\n}\n\n/**\n * Move every owned setting `package.json` → `pnpm` still carries into `pnpm-workspace.yaml`, unchanged in value: the\n * effective settings are the same before and after, under pnpm 10, and pnpm 11 starts reading them. Returns the keys\n * of `package.json` → `pnpm` it could not move (settings Wildo does not own), which the caller reports.\n */\nexport function migrateApplicationPnpmSettings(applicationRoot: string): { result: ApplicationPnpmSettingsWriteResult; unownedPackageJsonKeys: string[] } {\n const settings = readApplicationPnpmSettings(applicationRoot);\n const update: ApplicationPnpmSettingsUpdate = {};\n if (settings.sources.overrides === PnpmSettingsSource.PACKAGE_JSON) update.overrides = settings.overrides ?? {};\n if (settings.sources.onlyBuiltDependencies === PnpmSettingsSource.PACKAGE_JSON) update.onlyBuiltDependencies = settings.onlyBuiltDependencies ?? [];\n if (settings.sources.neverBuiltDependencies === PnpmSettingsSource.PACKAGE_JSON) update.neverBuiltDependencies = settings.neverBuiltDependencies ?? [];\n if (settings.sources.patchedDependencies === PnpmSettingsSource.PACKAGE_JSON) update.patchedDependencies = settings.patchedDependencies ?? {};\n const result = writeApplicationPnpmSettings(applicationRoot, update);\n return { result, unownedPackageJsonKeys: settings.packageJsonKeys.filter((key) => !OWNED_KEYS.has(key)) };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-public-pricing-catalog.loader.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"application-public-pricing-catalog.loader.d.ts","sourceRoot":"","sources":["../../../src/project-config/application-public-pricing-catalog.loader.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAmD,KAAK,oBAAoB,EAAyB,MAAM,uBAAuB,CAAC;AAE1I,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAM5D,uGAAuG;AACvG,eAAO,MAAM,6BAA6B,WAAW,CAAC;AAEtD,MAAM,WAAW,wCAAwC;IACvD,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;IACxD,yFAAyF;IACzF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,wBAAsB,mCAAmC,CAAC,KAAK,EAAE,wCAAwC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA0CxI"}
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Through the ONE door the dev companion and the CLI already open — the shared library's `./companion`
|
|
15
15
|
* entry, resolved with `moduleResolution: 'framework-source'` and evaluated by `loadConfig` (jiti) with a fresh module
|
|
16
|
-
* cache (see the call below for why the cache is never shared)
|
|
16
|
+
* cache (see the call below for why the cache is never shared), against the BUILT framework packages this package
|
|
17
|
+
* resolves (`loader-instances`, #3440): the source read is the application's library, not the engine's. A
|
|
17
18
|
* website image builds only the website (`pnpm --filter ./website run build`), so the shared library's
|
|
18
19
|
* `dist` does not exist there; and where it does exist, a dist older than its source is a price the site
|
|
19
20
|
* would advertise after the catalogue changed. Measured on Wonder Todos: the whole shared graph loads
|
|
@@ -28,7 +29,9 @@
|
|
|
28
29
|
*/
|
|
29
30
|
import { resolve as resolvePath } from 'node:path';
|
|
30
31
|
import { derivePublicPricingCatalog, describeCaughtError } from '@wildo-ai/saas-models';
|
|
32
|
+
import { ConfigModuleResolution } from './config-module-resolution.js';
|
|
31
33
|
import { loadConfig, resolvePackageCompanionEntryPath } from './loader.js';
|
|
34
|
+
import { sharesThisPackagesZod } from './loader-instances-zod.js';
|
|
32
35
|
import { registerStaticAssetImportNoop } from './static-asset-import-noop.js';
|
|
33
36
|
/** The library id the dev companion reads shared modules from, and the one every scaffold declares. */
|
|
34
37
|
export const APPLICATION_SHARED_LIBRARY_ID = 'shared';
|
|
@@ -37,7 +40,7 @@ export async function loadApplicationPublicPricingCatalog(input) {
|
|
|
37
40
|
if (library === undefined)
|
|
38
41
|
return { plans: [] };
|
|
39
42
|
const packageRoot = resolvePath(input.saasRoot, library.path);
|
|
40
|
-
const entryPath = resolvePackageCompanionEntryPath(packageRoot, undefined, { moduleResolution:
|
|
43
|
+
const entryPath = resolvePackageCompanionEntryPath(packageRoot, undefined, { moduleResolution: ConfigModuleResolution.FRAMEWORK_SOURCE });
|
|
41
44
|
// The shared graph reaches frontend presets that import stylesheets; Node cannot execute a `.css`.
|
|
42
45
|
registerStaticAssetImportNoop();
|
|
43
46
|
let modules;
|
|
@@ -48,7 +51,16 @@ export async function loadApplicationPublicPricingCatalog(input) {
|
|
|
48
51
|
// evaluated, patched onto ANOTHER `zod` instance, and the shared library's schemas failed with
|
|
49
52
|
// `z.literal(...).systemEnum is not a function` (#2598). Fresh is also what this loader is for: the catalogue as
|
|
50
53
|
// the source states it now, never a graph some earlier load of this process evaluated.
|
|
51
|
-
|
|
54
|
+
//
|
|
55
|
+
// The framework packages the library imports are the built copies this package resolves (`loader-instances`,
|
|
56
|
+
// #3440), when that is safe: in a framework checkout the inferred `framework-source` evaluated the whole of
|
|
57
|
+
// `@wildo-ai/saas-models` again from source on every read, about 350 MB and seconds of transpiling for the
|
|
58
|
+
// application's own few modules. The library itself is still read from source, and still fresh. See
|
|
59
|
+
// {@link sharesThisPackagesZod} for when it is not safe, and the read falls back to the inferred resolution.
|
|
60
|
+
const companionExports = await loadConfig(entryPath, {
|
|
61
|
+
freshModuleCache: true,
|
|
62
|
+
...(sharesThisPackagesZod(packageRoot) ? { moduleResolution: ConfigModuleResolution.LOADER_INSTANCES } : {}),
|
|
63
|
+
});
|
|
52
64
|
if (typeof companionExports.loadSharedModules !== 'function') {
|
|
53
65
|
throw new Error(`its default export has no loadSharedModules() function`);
|
|
54
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-public-pricing-catalog.loader.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"application-public-pricing-catalog.loader.js","sourceRoot":"","sources":["../../../src/project-config/application-public-pricing-catalog.loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAoD,MAAM,uBAAuB,CAAC;AAG1I,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAE3E,uGAAuG;AACvG,MAAM,CAAC,MAAM,6BAA6B,GAAG,QAAQ,CAAC;AAUtD,MAAM,CAAC,KAAK,UAAU,mCAAmC,CAAC,KAA+C;IACvG,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,6BAA6B,CAAC,CAAC;IAC5E,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IAEhD,MAAM,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,MAAM,SAAS,GAAG,gCAAgC,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE,gBAAgB,EAAE,sBAAsB,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC1I,mGAAmG;IACnG,6BAA6B,EAAE,CAAC;IAEhC,IAAI,OAAoC,CAAC;IACzC,IAAI,CAAC;QACH,iHAAiH;QACjH,kHAAkH;QAClH,gHAAgH;QAChH,+FAA+F;QAC/F,iHAAiH;QACjH,uFAAuF;QACvF,EAAE;QACF,6GAA6G;QAC7G,4GAA4G;QAC5G,2GAA2G;QAC3G,oGAAoG;QACpG,6GAA6G;QAC7G,MAAM,gBAAgB,GAAG,MAAM,UAAU,CAA4D,SAAS,EAAE;YAC9G,gBAAgB,EAAE,IAAI;YACtB,GAAG,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,sBAAsB,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7G,CAAC,CAAC;QACH,IAAI,OAAO,gBAAgB,CAAC,iBAAiB,KAAK,UAAU,EAAE,CAAC;YAC7D,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO,GAAG,MAAM,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;IACvD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,sDAAsD,SAAS,6DAA6D;cACxH,+DAA+D,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAChG,CAAC;IACJ,CAAC;IAED,OAAO,0BAA0B,CAC/B,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,kBAAkB,IAAI,EAAE,CAAC,EAC5D,KAAK,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAC1E,CAAC;AACJ,CAAC","sourcesContent":["/**\n * `loadApplicationPublicPricingCatalog` — the application's billing catalogue, as its public pricing\n * surfaces may state it, read at BUILD time from the application's shared library (#1835).\n *\n * ## The one source\n *\n * The catalogue an application sells is the `productDefinitions` its shared modules declare — the same\n * array the backend's catalogue sync pushes to the billing provider. A public website that advertises\n * prices must read that array, not a copy: before this, every generated site re-typed its prices, and\n * Wonder Todos' site published a tier its own catalogue does not sell.\n *\n * ## Why it reads SOURCE\n *\n * Through the ONE door the dev companion and the CLI already open — the shared library's `./companion`\n * entry, resolved with `moduleResolution: 'framework-source'` and evaluated by `loadConfig` (jiti) with a fresh module\n * cache (see the call below for why the cache is never shared), against the BUILT framework packages this package\n * resolves (`loader-instances`, #3440): the source read is the application's library, not the engine's. A\n * website image builds only the website (`pnpm --filter ./website run build`), so the shared library's\n * `dist` does not exist there; and where it does exist, a dist older than its source is a price the site\n * would advertise after the catalogue changed. Measured on Wonder Todos: the whole shared graph loads\n * from source in about ten seconds cold and 2.3 seconds warm, once per build, only for the pages that ask.\n *\n * ## ABSENT vs FAILED\n *\n * An application that declares no shared library has no catalogue, and gets an empty one. A shared\n * library that cannot be LOADED is not \"no plans\" — publishing an empty pricing page, or one whose\n * structured data offers nothing, would be a false statement about what the application sells — so it\n * throws, and the build stops with the reason.\n */\nimport { resolve as resolvePath } from 'node:path';\n\nimport { derivePublicPricingCatalog, describeCaughtError, type PublicPricingCatalog, type SharedSaaSModule } from '@wildo-ai/saas-models';\n\nimport type { WildoSaasConfig } from './define-saas-config';\nimport { ConfigModuleResolution } from './config-module-resolution';\nimport { loadConfig, resolvePackageCompanionEntryPath } from './loader';\nimport { sharesThisPackagesZod } from './loader-instances-zod';\nimport { registerStaticAssetImportNoop } from './static-asset-import-noop';\n\n/** The library id the dev companion reads shared modules from, and the one every scaffold declares. */\nexport const APPLICATION_SHARED_LIBRARY_ID = 'shared';\n\nexport interface LoadApplicationPublicPricingCatalogInput {\n /** The application root (the directory holding `wildo.saas.config.ts`). */\n readonly saasRoot: string;\n readonly saasConfig: Pick<WildoSaasConfig, 'libraries'>;\n /** Keep only plans this scope may subscribe to (a `ResourcePrimaryScope` wire value). */\n readonly targetScope?: string;\n}\n\nexport async function loadApplicationPublicPricingCatalog(input: LoadApplicationPublicPricingCatalogInput): Promise<PublicPricingCatalog> {\n const library = input.saasConfig.libraries?.[APPLICATION_SHARED_LIBRARY_ID];\n if (library === undefined) return { plans: [] };\n\n const packageRoot = resolvePath(input.saasRoot, library.path);\n const entryPath = resolvePackageCompanionEntryPath(packageRoot, undefined, { moduleResolution: ConfigModuleResolution.FRAMEWORK_SOURCE });\n // The shared graph reaches frontend presets that import stylesheets; Node cannot execute a `.css`.\n registerStaticAssetImportNoop();\n\n let modules: readonly SharedSaaSModule[];\n try {\n // A FRESH module graph, evaluated against the `zod` this load receives. In a process that has already loaded the\n // application through another jiti load — `wildo website audit` loads the site's context (its saas config) before\n // the structured data that reads this catalogue — the shared cache served `@wildo-ai/zod-decorators` as already\n // evaluated, patched onto ANOTHER `zod` instance, and the shared library's schemas failed with\n // `z.literal(...).systemEnum is not a function` (#2598). Fresh is also what this loader is for: the catalogue as\n // the source states it now, never a graph some earlier load of this process evaluated.\n //\n // The framework packages the library imports are the built copies this package resolves (`loader-instances`,\n // #3440), when that is safe: in a framework checkout the inferred `framework-source` evaluated the whole of\n // `@wildo-ai/saas-models` again from source on every read, about 350 MB and seconds of transpiling for the\n // application's own few modules. The library itself is still read from source, and still fresh. See\n // {@link sharesThisPackagesZod} for when it is not safe, and the read falls back to the inferred resolution.\n const companionExports = await loadConfig<{ loadSharedModules?: () => Promise<SharedSaaSModule[]> }>(entryPath, {\n freshModuleCache: true,\n ...(sharesThisPackagesZod(packageRoot) ? { moduleResolution: ConfigModuleResolution.LOADER_INSTANCES } : {}),\n });\n if (typeof companionExports.loadSharedModules !== 'function') {\n throw new Error(`its default export has no loadSharedModules() function`);\n }\n modules = await companionExports.loadSharedModules();\n } catch (error) {\n throw new Error(\n `Could not load the application's shared library at ${entryPath}, so the plans its pricing surfaces advertise are unknown. `\n + `Refusing to state an empty catalogue in their place. Cause: ${describeCaughtError(error)}`,\n );\n }\n\n return derivePublicPricingCatalog(\n modules.flatMap((module) => module.productDefinitions ?? []),\n input.targetScope === undefined ? {} : { targetScope: input.targetScope },\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-served-public-documents.loader.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"application-served-public-documents.loader.d.ts","sourceRoot":"","sources":["../../../src/project-config/application-served-public-documents.loader.ts"],"names":[],"mappings":"AA+CA,OAAO,EACL,6BAA6B,EAE7B,uCAAuC,EACvC,KAAK,6BAA6B,EACnC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,uHAAuH;AACvH,MAAM,MAAM,+BAA+B,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,6BAA6B,CAAC,CAAC;AAEpH,oHAAoH;AACpH,MAAM,MAAM,sCAAsC,GAAG,UAAU,CAAC,OAAO,uCAAuC,CAAC,CAAC,CAAC,CAAC,CAAC;AAKnH;;;;;;GAMG;AACH,wBAAgB,sCAAsC,CACpD,UAAU,EAAE,sCAAsC,EAClD,EAAE,EAAE,MAAM,GACT,+BAA+B,EAAE,CAGnC;AAED,MAAM,WAAW,iDAAiD;IAChE,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;IACvD;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,4CAA4C,CAChE,KAAK,EAAE,iDAAiD,GACvD,OAAO,CAAC,+BAA+B,EAAE,GAAG,SAAS,CAAC,CA4BxD"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* ## Why a surface outside the application needs this
|
|
7
7
|
*
|
|
8
8
|
* The application links `/privacy` and `/terms` only while the page would render the document
|
|
9
|
-
* (`resolveServedPublicGovernedDocumentPath`, #2976): a link that lands on "unavailable" is offered as the place the
|
|
9
|
+
* (`resolveServedPublicGovernedDocumentPath`, #2976; the page itself picks the release by the server's clock, #3187): a link that lands on "unavailable" is offered as the place the
|
|
10
10
|
* information is and informs nobody. A generated marketing site's footer links the same pages on the application's
|
|
11
11
|
* origin, and before this it linked both always. The site cannot read the application's configuration in the browser,
|
|
12
12
|
* so the answer is computed here, at build time, and forwarded as plain data — the way `legalNoticeOwed` already is.
|
|
@@ -20,10 +20,17 @@
|
|
|
20
20
|
* armed page withholds. The configuration the running application reads is the only object carrying both, so it is
|
|
21
21
|
* the one this loads, from SOURCE through `loadConfig` (jiti) with a fresh module graph, as
|
|
22
22
|
* `loadApplicationPublicPricingCatalog` does for the shared library and for the same reasons (a website image builds
|
|
23
|
-
* only the website, and #2598's shared-cache `zod` clash).
|
|
23
|
+
* only the website, and #2598's shared-cache `zod` clash). It imports the backend library only as a type (the
|
|
24
|
+
* vocabularies it names are `@wildo-ai/saas-models`'), and the framework packages it imports are the built copies this
|
|
25
|
+
* package resolves (`ConfigModuleResolution.LOADER_INSTANCES`) whenever the configuration resolves the `zod` they
|
|
26
|
+
* decorate, as a website's copy of this package does, so the read evaluates the application's own few modules (#2998).
|
|
24
27
|
*
|
|
25
|
-
* Cost, measured on Wonder Todos (2026-
|
|
26
|
-
*
|
|
28
|
+
* Cost, measured on Wonder Todos (2026-11-06, a fresh process each): 0.1 s and 14 MB live with the built packages,
|
|
29
|
+
* 0.2 s with an empty transpile cache; 1.5 s and 48 MB (4.6 s cold) with the inferred resolution, which a CLI in a
|
|
30
|
+
* framework checkout keeps. It was 5.0 s and 557 MB while the configuration took six enums from the backend library,
|
|
31
|
+
* which a framework checkout evaluated from source. The evaluation runs in a worker thread (`readBackendComplianceSection`,
|
|
32
|
+
* #3440), so what it loads is freed once the section is read, and the section is kept per thread, for every copy of
|
|
33
|
+
* this package in it, until a file beside the configuration changes, so a second read costs nothing.
|
|
27
34
|
*
|
|
28
35
|
* ## ABSENT vs FAILED
|
|
29
36
|
*
|
|
@@ -39,7 +46,7 @@ import { existsSync } from 'node:fs';
|
|
|
39
46
|
import { join, resolve as resolvePath } from 'node:path';
|
|
40
47
|
import { PUBLIC_GOVERNED_DOCUMENT_REFS, describeCaughtError, resolveServedPublicGovernedDocumentPath, } from '@wildo-ai/saas-models';
|
|
41
48
|
import { selectPrimaryBackendService } from '../bootstrap/runtime-topology.contracts.js';
|
|
42
|
-
import {
|
|
49
|
+
import { readBackendComplianceSection } from './backend-compliance-section.reader.js';
|
|
43
50
|
/** The backend configuration's source, under the primary backend service's directory. */
|
|
44
51
|
const BACKEND_CONFIGURATION_SOURCE_RELATIVE_PATH = join('src', 'saas-config.backend.ts');
|
|
45
52
|
/**
|
|
@@ -65,14 +72,15 @@ export async function loadApplicationServedPublicGovernedDocuments(input) {
|
|
|
65
72
|
+ 'documents (privacy notice, terms) the application serves is unknown here.');
|
|
66
73
|
return undefined;
|
|
67
74
|
}
|
|
68
|
-
let
|
|
75
|
+
let compliance;
|
|
69
76
|
try {
|
|
70
|
-
|
|
77
|
+
// In a worker thread, so the graph the evaluation loads is freed once the section is read (#3440).
|
|
78
|
+
compliance = (await readBackendComplianceSection(configPath));
|
|
71
79
|
}
|
|
72
80
|
catch (error) {
|
|
73
81
|
throw new Error(`Could not load the application's backend configuration at ${configPath}, so which public documents (privacy notice, `
|
|
74
82
|
+ `terms) the application serves is unknown. Cause: ${describeCaughtError(error)}`);
|
|
75
83
|
}
|
|
76
|
-
return deriveServedPublicGovernedDocumentRefs(
|
|
84
|
+
return deriveServedPublicGovernedDocumentRefs(compliance, input.at ?? new Date().toISOString());
|
|
77
85
|
}
|
|
78
86
|
//# sourceMappingURL=application-served-public-documents.loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-served-public-documents.loader.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"application-served-public-documents.loader.js","sourceRoot":"","sources":["../../../src/project-config/application-served-public-documents.loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,OAAO,IAA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V,8CAA8C,OAAO,CAAC,GAAG,6BAA6B,UAAU,oBAAoB;cAChH,2EAA2E,CAChF,CAAC;QACF,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,UAA8D,CAAC;IACnE,IAAI,CAAC;QACH,mGAAmG;QACnG,UAAU,GAAG,CAAC,MAAM,4BAA4B,CAAC,UAAU,CAAC,CAAuD,CAAC;IACtH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,6DAA6D,UAAU,+CAA+C;cAClH,oDAAoD,mBAAmB,CAAC,KAAK,CAAC,EAAE,CACrF,CAAC;IACJ,CAAC;IACD,OAAO,sCAAsC,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AAClG,CAAC","sourcesContent":["/**\n * `loadApplicationServedPublicGovernedDocuments` — which of the application's PUBLIC governed documents (its privacy\n * notice, its service terms) the application's own pages serve, read at BUILD time from its backend configuration\n * (#2987).\n *\n * ## Why a surface outside the application needs this\n *\n * The application links `/privacy` and `/terms` only while the page would render the document\n * (`resolveServedPublicGovernedDocumentPath`, #2976; the page itself picks the release by the server's clock, #3187): a link that lands on \"unavailable\" is offered as the place the\n * information is and informs nobody. A generated marketing site's footer links the same pages on the application's\n * origin, and before this it linked both always. The site cannot read the application's configuration in the browser,\n * so the answer is computed here, at build time, and forwarded as plain data — the way `legalNoticeOwed` already is.\n *\n * ## Why it reads the BACKEND configuration, and not the generated documents module alone\n *\n * Whether a document is served depends on two members of `compliance`: `publicDocuments` (written by\n * `wildo config document-releases` into a generated module) and `governedDocumentApprovalGate`, which the application\n * authors in `saas-config.backend.ts`. The gate is ONE switch for every surface that shows a governed document\n * (`requiresApprovedGovernedDocuments`), so reading the generated module alone would let the site link a draft the\n * armed page withholds. The configuration the running application reads is the only object carrying both, so it is\n * the one this loads, from SOURCE through `loadConfig` (jiti) with a fresh module graph, as\n * `loadApplicationPublicPricingCatalog` does for the shared library and for the same reasons (a website image builds\n * only the website, and #2598's shared-cache `zod` clash). It imports the backend library only as a type (the\n * vocabularies it names are `@wildo-ai/saas-models`'), and the framework packages it imports are the built copies this\n * package resolves (`ConfigModuleResolution.LOADER_INSTANCES`) whenever the configuration resolves the `zod` they\n * decorate, as a website's copy of this package does, so the read evaluates the application's own few modules (#2998).\n *\n * Cost, measured on Wonder Todos (2026-11-06, a fresh process each): 0.1 s and 14 MB live with the built packages,\n * 0.2 s with an empty transpile cache; 1.5 s and 48 MB (4.6 s cold) with the inferred resolution, which a CLI in a\n * framework checkout keeps. It was 5.0 s and 557 MB while the configuration took six enums from the backend library,\n * which a framework checkout evaluated from source. The evaluation runs in a worker thread (`readBackendComplianceSection`,\n * #3440), so what it loads is freed once the section is read, and the section is kept per thread, for every copy of\n * this package in it, until a file beside the configuration changes, so a second read costs nothing.\n *\n * ## ABSENT vs FAILED\n *\n * - No backend service, or no `src/saas-config.backend.ts` under it: the loader cannot read what decides the answer, so\n * it returns `undefined` and the site keeps linking every public document, as it did before. Dropping a privacy\n * link the application may well serve is the worse error of the two. A DECLARED backend whose configuration file is\n * missing (a website image that copied only the website) also warns, so that case is not mistaken for \"no backend\".\n * - A backend configuration that cannot be LOADED throws, naming the cause: stating that nothing is served would be a\n * guess about a legal page. What to do then is the caller's decision; the website's site-context loader warns and\n * keeps every link.\n */\nimport { existsSync } from 'node:fs';\nimport { join, resolve as resolvePath } from 'node:path';\n\nimport {\n PUBLIC_GOVERNED_DOCUMENT_REFS,\n describeCaughtError,\n resolveServedPublicGovernedDocumentPath,\n type PublicGovernedDocumentRefName,\n} from '@wildo-ai/saas-models';\n\nimport { selectPrimaryBackendService } from '../bootstrap/runtime-topology.contracts';\nimport { readBackendComplianceSection } from './backend-compliance-section.reader';\nimport type { WildoSaasConfig } from './define-saas-config';\n\n/** A public governed document's ref (`PUBLIC_GOVERNED_DOCUMENT_REFS` value), e.g. `document:public.privacy-notice`. */\nexport type ServedPublicGovernedDocumentRef = (typeof PUBLIC_GOVERNED_DOCUMENT_REFS)[PublicGovernedDocumentRefName];\n\n/** The `compliance` section the served reading takes, exactly as `resolveServedPublicGovernedDocumentPath` does. */\nexport type ServedPublicGovernedDocumentCompliance = Parameters<typeof resolveServedPublicGovernedDocumentPath>[0];\n\n/** The backend configuration's source, under the primary backend service's directory. */\nconst BACKEND_CONFIGURATION_SOURCE_RELATIVE_PATH = join('src', 'saas-config.backend.ts');\n\n/**\n * The public governed documents the application serves at `at`, in `PUBLIC_GOVERNED_DOCUMENT_REFS` order.\n *\n * PURE, and total over the public documents: a document added to that vocabulary is answered for by every build without\n * an edit here. Each answer is `resolveServedPublicGovernedDocumentPath`'s, never a literal path or a second reading of\n * releases, drafts and the approval gate.\n */\nexport function deriveServedPublicGovernedDocumentRefs(\n compliance: ServedPublicGovernedDocumentCompliance,\n at: string,\n): ServedPublicGovernedDocumentRef[] {\n return Object.values(PUBLIC_GOVERNED_DOCUMENT_REFS).filter((documentRef) =>\n resolveServedPublicGovernedDocumentPath(compliance, documentRef, at) !== undefined);\n}\n\nexport interface LoadApplicationServedPublicGovernedDocumentsInput {\n /** The application root (the directory holding `wildo.saas.config.ts`). */\n readonly saasRoot: string;\n readonly saasConfig: Pick<WildoSaasConfig, 'services'>;\n /**\n * The instant the answer is for, as an ISO string. Defaults to now: a static site states what was served when it\n * was BUILT, so a release that comes into force later is linked from the next build.\n */\n readonly at?: string;\n}\n\nexport async function loadApplicationServedPublicGovernedDocuments(\n input: LoadApplicationServedPublicGovernedDocumentsInput,\n): Promise<ServedPublicGovernedDocumentRef[] | undefined> {\n // The backend is the service with no `frontendType`, chosen by the rule the website's local origins use.\n const backend = selectPrimaryBackendService(\n Object.entries(input.saasConfig.services)\n .filter(([, service]) => service.frontendType === undefined)\n .map(([key, service]) => ({ key, path: service.path })),\n );\n if (backend === undefined) return undefined;\n const configPath = resolvePath(input.saasRoot, backend.path, BACKEND_CONFIGURATION_SOURCE_RELATIVE_PATH);\n if (!existsSync(configPath)) {\n console.warn(\n `[platform-config-lib] The backend service \"${backend.key}\" has no configuration at ${configPath}, so which public `\n + 'documents (privacy notice, terms) the application serves is unknown here.',\n );\n return undefined;\n }\n\n let compliance: ServedPublicGovernedDocumentCompliance | undefined;\n try {\n // In a worker thread, so the graph the evaluation loads is freed once the section is read (#3440).\n compliance = (await readBackendComplianceSection(configPath)) as ServedPublicGovernedDocumentCompliance | undefined;\n } catch (error) {\n throw new Error(\n `Could not load the application's backend configuration at ${configPath}, so which public documents (privacy notice, `\n + `terms) the application serves is unknown. Cause: ${describeCaughtError(error)}`,\n );\n }\n return deriveServedPublicGovernedDocumentRefs(compliance, input.at ?? new Date().toISOString());\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `compliance` section of an application's backend configuration, evaluated in a worker thread and kept, as data,
|
|
3
|
+
* until the configuration changes (#3440).
|
|
4
|
+
*
|
|
5
|
+
* ## Why a thread
|
|
6
|
+
*
|
|
7
|
+
* Node keeps every module it evaluates for the life of the thread that evaluated it. Until #2998 a framework checkout's
|
|
8
|
+
* configuration evaluated the whole backend library from source, and read in the caller's thread that graph, about
|
|
9
|
+
* 555 MB on Wonder Todos, stayed for the whole of a `wildo website audit` and of every website build that loads its
|
|
10
|
+
* site context, to answer two members. The configuration now imports the backend library only as a type and the worker
|
|
11
|
+
* evaluates the built framework packages (see the worker), so the read is small; the thread still bounds whatever an
|
|
12
|
+
* application's own configuration loads, and only the section crosses back.
|
|
13
|
+
*
|
|
14
|
+
* ## Why the answer is kept
|
|
15
|
+
*
|
|
16
|
+
* A worker starts cold, so a second read in the same process paid the whole evaluation again: measured on Wonder Todos,
|
|
17
|
+
* two reads took 46 s and 114 s on a loaded host, where a read in the caller's thread found its packages already
|
|
18
|
+
* loaded the second time. A website build reads twice (`astro.config.ts` and the prerender bundle each evaluate the site
|
|
19
|
+
* context). So the section is kept per thread, by every copy of this package in it ({@link keptSections}), as plain
|
|
20
|
+
* data, and the configuration is evaluated again only when a `.ts` file beside it changes: the configuration itself and
|
|
21
|
+
* the generated modules `wildo config document-releases` and its siblings rewrite there. That is the signature #2992's
|
|
22
|
+
* patch designed for a long-lived `astro dev`. It does not see a change to a package the configuration imports, which
|
|
23
|
+
* no website edit makes.
|
|
24
|
+
*
|
|
25
|
+
* A failed read is not kept: the next call evaluates again. Callers that ask while a read is running share it.
|
|
26
|
+
*
|
|
27
|
+
* Rejected: keeping the evaluated MODULE per process (#2992's patch, before the thread). It saved the second evaluation
|
|
28
|
+
* and kept the first one's graph for the rest of the process, which is the memory this exists to give back. Kept as
|
|
29
|
+
* data beside a thread, the same signature costs nothing.
|
|
30
|
+
*
|
|
31
|
+
* The section is plain data (release records and an enum value). A value a structured clone cannot carry (a function,
|
|
32
|
+
* a symbol) is refused by the worker; a class instance would cross as a plain object, which loses nothing here.
|
|
33
|
+
*/
|
|
34
|
+
export declare function readBackendComplianceSection(requestedConfigPath: string): Promise<unknown>;
|
|
35
|
+
//# sourceMappingURL=backend-compliance-section.reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend-compliance-section.reader.d.ts","sourceRoot":"","sources":["../../../src/project-config/backend-compliance-section.reader.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,4BAA4B,CAAC,mBAAmB,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAqBhG"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { readdirSync, realpathSync, statSync } from 'node:fs';
|
|
2
|
+
import { dirname, extname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { Worker } from 'node:worker_threads';
|
|
5
|
+
import { ConfigModuleResolution } from './config-module-resolution.js';
|
|
6
|
+
import { sharesThisPackagesZod } from './loader-instances-zod.js';
|
|
7
|
+
/** Where every copy of this package in a thread finds the kept sections ({@link keptSections}). */
|
|
8
|
+
const KEPT_SECTIONS_REGISTRY_KEY = Symbol.for('@wildo-ai/platform-config-lib/backend-compliance-sections@1');
|
|
9
|
+
/**
|
|
10
|
+
* The `compliance` section of an application's backend configuration, evaluated in a worker thread and kept, as data,
|
|
11
|
+
* until the configuration changes (#3440).
|
|
12
|
+
*
|
|
13
|
+
* ## Why a thread
|
|
14
|
+
*
|
|
15
|
+
* Node keeps every module it evaluates for the life of the thread that evaluated it. Until #2998 a framework checkout's
|
|
16
|
+
* configuration evaluated the whole backend library from source, and read in the caller's thread that graph, about
|
|
17
|
+
* 555 MB on Wonder Todos, stayed for the whole of a `wildo website audit` and of every website build that loads its
|
|
18
|
+
* site context, to answer two members. The configuration now imports the backend library only as a type and the worker
|
|
19
|
+
* evaluates the built framework packages (see the worker), so the read is small; the thread still bounds whatever an
|
|
20
|
+
* application's own configuration loads, and only the section crosses back.
|
|
21
|
+
*
|
|
22
|
+
* ## Why the answer is kept
|
|
23
|
+
*
|
|
24
|
+
* A worker starts cold, so a second read in the same process paid the whole evaluation again: measured on Wonder Todos,
|
|
25
|
+
* two reads took 46 s and 114 s on a loaded host, where a read in the caller's thread found its packages already
|
|
26
|
+
* loaded the second time. A website build reads twice (`astro.config.ts` and the prerender bundle each evaluate the site
|
|
27
|
+
* context). So the section is kept per thread, by every copy of this package in it ({@link keptSections}), as plain
|
|
28
|
+
* data, and the configuration is evaluated again only when a `.ts` file beside it changes: the configuration itself and
|
|
29
|
+
* the generated modules `wildo config document-releases` and its siblings rewrite there. That is the signature #2992's
|
|
30
|
+
* patch designed for a long-lived `astro dev`. It does not see a change to a package the configuration imports, which
|
|
31
|
+
* no website edit makes.
|
|
32
|
+
*
|
|
33
|
+
* A failed read is not kept: the next call evaluates again. Callers that ask while a read is running share it.
|
|
34
|
+
*
|
|
35
|
+
* Rejected: keeping the evaluated MODULE per process (#2992's patch, before the thread). It saved the second evaluation
|
|
36
|
+
* and kept the first one's graph for the rest of the process, which is the memory this exists to give back. Kept as
|
|
37
|
+
* data beside a thread, the same signature costs nothing.
|
|
38
|
+
*
|
|
39
|
+
* The section is plain data (release records and an enum value). A value a structured clone cannot carry (a function,
|
|
40
|
+
* a symbol) is refused by the worker; a class instance would cross as a plain object, which loses nothing here.
|
|
41
|
+
*/
|
|
42
|
+
export async function readBackendComplianceSection(requestedConfigPath) {
|
|
43
|
+
// Keyed on the REAL path: two callers reaching one application through different spellings of its root (macOS's
|
|
44
|
+
// `/var` and `/private/var`, a symlinked checkout) must find one kept answer, or the second runs the worker again.
|
|
45
|
+
const configPath = realpathSync(requestedConfigPath);
|
|
46
|
+
const key = `${configPath}\n${configurationSignature(configPath)}`;
|
|
47
|
+
let reading = keptSections.get(key);
|
|
48
|
+
if (reading === undefined) {
|
|
49
|
+
// One answer per configuration: an answer for an older signature can never be asked for again, so a long-lived
|
|
50
|
+
// `astro dev` does not accumulate one per edit.
|
|
51
|
+
for (const keptKey of keptSections.keys()) {
|
|
52
|
+
if (keptKey.startsWith(`${configPath}\n`))
|
|
53
|
+
keptSections.delete(keptKey);
|
|
54
|
+
}
|
|
55
|
+
reading = evaluateInWorker(configPath);
|
|
56
|
+
keptSections.set(key, reading);
|
|
57
|
+
// Never keep a failure: forget it as soon as it settles, so the next call evaluates again.
|
|
58
|
+
reading.catch(() => {
|
|
59
|
+
if (keptSections.get(key) === reading)
|
|
60
|
+
keptSections.delete(key);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
// A copy per caller, so no caller can change what the next one is handed.
|
|
64
|
+
return structuredClone(await reading);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Key (path + signature) → the section, or the read in progress. One map per THREAD, shared by every copy of this
|
|
68
|
+
* package loaded in it (#3440).
|
|
69
|
+
*
|
|
70
|
+
* Shared because a thread can hold two copies: `wildo website audit` runs the CLI's own copy and loads the website's
|
|
71
|
+
* installed copy with the site, and the site's context reads the section through ITS copy. The audit reads it first,
|
|
72
|
+
* through the CLI's copy, while nothing else is loaded, so the 0.9 GB worker never runs beside the site (measured on
|
|
73
|
+
* Wonder Todos); with one map per copy, the site's read missed and spawned the worker again with the site half loaded.
|
|
74
|
+
* A module-level map is also not enough for a website build whose `astro.config.ts` and prerender bundle were ever
|
|
75
|
+
* served two copies.
|
|
76
|
+
*
|
|
77
|
+
* The registry key carries a version: a copy whose key or value shape differs uses its own map, so copies of
|
|
78
|
+
* different releases can share a thread without reading each other's answers. Bump it when either changes.
|
|
79
|
+
*/
|
|
80
|
+
const keptSections = keptSectionsOfThisThread();
|
|
81
|
+
function keptSectionsOfThisThread() {
|
|
82
|
+
const registry = globalThis;
|
|
83
|
+
return (registry[KEPT_SECTIONS_REGISTRY_KEY] ??= new Map());
|
|
84
|
+
}
|
|
85
|
+
/** Name, size and modification time of every `.ts` file beside the configuration, in name order. */
|
|
86
|
+
function configurationSignature(configPath) {
|
|
87
|
+
const directory = dirname(configPath);
|
|
88
|
+
return readdirSync(directory)
|
|
89
|
+
.filter((name) => name.endsWith('.ts'))
|
|
90
|
+
.sort()
|
|
91
|
+
.map((name) => {
|
|
92
|
+
const stats = statSync(join(directory, name));
|
|
93
|
+
return `${name}:${stats.size}:${stats.mtimeMs}`;
|
|
94
|
+
})
|
|
95
|
+
.join('|');
|
|
96
|
+
}
|
|
97
|
+
async function evaluateInWorker(configPath) {
|
|
98
|
+
// The built framework packages this copy resolves (#2998), when the configuration's directory resolves the `zod` they
|
|
99
|
+
// decorate: an application module the configuration imports that builds a decorated schema would otherwise meet
|
|
100
|
+
// #2598. The guard the pricing catalogue's read uses, for the same reason. Otherwise the inferred resolution, which
|
|
101
|
+
// costs more (framework source in a framework checkout) and answers the same section.
|
|
102
|
+
const moduleResolution = sharesThisPackagesZod(dirname(configPath)) ? ConfigModuleResolution.LOADER_INSTANCES : undefined;
|
|
103
|
+
const workerData = { configPath, ...(moduleResolution === undefined ? {} : { moduleResolution }) };
|
|
104
|
+
// `.ts` under a test runner (Node strips the types), `.js` in the built package.
|
|
105
|
+
const workerUrl = new URL(`./backend-compliance-section.worker${extname(fileURLToPath(import.meta.url))}`, import.meta.url);
|
|
106
|
+
const worker = new Worker(workerUrl, { workerData });
|
|
107
|
+
try {
|
|
108
|
+
const result = await new Promise((resolve, reject) => {
|
|
109
|
+
worker.once('message', resolve);
|
|
110
|
+
worker.once('error', reject);
|
|
111
|
+
worker.once('exit', (code) => reject(new Error(`The backend configuration worker exited with code ${code} before answering.`)));
|
|
112
|
+
});
|
|
113
|
+
if ('error' in result) {
|
|
114
|
+
// What the evaluation threw, as it was thrown (an engine error is a plain object): the caller describes it.
|
|
115
|
+
throw result.error;
|
|
116
|
+
}
|
|
117
|
+
return result.compliance;
|
|
118
|
+
}
|
|
119
|
+
finally {
|
|
120
|
+
await worker.terminate();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=backend-compliance-section.reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend-compliance-section.reader.js","sourceRoot":"","sources":["../../../src/project-config/backend-compliance-section.reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAM/D,mGAAmG;AACnG,MAAM,0BAA0B,GAAkB,MAAM,CAAC,GAAG,CAAC,6DAA6D,CAAC,CAAC;AAE5H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,mBAA2B;IAC5E,gHAAgH;IAChH,mHAAmH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OAAO,EAAE,MAAM,CAAC,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,qDAAqD,IAAI,oBAAoB,CAAC,CAAC,CAAC,CAAC;QAClI,CAAC,CAAC,CAAC;QACH,IAAI,OAAO,IAAI,MAAM,EAAE,CAAC;YACtB,4GAA4G;YAC5G,MAAM,MAAM,CAAC,KAAK,CAAC;QACrB,CAAC;QACD,OAAO,MAAM,CAAC,UAAU,CAAC;IAC3B,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC;IAC3B,CAAC;AACH,CAAC","sourcesContent":["import { readdirSync, realpathSync, statSync } from 'node:fs';\nimport { dirname, extname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { Worker } from 'node:worker_threads';\n\nimport { ConfigModuleResolution } from './config-module-resolution';\nimport { sharesThisPackagesZod } from './loader-instances-zod';\nimport type {\n BackendComplianceSectionWorkerInput,\n BackendComplianceSectionWorkerResult,\n} from './backend-compliance-section.worker';\n\n/** Where every copy of this package in a thread finds the kept sections ({@link keptSections}). */\nconst KEPT_SECTIONS_REGISTRY_KEY: unique symbol = Symbol.for('@wildo-ai/platform-config-lib/backend-compliance-sections@1');\n\n/**\n * The `compliance` section of an application's backend configuration, evaluated in a worker thread and kept, as data,\n * until the configuration changes (#3440).\n *\n * ## Why a thread\n *\n * Node keeps every module it evaluates for the life of the thread that evaluated it. Until #2998 a framework checkout's\n * configuration evaluated the whole backend library from source, and read in the caller's thread that graph, about\n * 555 MB on Wonder Todos, stayed for the whole of a `wildo website audit` and of every website build that loads its\n * site context, to answer two members. The configuration now imports the backend library only as a type and the worker\n * evaluates the built framework packages (see the worker), so the read is small; the thread still bounds whatever an\n * application's own configuration loads, and only the section crosses back.\n *\n * ## Why the answer is kept\n *\n * A worker starts cold, so a second read in the same process paid the whole evaluation again: measured on Wonder Todos,\n * two reads took 46 s and 114 s on a loaded host, where a read in the caller's thread found its packages already\n * loaded the second time. A website build reads twice (`astro.config.ts` and the prerender bundle each evaluate the site\n * context). So the section is kept per thread, by every copy of this package in it ({@link keptSections}), as plain\n * data, and the configuration is evaluated again only when a `.ts` file beside it changes: the configuration itself and\n * the generated modules `wildo config document-releases` and its siblings rewrite there. That is the signature #2992's\n * patch designed for a long-lived `astro dev`. It does not see a change to a package the configuration imports, which\n * no website edit makes.\n *\n * A failed read is not kept: the next call evaluates again. Callers that ask while a read is running share it.\n *\n * Rejected: keeping the evaluated MODULE per process (#2992's patch, before the thread). It saved the second evaluation\n * and kept the first one's graph for the rest of the process, which is the memory this exists to give back. Kept as\n * data beside a thread, the same signature costs nothing.\n *\n * The section is plain data (release records and an enum value). A value a structured clone cannot carry (a function,\n * a symbol) is refused by the worker; a class instance would cross as a plain object, which loses nothing here.\n */\nexport async function readBackendComplianceSection(requestedConfigPath: string): Promise<unknown> {\n // Keyed on the REAL path: two callers reaching one application through different spellings of its root (macOS's\n // `/var` and `/private/var`, a symlinked checkout) must find one kept answer, or the second runs the worker again.\n const configPath = realpathSync(requestedConfigPath);\n const key = `${configPath}\\n${configurationSignature(configPath)}`;\n let reading = keptSections.get(key);\n if (reading === undefined) {\n // One answer per configuration: an answer for an older signature can never be asked for again, so a long-lived\n // `astro dev` does not accumulate one per edit.\n for (const keptKey of keptSections.keys()) {\n if (keptKey.startsWith(`${configPath}\\n`)) keptSections.delete(keptKey);\n }\n reading = evaluateInWorker(configPath);\n keptSections.set(key, reading);\n // Never keep a failure: forget it as soon as it settles, so the next call evaluates again.\n reading.catch(() => {\n if (keptSections.get(key) === reading) keptSections.delete(key);\n });\n }\n // A copy per caller, so no caller can change what the next one is handed.\n return structuredClone(await reading);\n}\n\n/**\n * Key (path + signature) → the section, or the read in progress. One map per THREAD, shared by every copy of this\n * package loaded in it (#3440).\n *\n * Shared because a thread can hold two copies: `wildo website audit` runs the CLI's own copy and loads the website's\n * installed copy with the site, and the site's context reads the section through ITS copy. The audit reads it first,\n * through the CLI's copy, while nothing else is loaded, so the 0.9 GB worker never runs beside the site (measured on\n * Wonder Todos); with one map per copy, the site's read missed and spawned the worker again with the site half loaded.\n * A module-level map is also not enough for a website build whose `astro.config.ts` and prerender bundle were ever\n * served two copies.\n *\n * The registry key carries a version: a copy whose key or value shape differs uses its own map, so copies of\n * different releases can share a thread without reading each other's answers. Bump it when either changes.\n */\nconst keptSections: Map<string, Promise<unknown>> = keptSectionsOfThisThread();\n\nfunction keptSectionsOfThisThread(): Map<string, Promise<unknown>> {\n const registry = globalThis as { [KEPT_SECTIONS_REGISTRY_KEY]?: Map<string, Promise<unknown>> };\n return (registry[KEPT_SECTIONS_REGISTRY_KEY] ??= new Map());\n}\n\n/** Name, size and modification time of every `.ts` file beside the configuration, in name order. */\nfunction configurationSignature(configPath: string): string {\n const directory = dirname(configPath);\n return readdirSync(directory)\n .filter((name) => name.endsWith('.ts'))\n .sort()\n .map((name) => {\n const stats = statSync(join(directory, name));\n return `${name}:${stats.size}:${stats.mtimeMs}`;\n })\n .join('|');\n}\n\nasync function evaluateInWorker(configPath: string): Promise<unknown> {\n // The built framework packages this copy resolves (#2998), when the configuration's directory resolves the `zod` they\n // decorate: an application module the configuration imports that builds a decorated schema would otherwise meet\n // #2598. The guard the pricing catalogue's read uses, for the same reason. Otherwise the inferred resolution, which\n // costs more (framework source in a framework checkout) and answers the same section.\n const moduleResolution = sharesThisPackagesZod(dirname(configPath)) ? ConfigModuleResolution.LOADER_INSTANCES : undefined;\n const workerData: BackendComplianceSectionWorkerInput = { configPath, ...(moduleResolution === undefined ? {} : { moduleResolution }) };\n // `.ts` under a test runner (Node strips the types), `.js` in the built package.\n const workerUrl = new URL(`./backend-compliance-section.worker${extname(fileURLToPath(import.meta.url))}`, import.meta.url);\n const worker = new Worker(workerUrl, { workerData });\n try {\n const result = await new Promise<BackendComplianceSectionWorkerResult>((resolve, reject) => {\n worker.once('message', resolve);\n worker.once('error', reject);\n worker.once('exit', (code) => reject(new Error(`The backend configuration worker exited with code ${code} before answering.`)));\n });\n if ('error' in result) {\n // What the evaluation threw, as it was thrown (an engine error is a plain object): the caller describes it.\n throw result.error;\n }\n return result.compliance;\n } finally {\n await worker.terminate();\n }\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ConfigModuleResolution } from './config-module-resolution';
|
|
2
|
+
/** What the parent hands this thread. */
|
|
3
|
+
export interface BackendComplianceSectionWorkerInput {
|
|
4
|
+
/** The absolute path of the backend configuration source (`<backend>/src/saas-config.backend.ts`). */
|
|
5
|
+
readonly configPath: string;
|
|
6
|
+
/** How framework packages are resolved while it is evaluated; absent, the loader infers it. */
|
|
7
|
+
readonly moduleResolution?: ConfigModuleResolution;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* What this thread posts back: the configuration's `compliance` section (absent when it declares none), or what the
|
|
11
|
+
* evaluation threw. The thrown value crosses as it is, so the caller describes it, as it did when the evaluation ran
|
|
12
|
+
* in its own thread: a plain-object engine error crosses whole, and an `Error` keeps its message, its cause and a
|
|
13
|
+
* standard name but loses its own properties (which `describeCaughtError` does not read).
|
|
14
|
+
*/
|
|
15
|
+
export type BackendComplianceSectionWorkerResult = {
|
|
16
|
+
readonly compliance: unknown;
|
|
17
|
+
} | {
|
|
18
|
+
readonly error: unknown;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=backend-compliance-section.worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend-compliance-section.worker.d.ts","sourceRoot":"","sources":["../../../src/project-config/backend-compliance-section.worker.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAWzE,yCAAyC;AACzC,MAAM,WAAW,mCAAmC;IAClD,sGAAsG;IACtG,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,+FAA+F;IAC/F,QAAQ,CAAC,gBAAgB,CAAC,EAAE,sBAAsB,CAAC;CACpD;AAED;;;;;GAKG;AACH,MAAM,MAAM,oCAAoC,GAC5C;IAAE,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;CAAE,GAChC;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC"}
|