everything-dev 1.53.2 → 2.0.0-rc.1
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/README.md +2 -11
- package/dist/_virtual/_rolldown/runtime.cjs +17 -2
- package/dist/_virtual/_rolldown/runtime.mjs +36 -0
- package/dist/api/auth-middleware.cjs +161 -0
- package/dist/api/auth-middleware.cjs.map +1 -0
- package/dist/api/auth-middleware.d.cts +69 -0
- package/dist/api/auth-middleware.d.mts +69 -0
- package/dist/api/auth-middleware.mjs +160 -0
- package/dist/api/auth-middleware.mjs.map +1 -0
- package/dist/api-contract.cjs +250 -62
- package/dist/api-contract.cjs.map +1 -1
- package/dist/api-contract.mjs +246 -65
- package/dist/api-contract.mjs.map +1 -1
- package/dist/app.cjs +99 -26
- package/dist/app.cjs.map +1 -1
- package/dist/app.d.cts +3 -0
- package/dist/app.d.mts +3 -0
- package/dist/app.mjs +100 -27
- package/dist/app.mjs.map +1 -1
- package/dist/auth-login.cjs +163 -0
- package/dist/auth-login.cjs.map +1 -0
- package/dist/auth-login.mjs +162 -0
- package/dist/auth-login.mjs.map +1 -0
- package/dist/auth-session.cjs +64 -0
- package/dist/auth-session.cjs.map +1 -0
- package/dist/auth-session.mjs +58 -0
- package/dist/auth-session.mjs.map +1 -0
- package/dist/auth-types-gen.cjs +0 -1
- package/dist/auth-types-gen.cjs.map +1 -1
- package/dist/build.cjs +37 -173
- package/dist/build.cjs.map +1 -1
- package/dist/build.mjs +37 -171
- package/dist/build.mjs.map +1 -1
- package/dist/bundle-cache.cjs +74 -0
- package/dist/bundle-cache.cjs.map +1 -0
- package/dist/bundle-cache.d.cts +27 -0
- package/dist/bundle-cache.d.mts +27 -0
- package/dist/bundle-cache.mjs +68 -0
- package/dist/bundle-cache.mjs.map +1 -0
- package/dist/bundle-fs-resolve.cjs +209 -0
- package/dist/bundle-fs-resolve.cjs.map +1 -0
- package/dist/bundle-fs-resolve.d.cts +76 -0
- package/dist/bundle-fs-resolve.d.mts +76 -0
- package/dist/bundle-fs-resolve.mjs +202 -0
- package/dist/bundle-fs-resolve.mjs.map +1 -0
- package/dist/cdn-deploy.cjs +126 -0
- package/dist/cdn-deploy.cjs.map +1 -0
- package/dist/cdn-deploy.mjs +124 -0
- package/dist/cdn-deploy.mjs.map +1 -0
- package/dist/cli/db-doctor.cjs +19 -19
- package/dist/cli/db-doctor.cjs.map +1 -1
- package/dist/cli/db-doctor.mjs +18 -18
- package/dist/cli/db-doctor.mjs.map +1 -1
- package/dist/cli/db-repair.cjs +9 -32
- package/dist/cli/db-repair.cjs.map +1 -1
- package/dist/cli/db-repair.mjs +9 -32
- package/dist/cli/db-repair.mjs.map +1 -1
- package/dist/cli/framework-version.cjs +7 -3
- package/dist/cli/framework-version.cjs.map +1 -1
- package/dist/cli/framework-version.mjs +7 -3
- package/dist/cli/framework-version.mjs.map +1 -1
- package/dist/cli/infra.cjs +159 -251
- package/dist/cli/infra.cjs.map +1 -1
- package/dist/cli/infra.mjs +154 -242
- package/dist/cli/infra.mjs.map +1 -1
- package/dist/cli/init.cjs +627 -199
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.d.cts +61 -8
- package/dist/cli/init.d.mts +61 -8
- package/dist/cli/init.mjs +616 -197
- package/dist/cli/init.mjs.map +1 -1
- package/dist/cli/parse.cjs +8 -7
- package/dist/cli/parse.cjs.map +1 -1
- package/dist/cli/parse.mjs +9 -7
- package/dist/cli/parse.mjs.map +1 -1
- package/dist/cli/prompts.cjs +14 -1
- package/dist/cli/prompts.cjs.map +1 -1
- package/dist/cli/prompts.mjs +14 -1
- package/dist/cli/prompts.mjs.map +1 -1
- package/dist/cli/prune.cjs +220 -0
- package/dist/cli/prune.cjs.map +1 -0
- package/dist/cli/prune.mjs +220 -0
- package/dist/cli/prune.mjs.map +1 -0
- package/dist/cli/snapshot.cjs +2 -1
- package/dist/cli/snapshot.cjs.map +1 -1
- package/dist/cli/snapshot.mjs +2 -1
- package/dist/cli/snapshot.mjs.map +1 -1
- package/dist/cli/status.cjs +5 -4
- package/dist/cli/status.cjs.map +1 -1
- package/dist/cli/status.mjs +6 -5
- package/dist/cli/status.mjs.map +1 -1
- package/dist/cli/sync.cjs +156 -58
- package/dist/cli/sync.cjs.map +1 -1
- package/dist/cli/sync.mjs +158 -63
- package/dist/cli/sync.mjs.map +1 -1
- package/dist/cli/timing.cjs +0 -1
- package/dist/cli/timing.cjs.map +1 -1
- package/dist/cli/upgrade.cjs +95 -69
- package/dist/cli/upgrade.cjs.map +1 -1
- package/dist/cli/upgrade.mjs +97 -72
- package/dist/cli/upgrade.mjs.map +1 -1
- package/dist/cli/utils/helpers.cjs.map +1 -1
- package/dist/cli.cjs +320 -72
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +316 -68
- package/dist/cli.mjs.map +1 -1
- package/dist/code-artifacts.cjs +76 -8
- package/dist/code-artifacts.cjs.map +1 -1
- package/dist/code-artifacts.mjs +76 -10
- package/dist/code-artifacts.mjs.map +1 -1
- package/dist/commands/build.cjs +65 -0
- package/dist/commands/build.cjs.map +1 -0
- package/dist/commands/build.mjs +65 -0
- package/dist/commands/build.mjs.map +1 -0
- package/dist/commands/config.cjs +77 -0
- package/dist/commands/config.cjs.map +1 -0
- package/dist/commands/config.d.cts +8 -0
- package/dist/commands/config.d.mts +8 -0
- package/dist/commands/config.mjs +74 -0
- package/dist/commands/config.mjs.map +1 -0
- package/dist/commands/db.cjs +107 -0
- package/dist/commands/db.cjs.map +1 -0
- package/dist/commands/db.mjs +107 -0
- package/dist/commands/db.mjs.map +1 -0
- package/dist/commands/deploy.cjs +336 -0
- package/dist/commands/deploy.cjs.map +1 -0
- package/dist/commands/deploy.mjs +334 -0
- package/dist/commands/deploy.mjs.map +1 -0
- package/dist/commands/dev.cjs +75 -0
- package/dist/commands/dev.cjs.map +1 -0
- package/dist/commands/dev.mjs +73 -0
- package/dist/commands/dev.mjs.map +1 -0
- package/dist/commands/init.cjs +234 -0
- package/dist/commands/init.cjs.map +1 -0
- package/dist/commands/init.mjs +231 -0
- package/dist/commands/init.mjs.map +1 -0
- package/dist/commands/keys.cjs +255 -0
- package/dist/commands/keys.cjs.map +1 -0
- package/dist/commands/keys.mjs +253 -0
- package/dist/commands/keys.mjs.map +1 -0
- package/dist/commands/ops.cjs +199 -0
- package/dist/commands/ops.cjs.map +1 -0
- package/dist/commands/ops.mjs +197 -0
- package/dist/commands/ops.mjs.map +1 -0
- package/dist/commands/plugins.cjs +211 -0
- package/dist/commands/plugins.cjs.map +1 -0
- package/dist/commands/plugins.mjs +211 -0
- package/dist/commands/plugins.mjs.map +1 -0
- package/dist/commands/shared.cjs +8 -0
- package/dist/commands/shared.cjs.map +1 -0
- package/dist/commands/shared.d.cts +6 -0
- package/dist/commands/shared.d.mts +6 -0
- package/dist/commands/shared.mjs +8 -0
- package/dist/commands/shared.mjs.map +1 -0
- package/dist/commands/upgrade.cjs +325 -0
- package/dist/commands/upgrade.cjs.map +1 -0
- package/dist/commands/upgrade.mjs +323 -0
- package/dist/commands/upgrade.mjs.map +1 -0
- package/dist/components/dev-render.cjs +340 -0
- package/dist/components/dev-render.cjs.map +1 -0
- package/dist/components/dev-render.mjs +332 -0
- package/dist/components/dev-render.mjs.map +1 -0
- package/dist/config.cjs +460 -221
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +491 -48
- package/dist/config.d.mts +491 -48
- package/dist/config.mjs +439 -212
- package/dist/config.mjs.map +1 -1
- package/dist/contract.cjs +327 -50
- package/dist/contract.cjs.map +1 -1
- package/dist/contract.d.cts +1951 -1062
- package/dist/contract.d.mts +1951 -1062
- package/dist/contract.meta.cjs +107 -12
- package/dist/contract.meta.cjs.map +1 -1
- package/dist/contract.meta.d.cts +166 -8
- package/dist/contract.meta.d.mts +166 -8
- package/dist/contract.meta.mjs +107 -11
- package/dist/contract.meta.mjs.map +1 -1
- package/dist/contract.mjs +580 -327
- package/dist/contract.mjs.map +1 -1
- package/dist/dag.cjs +5 -3
- package/dist/dag.cjs.map +1 -1
- package/dist/dag.mjs +6 -3
- package/dist/dag.mjs.map +1 -1
- package/dist/db/binding.cjs +80 -0
- package/dist/db/binding.cjs.map +1 -0
- package/dist/db/binding.d.cts +39 -0
- package/dist/db/binding.d.mts +39 -0
- package/dist/db/binding.mjs +78 -0
- package/dist/db/binding.mjs.map +1 -0
- package/dist/db/bindings.cjs +78 -0
- package/dist/db/bindings.cjs.map +1 -0
- package/dist/db/bindings.d.cts +34 -0
- package/dist/db/bindings.d.mts +34 -0
- package/dist/db/bindings.mjs +76 -0
- package/dist/db/bindings.mjs.map +1 -0
- package/dist/db/core.cjs +204 -0
- package/dist/db/core.cjs.map +1 -0
- package/dist/db/core.d.cts +69 -0
- package/dist/db/core.d.mts +69 -0
- package/dist/db/core.mjs +192 -0
- package/dist/db/core.mjs.map +1 -0
- package/dist/db/driver.cjs +167 -0
- package/dist/db/driver.cjs.map +1 -0
- package/dist/db/driver.d.cts +50 -0
- package/dist/db/driver.d.mts +50 -0
- package/dist/db/driver.mjs +165 -0
- package/dist/db/driver.mjs.map +1 -0
- package/dist/db/drizzle-kit.cjs +177 -0
- package/dist/db/drizzle-kit.cjs.map +1 -0
- package/dist/db/drizzle-kit.d.cts +25 -0
- package/dist/db/drizzle-kit.d.mts +25 -0
- package/dist/db/drizzle-kit.mjs +175 -0
- package/dist/db/drizzle-kit.mjs.map +1 -0
- package/dist/db/errors.cjs +27 -0
- package/dist/db/errors.cjs.map +1 -0
- package/dist/db/errors.d.cts +16 -0
- package/dist/db/errors.d.mts +16 -0
- package/dist/db/errors.mjs +26 -0
- package/dist/db/errors.mjs.map +1 -0
- package/dist/db/identity.cjs +55 -0
- package/dist/db/identity.cjs.map +1 -0
- package/dist/db/identity.d.cts +40 -0
- package/dist/db/identity.d.mts +40 -0
- package/dist/db/identity.mjs +53 -0
- package/dist/db/identity.mjs.map +1 -0
- package/dist/db/index.cjs +43 -0
- package/dist/db/index.d.cts +9 -0
- package/dist/db/index.d.mts +9 -0
- package/dist/db/index.mjs +10 -0
- package/dist/db/run-migrations.cjs +343 -0
- package/dist/db/run-migrations.cjs.map +1 -0
- package/dist/db/run-migrations.d.cts +87 -0
- package/dist/db/run-migrations.d.mts +87 -0
- package/dist/db/run-migrations.mjs +341 -0
- package/dist/db/run-migrations.mjs.map +1 -0
- package/dist/delegate-signer.cjs +85 -0
- package/dist/delegate-signer.cjs.map +1 -0
- package/dist/delegate-signer.mjs +84 -0
- package/dist/delegate-signer.mjs.map +1 -0
- package/dist/deploy-diff.cjs +119 -0
- package/dist/deploy-diff.cjs.map +1 -0
- package/dist/deploy-diff.mjs +109 -0
- package/dist/deploy-diff.mjs.map +1 -0
- package/dist/descriptor/constructors.cjs +49 -0
- package/dist/descriptor/constructors.cjs.map +1 -0
- package/dist/descriptor/constructors.d.cts +27 -0
- package/dist/descriptor/constructors.d.mts +27 -0
- package/dist/descriptor/constructors.mjs +45 -0
- package/dist/descriptor/constructors.mjs.map +1 -0
- package/dist/descriptor/index.cjs +24 -0
- package/dist/descriptor/index.d.cts +5 -0
- package/dist/descriptor/index.d.mts +5 -0
- package/dist/descriptor/index.mjs +6 -0
- package/dist/descriptor/resolve.cjs +258 -0
- package/dist/descriptor/resolve.cjs.map +1 -0
- package/dist/descriptor/resolve.d.cts +50 -0
- package/dist/descriptor/resolve.d.mts +50 -0
- package/dist/descriptor/resolve.mjs +252 -0
- package/dist/descriptor/resolve.mjs.map +1 -0
- package/dist/descriptor/schema.cjs +109 -0
- package/dist/descriptor/schema.cjs.map +1 -0
- package/dist/descriptor/schema.d.cts +217 -0
- package/dist/descriptor/schema.d.mts +217 -0
- package/dist/descriptor/schema.mjs +102 -0
- package/dist/descriptor/schema.mjs.map +1 -0
- package/dist/descriptor/serialize.cjs +45 -0
- package/dist/descriptor/serialize.cjs.map +1 -0
- package/dist/descriptor/serialize.d.cts +7 -0
- package/dist/descriptor/serialize.d.mts +7 -0
- package/dist/descriptor/serialize.mjs +45 -0
- package/dist/descriptor/serialize.mjs.map +1 -0
- package/dist/dev-log-pipeline.cjs +273 -0
- package/dist/dev-log-pipeline.cjs.map +1 -0
- package/dist/dev-log-pipeline.mjs +267 -0
- package/dist/dev-log-pipeline.mjs.map +1 -0
- package/dist/dev-logs.cjs +39 -8
- package/dist/dev-logs.cjs.map +1 -1
- package/dist/dev-logs.mjs +37 -9
- package/dist/dev-logs.mjs.map +1 -1
- package/dist/dev-program.cjs +405 -0
- package/dist/dev-program.cjs.map +1 -0
- package/dist/dev-program.d.cts +10 -0
- package/dist/dev-program.d.mts +10 -0
- package/dist/dev-program.mjs +395 -0
- package/dist/dev-program.mjs.map +1 -0
- package/dist/dev-session-data.d.cts +27 -0
- package/dist/dev-session-data.d.mts +27 -0
- package/dist/dev-session.cjs +178 -105
- package/dist/dev-session.cjs.map +1 -1
- package/dist/dev-session.mjs +180 -105
- package/dist/dev-session.mjs.map +1 -1
- package/dist/env/process-env.cjs +16 -0
- package/dist/env/process-env.cjs.map +1 -0
- package/dist/env/process-env.mjs +13 -0
- package/dist/env/process-env.mjs.map +1 -0
- package/dist/env/project-env.cjs +144 -0
- package/dist/env/project-env.cjs.map +1 -0
- package/dist/env/project-env.d.cts +1 -0
- package/dist/env/project-env.d.mts +1 -0
- package/dist/env/project-env.mjs +132 -0
- package/dist/env/project-env.mjs.map +1 -0
- package/dist/fastkv.cjs +59 -12
- package/dist/fastkv.cjs.map +1 -1
- package/dist/fastkv.d.cts +42 -6
- package/dist/fastkv.d.mts +42 -6
- package/dist/fastkv.mjs +58 -13
- package/dist/fastkv.mjs.map +1 -1
- package/dist/fingerprint.cjs +57 -0
- package/dist/fingerprint.cjs.map +1 -0
- package/dist/fingerprint.d.cts +14 -0
- package/dist/fingerprint.d.mts +14 -0
- package/dist/fingerprint.mjs +55 -0
- package/dist/fingerprint.mjs.map +1 -0
- package/dist/http-client.cjs +17 -17
- package/dist/http-client.cjs.map +1 -1
- package/dist/http-client.mjs +17 -17
- package/dist/http-client.mjs.map +1 -1
- package/dist/image-deploy.cjs +186 -0
- package/dist/image-deploy.cjs.map +1 -0
- package/dist/image-deploy.mjs +182 -0
- package/dist/image-deploy.mjs.map +1 -0
- package/dist/index.cjs +66 -18
- package/dist/index.d.cts +8 -7
- package/dist/index.d.mts +8 -7
- package/dist/index.mjs +6 -5
- package/dist/infra/docker.cjs +77 -0
- package/dist/infra/docker.cjs.map +1 -0
- package/dist/infra/docker.d.cts +10 -0
- package/dist/infra/docker.d.mts +10 -0
- package/dist/infra/docker.mjs +69 -0
- package/dist/infra/docker.mjs.map +1 -0
- package/dist/infra/materializer.cjs +74 -0
- package/dist/infra/materializer.cjs.map +1 -0
- package/dist/infra/materializer.mjs +70 -0
- package/dist/infra/materializer.mjs.map +1 -0
- package/dist/infra/planner.cjs +135 -103
- package/dist/infra/planner.cjs.map +1 -1
- package/dist/infra/planner.mjs +137 -104
- package/dist/infra/planner.mjs.map +1 -1
- package/dist/infra/port-ownership.cjs +57 -0
- package/dist/infra/port-ownership.cjs.map +1 -0
- package/dist/infra/port-ownership.mjs +57 -0
- package/dist/infra/port-ownership.mjs.map +1 -0
- package/dist/infra/preflight.cjs +45 -33
- package/dist/infra/preflight.cjs.map +1 -1
- package/dist/infra/preflight.d.cts +1 -0
- package/dist/infra/preflight.d.mts +1 -0
- package/dist/infra/preflight.mjs +46 -34
- package/dist/infra/preflight.mjs.map +1 -1
- package/dist/infra/types.cjs.map +1 -1
- package/dist/infra/types.d.cts +2 -0
- package/dist/infra/types.d.mts +2 -0
- package/dist/infra/types.mjs.map +1 -1
- package/dist/integrity.cjs +50 -61
- package/dist/integrity.cjs.map +1 -1
- package/dist/integrity.d.cts +16 -10
- package/dist/integrity.d.mts +16 -10
- package/dist/integrity.mjs +50 -59
- package/dist/integrity.mjs.map +1 -1
- package/dist/internal/manifest-normalizer.cjs +8 -2
- package/dist/internal/manifest-normalizer.cjs.map +1 -1
- package/dist/internal/manifest-normalizer.mjs +9 -3
- package/dist/internal/manifest-normalizer.mjs.map +1 -1
- package/dist/merge.cjs +19 -1
- package/dist/merge.cjs.map +1 -1
- package/dist/merge.d.cts +1 -1
- package/dist/merge.d.mts +1 -1
- package/dist/merge.mjs +19 -2
- package/dist/merge.mjs.map +1 -1
- package/dist/mf.cjs +190 -3
- package/dist/mf.cjs.map +1 -1
- package/dist/mf.d.cts +24 -2
- package/dist/mf.d.mts +24 -2
- package/dist/mf.mjs +189 -4
- package/dist/mf.mjs.map +1 -1
- package/dist/near-cli.cjs +59 -91
- package/dist/near-cli.cjs.map +1 -1
- package/dist/near-cli.mjs +58 -90
- package/dist/near-cli.mjs.map +1 -1
- package/dist/near-signer.cjs +73 -0
- package/dist/near-signer.cjs.map +1 -0
- package/dist/near-signer.mjs +70 -0
- package/dist/near-signer.mjs.map +1 -0
- package/dist/network.cjs +0 -1
- package/dist/network.cjs.map +1 -1
- package/dist/orchestrator.cjs +256 -87
- package/dist/orchestrator.cjs.map +1 -1
- package/dist/orchestrator.mjs +248 -87
- package/dist/orchestrator.mjs.map +1 -1
- package/dist/platform-deploy.cjs +81 -0
- package/dist/platform-deploy.cjs.map +1 -0
- package/dist/platform-deploy.mjs +80 -0
- package/dist/platform-deploy.mjs.map +1 -0
- package/dist/plugin.cjs +54 -1389
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +6 -896
- package/dist/plugin.d.mts +6 -896
- package/dist/plugin.mjs +53 -1387
- package/dist/plugin.mjs.map +1 -1
- package/dist/process-kill.cjs +44 -0
- package/dist/process-kill.cjs.map +1 -0
- package/dist/process-kill.mjs +43 -0
- package/dist/process-kill.mjs.map +1 -0
- package/dist/process-registry.cjs +64 -9
- package/dist/process-registry.cjs.map +1 -1
- package/dist/process-registry.mjs +61 -10
- package/dist/process-registry.mjs.map +1 -1
- package/dist/progress.cjs +45 -0
- package/dist/progress.cjs.map +1 -0
- package/dist/progress.d.cts +13 -0
- package/dist/progress.d.mts +13 -0
- package/dist/progress.mjs +42 -0
- package/dist/progress.mjs.map +1 -0
- package/dist/publish.cjs +513 -79
- package/dist/publish.cjs.map +1 -1
- package/dist/publish.mjs +515 -82
- package/dist/publish.mjs.map +1 -1
- package/dist/registry-use.cjs +41 -0
- package/dist/registry-use.cjs.map +1 -0
- package/dist/registry-use.mjs +40 -0
- package/dist/registry-use.mjs.map +1 -0
- package/dist/resolution/session.cjs +335 -0
- package/dist/resolution/session.cjs.map +1 -0
- package/dist/resolution/session.d.cts +105 -0
- package/dist/resolution/session.d.mts +105 -0
- package/dist/resolution/session.mjs +331 -0
- package/dist/resolution/session.mjs.map +1 -0
- package/dist/rollback.cjs +131 -0
- package/dist/rollback.cjs.map +1 -0
- package/dist/rollback.mjs +128 -0
- package/dist/rollback.mjs.map +1 -0
- package/dist/sdk.cjs +7 -7
- package/dist/sdk.d.cts +3 -3
- package/dist/sdk.d.mts +3 -3
- package/dist/sdk.mjs +2 -2
- package/dist/service-descriptor.cjs +67 -34
- package/dist/service-descriptor.cjs.map +1 -1
- package/dist/service-descriptor.d.cts +4 -1
- package/dist/service-descriptor.d.mts +3 -0
- package/dist/service-descriptor.mjs +63 -35
- package/dist/service-descriptor.mjs.map +1 -1
- package/dist/shared-deps.cjs +17 -16
- package/dist/shared-deps.cjs.map +1 -1
- package/dist/shared-deps.mjs +17 -16
- package/dist/shared-deps.mjs.map +1 -1
- package/dist/start-config-source.cjs +24 -0
- package/dist/start-config-source.cjs.map +1 -0
- package/dist/start-config-source.d.cts +29 -0
- package/dist/start-config-source.d.mts +29 -0
- package/dist/start-config-source.mjs +22 -0
- package/dist/start-config-source.mjs.map +1 -0
- package/dist/storage-upload.cjs +145 -0
- package/dist/storage-upload.cjs.map +1 -0
- package/dist/storage-upload.mjs +143 -0
- package/dist/storage-upload.mjs.map +1 -0
- package/dist/types.cjs +126 -20
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +867 -585
- package/dist/types.d.mts +867 -585
- package/dist/types.mjs +307 -208
- package/dist/types.mjs.map +1 -1
- package/dist/ui/api.cjs +105 -0
- package/dist/ui/api.cjs.map +1 -0
- package/dist/ui/api.d.cts +31 -0
- package/dist/ui/api.d.mts +31 -0
- package/dist/ui/api.mjs +99 -0
- package/dist/ui/api.mjs.map +1 -0
- package/dist/ui/auth-guards.cjs +50 -0
- package/dist/ui/auth-guards.cjs.map +1 -0
- package/dist/ui/auth-guards.d.cts +39 -0
- package/dist/ui/auth-guards.d.mts +39 -0
- package/dist/ui/auth-guards.mjs +48 -0
- package/dist/ui/auth-guards.mjs.map +1 -0
- package/dist/ui/auth.cjs +197 -0
- package/dist/ui/auth.cjs.map +1 -0
- package/dist/ui/auth.d.cts +56 -0
- package/dist/ui/auth.d.mts +56 -0
- package/dist/ui/auth.mjs +179 -0
- package/dist/ui/auth.mjs.map +1 -0
- package/dist/ui/entry.cjs +16 -0
- package/dist/ui/entry.cjs.map +1 -0
- package/dist/ui/entry.d.cts +12 -0
- package/dist/ui/entry.d.mts +12 -0
- package/dist/ui/entry.mjs +15 -0
- package/dist/ui/entry.mjs.map +1 -0
- package/dist/ui/head.cjs +14 -7
- package/dist/ui/head.cjs.map +1 -1
- package/dist/ui/head.mjs +15 -7
- package/dist/ui/head.mjs.map +1 -1
- package/dist/ui/hydrate.cjs +265 -0
- package/dist/ui/hydrate.cjs.map +1 -0
- package/dist/ui/hydrate.d.cts +48 -0
- package/dist/ui/hydrate.d.mts +48 -0
- package/dist/ui/hydrate.mjs +263 -0
- package/dist/ui/hydrate.mjs.map +1 -0
- package/dist/ui/i18n.cjs +153 -0
- package/dist/ui/i18n.cjs.map +1 -0
- package/dist/ui/i18n.d.cts +29 -0
- package/dist/ui/i18n.d.mts +29 -0
- package/dist/ui/i18n.mjs +140 -0
- package/dist/ui/i18n.mjs.map +1 -0
- package/dist/ui/index.cjs +19 -1
- package/dist/ui/index.d.cts +6 -3
- package/dist/ui/index.d.mts +6 -3
- package/dist/ui/index.mjs +5 -2
- package/dist/ui/locale.cjs +53 -0
- package/dist/ui/locale.cjs.map +1 -0
- package/dist/ui/locale.d.cts +18 -0
- package/dist/ui/locale.d.mts +18 -0
- package/dist/ui/locale.mjs +49 -0
- package/dist/ui/locale.mjs.map +1 -0
- package/dist/ui/manifest/index.cjs +25 -0
- package/dist/ui/manifest/index.cjs.map +1 -0
- package/dist/ui/manifest/index.d.cts +9 -0
- package/dist/ui/manifest/index.d.mts +9 -0
- package/dist/ui/manifest/index.mjs +13 -0
- package/dist/ui/manifest/index.mjs.map +1 -0
- package/dist/ui/manifest-generator.cjs +8 -0
- package/dist/ui/manifest-generator.d.cts +1 -0
- package/dist/ui/manifest-generator.d.mts +1 -0
- package/dist/ui/manifest-generator.mjs +3 -0
- package/dist/ui/message-catalogs.cjs +8 -0
- package/dist/ui/message-catalogs.cjs.map +1 -0
- package/dist/ui/message-catalogs.d.cts +5 -0
- package/dist/ui/message-catalogs.d.mts +5 -0
- package/dist/ui/message-catalogs.mjs +8 -0
- package/dist/ui/message-catalogs.mjs.map +1 -0
- package/dist/ui/metadata.cjs +0 -1
- package/dist/ui/metadata.cjs.map +1 -1
- package/dist/ui/metadata.d.cts +1 -1
- package/dist/ui/metadata.d.mts +1 -1
- package/dist/ui/plugin-path.cjs +37 -0
- package/dist/ui/plugin-path.cjs.map +1 -0
- package/dist/ui/plugin-path.d.cts +25 -0
- package/dist/ui/plugin-path.d.mts +25 -0
- package/dist/ui/plugin-path.mjs +35 -0
- package/dist/ui/plugin-path.mjs.map +1 -0
- package/dist/ui/router-client.cjs +61 -0
- package/dist/ui/router-client.cjs.map +1 -0
- package/dist/ui/router-client.d.cts +20 -0
- package/dist/ui/router-client.d.mts +20 -0
- package/dist/ui/router-client.mjs +60 -0
- package/dist/ui/router-client.mjs.map +1 -0
- package/dist/ui/router-defaults.cjs +48 -0
- package/dist/ui/router-defaults.cjs.map +1 -0
- package/dist/ui/router-defaults.d.cts +8 -0
- package/dist/ui/router-defaults.d.mts +8 -0
- package/dist/ui/router-defaults.mjs +45 -0
- package/dist/ui/router-defaults.mjs.map +1 -0
- package/dist/ui/router-error.cjs +70 -0
- package/dist/ui/router-error.cjs.map +1 -0
- package/dist/ui/router-error.d.cts +19 -0
- package/dist/ui/router-error.d.mts +19 -0
- package/dist/ui/router-error.mjs +69 -0
- package/dist/ui/router-error.mjs.map +1 -0
- package/dist/ui/router-server.cjs +153 -0
- package/dist/ui/router-server.cjs.map +1 -0
- package/dist/ui/router-server.d.cts +38 -0
- package/dist/ui/router-server.d.mts +38 -0
- package/dist/ui/router-server.mjs +152 -0
- package/dist/ui/router-server.mjs.map +1 -0
- package/dist/ui/router.cjs +4 -16
- package/dist/ui/router.cjs.map +1 -1
- package/dist/ui/router.mjs +4 -15
- package/dist/ui/router.mjs.map +1 -1
- package/dist/ui/runtime.cjs +5 -1
- package/dist/ui/runtime.cjs.map +1 -1
- package/dist/ui/runtime.d.cts +2 -1
- package/dist/ui/runtime.d.mts +2 -1
- package/dist/ui/runtime.mjs +5 -1
- package/dist/ui/runtime.mjs.map +1 -1
- package/dist/ui/slot.cjs +34 -0
- package/dist/ui/slot.cjs.map +1 -0
- package/dist/ui/slot.d.cts +43 -0
- package/dist/ui/slot.d.mts +43 -0
- package/dist/ui/slot.mjs +34 -0
- package/dist/ui/slot.mjs.map +1 -0
- package/dist/ui/tenant.cjs +300 -0
- package/dist/ui/tenant.cjs.map +1 -0
- package/dist/ui/tenant.d.cts +122 -0
- package/dist/ui/tenant.d.mts +122 -0
- package/dist/ui/tenant.mjs +279 -0
- package/dist/ui/tenant.mjs.map +1 -0
- package/dist/ui/types.d.cts +32 -2
- package/dist/ui/types.d.mts +32 -2
- package/dist/ui/version-check.cjs +47 -0
- package/dist/ui/version-check.cjs.map +1 -0
- package/dist/ui/version-check.d.cts +23 -0
- package/dist/ui/version-check.d.mts +23 -0
- package/dist/ui/version-check.mjs +46 -0
- package/dist/ui/version-check.mjs.map +1 -0
- package/dist/utils/banner.cjs +2 -2
- package/dist/utils/banner.cjs.map +1 -1
- package/dist/utils/banner.mjs +2 -2
- package/dist/utils/banner.mjs.map +1 -1
- package/dist/utils/linkify.cjs +1 -1
- package/dist/utils/linkify.cjs.map +1 -1
- package/dist/utils/linkify.mjs +1 -0
- package/dist/utils/linkify.mjs.map +1 -1
- package/dist/utils/run.cjs +6 -6
- package/dist/utils/run.cjs.map +1 -1
- package/dist/utils/run.mjs +6 -6
- package/dist/utils/run.mjs.map +1 -1
- package/dist/utils/save-config.cjs +12 -0
- package/dist/utils/save-config.cjs.map +1 -1
- package/dist/utils/save-config.mjs +12 -0
- package/dist/utils/save-config.mjs.map +1 -1
- package/dist/utils/snapshot-hash.cjs +10 -0
- package/dist/utils/snapshot-hash.cjs.map +1 -0
- package/dist/utils/snapshot-hash.mjs +10 -0
- package/dist/utils/snapshot-hash.mjs.map +1 -0
- package/dist/utils/string.cjs +0 -1
- package/dist/utils/string.cjs.map +1 -1
- package/dist/utils/theme.cjs +30 -12
- package/dist/utils/theme.cjs.map +1 -1
- package/dist/utils/theme.mjs +30 -11
- package/dist/utils/theme.mjs.map +1 -1
- package/dist/version-manifest-deploy.cjs +50 -0
- package/dist/version-manifest-deploy.cjs.map +1 -0
- package/dist/version-manifest-deploy.mjs +49 -0
- package/dist/version-manifest-deploy.mjs.map +1 -0
- package/dist/version-manifest-resolve.cjs +42 -0
- package/dist/version-manifest-resolve.cjs.map +1 -0
- package/dist/version-manifest-resolve.d.cts +38 -0
- package/dist/version-manifest-resolve.d.mts +38 -0
- package/dist/version-manifest-resolve.mjs +40 -0
- package/dist/version-manifest-resolve.mjs.map +1 -0
- package/dist/version-status.cjs +18 -0
- package/dist/version-status.cjs.map +1 -0
- package/dist/version-status.d.cts +22 -0
- package/dist/version-status.d.mts +22 -0
- package/dist/version-status.mjs +17 -0
- package/dist/version-status.mjs.map +1 -0
- package/dist/workspace-catalog.cjs +53 -0
- package/dist/workspace-catalog.cjs.map +1 -0
- package/dist/workspace-catalog.mjs +51 -0
- package/dist/workspace-catalog.mjs.map +1 -0
- package/dist/workspace.cjs +237 -0
- package/dist/workspace.cjs.map +1 -0
- package/dist/workspace.mjs +233 -0
- package/dist/workspace.mjs.map +1 -0
- package/package.json +179 -27
- package/skills/add-a-route/SKILL.md +132 -0
- package/skills/api-and-auth/SKILL.md +87 -21
- package/skills/api-and-auth/references/middleware.md +1 -1
- package/skills/cli-reference/SKILL.md +48 -21
- package/skills/code-style/SKILL.md +8 -0
- package/skills/dev-workflow/SKILL.md +50 -26
- package/skills/extends-config/SKILL.md +31 -19
- package/skills/init-upgrade/SKILL.md +29 -16
- package/skills/plugin-development/SKILL.md +46 -112
- package/skills/plugin-development/references/database.md +82 -0
- package/skills/plugin-development/references/request-context.md +67 -0
- package/skills/publish-sync/SKILL.md +99 -22
- package/skills/registry/SKILL.md +82 -0
- package/skills/super-app/SKILL.md +25 -15
- package/skills/talk-to-the-app/SKILL.md +138 -0
- package/skills/ui-integration/SKILL.md +93 -11
- package/dist/cli/db-studio.cjs +0 -131
- package/dist/cli/db-studio.cjs.map +0 -1
- package/dist/cli/db-studio.mjs +0 -127
- package/dist/cli/db-studio.mjs.map +0 -1
- package/dist/cli/init.d.cts.map +0 -1
- package/dist/cli/init.d.mts.map +0 -1
- package/dist/components/dev-view.cjs +0 -309
- package/dist/components/dev-view.cjs.map +0 -1
- package/dist/components/dev-view.mjs +0 -309
- package/dist/components/dev-view.mjs.map +0 -1
- package/dist/components/streaming-view.cjs +0 -134
- package/dist/components/streaming-view.cjs.map +0 -1
- package/dist/components/streaming-view.mjs +0 -132
- package/dist/components/streaming-view.mjs.map +0 -1
- package/dist/config.d.cts.map +0 -1
- package/dist/config.d.mts.map +0 -1
- package/dist/contract.d.cts.map +0 -1
- package/dist/contract.d.mts.map +0 -1
- package/dist/contract.meta.d.cts.map +0 -1
- package/dist/contract.meta.d.mts.map +0 -1
- package/dist/dag.d.cts.map +0 -1
- package/dist/dag.d.mts.map +0 -1
- package/dist/db.cjs +0 -81
- package/dist/db.cjs.map +0 -1
- package/dist/db.d.cts +0 -30
- package/dist/db.d.cts.map +0 -1
- package/dist/db.d.mts +0 -30
- package/dist/db.d.mts.map +0 -1
- package/dist/db.mjs +0 -75
- package/dist/db.mjs.map +0 -1
- package/dist/fastkv.d.cts.map +0 -1
- package/dist/fastkv.d.mts.map +0 -1
- package/dist/integrity.d.cts.map +0 -1
- package/dist/integrity.d.mts.map +0 -1
- package/dist/merge.d.cts.map +0 -1
- package/dist/merge.d.mts.map +0 -1
- package/dist/mf.d.cts.map +0 -1
- package/dist/mf.d.mts.map +0 -1
- package/dist/plugin.d.cts.map +0 -1
- package/dist/plugin.d.mts.map +0 -1
- package/dist/service-descriptor.d.cts.map +0 -1
- package/dist/service-descriptor.d.mts.map +0 -1
- package/dist/types.d.cts.map +0 -1
- package/dist/types.d.mts.map +0 -1
- package/dist/ui/head.d.cts.map +0 -1
- package/dist/ui/head.d.mts.map +0 -1
- package/dist/ui/metadata.d.cts.map +0 -1
- package/dist/ui/metadata.d.mts.map +0 -1
- package/dist/ui/router.d.cts.map +0 -1
- package/dist/ui/router.d.mts.map +0 -1
- package/dist/ui/runtime.d.cts.map +0 -1
- package/dist/ui/runtime.d.mts.map +0 -1
- package/dist/ui/types.d.cts.map +0 -1
- package/dist/ui/types.d.mts.map +0 -1
package/dist/utils/theme.cjs
CHANGED
|
@@ -1,21 +1,39 @@
|
|
|
1
1
|
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
2
|
let chalk = require("chalk");
|
|
3
3
|
chalk = require_runtime.__toESM(chalk, 1);
|
|
4
|
-
let gradient_string = require("gradient-string");
|
|
5
|
-
gradient_string = require_runtime.__toESM(gradient_string, 1);
|
|
6
4
|
|
|
7
5
|
//#region src/utils/theme.ts
|
|
8
|
-
const
|
|
6
|
+
const hex = (code) => (text) => chalk.default.hex(code)(text);
|
|
7
|
+
const truecolorRamp = (from, to) => (text) => {
|
|
8
|
+
const rgb = (code) => [
|
|
9
|
+
1,
|
|
10
|
+
3,
|
|
11
|
+
5
|
|
12
|
+
].map((i) => parseInt(code.slice(i, i + 2), 16));
|
|
13
|
+
const [r1, g1, b1] = rgb(from);
|
|
14
|
+
const [r2, g2, b2] = rgb(to);
|
|
15
|
+
const chars = Array.from(text);
|
|
16
|
+
const total = chars.filter((ch) => ch !== "\n").length;
|
|
17
|
+
let seen = 0;
|
|
18
|
+
return chars.map((ch) => {
|
|
19
|
+
if (ch === "\n") return ch;
|
|
20
|
+
const t = total > 1 ? seen / (total - 1) : 0;
|
|
21
|
+
seen += 1;
|
|
22
|
+
return chalk.default.rgb(Math.round(r1 + (r2 - r1) * t), Math.round(g1 + (g2 - g1) * t), Math.round(b1 + (b2 - b1) * t))(ch);
|
|
23
|
+
}).join("");
|
|
24
|
+
};
|
|
25
|
+
const gradients = { cyber: truecolorRamp("#00ffff", "#ff00ff") };
|
|
9
26
|
const colors = {
|
|
10
|
-
cyan:
|
|
11
|
-
magenta:
|
|
12
|
-
green:
|
|
13
|
-
blue:
|
|
14
|
-
yellow:
|
|
15
|
-
|
|
16
|
-
|
|
27
|
+
cyan: hex("#00ffff"),
|
|
28
|
+
magenta: hex("#ff00ff"),
|
|
29
|
+
green: hex("#00ff41"),
|
|
30
|
+
blue: hex("#0080ff"),
|
|
31
|
+
yellow: hex("#ffcc00"),
|
|
32
|
+
orange: hex("#ffaa00"),
|
|
33
|
+
white: hex("#f0f0f0"),
|
|
34
|
+
gray: hex("#555555"),
|
|
17
35
|
dim: chalk.default.dim,
|
|
18
|
-
error:
|
|
36
|
+
error: hex("#ff3366")
|
|
19
37
|
};
|
|
20
38
|
const icons = {
|
|
21
39
|
scan: "○",
|
|
@@ -33,7 +51,7 @@ const frames = {
|
|
|
33
51
|
bottom: (width) => `└${"─".repeat(width - 2)}┘`
|
|
34
52
|
};
|
|
35
53
|
function divider(width = 48) {
|
|
36
|
-
return
|
|
54
|
+
return chalk.default.dim("─".repeat(width));
|
|
37
55
|
}
|
|
38
56
|
|
|
39
57
|
//#endregion
|
package/dist/utils/theme.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.cjs","names":[],"sources":["../../src/utils/theme.ts"],"sourcesContent":["import chalk from \"chalk\";\
|
|
1
|
+
{"version":3,"file":"theme.cjs","names":[],"sources":["../../src/utils/theme.ts"],"sourcesContent":["import chalk from \"chalk\";\n\nconst hex =\n (code: string) =>\n (text: string): string =>\n chalk.hex(code)(text);\n\nconst truecolorRamp =\n (from: string, to: string) =>\n (text: string): string => {\n const rgb = (code: string) => [1, 3, 5].map((i) => parseInt(code.slice(i, i + 2), 16));\n const [r1, g1, b1] = rgb(from);\n const [r2, g2, b2] = rgb(to);\n const chars = Array.from(text);\n const total = chars.filter((ch) => ch !== \"\\n\").length;\n let seen = 0;\n return chars\n .map((ch) => {\n if (ch === \"\\n\") return ch;\n const t = total > 1 ? seen / (total - 1) : 0;\n seen += 1;\n return chalk.rgb(\n Math.round(r1 + (r2 - r1) * t),\n Math.round(g1 + (g2 - g1) * t),\n Math.round(b1 + (b2 - b1) * t),\n )(ch);\n })\n .join(\"\");\n };\n\nexport const gradients: Record<string, (text: string) => string> = {\n cyber: truecolorRamp(\"#00ffff\", \"#ff00ff\"),\n};\n\nexport const colors = {\n cyan: hex(\"#00ffff\"),\n magenta: hex(\"#ff00ff\"),\n green: hex(\"#00ff41\"),\n blue: hex(\"#0080ff\"),\n yellow: hex(\"#ffcc00\"),\n orange: hex(\"#ffaa00\"),\n white: hex(\"#f0f0f0\"),\n gray: hex(\"#555555\"),\n dim: chalk.dim,\n error: hex(\"#ff3366\"),\n};\n\nexport const icons = {\n scan: \"○\",\n run: \"▶\",\n ok: \"✓\",\n err: \"✗\",\n pending: \"○\",\n arrow: \"→\",\n dot: \"·\",\n app: \"◉\",\n config: \"⚙\",\n};\n\nexport const frames = {\n top: (width: number) => `┌${\"─\".repeat(width - 2)}┐`,\n bottom: (width: number) => `└${\"─\".repeat(width - 2)}┘`,\n};\n\nexport function divider(width = 48): string {\n return chalk.dim(\"─\".repeat(width));\n}\n"],"mappings":";;;;;AAEA,MAAM,OACH,UACA,SACC,cAAM,IAAI,IAAI,CAAC,CAAC,IAAI;AAExB,MAAM,iBACH,MAAc,QACd,SAAyB;CACxB,MAAM,OAAO,SAAiB;EAAC;EAAG;EAAG;CAAC,CAAC,CAAC,KAAK,MAAM,SAAS,KAAK,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;CACrF,MAAM,CAAC,IAAI,IAAI,MAAM,IAAI,IAAI;CAC7B,MAAM,CAAC,IAAI,IAAI,MAAM,IAAI,EAAE;CAC3B,MAAM,QAAQ,MAAM,KAAK,IAAI;CAC7B,MAAM,QAAQ,MAAM,QAAQ,OAAO,OAAO,IAAI,CAAC,CAAC;CAChD,IAAI,OAAO;CACX,OAAO,MACJ,KAAK,OAAO;EACX,IAAI,OAAO,MAAM,OAAO;EACxB,MAAM,IAAI,QAAQ,IAAI,QAAQ,QAAQ,KAAK;EAC3C,QAAQ;EACR,OAAO,cAAM,IACX,KAAK,MAAM,MAAM,KAAK,MAAM,CAAC,GAC7B,KAAK,MAAM,MAAM,KAAK,MAAM,CAAC,GAC7B,KAAK,MAAM,MAAM,KAAK,MAAM,CAAC,CAC/B,CAAC,CAAC,EAAE;CACN,CAAC,CAAC,CACD,KAAK,EAAE;AACZ;AAEF,MAAa,YAAsD,EACjE,OAAO,cAAc,WAAW,SAAS,EAC3C;AAEA,MAAa,SAAS;CACpB,MAAM,IAAI,SAAS;CACnB,SAAS,IAAI,SAAS;CACtB,OAAO,IAAI,SAAS;CACpB,MAAM,IAAI,SAAS;CACnB,QAAQ,IAAI,SAAS;CACrB,QAAQ,IAAI,SAAS;CACrB,OAAO,IAAI,SAAS;CACpB,MAAM,IAAI,SAAS;CACnB,KAAK,cAAM;CACX,OAAO,IAAI,SAAS;AACtB;AAEA,MAAa,QAAQ;CACnB,MAAM;CACN,KAAK;CACL,IAAI;CACJ,KAAK;CACL,SAAS;CACT,OAAO;CACP,KAAK;CACL,KAAK;CACL,QAAQ;AACV;AAEA,MAAa,SAAS;CACpB,MAAM,UAAkB,IAAI,IAAI,OAAO,QAAQ,CAAC,EAAE;CAClD,SAAS,UAAkB,IAAI,IAAI,OAAO,QAAQ,CAAC,EAAE;AACvD;AAEA,SAAgB,QAAQ,QAAQ,IAAY;CAC1C,OAAO,cAAM,IAAI,IAAI,OAAO,KAAK,CAAC;AACpC"}
|
package/dist/utils/theme.mjs
CHANGED
|
@@ -1,18 +1,37 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
|
-
import gradient from "gradient-string";
|
|
3
2
|
|
|
4
3
|
//#region src/utils/theme.ts
|
|
5
|
-
const
|
|
4
|
+
const hex = (code) => (text) => chalk.hex(code)(text);
|
|
5
|
+
const truecolorRamp = (from, to) => (text) => {
|
|
6
|
+
const rgb = (code) => [
|
|
7
|
+
1,
|
|
8
|
+
3,
|
|
9
|
+
5
|
|
10
|
+
].map((i) => parseInt(code.slice(i, i + 2), 16));
|
|
11
|
+
const [r1, g1, b1] = rgb(from);
|
|
12
|
+
const [r2, g2, b2] = rgb(to);
|
|
13
|
+
const chars = Array.from(text);
|
|
14
|
+
const total = chars.filter((ch) => ch !== "\n").length;
|
|
15
|
+
let seen = 0;
|
|
16
|
+
return chars.map((ch) => {
|
|
17
|
+
if (ch === "\n") return ch;
|
|
18
|
+
const t = total > 1 ? seen / (total - 1) : 0;
|
|
19
|
+
seen += 1;
|
|
20
|
+
return chalk.rgb(Math.round(r1 + (r2 - r1) * t), Math.round(g1 + (g2 - g1) * t), Math.round(b1 + (b2 - b1) * t))(ch);
|
|
21
|
+
}).join("");
|
|
22
|
+
};
|
|
23
|
+
const gradients = { cyber: truecolorRamp("#00ffff", "#ff00ff") };
|
|
6
24
|
const colors = {
|
|
7
|
-
cyan:
|
|
8
|
-
magenta:
|
|
9
|
-
green:
|
|
10
|
-
blue:
|
|
11
|
-
yellow:
|
|
12
|
-
|
|
13
|
-
|
|
25
|
+
cyan: hex("#00ffff"),
|
|
26
|
+
magenta: hex("#ff00ff"),
|
|
27
|
+
green: hex("#00ff41"),
|
|
28
|
+
blue: hex("#0080ff"),
|
|
29
|
+
yellow: hex("#ffcc00"),
|
|
30
|
+
orange: hex("#ffaa00"),
|
|
31
|
+
white: hex("#f0f0f0"),
|
|
32
|
+
gray: hex("#555555"),
|
|
14
33
|
dim: chalk.dim,
|
|
15
|
-
error:
|
|
34
|
+
error: hex("#ff3366")
|
|
16
35
|
};
|
|
17
36
|
const icons = {
|
|
18
37
|
scan: "○",
|
|
@@ -30,7 +49,7 @@ const frames = {
|
|
|
30
49
|
bottom: (width) => `└${"─".repeat(width - 2)}┘`
|
|
31
50
|
};
|
|
32
51
|
function divider(width = 48) {
|
|
33
|
-
return
|
|
52
|
+
return chalk.dim("─".repeat(width));
|
|
34
53
|
}
|
|
35
54
|
|
|
36
55
|
//#endregion
|
package/dist/utils/theme.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.mjs","names":[],"sources":["../../src/utils/theme.ts"],"sourcesContent":["import chalk from \"chalk\";\
|
|
1
|
+
{"version":3,"file":"theme.mjs","names":[],"sources":["../../src/utils/theme.ts"],"sourcesContent":["import chalk from \"chalk\";\n\nconst hex =\n (code: string) =>\n (text: string): string =>\n chalk.hex(code)(text);\n\nconst truecolorRamp =\n (from: string, to: string) =>\n (text: string): string => {\n const rgb = (code: string) => [1, 3, 5].map((i) => parseInt(code.slice(i, i + 2), 16));\n const [r1, g1, b1] = rgb(from);\n const [r2, g2, b2] = rgb(to);\n const chars = Array.from(text);\n const total = chars.filter((ch) => ch !== \"\\n\").length;\n let seen = 0;\n return chars\n .map((ch) => {\n if (ch === \"\\n\") return ch;\n const t = total > 1 ? seen / (total - 1) : 0;\n seen += 1;\n return chalk.rgb(\n Math.round(r1 + (r2 - r1) * t),\n Math.round(g1 + (g2 - g1) * t),\n Math.round(b1 + (b2 - b1) * t),\n )(ch);\n })\n .join(\"\");\n };\n\nexport const gradients: Record<string, (text: string) => string> = {\n cyber: truecolorRamp(\"#00ffff\", \"#ff00ff\"),\n};\n\nexport const colors = {\n cyan: hex(\"#00ffff\"),\n magenta: hex(\"#ff00ff\"),\n green: hex(\"#00ff41\"),\n blue: hex(\"#0080ff\"),\n yellow: hex(\"#ffcc00\"),\n orange: hex(\"#ffaa00\"),\n white: hex(\"#f0f0f0\"),\n gray: hex(\"#555555\"),\n dim: chalk.dim,\n error: hex(\"#ff3366\"),\n};\n\nexport const icons = {\n scan: \"○\",\n run: \"▶\",\n ok: \"✓\",\n err: \"✗\",\n pending: \"○\",\n arrow: \"→\",\n dot: \"·\",\n app: \"◉\",\n config: \"⚙\",\n};\n\nexport const frames = {\n top: (width: number) => `┌${\"─\".repeat(width - 2)}┐`,\n bottom: (width: number) => `└${\"─\".repeat(width - 2)}┘`,\n};\n\nexport function divider(width = 48): string {\n return chalk.dim(\"─\".repeat(width));\n}\n"],"mappings":";;;AAEA,MAAM,OACH,UACA,SACC,MAAM,IAAI,IAAI,CAAC,CAAC,IAAI;AAExB,MAAM,iBACH,MAAc,QACd,SAAyB;CACxB,MAAM,OAAO,SAAiB;EAAC;EAAG;EAAG;CAAC,CAAC,CAAC,KAAK,MAAM,SAAS,KAAK,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;CACrF,MAAM,CAAC,IAAI,IAAI,MAAM,IAAI,IAAI;CAC7B,MAAM,CAAC,IAAI,IAAI,MAAM,IAAI,EAAE;CAC3B,MAAM,QAAQ,MAAM,KAAK,IAAI;CAC7B,MAAM,QAAQ,MAAM,QAAQ,OAAO,OAAO,IAAI,CAAC,CAAC;CAChD,IAAI,OAAO;CACX,OAAO,MACJ,KAAK,OAAO;EACX,IAAI,OAAO,MAAM,OAAO;EACxB,MAAM,IAAI,QAAQ,IAAI,QAAQ,QAAQ,KAAK;EAC3C,QAAQ;EACR,OAAO,MAAM,IACX,KAAK,MAAM,MAAM,KAAK,MAAM,CAAC,GAC7B,KAAK,MAAM,MAAM,KAAK,MAAM,CAAC,GAC7B,KAAK,MAAM,MAAM,KAAK,MAAM,CAAC,CAC/B,CAAC,CAAC,EAAE;CACN,CAAC,CAAC,CACD,KAAK,EAAE;AACZ;AAEF,MAAa,YAAsD,EACjE,OAAO,cAAc,WAAW,SAAS,EAC3C;AAEA,MAAa,SAAS;CACpB,MAAM,IAAI,SAAS;CACnB,SAAS,IAAI,SAAS;CACtB,OAAO,IAAI,SAAS;CACpB,MAAM,IAAI,SAAS;CACnB,QAAQ,IAAI,SAAS;CACrB,QAAQ,IAAI,SAAS;CACrB,OAAO,IAAI,SAAS;CACpB,MAAM,IAAI,SAAS;CACnB,KAAK,MAAM;CACX,OAAO,IAAI,SAAS;AACtB;AAEA,MAAa,QAAQ;CACnB,MAAM;CACN,KAAK;CACL,IAAI;CACJ,KAAK;CACL,SAAS;CACT,OAAO;CACP,KAAK;CACL,KAAK;CACL,QAAQ;AACV;AAEA,MAAa,SAAS;CACpB,MAAM,UAAkB,IAAI,IAAI,OAAO,QAAQ,CAAC,EAAE;CAClD,SAAS,UAAkB,IAAI,IAAI,OAAO,QAAQ,CAAC,EAAE;AACvD;AAEA,SAAgB,QAAQ,QAAQ,IAAY;CAC1C,OAAO,MAAM,IAAI,IAAI,OAAO,KAAK,CAAC;AACpC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
let node_fs = require("node:fs");
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
let every_plugin_version_manifest = require("every-plugin/version-manifest");
|
|
4
|
+
let every_plugin_build_artifact_names = require("every-plugin/build/artifact-names");
|
|
5
|
+
|
|
6
|
+
//#region src/version-manifest-deploy.ts
|
|
7
|
+
/** Read a workspace dist's build-report.json (ticket 01's entry-name report). */
|
|
8
|
+
function readBuildReport(distRoot) {
|
|
9
|
+
const reportPath = (0, node_path.join)(distRoot, "build-report.json");
|
|
10
|
+
if (!(0, node_fs.existsSync)(reportPath)) return null;
|
|
11
|
+
try {
|
|
12
|
+
return every_plugin_build_artifact_names.BuildEntryReportSchema.parse(JSON.parse((0, node_fs.readFileSync)(reportPath, "utf8")));
|
|
13
|
+
} catch {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Compose the workspace's version manifest from the dist build reports and
|
|
19
|
+
* the **server-computed** SRI map of the upload response (MAP decision 6 —
|
|
20
|
+
* SRI is authoritative from the storage boundary, never computed
|
|
21
|
+
* client-side). Returns null when the dist predates hashed entry names
|
|
22
|
+
* (no report, or the SRI map lacks the entry) — the deploy leg then aborts:
|
|
23
|
+
* uploaded workspaces must pin.
|
|
24
|
+
*/
|
|
25
|
+
function composeWorkspaceVersionManifest(input) {
|
|
26
|
+
const { report, ssrReport, integrityMap, files } = input;
|
|
27
|
+
const entryIntegrity = integrityMap[report.entry];
|
|
28
|
+
if (!entryIntegrity) return null;
|
|
29
|
+
const ssrEntry = ssrReport?.entry;
|
|
30
|
+
const ssrIntegrity = ssrEntry ? integrityMap[`ssr/${ssrEntry}`] : void 0;
|
|
31
|
+
return (0, every_plugin_version_manifest.composeVersionManifest)({
|
|
32
|
+
entry: report.entry,
|
|
33
|
+
entryIntegrity,
|
|
34
|
+
...ssrEntry && ssrIntegrity ? { ssr: {
|
|
35
|
+
entry: `ssr/${ssrEntry}`,
|
|
36
|
+
integrity: ssrIntegrity
|
|
37
|
+
} } : {},
|
|
38
|
+
...report.browserManifest && integrityMap[report.browserManifest] ? { browserManifest: {
|
|
39
|
+
file: report.browserManifest,
|
|
40
|
+
integrity: integrityMap[report.browserManifest]
|
|
41
|
+
} } : {},
|
|
42
|
+
...report.css && integrityMap[report.css] ? { assets: { css: integrityMap[report.css] } } : {},
|
|
43
|
+
...files ? { files } : {}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
exports.composeWorkspaceVersionManifest = composeWorkspaceVersionManifest;
|
|
49
|
+
exports.readBuildReport = readBuildReport;
|
|
50
|
+
//# sourceMappingURL=version-manifest-deploy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-manifest-deploy.cjs","names":["join","existsSync","BuildEntryReportSchema","readFileSync","composeVersionManifest"],"sources":["../src/version-manifest-deploy.ts"],"sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { type BuildEntryReport, BuildEntryReportSchema } from \"every-plugin/build/artifact-names\";\nimport {\n composeVersionManifest,\n type WorkspaceVersionManifest,\n} from \"every-plugin/version-manifest\";\n\n/** Read a workspace dist's build-report.json (ticket 01's entry-name report). */\nexport function readBuildReport(distRoot: string): BuildEntryReport | null {\n const reportPath = join(distRoot, \"build-report.json\");\n if (!existsSync(reportPath)) return null;\n try {\n return BuildEntryReportSchema.parse(JSON.parse(readFileSync(reportPath, \"utf8\")));\n } catch {\n return null;\n }\n}\n\n/**\n * Compose the workspace's version manifest from the dist build reports and\n * the **server-computed** SRI map of the upload response (MAP decision 6 —\n * SRI is authoritative from the storage boundary, never computed\n * client-side). Returns null when the dist predates hashed entry names\n * (no report, or the SRI map lacks the entry) — the deploy leg then aborts:\n * uploaded workspaces must pin.\n */\nexport function composeWorkspaceVersionManifest(input: {\n report: BuildEntryReport;\n ssrReport?: BuildEntryReport | null;\n integrityMap: Record<string, string>;\n /** full per-file SRI map of the dist — recorded for the next deploy's diff */\n files?: Record<string, string>;\n}): WorkspaceVersionManifest | null {\n const { report, ssrReport, integrityMap, files } = input;\n\n const entryIntegrity = integrityMap[report.entry];\n if (!entryIntegrity) return null;\n\n const ssrEntry = ssrReport?.entry;\n const ssrIntegrity = ssrEntry ? integrityMap[`ssr/${ssrEntry}`] : undefined;\n\n return composeVersionManifest({\n entry: report.entry,\n entryIntegrity,\n ...(ssrEntry && ssrIntegrity\n ? { ssr: { entry: `ssr/${ssrEntry}`, integrity: ssrIntegrity } }\n : {}),\n ...(report.browserManifest && integrityMap[report.browserManifest]\n ? {\n browserManifest: {\n file: report.browserManifest,\n integrity: integrityMap[report.browserManifest]!,\n },\n }\n : {}),\n ...(report.css && integrityMap[report.css]\n ? { assets: { css: integrityMap[report.css]! } }\n : {}),\n ...(files ? { files } : {}),\n });\n}\n"],"mappings":";;;;;;;AASA,SAAgB,gBAAgB,UAA2C;CACzE,MAAM,iBAAaA,gBAAK,UAAU,mBAAmB;CACrD,IAAI,KAACC,oBAAW,UAAU,GAAG,OAAO;CACpC,IAAI;EACF,OAAOC,yDAAuB,MAAM,KAAK,UAAMC,sBAAa,YAAY,MAAM,CAAC,CAAC;CAClF,QAAQ;EACN,OAAO;CACT;AACF;;;;;;;;;AAUA,SAAgB,gCAAgC,OAMZ;CAClC,MAAM,EAAE,QAAQ,WAAW,cAAc,UAAU;CAEnD,MAAM,iBAAiB,aAAa,OAAO;CAC3C,IAAI,CAAC,gBAAgB,OAAO;CAE5B,MAAM,WAAW,WAAW;CAC5B,MAAM,eAAe,WAAW,aAAa,OAAO,cAAc;CAElE,WAAOC,sDAAuB;EAC5B,OAAO,OAAO;EACd;EACA,GAAI,YAAY,eACZ,EAAE,KAAK;GAAE,OAAO,OAAO;GAAY,WAAW;EAAa,EAAE,IAC7D,CAAC;EACL,GAAI,OAAO,mBAAmB,aAAa,OAAO,mBAC9C,EACE,iBAAiB;GACf,MAAM,OAAO;GACb,WAAW,aAAa,OAAO;EACjC,EACF,IACA,CAAC;EACL,GAAI,OAAO,OAAO,aAAa,OAAO,OAClC,EAAE,QAAQ,EAAE,KAAK,aAAa,OAAO,KAAM,EAAE,IAC7C,CAAC;EACL,GAAI,QAAQ,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AACH"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { composeVersionManifest } from "every-plugin/version-manifest";
|
|
4
|
+
import { BuildEntryReportSchema } from "every-plugin/build/artifact-names";
|
|
5
|
+
|
|
6
|
+
//#region src/version-manifest-deploy.ts
|
|
7
|
+
/** Read a workspace dist's build-report.json (ticket 01's entry-name report). */
|
|
8
|
+
function readBuildReport(distRoot) {
|
|
9
|
+
const reportPath = join(distRoot, "build-report.json");
|
|
10
|
+
if (!existsSync(reportPath)) return null;
|
|
11
|
+
try {
|
|
12
|
+
return BuildEntryReportSchema.parse(JSON.parse(readFileSync(reportPath, "utf8")));
|
|
13
|
+
} catch {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Compose the workspace's version manifest from the dist build reports and
|
|
19
|
+
* the **server-computed** SRI map of the upload response (MAP decision 6 —
|
|
20
|
+
* SRI is authoritative from the storage boundary, never computed
|
|
21
|
+
* client-side). Returns null when the dist predates hashed entry names
|
|
22
|
+
* (no report, or the SRI map lacks the entry) — the deploy leg then aborts:
|
|
23
|
+
* uploaded workspaces must pin.
|
|
24
|
+
*/
|
|
25
|
+
function composeWorkspaceVersionManifest(input) {
|
|
26
|
+
const { report, ssrReport, integrityMap, files } = input;
|
|
27
|
+
const entryIntegrity = integrityMap[report.entry];
|
|
28
|
+
if (!entryIntegrity) return null;
|
|
29
|
+
const ssrEntry = ssrReport?.entry;
|
|
30
|
+
const ssrIntegrity = ssrEntry ? integrityMap[`ssr/${ssrEntry}`] : void 0;
|
|
31
|
+
return composeVersionManifest({
|
|
32
|
+
entry: report.entry,
|
|
33
|
+
entryIntegrity,
|
|
34
|
+
...ssrEntry && ssrIntegrity ? { ssr: {
|
|
35
|
+
entry: `ssr/${ssrEntry}`,
|
|
36
|
+
integrity: ssrIntegrity
|
|
37
|
+
} } : {},
|
|
38
|
+
...report.browserManifest && integrityMap[report.browserManifest] ? { browserManifest: {
|
|
39
|
+
file: report.browserManifest,
|
|
40
|
+
integrity: integrityMap[report.browserManifest]
|
|
41
|
+
} } : {},
|
|
42
|
+
...report.css && integrityMap[report.css] ? { assets: { css: integrityMap[report.css] } } : {},
|
|
43
|
+
...files ? { files } : {}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { composeWorkspaceVersionManifest, readBuildReport };
|
|
49
|
+
//# sourceMappingURL=version-manifest-deploy.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-manifest-deploy.mjs","names":[],"sources":["../src/version-manifest-deploy.ts"],"sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { type BuildEntryReport, BuildEntryReportSchema } from \"every-plugin/build/artifact-names\";\nimport {\n composeVersionManifest,\n type WorkspaceVersionManifest,\n} from \"every-plugin/version-manifest\";\n\n/** Read a workspace dist's build-report.json (ticket 01's entry-name report). */\nexport function readBuildReport(distRoot: string): BuildEntryReport | null {\n const reportPath = join(distRoot, \"build-report.json\");\n if (!existsSync(reportPath)) return null;\n try {\n return BuildEntryReportSchema.parse(JSON.parse(readFileSync(reportPath, \"utf8\")));\n } catch {\n return null;\n }\n}\n\n/**\n * Compose the workspace's version manifest from the dist build reports and\n * the **server-computed** SRI map of the upload response (MAP decision 6 —\n * SRI is authoritative from the storage boundary, never computed\n * client-side). Returns null when the dist predates hashed entry names\n * (no report, or the SRI map lacks the entry) — the deploy leg then aborts:\n * uploaded workspaces must pin.\n */\nexport function composeWorkspaceVersionManifest(input: {\n report: BuildEntryReport;\n ssrReport?: BuildEntryReport | null;\n integrityMap: Record<string, string>;\n /** full per-file SRI map of the dist — recorded for the next deploy's diff */\n files?: Record<string, string>;\n}): WorkspaceVersionManifest | null {\n const { report, ssrReport, integrityMap, files } = input;\n\n const entryIntegrity = integrityMap[report.entry];\n if (!entryIntegrity) return null;\n\n const ssrEntry = ssrReport?.entry;\n const ssrIntegrity = ssrEntry ? integrityMap[`ssr/${ssrEntry}`] : undefined;\n\n return composeVersionManifest({\n entry: report.entry,\n entryIntegrity,\n ...(ssrEntry && ssrIntegrity\n ? { ssr: { entry: `ssr/${ssrEntry}`, integrity: ssrIntegrity } }\n : {}),\n ...(report.browserManifest && integrityMap[report.browserManifest]\n ? {\n browserManifest: {\n file: report.browserManifest,\n integrity: integrityMap[report.browserManifest]!,\n },\n }\n : {}),\n ...(report.css && integrityMap[report.css]\n ? { assets: { css: integrityMap[report.css]! } }\n : {}),\n ...(files ? { files } : {}),\n });\n}\n"],"mappings":";;;;;;;AASA,SAAgB,gBAAgB,UAA2C;CACzE,MAAM,aAAa,KAAK,UAAU,mBAAmB;CACrD,IAAI,CAAC,WAAW,UAAU,GAAG,OAAO;CACpC,IAAI;EACF,OAAO,uBAAuB,MAAM,KAAK,MAAM,aAAa,YAAY,MAAM,CAAC,CAAC;CAClF,QAAQ;EACN,OAAO;CACT;AACF;;;;;;;;;AAUA,SAAgB,gCAAgC,OAMZ;CAClC,MAAM,EAAE,QAAQ,WAAW,cAAc,UAAU;CAEnD,MAAM,iBAAiB,aAAa,OAAO;CAC3C,IAAI,CAAC,gBAAgB,OAAO;CAE5B,MAAM,WAAW,WAAW;CAC5B,MAAM,eAAe,WAAW,aAAa,OAAO,cAAc;CAElE,OAAO,uBAAuB;EAC5B,OAAO,OAAO;EACd;EACA,GAAI,YAAY,eACZ,EAAE,KAAK;GAAE,OAAO,OAAO;GAAY,WAAW;EAAa,EAAE,IAC7D,CAAC;EACL,GAAI,OAAO,mBAAmB,aAAa,OAAO,mBAC9C,EACE,iBAAiB;GACf,MAAM,OAAO;GACb,WAAW,aAAa,OAAO;EACjC,EACF,IACA,CAAC;EACL,GAAI,OAAO,OAAO,aAAa,OAAO,OAClC,EAAE,QAAQ,EAAE,KAAK,aAAa,OAAO,KAAM,EAAE,IAC7C,CAAC;EACL,GAAI,QAAQ,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AACH"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
let node_crypto = require("node:crypto");
|
|
3
|
+
let every_plugin_version_manifest = require("every-plugin/version-manifest");
|
|
4
|
+
|
|
5
|
+
//#region src/version-manifest-resolve.ts
|
|
6
|
+
const cache = /* @__PURE__ */ new Map();
|
|
7
|
+
function clearSlotVersionCache() {
|
|
8
|
+
cache.clear();
|
|
9
|
+
}
|
|
10
|
+
function fetchText(url, fetchImpl) {
|
|
11
|
+
return fetchImpl(url).then((response) => {
|
|
12
|
+
if (!response.ok) throw new Error(`version manifest fetch failed: ${response.status}`);
|
|
13
|
+
return response.text();
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
async function resolveSlotVersion(input) {
|
|
17
|
+
const key = `${input.base}::${input.pin.manifest}::${input.pin.integrity}`;
|
|
18
|
+
const cached = cache.get(key);
|
|
19
|
+
if (cached) return cached;
|
|
20
|
+
const manifestUrl = `${input.base.replace(/\/$/, "")}/${input.pin.manifest.replace(/^\//, "")}`;
|
|
21
|
+
const body = await fetchText(manifestUrl, input.fetchImpl ?? fetch);
|
|
22
|
+
const computed = `sha384-${(0, node_crypto.createHash)("sha384").update(body).digest("base64")}`;
|
|
23
|
+
if (computed !== input.pin.integrity) throw new Error(`[SRI] version manifest integrity mismatch for ${manifestUrl}\n Expected: ${input.pin.integrity}\n Computed: ${computed}`);
|
|
24
|
+
const manifest = every_plugin_version_manifest.WorkspaceVersionManifestSchema.parse(JSON.parse(body));
|
|
25
|
+
const resolved = {
|
|
26
|
+
entryUrl: `${input.base.replace(/\/$/, "")}/${manifest.entry}`,
|
|
27
|
+
entryIntegrity: manifest.entryIntegrity,
|
|
28
|
+
...manifest.browserManifest ? { browserManifestUrl: `${input.base.replace(/\/$/, "")}/${manifest.browserManifest.file}` } : {},
|
|
29
|
+
...manifest.ssr ? {
|
|
30
|
+
ssrEntryUrl: `${input.base.replace(/\/$/, "")}/${manifest.ssr.entry}`,
|
|
31
|
+
ssrIntegrity: manifest.ssr.integrity
|
|
32
|
+
} : {},
|
|
33
|
+
...manifest.files ? { files: manifest.files } : {}
|
|
34
|
+
};
|
|
35
|
+
cache.set(key, resolved);
|
|
36
|
+
return resolved;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
exports.clearSlotVersionCache = clearSlotVersionCache;
|
|
41
|
+
exports.resolveSlotVersion = resolveSlotVersion;
|
|
42
|
+
//# sourceMappingURL=version-manifest-resolve.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-manifest-resolve.cjs","names":["createHash","WorkspaceVersionManifestSchema"],"sources":["../src/version-manifest-resolve.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport {\n type WorkspaceVersionManifest,\n WorkspaceVersionManifestSchema,\n} from \"every-plugin/version-manifest\";\n\n/**\n * Version-manifest slot resolution (atomic-deploys 04): a config slot's\n * `pin` ({ manifest, integrity }) resolves to the derived entry-level fields\n * every consumer needs. The cache is keyed by the full pin — the pinned\n * bytes are immutable, so a verified entry is cached for the process\n * lifetime and serves as last-known-good if the origin later fails; a fetch\n * or SRI failure with nothing cached propagates (a boot-time resolution\n * failure fails the deploy, which is the platform's rollback).\n */\n\nexport interface ResolvedSlotVersion {\n /** Absolute URL of the content-hashed container entry. */\n entryUrl: string;\n entryIntegrity: string;\n /** Absolute URL of the hashed browser manifest (mf-manifest), when present. */\n browserManifestUrl?: string;\n /** Absolute URL of the content-hashed SSR entry, when present. */\n ssrEntryUrl?: string;\n ssrIntegrity?: string;\n /** Full per-file digest map of the dist (object path → SRI), when the\n * pinned manifest carries one — the diff base for skip-unchanged uploads. */\n files?: Record<string, string>;\n}\n\nexport interface SlotPin {\n /** versioned manifest filename, relative to the slot's production base */\n manifest: string;\n /** the manifest document's own SRI */\n integrity: string;\n}\n\nconst cache = new Map<string, ResolvedSlotVersion>();\n\nexport function clearSlotVersionCache(): void {\n cache.clear();\n}\n\nfunction fetchText(url: string, fetchImpl: typeof fetch): Promise<string> {\n return fetchImpl(url).then((response) => {\n if (!response.ok) throw new Error(`version manifest fetch failed: ${response.status}`);\n return response.text();\n });\n}\n\nexport async function resolveSlotVersion(input: {\n base: string;\n pin: SlotPin;\n fetchImpl?: typeof fetch;\n}): Promise<ResolvedSlotVersion> {\n const key = `${input.base}::${input.pin.manifest}::${input.pin.integrity}`;\n // content-addressed: a verified pin is cached for the process lifetime and\n // never refetched — the cache IS the last-known-good\n const cached = cache.get(key);\n if (cached) return cached;\n\n const manifestUrl = `${input.base.replace(/\\/$/, \"\")}/${input.pin.manifest.replace(/^\\//, \"\")}`;\n const body = await fetchText(manifestUrl, input.fetchImpl ?? fetch);\n const computed = `sha384-${createHash(\"sha384\").update(body).digest(\"base64\")}`;\n if (computed !== input.pin.integrity) {\n throw new Error(\n `[SRI] version manifest integrity mismatch for ${manifestUrl}\\n Expected: ${input.pin.integrity}\\n Computed: ${computed}`,\n );\n }\n const manifest: WorkspaceVersionManifest = WorkspaceVersionManifestSchema.parse(JSON.parse(body));\n\n const resolved: ResolvedSlotVersion = {\n entryUrl: `${input.base.replace(/\\/$/, \"\")}/${manifest.entry}`,\n entryIntegrity: manifest.entryIntegrity,\n ...(manifest.browserManifest\n ? {\n browserManifestUrl: `${input.base.replace(/\\/$/, \"\")}/${manifest.browserManifest.file}`,\n }\n : {}),\n ...(manifest.ssr\n ? {\n ssrEntryUrl: `${input.base.replace(/\\/$/, \"\")}/${manifest.ssr.entry}`,\n ssrIntegrity: manifest.ssr.integrity,\n }\n : {}),\n ...(manifest.files ? { files: manifest.files } : {}),\n };\n cache.set(key, resolved);\n return resolved;\n}\n"],"mappings":";;;;;AAqCA,MAAM,wBAAQ,IAAI,IAAiC;AAEnD,SAAgB,wBAA8B;CAC5C,MAAM,MAAM;AACd;AAEA,SAAS,UAAU,KAAa,WAA0C;CACxE,OAAO,UAAU,GAAG,CAAC,CAAC,MAAM,aAAa;EACvC,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,kCAAkC,SAAS,QAAQ;EACrF,OAAO,SAAS,KAAK;CACvB,CAAC;AACH;AAEA,eAAsB,mBAAmB,OAIR;CAC/B,MAAM,MAAM,GAAG,MAAM,KAAK,IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,IAAI;CAG/D,MAAM,SAAS,MAAM,IAAI,GAAG;CAC5B,IAAI,QAAQ,OAAO;CAEnB,MAAM,cAAc,GAAG,MAAM,KAAK,QAAQ,OAAO,EAAE,EAAE,GAAG,MAAM,IAAI,SAAS,QAAQ,OAAO,EAAE;CAC5F,MAAM,OAAO,MAAM,UAAU,aAAa,MAAM,aAAa,KAAK;CAClE,MAAM,WAAW,cAAUA,wBAAW,QAAQ,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,QAAQ;CAC5E,IAAI,aAAa,MAAM,IAAI,WACzB,MAAM,IAAI,MACR,iDAAiD,YAAY,gBAAgB,MAAM,IAAI,UAAU,gBAAgB,UACnH;CAEF,MAAM,WAAqCC,6DAA+B,MAAM,KAAK,MAAM,IAAI,CAAC;CAEhG,MAAM,WAAgC;EACpC,UAAU,GAAG,MAAM,KAAK,QAAQ,OAAO,EAAE,EAAE,GAAG,SAAS;EACvD,gBAAgB,SAAS;EACzB,GAAI,SAAS,kBACT,EACE,oBAAoB,GAAG,MAAM,KAAK,QAAQ,OAAO,EAAE,EAAE,GAAG,SAAS,gBAAgB,OACnF,IACA,CAAC;EACL,GAAI,SAAS,MACT;GACE,aAAa,GAAG,MAAM,KAAK,QAAQ,OAAO,EAAE,EAAE,GAAG,SAAS,IAAI;GAC9D,cAAc,SAAS,IAAI;EAC7B,IACA,CAAC;EACL,GAAI,SAAS,QAAQ,EAAE,OAAO,SAAS,MAAM,IAAI,CAAC;CACpD;CACA,MAAM,IAAI,KAAK,QAAQ;CACvB,OAAO;AACT"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region src/version-manifest-resolve.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Version-manifest slot resolution (atomic-deploys 04): a config slot's
|
|
4
|
+
* `pin` ({ manifest, integrity }) resolves to the derived entry-level fields
|
|
5
|
+
* every consumer needs. The cache is keyed by the full pin — the pinned
|
|
6
|
+
* bytes are immutable, so a verified entry is cached for the process
|
|
7
|
+
* lifetime and serves as last-known-good if the origin later fails; a fetch
|
|
8
|
+
* or SRI failure with nothing cached propagates (a boot-time resolution
|
|
9
|
+
* failure fails the deploy, which is the platform's rollback).
|
|
10
|
+
*/
|
|
11
|
+
interface ResolvedSlotVersion {
|
|
12
|
+
/** Absolute URL of the content-hashed container entry. */
|
|
13
|
+
entryUrl: string;
|
|
14
|
+
entryIntegrity: string;
|
|
15
|
+
/** Absolute URL of the hashed browser manifest (mf-manifest), when present. */
|
|
16
|
+
browserManifestUrl?: string;
|
|
17
|
+
/** Absolute URL of the content-hashed SSR entry, when present. */
|
|
18
|
+
ssrEntryUrl?: string;
|
|
19
|
+
ssrIntegrity?: string;
|
|
20
|
+
/** Full per-file digest map of the dist (object path → SRI), when the
|
|
21
|
+
* pinned manifest carries one — the diff base for skip-unchanged uploads. */
|
|
22
|
+
files?: Record<string, string>;
|
|
23
|
+
}
|
|
24
|
+
interface SlotPin {
|
|
25
|
+
/** versioned manifest filename, relative to the slot's production base */
|
|
26
|
+
manifest: string;
|
|
27
|
+
/** the manifest document's own SRI */
|
|
28
|
+
integrity: string;
|
|
29
|
+
}
|
|
30
|
+
declare function clearSlotVersionCache(): void;
|
|
31
|
+
declare function resolveSlotVersion(input: {
|
|
32
|
+
base: string;
|
|
33
|
+
pin: SlotPin;
|
|
34
|
+
fetchImpl?: typeof fetch;
|
|
35
|
+
}): Promise<ResolvedSlotVersion>;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { ResolvedSlotVersion, SlotPin, clearSlotVersionCache, resolveSlotVersion };
|
|
38
|
+
//# sourceMappingURL=version-manifest-resolve.d.cts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region src/version-manifest-resolve.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Version-manifest slot resolution (atomic-deploys 04): a config slot's
|
|
4
|
+
* `pin` ({ manifest, integrity }) resolves to the derived entry-level fields
|
|
5
|
+
* every consumer needs. The cache is keyed by the full pin — the pinned
|
|
6
|
+
* bytes are immutable, so a verified entry is cached for the process
|
|
7
|
+
* lifetime and serves as last-known-good if the origin later fails; a fetch
|
|
8
|
+
* or SRI failure with nothing cached propagates (a boot-time resolution
|
|
9
|
+
* failure fails the deploy, which is the platform's rollback).
|
|
10
|
+
*/
|
|
11
|
+
interface ResolvedSlotVersion {
|
|
12
|
+
/** Absolute URL of the content-hashed container entry. */
|
|
13
|
+
entryUrl: string;
|
|
14
|
+
entryIntegrity: string;
|
|
15
|
+
/** Absolute URL of the hashed browser manifest (mf-manifest), when present. */
|
|
16
|
+
browserManifestUrl?: string;
|
|
17
|
+
/** Absolute URL of the content-hashed SSR entry, when present. */
|
|
18
|
+
ssrEntryUrl?: string;
|
|
19
|
+
ssrIntegrity?: string;
|
|
20
|
+
/** Full per-file digest map of the dist (object path → SRI), when the
|
|
21
|
+
* pinned manifest carries one — the diff base for skip-unchanged uploads. */
|
|
22
|
+
files?: Record<string, string>;
|
|
23
|
+
}
|
|
24
|
+
interface SlotPin {
|
|
25
|
+
/** versioned manifest filename, relative to the slot's production base */
|
|
26
|
+
manifest: string;
|
|
27
|
+
/** the manifest document's own SRI */
|
|
28
|
+
integrity: string;
|
|
29
|
+
}
|
|
30
|
+
declare function clearSlotVersionCache(): void;
|
|
31
|
+
declare function resolveSlotVersion(input: {
|
|
32
|
+
base: string;
|
|
33
|
+
pin: SlotPin;
|
|
34
|
+
fetchImpl?: typeof fetch;
|
|
35
|
+
}): Promise<ResolvedSlotVersion>;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { ResolvedSlotVersion, SlotPin, clearSlotVersionCache, resolveSlotVersion };
|
|
38
|
+
//# sourceMappingURL=version-manifest-resolve.d.mts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { WorkspaceVersionManifestSchema } from "every-plugin/version-manifest";
|
|
3
|
+
|
|
4
|
+
//#region src/version-manifest-resolve.ts
|
|
5
|
+
const cache = /* @__PURE__ */ new Map();
|
|
6
|
+
function clearSlotVersionCache() {
|
|
7
|
+
cache.clear();
|
|
8
|
+
}
|
|
9
|
+
function fetchText(url, fetchImpl) {
|
|
10
|
+
return fetchImpl(url).then((response) => {
|
|
11
|
+
if (!response.ok) throw new Error(`version manifest fetch failed: ${response.status}`);
|
|
12
|
+
return response.text();
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
async function resolveSlotVersion(input) {
|
|
16
|
+
const key = `${input.base}::${input.pin.manifest}::${input.pin.integrity}`;
|
|
17
|
+
const cached = cache.get(key);
|
|
18
|
+
if (cached) return cached;
|
|
19
|
+
const manifestUrl = `${input.base.replace(/\/$/, "")}/${input.pin.manifest.replace(/^\//, "")}`;
|
|
20
|
+
const body = await fetchText(manifestUrl, input.fetchImpl ?? fetch);
|
|
21
|
+
const computed = `sha384-${createHash("sha384").update(body).digest("base64")}`;
|
|
22
|
+
if (computed !== input.pin.integrity) throw new Error(`[SRI] version manifest integrity mismatch for ${manifestUrl}\n Expected: ${input.pin.integrity}\n Computed: ${computed}`);
|
|
23
|
+
const manifest = WorkspaceVersionManifestSchema.parse(JSON.parse(body));
|
|
24
|
+
const resolved = {
|
|
25
|
+
entryUrl: `${input.base.replace(/\/$/, "")}/${manifest.entry}`,
|
|
26
|
+
entryIntegrity: manifest.entryIntegrity,
|
|
27
|
+
...manifest.browserManifest ? { browserManifestUrl: `${input.base.replace(/\/$/, "")}/${manifest.browserManifest.file}` } : {},
|
|
28
|
+
...manifest.ssr ? {
|
|
29
|
+
ssrEntryUrl: `${input.base.replace(/\/$/, "")}/${manifest.ssr.entry}`,
|
|
30
|
+
ssrIntegrity: manifest.ssr.integrity
|
|
31
|
+
} : {},
|
|
32
|
+
...manifest.files ? { files: manifest.files } : {}
|
|
33
|
+
};
|
|
34
|
+
cache.set(key, resolved);
|
|
35
|
+
return resolved;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { clearSlotVersionCache, resolveSlotVersion };
|
|
40
|
+
//# sourceMappingURL=version-manifest-resolve.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-manifest-resolve.mjs","names":[],"sources":["../src/version-manifest-resolve.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport {\n type WorkspaceVersionManifest,\n WorkspaceVersionManifestSchema,\n} from \"every-plugin/version-manifest\";\n\n/**\n * Version-manifest slot resolution (atomic-deploys 04): a config slot's\n * `pin` ({ manifest, integrity }) resolves to the derived entry-level fields\n * every consumer needs. The cache is keyed by the full pin — the pinned\n * bytes are immutable, so a verified entry is cached for the process\n * lifetime and serves as last-known-good if the origin later fails; a fetch\n * or SRI failure with nothing cached propagates (a boot-time resolution\n * failure fails the deploy, which is the platform's rollback).\n */\n\nexport interface ResolvedSlotVersion {\n /** Absolute URL of the content-hashed container entry. */\n entryUrl: string;\n entryIntegrity: string;\n /** Absolute URL of the hashed browser manifest (mf-manifest), when present. */\n browserManifestUrl?: string;\n /** Absolute URL of the content-hashed SSR entry, when present. */\n ssrEntryUrl?: string;\n ssrIntegrity?: string;\n /** Full per-file digest map of the dist (object path → SRI), when the\n * pinned manifest carries one — the diff base for skip-unchanged uploads. */\n files?: Record<string, string>;\n}\n\nexport interface SlotPin {\n /** versioned manifest filename, relative to the slot's production base */\n manifest: string;\n /** the manifest document's own SRI */\n integrity: string;\n}\n\nconst cache = new Map<string, ResolvedSlotVersion>();\n\nexport function clearSlotVersionCache(): void {\n cache.clear();\n}\n\nfunction fetchText(url: string, fetchImpl: typeof fetch): Promise<string> {\n return fetchImpl(url).then((response) => {\n if (!response.ok) throw new Error(`version manifest fetch failed: ${response.status}`);\n return response.text();\n });\n}\n\nexport async function resolveSlotVersion(input: {\n base: string;\n pin: SlotPin;\n fetchImpl?: typeof fetch;\n}): Promise<ResolvedSlotVersion> {\n const key = `${input.base}::${input.pin.manifest}::${input.pin.integrity}`;\n // content-addressed: a verified pin is cached for the process lifetime and\n // never refetched — the cache IS the last-known-good\n const cached = cache.get(key);\n if (cached) return cached;\n\n const manifestUrl = `${input.base.replace(/\\/$/, \"\")}/${input.pin.manifest.replace(/^\\//, \"\")}`;\n const body = await fetchText(manifestUrl, input.fetchImpl ?? fetch);\n const computed = `sha384-${createHash(\"sha384\").update(body).digest(\"base64\")}`;\n if (computed !== input.pin.integrity) {\n throw new Error(\n `[SRI] version manifest integrity mismatch for ${manifestUrl}\\n Expected: ${input.pin.integrity}\\n Computed: ${computed}`,\n );\n }\n const manifest: WorkspaceVersionManifest = WorkspaceVersionManifestSchema.parse(JSON.parse(body));\n\n const resolved: ResolvedSlotVersion = {\n entryUrl: `${input.base.replace(/\\/$/, \"\")}/${manifest.entry}`,\n entryIntegrity: manifest.entryIntegrity,\n ...(manifest.browserManifest\n ? {\n browserManifestUrl: `${input.base.replace(/\\/$/, \"\")}/${manifest.browserManifest.file}`,\n }\n : {}),\n ...(manifest.ssr\n ? {\n ssrEntryUrl: `${input.base.replace(/\\/$/, \"\")}/${manifest.ssr.entry}`,\n ssrIntegrity: manifest.ssr.integrity,\n }\n : {}),\n ...(manifest.files ? { files: manifest.files } : {}),\n };\n cache.set(key, resolved);\n return resolved;\n}\n"],"mappings":";;;;AAqCA,MAAM,wBAAQ,IAAI,IAAiC;AAEnD,SAAgB,wBAA8B;CAC5C,MAAM,MAAM;AACd;AAEA,SAAS,UAAU,KAAa,WAA0C;CACxE,OAAO,UAAU,GAAG,CAAC,CAAC,MAAM,aAAa;EACvC,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,kCAAkC,SAAS,QAAQ;EACrF,OAAO,SAAS,KAAK;CACvB,CAAC;AACH;AAEA,eAAsB,mBAAmB,OAIR;CAC/B,MAAM,MAAM,GAAG,MAAM,KAAK,IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,IAAI;CAG/D,MAAM,SAAS,MAAM,IAAI,GAAG;CAC5B,IAAI,QAAQ,OAAO;CAEnB,MAAM,cAAc,GAAG,MAAM,KAAK,QAAQ,OAAO,EAAE,EAAE,GAAG,MAAM,IAAI,SAAS,QAAQ,OAAO,EAAE;CAC5F,MAAM,OAAO,MAAM,UAAU,aAAa,MAAM,aAAa,KAAK;CAClE,MAAM,WAAW,UAAU,WAAW,QAAQ,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,QAAQ;CAC5E,IAAI,aAAa,MAAM,IAAI,WACzB,MAAM,IAAI,MACR,iDAAiD,YAAY,gBAAgB,MAAM,IAAI,UAAU,gBAAgB,UACnH;CAEF,MAAM,WAAqC,+BAA+B,MAAM,KAAK,MAAM,IAAI,CAAC;CAEhG,MAAM,WAAgC;EACpC,UAAU,GAAG,MAAM,KAAK,QAAQ,OAAO,EAAE,EAAE,GAAG,SAAS;EACvD,gBAAgB,SAAS;EACzB,GAAI,SAAS,kBACT,EACE,oBAAoB,GAAG,MAAM,KAAK,QAAQ,OAAO,EAAE,EAAE,GAAG,SAAS,gBAAgB,OACnF,IACA,CAAC;EACL,GAAI,SAAS,MACT;GACE,aAAa,GAAG,MAAM,KAAK,QAAQ,OAAO,EAAE,EAAE,GAAG,SAAS,IAAI;GAC9D,cAAc,SAAS,IAAI;EAC7B,IACA,CAAC;EACL,GAAI,SAAS,QAAQ,EAAE,OAAO,SAAS,MAAM,IAAI,CAAC;CACpD;CACA,MAAM,IAAI,KAAK,QAAQ;CACvB,OAAO;AACT"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
//#region src/version-status.ts
|
|
3
|
+
function computeDeployedVersionStatus(input) {
|
|
4
|
+
if (input.servedFingerprint === null || input.servedFingerprint === void 0) return {
|
|
5
|
+
publishedFingerprint: input.publishedFingerprint,
|
|
6
|
+
inSync: false,
|
|
7
|
+
...input.servedError ? { error: input.servedError } : {}
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
publishedFingerprint: input.publishedFingerprint,
|
|
11
|
+
servedFingerprint: input.servedFingerprint,
|
|
12
|
+
inSync: input.publishedFingerprint === input.servedFingerprint
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
exports.computeDeployedVersionStatus = computeDeployedVersionStatus;
|
|
18
|
+
//# sourceMappingURL=version-status.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-status.cjs","names":[],"sources":["../src/version-status.ts"],"sourcesContent":["/**\n * Deployed-vs-served version delta (atomic-deploys 12): the split-brain\n * detector — the published pointer's fingerprint vs the fingerprint the host\n * actually serves. A mismatch means the host has not adopted the latest\n * publish (or is pinned to stale bytes), which is exactly what the\n * 2026-09-30 incident looked like from the outside.\n */\n\nexport interface DeployedVersionStatus {\n publishedFingerprint: string;\n servedFingerprint?: string;\n inSync: boolean;\n error?: string;\n}\n\nexport function computeDeployedVersionStatus(input: {\n publishedFingerprint: string;\n servedFingerprint?: string | null;\n servedError?: string;\n}): DeployedVersionStatus {\n if (input.servedFingerprint === null || input.servedFingerprint === undefined) {\n return {\n publishedFingerprint: input.publishedFingerprint,\n inSync: false,\n ...(input.servedError ? { error: input.servedError } : {}),\n };\n }\n return {\n publishedFingerprint: input.publishedFingerprint,\n servedFingerprint: input.servedFingerprint,\n inSync: input.publishedFingerprint === input.servedFingerprint,\n };\n}\n"],"mappings":";;AAeA,SAAgB,6BAA6B,OAInB;CACxB,IAAI,MAAM,sBAAsB,QAAQ,MAAM,sBAAsB,QAClE,OAAO;EACL,sBAAsB,MAAM;EAC5B,QAAQ;EACR,GAAI,MAAM,cAAc,EAAE,OAAO,MAAM,YAAY,IAAI,CAAC;CAC1D;CAEF,OAAO;EACL,sBAAsB,MAAM;EAC5B,mBAAmB,MAAM;EACzB,QAAQ,MAAM,yBAAyB,MAAM;CAC/C;AACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/version-status.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Deployed-vs-served version delta (atomic-deploys 12): the split-brain
|
|
4
|
+
* detector — the published pointer's fingerprint vs the fingerprint the host
|
|
5
|
+
* actually serves. A mismatch means the host has not adopted the latest
|
|
6
|
+
* publish (or is pinned to stale bytes), which is exactly what the
|
|
7
|
+
* 2026-09-30 incident looked like from the outside.
|
|
8
|
+
*/
|
|
9
|
+
interface DeployedVersionStatus {
|
|
10
|
+
publishedFingerprint: string;
|
|
11
|
+
servedFingerprint?: string;
|
|
12
|
+
inSync: boolean;
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
declare function computeDeployedVersionStatus(input: {
|
|
16
|
+
publishedFingerprint: string;
|
|
17
|
+
servedFingerprint?: string | null;
|
|
18
|
+
servedError?: string;
|
|
19
|
+
}): DeployedVersionStatus;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { DeployedVersionStatus, computeDeployedVersionStatus };
|
|
22
|
+
//# sourceMappingURL=version-status.d.cts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/version-status.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Deployed-vs-served version delta (atomic-deploys 12): the split-brain
|
|
4
|
+
* detector — the published pointer's fingerprint vs the fingerprint the host
|
|
5
|
+
* actually serves. A mismatch means the host has not adopted the latest
|
|
6
|
+
* publish (or is pinned to stale bytes), which is exactly what the
|
|
7
|
+
* 2026-09-30 incident looked like from the outside.
|
|
8
|
+
*/
|
|
9
|
+
interface DeployedVersionStatus {
|
|
10
|
+
publishedFingerprint: string;
|
|
11
|
+
servedFingerprint?: string;
|
|
12
|
+
inSync: boolean;
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
declare function computeDeployedVersionStatus(input: {
|
|
16
|
+
publishedFingerprint: string;
|
|
17
|
+
servedFingerprint?: string | null;
|
|
18
|
+
servedError?: string;
|
|
19
|
+
}): DeployedVersionStatus;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { DeployedVersionStatus, computeDeployedVersionStatus };
|
|
22
|
+
//# sourceMappingURL=version-status.d.mts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/version-status.ts
|
|
2
|
+
function computeDeployedVersionStatus(input) {
|
|
3
|
+
if (input.servedFingerprint === null || input.servedFingerprint === void 0) return {
|
|
4
|
+
publishedFingerprint: input.publishedFingerprint,
|
|
5
|
+
inSync: false,
|
|
6
|
+
...input.servedError ? { error: input.servedError } : {}
|
|
7
|
+
};
|
|
8
|
+
return {
|
|
9
|
+
publishedFingerprint: input.publishedFingerprint,
|
|
10
|
+
servedFingerprint: input.servedFingerprint,
|
|
11
|
+
inSync: input.publishedFingerprint === input.servedFingerprint
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { computeDeployedVersionStatus };
|
|
17
|
+
//# sourceMappingURL=version-status.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-status.mjs","names":[],"sources":["../src/version-status.ts"],"sourcesContent":["/**\n * Deployed-vs-served version delta (atomic-deploys 12): the split-brain\n * detector — the published pointer's fingerprint vs the fingerprint the host\n * actually serves. A mismatch means the host has not adopted the latest\n * publish (or is pinned to stale bytes), which is exactly what the\n * 2026-09-30 incident looked like from the outside.\n */\n\nexport interface DeployedVersionStatus {\n publishedFingerprint: string;\n servedFingerprint?: string;\n inSync: boolean;\n error?: string;\n}\n\nexport function computeDeployedVersionStatus(input: {\n publishedFingerprint: string;\n servedFingerprint?: string | null;\n servedError?: string;\n}): DeployedVersionStatus {\n if (input.servedFingerprint === null || input.servedFingerprint === undefined) {\n return {\n publishedFingerprint: input.publishedFingerprint,\n inSync: false,\n ...(input.servedError ? { error: input.servedError } : {}),\n };\n }\n return {\n publishedFingerprint: input.publishedFingerprint,\n servedFingerprint: input.servedFingerprint,\n inSync: input.publishedFingerprint === input.servedFingerprint,\n };\n}\n"],"mappings":";AAeA,SAAgB,6BAA6B,OAInB;CACxB,IAAI,MAAM,sBAAsB,QAAQ,MAAM,sBAAsB,QAClE,OAAO;EACL,sBAAsB,MAAM;EAC5B,QAAQ;EACR,GAAI,MAAM,cAAc,EAAE,OAAO,MAAM,YAAY,IAAI,CAAC;CAC1D;CAEF,OAAO;EACL,sBAAsB,MAAM;EAC5B,mBAAmB,MAAM;EACzB,QAAQ,MAAM,yBAAyB,MAAM;CAC/C;AACF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
let node_fs = require("node:fs");
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
let yaml = require("yaml");
|
|
4
|
+
|
|
5
|
+
//#region src/workspace-catalog.ts
|
|
6
|
+
const WORKSPACE_YAML = "pnpm-workspace.yaml";
|
|
7
|
+
function catalogFromPackageJson(pkgJson) {
|
|
8
|
+
const catalog = pkgJson.workspaces?.catalog;
|
|
9
|
+
return catalog && typeof catalog === "object" ? { ...catalog } : {};
|
|
10
|
+
}
|
|
11
|
+
function readWorkspaceCatalog(root) {
|
|
12
|
+
const yamlPath = (0, node_path.join)(root, WORKSPACE_YAML);
|
|
13
|
+
if ((0, node_fs.existsSync)(yamlPath)) {
|
|
14
|
+
const catalog = (0, yaml.parse)((0, node_fs.readFileSync)(yamlPath, "utf8"))?.catalog;
|
|
15
|
+
return catalog && typeof catalog === "object" ? { ...catalog } : {};
|
|
16
|
+
}
|
|
17
|
+
const pkgPath = (0, node_path.join)(root, "package.json");
|
|
18
|
+
if ((0, node_fs.existsSync)(pkgPath)) try {
|
|
19
|
+
return catalogFromPackageJson(JSON.parse((0, node_fs.readFileSync)(pkgPath, "utf8")));
|
|
20
|
+
} catch {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
function writeWorkspaceCatalog(root, catalog) {
|
|
26
|
+
const yamlPath = (0, node_path.join)(root, WORKSPACE_YAML);
|
|
27
|
+
const pkgPath = (0, node_path.join)(root, "package.json");
|
|
28
|
+
const usesYaml = (0, node_fs.existsSync)(yamlPath);
|
|
29
|
+
const sorted = Object.fromEntries(Object.entries(catalog).sort(([a], [b]) => a.localeCompare(b)));
|
|
30
|
+
if (usesYaml) {
|
|
31
|
+
const parsed = (0, yaml.parse)((0, node_fs.readFileSync)(yamlPath, "utf8"));
|
|
32
|
+
const doc = parsed && typeof parsed === "object" ? parsed : {};
|
|
33
|
+
doc.catalog = sorted;
|
|
34
|
+
const body = (0, yaml.stringify)(doc, { lineWidth: 0 }).trimEnd();
|
|
35
|
+
(0, node_fs.writeFileSync)(yamlPath, `${body}\n`);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
let pkg = {};
|
|
39
|
+
if ((0, node_fs.existsSync)(pkgPath)) try {
|
|
40
|
+
pkg = JSON.parse((0, node_fs.readFileSync)(pkgPath, "utf8"));
|
|
41
|
+
} catch {
|
|
42
|
+
pkg = {};
|
|
43
|
+
}
|
|
44
|
+
if (!pkg.workspaces) pkg.workspaces = {};
|
|
45
|
+
pkg.workspaces.catalog = sorted;
|
|
46
|
+
(0, node_fs.writeFileSync)(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
exports.catalogFromPackageJson = catalogFromPackageJson;
|
|
51
|
+
exports.readWorkspaceCatalog = readWorkspaceCatalog;
|
|
52
|
+
exports.writeWorkspaceCatalog = writeWorkspaceCatalog;
|
|
53
|
+
//# sourceMappingURL=workspace-catalog.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-catalog.cjs","names":["join","existsSync","parse","readFileSync","stringify"],"sources":["../src/workspace-catalog.ts"],"sourcesContent":["import { existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { parse, stringify } from \"yaml\";\n\ninterface PkgJsonLike {\n workspaces?: { packages?: string[]; catalog?: Record<string, string> };\n}\n\ninterface WorkspaceYaml {\n packages?: string[];\n catalog?: Record<string, string>;\n [key: string]: unknown;\n}\n\nconst WORKSPACE_YAML = \"pnpm-workspace.yaml\";\n\nexport function catalogFromPackageJson(pkgJson: PkgJsonLike): Record<string, string> {\n const catalog = pkgJson.workspaces?.catalog;\n return catalog && typeof catalog === \"object\" ? { ...catalog } : {};\n}\n\nexport function readWorkspaceCatalog(root: string): Record<string, string> {\n const yamlPath = join(root, WORKSPACE_YAML);\n if (existsSync(yamlPath)) {\n const doc = parse(readFileSync(yamlPath, \"utf8\")) as WorkspaceYaml | null;\n const catalog = doc?.catalog;\n return catalog && typeof catalog === \"object\" ? { ...catalog } : {};\n }\n\n const pkgPath = join(root, \"package.json\");\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, \"utf8\")) as PkgJsonLike;\n return catalogFromPackageJson(pkg);\n } catch {\n return {};\n }\n }\n\n return {};\n}\n\nexport function writeWorkspaceCatalog(root: string, catalog: Record<string, string>): void {\n const yamlPath = join(root, WORKSPACE_YAML);\n const pkgPath = join(root, \"package.json\");\n const usesYaml = existsSync(yamlPath);\n const sorted = Object.fromEntries(Object.entries(catalog).sort(([a], [b]) => a.localeCompare(b)));\n\n if (usesYaml) {\n const parsed = parse(readFileSync(yamlPath, \"utf8\")) as WorkspaceYaml | null;\n const doc: WorkspaceYaml = parsed && typeof parsed === \"object\" ? parsed : {};\n doc.catalog = sorted;\n const body = stringify(doc, { lineWidth: 0 }).trimEnd();\n writeFileSync(yamlPath, `${body}\\n`);\n return;\n }\n\n let pkg: PkgJsonLike = {};\n if (existsSync(pkgPath)) {\n try {\n pkg = JSON.parse(readFileSync(pkgPath, \"utf8\")) as PkgJsonLike;\n } catch {\n pkg = {};\n }\n }\n if (!pkg.workspaces) {\n pkg.workspaces = {};\n }\n pkg.workspaces.catalog = sorted;\n writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\\n`);\n}\n"],"mappings":";;;;;AAcA,MAAM,iBAAiB;AAEvB,SAAgB,uBAAuB,SAA8C;CACnF,MAAM,UAAU,QAAQ,YAAY;CACpC,OAAO,WAAW,OAAO,YAAY,WAAW,EAAE,GAAG,QAAQ,IAAI,CAAC;AACpE;AAEA,SAAgB,qBAAqB,MAAsC;CACzE,MAAM,eAAWA,gBAAK,MAAM,cAAc;CAC1C,QAAIC,oBAAW,QAAQ,GAAG;EAExB,MAAM,cADMC,gBAAMC,sBAAa,UAAU,MAAM,CAC7B,CAAC,EAAE;EACrB,OAAO,WAAW,OAAO,YAAY,WAAW,EAAE,GAAG,QAAQ,IAAI,CAAC;CACpE;CAEA,MAAM,cAAUH,gBAAK,MAAM,cAAc;CACzC,QAAIC,oBAAW,OAAO,GACpB,IAAI;EAEF,OAAO,uBADK,KAAK,UAAME,sBAAa,SAAS,MAAM,CACnB,CAAC;CACnC,QAAQ;EACN,OAAO,CAAC;CACV;CAGF,OAAO,CAAC;AACV;AAEA,SAAgB,sBAAsB,MAAc,SAAuC;CACzF,MAAM,eAAWH,gBAAK,MAAM,cAAc;CAC1C,MAAM,cAAUA,gBAAK,MAAM,cAAc;CACzC,MAAM,eAAWC,oBAAW,QAAQ;CACpC,MAAM,SAAS,OAAO,YAAY,OAAO,QAAQ,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;CAEhG,IAAI,UAAU;EACZ,MAAM,aAASC,gBAAMC,sBAAa,UAAU,MAAM,CAAC;EACnD,MAAM,MAAqB,UAAU,OAAO,WAAW,WAAW,SAAS,CAAC;EAC5E,IAAI,UAAU;EACd,MAAM,WAAOC,gBAAU,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,QAAQ;EACtD,2BAAc,UAAU,GAAG,KAAK,GAAG;EACnC;CACF;CAEA,IAAI,MAAmB,CAAC;CACxB,QAAIH,oBAAW,OAAO,GACpB,IAAI;EACF,MAAM,KAAK,UAAME,sBAAa,SAAS,MAAM,CAAC;CAChD,QAAQ;EACN,MAAM,CAAC;CACT;CAEF,IAAI,CAAC,IAAI,YACP,IAAI,aAAa,CAAC;CAEpB,IAAI,WAAW,UAAU;CACzB,2BAAc,SAAS,GAAG,KAAK,UAAU,KAAK,MAAM,CAAC,EAAE,GAAG;AAC5D"}
|