everything-dev 1.53.2 → 2.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +624 -196
- 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 +613 -194
- 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,258 @@
|
|
|
1
|
+
const require_merge = require('../merge.cjs');
|
|
2
|
+
const require_schema = require('./schema.cjs');
|
|
3
|
+
|
|
4
|
+
//#region src/descriptor/resolve.ts
|
|
5
|
+
function isPlainObject(value) {
|
|
6
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
const devRef = (ref) => ref.path ? `local:${ref.path}` : ref.development;
|
|
9
|
+
function pick(source, keys) {
|
|
10
|
+
const out = {};
|
|
11
|
+
for (const key of keys) if (source[key] !== void 0) out[key] = source[key];
|
|
12
|
+
return out;
|
|
13
|
+
}
|
|
14
|
+
const ATTACHMENT_FIELDS = [
|
|
15
|
+
"name",
|
|
16
|
+
"proxy",
|
|
17
|
+
"variables",
|
|
18
|
+
"secrets",
|
|
19
|
+
"routes",
|
|
20
|
+
"shared",
|
|
21
|
+
"connectSrc",
|
|
22
|
+
"dependsOn",
|
|
23
|
+
"version"
|
|
24
|
+
];
|
|
25
|
+
/** Fields the attachment slots carry beyond the shared attachment set. */
|
|
26
|
+
const SLOT_INPUT_FIELDS = [
|
|
27
|
+
"development",
|
|
28
|
+
"extends",
|
|
29
|
+
"integrity"
|
|
30
|
+
];
|
|
31
|
+
/** Fields a config-entry may carry that map onto an attachment's slot-free set. */
|
|
32
|
+
const ENTRY_ONLY_FIELDS = ["name", "extends"];
|
|
33
|
+
const LOCAL_PREFIX = "local:";
|
|
34
|
+
function stripLocal(development) {
|
|
35
|
+
return development?.startsWith(LOCAL_PREFIX) ? development.slice(6) : void 0;
|
|
36
|
+
}
|
|
37
|
+
function attachmentToEntry(attachment) {
|
|
38
|
+
const development = devRef(attachment);
|
|
39
|
+
return {
|
|
40
|
+
...attachment.extends ? { extends: attachment.extends } : {},
|
|
41
|
+
...development ? { development } : {},
|
|
42
|
+
...pick(attachment, [...ATTACHMENT_FIELDS]),
|
|
43
|
+
...attachment.ui ? { ui: {
|
|
44
|
+
...attachment.ui.name ? { name: attachment.ui.name } : {},
|
|
45
|
+
...attachment.ui.path ? { development: `local:${attachment.ui.path}` } : attachment.ui.development ? { development: attachment.ui.development } : {},
|
|
46
|
+
...attachment.ui.integrity ? { integrity: attachment.ui.integrity } : {},
|
|
47
|
+
...attachment.ui.pin ? { pin: attachment.ui.pin } : {}
|
|
48
|
+
} } : {}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/** Descriptor → authoring-shape `BosConfigInput` (local refs only, no pipeline state). */
|
|
52
|
+
function toConfigInput(descriptor) {
|
|
53
|
+
const input = { ...pick(descriptor, [
|
|
54
|
+
"account",
|
|
55
|
+
"domain",
|
|
56
|
+
"title",
|
|
57
|
+
"description",
|
|
58
|
+
"repository",
|
|
59
|
+
"testnet",
|
|
60
|
+
"staging",
|
|
61
|
+
"ci",
|
|
62
|
+
"cdn",
|
|
63
|
+
"publish"
|
|
64
|
+
]) };
|
|
65
|
+
const app = {};
|
|
66
|
+
if (descriptor.host) {
|
|
67
|
+
const development = devRef(descriptor.host);
|
|
68
|
+
if (development) app.host = {
|
|
69
|
+
development,
|
|
70
|
+
...pick(descriptor.host, ["secrets"])
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (descriptor.api) {
|
|
74
|
+
const development = devRef(descriptor.api);
|
|
75
|
+
if (development) app.api = {
|
|
76
|
+
development,
|
|
77
|
+
...pick(descriptor.api, [
|
|
78
|
+
"proxy",
|
|
79
|
+
"variables",
|
|
80
|
+
"secrets",
|
|
81
|
+
"routes",
|
|
82
|
+
"shared",
|
|
83
|
+
"dependsOn"
|
|
84
|
+
])
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
if (descriptor.ui) {
|
|
88
|
+
const development = devRef(descriptor.ui);
|
|
89
|
+
if (development) app.ui = { development };
|
|
90
|
+
}
|
|
91
|
+
if (descriptor.auth) app.auth = attachmentToEntry(descriptor.auth);
|
|
92
|
+
if (Object.keys(app).length > 0) input.app = app;
|
|
93
|
+
if (descriptor.plugins) {
|
|
94
|
+
const plugins = {};
|
|
95
|
+
for (const [key, attachment] of Object.entries(descriptor.plugins)) {
|
|
96
|
+
const entry = attachmentToEntry(attachment);
|
|
97
|
+
if (entry.name === key) delete entry.name;
|
|
98
|
+
plugins[key] = entry;
|
|
99
|
+
}
|
|
100
|
+
input.plugins = plugins;
|
|
101
|
+
}
|
|
102
|
+
return input;
|
|
103
|
+
}
|
|
104
|
+
function applyPipeline(target, fields) {
|
|
105
|
+
for (const [key, value] of Object.entries(fields)) if (value !== void 0) target[key] = value;
|
|
106
|
+
}
|
|
107
|
+
function applyDeployMap(config, entry) {
|
|
108
|
+
if (!entry) return;
|
|
109
|
+
if (entry.app && isPlainObject(config.app)) for (const [slot, fields] of Object.entries(entry.app)) {
|
|
110
|
+
const target = config.app[slot];
|
|
111
|
+
if (fields && isPlainObject(target)) applyPipeline(target, fields);
|
|
112
|
+
}
|
|
113
|
+
if (entry.plugins && isPlainObject(config.plugins)) for (const [key, fields] of Object.entries(entry.plugins)) {
|
|
114
|
+
const target = config.plugins[key];
|
|
115
|
+
if (fields && isPlainObject(target)) applyPipeline(target, fields);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Flatten one app against the registry: `extends` inherits the base App's
|
|
120
|
+
* composition, the child's entries win (depth-1 — chains are deferred,
|
|
121
|
+
* wayfinder ticket 08). The consumed `extends` key is dropped from the
|
|
122
|
+
* output; the deploy map injects pipeline state.
|
|
123
|
+
*
|
|
124
|
+
* `extends` accepts a registry name or an imported App descriptor value —
|
|
125
|
+
* an imported parent is an inlined parent: same materialization, no fetch.
|
|
126
|
+
*/
|
|
127
|
+
function resolveApp(name, registry, deployMap = {}, seen = /* @__PURE__ */ new Set()) {
|
|
128
|
+
if (seen.has(name)) throw new Error(`Circular extends detected: ${name}`);
|
|
129
|
+
const raw = registry[name];
|
|
130
|
+
if (!raw) throw new Error(`App "${name}" not found in registry`);
|
|
131
|
+
const descriptor = require_schema.AppDescriptorSchema.parse(raw);
|
|
132
|
+
let parentInput;
|
|
133
|
+
if (descriptor.extends) {
|
|
134
|
+
if (typeof descriptor.extends === "string") {
|
|
135
|
+
const parentRaw = registry[descriptor.extends];
|
|
136
|
+
if (!parentRaw) throw new Error(`extends target "${descriptor.extends}" not found in registry`);
|
|
137
|
+
parentInput = flattenParent(parentRaw);
|
|
138
|
+
} else parentInput = flattenParent(descriptor.extends);
|
|
139
|
+
}
|
|
140
|
+
const childInput = toConfigInput(descriptor);
|
|
141
|
+
const resolved = { ...parentInput ? require_merge.mergeBosConfigWithExtends(parentInput, childInput) : childInput };
|
|
142
|
+
delete resolved.extends;
|
|
143
|
+
applyDeployMap(resolved, deployMap[name]);
|
|
144
|
+
return resolved;
|
|
145
|
+
}
|
|
146
|
+
function flattenParent(parentRaw) {
|
|
147
|
+
const parentDescriptor = require_schema.AppDescriptorSchema.parse(parentRaw);
|
|
148
|
+
if (parentDescriptor.extends) {
|
|
149
|
+
const parentName = typeof parentDescriptor.extends === "string" ? parentDescriptor.extends : parentDescriptor.extends.name;
|
|
150
|
+
throw new Error(`extends chains deeper than one level are not supported yet ("${parentDescriptor.name}" extends "${parentName ?? "?"}") — wayfinder ticket 08`);
|
|
151
|
+
}
|
|
152
|
+
return toConfigInput(parentDescriptor);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Dev-time overlay — merged child-wins over a resolved config by the dev
|
|
156
|
+
* runner (ports, local-vs-remote sources, seeding). Overlays are never
|
|
157
|
+
* published: they exist only in `bos.dev.ts` and apply when the environment
|
|
158
|
+
* is development.
|
|
159
|
+
*/
|
|
160
|
+
function applyDevOverlay(resolved, overlay) {
|
|
161
|
+
return require_merge.mergeBosConfigWithExtends(resolved, toConfigInput(overlay));
|
|
162
|
+
}
|
|
163
|
+
/** Resolve every app in the registry. */
|
|
164
|
+
function resolveApps(registry, deployMap = {}) {
|
|
165
|
+
return Object.fromEntries(Object.keys(registry).map((name) => [name, resolveApp(name, registry, deployMap)]));
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* The inverse of `toConfigInput` for the scaffold surface: an authoring-shape
|
|
169
|
+
* config (as personalizeConfig computes it) back into the authored
|
|
170
|
+
* descriptor form a child's `bos.app.ts` embeds. Driven by the same field
|
|
171
|
+
* maps as `toConfigInput` so the two directions cannot drift; pipeline state
|
|
172
|
+
* (production URLs, integrity) is dropped — it is deploy-map territory,
|
|
173
|
+
* never authored.
|
|
174
|
+
*/
|
|
175
|
+
function configInputToDescriptor(input) {
|
|
176
|
+
const source = input;
|
|
177
|
+
const descriptor = { name: input.domain ?? input.account ?? "child.app" };
|
|
178
|
+
for (const field of [
|
|
179
|
+
"extends",
|
|
180
|
+
"account",
|
|
181
|
+
"domain",
|
|
182
|
+
"title",
|
|
183
|
+
"description",
|
|
184
|
+
"repository",
|
|
185
|
+
"testnet",
|
|
186
|
+
"staging",
|
|
187
|
+
"starter",
|
|
188
|
+
"ci",
|
|
189
|
+
"cdn",
|
|
190
|
+
"publish"
|
|
191
|
+
]) if (source[field] !== void 0) descriptor[field] = source[field];
|
|
192
|
+
const app = input.app ?? {};
|
|
193
|
+
const slot = (key) => {
|
|
194
|
+
const entry = app[key];
|
|
195
|
+
if (!entry?.development) return void 0;
|
|
196
|
+
const out = { path: stripLocal(entry.development) };
|
|
197
|
+
for (const field of ATTACHMENT_FIELDS) {
|
|
198
|
+
if (field === "name") continue;
|
|
199
|
+
if (entry[field] !== void 0) out[field] = entry[field];
|
|
200
|
+
}
|
|
201
|
+
return out;
|
|
202
|
+
};
|
|
203
|
+
for (const key of [
|
|
204
|
+
"host",
|
|
205
|
+
"ui",
|
|
206
|
+
"api"
|
|
207
|
+
]) {
|
|
208
|
+
const value = slot(key);
|
|
209
|
+
if (value) descriptor[key] = value;
|
|
210
|
+
}
|
|
211
|
+
const auth = app.auth;
|
|
212
|
+
if (auth?.development) descriptor.auth = entryToAttachment("auth", auth);
|
|
213
|
+
const plugins = {};
|
|
214
|
+
for (const [key, raw] of Object.entries(input.plugins ?? {})) if (typeof raw === "string") plugins[key] = {
|
|
215
|
+
name: key,
|
|
216
|
+
extends: raw
|
|
217
|
+
};
|
|
218
|
+
else if (raw && typeof raw === "object") plugins[key] = entryToAttachment(key, raw);
|
|
219
|
+
if (Object.keys(plugins).length > 0) descriptor.plugins = plugins;
|
|
220
|
+
return require_schema.AppDescriptorSchema.parse(descriptor);
|
|
221
|
+
}
|
|
222
|
+
/** Config-entry → authored attachment: name/extends + the shared field map. */
|
|
223
|
+
function entryToAttachment(key, entry) {
|
|
224
|
+
const out = {};
|
|
225
|
+
for (const field of ENTRY_ONLY_FIELDS) {
|
|
226
|
+
const value = entry[field];
|
|
227
|
+
if (value !== void 0) out[field] = field === "name" ? value : value;
|
|
228
|
+
else if (field === "name") out.name = key;
|
|
229
|
+
}
|
|
230
|
+
const development = entry.development;
|
|
231
|
+
const path = stripLocal(development);
|
|
232
|
+
if (path !== void 0) out.path = path;
|
|
233
|
+
for (const field of ATTACHMENT_FIELDS) {
|
|
234
|
+
if (field === "name") continue;
|
|
235
|
+
if (entry[field] !== void 0) out[field] = entry[field];
|
|
236
|
+
}
|
|
237
|
+
const ui = entry.ui;
|
|
238
|
+
if (ui && typeof ui === "object") {
|
|
239
|
+
const uiPath = stripLocal(ui.development);
|
|
240
|
+
out.ui = {
|
|
241
|
+
...typeof ui.name === "string" ? { name: ui.name } : {},
|
|
242
|
+
...uiPath !== void 0 ? { path: uiPath } : {},
|
|
243
|
+
...ui.integrity !== void 0 ? { integrity: ui.integrity } : {},
|
|
244
|
+
...ui.pin !== void 0 ? { pin: ui.pin } : {}
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
return out;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
//#endregion
|
|
251
|
+
exports.ATTACHMENT_FIELDS = ATTACHMENT_FIELDS;
|
|
252
|
+
exports.SLOT_INPUT_FIELDS = SLOT_INPUT_FIELDS;
|
|
253
|
+
exports.applyDevOverlay = applyDevOverlay;
|
|
254
|
+
exports.configInputToDescriptor = configInputToDescriptor;
|
|
255
|
+
exports.resolveApp = resolveApp;
|
|
256
|
+
exports.resolveApps = resolveApps;
|
|
257
|
+
exports.toConfigInput = toConfigInput;
|
|
258
|
+
//# sourceMappingURL=resolve.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.cjs","names":["AppDescriptorSchema","mergeBosConfigWithExtends"],"sources":["../../src/descriptor/resolve.ts"],"sourcesContent":["import { mergeBosConfigWithExtends } from \"../merge\";\nimport type { BosConfigInput } from \"../types\";\nimport type { AppDescriptor, AppRegistry, AttachmentRef, PipelineFields } from \"./schema\";\nimport { AppDescriptorSchema } from \"./schema\";\n\n/**\n * Pipeline-owned fields per app entry, keyed by app name. Authored\n * descriptors never carry deployment state — the deploy map resolves local\n * refs to URLs (today extracted verbatim from bos.config.json; tomorrow\n * written back by the deploy pipeline).\n */\nexport interface AppDeployEntry {\n app?: Partial<Record<\"host\" | \"ui\" | \"api\" | \"auth\", PipelineFields>>;\n plugins?: Record<string, PipelineFields>;\n}\nexport type DeployMap = Record<string, AppDeployEntry>;\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return Boolean(value) && typeof value === \"object\" && !Array.isArray(value);\n}\n\nconst devRef = (ref: { path?: string; development?: string }): string | undefined =>\n ref.path ? `local:${ref.path}` : ref.development;\n\nfunction pick<T extends object, K extends keyof T>(source: T, keys: K[]): Partial<T> {\n const out: Partial<T> = {};\n for (const key of keys) {\n if (source[key] !== undefined) out[key] = source[key];\n }\n return out;\n}\n\nexport const ATTACHMENT_FIELDS = [\n \"name\",\n \"proxy\",\n \"variables\",\n \"secrets\",\n \"routes\",\n \"shared\",\n \"connectSrc\",\n \"dependsOn\",\n \"version\",\n] as const;\n\n/** Fields the attachment slots carry beyond the shared attachment set. */\nexport const SLOT_INPUT_FIELDS = [\"development\", \"extends\", \"integrity\"] as const;\n\n/** Fields a config-entry may carry that map onto an attachment's slot-free set. */\nconst ENTRY_ONLY_FIELDS = [\"name\", \"extends\"] as const;\n\nconst LOCAL_PREFIX = \"local:\";\n\nfunction stripLocal(development: string | undefined): string | undefined {\n return development?.startsWith(LOCAL_PREFIX) ? development.slice(LOCAL_PREFIX.length) : undefined;\n}\n\nfunction attachmentToEntry(attachment: AttachmentRef): Record<string, unknown> {\n const development = devRef(attachment);\n return {\n ...(attachment.extends ? { extends: attachment.extends } : {}),\n ...(development ? { development } : {}),\n ...pick(attachment, [...ATTACHMENT_FIELDS]),\n ...(attachment.ui\n ? {\n ui: {\n ...(attachment.ui.name ? { name: attachment.ui.name } : {}),\n ...(attachment.ui.path\n ? { development: `local:${attachment.ui.path}` }\n : attachment.ui.development\n ? { development: attachment.ui.development }\n : {}),\n ...(attachment.ui.integrity ? { integrity: attachment.ui.integrity } : {}),\n ...(attachment.ui.pin ? { pin: attachment.ui.pin } : {}),\n },\n }\n : {}),\n };\n}\n\n/** Descriptor → authoring-shape `BosConfigInput` (local refs only, no pipeline state). */\nexport function toConfigInput(descriptor: AppDescriptor): BosConfigInput {\n const input: Record<string, unknown> = {\n ...pick(descriptor, [\n \"account\",\n \"domain\",\n \"title\",\n \"description\",\n \"repository\",\n \"testnet\",\n \"staging\",\n \"ci\",\n \"cdn\",\n \"publish\",\n ]),\n };\n\n const app: Record<string, unknown> = {};\n if (descriptor.host) {\n const development = devRef(descriptor.host);\n if (development) app.host = { development, ...pick(descriptor.host, [\"secrets\"]) };\n }\n if (descriptor.api) {\n const development = devRef(descriptor.api);\n if (development) {\n app.api = {\n development,\n ...pick(descriptor.api, [\"proxy\", \"variables\", \"secrets\", \"routes\", \"shared\", \"dependsOn\"]),\n };\n }\n }\n if (descriptor.ui) {\n const development = devRef(descriptor.ui);\n if (development) app.ui = { development };\n }\n if (descriptor.auth) app.auth = attachmentToEntry(descriptor.auth);\n if (Object.keys(app).length > 0) input.app = app;\n\n if (descriptor.plugins) {\n const plugins: Record<string, unknown> = {};\n for (const [key, attachment] of Object.entries(descriptor.plugins)) {\n const entry = attachmentToEntry(attachment);\n // today's authored shape omits a name identical to the registry key\n if (entry.name === key) delete entry.name;\n plugins[key] = entry;\n }\n input.plugins = plugins;\n }\n\n return input as BosConfigInput;\n}\n\nfunction applyPipeline(target: Record<string, unknown>, fields: PipelineFields): void {\n for (const [key, value] of Object.entries(fields)) {\n if (value !== undefined) target[key] = value;\n }\n}\n\nfunction applyDeployMap(config: Record<string, unknown>, entry: AppDeployEntry | undefined): void {\n if (!entry) return;\n\n if (entry.app && isPlainObject(config.app)) {\n for (const [slot, fields] of Object.entries(entry.app)) {\n const target = config.app[slot];\n if (fields && isPlainObject(target)) applyPipeline(target, fields);\n }\n }\n if (entry.plugins && isPlainObject(config.plugins)) {\n for (const [key, fields] of Object.entries(entry.plugins)) {\n const target = config.plugins[key];\n if (fields && isPlainObject(target)) applyPipeline(target, fields);\n }\n }\n}\n\n/**\n * Flatten one app against the registry: `extends` inherits the base App's\n * composition, the child's entries win (depth-1 — chains are deferred,\n * wayfinder ticket 08). The consumed `extends` key is dropped from the\n * output; the deploy map injects pipeline state.\n *\n * `extends` accepts a registry name or an imported App descriptor value —\n * an imported parent is an inlined parent: same materialization, no fetch.\n */\nexport function resolveApp(\n name: string,\n registry: AppRegistry,\n deployMap: DeployMap = {},\n seen: Set<string> = new Set(),\n): BosConfigInput {\n if (seen.has(name)) throw new Error(`Circular extends detected: ${name}`);\n const raw = registry[name];\n if (!raw) throw new Error(`App \"${name}\" not found in registry`);\n const descriptor = AppDescriptorSchema.parse(raw);\n\n let parentInput: BosConfigInput | undefined;\n if (descriptor.extends) {\n if (typeof descriptor.extends === \"string\") {\n const parentRaw = registry[descriptor.extends];\n if (!parentRaw) {\n throw new Error(`extends target \"${descriptor.extends}\" not found in registry`);\n }\n parentInput = flattenParent(parentRaw);\n } else {\n parentInput = flattenParent(descriptor.extends);\n }\n }\n\n const childInput = toConfigInput(descriptor);\n const merged = parentInput ? mergeBosConfigWithExtends(parentInput, childInput) : childInput;\n\n const resolved = { ...merged } as Record<string, unknown>;\n delete resolved.extends;\n applyDeployMap(resolved, deployMap[name]);\n return resolved as BosConfigInput;\n}\n\nfunction flattenParent(parentRaw: unknown): BosConfigInput {\n const parentDescriptor = AppDescriptorSchema.parse(parentRaw);\n if (parentDescriptor.extends) {\n const parentName =\n typeof parentDescriptor.extends === \"string\"\n ? parentDescriptor.extends\n : (parentDescriptor.extends as { name?: string }).name;\n throw new Error(\n `extends chains deeper than one level are not supported yet (\"${parentDescriptor.name}\" extends \"${parentName ?? \"?\"}\") — wayfinder ticket 08`,\n );\n }\n return toConfigInput(parentDescriptor);\n}\n\n/**\n * Dev-time overlay — merged child-wins over a resolved config by the dev\n * runner (ports, local-vs-remote sources, seeding). Overlays are never\n * published: they exist only in `bos.dev.ts` and apply when the environment\n * is development.\n */\nexport function applyDevOverlay(\n resolved: BosConfigInput,\n overlay: Partial<AppDescriptor>,\n): BosConfigInput {\n return mergeBosConfigWithExtends(resolved, toConfigInput(overlay as AppDescriptor));\n}\n\n/** Resolve every app in the registry. */\nexport function resolveApps(\n registry: AppRegistry,\n deployMap: DeployMap = {},\n): Record<string, BosConfigInput> {\n return Object.fromEntries(\n Object.keys(registry).map((name) => [name, resolveApp(name, registry, deployMap)]),\n );\n}\n\n/**\n * The inverse of `toConfigInput` for the scaffold surface: an authoring-shape\n * config (as personalizeConfig computes it) back into the authored\n * descriptor form a child's `bos.app.ts` embeds. Driven by the same field\n * maps as `toConfigInput` so the two directions cannot drift; pipeline state\n * (production URLs, integrity) is dropped — it is deploy-map territory,\n * never authored.\n */\nexport function configInputToDescriptor(input: BosConfigInput): AppDescriptor {\n const source = input as Record<string, unknown>;\n const descriptor: Record<string, unknown> = {\n name: (input.domain ?? input.account ?? \"child.app\") as string,\n };\n for (const field of [\n \"extends\",\n \"account\",\n \"domain\",\n \"title\",\n \"description\",\n \"repository\",\n \"testnet\",\n \"staging\",\n \"starter\",\n \"ci\",\n \"cdn\",\n \"publish\",\n ] as const) {\n if (source[field] !== undefined) descriptor[field] = source[field];\n }\n\n const app = (input.app ?? {}) as Record<string, Record<string, unknown>>;\n const slot = (key: \"host\" | \"ui\" | \"api\"): Record<string, unknown> | undefined => {\n const entry = app[key];\n if (!entry?.development) return undefined;\n const out: Record<string, unknown> = { path: stripLocal(entry.development as string) };\n for (const field of ATTACHMENT_FIELDS) {\n if (field === \"name\") continue;\n if (entry[field] !== undefined) out[field] = entry[field];\n }\n return out;\n };\n for (const key of [\"host\", \"ui\", \"api\"] as const) {\n const value = slot(key);\n if (value) descriptor[key] = value;\n }\n\n const auth = app.auth;\n if (auth?.development) descriptor.auth = entryToAttachment(\"auth\", auth);\n\n const plugins: Record<string, unknown> = {};\n for (const [key, raw] of Object.entries((input.plugins ?? {}) as Record<string, unknown>)) {\n if (typeof raw === \"string\") {\n plugins[key] = { name: key, extends: raw };\n } else if (raw && typeof raw === \"object\") {\n plugins[key] = entryToAttachment(key, raw as Record<string, unknown>);\n }\n }\n if (Object.keys(plugins).length > 0) descriptor.plugins = plugins;\n\n return AppDescriptorSchema.parse(descriptor);\n}\n\n/** Config-entry → authored attachment: name/extends + the shared field map. */\nfunction entryToAttachment(key: string, entry: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const field of ENTRY_ONLY_FIELDS) {\n const value = entry[field];\n if (value !== undefined) out[field] = field === \"name\" ? value : value;\n else if (field === \"name\") out.name = key;\n }\n const development = entry.development as string | undefined;\n const path = stripLocal(development);\n if (path !== undefined) out.path = path;\n for (const field of ATTACHMENT_FIELDS) {\n if (field === \"name\") continue;\n if (entry[field] !== undefined) out[field] = entry[field];\n }\n const ui = entry.ui as Record<string, unknown> | undefined;\n if (ui && typeof ui === \"object\") {\n const uiPath = stripLocal(ui.development as string | undefined);\n out.ui = {\n ...(typeof ui.name === \"string\" ? { name: ui.name } : {}),\n ...(uiPath !== undefined ? { path: uiPath } : {}),\n ...(ui.integrity !== undefined ? { integrity: ui.integrity } : {}),\n ...(ui.pin !== undefined ? { pin: ui.pin } : {}),\n };\n }\n return out;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BosConfigInput } from "../types.cjs";
|
|
2
|
+
import { AppDescriptor, AppRegistry, PipelineFields } from "./schema.cjs";
|
|
3
|
+
//#region src/descriptor/resolve.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Pipeline-owned fields per app entry, keyed by app name. Authored
|
|
6
|
+
* descriptors never carry deployment state — the deploy map resolves local
|
|
7
|
+
* refs to URLs (today extracted verbatim from bos.config.json; tomorrow
|
|
8
|
+
* written back by the deploy pipeline).
|
|
9
|
+
*/
|
|
10
|
+
interface AppDeployEntry {
|
|
11
|
+
app?: Partial<Record<"host" | "ui" | "api" | "auth", PipelineFields>>;
|
|
12
|
+
plugins?: Record<string, PipelineFields>;
|
|
13
|
+
}
|
|
14
|
+
type DeployMap = Record<string, AppDeployEntry>;
|
|
15
|
+
declare const ATTACHMENT_FIELDS: readonly ["name", "proxy", "variables", "secrets", "routes", "shared", "connectSrc", "dependsOn", "version"];
|
|
16
|
+
/** Fields the attachment slots carry beyond the shared attachment set. */
|
|
17
|
+
declare const SLOT_INPUT_FIELDS: readonly ["development", "extends", "integrity"];
|
|
18
|
+
/** Descriptor → authoring-shape `BosConfigInput` (local refs only, no pipeline state). */
|
|
19
|
+
declare function toConfigInput(descriptor: AppDescriptor): BosConfigInput;
|
|
20
|
+
/**
|
|
21
|
+
* Flatten one app against the registry: `extends` inherits the base App's
|
|
22
|
+
* composition, the child's entries win (depth-1 — chains are deferred,
|
|
23
|
+
* wayfinder ticket 08). The consumed `extends` key is dropped from the
|
|
24
|
+
* output; the deploy map injects pipeline state.
|
|
25
|
+
*
|
|
26
|
+
* `extends` accepts a registry name or an imported App descriptor value —
|
|
27
|
+
* an imported parent is an inlined parent: same materialization, no fetch.
|
|
28
|
+
*/
|
|
29
|
+
declare function resolveApp(name: string, registry: AppRegistry, deployMap?: DeployMap, seen?: Set<string>): BosConfigInput;
|
|
30
|
+
/**
|
|
31
|
+
* Dev-time overlay — merged child-wins over a resolved config by the dev
|
|
32
|
+
* runner (ports, local-vs-remote sources, seeding). Overlays are never
|
|
33
|
+
* published: they exist only in `bos.dev.ts` and apply when the environment
|
|
34
|
+
* is development.
|
|
35
|
+
*/
|
|
36
|
+
declare function applyDevOverlay(resolved: BosConfigInput, overlay: Partial<AppDescriptor>): BosConfigInput;
|
|
37
|
+
/** Resolve every app in the registry. */
|
|
38
|
+
declare function resolveApps(registry: AppRegistry, deployMap?: DeployMap): Record<string, BosConfigInput>;
|
|
39
|
+
/**
|
|
40
|
+
* The inverse of `toConfigInput` for the scaffold surface: an authoring-shape
|
|
41
|
+
* config (as personalizeConfig computes it) back into the authored
|
|
42
|
+
* descriptor form a child's `bos.app.ts` embeds. Driven by the same field
|
|
43
|
+
* maps as `toConfigInput` so the two directions cannot drift; pipeline state
|
|
44
|
+
* (production URLs, integrity) is dropped — it is deploy-map territory,
|
|
45
|
+
* never authored.
|
|
46
|
+
*/
|
|
47
|
+
declare function configInputToDescriptor(input: BosConfigInput): AppDescriptor;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { ATTACHMENT_FIELDS, AppDeployEntry, DeployMap, SLOT_INPUT_FIELDS, applyDevOverlay, configInputToDescriptor, resolveApp, resolveApps, toConfigInput };
|
|
50
|
+
//# sourceMappingURL=resolve.d.cts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BosConfigInput } from "../types.mjs";
|
|
2
|
+
import { AppDescriptor, AppRegistry, PipelineFields } from "./schema.mjs";
|
|
3
|
+
//#region src/descriptor/resolve.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Pipeline-owned fields per app entry, keyed by app name. Authored
|
|
6
|
+
* descriptors never carry deployment state — the deploy map resolves local
|
|
7
|
+
* refs to URLs (today extracted verbatim from bos.config.json; tomorrow
|
|
8
|
+
* written back by the deploy pipeline).
|
|
9
|
+
*/
|
|
10
|
+
interface AppDeployEntry {
|
|
11
|
+
app?: Partial<Record<"host" | "ui" | "api" | "auth", PipelineFields>>;
|
|
12
|
+
plugins?: Record<string, PipelineFields>;
|
|
13
|
+
}
|
|
14
|
+
type DeployMap = Record<string, AppDeployEntry>;
|
|
15
|
+
declare const ATTACHMENT_FIELDS: readonly ["name", "proxy", "variables", "secrets", "routes", "shared", "connectSrc", "dependsOn", "version"];
|
|
16
|
+
/** Fields the attachment slots carry beyond the shared attachment set. */
|
|
17
|
+
declare const SLOT_INPUT_FIELDS: readonly ["development", "extends", "integrity"];
|
|
18
|
+
/** Descriptor → authoring-shape `BosConfigInput` (local refs only, no pipeline state). */
|
|
19
|
+
declare function toConfigInput(descriptor: AppDescriptor): BosConfigInput;
|
|
20
|
+
/**
|
|
21
|
+
* Flatten one app against the registry: `extends` inherits the base App's
|
|
22
|
+
* composition, the child's entries win (depth-1 — chains are deferred,
|
|
23
|
+
* wayfinder ticket 08). The consumed `extends` key is dropped from the
|
|
24
|
+
* output; the deploy map injects pipeline state.
|
|
25
|
+
*
|
|
26
|
+
* `extends` accepts a registry name or an imported App descriptor value —
|
|
27
|
+
* an imported parent is an inlined parent: same materialization, no fetch.
|
|
28
|
+
*/
|
|
29
|
+
declare function resolveApp(name: string, registry: AppRegistry, deployMap?: DeployMap, seen?: Set<string>): BosConfigInput;
|
|
30
|
+
/**
|
|
31
|
+
* Dev-time overlay — merged child-wins over a resolved config by the dev
|
|
32
|
+
* runner (ports, local-vs-remote sources, seeding). Overlays are never
|
|
33
|
+
* published: they exist only in `bos.dev.ts` and apply when the environment
|
|
34
|
+
* is development.
|
|
35
|
+
*/
|
|
36
|
+
declare function applyDevOverlay(resolved: BosConfigInput, overlay: Partial<AppDescriptor>): BosConfigInput;
|
|
37
|
+
/** Resolve every app in the registry. */
|
|
38
|
+
declare function resolveApps(registry: AppRegistry, deployMap?: DeployMap): Record<string, BosConfigInput>;
|
|
39
|
+
/**
|
|
40
|
+
* The inverse of `toConfigInput` for the scaffold surface: an authoring-shape
|
|
41
|
+
* config (as personalizeConfig computes it) back into the authored
|
|
42
|
+
* descriptor form a child's `bos.app.ts` embeds. Driven by the same field
|
|
43
|
+
* maps as `toConfigInput` so the two directions cannot drift; pipeline state
|
|
44
|
+
* (production URLs, integrity) is dropped — it is deploy-map territory,
|
|
45
|
+
* never authored.
|
|
46
|
+
*/
|
|
47
|
+
declare function configInputToDescriptor(input: BosConfigInput): AppDescriptor;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { ATTACHMENT_FIELDS, AppDeployEntry, DeployMap, SLOT_INPUT_FIELDS, applyDevOverlay, configInputToDescriptor, resolveApp, resolveApps, toConfigInput };
|
|
50
|
+
//# sourceMappingURL=resolve.d.mts.map
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { mergeBosConfigWithExtends } from "../merge.mjs";
|
|
2
|
+
import { AppDescriptorSchema } from "./schema.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/descriptor/resolve.ts
|
|
5
|
+
function isPlainObject(value) {
|
|
6
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
const devRef = (ref) => ref.path ? `local:${ref.path}` : ref.development;
|
|
9
|
+
function pick(source, keys) {
|
|
10
|
+
const out = {};
|
|
11
|
+
for (const key of keys) if (source[key] !== void 0) out[key] = source[key];
|
|
12
|
+
return out;
|
|
13
|
+
}
|
|
14
|
+
const ATTACHMENT_FIELDS = [
|
|
15
|
+
"name",
|
|
16
|
+
"proxy",
|
|
17
|
+
"variables",
|
|
18
|
+
"secrets",
|
|
19
|
+
"routes",
|
|
20
|
+
"shared",
|
|
21
|
+
"connectSrc",
|
|
22
|
+
"dependsOn",
|
|
23
|
+
"version"
|
|
24
|
+
];
|
|
25
|
+
/** Fields the attachment slots carry beyond the shared attachment set. */
|
|
26
|
+
const SLOT_INPUT_FIELDS = [
|
|
27
|
+
"development",
|
|
28
|
+
"extends",
|
|
29
|
+
"integrity"
|
|
30
|
+
];
|
|
31
|
+
/** Fields a config-entry may carry that map onto an attachment's slot-free set. */
|
|
32
|
+
const ENTRY_ONLY_FIELDS = ["name", "extends"];
|
|
33
|
+
const LOCAL_PREFIX = "local:";
|
|
34
|
+
function stripLocal(development) {
|
|
35
|
+
return development?.startsWith(LOCAL_PREFIX) ? development.slice(6) : void 0;
|
|
36
|
+
}
|
|
37
|
+
function attachmentToEntry(attachment) {
|
|
38
|
+
const development = devRef(attachment);
|
|
39
|
+
return {
|
|
40
|
+
...attachment.extends ? { extends: attachment.extends } : {},
|
|
41
|
+
...development ? { development } : {},
|
|
42
|
+
...pick(attachment, [...ATTACHMENT_FIELDS]),
|
|
43
|
+
...attachment.ui ? { ui: {
|
|
44
|
+
...attachment.ui.name ? { name: attachment.ui.name } : {},
|
|
45
|
+
...attachment.ui.path ? { development: `local:${attachment.ui.path}` } : attachment.ui.development ? { development: attachment.ui.development } : {},
|
|
46
|
+
...attachment.ui.integrity ? { integrity: attachment.ui.integrity } : {},
|
|
47
|
+
...attachment.ui.pin ? { pin: attachment.ui.pin } : {}
|
|
48
|
+
} } : {}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/** Descriptor → authoring-shape `BosConfigInput` (local refs only, no pipeline state). */
|
|
52
|
+
function toConfigInput(descriptor) {
|
|
53
|
+
const input = { ...pick(descriptor, [
|
|
54
|
+
"account",
|
|
55
|
+
"domain",
|
|
56
|
+
"title",
|
|
57
|
+
"description",
|
|
58
|
+
"repository",
|
|
59
|
+
"testnet",
|
|
60
|
+
"staging",
|
|
61
|
+
"ci",
|
|
62
|
+
"cdn",
|
|
63
|
+
"publish"
|
|
64
|
+
]) };
|
|
65
|
+
const app = {};
|
|
66
|
+
if (descriptor.host) {
|
|
67
|
+
const development = devRef(descriptor.host);
|
|
68
|
+
if (development) app.host = {
|
|
69
|
+
development,
|
|
70
|
+
...pick(descriptor.host, ["secrets"])
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (descriptor.api) {
|
|
74
|
+
const development = devRef(descriptor.api);
|
|
75
|
+
if (development) app.api = {
|
|
76
|
+
development,
|
|
77
|
+
...pick(descriptor.api, [
|
|
78
|
+
"proxy",
|
|
79
|
+
"variables",
|
|
80
|
+
"secrets",
|
|
81
|
+
"routes",
|
|
82
|
+
"shared",
|
|
83
|
+
"dependsOn"
|
|
84
|
+
])
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
if (descriptor.ui) {
|
|
88
|
+
const development = devRef(descriptor.ui);
|
|
89
|
+
if (development) app.ui = { development };
|
|
90
|
+
}
|
|
91
|
+
if (descriptor.auth) app.auth = attachmentToEntry(descriptor.auth);
|
|
92
|
+
if (Object.keys(app).length > 0) input.app = app;
|
|
93
|
+
if (descriptor.plugins) {
|
|
94
|
+
const plugins = {};
|
|
95
|
+
for (const [key, attachment] of Object.entries(descriptor.plugins)) {
|
|
96
|
+
const entry = attachmentToEntry(attachment);
|
|
97
|
+
if (entry.name === key) delete entry.name;
|
|
98
|
+
plugins[key] = entry;
|
|
99
|
+
}
|
|
100
|
+
input.plugins = plugins;
|
|
101
|
+
}
|
|
102
|
+
return input;
|
|
103
|
+
}
|
|
104
|
+
function applyPipeline(target, fields) {
|
|
105
|
+
for (const [key, value] of Object.entries(fields)) if (value !== void 0) target[key] = value;
|
|
106
|
+
}
|
|
107
|
+
function applyDeployMap(config, entry) {
|
|
108
|
+
if (!entry) return;
|
|
109
|
+
if (entry.app && isPlainObject(config.app)) for (const [slot, fields] of Object.entries(entry.app)) {
|
|
110
|
+
const target = config.app[slot];
|
|
111
|
+
if (fields && isPlainObject(target)) applyPipeline(target, fields);
|
|
112
|
+
}
|
|
113
|
+
if (entry.plugins && isPlainObject(config.plugins)) for (const [key, fields] of Object.entries(entry.plugins)) {
|
|
114
|
+
const target = config.plugins[key];
|
|
115
|
+
if (fields && isPlainObject(target)) applyPipeline(target, fields);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Flatten one app against the registry: `extends` inherits the base App's
|
|
120
|
+
* composition, the child's entries win (depth-1 — chains are deferred,
|
|
121
|
+
* wayfinder ticket 08). The consumed `extends` key is dropped from the
|
|
122
|
+
* output; the deploy map injects pipeline state.
|
|
123
|
+
*
|
|
124
|
+
* `extends` accepts a registry name or an imported App descriptor value —
|
|
125
|
+
* an imported parent is an inlined parent: same materialization, no fetch.
|
|
126
|
+
*/
|
|
127
|
+
function resolveApp(name, registry, deployMap = {}, seen = /* @__PURE__ */ new Set()) {
|
|
128
|
+
if (seen.has(name)) throw new Error(`Circular extends detected: ${name}`);
|
|
129
|
+
const raw = registry[name];
|
|
130
|
+
if (!raw) throw new Error(`App "${name}" not found in registry`);
|
|
131
|
+
const descriptor = AppDescriptorSchema.parse(raw);
|
|
132
|
+
let parentInput;
|
|
133
|
+
if (descriptor.extends) {
|
|
134
|
+
if (typeof descriptor.extends === "string") {
|
|
135
|
+
const parentRaw = registry[descriptor.extends];
|
|
136
|
+
if (!parentRaw) throw new Error(`extends target "${descriptor.extends}" not found in registry`);
|
|
137
|
+
parentInput = flattenParent(parentRaw);
|
|
138
|
+
} else parentInput = flattenParent(descriptor.extends);
|
|
139
|
+
}
|
|
140
|
+
const childInput = toConfigInput(descriptor);
|
|
141
|
+
const resolved = { ...parentInput ? mergeBosConfigWithExtends(parentInput, childInput) : childInput };
|
|
142
|
+
delete resolved.extends;
|
|
143
|
+
applyDeployMap(resolved, deployMap[name]);
|
|
144
|
+
return resolved;
|
|
145
|
+
}
|
|
146
|
+
function flattenParent(parentRaw) {
|
|
147
|
+
const parentDescriptor = AppDescriptorSchema.parse(parentRaw);
|
|
148
|
+
if (parentDescriptor.extends) {
|
|
149
|
+
const parentName = typeof parentDescriptor.extends === "string" ? parentDescriptor.extends : parentDescriptor.extends.name;
|
|
150
|
+
throw new Error(`extends chains deeper than one level are not supported yet ("${parentDescriptor.name}" extends "${parentName ?? "?"}") — wayfinder ticket 08`);
|
|
151
|
+
}
|
|
152
|
+
return toConfigInput(parentDescriptor);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Dev-time overlay — merged child-wins over a resolved config by the dev
|
|
156
|
+
* runner (ports, local-vs-remote sources, seeding). Overlays are never
|
|
157
|
+
* published: they exist only in `bos.dev.ts` and apply when the environment
|
|
158
|
+
* is development.
|
|
159
|
+
*/
|
|
160
|
+
function applyDevOverlay(resolved, overlay) {
|
|
161
|
+
return mergeBosConfigWithExtends(resolved, toConfigInput(overlay));
|
|
162
|
+
}
|
|
163
|
+
/** Resolve every app in the registry. */
|
|
164
|
+
function resolveApps(registry, deployMap = {}) {
|
|
165
|
+
return Object.fromEntries(Object.keys(registry).map((name) => [name, resolveApp(name, registry, deployMap)]));
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* The inverse of `toConfigInput` for the scaffold surface: an authoring-shape
|
|
169
|
+
* config (as personalizeConfig computes it) back into the authored
|
|
170
|
+
* descriptor form a child's `bos.app.ts` embeds. Driven by the same field
|
|
171
|
+
* maps as `toConfigInput` so the two directions cannot drift; pipeline state
|
|
172
|
+
* (production URLs, integrity) is dropped — it is deploy-map territory,
|
|
173
|
+
* never authored.
|
|
174
|
+
*/
|
|
175
|
+
function configInputToDescriptor(input) {
|
|
176
|
+
const source = input;
|
|
177
|
+
const descriptor = { name: input.domain ?? input.account ?? "child.app" };
|
|
178
|
+
for (const field of [
|
|
179
|
+
"extends",
|
|
180
|
+
"account",
|
|
181
|
+
"domain",
|
|
182
|
+
"title",
|
|
183
|
+
"description",
|
|
184
|
+
"repository",
|
|
185
|
+
"testnet",
|
|
186
|
+
"staging",
|
|
187
|
+
"starter",
|
|
188
|
+
"ci",
|
|
189
|
+
"cdn",
|
|
190
|
+
"publish"
|
|
191
|
+
]) if (source[field] !== void 0) descriptor[field] = source[field];
|
|
192
|
+
const app = input.app ?? {};
|
|
193
|
+
const slot = (key) => {
|
|
194
|
+
const entry = app[key];
|
|
195
|
+
if (!entry?.development) return void 0;
|
|
196
|
+
const out = { path: stripLocal(entry.development) };
|
|
197
|
+
for (const field of ATTACHMENT_FIELDS) {
|
|
198
|
+
if (field === "name") continue;
|
|
199
|
+
if (entry[field] !== void 0) out[field] = entry[field];
|
|
200
|
+
}
|
|
201
|
+
return out;
|
|
202
|
+
};
|
|
203
|
+
for (const key of [
|
|
204
|
+
"host",
|
|
205
|
+
"ui",
|
|
206
|
+
"api"
|
|
207
|
+
]) {
|
|
208
|
+
const value = slot(key);
|
|
209
|
+
if (value) descriptor[key] = value;
|
|
210
|
+
}
|
|
211
|
+
const auth = app.auth;
|
|
212
|
+
if (auth?.development) descriptor.auth = entryToAttachment("auth", auth);
|
|
213
|
+
const plugins = {};
|
|
214
|
+
for (const [key, raw] of Object.entries(input.plugins ?? {})) if (typeof raw === "string") plugins[key] = {
|
|
215
|
+
name: key,
|
|
216
|
+
extends: raw
|
|
217
|
+
};
|
|
218
|
+
else if (raw && typeof raw === "object") plugins[key] = entryToAttachment(key, raw);
|
|
219
|
+
if (Object.keys(plugins).length > 0) descriptor.plugins = plugins;
|
|
220
|
+
return AppDescriptorSchema.parse(descriptor);
|
|
221
|
+
}
|
|
222
|
+
/** Config-entry → authored attachment: name/extends + the shared field map. */
|
|
223
|
+
function entryToAttachment(key, entry) {
|
|
224
|
+
const out = {};
|
|
225
|
+
for (const field of ENTRY_ONLY_FIELDS) {
|
|
226
|
+
const value = entry[field];
|
|
227
|
+
if (value !== void 0) out[field] = field === "name" ? value : value;
|
|
228
|
+
else if (field === "name") out.name = key;
|
|
229
|
+
}
|
|
230
|
+
const development = entry.development;
|
|
231
|
+
const path = stripLocal(development);
|
|
232
|
+
if (path !== void 0) out.path = path;
|
|
233
|
+
for (const field of ATTACHMENT_FIELDS) {
|
|
234
|
+
if (field === "name") continue;
|
|
235
|
+
if (entry[field] !== void 0) out[field] = entry[field];
|
|
236
|
+
}
|
|
237
|
+
const ui = entry.ui;
|
|
238
|
+
if (ui && typeof ui === "object") {
|
|
239
|
+
const uiPath = stripLocal(ui.development);
|
|
240
|
+
out.ui = {
|
|
241
|
+
...typeof ui.name === "string" ? { name: ui.name } : {},
|
|
242
|
+
...uiPath !== void 0 ? { path: uiPath } : {},
|
|
243
|
+
...ui.integrity !== void 0 ? { integrity: ui.integrity } : {},
|
|
244
|
+
...ui.pin !== void 0 ? { pin: ui.pin } : {}
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
return out;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
//#endregion
|
|
251
|
+
export { ATTACHMENT_FIELDS, SLOT_INPUT_FIELDS, applyDevOverlay, configInputToDescriptor, resolveApp, resolveApps, toConfigInput };
|
|
252
|
+
//# sourceMappingURL=resolve.mjs.map
|