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
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
const require_rollback = require('./rollback.cjs');
|
|
2
|
+
let node_fs = require("node:fs");
|
|
3
|
+
let node_path = require("node:path");
|
|
4
|
+
let node_crypto = require("node:crypto");
|
|
5
|
+
|
|
6
|
+
//#region src/deploy-diff.ts
|
|
7
|
+
const BUNDLE_BASE_PATTERN = /\/bundles\/([^/]+)\/([^/]+)\/([^/]+)\/$/;
|
|
8
|
+
function workspaceKeyOfBase(base) {
|
|
9
|
+
const match = BUNDLE_BASE_PATTERN.exec(`${base.replace(/\/$/, "")}/`);
|
|
10
|
+
return match ? match[3] : null;
|
|
11
|
+
}
|
|
12
|
+
/** The sha384 SRI the storage route would compute for these bytes. */
|
|
13
|
+
function localObjectIntegrity(bytes) {
|
|
14
|
+
return `sha384-${(0, node_crypto.createHash)("sha384").update(bytes).digest("base64")}`;
|
|
15
|
+
}
|
|
16
|
+
function localSriMap(files) {
|
|
17
|
+
return Object.fromEntries(files.map((file) => [file.path, localObjectIntegrity(file.bytes)]));
|
|
18
|
+
}
|
|
19
|
+
const deployStatePath = (configDir) => (0, node_path.join)(configDir, ".bos", "deploy-state.json");
|
|
20
|
+
function readDeployState(configDir) {
|
|
21
|
+
const path = deployStatePath(configDir);
|
|
22
|
+
if (!(0, node_fs.existsSync)(path)) return {
|
|
23
|
+
version: 1,
|
|
24
|
+
apps: {}
|
|
25
|
+
};
|
|
26
|
+
try {
|
|
27
|
+
const parsed = JSON.parse((0, node_fs.readFileSync)(path, "utf8"));
|
|
28
|
+
if (parsed.version !== 1 || typeof parsed.apps !== "object" || parsed.apps === null) return {
|
|
29
|
+
version: 1,
|
|
30
|
+
apps: {}
|
|
31
|
+
};
|
|
32
|
+
return {
|
|
33
|
+
version: 1,
|
|
34
|
+
apps: parsed.apps
|
|
35
|
+
};
|
|
36
|
+
} catch {
|
|
37
|
+
return {
|
|
38
|
+
version: 1,
|
|
39
|
+
apps: {}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function writeDeployState(configDir, state) {
|
|
44
|
+
const path = deployStatePath(configDir);
|
|
45
|
+
(0, node_fs.mkdirSync)((0, node_path.dirname)(path), { recursive: true });
|
|
46
|
+
(0, node_fs.writeFileSync)(path, `${JSON.stringify(state, null, 2)}\n`);
|
|
47
|
+
}
|
|
48
|
+
function upsertDeployStatePins(configDir, account, gateway, pins) {
|
|
49
|
+
const state = readDeployState(configDir);
|
|
50
|
+
const appKey = `${account}/${gateway}`;
|
|
51
|
+
state.apps[appKey] = {
|
|
52
|
+
...state.apps[appKey] ?? {},
|
|
53
|
+
...pins
|
|
54
|
+
};
|
|
55
|
+
writeDeployState(configDir, state);
|
|
56
|
+
}
|
|
57
|
+
/** Previous pins by workspace key, from the local deploy-state pointer. */
|
|
58
|
+
function pinsFromDeployState(configDir, account, gateway) {
|
|
59
|
+
return readDeployState(configDir).apps[`${account}/${gateway}`] ?? {};
|
|
60
|
+
}
|
|
61
|
+
/** Previous pins by workspace key, from the published config's slot pins. */
|
|
62
|
+
function pinsFromPublishedConfig(config, account, gateway) {
|
|
63
|
+
const pins = {};
|
|
64
|
+
for (const ref of require_rollback.collectSlotPinRefs(config)) {
|
|
65
|
+
const workspace = workspaceKeyOfBase(ref.base);
|
|
66
|
+
const nsMatch = BUNDLE_BASE_PATTERN.exec(`${ref.base.replace(/\/$/, "")}/`);
|
|
67
|
+
if (!workspace || !nsMatch || nsMatch[1] !== account || nsMatch[2] !== gateway) continue;
|
|
68
|
+
pins[workspace] = ref.pin;
|
|
69
|
+
}
|
|
70
|
+
return pins;
|
|
71
|
+
}
|
|
72
|
+
function diffWorkspaceFiles(files, localSri, prevFiles) {
|
|
73
|
+
const upload = [];
|
|
74
|
+
let skipped = 0;
|
|
75
|
+
for (const file of files) {
|
|
76
|
+
if (prevFiles[file.path] !== void 0 && prevFiles[file.path] === localSri[file.path]) {
|
|
77
|
+
skipped += 1;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
upload.push(file);
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
upload,
|
|
84
|
+
skipped
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The manifest's merged per-file map for this deploy: uploaded files carry the
|
|
89
|
+
* server-computed SRI from the upload response; skipped files carry the
|
|
90
|
+
* previous manifest's server-computed SRI (byte-identical to the local hash by
|
|
91
|
+
* the skip decision). Files that left the dist carry nothing.
|
|
92
|
+
*/
|
|
93
|
+
function mergedFileIntegrity(files, uploadedIntegrity, prevFiles) {
|
|
94
|
+
const merged = {};
|
|
95
|
+
for (const file of files) {
|
|
96
|
+
const uploaded = uploadedIntegrity[file.path];
|
|
97
|
+
if (uploaded) {
|
|
98
|
+
merged[file.path] = uploaded;
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
const carried = prevFiles?.[file.path];
|
|
102
|
+
if (carried) merged[file.path] = carried;
|
|
103
|
+
}
|
|
104
|
+
return merged;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
//#endregion
|
|
108
|
+
exports.BUNDLE_BASE_PATTERN = BUNDLE_BASE_PATTERN;
|
|
109
|
+
exports.diffWorkspaceFiles = diffWorkspaceFiles;
|
|
110
|
+
exports.localObjectIntegrity = localObjectIntegrity;
|
|
111
|
+
exports.localSriMap = localSriMap;
|
|
112
|
+
exports.mergedFileIntegrity = mergedFileIntegrity;
|
|
113
|
+
exports.pinsFromDeployState = pinsFromDeployState;
|
|
114
|
+
exports.pinsFromPublishedConfig = pinsFromPublishedConfig;
|
|
115
|
+
exports.readDeployState = readDeployState;
|
|
116
|
+
exports.upsertDeployStatePins = upsertDeployStatePins;
|
|
117
|
+
exports.workspaceKeyOfBase = workspaceKeyOfBase;
|
|
118
|
+
exports.writeDeployState = writeDeployState;
|
|
119
|
+
//# sourceMappingURL=deploy-diff.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-diff.cjs","names":["createHash","join","existsSync","readFileSync","dirname","collectSlotPinRefs"],"sources":["../src/deploy-diff.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { collectSlotPinRefs } from \"./rollback\";\nimport type { DistFile } from \"./storage-upload\";\nimport type { BosConfigInput } from \"./types\";\n\n/**\n * Differential bundle uploads (skip-unchanged): the previous deploy's version\n * manifest carries the dist's full per-file SRI map (`files`), so the next\n * deploy hashes its local dist, diffs against that map, and re-uploads only\n * new or changed files. Content-hashed dist filenames make an unchanged chunk\n * byte-identical, so a typical redeploy ships a handful of files instead of\n * the whole tree.\n *\n * Correctness: a skip requires (path, sha384) to match the previous\n * **server-computed** SRI map — client hashes decide only what to skip; the\n * published manifest keeps carrying the server-computed values. Any failure\n * to resolve the previous map (no pointer, fetch failed, SRI mismatch, manifest\n * predates `files`) degrades to a full upload.\n */\n\nexport interface PreviousPin {\n manifest: string;\n integrity: string;\n}\n\nexport interface DeployStateFile {\n version: 1;\n /** key: `<account>/<gateway>`, then workspace key → pin */\n apps: Record<string, Record<string, PreviousPin>>;\n}\n\nexport const BUNDLE_BASE_PATTERN = /\\/bundles\\/([^/]+)\\/([^/]+)\\/([^/]+)\\/$/;\n\nexport function workspaceKeyOfBase(base: string): string | null {\n const match = BUNDLE_BASE_PATTERN.exec(`${base.replace(/\\/$/, \"\")}/`);\n return match ? match[3]! : null;\n}\n\n/** The sha384 SRI the storage route would compute for these bytes. */\nexport function localObjectIntegrity(bytes: Uint8Array): string {\n return `sha384-${createHash(\"sha384\").update(bytes).digest(\"base64\")}`;\n}\n\nexport function localSriMap(files: DistFile[]): Record<string, string> {\n return Object.fromEntries(files.map((file) => [file.path, localObjectIntegrity(file.bytes)]));\n}\n\nconst deployStatePath = (configDir: string) => join(configDir, \".bos\", \"deploy-state.json\");\n\nexport function readDeployState(configDir: string): DeployStateFile {\n const path = deployStatePath(configDir);\n if (!existsSync(path)) return { version: 1, apps: {} };\n try {\n const parsed = JSON.parse(readFileSync(path, \"utf8\")) as Partial<DeployStateFile>;\n if (parsed.version !== 1 || typeof parsed.apps !== \"object\" || parsed.apps === null) {\n return { version: 1, apps: {} };\n }\n return { version: 1, apps: parsed.apps as DeployStateFile[\"apps\"] };\n } catch {\n return { version: 1, apps: {} };\n }\n}\n\nexport function writeDeployState(configDir: string, state: DeployStateFile): void {\n const path = deployStatePath(configDir);\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, `${JSON.stringify(state, null, 2)}\\n`);\n}\n\nexport function upsertDeployStatePins(\n configDir: string,\n account: string,\n gateway: string,\n pins: Record<string, PreviousPin>,\n): void {\n const state = readDeployState(configDir);\n const appKey = `${account}/${gateway}`;\n state.apps[appKey] = { ...(state.apps[appKey] ?? {}), ...pins };\n writeDeployState(configDir, state);\n}\n\n/** Previous pins by workspace key, from the local deploy-state pointer. */\nexport function pinsFromDeployState(\n configDir: string,\n account: string,\n gateway: string,\n): Record<string, PreviousPin> {\n return readDeployState(configDir).apps[`${account}/${gateway}`] ?? {};\n}\n\n/** Previous pins by workspace key, from the published config's slot pins. */\nexport function pinsFromPublishedConfig(\n config: BosConfigInput,\n account: string,\n gateway: string,\n): Record<string, PreviousPin> {\n const pins: Record<string, PreviousPin> = {};\n for (const ref of collectSlotPinRefs(config)) {\n const workspace = workspaceKeyOfBase(ref.base);\n const nsMatch = BUNDLE_BASE_PATTERN.exec(`${ref.base.replace(/\\/$/, \"\")}/`);\n if (!workspace || !nsMatch || nsMatch[1] !== account || nsMatch[2] !== gateway) continue;\n pins[workspace] = ref.pin;\n }\n return pins;\n}\n\nexport interface WorkspaceDiff {\n /** files that must be uploaded (new or changed) */\n upload: DistFile[];\n /** number of files skipped because the previous manifest holds identical bytes */\n skipped: number;\n}\n\nexport function diffWorkspaceFiles(\n files: DistFile[],\n localSri: Record<string, string>,\n prevFiles: Record<string, string>,\n): WorkspaceDiff {\n const upload: DistFile[] = [];\n let skipped = 0;\n for (const file of files) {\n if (prevFiles[file.path] !== undefined && prevFiles[file.path] === localSri[file.path]) {\n skipped += 1;\n continue;\n }\n upload.push(file);\n }\n return { upload, skipped };\n}\n\n/**\n * The manifest's merged per-file map for this deploy: uploaded files carry the\n * server-computed SRI from the upload response; skipped files carry the\n * previous manifest's server-computed SRI (byte-identical to the local hash by\n * the skip decision). Files that left the dist carry nothing.\n */\nexport function mergedFileIntegrity(\n files: DistFile[],\n uploadedIntegrity: Record<string, string>,\n prevFiles: Record<string, string> | undefined,\n): Record<string, string> {\n const merged: Record<string, string> = {};\n for (const file of files) {\n const uploaded = uploadedIntegrity[file.path];\n if (uploaded) {\n merged[file.path] = uploaded;\n continue;\n }\n const carried = prevFiles?.[file.path];\n if (carried) merged[file.path] = carried;\n }\n return merged;\n}\n"],"mappings":";;;;;;AAiCA,MAAa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eFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
5
|
+
|
|
6
|
+
//#region src/deploy-diff.ts
|
|
7
|
+
const BUNDLE_BASE_PATTERN = /\/bundles\/([^/]+)\/([^/]+)\/([^/]+)\/$/;
|
|
8
|
+
function workspaceKeyOfBase(base) {
|
|
9
|
+
const match = BUNDLE_BASE_PATTERN.exec(`${base.replace(/\/$/, "")}/`);
|
|
10
|
+
return match ? match[3] : null;
|
|
11
|
+
}
|
|
12
|
+
/** The sha384 SRI the storage route would compute for these bytes. */
|
|
13
|
+
function localObjectIntegrity(bytes) {
|
|
14
|
+
return `sha384-${createHash("sha384").update(bytes).digest("base64")}`;
|
|
15
|
+
}
|
|
16
|
+
function localSriMap(files) {
|
|
17
|
+
return Object.fromEntries(files.map((file) => [file.path, localObjectIntegrity(file.bytes)]));
|
|
18
|
+
}
|
|
19
|
+
const deployStatePath = (configDir) => join(configDir, ".bos", "deploy-state.json");
|
|
20
|
+
function readDeployState(configDir) {
|
|
21
|
+
const path = deployStatePath(configDir);
|
|
22
|
+
if (!existsSync(path)) return {
|
|
23
|
+
version: 1,
|
|
24
|
+
apps: {}
|
|
25
|
+
};
|
|
26
|
+
try {
|
|
27
|
+
const parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
28
|
+
if (parsed.version !== 1 || typeof parsed.apps !== "object" || parsed.apps === null) return {
|
|
29
|
+
version: 1,
|
|
30
|
+
apps: {}
|
|
31
|
+
};
|
|
32
|
+
return {
|
|
33
|
+
version: 1,
|
|
34
|
+
apps: parsed.apps
|
|
35
|
+
};
|
|
36
|
+
} catch {
|
|
37
|
+
return {
|
|
38
|
+
version: 1,
|
|
39
|
+
apps: {}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function writeDeployState(configDir, state) {
|
|
44
|
+
const path = deployStatePath(configDir);
|
|
45
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
46
|
+
writeFileSync(path, `${JSON.stringify(state, null, 2)}\n`);
|
|
47
|
+
}
|
|
48
|
+
function upsertDeployStatePins(configDir, account, gateway, pins) {
|
|
49
|
+
const state = readDeployState(configDir);
|
|
50
|
+
const appKey = `${account}/${gateway}`;
|
|
51
|
+
state.apps[appKey] = {
|
|
52
|
+
...state.apps[appKey] ?? {},
|
|
53
|
+
...pins
|
|
54
|
+
};
|
|
55
|
+
writeDeployState(configDir, state);
|
|
56
|
+
}
|
|
57
|
+
/** Previous pins by workspace key, from the local deploy-state pointer. */
|
|
58
|
+
function pinsFromDeployState(configDir, account, gateway) {
|
|
59
|
+
return readDeployState(configDir).apps[`${account}/${gateway}`] ?? {};
|
|
60
|
+
}
|
|
61
|
+
/** Previous pins by workspace key, from the published config's slot pins. */
|
|
62
|
+
function pinsFromPublishedConfig(config, account, gateway) {
|
|
63
|
+
const pins = {};
|
|
64
|
+
for (const ref of collectSlotPinRefs(config)) {
|
|
65
|
+
const workspace = workspaceKeyOfBase(ref.base);
|
|
66
|
+
const nsMatch = BUNDLE_BASE_PATTERN.exec(`${ref.base.replace(/\/$/, "")}/`);
|
|
67
|
+
if (!workspace || !nsMatch || nsMatch[1] !== account || nsMatch[2] !== gateway) continue;
|
|
68
|
+
pins[workspace] = ref.pin;
|
|
69
|
+
}
|
|
70
|
+
return pins;
|
|
71
|
+
}
|
|
72
|
+
function diffWorkspaceFiles(files, localSri, prevFiles) {
|
|
73
|
+
const upload = [];
|
|
74
|
+
let skipped = 0;
|
|
75
|
+
for (const file of files) {
|
|
76
|
+
if (prevFiles[file.path] !== void 0 && prevFiles[file.path] === localSri[file.path]) {
|
|
77
|
+
skipped += 1;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
upload.push(file);
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
upload,
|
|
84
|
+
skipped
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The manifest's merged per-file map for this deploy: uploaded files carry the
|
|
89
|
+
* server-computed SRI from the upload response; skipped files carry the
|
|
90
|
+
* previous manifest's server-computed SRI (byte-identical to the local hash by
|
|
91
|
+
* the skip decision). Files that left the dist carry nothing.
|
|
92
|
+
*/
|
|
93
|
+
function mergedFileIntegrity(files, uploadedIntegrity, prevFiles) {
|
|
94
|
+
const merged = {};
|
|
95
|
+
for (const file of files) {
|
|
96
|
+
const uploaded = uploadedIntegrity[file.path];
|
|
97
|
+
if (uploaded) {
|
|
98
|
+
merged[file.path] = uploaded;
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
const carried = prevFiles?.[file.path];
|
|
102
|
+
if (carried) merged[file.path] = carried;
|
|
103
|
+
}
|
|
104
|
+
return merged;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
//#endregion
|
|
108
|
+
export { BUNDLE_BASE_PATTERN, diffWorkspaceFiles, localObjectIntegrity, localSriMap, mergedFileIntegrity, pinsFromDeployState, pinsFromPublishedConfig, readDeployState, upsertDeployStatePins, workspaceKeyOfBase, writeDeployState };
|
|
109
|
+
//# sourceMappingURL=deploy-diff.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-diff.mjs","names":[],"sources":["../src/deploy-diff.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { collectSlotPinRefs } from \"./rollback\";\nimport type { DistFile } from \"./storage-upload\";\nimport type { BosConfigInput } from \"./types\";\n\n/**\n * Differential bundle uploads (skip-unchanged): the previous deploy's version\n * manifest carries the dist's full per-file SRI map (`files`), so the next\n * deploy hashes its local dist, diffs against that map, and re-uploads only\n * new or changed files. Content-hashed dist filenames make an unchanged chunk\n * byte-identical, so a typical redeploy ships a handful of files instead of\n * the whole tree.\n *\n * Correctness: a skip requires (path, sha384) to match the previous\n * **server-computed** SRI map — client hashes decide only what to skip; the\n * published manifest keeps carrying the server-computed values. Any failure\n * to resolve the previous map (no pointer, fetch failed, SRI mismatch, manifest\n * predates `files`) degrades to a full upload.\n */\n\nexport interface PreviousPin {\n manifest: string;\n integrity: string;\n}\n\nexport interface DeployStateFile {\n version: 1;\n /** key: `<account>/<gateway>`, then workspace key → pin */\n apps: Record<string, Record<string, PreviousPin>>;\n}\n\nexport const BUNDLE_BASE_PATTERN = /\\/bundles\\/([^/]+)\\/([^/]+)\\/([^/]+)\\/$/;\n\nexport function workspaceKeyOfBase(base: string): string | null {\n const match = BUNDLE_BASE_PATTERN.exec(`${base.replace(/\\/$/, \"\")}/`);\n return match ? match[3]! : null;\n}\n\n/** The sha384 SRI the storage route would compute for these bytes. */\nexport function localObjectIntegrity(bytes: Uint8Array): string {\n return `sha384-${createHash(\"sha384\").update(bytes).digest(\"base64\")}`;\n}\n\nexport function localSriMap(files: DistFile[]): Record<string, string> {\n return Object.fromEntries(files.map((file) => [file.path, localObjectIntegrity(file.bytes)]));\n}\n\nconst deployStatePath = (configDir: string) => join(configDir, \".bos\", \"deploy-state.json\");\n\nexport function readDeployState(configDir: string): DeployStateFile {\n const path = deployStatePath(configDir);\n if (!existsSync(path)) return { version: 1, apps: {} };\n try {\n const parsed = JSON.parse(readFileSync(path, \"utf8\")) as Partial<DeployStateFile>;\n if (parsed.version !== 1 || typeof parsed.apps !== \"object\" || parsed.apps === null) {\n return { version: 1, apps: {} };\n }\n return { version: 1, apps: parsed.apps as DeployStateFile[\"apps\"] };\n } catch {\n return { version: 1, apps: {} };\n }\n}\n\nexport function writeDeployState(configDir: string, state: DeployStateFile): void {\n const path = deployStatePath(configDir);\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, `${JSON.stringify(state, null, 2)}\\n`);\n}\n\nexport function upsertDeployStatePins(\n configDir: string,\n account: string,\n gateway: string,\n pins: Record<string, PreviousPin>,\n): void {\n const state = readDeployState(configDir);\n const appKey = `${account}/${gateway}`;\n state.apps[appKey] = { ...(state.apps[appKey] ?? {}), ...pins };\n writeDeployState(configDir, state);\n}\n\n/** Previous pins by workspace key, from the local deploy-state pointer. */\nexport function pinsFromDeployState(\n configDir: string,\n account: string,\n gateway: string,\n): Record<string, PreviousPin> {\n return readDeployState(configDir).apps[`${account}/${gateway}`] ?? {};\n}\n\n/** Previous pins by workspace key, from the published config's slot pins. */\nexport function pinsFromPublishedConfig(\n config: BosConfigInput,\n account: string,\n gateway: string,\n): Record<string, PreviousPin> {\n const pins: Record<string, PreviousPin> = {};\n for (const ref of collectSlotPinRefs(config)) {\n const workspace = workspaceKeyOfBase(ref.base);\n const nsMatch = BUNDLE_BASE_PATTERN.exec(`${ref.base.replace(/\\/$/, \"\")}/`);\n if (!workspace || !nsMatch || nsMatch[1] !== account || nsMatch[2] !== gateway) continue;\n pins[workspace] = ref.pin;\n }\n return pins;\n}\n\nexport interface WorkspaceDiff {\n /** files that must be uploaded (new or changed) */\n upload: DistFile[];\n /** number of files skipped because the previous manifest holds identical bytes */\n skipped: number;\n}\n\nexport function diffWorkspaceFiles(\n files: DistFile[],\n localSri: Record<string, string>,\n prevFiles: Record<string, string>,\n): WorkspaceDiff {\n const upload: DistFile[] = [];\n let skipped = 0;\n for (const file of files) {\n if (prevFiles[file.path] !== undefined && prevFiles[file.path] === localSri[file.path]) {\n skipped += 1;\n continue;\n }\n upload.push(file);\n }\n return { upload, skipped };\n}\n\n/**\n * The manifest's merged per-file map for this deploy: uploaded files carry the\n * server-computed SRI from the upload response; skipped files carry the\n * previous manifest's server-computed SRI (byte-identical to the local hash by\n * the skip decision). Files that left the dist carry nothing.\n */\nexport function mergedFileIntegrity(\n files: DistFile[],\n uploadedIntegrity: Record<string, string>,\n prevFiles: Record<string, string> | undefined,\n): Record<string, string> {\n const merged: Record<string, string> = {};\n for (const file of files) {\n const uploaded = uploadedIntegrity[file.path];\n if (uploaded) {\n merged[file.path] = uploaded;\n continue;\n }\n const carried = prevFiles?.[file.path];\n if (carried) merged[file.path] = carried;\n }\n return merged;\n}\n"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
|
3
|
+
|
|
4
|
+
//#region src/descriptor/constructors.ts
|
|
5
|
+
/**
|
|
6
|
+
* The authored App — returns a pure, Zod-validated, serializable descriptor.
|
|
7
|
+
* Constructors never execute app code (the descriptor IS the deployment plan);
|
|
8
|
+
* resolution and deployment consume it as data.
|
|
9
|
+
*/
|
|
10
|
+
function App(input) {
|
|
11
|
+
return require_schema.AppDescriptorSchema.parse(input);
|
|
12
|
+
}
|
|
13
|
+
/** The app.api slot. */
|
|
14
|
+
function API(input) {
|
|
15
|
+
return require_schema.ApiRefSchema.parse(input);
|
|
16
|
+
}
|
|
17
|
+
/** The app.ui slot. */
|
|
18
|
+
function UI(input) {
|
|
19
|
+
return require_schema.UiRefSchema.parse(input);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Attach another App — by local workspace path (`Plugin("auth").path("plugins/auth")`)
|
|
23
|
+
* or by published module reference (`Plugin("auth").extends("bos://…")`).
|
|
24
|
+
* The attachment's `name` (the plugin's package name, e.g.
|
|
25
|
+
* `@everything-dev/auth-plugin`) may differ from the registry key; pass it
|
|
26
|
+
* through `extra` to override.
|
|
27
|
+
*/
|
|
28
|
+
function Plugin(name) {
|
|
29
|
+
return {
|
|
30
|
+
path: (dir, extra) => require_schema.AttachmentRefSchema.parse({
|
|
31
|
+
name,
|
|
32
|
+
...extra,
|
|
33
|
+
path: dir
|
|
34
|
+
}),
|
|
35
|
+
extends: (ref, extra) => require_schema.AttachmentRefSchema.parse({
|
|
36
|
+
name,
|
|
37
|
+
...extra,
|
|
38
|
+
extends: ref
|
|
39
|
+
})
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
exports.API = API;
|
|
45
|
+
exports.App = App;
|
|
46
|
+
exports.Plugin = Plugin;
|
|
47
|
+
exports.UI = UI;
|
|
48
|
+
exports.applyDevOverlay = require_resolve.applyDevOverlay;
|
|
49
|
+
//# sourceMappingURL=constructors.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constructors.cjs","names":["AppDescriptorSchema","ApiRefSchema","UiRefSchema","AttachmentRefSchema"],"sources":["../../src/descriptor/constructors.ts"],"sourcesContent":["import type {\n ApiInput,\n ApiRef,\n AppDescriptor,\n AppInput,\n AttachmentInput,\n AttachmentRef,\n UiInput,\n UiRef,\n} from \"./schema\";\nimport { ApiRefSchema, AppDescriptorSchema, AttachmentRefSchema, UiRefSchema } from \"./schema\";\n\n/**\n * The authored App — returns a pure, Zod-validated, serializable descriptor.\n * Constructors never execute app code (the descriptor IS the deployment plan);\n * resolution and deployment consume it as data.\n */\nexport function App(input: AppInput): AppDescriptor {\n return AppDescriptorSchema.parse(input);\n}\n\n/** The app.api slot. */\nexport function API(input: ApiInput): ApiRef {\n return ApiRefSchema.parse(input);\n}\n\n/** The app.ui slot. */\nexport function UI(input: UiInput): UiRef {\n return UiRefSchema.parse(input);\n}\n\n/**\n * Attach another App — by local workspace path (`Plugin(\"auth\").path(\"plugins/auth\")`)\n * or by published module reference (`Plugin(\"auth\").extends(\"bos://…\")`).\n * The attachment's `name` (the plugin's package name, e.g.\n * `@everything-dev/auth-plugin`) may differ from the registry key; pass it\n * through `extra` to override.\n */\nexport function Plugin<K extends string>(\n name: K,\n): {\n path: (dir: string, extra?: Omit<AttachmentInput, \"path\">) => AttachmentRef;\n extends: (ref: string, extra?: Omit<AttachmentInput, \"extends\">) => AttachmentRef;\n} {\n return {\n path: (dir, extra) => AttachmentRefSchema.parse({ name, ...extra, path: dir }),\n extends: (ref, extra) => AttachmentRefSchema.parse({ name, ...extra, extends: ref }),\n };\n}\nexport { applyDevOverlay } from \"./resolve\";\n"],"mappings":";;;;;;;;;AAiBA,SAAgB,IAAI,OAAgC;CAClD,OAAOA,mCAAoB,MAAM,KAAK;AACxC;;AAGA,SAAgB,IAAI,OAAyB;CAC3C,OAAOC,4BAAa,MAAM,KAAK;AACjC;;AAGA,SAAgB,GAAG,OAAuB;CACxC,OAAOC,2BAAY,MAAM,KAAK;AAChC;;;;;;;;AASA,SAAgB,OACd,MAIA;CACA,OAAO;EACL,OAAO,KAAK,UAAUC,mCAAoB,MAAM;GAAE;GAAM,GAAG;GAAO,MAAM;EAAI,CAAC;EAC7E,UAAU,KAAK,UAAUA,mCAAoB,MAAM;GAAE;GAAM,GAAG;GAAO,SAAS;EAAI,CAAC;CACrF;AACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ApiInput, ApiRef, AppDescriptor, AppInput, AttachmentInput, AttachmentRef, UiInput, UiRef } from "./schema.cjs";
|
|
2
|
+
import { applyDevOverlay } from "./resolve.cjs";
|
|
3
|
+
//#region src/descriptor/constructors.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The authored App — returns a pure, Zod-validated, serializable descriptor.
|
|
6
|
+
* Constructors never execute app code (the descriptor IS the deployment plan);
|
|
7
|
+
* resolution and deployment consume it as data.
|
|
8
|
+
*/
|
|
9
|
+
declare function App(input: AppInput): AppDescriptor;
|
|
10
|
+
/** The app.api slot. */
|
|
11
|
+
declare function API(input: ApiInput): ApiRef;
|
|
12
|
+
/** The app.ui slot. */
|
|
13
|
+
declare function UI(input: UiInput): UiRef;
|
|
14
|
+
/**
|
|
15
|
+
* Attach another App — by local workspace path (`Plugin("auth").path("plugins/auth")`)
|
|
16
|
+
* or by published module reference (`Plugin("auth").extends("bos://…")`).
|
|
17
|
+
* The attachment's `name` (the plugin's package name, e.g.
|
|
18
|
+
* `@everything-dev/auth-plugin`) may differ from the registry key; pass it
|
|
19
|
+
* through `extra` to override.
|
|
20
|
+
*/
|
|
21
|
+
declare function Plugin<K extends string>(name: K): {
|
|
22
|
+
path: (dir: string, extra?: Omit<AttachmentInput, "path">) => AttachmentRef;
|
|
23
|
+
extends: (ref: string, extra?: Omit<AttachmentInput, "extends">) => AttachmentRef;
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { API, App, Plugin, UI, applyDevOverlay };
|
|
27
|
+
//# sourceMappingURL=constructors.d.cts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ApiInput, ApiRef, AppDescriptor, AppInput, AttachmentInput, AttachmentRef, UiInput, UiRef } from "./schema.mjs";
|
|
2
|
+
import { applyDevOverlay } from "./resolve.mjs";
|
|
3
|
+
//#region src/descriptor/constructors.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The authored App — returns a pure, Zod-validated, serializable descriptor.
|
|
6
|
+
* Constructors never execute app code (the descriptor IS the deployment plan);
|
|
7
|
+
* resolution and deployment consume it as data.
|
|
8
|
+
*/
|
|
9
|
+
declare function App(input: AppInput): AppDescriptor;
|
|
10
|
+
/** The app.api slot. */
|
|
11
|
+
declare function API(input: ApiInput): ApiRef;
|
|
12
|
+
/** The app.ui slot. */
|
|
13
|
+
declare function UI(input: UiInput): UiRef;
|
|
14
|
+
/**
|
|
15
|
+
* Attach another App — by local workspace path (`Plugin("auth").path("plugins/auth")`)
|
|
16
|
+
* or by published module reference (`Plugin("auth").extends("bos://…")`).
|
|
17
|
+
* The attachment's `name` (the plugin's package name, e.g.
|
|
18
|
+
* `@everything-dev/auth-plugin`) may differ from the registry key; pass it
|
|
19
|
+
* through `extra` to override.
|
|
20
|
+
*/
|
|
21
|
+
declare function Plugin<K extends string>(name: K): {
|
|
22
|
+
path: (dir: string, extra?: Omit<AttachmentInput, "path">) => AttachmentRef;
|
|
23
|
+
extends: (ref: string, extra?: Omit<AttachmentInput, "extends">) => AttachmentRef;
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { API, App, Plugin, UI, applyDevOverlay };
|
|
27
|
+
//# sourceMappingURL=constructors.d.mts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ApiRefSchema, AppDescriptorSchema, AttachmentRefSchema, UiRefSchema } from "./schema.mjs";
|
|
2
|
+
import { applyDevOverlay } from "./resolve.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/descriptor/constructors.ts
|
|
5
|
+
/**
|
|
6
|
+
* The authored App — returns a pure, Zod-validated, serializable descriptor.
|
|
7
|
+
* Constructors never execute app code (the descriptor IS the deployment plan);
|
|
8
|
+
* resolution and deployment consume it as data.
|
|
9
|
+
*/
|
|
10
|
+
function App(input) {
|
|
11
|
+
return AppDescriptorSchema.parse(input);
|
|
12
|
+
}
|
|
13
|
+
/** The app.api slot. */
|
|
14
|
+
function API(input) {
|
|
15
|
+
return ApiRefSchema.parse(input);
|
|
16
|
+
}
|
|
17
|
+
/** The app.ui slot. */
|
|
18
|
+
function UI(input) {
|
|
19
|
+
return UiRefSchema.parse(input);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Attach another App — by local workspace path (`Plugin("auth").path("plugins/auth")`)
|
|
23
|
+
* or by published module reference (`Plugin("auth").extends("bos://…")`).
|
|
24
|
+
* The attachment's `name` (the plugin's package name, e.g.
|
|
25
|
+
* `@everything-dev/auth-plugin`) may differ from the registry key; pass it
|
|
26
|
+
* through `extra` to override.
|
|
27
|
+
*/
|
|
28
|
+
function Plugin(name) {
|
|
29
|
+
return {
|
|
30
|
+
path: (dir, extra) => AttachmentRefSchema.parse({
|
|
31
|
+
name,
|
|
32
|
+
...extra,
|
|
33
|
+
path: dir
|
|
34
|
+
}),
|
|
35
|
+
extends: (ref, extra) => AttachmentRefSchema.parse({
|
|
36
|
+
name,
|
|
37
|
+
...extra,
|
|
38
|
+
extends: ref
|
|
39
|
+
})
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { API, App, Plugin, UI, applyDevOverlay };
|
|
45
|
+
//# sourceMappingURL=constructors.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constructors.mjs","names":[],"sources":["../../src/descriptor/constructors.ts"],"sourcesContent":["import type {\n ApiInput,\n ApiRef,\n AppDescriptor,\n AppInput,\n AttachmentInput,\n AttachmentRef,\n UiInput,\n UiRef,\n} from \"./schema\";\nimport { ApiRefSchema, AppDescriptorSchema, AttachmentRefSchema, UiRefSchema } from \"./schema\";\n\n/**\n * The authored App — returns a pure, Zod-validated, serializable descriptor.\n * Constructors never execute app code (the descriptor IS the deployment plan);\n * resolution and deployment consume it as data.\n */\nexport function App(input: AppInput): AppDescriptor {\n return AppDescriptorSchema.parse(input);\n}\n\n/** The app.api slot. */\nexport function API(input: ApiInput): ApiRef {\n return ApiRefSchema.parse(input);\n}\n\n/** The app.ui slot. */\nexport function UI(input: UiInput): UiRef {\n return UiRefSchema.parse(input);\n}\n\n/**\n * Attach another App — by local workspace path (`Plugin(\"auth\").path(\"plugins/auth\")`)\n * or by published module reference (`Plugin(\"auth\").extends(\"bos://…\")`).\n * The attachment's `name` (the plugin's package name, e.g.\n * `@everything-dev/auth-plugin`) may differ from the registry key; pass it\n * through `extra` to override.\n */\nexport function Plugin<K extends string>(\n name: K,\n): {\n path: (dir: string, extra?: Omit<AttachmentInput, \"path\">) => AttachmentRef;\n extends: (ref: string, extra?: Omit<AttachmentInput, \"extends\">) => AttachmentRef;\n} {\n return {\n path: (dir, extra) => AttachmentRefSchema.parse({ name, ...extra, path: dir }),\n extends: (ref, extra) => AttachmentRefSchema.parse({ name, ...extra, extends: ref }),\n };\n}\nexport { applyDevOverlay } from \"./resolve\";\n"],"mappings":";;;;;;;;;AAiBA,SAAgB,IAAI,OAAgC;CAClD,OAAO,oBAAoB,MAAM,KAAK;AACxC;;AAGA,SAAgB,IAAI,OAAyB;CAC3C,OAAO,aAAa,MAAM,KAAK;AACjC;;AAGA,SAAgB,GAAG,OAAuB;CACxC,OAAO,YAAY,MAAM,KAAK;AAChC;;;;;;;;AASA,SAAgB,OACd,MAIA;CACA,OAAO;EACL,OAAO,KAAK,UAAU,oBAAoB,MAAM;GAAE;GAAM,GAAG;GAAO,MAAM;EAAI,CAAC;EAC7E,UAAU,KAAK,UAAU,oBAAoB,MAAM;GAAE;GAAM,GAAG;GAAO,SAAS;EAAI,CAAC;CACrF;AACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_schema = require('./schema.cjs');
|
|
3
|
+
const require_resolve = require('./resolve.cjs');
|
|
4
|
+
const require_constructors = require('./constructors.cjs');
|
|
5
|
+
const require_serialize = require('./serialize.cjs');
|
|
6
|
+
|
|
7
|
+
exports.API = require_constructors.API;
|
|
8
|
+
exports.ATTACHMENT_FIELDS = require_resolve.ATTACHMENT_FIELDS;
|
|
9
|
+
exports.ApiRefSchema = require_schema.ApiRefSchema;
|
|
10
|
+
exports.App = require_constructors.App;
|
|
11
|
+
exports.AppDescriptorSchema = require_schema.AppDescriptorSchema;
|
|
12
|
+
exports.AttachmentRefSchema = require_schema.AttachmentRefSchema;
|
|
13
|
+
exports.HostRefSchema = require_schema.HostRefSchema;
|
|
14
|
+
exports.PipelineFieldsSchema = require_schema.PipelineFieldsSchema;
|
|
15
|
+
exports.Plugin = require_constructors.Plugin;
|
|
16
|
+
exports.SLOT_INPUT_FIELDS = require_resolve.SLOT_INPUT_FIELDS;
|
|
17
|
+
exports.UI = require_constructors.UI;
|
|
18
|
+
exports.UiRefSchema = require_schema.UiRefSchema;
|
|
19
|
+
exports.applyDevOverlay = require_resolve.applyDevOverlay;
|
|
20
|
+
exports.configInputToDescriptor = require_resolve.configInputToDescriptor;
|
|
21
|
+
exports.resolveApp = require_resolve.resolveApp;
|
|
22
|
+
exports.resolveApps = require_resolve.resolveApps;
|
|
23
|
+
exports.serializeAppDescriptorSource = require_serialize.serializeAppDescriptorSource;
|
|
24
|
+
exports.toConfigInput = require_resolve.toConfigInput;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ApiInput, ApiRef, ApiRefSchema, AppDescriptor, AppDescriptorSchema, AppInput, AppRegistry, AttachmentInput, AttachmentRef, AttachmentRefSchema, HostInput, HostRef, HostRefSchema, PipelineFields, PipelineFieldsSchema, UiInput, UiRef, UiRefSchema } from "./schema.cjs";
|
|
2
|
+
import { ATTACHMENT_FIELDS, AppDeployEntry, DeployMap, SLOT_INPUT_FIELDS, applyDevOverlay, configInputToDescriptor, resolveApp, resolveApps, toConfigInput } from "./resolve.cjs";
|
|
3
|
+
import { API, App, Plugin, UI } from "./constructors.cjs";
|
|
4
|
+
import { serializeAppDescriptorSource } from "./serialize.cjs";
|
|
5
|
+
export { API, ATTACHMENT_FIELDS, ApiInput, ApiRef, ApiRefSchema, App, AppDeployEntry, AppDescriptor, AppDescriptorSchema, AppInput, AppRegistry, AttachmentInput, AttachmentRef, AttachmentRefSchema, DeployMap, HostInput, HostRef, HostRefSchema, PipelineFields, PipelineFieldsSchema, Plugin, SLOT_INPUT_FIELDS, UI, UiInput, UiRef, UiRefSchema, applyDevOverlay, configInputToDescriptor, resolveApp, resolveApps, serializeAppDescriptorSource, toConfigInput };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ApiInput, ApiRef, ApiRefSchema, AppDescriptor, AppDescriptorSchema, AppInput, AppRegistry, AttachmentInput, AttachmentRef, AttachmentRefSchema, HostInput, HostRef, HostRefSchema, PipelineFields, PipelineFieldsSchema, UiInput, UiRef, UiRefSchema } from "./schema.mjs";
|
|
2
|
+
import { ATTACHMENT_FIELDS, AppDeployEntry, DeployMap, SLOT_INPUT_FIELDS, applyDevOverlay, configInputToDescriptor, resolveApp, resolveApps, toConfigInput } from "./resolve.mjs";
|
|
3
|
+
import { API, App, Plugin, UI } from "./constructors.mjs";
|
|
4
|
+
import { serializeAppDescriptorSource } from "./serialize.mjs";
|
|
5
|
+
export { API, ATTACHMENT_FIELDS, ApiInput, ApiRef, ApiRefSchema, App, AppDeployEntry, AppDescriptor, AppDescriptorSchema, AppInput, AppRegistry, AttachmentInput, AttachmentRef, AttachmentRefSchema, DeployMap, HostInput, HostRef, HostRefSchema, PipelineFields, PipelineFieldsSchema, Plugin, SLOT_INPUT_FIELDS, UI, UiInput, UiRef, UiRefSchema, applyDevOverlay, configInputToDescriptor, resolveApp, resolveApps, serializeAppDescriptorSource, toConfigInput };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ApiRefSchema, AppDescriptorSchema, AttachmentRefSchema, HostRefSchema, PipelineFieldsSchema, UiRefSchema } from "./schema.mjs";
|
|
2
|
+
import { ATTACHMENT_FIELDS, SLOT_INPUT_FIELDS, applyDevOverlay, configInputToDescriptor, resolveApp, resolveApps, toConfigInput } from "./resolve.mjs";
|
|
3
|
+
import { API, App, Plugin, UI } from "./constructors.mjs";
|
|
4
|
+
import { serializeAppDescriptorSource } from "./serialize.mjs";
|
|
5
|
+
|
|
6
|
+
export { API, ATTACHMENT_FIELDS, ApiRefSchema, App, AppDescriptorSchema, AttachmentRefSchema, HostRefSchema, PipelineFieldsSchema, Plugin, SLOT_INPUT_FIELDS, UI, UiRefSchema, applyDevOverlay, configInputToDescriptor, resolveApp, resolveApps, serializeAppDescriptorSource, toConfigInput };
|