devflare 1.0.0-next.3 → 1.0.0-next.30
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 +15961 -1751
- package/README.md +389 -605
- package/bin/devflare.js +24 -14
- package/dist/account-fvf5gxc9.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 +4585 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +147 -0
- package/dist/build-x1fhfsgs.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 +267 -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 +3005 -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 +390 -0
- package/dist/config/schema-types.d.ts.map +1 -0
- package/dist/config/schema.d.ts +4495 -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-2d6x21jn.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-g85w9drn.js +1066 -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/dev-ymkq3thq.js +2609 -0
- package/dist/{doctor-fmgb3d28.js → doctor-sjrcz7x9.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-0gtmnw0m.js +895 -0
- package/dist/index-11p28kxx.js +256 -0
- package/dist/index-15fpa5tx.js +232 -0
- package/dist/index-1d4jg11n.js +542 -0
- package/dist/index-2sc756r1.js +1578 -0
- package/dist/index-3edvz3hs.js +124 -0
- package/dist/index-3jme4hgw.js +1234 -0
- package/dist/index-467tm7r4.js +1033 -0
- package/dist/index-5yvpk954.js +699 -0
- package/dist/index-627srx16.js +45 -0
- package/dist/index-62b3gt2g.js +12 -0
- package/dist/index-6sj0v0dk.js +2284 -0
- package/dist/index-706k4606.js +52 -0
- package/dist/index-7zfv1g9m.js +147 -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-c4jmfzz7.js +109 -0
- package/dist/index-c8p4njqy.js +479 -0
- package/dist/index-dm9q84c7.js +360 -0
- package/dist/index-fjmdb57t.js +581 -0
- package/dist/index-g4fcnwhc.js +1205 -0
- package/dist/{index-18hvb6gb.js → index-gn5wy09x.js} +13 -2
- package/dist/index-hpwa6vsw.js +239 -0
- package/dist/index-mg8vwqxf.js +514 -0
- package/dist/index-pmeashfz.js +476 -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-sqkbyw0c.js +1428 -0
- package/dist/index-stgn34cr.js +148 -0
- package/dist/index-t9y0sve5.js +155 -0
- package/dist/index-thwacc28.js +74 -0
- package/dist/index-vhqww6tt.js +307 -0
- package/dist/{index-1xpj0m4r.js → index-z9gy8w6b.js} +1 -1
- package/dist/index-za0r01bx.js +588 -0
- package/dist/index-zwmphmc5.js +185 -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-fthspvbx.js +77 -0
- package/dist/previews-aa16z2hj.js +1337 -0
- package/dist/productions-vemjgfz0.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-b0x50dd1.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-03w8zkg6.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-55q6b8nc.js +513 -0
- 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/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,41 @@
|
|
|
1
|
+
interface TransformResult {
|
|
2
|
+
code: string;
|
|
3
|
+
map?: any;
|
|
4
|
+
}
|
|
5
|
+
export interface RunDevflareTransformOptions {
|
|
6
|
+
doTransforms: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Returns `true` when devflare may rewrite the given module. Skips
|
|
10
|
+
* `node_modules` and any file that isn't a `.ts`/`.tsx`/`.js`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isTransformCandidate(id: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Worker-entrypoint instrumentation step.
|
|
15
|
+
*
|
|
16
|
+
* Only handles `worker.ts` / `worker.js` files and only when
|
|
17
|
+
* `shouldTransformWorker` accepts them. Returns `null` when this step does
|
|
18
|
+
* not apply, so the caller can fall through to other transforms.
|
|
19
|
+
*/
|
|
20
|
+
export declare function runWorkerEntryTransform(code: string, id: string): Promise<TransformResult | null>;
|
|
21
|
+
/**
|
|
22
|
+
* Durable Object class transform step.
|
|
23
|
+
*
|
|
24
|
+
* Only runs when the user opted in via `doTransforms` and the source mentions
|
|
25
|
+
* `DurableObject` or the `@durableObject` decorator. Returns `null` when this
|
|
26
|
+
* step does not apply.
|
|
27
|
+
*/
|
|
28
|
+
export declare function runDurableObjectTransform(code: string, id: string, options: RunDevflareTransformOptions): Promise<TransformResult | null>;
|
|
29
|
+
/**
|
|
30
|
+
* Apply devflare's source-level transforms to a single module.
|
|
31
|
+
*
|
|
32
|
+
* Order:
|
|
33
|
+
* 1. Worker-entrypoint instrumentation (`runWorkerEntryTransform`)
|
|
34
|
+
* 2. Durable Object class transform (`runDurableObjectTransform`)
|
|
35
|
+
*
|
|
36
|
+
* Returns `null` when no transform applies, mirroring Vite's transform-hook
|
|
37
|
+
* contract.
|
|
38
|
+
*/
|
|
39
|
+
export declare function runDevflareTransform(code: string, id: string, options: RunDevflareTransformOptions): Promise<TransformResult | null>;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=plugin-transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-transform.d.ts","sourceRoot":"","sources":["../../src/vite/plugin-transform.ts"],"names":[],"mappings":"AAQA,UAAU,eAAe;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,GAAG,CAAA;CACT;AAED,MAAM,WAAW,2BAA2B;IAC3C,YAAY,EAAE,OAAO,CAAA;CACrB;AAID;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAGxD;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC5C,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACR,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAqBjC;AAED;;;;;;GAMG;AACH,wBAAsB,yBAAyB,CAC9C,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,2BAA2B,GAClC,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAQjC;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACzC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,2BAA2B,GAClC,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAOjC"}
|
package/dist/vite/plugin.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
|
-
import {
|
|
2
|
+
import type { WranglerConfig } from '../config/compiler';
|
|
3
|
+
import { type AuxiliaryWorkerConfig, type DODiscoveryResult } from './plugin-durable-objects';
|
|
4
|
+
export type { AuxiliaryWorkerConfig, DODiscoveryResult };
|
|
3
5
|
export interface DevflarePluginOptions {
|
|
4
6
|
/**
|
|
5
7
|
* Path to devflare.config.ts
|
|
@@ -52,20 +54,13 @@ export interface DevflarePluginContext {
|
|
|
52
54
|
* Pass to @cloudflare/vite-plugin's auxiliaryWorkers option
|
|
53
55
|
*/
|
|
54
56
|
auxiliaryWorkerConfig: AuxiliaryWorkerConfig | null;
|
|
57
|
+
auxiliaryWorkerConfigs: AuxiliaryWorkerConfig[];
|
|
58
|
+
serviceWorkerVirtualModules: Map<string, string>;
|
|
55
59
|
/**
|
|
56
60
|
* Discovered DO files and their classes
|
|
57
61
|
*/
|
|
58
62
|
durableObjects: DODiscoveryResult | null;
|
|
59
63
|
}
|
|
60
|
-
export interface DODiscoveryResult {
|
|
61
|
-
/** Map of file path → array of class names */
|
|
62
|
-
files: Map<string, string[]>;
|
|
63
|
-
/** Worker name for the auxiliary DO worker */
|
|
64
|
-
workerName: string;
|
|
65
|
-
}
|
|
66
|
-
export interface AuxiliaryWorkerConfig {
|
|
67
|
-
config: Record<string, unknown>;
|
|
68
|
-
}
|
|
69
64
|
/**
|
|
70
65
|
* Get the compiled config context
|
|
71
66
|
* Can be used by other plugins or CLI commands
|
|
@@ -93,8 +88,8 @@ export declare function getPluginContext(): DevflarePluginContext;
|
|
|
93
88
|
* // Access context after configResolved
|
|
94
89
|
* cloudflare({
|
|
95
90
|
* config: getPluginContext().cloudflareConfig,
|
|
96
|
-
* auxiliaryWorkers: getPluginContext().
|
|
97
|
-
* ?
|
|
91
|
+
* auxiliaryWorkers: getPluginContext().auxiliaryWorkerConfigs.length > 0
|
|
92
|
+
* ? getPluginContext().auxiliaryWorkerConfigs
|
|
98
93
|
* : undefined
|
|
99
94
|
* })
|
|
100
95
|
* ]
|
|
@@ -104,35 +99,9 @@ export declare function getPluginContext(): DevflarePluginContext;
|
|
|
104
99
|
*/
|
|
105
100
|
export declare function devflarePlugin(options?: DevflarePluginOptions): Plugin;
|
|
106
101
|
/**
|
|
107
|
-
* Get cloudflare config for programmatic use with @cloudflare/vite-plugin
|
|
108
|
-
*
|
|
109
|
-
*/
|
|
110
|
-
export declare function getCloudflareConfig(options?: {
|
|
111
|
-
cwd?: string;
|
|
112
|
-
configPath?: string;
|
|
113
|
-
environment?: string;
|
|
114
|
-
}): Promise<Record<string, unknown>>;
|
|
115
|
-
/**
|
|
116
|
-
* Get auxiliary worker configs for Durable Objects
|
|
117
|
-
* Use this when configuring @cloudflare/vite-plugin's auxiliaryWorkers option
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* ```ts
|
|
121
|
-
* const { cloudflareConfig, auxiliaryWorkers } = await getDevflareConfigs()
|
|
122
|
-
*
|
|
123
|
-
* cloudflare({
|
|
124
|
-
* config: cloudflareConfig,
|
|
125
|
-
* auxiliaryWorkers
|
|
126
|
-
* })
|
|
127
|
-
* ```
|
|
102
|
+
* Get cloudflare config for programmatic use with @cloudflare/vite-plugin.
|
|
103
|
+
* Re-exported from `./plugin-programmatic`.
|
|
128
104
|
*/
|
|
129
|
-
export
|
|
130
|
-
cwd?: string;
|
|
131
|
-
configPath?: string;
|
|
132
|
-
environment?: string;
|
|
133
|
-
}): Promise<{
|
|
134
|
-
cloudflareConfig: Record<string, unknown>;
|
|
135
|
-
auxiliaryWorkers: AuxiliaryWorkerConfig[];
|
|
136
|
-
}>;
|
|
105
|
+
export { getCloudflareConfig, getDevflareConfigs } from './plugin-programmatic';
|
|
137
106
|
export default devflarePlugin;
|
|
138
107
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/vite/plugin.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAiC,MAAM,MAAM,CAAA;AAGjE,OAAO,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/vite/plugin.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAiC,MAAM,MAAM,CAAA;AAGjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAKN,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,MAAM,0BAA0B,CAAA;AAejC,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,CAAA;AAKxD,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IAEtB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,cAAc,EAAE,cAAc,GAAG,IAAI,CAAA;IAErC;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IAEhD;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IAEnB;;;OAGG;IACH,qBAAqB,EAAE,qBAAqB,GAAG,IAAI,CAAA;IACnD,sBAAsB,EAAE,qBAAqB,EAAE,CAAA;IAC/C,2BAA2B,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAEhD;;OAEG;IACH,cAAc,EAAE,iBAAiB,GAAG,IAAI,CAAA;CACxC;AAqED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAExD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,qBAA0B,GAAG,MAAM,CA8H1E;AAED;;;GAGG;AACH,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;eAGhE,cAAc"}
|
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
import {
|
|
2
|
+
findConfigPathsUnderDirectory,
|
|
3
|
+
formatSupportedConfigFilenames,
|
|
4
|
+
resolveConfigCandidatePath
|
|
5
|
+
} from "./index-706k4606.js";
|
|
6
|
+
import {
|
|
7
|
+
asOptionalString,
|
|
8
|
+
resolveCloudflareAccountId
|
|
9
|
+
} from "./index-thwacc28.js";
|
|
10
|
+
import {
|
|
11
|
+
account
|
|
12
|
+
} from "./index-qmmqww7h.js";
|
|
13
|
+
import"./index-11p28kxx.js";
|
|
14
|
+
import"./index-3jme4hgw.js";
|
|
15
|
+
import {
|
|
16
|
+
bold,
|
|
17
|
+
createCliTheme,
|
|
18
|
+
dim,
|
|
19
|
+
green,
|
|
20
|
+
logLine,
|
|
21
|
+
whiteDim,
|
|
22
|
+
yellow
|
|
23
|
+
} from "./index-stgn34cr.js";
|
|
24
|
+
import"./index-3t6rypgc.js";
|
|
25
|
+
import"./index-15fpa5tx.js";
|
|
26
|
+
import"./index-qwgr4q7s.js";
|
|
27
|
+
import"./index-5yvpk954.js";
|
|
28
|
+
import {
|
|
29
|
+
loadConfig,
|
|
30
|
+
normalizeDOBinding
|
|
31
|
+
} from "./index-2sc756r1.js";
|
|
32
|
+
import"./index-1d4jg11n.js";
|
|
33
|
+
import"./index-mg8vwqxf.js";
|
|
34
|
+
import"./index-c8p4njqy.js";
|
|
35
|
+
import"./index-q8f4kawk.js";
|
|
36
|
+
import {
|
|
37
|
+
__require
|
|
38
|
+
} from "./index-37x76zdn.js";
|
|
39
|
+
|
|
40
|
+
// src/cli/commands/worker.ts
|
|
41
|
+
import MagicString from "magic-string";
|
|
42
|
+
import { basename, dirname, relative, resolve } from "pathe";
|
|
43
|
+
function formatPathForLog(cwd, filePath) {
|
|
44
|
+
const relativePath = relative(cwd, filePath).replace(/\\/g, "/");
|
|
45
|
+
return relativePath && !relativePath.startsWith("..") ? relativePath : filePath;
|
|
46
|
+
}
|
|
47
|
+
async function loadConfigFromPath(configPath) {
|
|
48
|
+
return {
|
|
49
|
+
configPath,
|
|
50
|
+
config: await loadConfig({
|
|
51
|
+
cwd: dirname(configPath),
|
|
52
|
+
configFile: basename(configPath)
|
|
53
|
+
})
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
async function loadDiscoveredConfigs(cwd, explicitConfigPath) {
|
|
57
|
+
const candidatePaths = new Set;
|
|
58
|
+
const discoveredPaths = await findConfigPathsUnderDirectory(cwd);
|
|
59
|
+
for (const configPath of discoveredPaths) {
|
|
60
|
+
candidatePaths.add(configPath);
|
|
61
|
+
}
|
|
62
|
+
if (explicitConfigPath) {
|
|
63
|
+
candidatePaths.add(explicitConfigPath);
|
|
64
|
+
}
|
|
65
|
+
const loadedConfigs = [];
|
|
66
|
+
for (const configPath of [...candidatePaths].sort((left, right) => left.localeCompare(right))) {
|
|
67
|
+
try {
|
|
68
|
+
loadedConfigs.push(await loadConfigFromPath(configPath));
|
|
69
|
+
} catch (error) {
|
|
70
|
+
if (explicitConfigPath && explicitConfigPath === configPath) {
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return loadedConfigs;
|
|
76
|
+
}
|
|
77
|
+
function formatConfigChoices(matches, cwd) {
|
|
78
|
+
return matches.map((match) => ` - ${formatPathForLog(cwd, match.configPath)} (${match.config.name})`).join(`
|
|
79
|
+
`);
|
|
80
|
+
}
|
|
81
|
+
function selectTargetConfig(loadedConfigs, cwd, oldName, newName, explicitConfigPath) {
|
|
82
|
+
if (loadedConfigs.length === 0) {
|
|
83
|
+
throw new Error(`Could not find ${formatSupportedConfigFilenames()} under ${cwd}.`);
|
|
84
|
+
}
|
|
85
|
+
if (explicitConfigPath) {
|
|
86
|
+
const target = loadedConfigs.find((candidate) => candidate.configPath === explicitConfigPath);
|
|
87
|
+
if (!target) {
|
|
88
|
+
throw new Error(`Could not load the selected config: ${explicitConfigPath}`);
|
|
89
|
+
}
|
|
90
|
+
if (target.config.name === oldName) {
|
|
91
|
+
return {
|
|
92
|
+
target,
|
|
93
|
+
localConfigAlreadyUpdated: false,
|
|
94
|
+
allConfigs: loadedConfigs
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
if (target.config.name === newName) {
|
|
98
|
+
return {
|
|
99
|
+
target,
|
|
100
|
+
localConfigAlreadyUpdated: true,
|
|
101
|
+
allConfigs: loadedConfigs
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
throw new Error(`The selected config uses \`${target.config.name}\`, not \`${oldName}\` or \`${newName}\`.`);
|
|
105
|
+
}
|
|
106
|
+
const matchingConfigs = loadedConfigs.filter((candidate) => {
|
|
107
|
+
return candidate.config.name === oldName || candidate.config.name === newName;
|
|
108
|
+
});
|
|
109
|
+
const oldMatches = matchingConfigs.filter((candidate) => candidate.config.name === oldName);
|
|
110
|
+
const newMatches = matchingConfigs.filter((candidate) => candidate.config.name === newName);
|
|
111
|
+
if (oldMatches.length === 1 && matchingConfigs.length === 1) {
|
|
112
|
+
return {
|
|
113
|
+
target: oldMatches[0],
|
|
114
|
+
localConfigAlreadyUpdated: false,
|
|
115
|
+
allConfigs: loadedConfigs
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
if (newMatches.length === 1 && matchingConfigs.length === 1) {
|
|
119
|
+
return {
|
|
120
|
+
target: newMatches[0],
|
|
121
|
+
localConfigAlreadyUpdated: true,
|
|
122
|
+
allConfigs: loadedConfigs
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
if (matchingConfigs.length === 0) {
|
|
126
|
+
throw new Error(`Could not find a matching devflare config under ${cwd}. Expected a config whose \`name\` is \`${oldName}\` or \`${newName}\`.`);
|
|
127
|
+
}
|
|
128
|
+
throw new Error(`Multiple matching devflare configs were found. Use --config to pick one explicitly.
|
|
129
|
+
${formatConfigChoices(matchingConfigs, cwd)}`);
|
|
130
|
+
}
|
|
131
|
+
async function resolveAccountId(parsed, config) {
|
|
132
|
+
return resolveCloudflareAccountId({
|
|
133
|
+
explicitAccountId: asOptionalString(parsed.options.account),
|
|
134
|
+
configuredAccountId: config.accountId
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function skipWhitespaceAndComments(source, start, end) {
|
|
138
|
+
let index = start;
|
|
139
|
+
while (index < end) {
|
|
140
|
+
const char = source[index];
|
|
141
|
+
if (/\s/.test(char)) {
|
|
142
|
+
index++;
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
const nextIndex = consumeComment(source, index, end);
|
|
146
|
+
if (nextIndex !== null) {
|
|
147
|
+
index = nextIndex;
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
return index;
|
|
153
|
+
}
|
|
154
|
+
function consumeQuotedLiteral(source, start, end) {
|
|
155
|
+
const quote = source[start];
|
|
156
|
+
let index = start + 1;
|
|
157
|
+
while (index < end) {
|
|
158
|
+
const char = source[index];
|
|
159
|
+
if (char === "\\") {
|
|
160
|
+
index += 2;
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
if (char === quote) {
|
|
164
|
+
return index + 1;
|
|
165
|
+
}
|
|
166
|
+
index++;
|
|
167
|
+
}
|
|
168
|
+
throw new Error("Unterminated string literal in devflare config.");
|
|
169
|
+
}
|
|
170
|
+
function consumeComment(source, start, end) {
|
|
171
|
+
if (source[start] !== "/") {
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
if (source[start + 1] === "/") {
|
|
175
|
+
let index = start + 2;
|
|
176
|
+
while (index < end && source[index] !== `
|
|
177
|
+
`) {
|
|
178
|
+
index++;
|
|
179
|
+
}
|
|
180
|
+
return index;
|
|
181
|
+
}
|
|
182
|
+
if (source[start + 1] === "*") {
|
|
183
|
+
let index = start + 2;
|
|
184
|
+
while (index < end && !(source[index] === "*" && source[index + 1] === "/")) {
|
|
185
|
+
index++;
|
|
186
|
+
}
|
|
187
|
+
return Math.min(index + 2, end);
|
|
188
|
+
}
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
function findConfigObjectStart(source) {
|
|
192
|
+
const defineConfigIndex = source.indexOf("defineConfig");
|
|
193
|
+
if (defineConfigIndex >= 0) {
|
|
194
|
+
const parenIndex = source.indexOf("(", defineConfigIndex);
|
|
195
|
+
if (parenIndex >= 0) {
|
|
196
|
+
const objectIndex = source.indexOf("{", parenIndex);
|
|
197
|
+
if (objectIndex >= 0) {
|
|
198
|
+
return objectIndex;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
const exportDefaultIndex = source.indexOf("export default");
|
|
203
|
+
if (exportDefaultIndex >= 0) {
|
|
204
|
+
const objectIndex = source.indexOf("{", exportDefaultIndex);
|
|
205
|
+
if (objectIndex >= 0) {
|
|
206
|
+
return objectIndex;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return -1;
|
|
210
|
+
}
|
|
211
|
+
function getRootPropertySlices(source, objectStart) {
|
|
212
|
+
const slices = [];
|
|
213
|
+
let curlyDepth = 1;
|
|
214
|
+
let squareDepth = 0;
|
|
215
|
+
let parenDepth = 0;
|
|
216
|
+
let propertyStart = objectStart + 1;
|
|
217
|
+
let index = objectStart + 1;
|
|
218
|
+
while (index < source.length) {
|
|
219
|
+
const char = source[index];
|
|
220
|
+
if (char === "'" || char === '"' || char === "`") {
|
|
221
|
+
index = consumeQuotedLiteral(source, index, source.length);
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
const nextIndex = consumeComment(source, index, source.length);
|
|
225
|
+
if (nextIndex !== null) {
|
|
226
|
+
index = nextIndex;
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
if (char === "{") {
|
|
230
|
+
curlyDepth++;
|
|
231
|
+
index++;
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
if (char === "}") {
|
|
235
|
+
curlyDepth--;
|
|
236
|
+
if (curlyDepth === 0) {
|
|
237
|
+
slices.push({ start: propertyStart, end: index });
|
|
238
|
+
return slices;
|
|
239
|
+
}
|
|
240
|
+
index++;
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
if (char === "[") {
|
|
244
|
+
squareDepth++;
|
|
245
|
+
index++;
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
if (char === "]") {
|
|
249
|
+
squareDepth--;
|
|
250
|
+
index++;
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
if (char === "(") {
|
|
254
|
+
parenDepth++;
|
|
255
|
+
index++;
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
if (char === ")") {
|
|
259
|
+
parenDepth--;
|
|
260
|
+
index++;
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
if (char === "," && curlyDepth === 1 && squareDepth === 0 && parenDepth === 0) {
|
|
264
|
+
slices.push({ start: propertyStart, end: index });
|
|
265
|
+
propertyStart = index + 1;
|
|
266
|
+
}
|
|
267
|
+
index++;
|
|
268
|
+
}
|
|
269
|
+
throw new Error("Could not parse the root object in devflare config.");
|
|
270
|
+
}
|
|
271
|
+
function findTopLevelColon(source, start, end) {
|
|
272
|
+
let curlyDepth = 0;
|
|
273
|
+
let squareDepth = 0;
|
|
274
|
+
let parenDepth = 0;
|
|
275
|
+
let index = start;
|
|
276
|
+
while (index < end) {
|
|
277
|
+
const char = source[index];
|
|
278
|
+
if (char === "'" || char === '"' || char === "`") {
|
|
279
|
+
index = consumeQuotedLiteral(source, index, end);
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
const nextIndex = consumeComment(source, index, end);
|
|
283
|
+
if (nextIndex !== null) {
|
|
284
|
+
index = nextIndex;
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
if (char === "{") {
|
|
288
|
+
curlyDepth++;
|
|
289
|
+
index++;
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
if (char === "}") {
|
|
293
|
+
curlyDepth--;
|
|
294
|
+
index++;
|
|
295
|
+
continue;
|
|
296
|
+
}
|
|
297
|
+
if (char === "[") {
|
|
298
|
+
squareDepth++;
|
|
299
|
+
index++;
|
|
300
|
+
continue;
|
|
301
|
+
}
|
|
302
|
+
if (char === "]") {
|
|
303
|
+
squareDepth--;
|
|
304
|
+
index++;
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
if (char === "(") {
|
|
308
|
+
parenDepth++;
|
|
309
|
+
index++;
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
if (char === ")") {
|
|
313
|
+
parenDepth--;
|
|
314
|
+
index++;
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
if (char === ":" && curlyDepth === 0 && squareDepth === 0 && parenDepth === 0) {
|
|
318
|
+
return index;
|
|
319
|
+
}
|
|
320
|
+
index++;
|
|
321
|
+
}
|
|
322
|
+
return -1;
|
|
323
|
+
}
|
|
324
|
+
function normalizePropertyKey(rawKey) {
|
|
325
|
+
const trimmed = rawKey.trim();
|
|
326
|
+
if (trimmed.startsWith("'") && trimmed.endsWith("'") || trimmed.startsWith('"') && trimmed.endsWith('"')) {
|
|
327
|
+
return trimmed.slice(1, -1);
|
|
328
|
+
}
|
|
329
|
+
return trimmed;
|
|
330
|
+
}
|
|
331
|
+
function findRootNameLiteralRange(source) {
|
|
332
|
+
const objectStart = findConfigObjectStart(source);
|
|
333
|
+
if (objectStart < 0) {
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
for (const slice of getRootPropertySlices(source, objectStart)) {
|
|
337
|
+
const keyStart = skipWhitespaceAndComments(source, slice.start, slice.end);
|
|
338
|
+
const colonIndex = findTopLevelColon(source, keyStart, slice.end);
|
|
339
|
+
if (colonIndex < 0) {
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
const key = normalizePropertyKey(source.slice(keyStart, colonIndex));
|
|
343
|
+
if (key !== "name") {
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
const valueStart = skipWhitespaceAndComments(source, colonIndex + 1, slice.end);
|
|
347
|
+
const quote = source[valueStart];
|
|
348
|
+
if (quote !== "'" && quote !== '"') {
|
|
349
|
+
throw new Error("The top-level `name` property must be a string literal to be updated automatically.");
|
|
350
|
+
}
|
|
351
|
+
return {
|
|
352
|
+
start: valueStart,
|
|
353
|
+
end: consumeQuotedLiteral(source, valueStart, slice.end),
|
|
354
|
+
quote
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
return null;
|
|
358
|
+
}
|
|
359
|
+
function quoteWorkerName(value, quote) {
|
|
360
|
+
const escapedValue = value.replace(/\\/g, "\\\\").replace(new RegExp(`\\${quote}`, "g"), `\\${quote}`);
|
|
361
|
+
return `${quote}${escapedValue}${quote}`;
|
|
362
|
+
}
|
|
363
|
+
async function updateConfigName(configPath, newName) {
|
|
364
|
+
const fs = await import("node:fs/promises");
|
|
365
|
+
const source = await fs.readFile(configPath, "utf-8");
|
|
366
|
+
const literalRange = findRootNameLiteralRange(source);
|
|
367
|
+
if (!literalRange) {
|
|
368
|
+
throw new Error("Could not locate a top-level string literal `name` property in the selected devflare config.");
|
|
369
|
+
}
|
|
370
|
+
const magicString = new MagicString(source);
|
|
371
|
+
magicString.overwrite(literalRange.start, literalRange.end, quoteWorkerName(newName, literalRange.quote));
|
|
372
|
+
await fs.writeFile(configPath, magicString.toString(), "utf-8");
|
|
373
|
+
}
|
|
374
|
+
function collectReferenceHitsFromConfig(configPath, configLike, oldName, scope) {
|
|
375
|
+
if (!configLike?.bindings) {
|
|
376
|
+
return [];
|
|
377
|
+
}
|
|
378
|
+
const hits = [];
|
|
379
|
+
for (const [bindingName, bindingConfig] of Object.entries(configLike.bindings.services ?? {})) {
|
|
380
|
+
if (bindingConfig.service === oldName) {
|
|
381
|
+
hits.push({
|
|
382
|
+
configPath,
|
|
383
|
+
scope,
|
|
384
|
+
kind: "service",
|
|
385
|
+
bindingName
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
for (const [bindingName, bindingConfig] of Object.entries(configLike.bindings.durableObjects ?? {})) {
|
|
390
|
+
const normalized = normalizeDOBinding(bindingConfig);
|
|
391
|
+
if (normalized.scriptName === oldName) {
|
|
392
|
+
hits.push({
|
|
393
|
+
configPath,
|
|
394
|
+
scope,
|
|
395
|
+
kind: "durable-object",
|
|
396
|
+
bindingName
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
return hits;
|
|
401
|
+
}
|
|
402
|
+
function collectReferenceHits(loadedConfigs, oldName) {
|
|
403
|
+
const hits = [];
|
|
404
|
+
for (const record of loadedConfigs) {
|
|
405
|
+
hits.push(...collectReferenceHitsFromConfig(record.configPath, record.config, oldName, "root"));
|
|
406
|
+
for (const [envName, envConfig] of Object.entries(record.config.env ?? {})) {
|
|
407
|
+
hits.push(...collectReferenceHitsFromConfig(record.configPath, envConfig, oldName, `env.${envName}`));
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
return hits;
|
|
411
|
+
}
|
|
412
|
+
async function runWorkerCommand(parsed, logger, options) {
|
|
413
|
+
const cwd = options.cwd ?? process.cwd();
|
|
414
|
+
const theme = createCliTheme(parsed.options);
|
|
415
|
+
const subcommand = parsed.args[0];
|
|
416
|
+
const oldName = parsed.args[1]?.trim();
|
|
417
|
+
const newName = asOptionalString(parsed.options.to);
|
|
418
|
+
const explicitConfigPath = asOptionalString(parsed.options.config);
|
|
419
|
+
if (subcommand !== "rename") {
|
|
420
|
+
logger.error(`Unknown worker subcommand: ${subcommand ?? "<none>"}`);
|
|
421
|
+
logLine(logger, dim("Usage: devflare worker rename <old-name> --to <new-name> [--config <path>]", theme));
|
|
422
|
+
return { exitCode: 1 };
|
|
423
|
+
}
|
|
424
|
+
if (!oldName) {
|
|
425
|
+
logger.error("A current Worker name is required.");
|
|
426
|
+
logLine(logger, dim("Usage: devflare worker rename <old-name> --to <new-name> [--config <path>]", theme));
|
|
427
|
+
return { exitCode: 1 };
|
|
428
|
+
}
|
|
429
|
+
if (!newName) {
|
|
430
|
+
logger.error("The new Worker name must be provided with --to.");
|
|
431
|
+
return { exitCode: 1 };
|
|
432
|
+
}
|
|
433
|
+
if (oldName === newName) {
|
|
434
|
+
logger.error("The new Worker name must be different from the current name.");
|
|
435
|
+
return { exitCode: 1 };
|
|
436
|
+
}
|
|
437
|
+
logLine(logger);
|
|
438
|
+
logLine(logger, `${yellow("worker", theme)} ${dim("Renaming Worker identity", theme)}`);
|
|
439
|
+
logLine(logger, `${dim("from", theme)} ${whiteDim(oldName, theme)}`);
|
|
440
|
+
logLine(logger, `${dim("to", theme)} ${green(newName, theme)}`);
|
|
441
|
+
if (!await account.isAuthenticated()) {
|
|
442
|
+
logger.error("Not authenticated with Cloudflare");
|
|
443
|
+
logLine(logger, dim("Run `devflare login` first.", theme));
|
|
444
|
+
return { exitCode: 1 };
|
|
445
|
+
}
|
|
446
|
+
let remoteRenamed = false;
|
|
447
|
+
try {
|
|
448
|
+
const explicitResolvedConfigPath = explicitConfigPath ? await resolveConfigCandidatePath(resolve(cwd, explicitConfigPath)) : null;
|
|
449
|
+
if (explicitConfigPath && !explicitResolvedConfigPath) {
|
|
450
|
+
throw new Error(`${formatSupportedConfigFilenames()} not found for --config ${explicitConfigPath}.`);
|
|
451
|
+
}
|
|
452
|
+
const selection = selectTargetConfig(await loadDiscoveredConfigs(cwd, explicitResolvedConfigPath ?? undefined), cwd, oldName, newName, explicitResolvedConfigPath ?? undefined);
|
|
453
|
+
const { target, localConfigAlreadyUpdated, allConfigs } = selection;
|
|
454
|
+
const accountId = await resolveAccountId(parsed, target.config);
|
|
455
|
+
if (!accountId) {
|
|
456
|
+
logger.error("No Cloudflare account could be resolved for this config.");
|
|
457
|
+
logLine(logger, dim("Set accountId in devflare.config.ts, pass --account, or configure a default account.", theme));
|
|
458
|
+
return { exitCode: 1 };
|
|
459
|
+
}
|
|
460
|
+
logLine(logger, `${dim("config", theme)} ${whiteDim(formatPathForLog(cwd, target.configPath), theme)}`);
|
|
461
|
+
logLine(logger, `${dim("account", theme)} ${whiteDim(accountId, theme)}`);
|
|
462
|
+
logLine(logger);
|
|
463
|
+
const workers = await account.workers(accountId);
|
|
464
|
+
const hasOldWorker = workers.some((worker) => worker.name === oldName);
|
|
465
|
+
const hasNewWorker = workers.some((worker) => worker.name === newName);
|
|
466
|
+
if (hasOldWorker && hasNewWorker) {
|
|
467
|
+
logger.error(`Both \`${oldName}\` and \`${newName}\` already exist in Cloudflare.`);
|
|
468
|
+
logLine(logger, dim("Refusing to rename because the target Worker name is already taken.", theme));
|
|
469
|
+
return { exitCode: 1 };
|
|
470
|
+
}
|
|
471
|
+
if (!hasOldWorker && !hasNewWorker) {
|
|
472
|
+
logger.error(`Neither \`${oldName}\` nor \`${newName}\` exists in Cloudflare for account ${accountId}.`);
|
|
473
|
+
return { exitCode: 1 };
|
|
474
|
+
}
|
|
475
|
+
if (hasOldWorker && !hasNewWorker) {
|
|
476
|
+
await account.renameWorker(accountId, oldName, newName);
|
|
477
|
+
remoteRenamed = true;
|
|
478
|
+
logger.success(`Renamed remote Worker ${oldName} → ${newName}`);
|
|
479
|
+
} else {
|
|
480
|
+
logLine(logger, `${dim("remote", theme)} ${green(newName, theme)} ${dim("is already the active Worker name in Cloudflare", theme)}`);
|
|
481
|
+
}
|
|
482
|
+
if (!localConfigAlreadyUpdated) {
|
|
483
|
+
await updateConfigName(target.configPath, newName);
|
|
484
|
+
logger.success(`Updated ${formatPathForLog(cwd, target.configPath)}`);
|
|
485
|
+
} else {
|
|
486
|
+
logLine(logger, `${dim("config", theme)} ${green("already updated locally", theme)}`);
|
|
487
|
+
}
|
|
488
|
+
const referenceHits = collectReferenceHits(allConfigs, oldName);
|
|
489
|
+
if (referenceHits.length > 0) {
|
|
490
|
+
logger.warn(`Found ${referenceHits.length} local reference(s) that still use \`${oldName}\`.`);
|
|
491
|
+
for (const hit of referenceHits) {
|
|
492
|
+
logLine(logger, ` ${formatPathForLog(cwd, hit.configPath)} ${dim(`(${hit.scope})`, theme)} ${dim("—", theme)} ${hit.kind === "service" ? "service binding" : "durable object binding"} ${bold(hit.bindingName, theme)}`);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
logLine(logger);
|
|
496
|
+
logLine(logger, `${yellow("preview urls", theme)} ${dim("Existing preview URLs and registry entries may continue using the old Worker name until you upload fresh previews for the renamed Worker.", theme)}`);
|
|
497
|
+
logLine(logger, dim("Future deploys and preview uploads from this config will target the new Worker name.", theme));
|
|
498
|
+
return { exitCode: 0 };
|
|
499
|
+
} catch (error) {
|
|
500
|
+
if (remoteRenamed) {
|
|
501
|
+
logger.warn("The remote Worker rename succeeded, but the local config update did not complete.");
|
|
502
|
+
logLine(logger, dim("Update devflare.config.ts manually so future deploys target the renamed Worker.", theme));
|
|
503
|
+
}
|
|
504
|
+
if (error instanceof Error) {
|
|
505
|
+
logger.error(error.message);
|
|
506
|
+
return { exitCode: 1 };
|
|
507
|
+
}
|
|
508
|
+
throw error;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
export {
|
|
512
|
+
runWorkerCommand
|
|
513
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DevflareConfig } from '../config';
|
|
2
|
+
export interface PrepareComposedWorkerEntrypointOptions {
|
|
3
|
+
devInternalEmail?: boolean;
|
|
4
|
+
includeDevOnlyHooks?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function prepareComposedWorkerEntrypoint(cwd: string, config: DevflareConfig, environment?: string, options?: PrepareComposedWorkerEntrypointOptions): Promise<string | null>;
|
|
7
|
+
//# sourceMappingURL=composed-worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composed-worker.d.ts","sourceRoot":"","sources":["../../src/worker-entry/composed-worker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AA0B/C,MAAM,WAAW,sCAAsC;IACtD,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAmdD,wBAAsB,+BAA+B,CACpD,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,cAAc,EACtB,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,GAAE,sCAA2C,GAClD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiExB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface DODiscoveryResult {
|
|
2
|
+
/** Map of file path → array of DO class names found in that file */
|
|
3
|
+
files: Map<string, string[]>;
|
|
4
|
+
/** Worker name for the auxiliary DO worker */
|
|
5
|
+
workerName: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Walk the glob `pattern` under `cwd` and return a map of file path →
|
|
9
|
+
* Durable Object class names declared in that file. Files that fail to read
|
|
10
|
+
* or contain no DO classes are omitted. Respects `.gitignore` automatically
|
|
11
|
+
* (via `findFiles`).
|
|
12
|
+
*/
|
|
13
|
+
export declare function discoverDurableObjectFiles(cwd: string, pattern: string): Promise<Map<string, string[]>>;
|
|
14
|
+
/**
|
|
15
|
+
* Vite-plugin-shaped wrapper around `discoverDurableObjectFiles`. Returns a
|
|
16
|
+
* `DODiscoveryResult` carrying the discovered file map plus the auxiliary
|
|
17
|
+
* worker name.
|
|
18
|
+
*/
|
|
19
|
+
export declare function discoverDurableObjects(projectRoot: string, pattern: string, workerName: string): Promise<DODiscoveryResult>;
|
|
20
|
+
//# sourceMappingURL=durable-object-discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"durable-object-discovery.d.ts","sourceRoot":"","sources":["../../src/worker-entry/durable-object-discovery.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,iBAAiB;IACjC,oEAAoE;IACpE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAC5B,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAA;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAC/C,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GACb,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAkBhC;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC3C,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GAChB,OAAO,CAAC,iBAAiB,CAAC,CAG5B"}
|