everything-dev 1.53.1 → 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,64 @@
|
|
|
1
|
+
let node_fs = require("node:fs");
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
let node_os = require("node:os");
|
|
4
|
+
|
|
5
|
+
//#region src/auth-session.ts
|
|
6
|
+
const SESSION_FILE_NAME = "session.json";
|
|
7
|
+
function getSessionFilePath(configDir) {
|
|
8
|
+
return (0, node_path.join)(configDir, ".bos", SESSION_FILE_NAME);
|
|
9
|
+
}
|
|
10
|
+
function readSessionHandle(configDir) {
|
|
11
|
+
const filePath = getSessionFilePath(configDir);
|
|
12
|
+
if (!(0, node_fs.existsSync)(filePath)) return null;
|
|
13
|
+
try {
|
|
14
|
+
const parsed = JSON.parse((0, node_fs.readFileSync)(filePath, "utf-8"));
|
|
15
|
+
if (parsed.version !== 1) return null;
|
|
16
|
+
return {
|
|
17
|
+
version: 1,
|
|
18
|
+
credential: parsed.credential ?? null,
|
|
19
|
+
publishKey: parsed.publishKey ?? null,
|
|
20
|
+
delegateKey: parsed.delegateKey ?? null
|
|
21
|
+
};
|
|
22
|
+
} catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function writeSessionHandle(configDir, session) {
|
|
27
|
+
const bosDir = (0, node_path.join)(configDir, ".bos");
|
|
28
|
+
(0, node_fs.mkdirSync)(bosDir, { recursive: true });
|
|
29
|
+
(0, node_fs.writeFileSync)(getSessionFilePath(configDir), `${JSON.stringify(session, null, 2)}\n`, { mode: 384 });
|
|
30
|
+
}
|
|
31
|
+
function updateSessionHandle(configDir, update) {
|
|
32
|
+
const next = update(readSessionHandle(configDir) ?? {
|
|
33
|
+
version: 1,
|
|
34
|
+
credential: null,
|
|
35
|
+
publishKey: null,
|
|
36
|
+
delegateKey: null
|
|
37
|
+
});
|
|
38
|
+
writeSessionHandle(configDir, next);
|
|
39
|
+
return next;
|
|
40
|
+
}
|
|
41
|
+
function deleteSessionHandle(configDir) {
|
|
42
|
+
const filePath = getSessionFilePath(configDir);
|
|
43
|
+
if ((0, node_fs.existsSync)(filePath)) (0, node_fs.rmSync)(filePath);
|
|
44
|
+
}
|
|
45
|
+
function nearCredentialsPath(network, account) {
|
|
46
|
+
return (0, node_path.join)((0, node_os.homedir)(), ".near-credentials", network, `${account}.json`);
|
|
47
|
+
}
|
|
48
|
+
function removePublishedKeyFile(network, account, publicKey) {
|
|
49
|
+
const filePath = nearCredentialsPath(network, account);
|
|
50
|
+
if (!(0, node_fs.existsSync)(filePath)) return;
|
|
51
|
+
try {
|
|
52
|
+
if (JSON.parse((0, node_fs.readFileSync)(filePath, "utf-8")).public_key === publicKey) (0, node_fs.rmSync)(filePath);
|
|
53
|
+
} catch {}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
exports.deleteSessionHandle = deleteSessionHandle;
|
|
58
|
+
exports.getSessionFilePath = getSessionFilePath;
|
|
59
|
+
exports.nearCredentialsPath = nearCredentialsPath;
|
|
60
|
+
exports.readSessionHandle = readSessionHandle;
|
|
61
|
+
exports.removePublishedKeyFile = removePublishedKeyFile;
|
|
62
|
+
exports.updateSessionHandle = updateSessionHandle;
|
|
63
|
+
exports.writeSessionHandle = writeSessionHandle;
|
|
64
|
+
//# sourceMappingURL=auth-session.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-session.cjs","names":["join","existsSync","readFileSync","homedir"],"sources":["../src/auth-session.ts"],"sourcesContent":["import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\nexport interface SessionCredential {\n kind: \"session\";\n apiKey: string;\n apiKeyId: string;\n accountId: string | null;\n label: string;\n siteUrl: string;\n createdAt: string;\n expiresAt: string | null;\n}\n\nexport interface PublishKeyRecord {\n publicKey: string;\n network: \"mainnet\" | \"testnet\";\n contract: string;\n exportedTo: string;\n}\n\nexport interface DelegateKeyRecord {\n publicKey: string;\n privateKey: string;\n accountId: string;\n network: \"mainnet\" | \"testnet\";\n contract: string;\n mintedAt: string;\n}\n\nexport interface BosSessionFile {\n version: 1;\n credential: SessionCredential | null;\n publishKey: PublishKeyRecord | null;\n delegateKey: DelegateKeyRecord | null;\n}\n\nconst SESSION_FILE_NAME = \"session.json\";\n\nexport function getSessionFilePath(configDir: string): string {\n return join(configDir, \".bos\", SESSION_FILE_NAME);\n}\n\nexport function readSessionHandle(configDir: string): BosSessionFile | null {\n const filePath = getSessionFilePath(configDir);\n if (!existsSync(filePath)) return null;\n try {\n const parsed = JSON.parse(readFileSync(filePath, \"utf-8\")) as Partial<BosSessionFile>;\n if (parsed.version !== 1) return null;\n return {\n version: 1,\n credential: parsed.credential ?? null,\n publishKey: parsed.publishKey ?? null,\n delegateKey: parsed.delegateKey ?? null,\n };\n } catch {\n return null;\n }\n}\n\nexport function writeSessionHandle(configDir: string, session: BosSessionFile): void {\n const bosDir = join(configDir, \".bos\");\n mkdirSync(bosDir, { recursive: true });\n writeFileSync(getSessionFilePath(configDir), `${JSON.stringify(session, null, 2)}\\n`, {\n mode: 0o600,\n });\n}\n\nexport function updateSessionHandle(\n configDir: string,\n update: (session: BosSessionFile) => BosSessionFile,\n): BosSessionFile {\n const current = readSessionHandle(configDir) ?? {\n version: 1 as const,\n credential: null,\n publishKey: null,\n delegateKey: null,\n };\n const next = update(current);\n writeSessionHandle(configDir, next);\n return next;\n}\n\nexport function deleteSessionHandle(configDir: string): void {\n const filePath = getSessionFilePath(configDir);\n if (existsSync(filePath)) {\n rmSync(filePath);\n }\n}\n\nexport function nearCredentialsPath(network: \"mainnet\" | \"testnet\", account: string): string {\n return join(homedir(), \".near-credentials\", network, `${account}.json`);\n}\n\nexport function removePublishedKeyFile(\n network: \"mainnet\" | \"testnet\",\n account: string,\n publicKey: string,\n): void {\n const filePath = nearCredentialsPath(network, account);\n if (!existsSync(filePath)) return;\n try {\n const credential = JSON.parse(readFileSync(filePath, \"utf-8\")) as { public_key?: string };\n if (credential.public_key === publicKey) {\n rmSync(filePath);\n }\n } catch {\n // leave malformed files alone\n }\n}\n"],"mappings":";;;;;AAsCA,MAAM,oBAAoB;AAE1B,SAAgB,mBAAmB,WAA2B;CAC5D,WAAOA,gBAAK,WAAW,QAAQ,iBAAiB;AAClD;AAEA,SAAgB,kBAAkB,WAA0C;CAC1E,MAAM,WAAW,mBAAmB,SAAS;CAC7C,IAAI,KAACC,oBAAW,QAAQ,GAAG,OAAO;CAClC,IAAI;EACF,MAAM,SAAS,KAAK,UAAMC,sBAAa,UAAU,OAAO,CAAC;EACzD,IAAI,OAAO,YAAY,GAAG,OAAO;EACjC,OAAO;GACL,SAAS;GACT,YAAY,OAAO,cAAc;GACjC,YAAY,OAAO,cAAc;GACjC,aAAa,OAAO,eAAe;EACrC;CACF,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,mBAAmB,WAAmB,SAA+B;CACnF,MAAM,aAASF,gBAAK,WAAW,MAAM;CACrC,uBAAU,QAAQ,EAAE,WAAW,KAAK,CAAC;CACrC,2BAAc,mBAAmB,SAAS,GAAG,GAAG,KAAK,UAAU,SAAS,MAAM,CAAC,EAAE,KAAK,EACpF,MAAM,IACR,CAAC;AACH;AAEA,SAAgB,oBACd,WACA,QACgB;CAOhB,MAAM,OAAO,OANG,kBAAkB,SAAS,KAAK;EAC9C,SAAS;EACT,YAAY;EACZ,YAAY;EACZ,aAAa;CACf,CAC2B;CAC3B,mBAAmB,WAAW,IAAI;CAClC,OAAO;AACT;AAEA,SAAgB,oBAAoB,WAAyB;CAC3D,MAAM,WAAW,mBAAmB,SAAS;CAC7C,QAAIC,oBAAW,QAAQ,GACrB,oBAAO,QAAQ;AAEnB;AAEA,SAAgB,oBAAoB,SAAgC,SAAyB;CAC3F,WAAOD,oBAAKG,iBAAQ,GAAG,qBAAqB,SAAS,GAAG,QAAQ,MAAM;AACxE;AAEA,SAAgB,uBACd,SACA,SACA,WACM;CACN,MAAM,WAAW,oBAAoB,SAAS,OAAO;CACrD,IAAI,KAACF,oBAAW,QAAQ,GAAG;CAC3B,IAAI;EAEF,IADmB,KAAK,UAAMC,sBAAa,UAAU,OAAO,CAC/C,CAAC,CAAC,eAAe,WAC5B,oBAAO,QAAQ;CAEnB,QAAQ,CAER;AACF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
|
|
5
|
+
//#region src/auth-session.ts
|
|
6
|
+
const SESSION_FILE_NAME = "session.json";
|
|
7
|
+
function getSessionFilePath(configDir) {
|
|
8
|
+
return join(configDir, ".bos", SESSION_FILE_NAME);
|
|
9
|
+
}
|
|
10
|
+
function readSessionHandle(configDir) {
|
|
11
|
+
const filePath = getSessionFilePath(configDir);
|
|
12
|
+
if (!existsSync(filePath)) return null;
|
|
13
|
+
try {
|
|
14
|
+
const parsed = JSON.parse(readFileSync(filePath, "utf-8"));
|
|
15
|
+
if (parsed.version !== 1) return null;
|
|
16
|
+
return {
|
|
17
|
+
version: 1,
|
|
18
|
+
credential: parsed.credential ?? null,
|
|
19
|
+
publishKey: parsed.publishKey ?? null,
|
|
20
|
+
delegateKey: parsed.delegateKey ?? null
|
|
21
|
+
};
|
|
22
|
+
} catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function writeSessionHandle(configDir, session) {
|
|
27
|
+
const bosDir = join(configDir, ".bos");
|
|
28
|
+
mkdirSync(bosDir, { recursive: true });
|
|
29
|
+
writeFileSync(getSessionFilePath(configDir), `${JSON.stringify(session, null, 2)}\n`, { mode: 384 });
|
|
30
|
+
}
|
|
31
|
+
function updateSessionHandle(configDir, update) {
|
|
32
|
+
const next = update(readSessionHandle(configDir) ?? {
|
|
33
|
+
version: 1,
|
|
34
|
+
credential: null,
|
|
35
|
+
publishKey: null,
|
|
36
|
+
delegateKey: null
|
|
37
|
+
});
|
|
38
|
+
writeSessionHandle(configDir, next);
|
|
39
|
+
return next;
|
|
40
|
+
}
|
|
41
|
+
function deleteSessionHandle(configDir) {
|
|
42
|
+
const filePath = getSessionFilePath(configDir);
|
|
43
|
+
if (existsSync(filePath)) rmSync(filePath);
|
|
44
|
+
}
|
|
45
|
+
function nearCredentialsPath(network, account) {
|
|
46
|
+
return join(homedir(), ".near-credentials", network, `${account}.json`);
|
|
47
|
+
}
|
|
48
|
+
function removePublishedKeyFile(network, account, publicKey) {
|
|
49
|
+
const filePath = nearCredentialsPath(network, account);
|
|
50
|
+
if (!existsSync(filePath)) return;
|
|
51
|
+
try {
|
|
52
|
+
if (JSON.parse(readFileSync(filePath, "utf-8")).public_key === publicKey) rmSync(filePath);
|
|
53
|
+
} catch {}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { deleteSessionHandle, getSessionFilePath, nearCredentialsPath, readSessionHandle, removePublishedKeyFile, updateSessionHandle, writeSessionHandle };
|
|
58
|
+
//# sourceMappingURL=auth-session.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-session.mjs","names":[],"sources":["../src/auth-session.ts"],"sourcesContent":["import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\nexport interface SessionCredential {\n kind: \"session\";\n apiKey: string;\n apiKeyId: string;\n accountId: string | null;\n label: string;\n siteUrl: string;\n createdAt: string;\n expiresAt: string | null;\n}\n\nexport interface PublishKeyRecord {\n publicKey: string;\n network: \"mainnet\" | \"testnet\";\n contract: string;\n exportedTo: string;\n}\n\nexport interface DelegateKeyRecord {\n publicKey: string;\n privateKey: string;\n accountId: string;\n network: \"mainnet\" | \"testnet\";\n contract: string;\n mintedAt: string;\n}\n\nexport interface BosSessionFile {\n version: 1;\n credential: SessionCredential | null;\n publishKey: PublishKeyRecord | null;\n delegateKey: DelegateKeyRecord | null;\n}\n\nconst SESSION_FILE_NAME = \"session.json\";\n\nexport function getSessionFilePath(configDir: string): string {\n return join(configDir, \".bos\", SESSION_FILE_NAME);\n}\n\nexport function readSessionHandle(configDir: string): BosSessionFile | null {\n const filePath = getSessionFilePath(configDir);\n if (!existsSync(filePath)) return null;\n try {\n const parsed = JSON.parse(readFileSync(filePath, \"utf-8\")) as Partial<BosSessionFile>;\n if (parsed.version !== 1) return null;\n return {\n version: 1,\n credential: parsed.credential ?? null,\n publishKey: parsed.publishKey ?? null,\n delegateKey: parsed.delegateKey ?? null,\n };\n } catch {\n return null;\n }\n}\n\nexport function writeSessionHandle(configDir: string, session: BosSessionFile): void {\n const bosDir = join(configDir, \".bos\");\n mkdirSync(bosDir, { recursive: true });\n writeFileSync(getSessionFilePath(configDir), `${JSON.stringify(session, null, 2)}\\n`, {\n mode: 0o600,\n });\n}\n\nexport function updateSessionHandle(\n configDir: string,\n update: (session: BosSessionFile) => BosSessionFile,\n): BosSessionFile {\n const current = readSessionHandle(configDir) ?? {\n version: 1 as const,\n credential: null,\n publishKey: null,\n delegateKey: null,\n };\n const next = update(current);\n writeSessionHandle(configDir, next);\n return next;\n}\n\nexport function deleteSessionHandle(configDir: string): void {\n const filePath = getSessionFilePath(configDir);\n if (existsSync(filePath)) {\n rmSync(filePath);\n }\n}\n\nexport function nearCredentialsPath(network: \"mainnet\" | \"testnet\", account: string): string {\n return join(homedir(), \".near-credentials\", network, `${account}.json`);\n}\n\nexport function removePublishedKeyFile(\n network: \"mainnet\" | \"testnet\",\n account: string,\n publicKey: string,\n): void {\n const filePath = nearCredentialsPath(network, account);\n if (!existsSync(filePath)) return;\n try {\n const credential = JSON.parse(readFileSync(filePath, \"utf-8\")) as { public_key?: string };\n if (credential.public_key === publicKey) {\n rmSync(filePath);\n }\n } catch {\n // leave malformed files alone\n }\n}\n"],"mappings":";;;;;AAsCA,MAAM,oBAAoB;AAE1B,SAAgB,mBAAmB,WAA2B;CAC5D,OAAO,KAAK,WAAW,QAAQ,iBAAiB;AAClD;AAEA,SAAgB,kBAAkB,WAA0C;CAC1E,MAAM,WAAW,mBAAmB,SAAS;CAC7C,IAAI,CAAC,WAAW,QAAQ,GAAG,OAAO;CAClC,IAAI;EACF,MAAM,SAAS,KAAK,MAAM,aAAa,UAAU,OAAO,CAAC;EACzD,IAAI,OAAO,YAAY,GAAG,OAAO;EACjC,OAAO;GACL,SAAS;GACT,YAAY,OAAO,cAAc;GACjC,YAAY,OAAO,cAAc;GACjC,aAAa,OAAO,eAAe;EACrC;CACF,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,mBAAmB,WAAmB,SAA+B;CACnF,MAAM,SAAS,KAAK,WAAW,MAAM;CACrC,UAAU,QAAQ,EAAE,WAAW,KAAK,CAAC;CACrC,cAAc,mBAAmB,SAAS,GAAG,GAAG,KAAK,UAAU,SAAS,MAAM,CAAC,EAAE,KAAK,EACpF,MAAM,IACR,CAAC;AACH;AAEA,SAAgB,oBACd,WACA,QACgB;CAOhB,MAAM,OAAO,OANG,kBAAkB,SAAS,KAAK;EAC9C,SAAS;EACT,YAAY;EACZ,YAAY;EACZ,aAAa;CACf,CAC2B;CAC3B,mBAAmB,WAAW,IAAI;CAClC,OAAO;AACT;AAEA,SAAgB,oBAAoB,WAAyB;CAC3D,MAAM,WAAW,mBAAmB,SAAS;CAC7C,IAAI,WAAW,QAAQ,GACrB,OAAO,QAAQ;AAEnB;AAEA,SAAgB,oBAAoB,SAAgC,SAAyB;CAC3F,OAAO,KAAK,QAAQ,GAAG,qBAAqB,SAAS,GAAG,QAAQ,MAAM;AACxE;AAEA,SAAgB,uBACd,SACA,SACA,WACM;CACN,MAAM,WAAW,oBAAoB,SAAS,OAAO;CACrD,IAAI,CAAC,WAAW,QAAQ,GAAG;CAC3B,IAAI;EAEF,IADmB,KAAK,MAAM,aAAa,UAAU,OAAO,CAC/C,CAAC,CAAC,eAAe,WAC5B,OAAO,QAAQ;CAEnB,QAAQ,CAER;AACF"}
|
package/dist/auth-types-gen.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-types-gen.cjs","names":[],"sources":["../src/auth-types-gen.ts"],"sourcesContent":["export const AUTH_DERIVED_TYPES_BODY = `\nexport type AuthSessionUser = NonNullable<InferOutput<\"getSession\">[\"user\"]>;\nexport type AuthSessionData = NonNullable<InferOutput<\"getSession\">[\"session\"]>;\nexport type AuthSession = {\n user: AuthSessionUser | null;\n session: AuthSessionData | null;\n};\nexport type AuthRequestContext = InferOutput<\"getContext\">;\nexport type AuthPluginContext = Partial<AuthRequestContext> & {\n reqHeaders?: Headers;\n getRawBody?: () => Promise<string>;\n};\n`;\n\nexport function buildAuthTypesGenContent(\n authExportImportPath: string,\n contractImportPath: string,\n): string {\n return `export type * from \"${authExportImportPath}\";\nimport type { InferOutput } from \"${contractImportPath}\";\n${AUTH_DERIVED_TYPES_BODY}\n`;\n}\n\nexport function buildAuthExportStub(): string {\n return `export type Auth = any;\nexport type AuthOrganizationContext = any;\nexport type AuthOrganization = any;\nexport type AuthOrganizationSummary = any;\nexport type AuthOrganizationMember = any;\nexport type AuthApiKey = any;\nexport type AuthInvitation = any;\nexport type AuthTeam = any;\nexport type GetActiveMemberInput = any;\nexport type GetFullOrganizationInput = any;\nexport type ListMembersInput = any;\nexport type ListInvitationsInput = any;\nexport type ListApiKeysInput = any;\nexport type AuthServices = any;\nexport type createAuthInstance = any;\n`;\n}\n\nexport function buildAuthContractStub(): string {\n return `export type ContractType = any;\nexport type InferOutput<_TRoute extends string> = any;\n`;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth-types-gen.cjs","names":[],"sources":["../src/auth-types-gen.ts"],"sourcesContent":["export const AUTH_DERIVED_TYPES_BODY = `\nexport type AuthSessionUser = NonNullable<InferOutput<\"getSession\">[\"user\"]>;\nexport type AuthSessionData = NonNullable<InferOutput<\"getSession\">[\"session\"]>;\nexport type AuthSession = {\n user: AuthSessionUser | null;\n session: AuthSessionData | null;\n};\nexport type AuthRequestContext = InferOutput<\"getContext\">;\nexport type AuthPluginContext = Partial<AuthRequestContext> & {\n reqHeaders?: Headers;\n getRawBody?: () => Promise<string>;\n};\n`;\n\nexport function buildAuthTypesGenContent(\n authExportImportPath: string,\n contractImportPath: string,\n): string {\n return `export type * from \"${authExportImportPath}\";\nimport type { InferOutput } from \"${contractImportPath}\";\n${AUTH_DERIVED_TYPES_BODY}\n`;\n}\n\nexport function buildAuthExportStub(): string {\n return `export type Auth = any;\nexport type AuthOrganizationContext = any;\nexport type AuthOrganization = any;\nexport type AuthOrganizationSummary = any;\nexport type AuthOrganizationMember = any;\nexport type AuthApiKey = any;\nexport type AuthInvitation = any;\nexport type AuthTeam = any;\nexport type GetActiveMemberInput = any;\nexport type GetFullOrganizationInput = any;\nexport type ListMembersInput = any;\nexport type ListInvitationsInput = any;\nexport type ListApiKeysInput = any;\nexport type AuthServices = any;\nexport type createAuthInstance = any;\n`;\n}\n\nexport function buildAuthContractStub(): string {\n return `export type ContractType = any;\nexport type InferOutput<_TRoute extends string> = any;\n`;\n}\n"],"mappings":";AAAA,MAAa,0BAA0B;;;;;;;;;;;;;AAcvC,SAAgB,yBACd,sBACA,oBACQ;CACR,OAAO,uBAAuB,qBAAqB;oCACjB,mBAAmB;EACrD,wBAAwB;;AAE1B;AAEA,SAAgB,sBAA8B;CAC5C,OAAO;;;;;;;;;;;;;;;;AAgBT;AAEA,SAAgB,wBAAgC;CAC9C,OAAO;;;AAGT"}
|
package/dist/build.cjs
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
2
2
|
const require_config = require('./config.cjs');
|
|
3
|
-
const require_integrity = require('./integrity.cjs');
|
|
4
3
|
const require_timing = require('./cli/timing.cjs');
|
|
5
|
-
const require_shared_deps = require('./shared-deps.cjs');
|
|
6
4
|
const require_run = require('./utils/run.cjs');
|
|
5
|
+
const require_workspace = require('./workspace.cjs');
|
|
6
|
+
const require_shared_deps = require('./shared-deps.cjs');
|
|
7
7
|
const require_string = require('./utils/string.cjs');
|
|
8
8
|
const require_theme = require('./utils/theme.cjs');
|
|
9
|
-
let node_fs = require("node:fs");
|
|
10
|
-
let node_path = require("node:path");
|
|
11
9
|
let node_process = require("node:process");
|
|
12
10
|
node_process = require_runtime.__toESM(node_process, 1);
|
|
13
11
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -15,15 +13,15 @@ let node_fs_promises = require("node:fs/promises");
|
|
|
15
13
|
//#region src/build.ts
|
|
16
14
|
const buildCommands = {
|
|
17
15
|
host: {
|
|
18
|
-
cmd: "
|
|
16
|
+
cmd: "pnpm",
|
|
19
17
|
args: ["run", "build"]
|
|
20
18
|
},
|
|
21
19
|
ui: {
|
|
22
|
-
cmd: "
|
|
20
|
+
cmd: "pnpm",
|
|
23
21
|
args: ["run", "build"]
|
|
24
22
|
},
|
|
25
23
|
api: {
|
|
26
|
-
cmd: "
|
|
24
|
+
cmd: "pnpm",
|
|
27
25
|
args: ["run", "build"]
|
|
28
26
|
}
|
|
29
27
|
};
|
|
@@ -39,9 +37,6 @@ async function fileExists(path) {
|
|
|
39
37
|
return false;
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
|
-
async function readJsonFile(path) {
|
|
43
|
-
return JSON.parse(await (0, node_fs_promises.readFile)(path, "utf8"));
|
|
44
|
-
}
|
|
45
40
|
function resolveWorkspaceTarget(key, bosConfig, runtimeConfig, configDir) {
|
|
46
41
|
if (bosConfig?.app && key in bosConfig.app) {
|
|
47
42
|
const appEntry = bosConfig.app[key];
|
|
@@ -68,120 +63,43 @@ function resolveWorkspaceTarget(key, bosConfig, runtimeConfig, configDir) {
|
|
|
68
63
|
function selectWorkspaceTargets(packages, bosConfig) {
|
|
69
64
|
const allPackages = [...Object.keys(bosConfig?.app ?? {}), ...Object.keys(bosConfig?.plugins ?? {})];
|
|
70
65
|
if (packages === "all") return allPackages;
|
|
66
|
+
if (packages === "local") return allPackages.filter((k) => isLocalTarget(k, bosConfig));
|
|
71
67
|
return packages.split(",").map((pkg) => pkg.trim()).filter((pkg) => allPackages.includes(pkg));
|
|
72
68
|
}
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
69
|
+
function isLocalTarget(key, bosConfig) {
|
|
70
|
+
const dev = ((bosConfig?.app)?.[key] ?? bosConfig?.plugins?.[key])?.development;
|
|
71
|
+
return typeof dev === "string" && dev.startsWith("local:");
|
|
72
|
+
}
|
|
73
|
+
async function buildOneWorkspace(ws, env, opts) {
|
|
74
|
+
const buildConfig = buildCommands[ws.key] ?? {
|
|
75
|
+
cmd: "pnpm",
|
|
76
|
+
args: ["run", "build"]
|
|
77
|
+
};
|
|
78
|
+
const verbose = opts.verbose ?? false;
|
|
79
|
+
const startTime = Date.now();
|
|
80
|
+
const proc = await require_run.run(buildConfig.cmd, buildConfig.args, {
|
|
81
|
+
cwd: ws.path,
|
|
76
82
|
env,
|
|
77
83
|
capture: true,
|
|
78
84
|
onChunk: (stream, chunk) => {
|
|
79
85
|
if (stream === "stderr") node_process.default.stderr.write(chunk);
|
|
80
86
|
else if (verbose) node_process.default.stdout.write(chunk);
|
|
81
|
-
const text = chunk.toString("utf-8");
|
|
82
|
-
if (/ZEPHYR|auth\.zephyr-cloud\.io\/authorize|ZE\d{4,}/.test(text)) node_process.default.stdout.write(chunk);
|
|
83
87
|
}
|
|
84
88
|
});
|
|
85
|
-
const
|
|
86
|
-
const stderr = result?.stderr ?? "";
|
|
87
|
-
const exitCode = result?.exitCode ?? 0;
|
|
88
|
-
const output = `${stdout}\n${stderr}`;
|
|
89
|
-
const deployEntries = require_integrity.parseDeployLines(output);
|
|
90
|
-
if (deployEntries.length > 0) {
|
|
91
|
-
const result = {
|
|
92
|
-
success: true,
|
|
93
|
-
url: deployEntries[0]?.url,
|
|
94
|
-
exitCode: 0,
|
|
95
|
-
output,
|
|
96
|
-
deployEntries
|
|
97
|
-
};
|
|
98
|
-
if (exitCode !== 0) {
|
|
99
|
-
const errorLines = output.split("\n").filter((line) => /\bERROR\b/.test(line) || line.startsWith("Rspack compiled with")).slice(0, 5);
|
|
100
|
-
if (errorLines.length > 0) {
|
|
101
|
-
result.warnings = errorLines.map((l) => l.trim());
|
|
102
|
-
if (!verbose) {
|
|
103
|
-
console.log(` ${require_theme.colors.yellow("⚠")} Build completed with errors (exit code ${exitCode}) — Zephyr deployed successfully`);
|
|
104
|
-
for (const line of errorLines) console.log(` ${require_theme.colors.dim(line.trim())}`);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return result;
|
|
109
|
-
}
|
|
110
|
-
if (exitCode !== 0) return {
|
|
111
|
-
success: false,
|
|
112
|
-
error: `Build failed (exit code ${exitCode})\n${output.trim().split("\n").slice(-5).join("\n")}`,
|
|
113
|
-
exitCode,
|
|
114
|
-
output
|
|
115
|
-
};
|
|
116
|
-
const deployMatch = output.match(/🚀.*Deployed:\s*(https?:\S+)/);
|
|
117
|
-
if (deployMatch) return {
|
|
118
|
-
success: true,
|
|
119
|
-
url: deployMatch[1],
|
|
120
|
-
exitCode: 0,
|
|
121
|
-
output
|
|
122
|
-
};
|
|
123
|
-
const zeMatch = output.match(/ZE\d{4,}/);
|
|
124
|
-
if (zeMatch) {
|
|
125
|
-
const zeLines = output.split("\n").filter((l) => /ZEPHYR|ZE\d{4,}/.test(l)).slice(0, 5);
|
|
126
|
-
const detail = zeLines.length > 0 ? `\n${zeLines.join("\n")}` : "";
|
|
127
|
-
return {
|
|
128
|
-
success: false,
|
|
129
|
-
error: `Zephyr upload failed (${zeMatch[0]})${detail}`,
|
|
130
|
-
exitCode: 0,
|
|
131
|
-
output
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
if (env.DEPLOY === "true") return {
|
|
135
|
-
success: false,
|
|
136
|
-
error: "No deploy URL found (Zephyr may have failed)",
|
|
137
|
-
exitCode: 0,
|
|
138
|
-
output
|
|
139
|
-
};
|
|
140
|
-
return {
|
|
141
|
-
success: true,
|
|
142
|
-
exitCode: 0,
|
|
143
|
-
output
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
async function buildOneWorkspace(ws, env, opts) {
|
|
147
|
-
const pkgJson = await readJsonFile(`${ws.path}/package.json`);
|
|
148
|
-
const buildConfig = opts.deploy && pkgJson.scripts?.deploy ? {
|
|
149
|
-
cmd: "bun",
|
|
150
|
-
args: ["run", "deploy"]
|
|
151
|
-
} : buildCommands[ws.key] ?? {
|
|
152
|
-
cmd: "bun",
|
|
153
|
-
args: ["run", "build"]
|
|
154
|
-
};
|
|
155
|
-
const wsEnv = { ...env };
|
|
156
|
-
const startTime = Date.now();
|
|
157
|
-
let attempt = await runBuildAttempt(buildConfig.cmd, buildConfig.args, ws.path, wsEnv, opts.verbose ?? false);
|
|
158
|
-
let retried = false;
|
|
159
|
-
const firstAttempt = attempt.success ? void 0 : { ...attempt };
|
|
160
|
-
if (!attempt.success && attempt.exitCode === 0 && opts.deploy) {
|
|
161
|
-
if (!opts.verbose) console.log(` ${require_theme.colors.yellow("↻")} ${require_string.padRight(ws.key, 28)} retrying...`);
|
|
162
|
-
retried = true;
|
|
163
|
-
attempt = await runBuildAttempt(buildConfig.cmd, buildConfig.args, ws.path, wsEnv, opts.verbose ?? false);
|
|
164
|
-
if (!attempt.success && firstAttempt) attempt.error = `First attempt: ${firstAttempt.error}\nRetry: ${attempt.error}`;
|
|
165
|
-
}
|
|
89
|
+
const exitCode = proc?.exitCode ?? 0;
|
|
166
90
|
const durationMs = Date.now() - startTime;
|
|
91
|
+
const output = `${proc?.stdout ?? ""}\n${proc?.stderr ?? ""}`;
|
|
167
92
|
const result = {
|
|
168
93
|
key: ws.key,
|
|
169
94
|
kind: ws.kind,
|
|
170
|
-
success:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
warnings: attempt.warnings,
|
|
174
|
-
deployEntries: attempt.deployEntries,
|
|
175
|
-
durationMs,
|
|
176
|
-
retried: retried ? true : void 0
|
|
95
|
+
success: exitCode === 0,
|
|
96
|
+
...exitCode !== 0 && { error: `Build failed (exit code ${exitCode})\n${output.trim().split("\n").slice(-5).join("\n")}` },
|
|
97
|
+
durationMs
|
|
177
98
|
};
|
|
178
|
-
if (!
|
|
99
|
+
if (!verbose) {
|
|
179
100
|
const name = require_string.padRight(ws.key, 28);
|
|
180
|
-
if (result.success) {
|
|
181
|
-
|
|
182
|
-
const retryTag = retried ? " (retried)" : "";
|
|
183
|
-
console.log(` ${require_theme.colors.green(require_theme.icons.ok)} ${name} ${require_theme.colors.dim(duration + retryTag)}`);
|
|
184
|
-
} else {
|
|
101
|
+
if (result.success) console.log(` ${require_theme.colors.green(require_theme.icons.ok)} ${name} ${require_theme.colors.dim(require_timing.formatDuration(durationMs))}`);
|
|
102
|
+
else {
|
|
185
103
|
const errorLine = (result.error ?? "Failed").split("\n")[0];
|
|
186
104
|
console.log(` ${require_theme.colors.error(require_theme.icons.err)} ${name} ${errorLine}`);
|
|
187
105
|
}
|
|
@@ -209,21 +127,18 @@ async function buildWorkspaceTargets(opts) {
|
|
|
209
127
|
hostMode: "local",
|
|
210
128
|
bosConfig: opts.bosConfig ?? void 0,
|
|
211
129
|
extendsChain: []
|
|
212
|
-
})).catalogChanged) await require_run.run("
|
|
213
|
-
const shouldBuildPlugin = existing.some((entry) => entry.key === "api");
|
|
214
|
-
const forceRebuild = opts.deploy;
|
|
215
|
-
const buildTasks = [buildEverythingDevQuietly(opts.configDir, forceRebuild)];
|
|
216
|
-
if (shouldBuildPlugin) buildTasks.push(buildEveryPluginQuietly(opts.configDir, forceRebuild));
|
|
217
|
-
await Promise.all(buildTasks);
|
|
130
|
+
})).catalogChanged) await require_run.run("pnpm", ["install"], { cwd: require_workspace.findWorkspaceRoot(opts.configDir)?.dir ?? opts.configDir });
|
|
218
131
|
const env = {
|
|
219
132
|
...node_process.default.env,
|
|
220
133
|
NODE_ENV: opts.deploy ? "production" : "development"
|
|
221
134
|
};
|
|
222
135
|
if (opts.deploy) env.DEPLOY = "true";
|
|
223
136
|
else delete env.DEPLOY;
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
137
|
+
const depsReport = await require_workspace.ensureFreshDeps(opts.configDir, existing.map((entry) => entry.path), {
|
|
138
|
+
force: opts.deploy,
|
|
139
|
+
env
|
|
140
|
+
});
|
|
141
|
+
if (depsReport.rebuilt.length > 0) console.log(` ${require_theme.colors.dim(`prerequisites: rebuilt ${depsReport.rebuilt.map((member) => member.name).join(", ")}`)}`);
|
|
227
142
|
const orderedExisting = opts.deploy ? [
|
|
228
143
|
...existing.filter((entry) => entry.kind === "app" && entry.key !== "host"),
|
|
229
144
|
...existing.filter((entry) => entry.kind === "plugin"),
|
|
@@ -239,15 +154,12 @@ async function buildWorkspaceTargets(opts) {
|
|
|
239
154
|
console.log(` Building ${total} workspace${total > 1 ? "s" : ""}...`);
|
|
240
155
|
console.log();
|
|
241
156
|
const results = await Promise.allSettled(parallelGroup.map((ws) => buildOneWorkspace(ws, env, opts)));
|
|
242
|
-
const allDeployEntries = [];
|
|
243
157
|
for (let i = 0; i < parallelGroup.length; i++) {
|
|
244
158
|
const ws = parallelGroup[i];
|
|
245
159
|
const result = results[i];
|
|
246
160
|
if (result.status === "fulfilled") {
|
|
247
161
|
if (result.value.success) built.push(ws.key);
|
|
248
|
-
|
|
249
|
-
const { deployEntries: _deployEntries, ...deployResult } = result.value;
|
|
250
|
-
deployResults.push(deployResult);
|
|
162
|
+
deployResults.push(result.value);
|
|
251
163
|
} else deployResults.push({
|
|
252
164
|
key: ws.key,
|
|
253
165
|
kind: ws.kind,
|
|
@@ -255,27 +167,15 @@ async function buildWorkspaceTargets(opts) {
|
|
|
255
167
|
error: result.reason?.message ?? "Unknown error"
|
|
256
168
|
});
|
|
257
169
|
}
|
|
258
|
-
if (configSnapshot && allDeployEntries.length > 0) {
|
|
259
|
-
const merged = require_integrity.applyDeployResults(JSON.parse(configSnapshot), allDeployEntries);
|
|
260
|
-
(0, node_fs.writeFileSync)(bosConfigPath, `${JSON.stringify(merged, null, 2)}\n`);
|
|
261
|
-
}
|
|
262
170
|
for (const ws of sequentialGroup) {
|
|
263
171
|
const result = await buildOneWorkspace(ws, env, opts);
|
|
264
172
|
if (result.success) built.push(ws.key);
|
|
265
|
-
|
|
266
|
-
const hostEntries = result.deployEntries.filter((r) => r.urlField.startsWith("app.host"));
|
|
267
|
-
if (hostEntries.length > 0 && (0, node_fs.existsSync)(bosConfigPath)) {
|
|
268
|
-
const merged = require_integrity.applyDeployResults(JSON.parse((0, node_fs.readFileSync)(bosConfigPath, "utf-8")), hostEntries);
|
|
269
|
-
(0, node_fs.writeFileSync)(bosConfigPath, `${JSON.stringify(merged, null, 2)}\n`);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
const { deployEntries: _deployEntries, ...sequentialResult } = result;
|
|
273
|
-
deployResults.push(sequentialResult);
|
|
173
|
+
deployResults.push(result);
|
|
274
174
|
}
|
|
275
175
|
console.log();
|
|
276
176
|
} else for (const resolved of orderedExisting) {
|
|
277
177
|
const buildConfig = buildCommands[resolved.key] ?? {
|
|
278
|
-
cmd: "
|
|
178
|
+
cmd: "pnpm",
|
|
279
179
|
args: ["run", "build"]
|
|
280
180
|
};
|
|
281
181
|
await require_run.run(buildConfig.cmd, buildConfig.args, {
|
|
@@ -290,47 +190,11 @@ async function buildWorkspaceTargets(opts) {
|
|
|
290
190
|
deployResults: opts.deploy ? deployResults : void 0
|
|
291
191
|
};
|
|
292
192
|
}
|
|
293
|
-
async function buildEveryPluginQuietly(cwd, force = false) {
|
|
294
|
-
if (!await fileExists(`${`${cwd}/packages/every-plugin`}/package.json`)) return;
|
|
295
|
-
if (await fileExists(`${cwd}/packages/every-plugin/dist/build/rspack/plugin.mjs`) && !force) return;
|
|
296
|
-
const result = await require_run.run("bun", [
|
|
297
|
-
"run",
|
|
298
|
-
"--cwd",
|
|
299
|
-
"packages/every-plugin",
|
|
300
|
-
"build"
|
|
301
|
-
], {
|
|
302
|
-
cwd,
|
|
303
|
-
capture: true
|
|
304
|
-
});
|
|
305
|
-
if (result.exitCode === 0) return;
|
|
306
|
-
if (result.stdout.trim()) node_process.default.stdout.write(result.stdout);
|
|
307
|
-
if (result.stderr.trim()) node_process.default.stderr.write(result.stderr);
|
|
308
|
-
throw new Error(`bun run --cwd packages/every-plugin build failed with exit code ${result.exitCode}`);
|
|
309
|
-
}
|
|
310
|
-
async function buildEverythingDevQuietly(cwd, force = false) {
|
|
311
|
-
if (!await fileExists(`${`${cwd}/packages/everything-dev`}/package.json`)) return;
|
|
312
|
-
if (await fileExists(`${cwd}/packages/everything-dev/dist/index.mjs`) && !force) return;
|
|
313
|
-
const result = await require_run.run("bun", [
|
|
314
|
-
"run",
|
|
315
|
-
"--cwd",
|
|
316
|
-
"packages/everything-dev",
|
|
317
|
-
"build"
|
|
318
|
-
], {
|
|
319
|
-
cwd,
|
|
320
|
-
capture: true
|
|
321
|
-
});
|
|
322
|
-
if (result.exitCode === 0) return;
|
|
323
|
-
if (result.stdout.trim()) node_process.default.stdout.write(result.stdout);
|
|
324
|
-
if (result.stderr.trim()) node_process.default.stderr.write(result.stderr);
|
|
325
|
-
throw new Error(`bun run --cwd packages/everything-dev build failed with exit code ${result.exitCode}`);
|
|
326
|
-
}
|
|
327
193
|
|
|
328
194
|
//#endregion
|
|
329
|
-
exports.buildEveryPluginQuietly = buildEveryPluginQuietly;
|
|
330
|
-
exports.buildEverythingDevQuietly = buildEverythingDevQuietly;
|
|
331
195
|
exports.buildWorkspaceTargets = buildWorkspaceTargets;
|
|
332
196
|
exports.fileExists = fileExists;
|
|
333
197
|
exports.getPluginRef = getPluginRef;
|
|
334
|
-
exports.
|
|
198
|
+
exports.resolveWorkspaceTarget = resolveWorkspaceTarget;
|
|
335
199
|
exports.selectWorkspaceTargets = selectWorkspaceTargets;
|
|
336
200
|
//# sourceMappingURL=build.cjs.map
|
package/dist/build.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.cjs","names":["resolveLocalDevelopmentPath","run","parseDeployLines","colors","padRight","formatDuration","icons","syncResolvedSharedDeps","process","applyDeployResults"],"sources":["../src/build.ts"],"sourcesContent":["import { existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { access, readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport process from \"node:process\";\nimport { formatDuration } from \"./cli/timing\";\nimport { resolveLocalDevelopmentPath } from \"./config\";\nimport type { WorkspaceDeployResult } from \"./contract\";\nimport { applyDeployResults, type DeployResultEntry, parseDeployLines } from \"./integrity\";\nimport { syncResolvedSharedDeps } from \"./shared-deps\";\nimport type { BosConfig, BosPluginRef, RuntimeConfig } from \"./types\";\nimport { run } from \"./utils/run\";\nimport { padRight } from \"./utils/string\";\nimport { colors, icons } from \"./utils/theme\";\n\nconst buildCommands: Record<string, { cmd: string; args: string[] }> = {\n host: { cmd: \"bun\", args: [\"run\", \"build\"] },\n ui: { cmd: \"bun\", args: [\"run\", \"build\"] },\n api: { cmd: \"bun\", args: [\"run\", \"build\"] },\n};\n\ntype WorkspaceTarget = {\n key: string;\n kind: \"app\" | \"plugin\";\n path: string;\n};\n\nexport function getPluginRef(entry: string | BosPluginRef | undefined | null): BosPluginRef | null {\n if (!entry || typeof entry === \"string\") return null;\n return entry;\n}\n\nexport async function fileExists(path: string): Promise<boolean> {\n try {\n await access(path);\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function readJsonFile<T>(path: string): Promise<T> {\n return JSON.parse(await readFile(path, \"utf8\")) as T;\n}\n\nfunction resolveWorkspaceTarget(\n key: string,\n bosConfig: BosConfig | null,\n runtimeConfig: RuntimeConfig | null,\n configDir: string,\n): WorkspaceTarget | null {\n if (bosConfig?.app && key in bosConfig.app) {\n const appEntry = (bosConfig.app as Record<string, { development?: string }>)[key];\n const devPath = resolveLocalDevelopmentPath(appEntry?.development, configDir);\n if (devPath) {\n return {\n key,\n kind: \"app\",\n path: devPath,\n };\n }\n return {\n key,\n kind: \"app\",\n path: `${configDir}/${key}`,\n };\n }\n\n const runtimePlugin = runtimeConfig?.plugins?.[key];\n const pluginPath =\n runtimePlugin?.localPath ??\n resolveLocalDevelopmentPath(getPluginRef(bosConfig?.plugins?.[key])?.development, configDir);\n if (pluginPath) {\n return {\n key,\n kind: \"plugin\",\n path: pluginPath,\n };\n }\n\n return null;\n}\n\nexport function selectWorkspaceTargets(packages: string, bosConfig: BosConfig | null): string[] {\n const allPackages = [\n ...Object.keys(bosConfig?.app ?? {}),\n ...Object.keys(bosConfig?.plugins ?? {}),\n ];\n if (packages === \"all\") {\n return allPackages;\n }\n\n return packages\n .split(\",\")\n .map((pkg) => pkg.trim())\n .filter((pkg) => allPackages.includes(pkg));\n}\n\ninterface BuildAttemptResult {\n success: boolean;\n url?: string;\n error?: string;\n warnings?: string[];\n exitCode: number;\n output: string;\n deployEntries?: DeployResultEntry[];\n}\n\nasync function runBuildAttempt(\n cmd: string,\n args: string[],\n cwd: string,\n env: Record<string, string>,\n verbose: boolean,\n): Promise<BuildAttemptResult> {\n const result = await run(cmd, args, {\n cwd,\n env,\n capture: true,\n onChunk: (stream, chunk) => {\n if (stream === \"stderr\") {\n process.stderr.write(chunk);\n } else if (verbose) {\n process.stdout.write(chunk);\n }\n const text = chunk.toString(\"utf-8\");\n if (/ZEPHYR|auth\\.zephyr-cloud\\.io\\/authorize|ZE\\d{4,}/.test(text)) {\n process.stdout.write(chunk);\n }\n },\n });\n const stdout = result?.stdout ?? \"\";\n const stderr = result?.stderr ?? \"\";\n const exitCode = result?.exitCode ?? 0;\n const output = `${stdout}\\n${stderr}`;\n\n const deployEntries = parseDeployLines(output);\n\n if (deployEntries.length > 0) {\n const result: BuildAttemptResult = {\n success: true,\n url: deployEntries[0]?.url,\n exitCode: 0,\n output,\n deployEntries,\n };\n if (exitCode !== 0) {\n const errorLines = output\n .split(\"\\n\")\n .filter((line) => /\\bERROR\\b/.test(line) || line.startsWith(\"Rspack compiled with\"))\n .slice(0, 5);\n if (errorLines.length > 0) {\n result.warnings = errorLines.map((l) => l.trim());\n if (!verbose) {\n console.log(\n ` ${colors.yellow(\"⚠\")} Build completed with errors (exit code ${exitCode}) — Zephyr deployed successfully`,\n );\n for (const line of errorLines) {\n console.log(` ${colors.dim(line.trim())}`);\n }\n }\n }\n }\n return result;\n }\n\n if (exitCode !== 0) {\n const lastLines = output.trim().split(\"\\n\").slice(-5).join(\"\\n\");\n return {\n success: false,\n error: `Build failed (exit code ${exitCode})\\n${lastLines}`,\n exitCode,\n output,\n };\n }\n\n const deployMatch = output.match(/🚀.*Deployed:\\s*(https?:\\S+)/);\n if (deployMatch) {\n return { success: true, url: deployMatch[1], exitCode: 0, output };\n }\n\n const zeMatch = output.match(/ZE\\d{4,}/);\n if (zeMatch) {\n const zeLines = output\n .split(\"\\n\")\n .filter((l) => /ZEPHYR|ZE\\d{4,}/.test(l))\n .slice(0, 5);\n const detail = zeLines.length > 0 ? `\\n${zeLines.join(\"\\n\")}` : \"\";\n return {\n success: false,\n error: `Zephyr upload failed (${zeMatch[0]})${detail}`,\n exitCode: 0,\n output,\n };\n }\n\n if (env.DEPLOY === \"true\") {\n return {\n success: false,\n error: \"No deploy URL found (Zephyr may have failed)\",\n exitCode: 0,\n output,\n };\n }\n return { success: true, exitCode: 0, output };\n}\n\ninterface InternalWorkspaceResult extends WorkspaceDeployResult {\n deployEntries?: DeployResultEntry[];\n}\n\nasync function buildOneWorkspace(\n ws: WorkspaceTarget,\n env: Record<string, string>,\n opts: { deploy: boolean; verbose?: boolean },\n): Promise<InternalWorkspaceResult> {\n const pkgJson = await readJsonFile<{\n scripts?: Record<string, string>;\n }>(`${ws.path}/package.json`);\n const shouldDeployScript = opts.deploy && pkgJson.scripts?.deploy;\n const buildConfig = shouldDeployScript\n ? { cmd: \"bun\", args: [\"run\", \"deploy\"] }\n : (buildCommands[ws.key] ?? { cmd: \"bun\", args: [\"run\", \"build\"] });\n\n const wsEnv = { ...env };\n\n const startTime = Date.now();\n let attempt = await runBuildAttempt(\n buildConfig.cmd,\n buildConfig.args,\n ws.path,\n wsEnv,\n opts.verbose ?? false,\n );\n\n let retried = false;\n const firstAttempt: BuildAttemptResult | undefined = attempt.success ? undefined : { ...attempt };\n\n if (!attempt.success && attempt.exitCode === 0 && opts.deploy) {\n if (!opts.verbose) {\n console.log(` ${colors.yellow(\"↻\")} ${padRight(ws.key, 28)} retrying...`);\n }\n retried = true;\n attempt = await runBuildAttempt(\n buildConfig.cmd,\n buildConfig.args,\n ws.path,\n wsEnv,\n opts.verbose ?? false,\n );\n\n if (!attempt.success && firstAttempt) {\n attempt.error = `First attempt: ${firstAttempt.error}\\nRetry: ${attempt.error}`;\n }\n }\n\n const durationMs = Date.now() - startTime;\n const result: InternalWorkspaceResult = {\n key: ws.key,\n kind: ws.kind,\n success: attempt.success,\n url: attempt.url,\n error: attempt.error,\n warnings: attempt.warnings,\n deployEntries: attempt.deployEntries,\n durationMs,\n retried: retried ? true : undefined,\n };\n\n if (!opts.verbose) {\n const name = padRight(ws.key, 28);\n if (result.success) {\n const duration = formatDuration(durationMs);\n const retryTag = retried ? \" (retried)\" : \"\";\n console.log(` ${colors.green(icons.ok)} ${name} ${colors.dim(duration + retryTag)}`);\n } else {\n const errorLine = (result.error ?? \"Failed\").split(\"\\n\")[0];\n console.log(` ${colors.error(icons.err)} ${name} ${errorLine}`);\n }\n }\n\n return result;\n}\n\nexport async function buildWorkspaceTargets(opts: {\n configDir: string;\n bosConfig: BosConfig | null;\n runtimeConfig: RuntimeConfig | null;\n targets: string[];\n deploy: boolean;\n verbose?: boolean;\n}): Promise<{\n built: string[];\n skipped: string[];\n deployResults?: WorkspaceDeployResult[];\n}> {\n const existing: WorkspaceTarget[] = [];\n const skipped: string[] = [];\n\n for (const target of opts.targets) {\n const resolved = resolveWorkspaceTarget(\n target,\n opts.bosConfig,\n opts.runtimeConfig,\n opts.configDir,\n );\n if (!resolved) {\n skipped.push(target);\n continue;\n }\n\n const exists = await fileExists(`${resolved.path}/package.json`);\n if (exists) existing.push(resolved);\n else skipped.push(target);\n }\n\n if (existing.length === 0) {\n return { built: [], skipped };\n }\n\n const sharedSync = await syncResolvedSharedDeps({\n configDir: opts.configDir,\n hostMode: \"local\",\n bosConfig: opts.bosConfig ?? undefined,\n extendsChain: [],\n });\n if (sharedSync.catalogChanged) {\n await run(\"bun\", [\"install\"], { cwd: opts.configDir });\n }\n\n const shouldBuildPlugin = existing.some((entry) => entry.key === \"api\");\n\n const forceRebuild = opts.deploy;\n const buildTasks: Promise<void>[] = [buildEverythingDevQuietly(opts.configDir, forceRebuild)];\n if (shouldBuildPlugin) {\n buildTasks.push(buildEveryPluginQuietly(opts.configDir, forceRebuild));\n }\n await Promise.all(buildTasks);\n\n const env: Record<string, string> = {\n ...process.env,\n NODE_ENV: opts.deploy ? \"production\" : \"development\",\n };\n if (opts.deploy) {\n env.DEPLOY = \"true\";\n } else {\n delete env.DEPLOY;\n }\n\n const bosConfigPath = join(opts.configDir, \"bos.config.json\");\n let configSnapshot: string | undefined;\n if (opts.deploy && existsSync(bosConfigPath)) {\n configSnapshot = readFileSync(bosConfigPath, \"utf-8\");\n }\n\n const orderedExisting = opts.deploy\n ? [\n ...existing.filter((entry) => entry.kind === \"app\" && entry.key !== \"host\"),\n ...existing.filter((entry) => entry.kind === \"plugin\"),\n ...existing.filter((entry) => entry.kind === \"app\" && entry.key === \"host\"),\n ]\n : existing;\n\n const parallelGroup = opts.deploy\n ? orderedExisting.filter((e) => e.key !== \"host\")\n : orderedExisting;\n const sequentialGroup = opts.deploy ? orderedExisting.filter((e) => e.key === \"host\") : [];\n\n const built: string[] = [];\n const deployResults: WorkspaceDeployResult[] = [];\n\n if (opts.deploy && parallelGroup.length > 0) {\n const total = parallelGroup.length + sequentialGroup.length;\n console.log();\n console.log(` Building ${total} workspace${total > 1 ? \"s\" : \"\"}...`);\n console.log();\n\n const results = await Promise.allSettled(\n parallelGroup.map((ws) => buildOneWorkspace(ws, env, opts)),\n );\n\n const allDeployEntries: DeployResultEntry[] = [];\n for (let i = 0; i < parallelGroup.length; i++) {\n const ws = parallelGroup[i];\n const result = results[i];\n if (result.status === \"fulfilled\") {\n if (result.value.success) {\n built.push(ws.key);\n }\n if (result.value.deployEntries) {\n allDeployEntries.push(...result.value.deployEntries);\n }\n const { deployEntries: _deployEntries, ...deployResult } = result.value;\n deployResults.push(deployResult);\n } else {\n deployResults.push({\n key: ws.key,\n kind: ws.kind,\n success: false,\n error: result.reason?.message ?? \"Unknown error\",\n });\n }\n }\n\n if (configSnapshot && allDeployEntries.length > 0) {\n const config = JSON.parse(configSnapshot) as Record<string, unknown>;\n const merged = applyDeployResults(config, allDeployEntries);\n writeFileSync(bosConfigPath, `${JSON.stringify(merged, null, 2)}\\n`);\n }\n\n for (const ws of sequentialGroup) {\n const result = await buildOneWorkspace(ws, env, opts);\n if (result.success) {\n built.push(ws.key);\n }\n if (result.deployEntries) {\n const hostEntries = result.deployEntries.filter((r) => r.urlField.startsWith(\"app.host\"));\n if (hostEntries.length > 0 && existsSync(bosConfigPath)) {\n const currentConfig = JSON.parse(readFileSync(bosConfigPath, \"utf-8\")) as Record<\n string,\n unknown\n >;\n const merged = applyDeployResults(currentConfig, hostEntries);\n writeFileSync(bosConfigPath, `${JSON.stringify(merged, null, 2)}\\n`);\n }\n }\n const { deployEntries: _deployEntries, ...sequentialResult } = result;\n deployResults.push(sequentialResult);\n }\n\n console.log();\n } else {\n for (const resolved of orderedExisting) {\n const buildConfig = buildCommands[resolved.key] ?? {\n cmd: \"bun\",\n args: [\"run\", \"build\"],\n };\n\n await run(buildConfig.cmd, buildConfig.args, {\n cwd: resolved.path,\n env,\n });\n built.push(resolved.key);\n }\n }\n\n return { built, skipped, deployResults: opts.deploy ? deployResults : undefined };\n}\n\nexport async function buildEveryPluginQuietly(cwd: string, force = false) {\n const packageDir = `${cwd}/packages/every-plugin`;\n const packageExists = await fileExists(`${packageDir}/package.json`);\n if (!packageExists) {\n return;\n }\n\n const distPath = `${cwd}/packages/every-plugin/dist/build/rspack/plugin.mjs`;\n const distExists = await fileExists(distPath);\n\n if (distExists && !force) {\n return;\n }\n\n const result = (await run(\"bun\", [\"run\", \"--cwd\", \"packages/every-plugin\", \"build\"], {\n cwd,\n capture: true,\n })) as { stdout: string; stderr: string; exitCode: number };\n\n if (result.exitCode === 0) {\n return;\n }\n\n if (result.stdout.trim()) {\n process.stdout.write(result.stdout);\n }\n\n if (result.stderr.trim()) {\n process.stderr.write(result.stderr);\n }\n\n throw new Error(\n `bun run --cwd packages/every-plugin build failed with exit code ${result.exitCode}`,\n );\n}\n\nexport async function buildEverythingDevQuietly(cwd: string, force = false) {\n const packageDir = `${cwd}/packages/everything-dev`;\n const packageExists = await fileExists(`${packageDir}/package.json`);\n if (!packageExists) {\n return;\n }\n\n const distPath = `${cwd}/packages/everything-dev/dist/index.mjs`;\n const distExists = await fileExists(distPath);\n\n if (distExists && !force) {\n return;\n }\n\n const result = (await run(\"bun\", [\"run\", \"--cwd\", \"packages/everything-dev\", \"build\"], {\n cwd,\n capture: true,\n })) as { stdout: string; stderr: string; exitCode: number };\n\n if (result.exitCode === 0) {\n return;\n }\n\n if (result.stdout.trim()) {\n process.stdout.write(result.stdout);\n }\n\n if (result.stderr.trim()) {\n process.stderr.write(result.stderr);\n }\n\n throw new Error(\n `bun run --cwd packages/everything-dev build failed with exit code ${result.exitCode}`,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAM,gBAAiE;CACrE,MAAM;EAAE,KAAK;EAAO,MAAM,CAAC,OAAO,OAAO;CAAE;CAC3C,IAAI;EAAE,KAAK;EAAO,MAAM,CAAC,OAAO,OAAO;CAAE;CACzC,KAAK;EAAE,KAAK;EAAO,MAAM,CAAC,OAAO,OAAO;CAAE;AAC5C;AAQA,SAAgB,aAAa,OAAsE;CACjG,IAAI,CAAC,SAAS,OAAO,UAAU,UAAU,OAAO;CAChD,OAAO;AACT;AAEA,eAAsB,WAAW,MAAgC;CAC/D,IAAI;EACF,mCAAa,IAAI;EACjB,OAAO;CACT,QAAQ;EACN,OAAO;CACT;AACF;AAEA,eAAsB,aAAgB,MAA0B;CAC9D,OAAO,KAAK,MAAM,qCAAe,MAAM,MAAM,CAAC;AAChD;AAEA,SAAS,uBACP,KACA,WACA,eACA,WACwB;CACxB,IAAI,WAAW,OAAO,OAAO,UAAU,KAAK;EAC1C,MAAM,WAAY,UAAU,IAAiD;EAC7E,MAAM,UAAUA,2CAA4B,UAAU,aAAa,SAAS;EAC5E,IAAI,SACF,OAAO;GACL;GACA,MAAM;GACN,MAAM;EACR;EAEF,OAAO;GACL;GACA,MAAM;GACN,MAAM,GAAG,UAAU,GAAG;EACxB;CACF;CAGA,MAAM,cADgB,eAAe,UAAU,KAEhC,EAAE,aACfA,2CAA4B,aAAa,WAAW,UAAU,IAAI,CAAC,EAAE,aAAa,SAAS;CAC7F,IAAI,YACF,OAAO;EAC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AAI,OAAO,OAAO,KAAK,GACrB,qBAAQ,OAAO,MAAM,OAAO,MAAM;CAGpC,IAAI,OAAO,OAAO,KAAK,GACrB,qBAAQ,OAAO,MAAM,OAAO,MAAM;CAGpC,MAAM,IAAI,MACR,mEAAmE,OAAO,UAC5E;AACF;AAEA,eAAsB,0BAA0B,KAAa,QAAQ,OAAO;CAG1E,IAAI,CAAC,MADuB,WAAW,GAAG,GADpB,IAAI,0BAC2B,cAAc,GAEjE;CAMF,IAAI,MAFqB,WAAW,GADhB,IAAI,wCACoB,KAE1B,CAAC,OACjB;CAGF,MAAM,SAAU,MAAMA,gBAAI,OAAO;EAAC;EAAO;EAAS;EAA2B;CAAO,GAAG;EACrF;EACA,SAAS;CACX,CAAC;CAED,IAAI,OAAO,aAAa,GACtB;CAGF,IAAI,OAAO,OAAO,KAAK,GACrB,qBAAQ,OAAO,MAAM,OAAO,MAAM;CAGpC,IAAI,OAAO,OAAO,KAAK,GACrB,qBAAQ,OAAO,MAAM,OAAO,MAAM;CAGpC,MAAM,IAAI,MACR,qEAAqE,OAAO,UAC9E;AACF"}
|
|
1
|
+
{"version":3,"file":"build.cjs","names":["access","resolveLocalDevelopmentPath","run","padRight","colors","icons","formatDuration","syncResolvedSharedDeps","findWorkspaceRoot","process","ensureFreshDeps"],"sources":["../src/build.ts"],"sourcesContent":["import { access, readFile } from \"node:fs/promises\";\nimport process from \"node:process\";\nimport { formatDuration } from \"./cli/timing\";\nimport { resolveLocalDevelopmentPath } from \"./config\";\nimport type { WorkspaceDeployResult } from \"./contract\";\nimport { syncResolvedSharedDeps } from \"./shared-deps\";\nimport type { BosConfig, BosPluginRef, RuntimeConfig } from \"./types\";\nimport { run } from \"./utils/run\";\nimport { padRight } from \"./utils/string\";\nimport { colors, icons } from \"./utils/theme\";\nimport { ensureFreshDeps, findWorkspaceRoot } from \"./workspace\";\n\nconst buildCommands: Record<string, { cmd: string; args: string[] }> = {\n host: { cmd: \"pnpm\", args: [\"run\", \"build\"] },\n ui: { cmd: \"pnpm\", args: [\"run\", \"build\"] },\n api: { cmd: \"pnpm\", args: [\"run\", \"build\"] },\n};\n\nexport type WorkspaceTarget = {\n key: string;\n kind: \"app\" | \"plugin\";\n path: string;\n};\n\nexport function getPluginRef(entry: string | BosPluginRef | undefined | null): BosPluginRef | null {\n if (!entry || typeof entry === \"string\") return null;\n return entry;\n}\n\nexport async function fileExists(path: string): Promise<boolean> {\n try {\n await access(path);\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function readJsonFile<T>(path: string): Promise<T> {\n return JSON.parse(await readFile(path, \"utf8\")) as T;\n}\n\nexport function resolveWorkspaceTarget(\n key: string,\n bosConfig: BosConfig | null,\n runtimeConfig: RuntimeConfig | null,\n configDir: string,\n): WorkspaceTarget | null {\n if (bosConfig?.app && key in bosConfig.app) {\n const appEntry = (bosConfig.app as Record<string, { development?: string }>)[key];\n const devPath = resolveLocalDevelopmentPath(appEntry?.development, configDir);\n if (devPath) {\n return {\n key,\n kind: \"app\",\n path: devPath,\n };\n }\n return {\n key,\n kind: \"app\",\n path: `${configDir}/${key}`,\n };\n }\n\n const runtimePlugin = runtimeConfig?.plugins?.[key];\n const pluginPath =\n runtimePlugin?.localPath ??\n resolveLocalDevelopmentPath(getPluginRef(bosConfig?.plugins?.[key])?.development, configDir);\n if (pluginPath) {\n return {\n key,\n kind: \"plugin\",\n path: pluginPath,\n };\n }\n\n return null;\n}\n\nexport function selectWorkspaceTargets(packages: string, bosConfig: BosConfig | null): string[] {\n const allPackages = [\n ...Object.keys(bosConfig?.app ?? {}),\n ...Object.keys(bosConfig?.plugins ?? {}),\n ];\n if (packages === \"all\") {\n return allPackages;\n }\n if (packages === \"local\") {\n return allPackages.filter((k) => isLocalTarget(k, bosConfig));\n }\n\n return packages\n .split(\",\")\n .map((pkg) => pkg.trim())\n .filter((pkg) => allPackages.includes(pkg));\n}\n\nfunction isLocalTarget(key: string, bosConfig: BosConfig | null): boolean {\n const slot =\n (bosConfig?.app as Record<string, { development?: string }> | undefined)?.[key] ??\n bosConfig?.plugins?.[key];\n const dev = (slot as { development?: unknown } | undefined)?.development;\n return typeof dev === \"string\" && dev.startsWith(\"local:\");\n}\n\ninterface WorkspaceBuildOutcome {\n key: string;\n kind: \"app\" | \"plugin\";\n success: boolean;\n error?: string;\n durationMs: number;\n}\n\nasync function buildOneWorkspace(\n ws: WorkspaceTarget,\n env: Record<string, string>,\n opts: { verbose?: boolean },\n): Promise<WorkspaceBuildOutcome> {\n const buildConfig = buildCommands[ws.key] ?? { cmd: \"pnpm\", args: [\"run\", \"build\"] };\n const verbose = opts.verbose ?? false;\n const startTime = Date.now();\n\n const proc = await run(buildConfig.cmd, buildConfig.args, {\n cwd: ws.path,\n env,\n capture: true,\n onChunk: (stream, chunk) => {\n if (stream === \"stderr\") {\n process.stderr.write(chunk);\n } else if (verbose) {\n process.stdout.write(chunk);\n }\n },\n });\n\n const exitCode = proc?.exitCode ?? 0;\n const durationMs = Date.now() - startTime;\n const output = `${proc?.stdout ?? \"\"}\\n${proc?.stderr ?? \"\"}`;\n const result: WorkspaceBuildOutcome = {\n key: ws.key,\n kind: ws.kind,\n success: exitCode === 0,\n ...(exitCode !== 0 && {\n error: `Build failed (exit code ${exitCode})\\n${output.trim().split(\"\\n\").slice(-5).join(\"\\n\")}`,\n }),\n durationMs,\n };\n\n if (!verbose) {\n const name = padRight(ws.key, 28);\n if (result.success) {\n console.log(` ${colors.green(icons.ok)} ${name} ${colors.dim(formatDuration(durationMs))}`);\n } else {\n const errorLine = (result.error ?? \"Failed\").split(\"\\n\")[0];\n console.log(` ${colors.error(icons.err)} ${name} ${errorLine}`);\n }\n }\n\n return result;\n}\n\nexport async function buildWorkspaceTargets(opts: {\n configDir: string;\n bosConfig: BosConfig | null;\n runtimeConfig: RuntimeConfig | null;\n targets: string[];\n deploy: boolean;\n verbose?: boolean;\n}): Promise<{\n built: string[];\n skipped: string[];\n deployResults?: WorkspaceDeployResult[];\n}> {\n const existing: WorkspaceTarget[] = [];\n const skipped: string[] = [];\n\n for (const target of opts.targets) {\n const resolved = resolveWorkspaceTarget(\n target,\n opts.bosConfig,\n opts.runtimeConfig,\n opts.configDir,\n );\n if (!resolved) {\n skipped.push(target);\n continue;\n }\n\n const exists = await fileExists(`${resolved.path}/package.json`);\n if (exists) existing.push(resolved);\n else skipped.push(target);\n }\n\n if (existing.length === 0) {\n return { built: [], skipped };\n }\n\n const sharedSync = await syncResolvedSharedDeps({\n configDir: opts.configDir,\n hostMode: \"local\",\n bosConfig: opts.bosConfig ?? undefined,\n extendsChain: [],\n });\n if (sharedSync.catalogChanged) {\n await run(\"pnpm\", [\"install\"], {\n cwd: findWorkspaceRoot(opts.configDir)?.dir ?? opts.configDir,\n });\n }\n\n // Prerequisite train: every target's local workspace deps get fresh dists\n // before the target builds (runtime subpaths resolve from dist — ADR 0018;\n // bundler-config factories resolve from src, so the config chain cannot go\n // stale). Fresh members no-op; failures are loud. Deploy prerequisite\n // builds run in the same build mode as the target builds below — one env\n // contract for every deploy build child.\n const env: Record<string, string> = {\n ...process.env,\n NODE_ENV: opts.deploy ? \"production\" : \"development\",\n };\n // Dist-first deploy builds (ADR 0018): a deploy build must never inherit a\n // DEPLOY value from the operator's shell, and a dev build must never see one.\n if (opts.deploy) env.DEPLOY = \"true\";\n else delete env.DEPLOY;\n\n const depsReport = await ensureFreshDeps(\n opts.configDir,\n existing.map((entry) => entry.path),\n { force: opts.deploy, env },\n );\n if (depsReport.rebuilt.length > 0) {\n console.log(\n ` ${colors.dim(`prerequisites: rebuilt ${depsReport.rebuilt.map((member) => member.name).join(\", \")}`)}`,\n );\n }\n\n const orderedExisting = opts.deploy\n ? [\n ...existing.filter((entry) => entry.kind === \"app\" && entry.key !== \"host\"),\n ...existing.filter((entry) => entry.kind === \"plugin\"),\n ...existing.filter((entry) => entry.kind === \"app\" && entry.key === \"host\"),\n ]\n : existing;\n\n const parallelGroup = opts.deploy\n ? orderedExisting.filter((e) => e.key !== \"host\")\n : orderedExisting;\n const sequentialGroup = opts.deploy ? orderedExisting.filter((e) => e.key === \"host\") : [];\n\n const built: string[] = [];\n const deployResults: WorkspaceDeployResult[] = [];\n\n if (opts.deploy && parallelGroup.length > 0) {\n const total = parallelGroup.length + sequentialGroup.length;\n console.log();\n console.log(` Building ${total} workspace${total > 1 ? \"s\" : \"\"}...`);\n console.log();\n\n const results = await Promise.allSettled(\n parallelGroup.map((ws) => buildOneWorkspace(ws, env, opts)),\n );\n\n for (let i = 0; i < parallelGroup.length; i++) {\n const ws = parallelGroup[i];\n const result = results[i];\n if (result.status === \"fulfilled\") {\n if (result.value.success) {\n built.push(ws.key);\n }\n deployResults.push(result.value);\n } else {\n deployResults.push({\n key: ws.key,\n kind: ws.kind,\n success: false,\n error: result.reason?.message ?? \"Unknown error\",\n });\n }\n }\n\n for (const ws of sequentialGroup) {\n const result = await buildOneWorkspace(ws, env, opts);\n if (result.success) {\n built.push(ws.key);\n }\n deployResults.push(result);\n }\n\n console.log();\n } else {\n for (const resolved of orderedExisting) {\n const buildConfig = buildCommands[resolved.key] ?? {\n cmd: \"pnpm\",\n args: [\"run\", \"build\"],\n };\n\n await run(buildConfig.cmd, buildConfig.args, {\n cwd: resolved.path,\n env,\n });\n built.push(resolved.key);\n }\n }\n\n return { built, skipped, deployResults: opts.deploy ? deployResults : undefined };\n}\n"],"mappings":";;;;;;;;;;;;;AAYA,MAAM,gBAAiE;CACrE,MAAM;EAAE,KAAK;EAAQ,MAAM,CAAC,OAAO,OAAO;CAAE;CAC5C,IAAI;EAAE,KAAK;EAAQ,MAAM,CAAC,OAAO,OAAO;CAAE;CAC1C,KAAK;EAAE,KAAK;EAAQ,MAAM,CAAC,OAAO,OAAO;CAAE;AAC7C;AAQA,SAAgB,aAAa,OAAsE;CACjG,IAAI,CAAC,SAAS,OAAO,UAAU,UAAU,OAAO;CAChD,OAAO;AACT;AAEA,eAAsB,WAAW,MAAgC;CAC/D,IAAI;EACF,UAAMA,yBAAO,IAAI;EACjB,OAAO;CACT,QAAQ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