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
package/dist/api-contract.cjs
CHANGED
|
@@ -1,10 +1,152 @@
|
|
|
1
1
|
const require_auth_types_gen = require('./auth-types-gen.cjs');
|
|
2
2
|
const require_http_client = require('./http-client.cjs');
|
|
3
|
+
const require_service_descriptor = require('./service-descriptor.cjs');
|
|
3
4
|
let node_fs = require("node:fs");
|
|
4
5
|
let node_path = require("node:path");
|
|
6
|
+
let effect = require("effect");
|
|
5
7
|
let node_crypto = require("node:crypto");
|
|
6
8
|
|
|
7
9
|
//#region src/api-contract.ts
|
|
10
|
+
var ApiManifestFetchError = class extends effect.Schema.TaggedError()("ApiManifestFetchError", {
|
|
11
|
+
url: effect.Schema.String,
|
|
12
|
+
message: effect.Schema.String
|
|
13
|
+
}) {};
|
|
14
|
+
var ApiManifestFormatError = class extends effect.Schema.TaggedError()("ApiManifestFormatError", {
|
|
15
|
+
url: effect.Schema.String,
|
|
16
|
+
message: effect.Schema.String
|
|
17
|
+
}) {};
|
|
18
|
+
var MissingContractTypesError = class extends effect.Schema.TaggedError()("MissingContractTypesError", {
|
|
19
|
+
pluginName: effect.Schema.String,
|
|
20
|
+
message: effect.Schema.String
|
|
21
|
+
}) {};
|
|
22
|
+
var ContractTypesFetchError = class extends effect.Schema.TaggedError()("ContractTypesFetchError", {
|
|
23
|
+
url: effect.Schema.String,
|
|
24
|
+
message: effect.Schema.String
|
|
25
|
+
}) {};
|
|
26
|
+
var ContractTypesChecksumError = class extends effect.Schema.TaggedError()("ContractTypesChecksumError", {
|
|
27
|
+
url: effect.Schema.String,
|
|
28
|
+
message: effect.Schema.String
|
|
29
|
+
}) {};
|
|
30
|
+
var AuthExportFetchError = class extends effect.Schema.TaggedError()("AuthExportFetchError", {
|
|
31
|
+
url: effect.Schema.String,
|
|
32
|
+
message: effect.Schema.String
|
|
33
|
+
}) {};
|
|
34
|
+
var ApiContractResolver = class ApiContractResolver extends effect.Context.Service()("everything-dev/api-contract/ApiContractResolver") {
|
|
35
|
+
static layer = effect.Layer.effect(ApiContractResolver, effect.Effect.sync(() => {
|
|
36
|
+
const manifest = effect.Effect.fn("ApiContractResolver.manifest")(function* (apiBaseUrl) {
|
|
37
|
+
const url = getApiPluginManifestUrl(apiBaseUrl);
|
|
38
|
+
const fetched = yield* effect.Effect.tryPromise({
|
|
39
|
+
try: () => require_http_client.fetchJsonOrNull(url, { retries: 2 }),
|
|
40
|
+
catch: () => new ApiManifestFetchError({
|
|
41
|
+
url,
|
|
42
|
+
message: `Failed to fetch API plugin manifest from ${url}`
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
if (!fetched) return yield* new ApiManifestFetchError({
|
|
46
|
+
url,
|
|
47
|
+
message: `Failed to fetch API plugin manifest from ${url}`
|
|
48
|
+
});
|
|
49
|
+
if (fetched.schemaVersion !== 1 || fetched.kind !== "every-plugin/manifest") return yield* new ApiManifestFormatError({
|
|
50
|
+
url,
|
|
51
|
+
message: "Unsupported API plugin manifest format"
|
|
52
|
+
});
|
|
53
|
+
return fetched;
|
|
54
|
+
});
|
|
55
|
+
const writeContractTypes = effect.Effect.fn("ApiContractResolver.writeContractTypes")(function* (opts) {
|
|
56
|
+
const contractResponse = yield* effect.Effect.tryPromise({
|
|
57
|
+
try: () => require_http_client.fetchResponse(opts.contractUrl),
|
|
58
|
+
catch: () => new ContractTypesFetchError({
|
|
59
|
+
url: opts.contractUrl,
|
|
60
|
+
message: `Failed to fetch contract types from ${opts.contractUrl}`
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
if (!contractResponse.ok) return yield* new ContractTypesFetchError({
|
|
64
|
+
url: opts.contractUrl,
|
|
65
|
+
message: `Failed to fetch contract types from ${opts.contractUrl}: ${contractResponse.status} ${contractResponse.statusText}`
|
|
66
|
+
});
|
|
67
|
+
const contractTypes = yield* effect.Effect.tryPromise({
|
|
68
|
+
try: () => contractResponse.text(),
|
|
69
|
+
catch: () => new ContractTypesFetchError({
|
|
70
|
+
url: opts.contractUrl,
|
|
71
|
+
message: `Failed to fetch contract types from ${opts.contractUrl}`
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
if (opts.manifest.contract?.types.sha256 && opts.manifest.contract.types.sha256 !== sha256(contractTypes)) return yield* new ContractTypesChecksumError({
|
|
75
|
+
url: opts.contractUrl,
|
|
76
|
+
message: "Fetched contract types failed checksum verification"
|
|
77
|
+
});
|
|
78
|
+
const generatedPath = (0, node_path.join)(opts.runtimeDir, opts.generatedSubdir, "contract.d.ts");
|
|
79
|
+
yield* effect.Effect.sync(() => {
|
|
80
|
+
(0, node_fs.mkdirSync)((0, node_path.dirname)(generatedPath), { recursive: true });
|
|
81
|
+
writeFileIfChanged(generatedPath, contractTypes);
|
|
82
|
+
});
|
|
83
|
+
return {
|
|
84
|
+
key: opts.name,
|
|
85
|
+
importName: `${sanitizeIdentifier(opts.name)}Contract`,
|
|
86
|
+
sourceFilePath: generatedPath,
|
|
87
|
+
generatedPath
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
const contractSource = effect.Effect.fn("ApiContractResolver.contractSource")(function* (opts) {
|
|
91
|
+
const fetchedManifest = yield* manifest(opts.baseUrl);
|
|
92
|
+
if (!fetchedManifest.contract) return yield* new MissingContractTypesError({
|
|
93
|
+
pluginName: fetchedManifest.plugin.name,
|
|
94
|
+
message: `Plugin manifest for ${fetchedManifest.plugin.name} does not advertise contract types`
|
|
95
|
+
});
|
|
96
|
+
const contractUrl = `${trimTrailingSlash(opts.baseUrl)}/${fetchedManifest.contract.types.path.replace(/^\.\//, "")}`;
|
|
97
|
+
return yield* writeContractTypes({
|
|
98
|
+
contractUrl,
|
|
99
|
+
manifest: fetchedManifest,
|
|
100
|
+
runtimeDir: opts.runtimeDir,
|
|
101
|
+
generatedSubdir: opts.generatedSubdir,
|
|
102
|
+
name: opts.name
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
const authExportTypes = effect.Effect.fn("ApiContractResolver.authExportTypes")(function* (opts) {
|
|
106
|
+
const entry = (opts.manifest.additionalExports ?? []).find((candidate) => candidate.path.includes("auth-export") || candidate.path.endsWith("auth-export.d.ts"));
|
|
107
|
+
if (!entry) return null;
|
|
108
|
+
const exportUrl = `${trimTrailingSlash(opts.baseUrl)}/${entry.path.replace(/^\.\//, "")}`;
|
|
109
|
+
const response = yield* effect.Effect.tryPromise({
|
|
110
|
+
try: () => require_http_client.fetchResponse(exportUrl),
|
|
111
|
+
catch: () => new AuthExportFetchError({
|
|
112
|
+
url: exportUrl,
|
|
113
|
+
message: `Failed to fetch auth export types from ${exportUrl}`
|
|
114
|
+
})
|
|
115
|
+
});
|
|
116
|
+
if (!response.ok) return yield* new AuthExportFetchError({
|
|
117
|
+
url: exportUrl,
|
|
118
|
+
message: `Failed to fetch auth export types from ${exportUrl}: ${response.status}`
|
|
119
|
+
});
|
|
120
|
+
const content = yield* effect.Effect.tryPromise({
|
|
121
|
+
try: () => response.text(),
|
|
122
|
+
catch: () => new AuthExportFetchError({
|
|
123
|
+
url: exportUrl,
|
|
124
|
+
message: `Failed to fetch auth export types from ${exportUrl}`
|
|
125
|
+
})
|
|
126
|
+
});
|
|
127
|
+
if (entry.sha256 && entry.sha256 !== sha256(content)) return yield* new AuthExportFetchError({
|
|
128
|
+
url: exportUrl,
|
|
129
|
+
message: `Auth export types checksum mismatch for ${exportUrl}`
|
|
130
|
+
});
|
|
131
|
+
const generatedPath = (0, node_path.join)(opts.runtimeDir, "auth", "auth-export.d.ts");
|
|
132
|
+
yield* effect.Effect.sync(() => {
|
|
133
|
+
(0, node_fs.mkdirSync)((0, node_path.dirname)(generatedPath), { recursive: true });
|
|
134
|
+
writeFileIfChanged(generatedPath, content);
|
|
135
|
+
});
|
|
136
|
+
return generatedPath;
|
|
137
|
+
});
|
|
138
|
+
return ApiContractResolver.of({
|
|
139
|
+
manifest,
|
|
140
|
+
contractSource,
|
|
141
|
+
authExportTypes
|
|
142
|
+
});
|
|
143
|
+
}));
|
|
144
|
+
};
|
|
145
|
+
let resolverRuntime = null;
|
|
146
|
+
function getResolver() {
|
|
147
|
+
if (!resolverRuntime) resolverRuntime = effect.ManagedRuntime.make(ApiContractResolver.layer);
|
|
148
|
+
return resolverRuntime;
|
|
149
|
+
}
|
|
8
150
|
function sha256(input) {
|
|
9
151
|
return (0, node_crypto.createHash)("sha256").update(input).digest("hex");
|
|
10
152
|
}
|
|
@@ -29,63 +171,53 @@ function getApiPluginManifestUrl(apiBaseUrl) {
|
|
|
29
171
|
return `${trimTrailingSlash(apiBaseUrl)}/plugin.manifest.json`;
|
|
30
172
|
}
|
|
31
173
|
async function fetchApiPluginManifest(apiBaseUrl) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
174
|
+
return getResolver().runPromise(effect.Effect.gen(function* () {
|
|
175
|
+
return yield* (yield* ApiContractResolver).manifest(apiBaseUrl);
|
|
176
|
+
})).catch((error) => {
|
|
177
|
+
throw new Error(error.message);
|
|
178
|
+
});
|
|
37
179
|
}
|
|
38
180
|
function localApiContractSource(configDir) {
|
|
181
|
+
const sourcePath = (0, node_path.join)(configDir, "api", "src", "contract.ts");
|
|
182
|
+
if (!(0, node_fs.existsSync)(sourcePath)) throw new Error(`local api contract not found at api/src/contract.ts — restore the file or configure a reachable api URL`);
|
|
39
183
|
return {
|
|
40
184
|
key: "api",
|
|
41
185
|
importName: "BaseApiContract",
|
|
42
|
-
sourceFilePath:
|
|
186
|
+
sourceFilePath: sourcePath
|
|
43
187
|
};
|
|
44
188
|
}
|
|
45
189
|
function localAuthContractSource(configDir) {
|
|
190
|
+
const sourcePath = (0, node_path.join)(configDir, "plugins", "auth", "src", "contract.ts");
|
|
191
|
+
if (!(0, node_fs.existsSync)(sourcePath)) throw new Error(`local auth contract not found at plugins/auth/src/contract.ts — restore the file or configure a reachable auth URL`);
|
|
46
192
|
return {
|
|
47
193
|
key: "auth",
|
|
48
194
|
importName: "authContract",
|
|
49
|
-
sourceFilePath:
|
|
195
|
+
sourceFilePath: sourcePath
|
|
50
196
|
};
|
|
51
197
|
}
|
|
52
198
|
async function remoteContractSource(opts) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
key: opts.name,
|
|
65
|
-
importName: `${sanitizeIdentifier(opts.name)}Contract`,
|
|
66
|
-
sourceFilePath: generatedPath,
|
|
67
|
-
generatedPath
|
|
68
|
-
};
|
|
199
|
+
return getResolver().runPromise(effect.Effect.gen(function* () {
|
|
200
|
+
return yield* (yield* ApiContractResolver).contractSource({
|
|
201
|
+
baseUrl: opts.baseUrl,
|
|
202
|
+
runtimeDir: opts.runtimeDir,
|
|
203
|
+
name: opts.name,
|
|
204
|
+
generatedSubdir: opts.generatedSubdir
|
|
205
|
+
});
|
|
206
|
+
})).catch((error) => {
|
|
207
|
+
throw new Error(error.message);
|
|
208
|
+
});
|
|
69
209
|
}
|
|
70
210
|
async function fetchAuthExportTypes(opts) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
const content = await response.text();
|
|
81
|
-
if (authExportEntry.sha256 && authExportEntry.sha256 !== sha256(content)) {
|
|
82
|
-
console.warn(`[API Contract] Auth export types checksum mismatch for ${exportUrl}`);
|
|
211
|
+
return getResolver().runPromise(effect.Effect.gen(function* () {
|
|
212
|
+
return yield* (yield* ApiContractResolver).authExportTypes({
|
|
213
|
+
baseUrl: opts.baseUrl,
|
|
214
|
+
runtimeDir: opts.runtimeDir,
|
|
215
|
+
manifest: opts.manifest
|
|
216
|
+
});
|
|
217
|
+
})).catch((error) => {
|
|
218
|
+
console.warn(`[API Contract] ${error.message}`);
|
|
83
219
|
return null;
|
|
84
|
-
}
|
|
85
|
-
const generatedPath = (0, node_path.join)(opts.runtimeDir, "auth", "auth-export.d.ts");
|
|
86
|
-
(0, node_fs.mkdirSync)((0, node_path.dirname)(generatedPath), { recursive: true });
|
|
87
|
-
writeFileIfChanged(generatedPath, content);
|
|
88
|
-
return generatedPath;
|
|
220
|
+
});
|
|
89
221
|
}
|
|
90
222
|
async function resolveContractSource(opts) {
|
|
91
223
|
if (opts.key === "api") {
|
|
@@ -120,7 +252,7 @@ async function resolveContractSource(opts) {
|
|
|
120
252
|
});
|
|
121
253
|
}
|
|
122
254
|
function writePluginClientGen(opts) {
|
|
123
|
-
const pluginSrcDir = (0, node_path.join)(opts.
|
|
255
|
+
const pluginSrcDir = (0, node_path.join)(opts.localPath, "src");
|
|
124
256
|
if (!(0, node_fs.existsSync)(pluginSrcDir)) return;
|
|
125
257
|
const targetPath = (0, node_path.join)(pluginSrcDir, "lib", "plugins-client.gen.ts");
|
|
126
258
|
const lines = [];
|
|
@@ -128,15 +260,16 @@ function writePluginClientGen(opts) {
|
|
|
128
260
|
const importPath = toImportPath(targetPath, source.sourceFilePath);
|
|
129
261
|
lines.push(`import type { ContractType as ${source.importName} } from "${importPath}";`);
|
|
130
262
|
}
|
|
131
|
-
lines.push("import type {
|
|
132
|
-
lines.push("type
|
|
263
|
+
lines.push("import type { RouterContractClient, RouterContract } from \"@orpc/contract\";");
|
|
264
|
+
lines.push("import type { ContractedRouter } from \"@orpc/server\";");
|
|
265
|
+
lines.push("type PluginClientEntry<C extends RouterContract> = {\n client: (context?: Record<string, unknown>) => RouterContractClient<C>;\n router: ContractedRouter<C, any>;\n};");
|
|
133
266
|
lines.push("");
|
|
134
267
|
if (opts.depSources.length === 0) lines.push("export type PluginsClient = Record<string, never>;");
|
|
135
268
|
else {
|
|
136
269
|
lines.push("export type PluginsClient = {");
|
|
137
270
|
for (const source of opts.depSources) {
|
|
138
271
|
const key = /^[$A-Z_][0-9A-Z_$]*$/i.test(source.key) ? source.key : JSON.stringify(source.key);
|
|
139
|
-
lines.push(` ${key}:
|
|
272
|
+
lines.push(` ${key}: PluginClientEntry<${source.importName}>;`);
|
|
140
273
|
}
|
|
141
274
|
lines.push("};");
|
|
142
275
|
}
|
|
@@ -183,19 +316,20 @@ function writeGeneratedFiles(opts) {
|
|
|
183
316
|
const importPath = toImportPath(pluginsClientPath, source.sourceFilePath);
|
|
184
317
|
pluginsClientLines.push(`import type { ContractType as ${source.importName} } from "${importPath}";`);
|
|
185
318
|
}
|
|
186
|
-
pluginsClientLines.push("import type {
|
|
187
|
-
pluginsClientLines.push("type
|
|
319
|
+
pluginsClientLines.push("import type { RouterContractClient, RouterContract } from \"@orpc/contract\";");
|
|
320
|
+
pluginsClientLines.push("import type { ContractedRouter } from \"@orpc/server\";");
|
|
321
|
+
pluginsClientLines.push("type PluginClientEntry<C extends RouterContract> = {\n client: (context?: Record<string, unknown>) => RouterContractClient<C>;\n router: ContractedRouter<C, any>;\n};");
|
|
188
322
|
pluginsClientLines.push("");
|
|
189
323
|
if (apiDepSources.length === 0 && unresolvedDepKeys.length === 0) pluginsClientLines.push("export type PluginsClient = Record<string, never>;");
|
|
190
324
|
else {
|
|
191
325
|
pluginsClientLines.push("export type PluginsClient = {");
|
|
192
326
|
for (const source of apiDepSources) {
|
|
193
327
|
const key = /^[$A-Z_][0-9A-Z_$]*$/i.test(source.key) ? source.key : JSON.stringify(source.key);
|
|
194
|
-
pluginsClientLines.push(` ${key}:
|
|
328
|
+
pluginsClientLines.push(` ${key}: PluginClientEntry<${source.importName}>;`);
|
|
195
329
|
}
|
|
196
330
|
for (const key of unresolvedDepKeys) {
|
|
197
331
|
const keyStr = /^[$A-Z_][0-9A-Z_$]*$/i.test(key) ? key : JSON.stringify(key);
|
|
198
|
-
pluginsClientLines.push(` ${keyStr}?:
|
|
332
|
+
pluginsClientLines.push(` ${keyStr}?: PluginClientEntry<RouterContract>;`);
|
|
199
333
|
}
|
|
200
334
|
pluginsClientLines.push("};");
|
|
201
335
|
}
|
|
@@ -208,13 +342,23 @@ function writeGeneratedFiles(opts) {
|
|
|
208
342
|
key: "auth"
|
|
209
343
|
});
|
|
210
344
|
for (const pluginKey of opts.pluginKeys) {
|
|
211
|
-
const
|
|
212
|
-
if (!
|
|
213
|
-
const depSources =
|
|
345
|
+
const localPath = opts.pluginLocalPaths?.[pluginKey];
|
|
346
|
+
if (!localPath) continue;
|
|
347
|
+
const depSources = (opts.pluginDependsOn?.[pluginKey] ?? []).map((depKey) => allSourcesForLookup.find((s) => s.key === depKey)).filter((s) => Boolean(s));
|
|
214
348
|
writePluginClientGen({
|
|
215
349
|
configDir: opts.configDir,
|
|
216
350
|
pluginKey,
|
|
217
|
-
depSources
|
|
351
|
+
depSources,
|
|
352
|
+
localPath
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
if (opts.authLocalPath) {
|
|
356
|
+
const depSources = (opts.authDependsOn ?? []).map((depKey) => allSourcesForLookup.find((s) => s.key === depKey)).filter((s) => Boolean(s));
|
|
357
|
+
writePluginClientGen({
|
|
358
|
+
configDir: opts.configDir,
|
|
359
|
+
pluginKey: "auth",
|
|
360
|
+
depSources,
|
|
361
|
+
localPath: opts.authLocalPath
|
|
218
362
|
});
|
|
219
363
|
}
|
|
220
364
|
const authTypeTargets = [(0, node_path.join)(opts.configDir, "ui", "src", "lib", "auth-types.gen.ts")];
|
|
@@ -223,8 +367,10 @@ function writeGeneratedFiles(opts) {
|
|
|
223
367
|
const hostLibDir = (0, node_path.join)(opts.configDir, "host", "src", "lib");
|
|
224
368
|
if ((0, node_fs.existsSync)((0, node_path.join)(opts.configDir, "host", "src"))) authTypeTargets.push((0, node_path.join)(hostLibDir, "auth-types.gen.ts"));
|
|
225
369
|
for (const key of opts.pluginKeys) {
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
370
|
+
const localPath = opts.pluginLocalPaths?.[key];
|
|
371
|
+
if (!localPath) continue;
|
|
372
|
+
const pluginSrcDir = (0, node_path.join)(localPath, "src");
|
|
373
|
+
if ((0, node_fs.existsSync)(pluginSrcDir)) authTypeTargets.push((0, node_path.join)(pluginSrcDir, "lib", "auth-types.gen.ts"));
|
|
228
374
|
}
|
|
229
375
|
if (opts.authExportPath) for (const authTypesPath of authTypeTargets) {
|
|
230
376
|
const exportImportPath = toImportPath(authTypesPath, opts.authExportPath);
|
|
@@ -232,17 +378,44 @@ function writeGeneratedFiles(opts) {
|
|
|
232
378
|
(0, node_fs.mkdirSync)((0, node_path.dirname)(authTypesPath), { recursive: true });
|
|
233
379
|
writeFileIfChanged(authTypesPath, require_auth_types_gen.buildAuthTypesGenContent(exportImportPath, contractImportPath));
|
|
234
380
|
}
|
|
235
|
-
else if (opts.authSource)
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
(0, node_fs.
|
|
239
|
-
|
|
381
|
+
else if (opts.authSource) {
|
|
382
|
+
const generatedAuthExportPath = (0, node_path.join)(opts.configDir, ".bos", "generated", "auth", "auth-export.d.ts");
|
|
383
|
+
(0, node_fs.mkdirSync)((0, node_path.dirname)(generatedAuthExportPath), { recursive: true });
|
|
384
|
+
if (!(0, node_fs.existsSync)(generatedAuthExportPath)) writeFileIfChanged(generatedAuthExportPath, require_auth_types_gen.buildAuthExportStub());
|
|
385
|
+
for (const authTypesPath of authTypeTargets) {
|
|
386
|
+
const exportImportPath = toImportPath(authTypesPath, generatedAuthExportPath);
|
|
387
|
+
const contractImportPath = toImportPath(authTypesPath, (0, node_path.join)(opts.configDir, ".bos", "generated", "auth", "contract.d.ts"));
|
|
388
|
+
(0, node_fs.mkdirSync)((0, node_path.dirname)(authTypesPath), { recursive: true });
|
|
389
|
+
writeFileIfChanged(authTypesPath, require_auth_types_gen.buildAuthTypesGenContent(exportImportPath, contractImportPath));
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
const localPluginKeys = new Set(Object.keys(opts.pluginLocalPaths ?? {}));
|
|
393
|
+
if (opts.authLocalPath) localPluginKeys.add("auth");
|
|
394
|
+
const pluginsRoot = (0, node_path.join)(opts.configDir, "plugins");
|
|
395
|
+
if ((0, node_fs.existsSync)(pluginsRoot)) for (const entry of (0, node_fs.readdirSync)(pluginsRoot, { withFileTypes: true })) {
|
|
396
|
+
if (!entry.isDirectory() || entry.name.startsWith("_") || localPluginKeys.has(entry.name)) continue;
|
|
397
|
+
for (const genName of ["plugins-client.gen.ts", "auth-types.gen.ts"]) {
|
|
398
|
+
const genPath = (0, node_path.join)(pluginsRoot, entry.name, "src", "lib", genName);
|
|
399
|
+
if ((0, node_fs.existsSync)(genPath)) (0, node_fs.rmSync)(genPath);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
const generatedPluginsRoot = (0, node_path.join)(opts.configDir, ".bos", "generated", "plugins");
|
|
403
|
+
if ((0, node_fs.existsSync)(generatedPluginsRoot)) {
|
|
404
|
+
const configuredKeys = new Set(opts.sources.map((source) => source.key));
|
|
405
|
+
for (const entry of (0, node_fs.readdirSync)(generatedPluginsRoot, { withFileTypes: true })) {
|
|
406
|
+
if (!entry.isDirectory() || configuredKeys.has(entry.name)) continue;
|
|
407
|
+
(0, node_fs.rmSync)((0, node_path.join)(generatedPluginsRoot, entry.name), {
|
|
408
|
+
recursive: true,
|
|
409
|
+
force: true
|
|
410
|
+
});
|
|
411
|
+
}
|
|
240
412
|
}
|
|
241
413
|
return uiContractPath;
|
|
242
414
|
}
|
|
243
415
|
async function syncApiContractBridge(opts) {
|
|
244
416
|
const runtimeDir = (0, node_path.join)(opts.configDir, ".bos", "generated");
|
|
245
|
-
const
|
|
417
|
+
const isAuthMirrorEntry = (key, plugin) => require_service_descriptor.isAuthMirrorPluginEntry(opts.runtimeConfig.auth, key, plugin);
|
|
418
|
+
const pluginEntries = Object.entries(opts.runtimeConfig.plugins ?? {}).filter(([key, plugin]) => !isAuthMirrorEntry(key, plugin)).sort(([a], [b]) => a.localeCompare(b));
|
|
246
419
|
const sources = [];
|
|
247
420
|
const status = [];
|
|
248
421
|
let manifest = null;
|
|
@@ -372,7 +545,12 @@ async function syncApiContractBridge(opts) {
|
|
|
372
545
|
if (apiStatus?.source === "failed") throw new Error(`Cannot generate contract types without api contract: ${apiStatus.error ?? "unknown error"}`);
|
|
373
546
|
const allPluginKeys = pluginEntries.filter(([key]) => !excludedPluginKeys.has(key)).map(([key]) => key);
|
|
374
547
|
const pluginDependsOn = {};
|
|
375
|
-
|
|
548
|
+
const pluginLocalPaths = {};
|
|
549
|
+
for (const [key, plugin] of pluginEntries) {
|
|
550
|
+
if (excludedPluginKeys.has(key)) continue;
|
|
551
|
+
if (plugin.dependsOn?.length) pluginDependsOn[key] = plugin.dependsOn;
|
|
552
|
+
if (plugin.localPath) pluginLocalPaths[key] = plugin.localPath;
|
|
553
|
+
}
|
|
376
554
|
writeGeneratedFiles({
|
|
377
555
|
configDir: opts.configDir,
|
|
378
556
|
sources,
|
|
@@ -380,7 +558,10 @@ async function syncApiContractBridge(opts) {
|
|
|
380
558
|
authSource,
|
|
381
559
|
authExportPath,
|
|
382
560
|
apiDependsOn: opts.runtimeConfig.api.dependsOn,
|
|
383
|
-
pluginDependsOn
|
|
561
|
+
pluginDependsOn,
|
|
562
|
+
pluginLocalPaths,
|
|
563
|
+
authLocalPath: opts.runtimeConfig.auth?.source === "local" ? opts.runtimeConfig.auth.localPath : void 0,
|
|
564
|
+
authDependsOn: opts.runtimeConfig.auth?.dependsOn
|
|
384
565
|
});
|
|
385
566
|
if (opts.runtimeConfig.api.source !== "local") manifest = await fetchApiPluginManifest(opts.apiBaseUrl);
|
|
386
567
|
return {
|
|
@@ -393,6 +574,13 @@ async function syncApiContractBridge(opts) {
|
|
|
393
574
|
}
|
|
394
575
|
|
|
395
576
|
//#endregion
|
|
577
|
+
exports.ApiContractResolver = ApiContractResolver;
|
|
578
|
+
exports.ApiManifestFetchError = ApiManifestFetchError;
|
|
579
|
+
exports.ApiManifestFormatError = ApiManifestFormatError;
|
|
580
|
+
exports.AuthExportFetchError = AuthExportFetchError;
|
|
581
|
+
exports.ContractTypesChecksumError = ContractTypesChecksumError;
|
|
582
|
+
exports.ContractTypesFetchError = ContractTypesFetchError;
|
|
583
|
+
exports.MissingContractTypesError = MissingContractTypesError;
|
|
396
584
|
exports.fetchApiPluginManifest = fetchApiPluginManifest;
|
|
397
585
|
exports.syncApiContractBridge = syncApiContractBridge;
|
|
398
586
|
exports.writeGeneratedFiles = writeGeneratedFiles;
|