devflare 1.0.0-next.3 → 1.0.0-next.31
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/LLM.md +15964 -1751
- package/README.md +392 -605
- package/bin/devflare.js +24 -14
- package/dist/account-g99mzrqp.js +475 -0
- package/dist/api-2n6dd2ws.js +33 -0
- package/dist/bridge/client.d.ts +48 -6
- package/dist/bridge/client.d.ts.map +1 -1
- package/dist/bridge/gateway-runtime.d.ts +8 -0
- package/dist/bridge/gateway-runtime.d.ts.map +1 -0
- package/dist/bridge/index.d.ts +3 -3
- package/dist/bridge/index.d.ts.map +1 -1
- package/dist/bridge/log.d.ts +5 -0
- package/dist/bridge/log.d.ts.map +1 -0
- package/dist/bridge/miniflare.d.ts +74 -1
- package/dist/bridge/miniflare.d.ts.map +1 -1
- package/dist/bridge/proxy.d.ts +11 -10
- package/dist/bridge/proxy.d.ts.map +1 -1
- package/dist/bridge/server.d.ts +2 -1
- package/dist/bridge/server.d.ts.map +1 -1
- package/dist/bridge/v2/body-streams.d.ts +53 -0
- package/dist/bridge/v2/body-streams.d.ts.map +1 -0
- package/dist/bridge/v2/codec.d.ts +106 -0
- package/dist/bridge/v2/codec.d.ts.map +1 -0
- package/dist/bridge/v2/control-messages.d.ts +51 -0
- package/dist/bridge/v2/control-messages.d.ts.map +1 -0
- package/dist/bridge/v2/frames.d.ts +109 -0
- package/dist/bridge/v2/frames.d.ts.map +1 -0
- package/dist/bridge/v2/index.d.ts +11 -0
- package/dist/bridge/v2/index.d.ts.map +1 -0
- package/dist/bridge/v2/serialization.d.ts +48 -0
- package/dist/bridge/v2/serialization.d.ts.map +1 -0
- package/dist/bridge/v2/transport.d.ts +31 -0
- package/dist/bridge/v2/transport.d.ts.map +1 -0
- package/dist/bridge/v2/value-codec.d.ts +61 -0
- package/dist/bridge/v2/value-codec.d.ts.map +1 -0
- package/dist/bridge/{serialization.d.ts → v2/value-serialization.d.ts} +40 -18
- package/dist/bridge/v2/value-serialization.d.ts.map +1 -0
- package/dist/bridge/{protocol.d.ts → v2/wire.d.ts} +28 -4
- package/dist/bridge/v2/wire.d.ts.map +1 -0
- package/dist/bridge/v2/ws-relay.d.ts +53 -0
- package/dist/bridge/v2/ws-relay.d.ts.map +1 -0
- package/dist/browser-shim/handler.d.ts +1 -1
- package/dist/browser-shim/handler.d.ts.map +1 -1
- package/dist/browser-shim/server.d.ts +63 -0
- package/dist/browser-shim/server.d.ts.map +1 -1
- package/dist/browser.d.ts +4621 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +147 -0
- package/dist/build-4tyjywn9.js +54 -0
- package/dist/bundler/defaults.d.ts +23 -0
- package/dist/bundler/defaults.d.ts.map +1 -0
- package/dist/bundler/do-bundler.d.ts +7 -0
- package/dist/bundler/do-bundler.d.ts.map +1 -1
- package/dist/bundler/index.d.ts +2 -0
- package/dist/bundler/index.d.ts.map +1 -1
- package/dist/bundler/rolldown-shared.d.ts +53 -0
- package/dist/bundler/rolldown-shared.d.ts.map +1 -0
- package/dist/bundler/worker-bundler.d.ts +13 -0
- package/dist/bundler/worker-bundler.d.ts.map +1 -0
- package/dist/bundler/worker-compat.d.ts +4 -0
- package/dist/bundler/worker-compat.d.ts.map +1 -0
- package/dist/cli/build-manifest.d.ts +66 -0
- package/dist/cli/build-manifest.d.ts.map +1 -0
- package/dist/cli/command-utils.d.ts +18 -0
- package/dist/cli/command-utils.d.ts.map +1 -0
- package/dist/cli/commands/account.d.ts +1 -1
- package/dist/cli/commands/account.d.ts.map +1 -1
- package/dist/cli/commands/build-artifacts.d.ts +40 -0
- package/dist/cli/commands/build-artifacts.d.ts.map +1 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/config.d.ts +4 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/deploy/metadata.d.ts +18 -0
- package/dist/cli/commands/deploy/metadata.d.ts.map +1 -0
- package/dist/cli/commands/deploy/prepare.d.ts +23 -0
- package/dist/cli/commands/deploy/prepare.d.ts.map +1 -0
- package/dist/cli/commands/deploy/runtime.d.ts +4 -0
- package/dist/cli/commands/deploy/runtime.d.ts.map +1 -0
- package/dist/cli/commands/deploy/verification.d.ts +36 -0
- package/dist/cli/commands/deploy/verification.d.ts.map +1 -0
- package/dist/cli/commands/deploy.d.ts +2 -2
- package/dist/cli/commands/deploy.d.ts.map +1 -1
- package/dist/cli/commands/dev.d.ts +8 -0
- package/dist/cli/commands/dev.d.ts.map +1 -1
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/login.d.ts +4 -0
- package/dist/cli/commands/login.d.ts.map +1 -0
- package/dist/cli/commands/previews-support/cleanup.d.ts +9 -0
- package/dist/cli/commands/previews-support/cleanup.d.ts.map +1 -0
- package/dist/cli/commands/previews-support/family.d.ts +10 -0
- package/dist/cli/commands/previews-support/family.d.ts.map +1 -0
- package/dist/cli/commands/previews-support/render.d.ts +8 -0
- package/dist/cli/commands/previews-support/render.d.ts.map +1 -0
- package/dist/cli/commands/previews-support/theme.d.ts +10 -0
- package/dist/cli/commands/previews-support/theme.d.ts.map +1 -0
- package/dist/cli/commands/previews-support/types.d.ts +70 -0
- package/dist/cli/commands/previews-support/types.d.ts.map +1 -0
- package/dist/cli/commands/previews.d.ts +4 -0
- package/dist/cli/commands/previews.d.ts.map +1 -0
- package/dist/cli/commands/productions.d.ts +4 -0
- package/dist/cli/commands/productions.d.ts.map +1 -0
- package/dist/cli/commands/secrets.d.ts +4 -0
- package/dist/cli/commands/secrets.d.ts.map +1 -0
- package/dist/cli/commands/token.d.ts +4 -0
- package/dist/cli/commands/token.d.ts.map +1 -0
- package/dist/cli/commands/type-generation/discovery.d.ts +7 -0
- package/dist/cli/commands/type-generation/discovery.d.ts.map +1 -0
- package/dist/cli/commands/type-generation/generator.d.ts +112 -0
- package/dist/cli/commands/type-generation/generator.d.ts.map +1 -0
- package/dist/cli/commands/type-generation/models.d.ts +27 -0
- package/dist/cli/commands/type-generation/models.d.ts.map +1 -0
- package/dist/cli/commands/types.d.ts.map +1 -1
- package/dist/cli/commands/worker.d.ts +4 -0
- package/dist/cli/commands/worker.d.ts.map +1 -0
- package/dist/cli/config-path.d.ts +6 -0
- package/dist/cli/config-path.d.ts.map +1 -0
- package/dist/cli/dependencies.d.ts +1 -0
- package/dist/cli/dependencies.d.ts.map +1 -1
- package/dist/cli/deploy-strategy.d.ts +17 -0
- package/dist/cli/deploy-strategy.d.ts.map +1 -0
- package/dist/cli/deploy-target.d.ts +17 -0
- package/dist/cli/deploy-target.d.ts.map +1 -0
- package/dist/cli/generated-artifacts.d.ts +12 -0
- package/dist/cli/generated-artifacts.d.ts.map +1 -0
- package/dist/cli/help-pages/pages/account.d.ts +3 -0
- package/dist/cli/help-pages/pages/account.d.ts.map +1 -0
- package/dist/cli/help-pages/pages/core.d.ts +4 -0
- package/dist/cli/help-pages/pages/core.d.ts.map +1 -0
- package/dist/cli/help-pages/pages/index.d.ts +3 -0
- package/dist/cli/help-pages/pages/index.d.ts.map +1 -0
- package/dist/cli/help-pages/pages/misc.d.ts +3 -0
- package/dist/cli/help-pages/pages/misc.d.ts.map +1 -0
- package/dist/cli/help-pages/pages/previews.d.ts +3 -0
- package/dist/cli/help-pages/pages/previews.d.ts.map +1 -0
- package/dist/cli/help-pages/pages/productions.d.ts +3 -0
- package/dist/cli/help-pages/pages/productions.d.ts.map +1 -0
- package/dist/cli/help-pages/render.d.ts +12 -0
- package/dist/cli/help-pages/render.d.ts.map +1 -0
- package/dist/cli/help-pages/shared.d.ts +15 -0
- package/dist/cli/help-pages/shared.d.ts.map +1 -0
- package/dist/cli/help-pages/types.d.ts +23 -0
- package/dist/cli/help-pages/types.d.ts.map +1 -0
- package/dist/cli/help.d.ts +6 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +12 -0
- package/dist/cli/package-metadata.d.ts +16 -0
- package/dist/cli/package-metadata.d.ts.map +1 -0
- package/dist/cli/preview-bindings.d.ts +49 -0
- package/dist/cli/preview-bindings.d.ts.map +1 -0
- package/dist/cli/preview.d.ts +10 -0
- package/dist/cli/preview.d.ts.map +1 -0
- package/dist/cli/ui.d.ts +37 -0
- package/dist/cli/ui.d.ts.map +1 -0
- package/dist/cli/workspace-build-guard.d.ts +14 -0
- package/dist/cli/workspace-build-guard.d.ts.map +1 -0
- package/dist/cloudflare/account-core.d.ts +6 -0
- package/dist/cloudflare/account-core.d.ts.map +1 -0
- package/dist/cloudflare/account-resources.d.ts +40 -0
- package/dist/cloudflare/account-resources.d.ts.map +1 -0
- package/dist/cloudflare/account-status.d.ts +11 -0
- package/dist/cloudflare/account-status.d.ts.map +1 -0
- package/dist/cloudflare/account-workers.d.ts +14 -0
- package/dist/cloudflare/account-workers.d.ts.map +1 -0
- package/dist/cloudflare/account.d.ts +7 -64
- package/dist/cloudflare/account.d.ts.map +1 -1
- package/dist/cloudflare/api.d.ts +71 -3
- package/dist/cloudflare/api.d.ts.map +1 -1
- package/dist/cloudflare/auth.d.ts.map +1 -1
- package/dist/cloudflare/index.d.ts +57 -2
- package/dist/cloudflare/index.d.ts.map +1 -1
- package/dist/cloudflare/index.js +49 -2
- package/dist/cloudflare/known-permission-group-ids.generated.d.ts +10 -0
- package/dist/cloudflare/known-permission-group-ids.generated.d.ts.map +1 -0
- package/dist/cloudflare/kv-namespace.d.ts +4 -0
- package/dist/cloudflare/kv-namespace.d.ts.map +1 -0
- package/dist/cloudflare/preferences.d.ts +7 -0
- package/dist/cloudflare/preferences.d.ts.map +1 -1
- package/dist/cloudflare/preview-registry-cache.d.ts +6 -0
- package/dist/cloudflare/preview-registry-cache.d.ts.map +1 -0
- package/dist/cloudflare/preview-registry-inference.d.ts +14 -0
- package/dist/cloudflare/preview-registry-inference.d.ts.map +1 -0
- package/dist/cloudflare/preview-registry-records.d.ts +4 -0
- package/dist/cloudflare/preview-registry-records.d.ts.map +1 -0
- package/dist/cloudflare/preview-registry-shape.d.ts +47 -0
- package/dist/cloudflare/preview-registry-shape.d.ts.map +1 -0
- package/dist/cloudflare/preview-registry-store.d.ts +14 -0
- package/dist/cloudflare/preview-registry-store.d.ts.map +1 -0
- package/dist/cloudflare/preview-registry-transport.d.ts +4 -0
- package/dist/cloudflare/preview-registry-transport.d.ts.map +1 -0
- package/dist/cloudflare/preview-registry-types.d.ts +103 -0
- package/dist/cloudflare/preview-registry-types.d.ts.map +1 -0
- package/dist/cloudflare/preview-registry.d.ts +42 -0
- package/dist/cloudflare/preview-registry.d.ts.map +1 -0
- package/dist/cloudflare/preview-urls.d.ts +3 -0
- package/dist/cloudflare/preview-urls.d.ts.map +1 -0
- package/dist/cloudflare/registry-schema.d.ts +253 -0
- package/dist/cloudflare/registry-schema.d.ts.map +1 -0
- package/dist/cloudflare/tokens.d.ts +44 -0
- package/dist/cloudflare/tokens.d.ts.map +1 -0
- package/dist/cloudflare/types.d.ts +124 -7
- package/dist/cloudflare/types.d.ts.map +1 -1
- package/dist/cloudflare/usage.d.ts +30 -2
- package/dist/cloudflare/usage.d.ts.map +1 -1
- package/dist/config/binding-resolution-helpers.d.ts +41 -0
- package/dist/config/binding-resolution-helpers.d.ts.map +1 -0
- package/dist/config/compatibility.d.ts +3 -0
- package/dist/config/compatibility.d.ts.map +1 -0
- package/dist/config/compiler/bindings.d.ts +14 -0
- package/dist/config/compiler/bindings.d.ts.map +1 -0
- package/dist/config/compiler/core-helpers.d.ts +6 -0
- package/dist/config/compiler/core-helpers.d.ts.map +1 -0
- package/dist/config/compiler/do-workers.d.ts +34 -0
- package/dist/config/compiler/do-workers.d.ts.map +1 -0
- package/dist/config/compiler/paths.d.ts +18 -0
- package/dist/config/compiler/paths.d.ts.map +1 -0
- package/dist/config/compiler/types.d.ts +270 -0
- package/dist/config/compiler/types.d.ts.map +1 -0
- package/dist/config/compiler.d.ts +22 -134
- package/dist/config/compiler.d.ts.map +1 -1
- package/dist/config/define.d.ts +7 -4
- package/dist/config/define.d.ts.map +1 -1
- package/dist/config/deploy-resources.d.ts +58 -0
- package/dist/config/deploy-resources.d.ts.map +1 -0
- package/dist/config/env-vars.d.ts +309 -0
- package/dist/config/env-vars.d.ts.map +1 -0
- package/dist/config/framework-providers.d.ts +9 -0
- package/dist/config/framework-providers.d.ts.map +1 -0
- package/dist/config/index.d.ts +12 -5
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/loader.d.ts +1 -0
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/local-dev-vars.d.ts +15 -0
- package/dist/config/local-dev-vars.d.ts.map +1 -0
- package/dist/config/preview-resources.d.ts +83 -0
- package/dist/config/preview-resources.d.ts.map +1 -0
- package/dist/config/preview.d.ts +31 -0
- package/dist/config/preview.d.ts.map +1 -0
- package/dist/config/ref.d.ts +14 -23
- package/dist/config/ref.d.ts.map +1 -1
- package/dist/config/resolve-phased.d.ts +72 -0
- package/dist/config/resolve-phased.d.ts.map +1 -0
- package/dist/config/resolve.d.ts +11 -0
- package/dist/config/resolve.d.ts.map +1 -0
- package/dist/config/resource-resolution.d.ts +80 -0
- package/dist/config/resource-resolution.d.ts.map +1 -0
- package/dist/config/schema-bindings.d.ts +1495 -0
- package/dist/config/schema-bindings.d.ts.map +1 -0
- package/dist/config/schema-build.d.ts +67 -0
- package/dist/config/schema-build.d.ts.map +1 -0
- package/dist/config/schema-env.d.ts +3023 -0
- package/dist/config/schema-env.d.ts.map +1 -0
- package/dist/config/schema-normalization.d.ts +184 -0
- package/dist/config/schema-normalization.d.ts.map +1 -0
- package/dist/config/schema-runtime.d.ts +500 -0
- package/dist/config/schema-runtime.d.ts.map +1 -0
- package/dist/config/schema-types-bindings-platform.d.ts +378 -0
- package/dist/config/schema-types-bindings-platform.d.ts.map +1 -0
- package/dist/config/schema-types-bindings-resources.d.ts +551 -0
- package/dist/config/schema-types-bindings-resources.d.ts.map +1 -0
- package/dist/config/schema-types-bindings.d.ts +254 -0
- package/dist/config/schema-types-bindings.d.ts.map +1 -0
- package/dist/config/schema-types-build.d.ts +86 -0
- package/dist/config/schema-types-build.d.ts.map +1 -0
- package/dist/config/schema-types-runtime.d.ts +917 -0
- package/dist/config/schema-types-runtime.d.ts.map +1 -0
- package/dist/config/schema-types.d.ts +424 -0
- package/dist/config/schema-types.d.ts.map +1 -0
- package/dist/config/schema.d.ts +4537 -2214
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/service-bindings-validation.d.ts +36 -0
- package/dist/config/service-bindings-validation.d.ts.map +1 -0
- package/dist/config-88sdhx3w.js +105 -0
- package/dist/config-entry.d.ts +7 -0
- package/dist/config-entry.d.ts.map +1 -0
- package/dist/config-entry.js +16 -0
- package/dist/decorators/durable-object.d.ts.map +1 -1
- package/dist/deploy-8fpav2cw.js +1066 -0
- package/dist/dev-nxevkfdv.js +2609 -0
- package/dist/dev-server/d1-migrations.d.ts +36 -0
- package/dist/dev-server/d1-migrations.d.ts.map +1 -0
- package/dist/dev-server/dev-server-state.d.ts +59 -0
- package/dist/dev-server/dev-server-state.d.ts.map +1 -0
- package/dist/dev-server/gateway-script.d.ts +21 -0
- package/dist/dev-server/gateway-script.d.ts.map +1 -0
- package/dist/dev-server/miniflare-bindings.d.ts +59 -0
- package/dist/dev-server/miniflare-bindings.d.ts.map +1 -0
- package/dist/dev-server/miniflare-dev-config.d.ts +36 -0
- package/dist/dev-server/miniflare-dev-config.d.ts.map +1 -0
- package/dist/dev-server/miniflare-log.d.ts +20 -0
- package/dist/dev-server/miniflare-log.d.ts.map +1 -0
- package/dist/dev-server/miniflare-worker-config.d.ts +74 -0
- package/dist/dev-server/miniflare-worker-config.d.ts.map +1 -0
- package/dist/dev-server/reload-queue.d.ts +13 -0
- package/dist/dev-server/reload-queue.d.ts.map +1 -0
- package/dist/dev-server/runtime-stdio.d.ts +8 -0
- package/dist/dev-server/runtime-stdio.d.ts.map +1 -0
- package/dist/dev-server/server-startup-helpers.d.ts +84 -0
- package/dist/dev-server/server-startup-helpers.d.ts.map +1 -0
- package/dist/dev-server/server.d.ts +2 -0
- package/dist/dev-server/server.d.ts.map +1 -1
- package/dist/dev-server/vite-process.d.ts +15 -0
- package/dist/dev-server/vite-process.d.ts.map +1 -0
- package/dist/dev-server/vite-utils.d.ts +19 -1
- package/dist/dev-server/vite-utils.d.ts.map +1 -1
- package/dist/dev-server/worker-source-watcher.d.ts +17 -0
- package/dist/dev-server/worker-source-watcher.d.ts.map +1 -0
- package/dist/dev-server/worker-surface-paths.d.ts +6 -0
- package/dist/dev-server/worker-surface-paths.d.ts.map +1 -0
- package/dist/{doctor-fmgb3d28.js → doctor-ztwx1y95.js} +104 -35
- package/dist/{durable-object-t4kbb0yt.js → durable-object-v3gsnybk.js} +1 -1
- package/dist/env.d.ts +10 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/index-11p28kxx.js +256 -0
- package/dist/index-15fpa5tx.js +232 -0
- package/dist/index-1d4jg11n.js +542 -0
- package/dist/index-3edvz3hs.js +124 -0
- package/dist/index-3jme4hgw.js +1234 -0
- package/dist/index-627srx16.js +45 -0
- package/dist/index-62b3gt2g.js +12 -0
- package/dist/index-67gr49zr.js +109 -0
- package/dist/index-69c0ed4a.js +895 -0
- package/dist/index-6sj0v0dk.js +2284 -0
- package/dist/index-7qd7nmdd.js +74 -0
- package/dist/index-85yjb686.js +413 -0
- package/dist/index-aabgympv.js +39 -0
- package/dist/{index-z14anrqp.js → index-aqrwyy57.js} +93 -31
- package/dist/index-c8p4njqy.js +479 -0
- package/dist/index-dfcp9hsd.js +1581 -0
- package/dist/index-dm9q84c7.js +360 -0
- package/dist/index-fcmj6641.js +147 -0
- package/dist/index-ft3trvra.js +476 -0
- package/dist/{index-18hvb6gb.js → index-gn5wy09x.js} +13 -2
- package/dist/index-hjjfxv02.js +708 -0
- package/dist/index-hpwa6vsw.js +239 -0
- package/dist/index-k9x5v335.js +1033 -0
- package/dist/index-mg8vwqxf.js +514 -0
- package/dist/index-ptwem1nt.js +1428 -0
- package/dist/{index-07q6yxyc.js → index-q8f4kawk.js} +68 -32
- package/dist/index-qmmqww7h.js +133 -0
- package/dist/{index-rbht7m9r.js → index-qwgr4q7s.js} +2 -1
- package/dist/index-qz6nbwpw.js +111 -0
- package/dist/index-rzp9ejrh.js +185 -0
- package/dist/index-s3km3y34.js +1205 -0
- package/dist/index-stgn34cr.js +148 -0
- package/dist/index-t9y0sve5.js +155 -0
- package/dist/index-vez803pp.js +52 -0
- package/dist/index-vhqww6tt.js +307 -0
- package/dist/index-xz18tstn.js +581 -0
- package/dist/{index-1xpj0m4r.js → index-z9gy8w6b.js} +1 -1
- package/dist/index-za0r01bx.js +588 -0
- package/dist/index.d.ts +3 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -269
- package/dist/{init-f9mgmew3.js → init-cwpergap.js} +63 -69
- package/dist/login-r5ve73kf.js +77 -0
- package/dist/previews-qjj98rpp.js +1337 -0
- package/dist/productions-gzdtge0e.js +505 -0
- package/dist/runtime/context-events.d.ts +13 -0
- package/dist/runtime/context-events.d.ts.map +1 -0
- package/dist/runtime/context-types.d.ts +82 -0
- package/dist/runtime/context-types.d.ts.map +1 -0
- package/dist/runtime/context.d.ts +20 -44
- package/dist/runtime/context.d.ts.map +1 -1
- package/dist/runtime/exports.d.ts +70 -55
- package/dist/runtime/exports.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +8 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +108 -99
- package/dist/runtime/middleware.d.ts +102 -60
- package/dist/runtime/middleware.d.ts.map +1 -1
- package/dist/runtime/router/index.d.ts +7 -0
- package/dist/runtime/router/index.d.ts.map +1 -0
- package/dist/runtime/router/types.d.ts +24 -0
- package/dist/runtime/router/types.d.ts.map +1 -0
- package/dist/runtime/validation.d.ts +17 -3
- package/dist/runtime/validation.d.ts.map +1 -1
- package/dist/secrets/local-secrets.d.ts +46 -0
- package/dist/secrets/local-secrets.d.ts.map +1 -0
- package/dist/secrets-4w5166km.js +91 -0
- package/dist/shims/local-hyperdrive.d.ts +12 -0
- package/dist/shims/local-hyperdrive.d.ts.map +1 -0
- package/dist/shims/local-media-bindings.d.ts +19 -0
- package/dist/shims/local-media-bindings.d.ts.map +1 -0
- package/dist/shims/local-worker-loader.d.ts +3 -0
- package/dist/shims/local-worker-loader.d.ts.map +1 -0
- package/dist/sveltekit/index.js +169 -75
- package/dist/sveltekit/local-bindings.d.ts +4 -0
- package/dist/sveltekit/local-bindings.d.ts.map +1 -0
- package/dist/sveltekit/platform.d.ts +19 -1
- package/dist/sveltekit/platform.d.ts.map +1 -1
- package/dist/test/ai-search.d.ts +39 -0
- package/dist/test/ai-search.d.ts.map +1 -0
- package/dist/test/binding-hints.d.ts +11 -0
- package/dist/test/binding-hints.d.ts.map +1 -0
- package/dist/test/cf.d.ts +35 -21
- package/dist/test/cf.d.ts.map +1 -1
- package/dist/test/containers.d.ts +87 -0
- package/dist/test/containers.d.ts.map +1 -0
- package/dist/test/email.d.ts +16 -7
- package/dist/test/email.d.ts.map +1 -1
- package/dist/test/index.d.ts +5 -8
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +4641 -43
- package/dist/test/offline-bindings.d.ts +65 -0
- package/dist/test/offline-bindings.d.ts.map +1 -0
- package/dist/test/queue.d.ts.map +1 -1
- package/dist/test/remote-ai.d.ts.map +1 -1
- package/dist/test/remote-cloudflare.d.ts +13 -0
- package/dist/test/remote-cloudflare.d.ts.map +1 -0
- package/dist/test/remote-vectorize.d.ts.map +1 -1
- package/dist/test/resolve-service-bindings.d.ts +63 -3
- package/dist/test/resolve-service-bindings.d.ts.map +1 -1
- package/dist/test/scheduled.d.ts.map +1 -1
- package/dist/test/should-skip.d.ts +14 -18
- package/dist/test/should-skip.d.ts.map +1 -1
- package/dist/test/simple-context-bindings.d.ts +13 -0
- package/dist/test/simple-context-bindings.d.ts.map +1 -0
- package/dist/test/simple-context-durable-objects.d.ts +6 -0
- package/dist/test/simple-context-durable-objects.d.ts.map +1 -0
- package/dist/test/simple-context-env.d.ts +35 -0
- package/dist/test/simple-context-env.d.ts.map +1 -0
- package/dist/test/simple-context-gateway-script.d.ts +2 -0
- package/dist/test/simple-context-gateway-script.d.ts.map +1 -0
- package/dist/test/simple-context-handlers.d.ts +12 -0
- package/dist/test/simple-context-handlers.d.ts.map +1 -0
- package/dist/test/simple-context-lifecycle.d.ts +32 -0
- package/dist/test/simple-context-lifecycle.d.ts.map +1 -0
- package/dist/test/simple-context-mfconfig.d.ts +10 -0
- package/dist/test/simple-context-mfconfig.d.ts.map +1 -0
- package/dist/test/simple-context-multi-worker.d.ts +16 -0
- package/dist/test/simple-context-multi-worker.d.ts.map +1 -0
- package/dist/test/simple-context-paths.d.ts +40 -0
- package/dist/test/simple-context-paths.d.ts.map +1 -0
- package/dist/test/simple-context-runtime.d.ts +19 -0
- package/dist/test/simple-context-runtime.d.ts.map +1 -0
- package/dist/test/simple-context-startup.d.ts +11 -0
- package/dist/test/simple-context-startup.d.ts.map +1 -0
- package/dist/test/simple-context-transport.d.ts +14 -0
- package/dist/test/simple-context-transport.d.ts.map +1 -0
- package/dist/test/simple-context.d.ts +7 -26
- package/dist/test/simple-context.d.ts.map +1 -1
- package/dist/test/tail.d.ts +2 -1
- package/dist/test/tail.d.ts.map +1 -1
- package/dist/test/utilities/artifacts.d.ts +11 -0
- package/dist/test/utilities/artifacts.d.ts.map +1 -0
- package/dist/test/utilities/context.d.ts +39 -0
- package/dist/test/utilities/context.d.ts.map +1 -0
- package/dist/test/utilities/d1.d.ts +21 -0
- package/dist/test/utilities/d1.d.ts.map +1 -0
- package/dist/test/utilities/env.d.ts +40 -0
- package/dist/test/utilities/env.d.ts.map +1 -0
- package/dist/test/utilities/kv.d.ts +11 -0
- package/dist/test/utilities/kv.d.ts.map +1 -0
- package/dist/test/utilities/media.d.ts +16 -0
- package/dist/test/utilities/media.d.ts.map +1 -0
- package/dist/test/utilities/platform.d.ts +41 -0
- package/dist/test/utilities/platform.d.ts.map +1 -0
- package/dist/test/utilities/queue.d.ts +5 -0
- package/dist/test/utilities/queue.d.ts.map +1 -0
- package/dist/test/utilities/r2.d.ts +2 -0
- package/dist/test/utilities/r2.d.ts.map +1 -0
- package/dist/test/utilities/workflows.d.ts +26 -0
- package/dist/test/utilities/workflows.d.ts.map +1 -0
- package/dist/test/utilities.d.ts +10 -98
- package/dist/test/utilities.d.ts.map +1 -1
- package/dist/test/worker.d.ts +6 -0
- package/dist/test/worker.d.ts.map +1 -1
- package/dist/token-35jcdqq8.js +419 -0
- package/dist/transform/durable-object.d.ts.map +1 -1
- package/dist/transform/worker-entrypoint.d.ts +5 -0
- package/dist/transform/worker-entrypoint.d.ts.map +1 -1
- package/dist/types-6vc02evc.js +705 -0
- package/dist/utils/entrypoint-discovery.d.ts +6 -3
- package/dist/utils/entrypoint-discovery.d.ts.map +1 -1
- package/dist/utils/resolve-package.d.ts.map +1 -1
- package/dist/utils/send-email.d.ts +15 -0
- package/dist/utils/send-email.d.ts.map +1 -0
- package/dist/utils/send-email.js +19 -0
- package/dist/vite/config-file.d.ts +25 -0
- package/dist/vite/config-file.d.ts.map +1 -0
- package/dist/vite/index.d.ts +1 -0
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +25 -331
- package/dist/vite/plugin-config-hook.d.ts +28 -0
- package/dist/vite/plugin-config-hook.d.ts.map +1 -0
- package/dist/vite/plugin-context.d.ts +27 -0
- package/dist/vite/plugin-context.d.ts.map +1 -0
- package/dist/vite/plugin-durable-objects.d.ts +18 -0
- package/dist/vite/plugin-durable-objects.d.ts.map +1 -0
- package/dist/vite/plugin-programmatic.d.ts +44 -0
- package/dist/vite/plugin-programmatic.d.ts.map +1 -0
- package/dist/vite/plugin-service-bindings.d.ts +13 -0
- package/dist/vite/plugin-service-bindings.d.ts.map +1 -0
- package/dist/vite/plugin-transform.d.ts +41 -0
- package/dist/vite/plugin-transform.d.ts.map +1 -0
- package/dist/vite/plugin.d.ts +10 -41
- package/dist/vite/plugin.d.ts.map +1 -1
- package/dist/worker-entry/composed-worker.d.ts +7 -0
- package/dist/worker-entry/composed-worker.d.ts.map +1 -0
- package/dist/worker-entry/durable-object-discovery.d.ts +20 -0
- package/dist/worker-entry/durable-object-discovery.d.ts.map +1 -0
- package/dist/worker-entry/extensions.d.ts +5 -0
- package/dist/worker-entry/extensions.d.ts.map +1 -0
- package/dist/worker-entry/routes.d.ts +22 -0
- package/dist/worker-entry/routes.d.ts.map +1 -0
- package/dist/worker-entry/surface-paths.d.ts +26 -0
- package/dist/worker-entry/surface-paths.d.ts.map +1 -0
- package/dist/{worker-entrypoint-m9th0rg0.js → worker-entrypoint-3rmzd4c1.js} +3 -1
- package/dist/worker-f2v85f7d.js +513 -0
- package/dist/workflows/local-workflow-entrypoints.d.ts +7 -0
- package/dist/workflows/local-workflow-entrypoints.d.ts.map +1 -0
- package/package.json +154 -115
- package/dist/account-rvrj687w.js +0 -397
- package/dist/bridge/protocol.d.ts.map +0 -1
- package/dist/bridge/serialization.d.ts.map +0 -1
- package/dist/browser-shim/worker.d.ts +0 -14
- package/dist/browser-shim/worker.d.ts.map +0 -1
- package/dist/build-mnf6v8gd.js +0 -53
- package/dist/deploy-nhceck39.js +0 -70
- package/dist/dev-pa8dhm20.js +0 -2162
- package/dist/index-67qcae0f.js +0 -183
- package/dist/index-ep3445yc.js +0 -2225
- package/dist/index-gz1gndna.js +0 -307
- package/dist/index-hcex3rgh.js +0 -266
- package/dist/index-m2q41jwa.js +0 -462
- package/dist/index-n7rs26ft.js +0 -77
- package/dist/index-pf5s73n9.js +0 -1413
- package/dist/index-tfyxa77h.js +0 -850
- package/dist/index-tk6ej9dj.js +0 -94
- package/dist/test/bridge-context.d.ts +0 -76
- package/dist/test/bridge-context.d.ts.map +0 -1
- package/dist/test/multi-worker-context.d.ts +0 -114
- package/dist/test/multi-worker-context.d.ts.map +0 -1
- package/dist/types-5nyrz1sz.js +0 -454
|
@@ -0,0 +1,708 @@
|
|
|
1
|
+
import {
|
|
2
|
+
browserBindingSchema,
|
|
3
|
+
getSingleBrowserBindingName,
|
|
4
|
+
normalizeArtifactsBinding,
|
|
5
|
+
normalizeCompatibilityFlags,
|
|
6
|
+
normalizeD1Binding,
|
|
7
|
+
normalizeDOBinding,
|
|
8
|
+
normalizeDispatchNamespaceBinding,
|
|
9
|
+
normalizeHyperdriveBinding,
|
|
10
|
+
normalizeImagesBinding,
|
|
11
|
+
normalizeKVBinding,
|
|
12
|
+
normalizeMediaBinding,
|
|
13
|
+
normalizeMtlsCertificateBinding,
|
|
14
|
+
normalizePipelineBinding,
|
|
15
|
+
normalizeSecretsStoreBinding,
|
|
16
|
+
normalizeWorkflowBinding,
|
|
17
|
+
resolveConfigForEnvironment
|
|
18
|
+
} from "./index-dfcp9hsd.js";
|
|
19
|
+
import {
|
|
20
|
+
__require
|
|
21
|
+
} from "./index-37x76zdn.js";
|
|
22
|
+
|
|
23
|
+
// src/config/compiler/paths.ts
|
|
24
|
+
import { basename, isAbsolute, relative, resolve } from "pathe";
|
|
25
|
+
function stringifyConfig(config) {
|
|
26
|
+
const header = `// Generated by devflare — Do not edit directly
|
|
27
|
+
// Edit devflare.config.ts instead
|
|
28
|
+
|
|
29
|
+
`;
|
|
30
|
+
return header + JSON.stringify(config, null, "\t");
|
|
31
|
+
}
|
|
32
|
+
function rebasePathForConfigDir(projectRoot, configDir, pathValue) {
|
|
33
|
+
const absolutePath = isAbsolute(pathValue) ? pathValue : resolve(projectRoot, pathValue);
|
|
34
|
+
return relative(configDir, absolutePath).replace(/\\/g, "/");
|
|
35
|
+
}
|
|
36
|
+
function isLocalContainerPath(pathValue) {
|
|
37
|
+
return pathValue === "Dockerfile" || pathValue.startsWith(".") || pathValue.startsWith("/") || pathValue.startsWith("\\") || isAbsolute(pathValue) || pathValue.endsWith("/Dockerfile") || pathValue.endsWith("\\Dockerfile");
|
|
38
|
+
}
|
|
39
|
+
function pathIsInsideDirectory(directoryPath, candidatePath) {
|
|
40
|
+
const normalizedDirectoryPath = directoryPath.replace(/\\/g, "/");
|
|
41
|
+
const normalizedCandidatePath = candidatePath.replace(/\\/g, "/");
|
|
42
|
+
return normalizedCandidatePath === normalizedDirectoryPath || normalizedCandidatePath.startsWith(`${normalizedDirectoryPath}/`);
|
|
43
|
+
}
|
|
44
|
+
function isolateViteBuildOutputPaths(projectRoot, config) {
|
|
45
|
+
const assetsDirectory = config.assets?.directory;
|
|
46
|
+
if (!assetsDirectory) {
|
|
47
|
+
return config;
|
|
48
|
+
}
|
|
49
|
+
const isolatedAssetsDirectoryPath = resolve(projectRoot, ".devflare", "vite-build-output", basename(assetsDirectory));
|
|
50
|
+
const isolatedAssetsDirectory = relative(projectRoot, isolatedAssetsDirectoryPath).replace(/\\/g, "/");
|
|
51
|
+
const isolatedConfig = {
|
|
52
|
+
...config,
|
|
53
|
+
assets: config.assets ? {
|
|
54
|
+
...config.assets,
|
|
55
|
+
directory: isolatedAssetsDirectory
|
|
56
|
+
} : config.assets
|
|
57
|
+
};
|
|
58
|
+
if (!config.main) {
|
|
59
|
+
return isolatedConfig;
|
|
60
|
+
}
|
|
61
|
+
const originalAssetsDirectoryPath = resolve(projectRoot, assetsDirectory);
|
|
62
|
+
const originalMainEntryPath = resolve(projectRoot, config.main);
|
|
63
|
+
if (!pathIsInsideDirectory(originalAssetsDirectoryPath, originalMainEntryPath)) {
|
|
64
|
+
return isolatedConfig;
|
|
65
|
+
}
|
|
66
|
+
const relativeMainEntryPath = relative(originalAssetsDirectoryPath, originalMainEntryPath);
|
|
67
|
+
const isolatedMainEntryPath = resolve(isolatedAssetsDirectoryPath, relativeMainEntryPath);
|
|
68
|
+
return {
|
|
69
|
+
...isolatedConfig,
|
|
70
|
+
main: relative(projectRoot, isolatedMainEntryPath).replace(/\\/g, "/")
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function rebaseWranglerConfigPaths(projectRoot, configDir, config) {
|
|
74
|
+
return {
|
|
75
|
+
...config,
|
|
76
|
+
...config.main ? { main: rebasePathForConfigDir(projectRoot, configDir, config.main) } : {},
|
|
77
|
+
...config.assets?.directory ? {
|
|
78
|
+
assets: {
|
|
79
|
+
...config.assets,
|
|
80
|
+
directory: rebasePathForConfigDir(projectRoot, configDir, config.assets.directory)
|
|
81
|
+
}
|
|
82
|
+
} : {},
|
|
83
|
+
...config.containers ? {
|
|
84
|
+
containers: config.containers.map((container) => ({
|
|
85
|
+
...container,
|
|
86
|
+
image: isLocalContainerPath(container.image) ? rebasePathForConfigDir(projectRoot, configDir, container.image) : container.image,
|
|
87
|
+
...container.image_build_context && {
|
|
88
|
+
image_build_context: rebasePathForConfigDir(projectRoot, configDir, container.image_build_context)
|
|
89
|
+
}
|
|
90
|
+
}))
|
|
91
|
+
} : {}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
async function writeWranglerConfig(cwd, config, filename = "wrangler.jsonc") {
|
|
95
|
+
const { resolve: resolve2 } = await import("pathe");
|
|
96
|
+
const fs = await import("node:fs/promises");
|
|
97
|
+
try {
|
|
98
|
+
await fs.mkdir(cwd, { recursive: true });
|
|
99
|
+
} catch {}
|
|
100
|
+
const content = stringifyConfig(config);
|
|
101
|
+
const wranglerPath = resolve2(cwd, filename);
|
|
102
|
+
await fs.writeFile(wranglerPath, content, "utf-8");
|
|
103
|
+
return wranglerPath;
|
|
104
|
+
}
|
|
105
|
+
async function readWranglerConfig(filePath) {
|
|
106
|
+
const fs = await import("node:fs/promises");
|
|
107
|
+
const { parse } = await import("jsonc-parser");
|
|
108
|
+
const content = await fs.readFile(filePath, "utf-8");
|
|
109
|
+
const parsedConfig = parse(content);
|
|
110
|
+
if (!parsedConfig || typeof parsedConfig !== "object") {
|
|
111
|
+
throw new Error(`Could not parse Wrangler config at ${filePath}.`);
|
|
112
|
+
}
|
|
113
|
+
return parsedConfig;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// src/config/compiler/bindings.ts
|
|
117
|
+
function getWranglerD1DatabaseBinding(bindingName, bindingConfig, options = {}) {
|
|
118
|
+
const normalized = normalizeD1Binding(bindingConfig);
|
|
119
|
+
if (normalized.databaseId) {
|
|
120
|
+
return {
|
|
121
|
+
binding: bindingName,
|
|
122
|
+
database_id: normalized.databaseId
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
if (options.preserveNamedBindings && normalized.name) {
|
|
126
|
+
return {
|
|
127
|
+
binding: bindingName,
|
|
128
|
+
database_name: normalized.name
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
throw new Error(`D1 binding "${bindingName}" is configured by name (${normalized.name}) and must be resolved before compiling Wrangler config. Use loadResolvedConfig() or resolveConfigResources() for build/deploy/automation flows.`);
|
|
132
|
+
}
|
|
133
|
+
function getWranglerKVNamespaceBinding(bindingName, bindingConfig, options = {}) {
|
|
134
|
+
const normalized = normalizeKVBinding(bindingConfig);
|
|
135
|
+
if (normalized.namespaceId) {
|
|
136
|
+
return {
|
|
137
|
+
binding: bindingName,
|
|
138
|
+
id: normalized.namespaceId
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
if (options.preserveNamedBindings && normalized.name) {
|
|
142
|
+
return {
|
|
143
|
+
binding: bindingName,
|
|
144
|
+
name: normalized.name
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
throw new Error(`KV binding "${bindingName}" is configured by name (${normalized.name}) and must be resolved before compiling Wrangler config. Use loadResolvedConfig() or resolveConfigResources() for build/deploy/automation flows.`);
|
|
148
|
+
}
|
|
149
|
+
function getWranglerHyperdriveBinding(bindingName, bindingConfig, options = {}) {
|
|
150
|
+
const normalized = normalizeHyperdriveBinding(bindingConfig);
|
|
151
|
+
if (normalized.configurationId) {
|
|
152
|
+
return {
|
|
153
|
+
binding: bindingName,
|
|
154
|
+
id: normalized.configurationId,
|
|
155
|
+
...normalized.localConnectionString && {
|
|
156
|
+
localConnectionString: normalized.localConnectionString
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
if (options.preserveNamedBindings && normalized.name) {
|
|
161
|
+
return {
|
|
162
|
+
binding: bindingName,
|
|
163
|
+
name: normalized.name,
|
|
164
|
+
...normalized.localConnectionString && {
|
|
165
|
+
localConnectionString: normalized.localConnectionString
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
throw new Error(`Hyperdrive binding "${bindingName}" is configured by name (${normalized.name}) and must be resolved before compiling Wrangler config. Use loadResolvedConfig() or resolveConfigResources() for build/deploy/automation flows.`);
|
|
170
|
+
}
|
|
171
|
+
function getWranglerBrowserBinding(browserBindings) {
|
|
172
|
+
if (!browserBindings) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const parsed = browserBindingSchema.parse(browserBindings);
|
|
176
|
+
const bindingName = getSingleBrowserBindingName(parsed);
|
|
177
|
+
if (!bindingName) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
const bindingConfig = parsed[bindingName];
|
|
181
|
+
return {
|
|
182
|
+
binding: bindingName,
|
|
183
|
+
...typeof bindingConfig === "object" && bindingConfig.remote !== undefined && {
|
|
184
|
+
remote: bindingConfig.remote
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function compileBindings(bindings, result, options = {}, defaultSecretsStoreId) {
|
|
189
|
+
if (bindings.kv) {
|
|
190
|
+
result.kv_namespaces = Object.entries(bindings.kv).map(([binding, namespace]) => {
|
|
191
|
+
return getWranglerKVNamespaceBinding(binding, namespace, options);
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
if (bindings.d1) {
|
|
195
|
+
result.d1_databases = Object.entries(bindings.d1).map(([binding, database_id]) => {
|
|
196
|
+
return getWranglerD1DatabaseBinding(binding, database_id, options);
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
if (bindings.r2) {
|
|
200
|
+
result.r2_buckets = Object.entries(bindings.r2).map(([binding, bucket_name]) => ({
|
|
201
|
+
binding,
|
|
202
|
+
bucket_name
|
|
203
|
+
}));
|
|
204
|
+
}
|
|
205
|
+
if (bindings.durableObjects) {
|
|
206
|
+
result.durable_objects = {
|
|
207
|
+
bindings: Object.entries(bindings.durableObjects).map(([name, config]) => {
|
|
208
|
+
const normalized = normalizeDOBinding(config);
|
|
209
|
+
const binding = {
|
|
210
|
+
name,
|
|
211
|
+
class_name: normalized.className
|
|
212
|
+
};
|
|
213
|
+
if (normalized.kind === "cross-worker" && normalized.scriptName) {
|
|
214
|
+
binding.script_name = normalized.scriptName;
|
|
215
|
+
}
|
|
216
|
+
return binding;
|
|
217
|
+
})
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
if (bindings.queues) {
|
|
221
|
+
result.queues = {};
|
|
222
|
+
if (bindings.queues.producers) {
|
|
223
|
+
result.queues.producers = Object.entries(bindings.queues.producers).map(([binding, queue]) => ({ binding, queue }));
|
|
224
|
+
}
|
|
225
|
+
if (bindings.queues.consumers) {
|
|
226
|
+
result.queues.consumers = bindings.queues.consumers.map((consumer) => ({
|
|
227
|
+
queue: consumer.queue,
|
|
228
|
+
...consumer.maxBatchSize && { max_batch_size: consumer.maxBatchSize },
|
|
229
|
+
...consumer.maxBatchTimeout && { max_batch_timeout: consumer.maxBatchTimeout },
|
|
230
|
+
...consumer.maxRetries && { max_retries: consumer.maxRetries },
|
|
231
|
+
...consumer.deadLetterQueue && { dead_letter_queue: consumer.deadLetterQueue },
|
|
232
|
+
...consumer.maxConcurrency && { max_concurrency: consumer.maxConcurrency },
|
|
233
|
+
...consumer.retryDelay && { retry_delay: consumer.retryDelay }
|
|
234
|
+
}));
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if (bindings.rateLimits) {
|
|
238
|
+
result.ratelimits = Object.entries(bindings.rateLimits).map(([name, config]) => ({
|
|
239
|
+
name,
|
|
240
|
+
namespace_id: config.namespaceId,
|
|
241
|
+
simple: {
|
|
242
|
+
limit: config.simple.limit,
|
|
243
|
+
period: config.simple.period
|
|
244
|
+
}
|
|
245
|
+
}));
|
|
246
|
+
}
|
|
247
|
+
if (bindings.versionMetadata) {
|
|
248
|
+
result.version_metadata = {
|
|
249
|
+
binding: bindings.versionMetadata.binding
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
if (bindings.workerLoaders) {
|
|
253
|
+
result.worker_loaders = Object.keys(bindings.workerLoaders).map((binding) => ({ binding }));
|
|
254
|
+
}
|
|
255
|
+
if (bindings.mtlsCertificates) {
|
|
256
|
+
result.mtls_certificates = Object.entries(bindings.mtlsCertificates).map(([binding, config]) => {
|
|
257
|
+
const normalized = normalizeMtlsCertificateBinding(config);
|
|
258
|
+
return {
|
|
259
|
+
binding,
|
|
260
|
+
certificate_id: normalized.certificateId,
|
|
261
|
+
...normalized.remote !== undefined && { remote: normalized.remote }
|
|
262
|
+
};
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
if (bindings.dispatchNamespaces) {
|
|
266
|
+
result.dispatch_namespaces = Object.entries(bindings.dispatchNamespaces).map(([binding, config]) => {
|
|
267
|
+
const normalized = normalizeDispatchNamespaceBinding(config);
|
|
268
|
+
return {
|
|
269
|
+
binding,
|
|
270
|
+
namespace: normalized.namespace,
|
|
271
|
+
...normalized.outbound && { outbound: normalized.outbound },
|
|
272
|
+
...normalized.remote !== undefined && { remote: normalized.remote }
|
|
273
|
+
};
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
if (bindings.workflows) {
|
|
277
|
+
result.workflows = Object.entries(bindings.workflows).map(([binding, config]) => {
|
|
278
|
+
const normalized = normalizeWorkflowBinding(config);
|
|
279
|
+
return {
|
|
280
|
+
binding,
|
|
281
|
+
name: normalized.name,
|
|
282
|
+
class_name: normalized.className,
|
|
283
|
+
...normalized.scriptName && { script_name: normalized.scriptName },
|
|
284
|
+
...normalized.remote !== undefined && { remote: normalized.remote },
|
|
285
|
+
...normalized.limits && { limits: normalized.limits }
|
|
286
|
+
};
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
if (bindings.pipelines) {
|
|
290
|
+
result.pipelines = Object.entries(bindings.pipelines).map(([binding, config]) => {
|
|
291
|
+
const normalized = normalizePipelineBinding(config);
|
|
292
|
+
return {
|
|
293
|
+
binding,
|
|
294
|
+
pipeline: normalized.pipeline,
|
|
295
|
+
...normalized.remote !== undefined && { remote: normalized.remote }
|
|
296
|
+
};
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
if (bindings.images) {
|
|
300
|
+
const [entry] = Object.entries(bindings.images);
|
|
301
|
+
if (entry) {
|
|
302
|
+
const [binding, config] = entry;
|
|
303
|
+
const normalized = normalizeImagesBinding(binding, config);
|
|
304
|
+
result.images = {
|
|
305
|
+
binding: normalized.binding,
|
|
306
|
+
...normalized.remote !== undefined && { remote: normalized.remote }
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if (bindings.media) {
|
|
311
|
+
const [entry] = Object.entries(bindings.media);
|
|
312
|
+
if (entry) {
|
|
313
|
+
const [binding, config] = entry;
|
|
314
|
+
const normalized = normalizeMediaBinding(binding, config);
|
|
315
|
+
result.media = {
|
|
316
|
+
binding: normalized.binding,
|
|
317
|
+
...normalized.remote !== undefined && { remote: normalized.remote }
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
if (bindings.artifacts) {
|
|
322
|
+
result.artifacts = Object.entries(bindings.artifacts).map(([binding, config]) => {
|
|
323
|
+
const normalized = normalizeArtifactsBinding(config);
|
|
324
|
+
return {
|
|
325
|
+
binding,
|
|
326
|
+
namespace: normalized.namespace,
|
|
327
|
+
...normalized.remote !== undefined && { remote: normalized.remote }
|
|
328
|
+
};
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
if (bindings.secretsStore) {
|
|
332
|
+
result.secrets_store_secrets = Object.entries(bindings.secretsStore).map(([binding, config]) => {
|
|
333
|
+
const normalized = normalizeSecretsStoreBinding(config, defaultSecretsStoreId, binding);
|
|
334
|
+
return {
|
|
335
|
+
binding,
|
|
336
|
+
store_id: normalized.storeId,
|
|
337
|
+
secret_name: normalized.secretName
|
|
338
|
+
};
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
if (bindings.services) {
|
|
342
|
+
result.services = Object.entries(bindings.services).map(([binding, config]) => ({
|
|
343
|
+
binding,
|
|
344
|
+
service: config.service,
|
|
345
|
+
...config.entrypoint && { entrypoint: config.entrypoint },
|
|
346
|
+
...config.environment && { environment: config.environment }
|
|
347
|
+
}));
|
|
348
|
+
}
|
|
349
|
+
if (bindings.ai?.binding) {
|
|
350
|
+
result.ai = {
|
|
351
|
+
binding: bindings.ai.binding,
|
|
352
|
+
...bindings.ai.remote !== undefined && { remote: bindings.ai.remote },
|
|
353
|
+
...bindings.ai.staging !== undefined && { staging: bindings.ai.staging }
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
if (bindings.aiSearchNamespaces) {
|
|
357
|
+
result.ai_search_namespaces = Object.entries(bindings.aiSearchNamespaces).map(([binding, config]) => ({
|
|
358
|
+
binding,
|
|
359
|
+
namespace: config.namespace,
|
|
360
|
+
...config.remote !== undefined && { remote: config.remote }
|
|
361
|
+
}));
|
|
362
|
+
}
|
|
363
|
+
if (bindings.aiSearch) {
|
|
364
|
+
result.ai_search = Object.entries(bindings.aiSearch).map(([binding, config]) => ({
|
|
365
|
+
binding,
|
|
366
|
+
instance_name: config.instanceName,
|
|
367
|
+
...config.remote !== undefined && { remote: config.remote }
|
|
368
|
+
}));
|
|
369
|
+
}
|
|
370
|
+
if (bindings.vectorize) {
|
|
371
|
+
result.vectorize = Object.entries(bindings.vectorize).map(([binding, config]) => ({
|
|
372
|
+
binding,
|
|
373
|
+
index_name: config.indexName,
|
|
374
|
+
...config.remote !== undefined && { remote: config.remote }
|
|
375
|
+
}));
|
|
376
|
+
}
|
|
377
|
+
if (bindings.hyperdrive) {
|
|
378
|
+
result.hyperdrive = Object.entries(bindings.hyperdrive).map(([binding, config]) => {
|
|
379
|
+
return getWranglerHyperdriveBinding(binding, config, options);
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
const browserBinding = getWranglerBrowserBinding(bindings.browser);
|
|
383
|
+
if (browserBinding) {
|
|
384
|
+
result.browser = browserBinding;
|
|
385
|
+
}
|
|
386
|
+
if (bindings.analyticsEngine) {
|
|
387
|
+
result.analytics_engine_datasets = Object.entries(bindings.analyticsEngine).map(([binding, config]) => ({
|
|
388
|
+
binding,
|
|
389
|
+
dataset: config.dataset
|
|
390
|
+
}));
|
|
391
|
+
}
|
|
392
|
+
if (bindings.sendEmail) {
|
|
393
|
+
result.send_email = Object.entries(bindings.sendEmail).map(([name, config]) => ({
|
|
394
|
+
name,
|
|
395
|
+
...config.destinationAddress && {
|
|
396
|
+
destination_address: config.destinationAddress
|
|
397
|
+
},
|
|
398
|
+
...config.allowedDestinationAddresses && {
|
|
399
|
+
allowed_destination_addresses: config.allowedDestinationAddresses
|
|
400
|
+
},
|
|
401
|
+
...config.allowedSenderAddresses && {
|
|
402
|
+
allowed_sender_addresses: config.allowedSenderAddresses
|
|
403
|
+
}
|
|
404
|
+
}));
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// src/config/compiler/core-helpers.ts
|
|
409
|
+
function compileWranglerMigrations(migrations) {
|
|
410
|
+
return migrations.map((migration) => ({
|
|
411
|
+
tag: migration.tag,
|
|
412
|
+
...migration.new_classes && { new_classes: migration.new_classes },
|
|
413
|
+
...migration.renamed_classes && {
|
|
414
|
+
renamed_classes: migration.renamed_classes.map((renamedClass) => ({
|
|
415
|
+
from: renamedClass.from,
|
|
416
|
+
to: renamedClass.to
|
|
417
|
+
}))
|
|
418
|
+
},
|
|
419
|
+
...migration.deleted_classes && { deleted_classes: migration.deleted_classes },
|
|
420
|
+
...migration.new_sqlite_classes && { new_sqlite_classes: migration.new_sqlite_classes }
|
|
421
|
+
}));
|
|
422
|
+
}
|
|
423
|
+
function compileModuleOptions(config, result) {
|
|
424
|
+
if (config.rules && config.rules.length > 0) {
|
|
425
|
+
result.rules = config.rules;
|
|
426
|
+
}
|
|
427
|
+
if (config.findAdditionalModules !== undefined) {
|
|
428
|
+
result.find_additional_modules = config.findAdditionalModules;
|
|
429
|
+
}
|
|
430
|
+
if (config.baseDir) {
|
|
431
|
+
result.base_dir = config.baseDir;
|
|
432
|
+
}
|
|
433
|
+
if (config.preserveFileNames !== undefined) {
|
|
434
|
+
result.preserve_file_names = config.preserveFileNames;
|
|
435
|
+
}
|
|
436
|
+
if (config.logpush !== undefined) {
|
|
437
|
+
result.logpush = config.logpush;
|
|
438
|
+
}
|
|
439
|
+
if (config.uploadSourceMaps !== undefined) {
|
|
440
|
+
result.upload_source_maps = config.uploadSourceMaps;
|
|
441
|
+
}
|
|
442
|
+
if (config.keepVars !== undefined) {
|
|
443
|
+
result.keep_vars = config.keepVars;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
function compileContainers(config, result) {
|
|
447
|
+
if (!config.containers || config.containers.length === 0) {
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
result.containers = config.containers.map((container) => ({
|
|
451
|
+
class_name: container.className,
|
|
452
|
+
image: container.image,
|
|
453
|
+
...container.maxInstances !== undefined && { max_instances: container.maxInstances },
|
|
454
|
+
...container.instanceType && { instance_type: container.instanceType },
|
|
455
|
+
...container.name && { name: container.name },
|
|
456
|
+
...container.imageBuildContext && { image_build_context: container.imageBuildContext },
|
|
457
|
+
...container.imageVars && { image_vars: container.imageVars },
|
|
458
|
+
...container.rolloutActiveGracePeriod !== undefined && {
|
|
459
|
+
rollout_active_grace_period: container.rolloutActiveGracePeriod
|
|
460
|
+
},
|
|
461
|
+
...container.rolloutStepPercentage !== undefined && {
|
|
462
|
+
rollout_step_percentage: container.rolloutStepPercentage
|
|
463
|
+
}
|
|
464
|
+
}));
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// src/config/local-dev-vars.ts
|
|
468
|
+
import { readFile } from "node:fs/promises";
|
|
469
|
+
import { resolve as resolve2 } from "pathe";
|
|
470
|
+
function parseEnvValue(value) {
|
|
471
|
+
const trimmed = value.trim();
|
|
472
|
+
const quote = trimmed[0];
|
|
473
|
+
if ((quote === '"' || quote === "'" || quote === "`") && trimmed.endsWith(quote) && trimmed.length >= 2) {
|
|
474
|
+
const inner = trimmed.slice(1, -1);
|
|
475
|
+
return quote === '"' ? inner.replace(/\\n/g, `
|
|
476
|
+
`).replace(/\\r/g, "\r").replace(/\\t/g, "\t").replace(/\\"/g, '"').replace(/\\\\/g, "\\") : inner;
|
|
477
|
+
}
|
|
478
|
+
const commentIndex = trimmed.search(/\s+#/);
|
|
479
|
+
return (commentIndex >= 0 ? trimmed.slice(0, commentIndex) : trimmed).trimEnd();
|
|
480
|
+
}
|
|
481
|
+
function parseEnvFile(contents) {
|
|
482
|
+
const vars = {};
|
|
483
|
+
for (const line of contents.split(/\r?\n/)) {
|
|
484
|
+
const trimmed = line.trim();
|
|
485
|
+
if (!trimmed || trimmed.startsWith("#")) {
|
|
486
|
+
continue;
|
|
487
|
+
}
|
|
488
|
+
const assignment = trimmed.startsWith("export ") ? trimmed.slice("export ".length).trimStart() : trimmed;
|
|
489
|
+
const equalsIndex = assignment.indexOf("=");
|
|
490
|
+
if (equalsIndex <= 0) {
|
|
491
|
+
continue;
|
|
492
|
+
}
|
|
493
|
+
const key = assignment.slice(0, equalsIndex).trim();
|
|
494
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(key)) {
|
|
495
|
+
continue;
|
|
496
|
+
}
|
|
497
|
+
vars[key] = parseEnvValue(assignment.slice(equalsIndex + 1));
|
|
498
|
+
}
|
|
499
|
+
return vars;
|
|
500
|
+
}
|
|
501
|
+
async function readOptionalEnvFile(filePath) {
|
|
502
|
+
try {
|
|
503
|
+
return parseEnvFile(await readFile(filePath, "utf8"));
|
|
504
|
+
} catch (error) {
|
|
505
|
+
if (error.code === "ENOENT") {
|
|
506
|
+
return null;
|
|
507
|
+
}
|
|
508
|
+
throw error;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
async function loadWranglerCompatibleLocalVars(cwd, environment) {
|
|
512
|
+
const environmentDevVars = environment ? await readOptionalEnvFile(resolve2(cwd, `.dev.vars.${environment}`)) : null;
|
|
513
|
+
if (environmentDevVars) {
|
|
514
|
+
return environmentDevVars;
|
|
515
|
+
}
|
|
516
|
+
const devVars = await readOptionalEnvFile(resolve2(cwd, ".dev.vars"));
|
|
517
|
+
if (devVars) {
|
|
518
|
+
return devVars;
|
|
519
|
+
}
|
|
520
|
+
const envFiles = [
|
|
521
|
+
".env",
|
|
522
|
+
".env.local",
|
|
523
|
+
...environment ? [`.env.${environment}`, `.env.${environment}.local`] : []
|
|
524
|
+
];
|
|
525
|
+
const merged = {};
|
|
526
|
+
for (const fileName of envFiles) {
|
|
527
|
+
const values = await readOptionalEnvFile(resolve2(cwd, fileName));
|
|
528
|
+
if (values) {
|
|
529
|
+
Object.assign(merged, values);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
return merged;
|
|
533
|
+
}
|
|
534
|
+
function toWranglerSecretsConfig(secrets) {
|
|
535
|
+
if (!secrets) {
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
const required = Object.entries(secrets).filter(([, config]) => config.required !== false).map(([name]) => name).sort();
|
|
539
|
+
return required.length > 0 ? { required } : undefined;
|
|
540
|
+
}
|
|
541
|
+
async function loadLocalDevVars(options) {
|
|
542
|
+
const activeEnvironment = options.environment ?? process.env.CLOUDFLARE_ENV;
|
|
543
|
+
const localVars = await loadWranglerCompatibleLocalVars(options.cwd, activeEnvironment);
|
|
544
|
+
const secretNames = toWranglerSecretsConfig(options.secrets)?.required;
|
|
545
|
+
const filteredLocalVars = secretNames ? Object.fromEntries(Object.entries(localVars).filter(([name]) => secretNames.includes(name))) : localVars;
|
|
546
|
+
return {
|
|
547
|
+
...options.vars ?? {},
|
|
548
|
+
...filteredLocalVars
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
async function applyLocalDevVarsToConfig(config, options) {
|
|
552
|
+
const vars = await loadLocalDevVars({
|
|
553
|
+
...options,
|
|
554
|
+
vars: config.vars,
|
|
555
|
+
secrets: config.secrets
|
|
556
|
+
});
|
|
557
|
+
if (Object.keys(vars).length === 0) {
|
|
558
|
+
return config;
|
|
559
|
+
}
|
|
560
|
+
return {
|
|
561
|
+
...config,
|
|
562
|
+
vars
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// src/config/compiler/do-workers.ts
|
|
567
|
+
import { resolve as resolve3 } from "pathe";
|
|
568
|
+
|
|
569
|
+
// src/config/compiler.ts
|
|
570
|
+
function compileConfig(config, environment) {
|
|
571
|
+
return compileConfigInternal(config, environment);
|
|
572
|
+
}
|
|
573
|
+
function compileBuildConfig(config, environment, options = {}) {
|
|
574
|
+
return compileConfigInternal(config, environment, {
|
|
575
|
+
preserveNamedBindings: true,
|
|
576
|
+
alreadyResolved: options.alreadyResolved
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
function compileConfigInternal(config, environment, options = {}) {
|
|
580
|
+
const resolvedConfig = options.alreadyResolved ? config : resolveConfigForEnvironment(config, environment);
|
|
581
|
+
const mergedConfig = {
|
|
582
|
+
...resolvedConfig,
|
|
583
|
+
compatibilityFlags: normalizeCompatibilityFlags(resolvedConfig.compatibilityFlags)
|
|
584
|
+
};
|
|
585
|
+
const result = {
|
|
586
|
+
name: mergedConfig.name,
|
|
587
|
+
compatibility_date: mergedConfig.compatibilityDate,
|
|
588
|
+
preview_urls: true,
|
|
589
|
+
workers_dev: true
|
|
590
|
+
};
|
|
591
|
+
if (mergedConfig.accountId) {
|
|
592
|
+
result.account_id = mergedConfig.accountId;
|
|
593
|
+
}
|
|
594
|
+
const mainEntry = mergedConfig.files?.fetch;
|
|
595
|
+
if (typeof mainEntry === "string") {
|
|
596
|
+
result.main = mainEntry;
|
|
597
|
+
}
|
|
598
|
+
compileModuleOptions(mergedConfig, result);
|
|
599
|
+
if (mergedConfig.compatibilityFlags && mergedConfig.compatibilityFlags.length > 0) {
|
|
600
|
+
result.compatibility_flags = mergedConfig.compatibilityFlags;
|
|
601
|
+
}
|
|
602
|
+
if (mergedConfig.bindings) {
|
|
603
|
+
compileBindings(mergedConfig.bindings, result, options, mergedConfig.secretsStoreId);
|
|
604
|
+
}
|
|
605
|
+
if (mergedConfig.triggers?.crons && mergedConfig.triggers.crons.length > 0) {
|
|
606
|
+
result.triggers = { crons: mergedConfig.triggers.crons };
|
|
607
|
+
}
|
|
608
|
+
if (mergedConfig.tailConsumers && mergedConfig.tailConsumers.length > 0) {
|
|
609
|
+
result.tail_consumers = mergedConfig.tailConsumers.map((consumer) => typeof consumer === "string" ? { service: consumer } : {
|
|
610
|
+
service: consumer.service,
|
|
611
|
+
...consumer.environment && { environment: consumer.environment }
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
if (mergedConfig.vars && Object.keys(mergedConfig.vars).length > 0) {
|
|
615
|
+
result.vars = mergedConfig.vars;
|
|
616
|
+
}
|
|
617
|
+
const secrets = toWranglerSecretsConfig(mergedConfig.secrets);
|
|
618
|
+
if (secrets) {
|
|
619
|
+
result.secrets = secrets;
|
|
620
|
+
}
|
|
621
|
+
if (mergedConfig.routes && mergedConfig.routes.length > 0) {
|
|
622
|
+
result.routes = mergedConfig.routes.map((route) => ({
|
|
623
|
+
pattern: route.pattern,
|
|
624
|
+
...route.zone_name && { zone_name: route.zone_name },
|
|
625
|
+
...route.zone_id && { zone_id: route.zone_id },
|
|
626
|
+
...route.custom_domain !== undefined && { custom_domain: route.custom_domain }
|
|
627
|
+
}));
|
|
628
|
+
}
|
|
629
|
+
if (mergedConfig.assets?.directory) {
|
|
630
|
+
result.assets = {
|
|
631
|
+
directory: mergedConfig.assets.directory,
|
|
632
|
+
...mergedConfig.assets.binding && { binding: mergedConfig.assets.binding },
|
|
633
|
+
...mergedConfig.assets.html_handling && {
|
|
634
|
+
html_handling: mergedConfig.assets.html_handling
|
|
635
|
+
},
|
|
636
|
+
...mergedConfig.assets.not_found_handling && {
|
|
637
|
+
not_found_handling: mergedConfig.assets.not_found_handling
|
|
638
|
+
},
|
|
639
|
+
...mergedConfig.assets.run_worker_first !== undefined && {
|
|
640
|
+
run_worker_first: mergedConfig.assets.run_worker_first
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
if (mergedConfig.placement) {
|
|
645
|
+
result.placement = mergedConfig.placement;
|
|
646
|
+
}
|
|
647
|
+
if (mergedConfig.observability) {
|
|
648
|
+
result.observability = mergedConfig.observability;
|
|
649
|
+
}
|
|
650
|
+
if (mergedConfig.limits) {
|
|
651
|
+
result.limits = mergedConfig.limits;
|
|
652
|
+
}
|
|
653
|
+
compileContainers(mergedConfig, result);
|
|
654
|
+
if (mergedConfig.migrations && mergedConfig.migrations.length > 0) {
|
|
655
|
+
result.migrations = compileWranglerMigrations(mergedConfig.migrations);
|
|
656
|
+
}
|
|
657
|
+
if (mergedConfig.wrangler?.passthrough) {
|
|
658
|
+
Object.assign(result, mergedConfig.wrangler.passthrough);
|
|
659
|
+
}
|
|
660
|
+
return result;
|
|
661
|
+
}
|
|
662
|
+
function compileToProgrammaticConfig(config, environment, options = {}) {
|
|
663
|
+
return options.preserveNamedBindings ? compileBuildConfig(config, environment) : compileConfig(config, environment);
|
|
664
|
+
}
|
|
665
|
+
// src/config/service-bindings-validation.ts
|
|
666
|
+
class ServiceBindingValidationError extends Error {
|
|
667
|
+
code = "SERVICE_BINDING_VALIDATION_ERROR";
|
|
668
|
+
missing;
|
|
669
|
+
constructor(missing, accountId) {
|
|
670
|
+
super(`Service binding(s) reference worker(s) that do not exist in Cloudflare account ${accountId}: ` + missing.join(", ") + `. Check the 'services' map in devflare.config.ts for typos or deploy the target worker(s) first.`);
|
|
671
|
+
this.name = "ServiceBindingValidationError";
|
|
672
|
+
this.missing = missing;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
function collectReferencedServiceNames(config) {
|
|
676
|
+
const services = config.bindings?.services;
|
|
677
|
+
if (!services) {
|
|
678
|
+
return [];
|
|
679
|
+
}
|
|
680
|
+
const names = new Set;
|
|
681
|
+
for (const binding of Object.values(services)) {
|
|
682
|
+
if (binding && typeof binding === "object" && typeof binding.service === "string") {
|
|
683
|
+
const name = binding.service.trim();
|
|
684
|
+
if (name.length > 0) {
|
|
685
|
+
names.add(name);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
return [...names];
|
|
690
|
+
}
|
|
691
|
+
async function validateServiceBindings(config, accountId, options) {
|
|
692
|
+
const referenced = collectReferencedServiceNames(config);
|
|
693
|
+
if (referenced.length === 0) {
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
const selfName = options.selfWorkerName?.trim();
|
|
697
|
+
const toValidate = selfName ? referenced.filter((name) => name !== selfName) : referenced;
|
|
698
|
+
if (toValidate.length === 0) {
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
const workers = await options.listWorkers(accountId);
|
|
702
|
+
const workerNames = new Set(workers.map((worker) => worker.name));
|
|
703
|
+
const missing = toValidate.filter((name) => !workerNames.has(name));
|
|
704
|
+
if (missing.length > 0) {
|
|
705
|
+
throw new ServiceBindingValidationError(missing, accountId);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
export { applyLocalDevVarsToConfig, stringifyConfig, isolateViteBuildOutputPaths, rebaseWranglerConfigPaths, writeWranglerConfig, readWranglerConfig, compileConfig, compileBuildConfig, compileToProgrammaticConfig, ServiceBindingValidationError, validateServiceBindings };
|