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,186 @@
|
|
|
1
|
+
const require_run = require('./utils/run.cjs');
|
|
2
|
+
const require_theme = require('./utils/theme.cjs');
|
|
3
|
+
let node_fs = require("node:fs");
|
|
4
|
+
let node_path = require("node:path");
|
|
5
|
+
|
|
6
|
+
//#region src/image-deploy.ts
|
|
7
|
+
/**
|
|
8
|
+
* Image reference resolution precedence (ADR 0021): `ci.image` in
|
|
9
|
+
* bos.config.json → `BOS_IMAGE` env → derived from `repository`.
|
|
10
|
+
*/
|
|
11
|
+
function resolveImageRef(input) {
|
|
12
|
+
const envImage = input.env?.BOS_IMAGE;
|
|
13
|
+
if (input.ciImage) return {
|
|
14
|
+
image: input.ciImage,
|
|
15
|
+
source: "ci"
|
|
16
|
+
};
|
|
17
|
+
if (envImage) return {
|
|
18
|
+
image: envImage,
|
|
19
|
+
source: "env"
|
|
20
|
+
};
|
|
21
|
+
const repo = input.repository?.replace(/^https?:\/\/(www\.)?github\.com\//i, "").replace(/\.git$/i, "").replace(/\/+$/, "").toLowerCase();
|
|
22
|
+
if (!repo?.includes("/") || repo.split("/").length !== 2) return void 0;
|
|
23
|
+
return {
|
|
24
|
+
image: `ghcr.io/${repo}`,
|
|
25
|
+
source: "repository"
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
async function hasDocker() {
|
|
29
|
+
try {
|
|
30
|
+
return (await require_run.run("docker", [
|
|
31
|
+
"info",
|
|
32
|
+
"--format",
|
|
33
|
+
"{{.ServerVersion}}"
|
|
34
|
+
], { capture: true }))?.exitCode === 0;
|
|
35
|
+
} catch {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function parseDigest(pushOutput) {
|
|
40
|
+
return pushOutput.match(/digest:\s*(sha256:[a-f0-9]+)/i)?.[1];
|
|
41
|
+
}
|
|
42
|
+
const SEMVER_PATTERN = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/;
|
|
43
|
+
/**
|
|
44
|
+
* The runtime framework version baked into the image is the workspace source's
|
|
45
|
+
* `everything-dev` package version — the image builds from `configDir`, so that
|
|
46
|
+
* file is the truth. Missing (child repos without the workspace) → undefined.
|
|
47
|
+
*/
|
|
48
|
+
function readFrameworkVersion(configDir) {
|
|
49
|
+
try {
|
|
50
|
+
const raw = (0, node_fs.readFileSync)((0, node_path.join)(configDir, "packages", "everything-dev", "package.json"), "utf-8");
|
|
51
|
+
const pkg = JSON.parse(raw);
|
|
52
|
+
return typeof pkg.version === "string" && SEMVER_PATTERN.test(pkg.version) ? pkg.version : void 0;
|
|
53
|
+
} catch {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Tag scheme (ADR 0021): `sha-<short>` always; the exact `v<version>` tag; a
|
|
59
|
+
* floating major tag (`v2`) on stable releases only. `latest` is held during
|
|
60
|
+
* prereleases (npm's `rc` dist-tag analog) so existing deployments pinned to
|
|
61
|
+
* `:latest` keep serving the last stable image.
|
|
62
|
+
*/
|
|
63
|
+
function computeImageTags(input) {
|
|
64
|
+
const tags = [`sha-${input.shortSha}`];
|
|
65
|
+
const match = input.version?.trim().match(SEMVER_PATTERN);
|
|
66
|
+
if (!match) return {
|
|
67
|
+
tags,
|
|
68
|
+
pushLatest: true
|
|
69
|
+
};
|
|
70
|
+
const [, major, minor, patch, prerelease] = match;
|
|
71
|
+
const exact = prerelease ? `v${major}.${minor}.${patch}-${prerelease}` : `v${major}.${minor}.${patch}`;
|
|
72
|
+
if (prerelease) return {
|
|
73
|
+
tags: [...tags, exact],
|
|
74
|
+
pushLatest: false,
|
|
75
|
+
latestHoldReason: `${exact} is a prerelease — :latest still serves the last stable image`
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
tags: [
|
|
79
|
+
...tags,
|
|
80
|
+
exact,
|
|
81
|
+
`v${major}`
|
|
82
|
+
],
|
|
83
|
+
pushLatest: true
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Image leg (ADR 0021): build the runtime stage, tag `sha-<short>` + version
|
|
88
|
+
* tags, push them, capture the digest, and push `:latest` unless the version
|
|
89
|
+
* is a prerelease. Callers skip the leg with a notice when no image is
|
|
90
|
+
* configured (child repos get build+upload+publish only).
|
|
91
|
+
*/
|
|
92
|
+
async function buildAndPushImage(input) {
|
|
93
|
+
const shaResult = await require_run.run("git", [
|
|
94
|
+
"rev-parse",
|
|
95
|
+
"--short=7",
|
|
96
|
+
"HEAD"
|
|
97
|
+
], {
|
|
98
|
+
cwd: input.configDir,
|
|
99
|
+
capture: true
|
|
100
|
+
});
|
|
101
|
+
const shortSha = shaResult?.stdout.trim();
|
|
102
|
+
if (!shaResult || shaResult.exitCode !== 0 || !shortSha) {
|
|
103
|
+
const detail = shaResult?.stderr.trim();
|
|
104
|
+
throw new Error(`Failed to resolve the current git SHA in ${input.configDir} (exit code ${shaResult?.exitCode ?? "unknown"}${detail ? `: ${detail}` : ""})`);
|
|
105
|
+
}
|
|
106
|
+
const { tags, pushLatest, latestHoldReason } = computeImageTags({
|
|
107
|
+
shortSha,
|
|
108
|
+
version: readFrameworkVersion(input.configDir)
|
|
109
|
+
});
|
|
110
|
+
const refs = tags.map((tag) => `${input.image}:${tag}`);
|
|
111
|
+
const latestRef = `${input.image}:latest`;
|
|
112
|
+
const buildRefs = pushLatest ? [...refs, latestRef] : refs;
|
|
113
|
+
console.log(` Building runtime image ${require_theme.colors.cyan(buildRefs.join(", "))}${pushLatest ? "" : require_theme.colors.yellow(" (latest held)")}`);
|
|
114
|
+
await require_run.run("docker", [
|
|
115
|
+
"build",
|
|
116
|
+
"--target",
|
|
117
|
+
"runtime",
|
|
118
|
+
...buildRefs.flatMap((ref) => ["-t", ref]),
|
|
119
|
+
"."
|
|
120
|
+
], { cwd: input.configDir });
|
|
121
|
+
console.log(` Pushing ${require_theme.colors.cyan(refs.join(", "))}...`);
|
|
122
|
+
let digest;
|
|
123
|
+
for (const ref of refs) {
|
|
124
|
+
const push = await require_run.run("docker", ["push", ref], {
|
|
125
|
+
cwd: input.configDir,
|
|
126
|
+
capture: true
|
|
127
|
+
});
|
|
128
|
+
if (!push || push.exitCode !== 0) throw new Error(`docker push ${ref} failed with exit code ${push?.exitCode ?? "unknown"}`);
|
|
129
|
+
digest ??= parseDigest(push.stdout);
|
|
130
|
+
if (input.verbose && push.stdout.trim()) console.log(require_theme.colors.dim(push.stdout.trim()));
|
|
131
|
+
}
|
|
132
|
+
let latestPushed = false;
|
|
133
|
+
if (pushLatest) {
|
|
134
|
+
const pushLatestRef = await require_run.run("docker", ["push", latestRef], {
|
|
135
|
+
cwd: input.configDir,
|
|
136
|
+
capture: true
|
|
137
|
+
});
|
|
138
|
+
if (!pushLatestRef || pushLatestRef.exitCode !== 0) throw new Error(`docker push ${latestRef} failed with exit code ${pushLatestRef?.exitCode ?? "unknown"}`);
|
|
139
|
+
digest ??= parseDigest(pushLatestRef.stdout);
|
|
140
|
+
if (input.verbose && pushLatestRef.stdout.trim()) console.log(require_theme.colors.dim(pushLatestRef.stdout.trim()));
|
|
141
|
+
latestPushed = true;
|
|
142
|
+
} else console.log(require_theme.colors.yellow(` latest held: ${latestHoldReason}`));
|
|
143
|
+
if (!digest) console.log(require_theme.colors.yellow(" Could not capture the image digest from push output"));
|
|
144
|
+
return {
|
|
145
|
+
image: input.image,
|
|
146
|
+
tag: tags[0],
|
|
147
|
+
tags,
|
|
148
|
+
latestPushed,
|
|
149
|
+
digest
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Railway leg (ADR 0021): pull-only deploy of the pushed image digest — a
|
|
154
|
+
* thin `FROM image@digest` Dockerfile pins the digest so Railway never
|
|
155
|
+
* rebuilds; `RAILWAY_DOCKERFILE_PATH` points at the generated file.
|
|
156
|
+
*/
|
|
157
|
+
async function deployImageToRailway(input) {
|
|
158
|
+
const deployDir = (0, node_path.join)(input.configDir, ".bos", "deploy");
|
|
159
|
+
(0, node_fs.mkdirSync)(deployDir, { recursive: true });
|
|
160
|
+
const dockerfilePath = (0, node_path.join)(deployDir, "Dockerfile");
|
|
161
|
+
(0, node_fs.writeFileSync)(dockerfilePath, `FROM ${input.image}@${input.digest}\n`);
|
|
162
|
+
console.log(` Deploying to Railway service ${require_theme.colors.cyan(input.service)} (pull-only)...`);
|
|
163
|
+
const result = await require_run.run("railway", [
|
|
164
|
+
"up",
|
|
165
|
+
"--service",
|
|
166
|
+
input.service,
|
|
167
|
+
"--ci"
|
|
168
|
+
], {
|
|
169
|
+
cwd: input.configDir,
|
|
170
|
+
capture: true,
|
|
171
|
+
env: { RAILWAY_DOCKERFILE_PATH: ".bos/deploy/Dockerfile" }
|
|
172
|
+
});
|
|
173
|
+
if (result?.stdout) {
|
|
174
|
+
for (const line of result.stdout.split("\n")) if (line.trim()) console.log(` ${require_theme.colors.dim(line.trim())}`);
|
|
175
|
+
}
|
|
176
|
+
if (!result || result.exitCode !== 0) throw new Error(result?.stderr.trim() ? `railway up failed: ${result.stderr.trim().split("\n").slice(-3).join(" ")}` : `railway up failed with exit code ${result?.exitCode ?? "unknown"}`);
|
|
177
|
+
console.log(require_theme.colors.green(` ${require_theme.icons.ok} Railway deploy complete`));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
//#endregion
|
|
181
|
+
exports.buildAndPushImage = buildAndPushImage;
|
|
182
|
+
exports.computeImageTags = computeImageTags;
|
|
183
|
+
exports.deployImageToRailway = deployImageToRailway;
|
|
184
|
+
exports.hasDocker = hasDocker;
|
|
185
|
+
exports.resolveImageRef = resolveImageRef;
|
|
186
|
+
//# sourceMappingURL=image-deploy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-deploy.cjs","names":["run","readFileSync","join","colors","icons"],"sources":["../src/image-deploy.ts"],"sourcesContent":["import { mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { run } from \"./utils/run\";\nimport { colors, icons } from \"./utils/theme\";\n\nexport interface ResolvedImageRef {\n image: string;\n source: \"ci\" | \"env\" | \"repository\";\n}\n\n/**\n * Image reference resolution precedence (ADR 0021): `ci.image` in\n * bos.config.json → `BOS_IMAGE` env → derived from `repository`.\n */\nexport function resolveImageRef(input: {\n ciImage?: string;\n repository?: string;\n env?: Record<string, string | undefined>;\n}): ResolvedImageRef | undefined {\n const envImage = input.env?.BOS_IMAGE;\n if (input.ciImage) return { image: input.ciImage, source: \"ci\" };\n if (envImage) return { image: envImage, source: \"env\" };\n\n const repo = input.repository\n ?.replace(/^https?:\\/\\/(www\\.)?github\\.com\\//i, \"\")\n .replace(/\\.git$/i, \"\")\n .replace(/\\/+$/, \"\")\n .toLowerCase();\n if (!repo?.includes(\"/\") || repo.split(\"/\").length !== 2) return undefined;\n return { image: `ghcr.io/${repo}`, source: \"repository\" };\n}\n\nexport async function hasDocker(): Promise<boolean> {\n try {\n const result = await run(\"docker\", [\"info\", \"--format\", \"{{.ServerVersion}}\"], {\n capture: true,\n });\n return result?.exitCode === 0;\n } catch {\n return false;\n }\n}\n\nfunction parseDigest(pushOutput: string): string | undefined {\n const match = pushOutput.match(/digest:\\s*(sha256:[a-f0-9]+)/i);\n return match?.[1];\n}\n\nconst SEMVER_PATTERN = /^(\\d+)\\.(\\d+)\\.(\\d+)(?:-([0-9A-Za-z.-]+))?$/;\n\n/**\n * The runtime framework version baked into the image is the workspace source's\n * `everything-dev` package version — the image builds from `configDir`, so that\n * file is the truth. Missing (child repos without the workspace) → undefined.\n */\nfunction readFrameworkVersion(configDir: string): string | undefined {\n try {\n const raw = readFileSync(\n join(configDir, \"packages\", \"everything-dev\", \"package.json\"),\n \"utf-8\",\n );\n const pkg = JSON.parse(raw) as { version?: unknown };\n return typeof pkg.version === \"string\" && SEMVER_PATTERN.test(pkg.version)\n ? pkg.version\n : undefined;\n } catch {\n return undefined;\n }\n}\n\nexport interface ImageTags {\n /** Exact refs to build and push, in push order (latest excluded). */\n tags: string[];\n /** Push `:latest` after the pinned tags. */\n pushLatest: boolean;\n /** Human-readable reason when `latest` is held. */\n latestHoldReason?: string;\n}\n\n/**\n * Tag scheme (ADR 0021): `sha-<short>` always; the exact `v<version>` tag; a\n * floating major tag (`v2`) on stable releases only. `latest` is held during\n * prereleases (npm's `rc` dist-tag analog) so existing deployments pinned to\n * `:latest` keep serving the last stable image.\n */\nexport function computeImageTags(input: { shortSha: string; version?: string }): ImageTags {\n const tags = [`sha-${input.shortSha}`];\n const match = input.version?.trim().match(SEMVER_PATTERN);\n if (!match) {\n return { tags, pushLatest: true };\n }\n const [, major, minor, patch, prerelease] = match;\n const exact = prerelease\n ? `v${major}.${minor}.${patch}-${prerelease}`\n : `v${major}.${minor}.${patch}`;\n if (prerelease) {\n return {\n tags: [...tags, exact],\n pushLatest: false,\n latestHoldReason: `${exact} is a prerelease — :latest still serves the last stable image`,\n };\n }\n return { tags: [...tags, exact, `v${major}`], pushLatest: true };\n}\n\nexport interface ImageDeployResult {\n image: string;\n /** Primary pinned tag (the sha tag). */\n tag: string;\n /** All tags pushed, including the primary. */\n tags: string[];\n latestPushed: boolean;\n digest?: string;\n}\n\n/**\n * Image leg (ADR 0021): build the runtime stage, tag `sha-<short>` + version\n * tags, push them, capture the digest, and push `:latest` unless the version\n * is a prerelease. Callers skip the leg with a notice when no image is\n * configured (child repos get build+upload+publish only).\n */\nexport async function buildAndPushImage(input: {\n image: string;\n configDir: string;\n verbose?: boolean;\n}): Promise<ImageDeployResult> {\n const shaResult = await run(\"git\", [\"rev-parse\", \"--short=7\", \"HEAD\"], {\n cwd: input.configDir,\n capture: true,\n });\n const shortSha = shaResult?.stdout.trim();\n if (!shaResult || shaResult.exitCode !== 0 || !shortSha) {\n const detail = shaResult?.stderr.trim();\n throw new Error(\n `Failed to resolve the current git SHA in ${input.configDir} (exit code ${shaResult?.exitCode ?? \"unknown\"}${detail ? `: ${detail}` : \"\"})`,\n );\n }\n\n const version = readFrameworkVersion(input.configDir);\n const { tags, pushLatest, latestHoldReason } = computeImageTags({ shortSha, version });\n const refs = tags.map((tag) => `${input.image}:${tag}`);\n const latestRef = `${input.image}:latest`;\n const buildRefs = pushLatest ? [...refs, latestRef] : refs;\n\n console.log(\n ` Building runtime image ${colors.cyan(buildRefs.join(\", \"))}${pushLatest ? \"\" : colors.yellow(\" (latest held)\")}`,\n );\n await run(\n \"docker\",\n [\"build\", \"--target\", \"runtime\", ...buildRefs.flatMap((ref) => [\"-t\", ref]), \".\"],\n { cwd: input.configDir },\n );\n\n console.log(` Pushing ${colors.cyan(refs.join(\", \"))}...`);\n let digest: string | undefined;\n for (const ref of refs) {\n const push = await run(\"docker\", [\"push\", ref], {\n cwd: input.configDir,\n capture: true,\n });\n if (!push || push.exitCode !== 0) {\n throw new Error(`docker push ${ref} failed with exit code ${push?.exitCode ?? \"unknown\"}`);\n }\n digest ??= parseDigest(push.stdout);\n if (input.verbose && push.stdout.trim()) {\n console.log(colors.dim(push.stdout.trim()));\n }\n }\n\n let latestPushed = false;\n if (pushLatest) {\n const pushLatestRef = await run(\"docker\", [\"push\", latestRef], {\n cwd: input.configDir,\n capture: true,\n });\n if (!pushLatestRef || pushLatestRef.exitCode !== 0) {\n throw new Error(\n `docker push ${latestRef} failed with exit code ${pushLatestRef?.exitCode ?? \"unknown\"}`,\n );\n }\n digest ??= parseDigest(pushLatestRef.stdout);\n if (input.verbose && pushLatestRef.stdout.trim()) {\n console.log(colors.dim(pushLatestRef.stdout.trim()));\n }\n latestPushed = true;\n } else {\n console.log(colors.yellow(` latest held: ${latestHoldReason}`));\n }\n\n if (!digest) {\n console.log(colors.yellow(\" Could not capture the image digest from push output\"));\n }\n\n return { image: input.image, tag: tags[0], tags, latestPushed, digest };\n}\n\n/**\n * Railway leg (ADR 0021): pull-only deploy of the pushed image digest — a\n * thin `FROM image@digest` Dockerfile pins the digest so Railway never\n * rebuilds; `RAILWAY_DOCKERFILE_PATH` points at the generated file.\n */\nexport async function deployImageToRailway(input: {\n image: string;\n digest: string;\n service: string;\n configDir: string;\n}): Promise<void> {\n const deployDir = join(input.configDir, \".bos\", \"deploy\");\n mkdirSync(deployDir, { recursive: true });\n const dockerfilePath = join(deployDir, \"Dockerfile\");\n writeFileSync(dockerfilePath, `FROM ${input.image}@${input.digest}\\n`);\n\n console.log(` Deploying to Railway service ${colors.cyan(input.service)} (pull-only)...`);\n const result = await run(\"railway\", [\"up\", \"--service\", input.service, \"--ci\"], {\n cwd: input.configDir,\n capture: true,\n env: { RAILWAY_DOCKERFILE_PATH: \".bos/deploy/Dockerfile\" },\n });\n if (result?.stdout) {\n for (const line of result.stdout.split(\"\\n\")) {\n if (line.trim()) console.log(` ${colors.dim(line.trim())}`);\n }\n }\n if (!result || result.exitCode !== 0) {\n throw new Error(\n result?.stderr.trim()\n ? `railway up failed: ${result.stderr.trim().split(\"\\n\").slice(-3).join(\" \")}`\n : `railway up failed with exit code ${result?.exitCode ?? \"unknown\"}`,\n );\n }\n console.log(colors.green(` ${icons.ok} Railway deploy complete`));\n}\n"],"mappings":";;;;;;;;;;AAcA,SAAgB,gBAAgB,OAIC;CAC/B,MAAM,WAAW,MAAM,KAAK;CAC5B,IAAI,MAAM,SAAS,OAAO;EAAE,OAAO,MAAM;EAAS,QAAQ;CAAK;CAC/D,IAAI,UAAU,OAAO;EAAE,OAAO;EAAU,QAAQ;CAAM;CAEtD,MAAM,OAAO,MAAM,YACf,QAAQ,sCAAsC,EAAE,CAAC,CAClD,QAAQ,WAAW,EAAE,CAAC,CACtB,QAAQ,QAAQ,EAAE,CAAC,CACnB,YAAY;CACf,IAAI,CAAC,MAAM,SAAS,GAAG,KAAK,KAAK,MAAM,GAAG,CAAC,CAAC,WAAW,GAAG,OAAO;CACjE,OAAO;EAAE,OAAO,WAAW;EAAQ,QAAQ;CAAa;AAC1D;AAEA,eAAsB,YAA8B;CAClD,IAAI;EAIF,QAAO,MAHcA,gBAAI,UAAU;GAAC;GAAQ;GAAY;EAAoB,GAAG,EAC7E,SAAS,KACX,CAAC,EACY,EAAE,aAAa;CAC9B,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAS,YAAY,YAAwC;CAE3D,OADc,WAAW,MAAM,+BACpB,CAAC,GAAG;AACjB;AAEA,MAAM,iBAAiB;;;;;;AAOvB,SAAS,qBAAqB,WAAuC;CACnE,IAAI;EACF,MAAM,UAAMC,0BACVC,gBAAK,WAAW,YAAY,kBAAkB,cAAc,GAC5D,OACF;EACA,MAAM,MAAM,KAAK,MAAM,GAAG;EAC1B,OAAO,OAAO,IAAI,YAAY,YAAY,eAAe,KAAK,IAAI,OAAO,IACrE,IAAI,UACJ;CACN,QAAQ;EACN;CACF;AACF;;;;;;;AAiBA,SAAgB,iBAAiB,OAA0D;CACzF,MAAM,OAAO,CAAC,OAAO,MAAM,UAAU;CACrC,MAAM,QAAQ,MAAM,SAAS,KAAK,CAAC,CAAC,MAA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AAE,WAAW,KAAK,CAAC;CACxC,MAAM,qBAAiBA,gBAAK,WAAW,YAAY;CACnD,2BAAc,gBAAgB,QAAQ,MAAM,MAAM,GAAG,MAAM,OAAO,GAAG;CAErE,QAAQ,IAAI,kCAAkCC,qBAAO,KAAK,MAAM,OAAO,EAAE,gBAAgB;CACzF,MAAM,SAAS,MAAMH,gBAAI,WAAW;EAAC;EAAM;EAAa,MAAM;EAAS;CAAM,GAAG;EAC9E,KAAK,MAAM;EACX,SAAS;EACT,KAAK,EAAE,yBAAyB,yBAAyB;CAC3D,CAAC;CACD,IAAI,QAAQ,QACV;OAAK,MAAM,QAAQ,OAAO,OAAO,MAAM,IAAI,GACzC,IAAI,KAAK,KAAK,GAAG,QAAQ,IAAI,KAAKG,qBAAO,IAAI,KAAK,KAAK,CAAC,GAAG;CAC7D;CAEF,IAAI,CAAC,UAAU,OAAO,aAAa,GACjC,MAAM,IAAI,MACR,QAAQ,OAAO,KAAK,IAChB,sBAAsB,OAAO,OAAO,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,GAAG,MACzE,oCAAoC,QAAQ,YAAY,WAC9D;CAEF,QAAQ,IAAIA,qBAAO,MAAM,KAAKC,oBAAM,GAAG,yBAAyB,CAAC;AACnE"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { run } from "./utils/run.mjs";
|
|
2
|
+
import { colors, icons } from "./utils/theme.mjs";
|
|
3
|
+
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
|
|
6
|
+
//#region src/image-deploy.ts
|
|
7
|
+
/**
|
|
8
|
+
* Image reference resolution precedence (ADR 0021): `ci.image` in
|
|
9
|
+
* bos.config.json → `BOS_IMAGE` env → derived from `repository`.
|
|
10
|
+
*/
|
|
11
|
+
function resolveImageRef(input) {
|
|
12
|
+
const envImage = input.env?.BOS_IMAGE;
|
|
13
|
+
if (input.ciImage) return {
|
|
14
|
+
image: input.ciImage,
|
|
15
|
+
source: "ci"
|
|
16
|
+
};
|
|
17
|
+
if (envImage) return {
|
|
18
|
+
image: envImage,
|
|
19
|
+
source: "env"
|
|
20
|
+
};
|
|
21
|
+
const repo = input.repository?.replace(/^https?:\/\/(www\.)?github\.com\//i, "").replace(/\.git$/i, "").replace(/\/+$/, "").toLowerCase();
|
|
22
|
+
if (!repo?.includes("/") || repo.split("/").length !== 2) return void 0;
|
|
23
|
+
return {
|
|
24
|
+
image: `ghcr.io/${repo}`,
|
|
25
|
+
source: "repository"
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
async function hasDocker() {
|
|
29
|
+
try {
|
|
30
|
+
return (await run("docker", [
|
|
31
|
+
"info",
|
|
32
|
+
"--format",
|
|
33
|
+
"{{.ServerVersion}}"
|
|
34
|
+
], { capture: true }))?.exitCode === 0;
|
|
35
|
+
} catch {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function parseDigest(pushOutput) {
|
|
40
|
+
return pushOutput.match(/digest:\s*(sha256:[a-f0-9]+)/i)?.[1];
|
|
41
|
+
}
|
|
42
|
+
const SEMVER_PATTERN = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/;
|
|
43
|
+
/**
|
|
44
|
+
* The runtime framework version baked into the image is the workspace source's
|
|
45
|
+
* `everything-dev` package version — the image builds from `configDir`, so that
|
|
46
|
+
* file is the truth. Missing (child repos without the workspace) → undefined.
|
|
47
|
+
*/
|
|
48
|
+
function readFrameworkVersion(configDir) {
|
|
49
|
+
try {
|
|
50
|
+
const raw = readFileSync(join(configDir, "packages", "everything-dev", "package.json"), "utf-8");
|
|
51
|
+
const pkg = JSON.parse(raw);
|
|
52
|
+
return typeof pkg.version === "string" && SEMVER_PATTERN.test(pkg.version) ? pkg.version : void 0;
|
|
53
|
+
} catch {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Tag scheme (ADR 0021): `sha-<short>` always; the exact `v<version>` tag; a
|
|
59
|
+
* floating major tag (`v2`) on stable releases only. `latest` is held during
|
|
60
|
+
* prereleases (npm's `rc` dist-tag analog) so existing deployments pinned to
|
|
61
|
+
* `:latest` keep serving the last stable image.
|
|
62
|
+
*/
|
|
63
|
+
function computeImageTags(input) {
|
|
64
|
+
const tags = [`sha-${input.shortSha}`];
|
|
65
|
+
const match = input.version?.trim().match(SEMVER_PATTERN);
|
|
66
|
+
if (!match) return {
|
|
67
|
+
tags,
|
|
68
|
+
pushLatest: true
|
|
69
|
+
};
|
|
70
|
+
const [, major, minor, patch, prerelease] = match;
|
|
71
|
+
const exact = prerelease ? `v${major}.${minor}.${patch}-${prerelease}` : `v${major}.${minor}.${patch}`;
|
|
72
|
+
if (prerelease) return {
|
|
73
|
+
tags: [...tags, exact],
|
|
74
|
+
pushLatest: false,
|
|
75
|
+
latestHoldReason: `${exact} is a prerelease — :latest still serves the last stable image`
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
tags: [
|
|
79
|
+
...tags,
|
|
80
|
+
exact,
|
|
81
|
+
`v${major}`
|
|
82
|
+
],
|
|
83
|
+
pushLatest: true
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Image leg (ADR 0021): build the runtime stage, tag `sha-<short>` + version
|
|
88
|
+
* tags, push them, capture the digest, and push `:latest` unless the version
|
|
89
|
+
* is a prerelease. Callers skip the leg with a notice when no image is
|
|
90
|
+
* configured (child repos get build+upload+publish only).
|
|
91
|
+
*/
|
|
92
|
+
async function buildAndPushImage(input) {
|
|
93
|
+
const shaResult = await run("git", [
|
|
94
|
+
"rev-parse",
|
|
95
|
+
"--short=7",
|
|
96
|
+
"HEAD"
|
|
97
|
+
], {
|
|
98
|
+
cwd: input.configDir,
|
|
99
|
+
capture: true
|
|
100
|
+
});
|
|
101
|
+
const shortSha = shaResult?.stdout.trim();
|
|
102
|
+
if (!shaResult || shaResult.exitCode !== 0 || !shortSha) {
|
|
103
|
+
const detail = shaResult?.stderr.trim();
|
|
104
|
+
throw new Error(`Failed to resolve the current git SHA in ${input.configDir} (exit code ${shaResult?.exitCode ?? "unknown"}${detail ? `: ${detail}` : ""})`);
|
|
105
|
+
}
|
|
106
|
+
const { tags, pushLatest, latestHoldReason } = computeImageTags({
|
|
107
|
+
shortSha,
|
|
108
|
+
version: readFrameworkVersion(input.configDir)
|
|
109
|
+
});
|
|
110
|
+
const refs = tags.map((tag) => `${input.image}:${tag}`);
|
|
111
|
+
const latestRef = `${input.image}:latest`;
|
|
112
|
+
const buildRefs = pushLatest ? [...refs, latestRef] : refs;
|
|
113
|
+
console.log(` Building runtime image ${colors.cyan(buildRefs.join(", "))}${pushLatest ? "" : colors.yellow(" (latest held)")}`);
|
|
114
|
+
await run("docker", [
|
|
115
|
+
"build",
|
|
116
|
+
"--target",
|
|
117
|
+
"runtime",
|
|
118
|
+
...buildRefs.flatMap((ref) => ["-t", ref]),
|
|
119
|
+
"."
|
|
120
|
+
], { cwd: input.configDir });
|
|
121
|
+
console.log(` Pushing ${colors.cyan(refs.join(", "))}...`);
|
|
122
|
+
let digest;
|
|
123
|
+
for (const ref of refs) {
|
|
124
|
+
const push = await run("docker", ["push", ref], {
|
|
125
|
+
cwd: input.configDir,
|
|
126
|
+
capture: true
|
|
127
|
+
});
|
|
128
|
+
if (!push || push.exitCode !== 0) throw new Error(`docker push ${ref} failed with exit code ${push?.exitCode ?? "unknown"}`);
|
|
129
|
+
digest ??= parseDigest(push.stdout);
|
|
130
|
+
if (input.verbose && push.stdout.trim()) console.log(colors.dim(push.stdout.trim()));
|
|
131
|
+
}
|
|
132
|
+
let latestPushed = false;
|
|
133
|
+
if (pushLatest) {
|
|
134
|
+
const pushLatestRef = await run("docker", ["push", latestRef], {
|
|
135
|
+
cwd: input.configDir,
|
|
136
|
+
capture: true
|
|
137
|
+
});
|
|
138
|
+
if (!pushLatestRef || pushLatestRef.exitCode !== 0) throw new Error(`docker push ${latestRef} failed with exit code ${pushLatestRef?.exitCode ?? "unknown"}`);
|
|
139
|
+
digest ??= parseDigest(pushLatestRef.stdout);
|
|
140
|
+
if (input.verbose && pushLatestRef.stdout.trim()) console.log(colors.dim(pushLatestRef.stdout.trim()));
|
|
141
|
+
latestPushed = true;
|
|
142
|
+
} else console.log(colors.yellow(` latest held: ${latestHoldReason}`));
|
|
143
|
+
if (!digest) console.log(colors.yellow(" Could not capture the image digest from push output"));
|
|
144
|
+
return {
|
|
145
|
+
image: input.image,
|
|
146
|
+
tag: tags[0],
|
|
147
|
+
tags,
|
|
148
|
+
latestPushed,
|
|
149
|
+
digest
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Railway leg (ADR 0021): pull-only deploy of the pushed image digest — a
|
|
154
|
+
* thin `FROM image@digest` Dockerfile pins the digest so Railway never
|
|
155
|
+
* rebuilds; `RAILWAY_DOCKERFILE_PATH` points at the generated file.
|
|
156
|
+
*/
|
|
157
|
+
async function deployImageToRailway(input) {
|
|
158
|
+
const deployDir = join(input.configDir, ".bos", "deploy");
|
|
159
|
+
mkdirSync(deployDir, { recursive: true });
|
|
160
|
+
const dockerfilePath = join(deployDir, "Dockerfile");
|
|
161
|
+
writeFileSync(dockerfilePath, `FROM ${input.image}@${input.digest}\n`);
|
|
162
|
+
console.log(` Deploying to Railway service ${colors.cyan(input.service)} (pull-only)...`);
|
|
163
|
+
const result = await run("railway", [
|
|
164
|
+
"up",
|
|
165
|
+
"--service",
|
|
166
|
+
input.service,
|
|
167
|
+
"--ci"
|
|
168
|
+
], {
|
|
169
|
+
cwd: input.configDir,
|
|
170
|
+
capture: true,
|
|
171
|
+
env: { RAILWAY_DOCKERFILE_PATH: ".bos/deploy/Dockerfile" }
|
|
172
|
+
});
|
|
173
|
+
if (result?.stdout) {
|
|
174
|
+
for (const line of result.stdout.split("\n")) if (line.trim()) console.log(` ${colors.dim(line.trim())}`);
|
|
175
|
+
}
|
|
176
|
+
if (!result || result.exitCode !== 0) throw new Error(result?.stderr.trim() ? `railway up failed: ${result.stderr.trim().split("\n").slice(-3).join(" ")}` : `railway up failed with exit code ${result?.exitCode ?? "unknown"}`);
|
|
177
|
+
console.log(colors.green(` ${icons.ok} Railway deploy complete`));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
//#endregion
|
|
181
|
+
export { buildAndPushImage, computeImageTags, deployImageToRailway, hasDocker, resolveImageRef };
|
|
182
|
+
//# sourceMappingURL=image-deploy.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-deploy.mjs","names":[],"sources":["../src/image-deploy.ts"],"sourcesContent":["import { mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { run } from \"./utils/run\";\nimport { colors, icons } from \"./utils/theme\";\n\nexport interface ResolvedImageRef {\n image: string;\n source: \"ci\" | \"env\" | \"repository\";\n}\n\n/**\n * Image reference resolution precedence (ADR 0021): `ci.image` in\n * bos.config.json → `BOS_IMAGE` env → derived from `repository`.\n */\nexport function resolveImageRef(input: {\n ciImage?: string;\n repository?: string;\n env?: Record<string, string | undefined>;\n}): ResolvedImageRef | undefined {\n const envImage = input.env?.BOS_IMAGE;\n if (input.ciImage) return { image: input.ciImage, source: \"ci\" };\n if (envImage) return { image: envImage, source: \"env\" };\n\n const repo = input.repository\n ?.replace(/^https?:\\/\\/(www\\.)?github\\.com\\//i, \"\")\n .replace(/\\.git$/i, \"\")\n .replace(/\\/+$/, \"\")\n .toLowerCase();\n if (!repo?.includes(\"/\") || repo.split(\"/\").length !== 2) return undefined;\n return { image: `ghcr.io/${repo}`, source: \"repository\" };\n}\n\nexport async function hasDocker(): Promise<boolean> {\n try {\n const result = await run(\"docker\", [\"info\", \"--format\", \"{{.ServerVersion}}\"], {\n capture: true,\n });\n return result?.exitCode === 0;\n } catch {\n return false;\n }\n}\n\nfunction parseDigest(pushOutput: string): string | undefined {\n const match = pushOutput.match(/digest:\\s*(sha256:[a-f0-9]+)/i);\n return match?.[1];\n}\n\nconst SEMVER_PATTERN = /^(\\d+)\\.(\\d+)\\.(\\d+)(?:-([0-9A-Za-z.-]+))?$/;\n\n/**\n * The runtime framework version baked into the image is the workspace source's\n * `everything-dev` package version — the image builds from `configDir`, so that\n * file is the truth. Missing (child repos without the workspace) → undefined.\n */\nfunction readFrameworkVersion(configDir: string): string | undefined {\n try {\n const raw = readFileSync(\n join(configDir, \"packages\", \"everything-dev\", \"package.json\"),\n \"utf-8\",\n );\n const pkg = JSON.parse(raw) as { version?: unknown };\n return typeof pkg.version === \"string\" && SEMVER_PATTERN.test(pkg.version)\n ? pkg.version\n : undefined;\n } catch {\n return undefined;\n }\n}\n\nexport interface ImageTags {\n /** Exact refs to build and push, in push order (latest excluded). */\n tags: string[];\n /** Push `:latest` after the pinned tags. */\n pushLatest: boolean;\n /** Human-readable reason when `latest` is held. */\n latestHoldReason?: string;\n}\n\n/**\n * Tag scheme (ADR 0021): `sha-<short>` always; the exact `v<version>` tag; a\n * floating major tag (`v2`) on stable releases only. `latest` is held during\n * prereleases (npm's `rc` dist-tag analog) so existing deployments pinned to\n * `:latest` keep serving the last stable image.\n */\nexport function computeImageTags(input: { shortSha: string; version?: string }): ImageTags {\n const tags = [`sha-${input.shortSha}`];\n const match = input.version?.trim().match(SEMVER_PATTERN);\n if (!match) {\n return { tags, pushLatest: true };\n }\n const [, major, minor, patch, prerelease] = match;\n const exact = prerelease\n ? `v${major}.${minor}.${patch}-${prerelease}`\n : `v${major}.${minor}.${patch}`;\n if (prerelease) {\n return {\n tags: [...tags, exact],\n pushLatest: false,\n latestHoldReason: `${exact} is a prerelease — :latest still serves the last stable image`,\n };\n }\n return { tags: [...tags, exact, `v${major}`], pushLatest: true };\n}\n\nexport interface ImageDeployResult {\n image: string;\n /** Primary pinned tag (the sha tag). */\n tag: string;\n /** All tags pushed, including the primary. */\n tags: string[];\n latestPushed: boolean;\n digest?: string;\n}\n\n/**\n * Image leg (ADR 0021): build the runtime stage, tag `sha-<short>` + version\n * tags, push them, capture the digest, and push `:latest` unless the version\n * is a prerelease. Callers skip the leg with a notice when no image is\n * configured (child repos get build+upload+publish only).\n */\nexport async function buildAndPushImage(input: {\n image: string;\n configDir: string;\n verbose?: boolean;\n}): Promise<ImageDeployResult> {\n const shaResult = await run(\"git\", [\"rev-parse\", \"--short=7\", \"HEAD\"], {\n cwd: input.configDir,\n capture: true,\n });\n const shortSha = shaResult?.stdout.trim();\n if (!shaResult || shaResult.exitCode !== 0 || !shortSha) {\n const detail = shaResult?.stderr.trim();\n throw new Error(\n `Failed to resolve the current git SHA in ${input.configDir} (exit code ${shaResult?.exitCode ?? \"unknown\"}${detail ? `: ${detail}` : \"\"})`,\n );\n }\n\n const version = readFrameworkVersion(input.configDir);\n const { tags, pushLatest, latestHoldReason } = computeImageTags({ shortSha, version });\n const refs = tags.map((tag) => `${input.image}:${tag}`);\n const latestRef = `${input.image}:latest`;\n const buildRefs = pushLatest ? [...refs, latestRef] : refs;\n\n console.log(\n ` Building runtime image ${colors.cyan(buildRefs.join(\", \"))}${pushLatest ? \"\" : colors.yellow(\" (latest held)\")}`,\n );\n await run(\n \"docker\",\n [\"build\", \"--target\", \"runtime\", ...buildRefs.flatMap((ref) => [\"-t\", ref]), \".\"],\n { cwd: input.configDir },\n );\n\n console.log(` Pushing ${colors.cyan(refs.join(\", \"))}...`);\n let digest: string | undefined;\n for (const ref of refs) {\n const push = await run(\"docker\", [\"push\", ref], {\n cwd: input.configDir,\n capture: true,\n });\n if (!push || push.exitCode !== 0) {\n throw new Error(`docker push ${ref} failed with exit code ${push?.exitCode ?? \"unknown\"}`);\n }\n digest ??= parseDigest(push.stdout);\n if (input.verbose && push.stdout.trim()) {\n console.log(colors.dim(push.stdout.trim()));\n }\n }\n\n let latestPushed = false;\n if (pushLatest) {\n const pushLatestRef = await run(\"docker\", [\"push\", latestRef], {\n cwd: input.configDir,\n capture: true,\n });\n if (!pushLatestRef || pushLatestRef.exitCode !== 0) {\n throw new Error(\n `docker push ${latestRef} failed with exit code ${pushLatestRef?.exitCode ?? \"unknown\"}`,\n );\n }\n digest ??= parseDigest(pushLatestRef.stdout);\n if (input.verbose && pushLatestRef.stdout.trim()) {\n console.log(colors.dim(pushLatestRef.stdout.trim()));\n }\n latestPushed = true;\n } else {\n console.log(colors.yellow(` latest held: ${latestHoldReason}`));\n }\n\n if (!digest) {\n console.log(colors.yellow(\" Could not capture the image digest from push output\"));\n }\n\n return { image: input.image, tag: tags[0], tags, latestPushed, digest };\n}\n\n/**\n * Railway leg (ADR 0021): pull-only deploy of the pushed image digest — a\n * thin `FROM image@digest` Dockerfile pins the digest so Railway never\n * rebuilds; `RAILWAY_DOCKERFILE_PATH` points at the generated file.\n */\nexport async function deployImageToRailway(input: {\n image: string;\n digest: string;\n service: string;\n configDir: string;\n}): Promise<void> {\n const deployDir = join(input.configDir, \".bos\", \"deploy\");\n mkdirSync(deployDir, { recursive: true });\n const dockerfilePath = join(deployDir, \"Dockerfile\");\n writeFileSync(dockerfilePath, `FROM ${input.image}@${input.digest}\\n`);\n\n console.log(` Deploying to Railway service ${colors.cyan(input.service)} (pull-only)...`);\n const result = await run(\"railway\", [\"up\", \"--service\", input.service, \"--ci\"], {\n cwd: input.configDir,\n capture: true,\n env: { RAILWAY_DOCKERFILE_PATH: \".bos/deploy/Dockerfile\" },\n });\n if (result?.stdout) {\n for (const line of result.stdout.split(\"\\n\")) {\n if (line.trim()) console.log(` ${colors.dim(line.trim())}`);\n }\n }\n if (!result || result.exitCode !== 0) {\n throw new Error(\n result?.stderr.trim()\n ? `railway up failed: ${result.stderr.trim().split(\"\\n\").slice(-3).join(\" \")}`\n : `railway up failed with exit code ${result?.exitCode ?? \"unknown\"}`,\n );\n }\n console.log(colors.green(` ${icons.ok} Railway deploy complete`));\n}\n"],"mappings":";;;;;;;;;;AAcA,SAAgB,gBAAgB,OAIC;CAC/B,MAAM,WAAW,MAAM,KAAK;C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S,MAAM,IAAI,WAAW;EAAC;EAAM;EAAa,MAAM;EAAS;CAAM,GAAG;EAC9E,KAAK,MAAM;EACX,SAAS;EACT,KAAK,EAAE,yBAAyB,yBAAyB;CAC3D,CAAC;CACD,IAAI,QAAQ,QACV;OAAK,MAAM,QAAQ,OAAO,OAAO,MAAM,IAAI,GACzC,IAAI,KAAK,KAAK,GAAG,QAAQ,IAAI,KAAK,OAAO,IAAI,KAAK,KAAK,CAAC,GAAG;CAC7D;CAEF,IAAI,CAAC,UAAU,OAAO,aAAa,GACjC,MAAM,IAAI,MACR,QAAQ,OAAO,KAAK,IAChB,sBAAsB,OAAO,OAAO,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,GAAG,MACzE,oCAAoC,QAAQ,YAAY,WAC9D;CAEF,QAAQ,IAAI,OAAO,MAAM,KAAK,MAAM,GAAG,yBAAyB,CAAC;AACnE"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_fastkv = require('./fastkv.cjs');
|
|
3
2
|
const require_merge = require('./merge.cjs');
|
|
4
3
|
const require_types = require('./types.cjs');
|
|
4
|
+
const require_fastkv = require('./fastkv.cjs');
|
|
5
5
|
const require_config = require('./config.cjs');
|
|
6
6
|
const require_contract = require('./contract.cjs');
|
|
7
7
|
const require_contract_meta = require('./contract.meta.cjs');
|
|
8
|
-
|
|
8
|
+
const require_start_config_source = require('./start-config-source.cjs');
|
|
9
|
+
let effect = require("effect");
|
|
9
10
|
let every_plugin = require("every-plugin");
|
|
10
|
-
let
|
|
11
|
+
let _orpc_contract = require("@orpc/contract");
|
|
11
12
|
let zod = require("zod");
|
|
12
13
|
|
|
13
14
|
exports.ApiPluginConfigSchema = require_types.ApiPluginConfigSchema;
|
|
@@ -18,18 +19,25 @@ exports.BosPluginRefSchema = require_types.BosPluginRefSchema;
|
|
|
18
19
|
exports.BosStagingSchema = require_types.BosStagingSchema;
|
|
19
20
|
exports.BuildOptionsSchema = require_contract.BuildOptionsSchema;
|
|
20
21
|
exports.BuildResultSchema = require_contract.BuildResultSchema;
|
|
22
|
+
exports.CdnConfigSchema = require_types.CdnConfigSchema;
|
|
21
23
|
exports.CiConfigSchema = require_types.CiConfigSchema;
|
|
24
|
+
exports.CircularExtendsError = require_config.CircularExtendsError;
|
|
22
25
|
exports.ClientRuntimeConfigSchema = require_types.ClientRuntimeConfigSchema;
|
|
23
26
|
exports.ClientRuntimeInfoSchema = require_types.ClientRuntimeInfoSchema;
|
|
24
27
|
exports.ComposableAppEntrySchema = require_types.ComposableAppEntrySchema;
|
|
28
|
+
exports.ConfigExtendsError = require_config.ConfigExtendsError;
|
|
29
|
+
exports.ConfigLoadError = require_config.ConfigLoadError;
|
|
30
|
+
exports.ConfigNotfoundError = require_config.ConfigNotfoundError;
|
|
25
31
|
exports.ConfigOptionsSchema = require_contract.ConfigOptionsSchema;
|
|
26
32
|
exports.ConfigResultSchema = require_contract.ConfigResultSchema;
|
|
33
|
+
exports.ConfigVersionManifestError = require_config.ConfigVersionManifestError;
|
|
27
34
|
Object.defineProperty(exports, 'Context', {
|
|
28
35
|
enumerable: true,
|
|
29
36
|
get: function () {
|
|
30
|
-
return
|
|
37
|
+
return effect.Context;
|
|
31
38
|
}
|
|
32
39
|
});
|
|
40
|
+
exports.DEV_OVERLAY_FILENAME = require_config.DEV_OVERLAY_FILENAME;
|
|
33
41
|
exports.DbDoctorOptionsSchema = require_contract.DbDoctorOptionsSchema;
|
|
34
42
|
exports.DbDoctorResultSchema = require_contract.DbDoctorResultSchema;
|
|
35
43
|
exports.DbRepairOptionsSchema = require_contract.DbRepairOptionsSchema;
|
|
@@ -37,19 +45,25 @@ exports.DbRepairResultSchema = require_contract.DbRepairResultSchema;
|
|
|
37
45
|
exports.DbStudioOptionsSchema = require_contract.DbStudioOptionsSchema;
|
|
38
46
|
exports.DbStudioResultSchema = require_contract.DbStudioResultSchema;
|
|
39
47
|
exports.DependencyNodeKindSchema = require_types.DependencyNodeKindSchema;
|
|
48
|
+
exports.DeployManifestListEntrySchema = require_contract.DeployManifestListEntrySchema;
|
|
40
49
|
exports.DeployOptionsSchema = require_contract.DeployOptionsSchema;
|
|
41
50
|
exports.DeployResultSchema = require_contract.DeployResultSchema;
|
|
51
|
+
exports.DeployedVersionStatusSchema = require_contract.DeployedVersionStatusSchema;
|
|
42
52
|
exports.DevOptionsSchema = require_contract.DevOptionsSchema;
|
|
53
|
+
exports.DevOverlayError = require_config.DevOverlayError;
|
|
43
54
|
exports.DevResultSchema = require_contract.DevResultSchema;
|
|
44
55
|
Object.defineProperty(exports, 'Effect', {
|
|
45
56
|
enumerable: true,
|
|
46
57
|
get: function () {
|
|
47
|
-
return
|
|
58
|
+
return effect.Effect;
|
|
48
59
|
}
|
|
49
60
|
});
|
|
50
61
|
exports.ExtendsSchema = require_types.ExtendsSchema;
|
|
51
62
|
exports.FederationEntrySchema = require_types.FederationEntrySchema;
|
|
52
63
|
exports.HostConfigSchema = require_types.HostConfigSchema;
|
|
64
|
+
exports.InfraExportOptionsSchema = require_contract.InfraExportOptionsSchema;
|
|
65
|
+
exports.InfraExportResultSchema = require_contract.InfraExportResultSchema;
|
|
66
|
+
exports.InfraExportServiceSchema = require_contract.InfraExportServiceSchema;
|
|
53
67
|
exports.InitOptionsSchema = require_contract.InitOptionsSchema;
|
|
54
68
|
exports.InitResultSchema = require_contract.InitResultSchema;
|
|
55
69
|
exports.JsonObjectSchema = require_types.JsonObjectSchema;
|
|
@@ -61,10 +75,21 @@ exports.KillResultSchema = require_contract.KillResultSchema;
|
|
|
61
75
|
Object.defineProperty(exports, 'Layer', {
|
|
62
76
|
enumerable: true,
|
|
63
77
|
get: function () {
|
|
64
|
-
return
|
|
78
|
+
return effect.Layer;
|
|
65
79
|
}
|
|
66
80
|
});
|
|
81
|
+
exports.LoginOptionsSchema = require_contract.LoginOptionsSchema;
|
|
82
|
+
exports.LoginResultSchema = require_contract.LoginResultSchema;
|
|
83
|
+
exports.LogoutOptionsSchema = require_contract.LogoutOptionsSchema;
|
|
84
|
+
exports.LogoutResultSchema = require_contract.LogoutResultSchema;
|
|
85
|
+
exports.LogsOptionsSchema = require_contract.LogsOptionsSchema;
|
|
86
|
+
exports.LogsResultSchema = require_contract.LogsResultSchema;
|
|
87
|
+
exports.MISSING_CONFIG_MESSAGE = require_config.MISSING_CONFIG_MESSAGE;
|
|
88
|
+
exports.MfCheckOptionsSchema = require_contract.MfCheckOptionsSchema;
|
|
89
|
+
exports.MfCheckRemoteResultSchema = require_contract.MfCheckRemoteResultSchema;
|
|
90
|
+
exports.MfCheckResultSchema = require_contract.MfCheckResultSchema;
|
|
67
91
|
exports.OverrideSectionSchema = require_contract.OverrideSectionSchema;
|
|
92
|
+
exports.ParentStarterConfigSchema = require_types.ParentStarterConfigSchema;
|
|
68
93
|
exports.PhaseTimingSchema = require_contract.PhaseTimingSchema;
|
|
69
94
|
exports.PidEntrySchema = require_contract.PidEntrySchema;
|
|
70
95
|
exports.PluginAddOptionsSchema = require_contract.PluginAddOptionsSchema;
|
|
@@ -83,9 +108,17 @@ Object.defineProperty(exports, 'PluginRuntime', {
|
|
|
83
108
|
exports.PluginUiConfigSchema = require_types.PluginUiConfigSchema;
|
|
84
109
|
exports.ProcessRoleSchema = require_contract.ProcessRoleSchema;
|
|
85
110
|
exports.PsResultSchema = require_contract.PsResultSchema;
|
|
111
|
+
exports.PublishAuthSchema = require_types.PublishAuthSchema;
|
|
112
|
+
exports.PublishConfigSchema = require_types.PublishConfigSchema;
|
|
86
113
|
exports.PublishOptionsSchema = require_contract.PublishOptionsSchema;
|
|
87
114
|
exports.PublishResultSchema = require_contract.PublishResultSchema;
|
|
88
115
|
exports.RailwayCiSchema = require_types.RailwayCiSchema;
|
|
116
|
+
exports.RegistryUseOptionsSchema = require_contract.RegistryUseOptionsSchema;
|
|
117
|
+
exports.RegistryUseResultSchema = require_contract.RegistryUseResultSchema;
|
|
118
|
+
exports.RollbackHistoryEntrySchema = require_contract.RollbackHistoryEntrySchema;
|
|
119
|
+
exports.RollbackOptionsSchema = require_contract.RollbackOptionsSchema;
|
|
120
|
+
exports.RollbackResultSchema = require_contract.RollbackResultSchema;
|
|
121
|
+
exports.RollbackSlotCheckSchema = require_contract.RollbackSlotCheckSchema;
|
|
89
122
|
exports.RuntimeConfigSchema = require_types.RuntimeConfigSchema;
|
|
90
123
|
exports.RuntimeDependencyNodeSchema = require_types.RuntimeDependencyNodeSchema;
|
|
91
124
|
exports.RuntimeLineageSchema = require_types.RuntimeLineageSchema;
|
|
@@ -95,18 +128,24 @@ exports.RuntimePluginConfigSchema = require_types.RuntimePluginConfigSchema;
|
|
|
95
128
|
Object.defineProperty(exports, 'Scope', {
|
|
96
129
|
enumerable: true,
|
|
97
130
|
get: function () {
|
|
98
|
-
return
|
|
131
|
+
return effect.Scope;
|
|
99
132
|
}
|
|
100
133
|
});
|
|
101
134
|
exports.SharedConfigSchema = require_types.SharedConfigSchema;
|
|
102
135
|
exports.SharedDepConfigSchema = require_types.SharedDepConfigSchema;
|
|
103
136
|
exports.SharedDepMapSchema = require_types.SharedDepMapSchema;
|
|
137
|
+
exports.SlotPinSchema = require_types.SlotPinSchema;
|
|
104
138
|
exports.SourceModeSchema = require_types.SourceModeSchema;
|
|
105
139
|
exports.StartOptionsSchema = require_contract.StartOptionsSchema;
|
|
106
140
|
exports.StartResultSchema = require_contract.StartResultSchema;
|
|
141
|
+
exports.StarterLevelConfigSchema = require_types.StarterLevelConfigSchema;
|
|
142
|
+
exports.StarterLevelSchema = require_types.StarterLevelSchema;
|
|
107
143
|
exports.StatusResultSchema = require_contract.StatusResultSchema;
|
|
108
144
|
exports.SyncOptionsSchema = require_contract.SyncOptionsSchema;
|
|
109
145
|
exports.SyncResultSchema = require_contract.SyncResultSchema;
|
|
146
|
+
exports.TypecheckOptionsSchema = require_contract.TypecheckOptionsSchema;
|
|
147
|
+
exports.TypecheckResultSchema = require_contract.TypecheckResultSchema;
|
|
148
|
+
exports.TypecheckWorkspaceResultSchema = require_contract.TypecheckWorkspaceResultSchema;
|
|
110
149
|
exports.TypesGenOptionsSchema = require_contract.TypesGenOptionsSchema;
|
|
111
150
|
exports.TypesGenResultSchema = require_contract.TypesGenResultSchema;
|
|
112
151
|
exports.UiConfigSchema = require_types.UiConfigSchema;
|
|
@@ -117,9 +156,10 @@ exports.bosContract = require_contract.bosContract;
|
|
|
117
156
|
exports.buildRegistryConfigUrl = require_fastkv.buildRegistryConfigUrl;
|
|
118
157
|
exports.buildRegistryConfigUrlForNetwork = require_fastkv.buildRegistryConfigUrlForNetwork;
|
|
119
158
|
exports.buildRuntimeConfig = require_config.buildRuntimeConfig;
|
|
159
|
+
exports.buildRuntimeConfigEffect = require_config.buildRuntimeConfigEffect;
|
|
120
160
|
exports.buildRuntimePluginsForConfig = require_config.buildRuntimePluginsForConfig;
|
|
121
|
-
exports.clearConfigCache = require_config.clearConfigCache;
|
|
122
161
|
exports.cliCommandMeta = require_contract_meta.cliCommandMeta;
|
|
162
|
+
exports.commandOptionSchemas = require_contract.commandOptionSchemas;
|
|
123
163
|
Object.defineProperty(exports, 'createPlugin', {
|
|
124
164
|
enumerable: true,
|
|
125
165
|
get: function () {
|
|
@@ -132,36 +172,43 @@ Object.defineProperty(exports, 'createPluginRuntime', {
|
|
|
132
172
|
return every_plugin.createPluginRuntime;
|
|
133
173
|
}
|
|
134
174
|
});
|
|
135
|
-
exports.
|
|
175
|
+
exports.defaultConfigEnv = require_config.defaultConfigEnv;
|
|
136
176
|
exports.fetchBosConfigFromFastKv = require_fastkv.fetchBosConfigFromFastKv;
|
|
177
|
+
exports.fetchConfigHistory = require_fastkv.fetchConfigHistory;
|
|
178
|
+
exports.fetchDeployManifests = require_fastkv.fetchDeployManifests;
|
|
137
179
|
exports.fetchRemotePluginManifest = require_fastkv.fetchRemotePluginManifest;
|
|
138
180
|
exports.findConfigPath = require_config.findConfigPath;
|
|
139
|
-
exports.
|
|
181
|
+
exports.getConfigBaseDir = require_config.getConfigBaseDir;
|
|
140
182
|
exports.getFastKvBaseUrlForNetwork = require_fastkv.getFastKvBaseUrlForNetwork;
|
|
141
183
|
exports.getHostDevelopmentPort = require_config.getHostDevelopmentPort;
|
|
142
|
-
exports.getProjectRoot = require_config.getProjectRoot;
|
|
143
184
|
exports.getRegistryNamespaceForAccount = require_fastkv.getRegistryNamespaceForAccount;
|
|
144
185
|
exports.getRegistryNamespaceForNetwork = require_fastkv.getRegistryNamespaceForNetwork;
|
|
145
186
|
exports.getResolvedConfigPath = require_config.getResolvedConfigPath;
|
|
187
|
+
exports.isAppDescriptorPath = require_config.isAppDescriptorPath;
|
|
146
188
|
exports.isLocalDevelopmentTarget = require_config.isLocalDevelopmentTarget;
|
|
189
|
+
exports.isRegistryStart = require_start_config_source.isRegistryStart;
|
|
147
190
|
exports.isRuntimeOverrideAllowed = require_config.isRuntimeOverrideAllowed;
|
|
148
|
-
exports.
|
|
191
|
+
exports.loadAppDescriptorConfig = require_config.loadAppDescriptorConfig;
|
|
149
192
|
exports.loadGeneratedResolvedConfig = require_config.loadGeneratedResolvedConfig;
|
|
150
|
-
exports.
|
|
151
|
-
exports.loadRemoteConfig = require_config.loadRemoteConfig;
|
|
152
|
-
exports.loadResolvedConfig = require_config.loadResolvedConfig;
|
|
193
|
+
exports.localConfigEntryPath = require_config.localConfigEntryPath;
|
|
153
194
|
exports.mergeBosConfigWithExtends = require_merge.mergeBosConfigWithExtends;
|
|
154
195
|
Object.defineProperty(exports, 'oc', {
|
|
155
196
|
enumerable: true,
|
|
156
197
|
get: function () {
|
|
157
|
-
return
|
|
198
|
+
return _orpc_contract.oc;
|
|
158
199
|
}
|
|
159
200
|
});
|
|
201
|
+
exports.parseAppDescriptorModule = require_config.parseAppDescriptorModule;
|
|
160
202
|
exports.parseBosUrl = require_fastkv.parseBosUrl;
|
|
203
|
+
exports.parseDevOverlayModule = require_config.parseDevOverlayModule;
|
|
204
|
+
exports.parseExtendsTarget = require_config.parseExtendsTarget;
|
|
161
205
|
exports.parsePort = require_config.parsePort;
|
|
162
206
|
exports.parseRuntimeOverrideTargets = require_config.parseRuntimeOverrideTargets;
|
|
207
|
+
exports.readAuthoredConfigInput = require_config.readAuthoredConfigInput;
|
|
163
208
|
exports.readBosConfigForBuild = require_config.readBosConfigForBuild;
|
|
209
|
+
exports.readLocalAuthoredConfigInput = require_config.readLocalAuthoredConfigInput;
|
|
164
210
|
exports.rebuildOrderedConfig = require_merge.rebuildOrderedConfig;
|
|
211
|
+
exports.resetConfigPathCache = require_config.resetConfigPathCache;
|
|
165
212
|
exports.resolveBosConfigPath = require_config.resolveBosConfigPath;
|
|
166
213
|
exports.resolveComposableReference = require_config.resolveComposableReference;
|
|
167
214
|
exports.resolveConfigComposableEntries = require_config.resolveConfigComposableEntries;
|
|
@@ -169,8 +216,9 @@ exports.resolveDevelopmentHostUrl = require_config.resolveDevelopmentHostUrl;
|
|
|
169
216
|
exports.resolveExtendsRef = require_merge.resolveExtendsRef;
|
|
170
217
|
exports.resolveLocalDevelopmentPath = require_config.resolveLocalDevelopmentPath;
|
|
171
218
|
exports.resolvePluginRuntimeName = require_config.resolvePluginRuntimeName;
|
|
172
|
-
exports.
|
|
173
|
-
exports.
|
|
219
|
+
exports.resolveStartConfigSource = require_start_config_source.resolveStartConfigSource;
|
|
220
|
+
exports.resolveUiRuntimeName = require_config.resolveUiRuntimeName;
|
|
221
|
+
exports.runWithConfigWarningSink = require_config.runWithConfigWarningSink;
|
|
174
222
|
exports.writeResolvedConfig = require_config.writeResolvedConfig;
|
|
175
223
|
Object.defineProperty(exports, 'z', {
|
|
176
224
|
enumerable: true,
|