devflare 1.0.0-next.5 → 1.0.0-next.51
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/LICENSE +21 -0
- package/LLM.md +17312 -2139
- package/README.md +397 -605
- package/bin/devflare.js +30 -14
- package/dist/_chunks/account-Csog80ie.js +462 -0
- package/dist/_chunks/account-resources-CsmVowJp.js +159 -0
- package/dist/_chunks/ai-CBEuLdoP.js +322 -0
- package/dist/_chunks/api-TzdliH-6.js +568 -0
- package/dist/_chunks/build-Ccza8VQz.js +24 -0
- package/dist/_chunks/build-artifacts-BNssqhxE.js +483 -0
- package/dist/_chunks/cli-CU7wSG1-.js +1163 -0
- package/dist/_chunks/cloudflare-BaloqI3H.js +157 -0
- package/dist/_chunks/colors-DiK6wPJ5.js +13 -0
- package/dist/_chunks/command-utils-_bGRraDR.js +45 -0
- package/dist/_chunks/compiler-BtLp9T9N.js +500 -0
- package/dist/_chunks/config-QU8UEWmA.js +78 -0
- package/dist/_chunks/config-path-1yI7BiDU.js +42 -0
- package/dist/_chunks/context-CX50Y2Kb.js +2250 -0
- package/dist/_chunks/decorators-QmV57ixr.js +19 -0
- package/dist/_chunks/dependencies-C2oxFjU_.js +57 -0
- package/dist/_chunks/deploy-aifBaMVv.js +1032 -0
- package/dist/_chunks/dev-DF_3baGr.js +3483 -0
- package/dist/_chunks/doctor-tR9kGT_Z.js +219 -0
- package/dist/_chunks/durable-object-DMtH0XYX.js +234 -0
- package/dist/_chunks/env-S0_nMVz1.js +125 -0
- package/dist/_chunks/family-DKPp4wqj.js +143 -0
- package/dist/_chunks/generated-artifacts-dMJY4KAt.js +32 -0
- package/dist/_chunks/glob-CmQOvunB.js +56 -0
- package/dist/_chunks/init-DnkJOmpW.js +165 -0
- package/dist/_chunks/loader-OQ2AWpqm.js +1308 -0
- package/dist/_chunks/local-dev-vars-CTSa-wvF.js +81 -0
- package/dist/_chunks/local-hyperdrive-CJ90j46O.js +119 -0
- package/dist/_chunks/local-media-bindings-DsAW4AMF.js +335 -0
- package/dist/_chunks/local-secrets-CYoHfvQ1.js +123 -0
- package/dist/_chunks/local-workflow-entrypoints-8d_mXh8T.js +90 -0
- package/dist/_chunks/login-rVWUZOKC.js +51 -0
- package/dist/_chunks/package-metadata-DjHBLB-z.js +39 -0
- package/dist/_chunks/preferences-BKp_7XJx.js +241 -0
- package/dist/_chunks/preview-C3Cdr8an.js +462 -0
- package/dist/_chunks/preview-registry-ClAbLTHH.js +1186 -0
- package/dist/_chunks/preview-resources-DRWR0gaB.js +359 -0
- package/dist/_chunks/previews-BxNq8Y_J.js +1134 -0
- package/dist/_chunks/productions-DK7xwbEs.js +411 -0
- package/dist/_chunks/ref-CYJNAAe_.js +178 -0
- package/dist/_chunks/remote-CZnP-HLJ.js +79 -0
- package/dist/_chunks/remote-config-D39BY9ji.js +132 -0
- package/dist/_chunks/resolve-package-qizBfCIm.js +152 -0
- package/dist/_chunks/rolldown-runtime-CvQ6eiug.js +14 -0
- package/dist/_chunks/routes-B6XiI8Sa.js +851 -0
- package/dist/_chunks/runtime-DL-Nz3k8.js +550 -0
- package/dist/_chunks/schema-normalization-GjhTATHL.js +666 -0
- package/dist/_chunks/secrets-qT1JaBGt.js +95 -0
- package/dist/_chunks/tail-CuWI04BL.js +239 -0
- package/dist/_chunks/token-Dmi0KXyX.js +333 -0
- package/dist/_chunks/tokens-iVcgNXi-.js +221 -0
- package/dist/_chunks/types-BquPXsFg.js +484 -0
- package/dist/_chunks/ui-BUoZApvE.js +103 -0
- package/dist/_chunks/usage-BBTGzjon.js +272 -0
- package/dist/_chunks/vite-D_wLDGBs.js +1267 -0
- package/dist/_chunks/vite-utils-OVLMV605.js +183 -0
- package/dist/_chunks/worker-DEF-e8LL.js +410 -0
- package/dist/_chunks/worker-bundler-dTTnYU3n.js +458 -0
- package/dist/_chunks/worker-entrypoint-CQW77lG8.js +247 -0
- package/dist/_chunks/workerName-CFJsLZA-.js +23 -0
- package/dist/bridge/client.d.ts +49 -7
- 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 +6 -6
- 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 +85 -2
- package/dist/bridge/miniflare.d.ts.map +1 -1
- package/dist/bridge/proxy.d.ts +12 -11
- 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 +46 -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} +32 -8
- 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 +2 -2
- package/dist/browser-shim/handler.d.ts.map +1 -1
- package/dist/browser-shim/index.d.ts +2 -2
- package/dist/browser-shim/server.d.ts +63 -0
- package/dist/browser-shim/server.d.ts.map +1 -1
- package/dist/browser.d.ts +5705 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +80 -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 +3 -1
- 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 +2 -2
- package/dist/cli/commands/account.d.ts.map +1 -1
- package/dist/cli/commands/ai.d.ts +1 -1
- package/dist/cli/commands/ai.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 +2 -2
- 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 +9 -1
- package/dist/cli/commands/dev.d.ts.map +1 -1
- package/dist/cli/commands/doctor.d.ts +2 -2
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/init.d.ts +2 -2
- 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/remote.d.ts +1 -1
- package/dist/cli/commands/remote.d.ts.map +1 -1
- package/dist/cli/commands/secrets.d.ts +4 -0
- package/dist/cli/commands/secrets.d.ts.map +1 -0
- package/dist/cli/commands/tail.d.ts +44 -0
- package/dist/cli/commands/tail.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 +121 -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 +2 -2
- 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 +2 -1
- 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/gradual-deploy.d.ts +49 -0
- package/dist/cli/gradual-deploy.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 +2 -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/cli/wrangler-auth.d.ts +1 -1
- 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 +1 -1
- package/dist/cloudflare/auth.d.ts.map +1 -1
- package/dist/cloudflare/index.d.ts +61 -6
- package/dist/cloudflare/index.d.ts.map +1 -1
- package/dist/cloudflare/index.js +4 -13
- 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/remote-config.d.ts.map +1 -1
- 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 +31 -3
- 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 +309 -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/cron.d.ts +19 -0
- package/dist/config/cron.d.ts.map +1 -0
- package/dist/config/define.d.ts +8 -5
- 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 +2 -1
- 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 +29 -0
- package/dist/config/preview.d.ts.map +1 -0
- package/dist/config/ref.d.ts +16 -25
- 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 +2087 -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 +3771 -0
- package/dist/config/schema-env.d.ts.map +1 -0
- package/dist/config/schema-normalization.d.ts +267 -0
- package/dist/config/schema-normalization.d.ts.map +1 -0
- package/dist/config/schema-runtime.d.ts +557 -0
- package/dist/config/schema-runtime.d.ts.map +1 -0
- package/dist/config/schema-types-bindings-platform.d.ts +520 -0
- package/dist/config/schema-types-bindings-platform.d.ts.map +1 -0
- package/dist/config/schema-types-bindings-resources.d.ts +802 -0
- package/dist/config/schema-types-bindings-resources.d.ts.map +1 -0
- package/dist/config/schema-types-bindings.d.ts +293 -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-server.d.ts +122 -0
- package/dist/config/schema-types-runtime-server.d.ts.map +1 -0
- package/dist/config/schema-types-runtime.d.ts +913 -0
- package/dist/config/schema-types-runtime.d.ts.map +1 -0
- package/dist/config/schema-types.d.ts +458 -0
- package/dist/config/schema-types.d.ts.map +1 -0
- package/dist/config/schema.d.ts +5699 -2021
- 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-entry.d.ts +7 -0
- package/dist/config-entry.d.ts.map +1 -0
- package/dist/config-entry.js +3 -0
- package/dist/decorators/durable-object.d.ts.map +1 -1
- package/dist/decorators/index.d.ts +2 -2
- package/dist/decorators/index.js +2 -9
- 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/index.d.ts +1 -1
- package/dist/dev-server/miniflare-bindings.d.ts +90 -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 +93 -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/env.d.ts +10 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/index.d.ts +8 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -298
- 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 +10 -3
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +5 -111
- package/dist/runtime/middleware.d.ts +119 -67
- 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 +18 -4
- 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/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.d.ts +1 -1
- package/dist/sveltekit/index.d.ts.map +1 -1
- package/dist/sveltekit/index.js +313 -167
- 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 +20 -2
- 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/alarm.d.ts +55 -0
- package/dist/test/alarm.d.ts.map +1 -0
- package/dist/test/binding-hints.d.ts +10 -0
- package/dist/test/binding-hints.d.ts.map +1 -0
- package/dist/test/cf.d.ts +71 -35
- 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 +20 -21
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +4981 -70
- package/dist/test/offline-bindings.d.ts +115 -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 +64 -4
- 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 +8 -27
- package/dist/test/simple-context.d.ts.map +1 -1
- package/dist/test/tail.d.ts +3 -2
- package/dist/test/tail.d.ts.map +1 -1
- package/dist/test/utilities/analytics-engine.d.ts +22 -0
- package/dist/test/utilities/analytics-engine.d.ts.map +1 -0
- 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 +43 -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/stream-flagship.d.ts +27 -0
- package/dist/test/utilities/stream-flagship.d.ts.map +1 -0
- package/dist/test/utilities/vectorize.d.ts +38 -0
- package/dist/test/utilities/vectorize.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 +13 -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/transform/durable-object.d.ts.map +1 -1
- package/dist/transform/index.d.ts +2 -2
- package/dist/transform/worker-entrypoint.d.ts +5 -0
- package/dist/transform/worker-entrypoint.d.ts.map +1 -1
- package/dist/utils/entrypoint-discovery.d.ts +6 -3
- package/dist/utils/entrypoint-discovery.d.ts.map +1 -1
- package/dist/utils/glob.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 +163 -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 +3 -2
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +2 -339
- 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-entry/validate-fetch-style.d.ts +12 -0
- package/dist/worker-entry/validate-fetch-style.d.ts.map +1 -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 +159 -116
- package/R2.md +0 -170
- package/dist/account-rvrj687w.js +0 -397
- package/dist/ai-dx4fr9jh.js +0 -107
- 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-b9dmrj7b.js +0 -2417
- package/dist/doctor-fmgb3d28.js +0 -190
- package/dist/durable-object-t4kbb0yt.js +0 -13
- package/dist/index-07q6yxyc.js +0 -168
- package/dist/index-18hvb6gb.js +0 -194
- package/dist/index-1xpj0m4r.js +0 -57
- package/dist/index-37x76zdn.js +0 -4
- package/dist/index-3t6rypgc.js +0 -13
- package/dist/index-67qcae0f.js +0 -183
- package/dist/index-a855bdsx.js +0 -18
- package/dist/index-d8bdkx2h.js +0 -109
- 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-rbht7m9r.js +0 -36
- package/dist/index-tfyxa77h.js +0 -850
- package/dist/index-tk6ej9dj.js +0 -94
- package/dist/index-z14anrqp.js +0 -226
- package/dist/init-f9mgmew3.js +0 -186
- package/dist/remote-q59qk463.js +0 -97
- 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
- package/dist/worker-entrypoint-m9th0rg0.js +0 -13
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { r as loadConfig } from "./loader-OQ2AWpqm.js";
|
|
2
|
+
import { d as green, f as logLine, g as yellow, m as red, n as bold, o as dim, r as createCliTheme } from "./ui-BUoZApvE.js";
|
|
3
|
+
import { n as getPackageVersion } from "./package-metadata-DjHBLB-z.js";
|
|
4
|
+
import { t as detectViteProject } from "./vite-utils-OVLMV605.js";
|
|
5
|
+
import { t as getDependencies } from "./dependencies-C2oxFjU_.js";
|
|
6
|
+
import { n as getGeneratedArtifactPaths } from "./generated-artifacts-dMJY4KAt.js";
|
|
7
|
+
import { n as formatSupportedConfigFilenames, r as resolveConfigCandidatePath } from "./config-path-1yI7BiDU.js";
|
|
8
|
+
import { basename, dirname, relative, resolve } from "pathe";
|
|
9
|
+
//#region src/cli/commands/doctor.ts
|
|
10
|
+
async function runDoctorCommand(parsed, logger, options) {
|
|
11
|
+
const cwd = options.cwd || process.cwd();
|
|
12
|
+
const theme = createCliTheme(parsed.options);
|
|
13
|
+
const requestedConfigOption = parsed.options.config;
|
|
14
|
+
const scope = parsed.options.scope ?? "all";
|
|
15
|
+
if (![
|
|
16
|
+
"all",
|
|
17
|
+
"local",
|
|
18
|
+
"deploy"
|
|
19
|
+
].includes(scope)) {
|
|
20
|
+
logger.error(`Unsupported doctor scope: ${scope}`);
|
|
21
|
+
logger.info("Supported scopes: all, local, deploy");
|
|
22
|
+
return { exitCode: 1 };
|
|
23
|
+
}
|
|
24
|
+
const requestedConfigPath = requestedConfigOption ? resolve(cwd, requestedConfigOption) : cwd;
|
|
25
|
+
const checks = [];
|
|
26
|
+
const { fs } = await getDependencies();
|
|
27
|
+
const viteProject = await detectViteProject(cwd, fs);
|
|
28
|
+
logLine(logger);
|
|
29
|
+
logLine(logger, `${bold("doctor", theme)} ${dim("Running diagnostics", theme)}`);
|
|
30
|
+
logLine(logger);
|
|
31
|
+
const configPath = await resolveConfigCandidatePath(requestedConfigPath);
|
|
32
|
+
if (configPath) {
|
|
33
|
+
checks.push({
|
|
34
|
+
name: "Config File",
|
|
35
|
+
status: "pass",
|
|
36
|
+
message: `Found: ${configPath}`
|
|
37
|
+
});
|
|
38
|
+
try {
|
|
39
|
+
const config = requestedConfigOption ? await loadConfig({
|
|
40
|
+
cwd: dirname(configPath),
|
|
41
|
+
configFile: basename(configPath)
|
|
42
|
+
}) : await loadConfig({ cwd });
|
|
43
|
+
checks.push({
|
|
44
|
+
name: "Config Valid",
|
|
45
|
+
status: "pass",
|
|
46
|
+
message: `Project: ${config.name}`
|
|
47
|
+
});
|
|
48
|
+
} catch (error) {
|
|
49
|
+
checks.push({
|
|
50
|
+
name: "Config Valid",
|
|
51
|
+
status: "fail",
|
|
52
|
+
message: error instanceof Error ? error.message : "Unknown error"
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
} else checks.push({
|
|
56
|
+
name: "Config File",
|
|
57
|
+
status: "fail",
|
|
58
|
+
message: `${formatSupportedConfigFilenames()} not found. Run \`devflare init\` to create one.`
|
|
59
|
+
});
|
|
60
|
+
const packageJsonPath = resolve(cwd, "package.json");
|
|
61
|
+
try {
|
|
62
|
+
await fs.access(packageJsonPath);
|
|
63
|
+
const content = await fs.readFile(packageJsonPath, "utf-8");
|
|
64
|
+
const pkg = JSON.parse(content);
|
|
65
|
+
checks.push({
|
|
66
|
+
name: "package.json",
|
|
67
|
+
status: "pass",
|
|
68
|
+
message: `Found: ${pkg.name || "unnamed"}`
|
|
69
|
+
});
|
|
70
|
+
const deps = {
|
|
71
|
+
...pkg.dependencies,
|
|
72
|
+
...pkg.devDependencies
|
|
73
|
+
};
|
|
74
|
+
if (deps.devflare) {
|
|
75
|
+
const resolvedVersion = await getPackageVersion();
|
|
76
|
+
checks.push({
|
|
77
|
+
name: "devflare dep",
|
|
78
|
+
status: "pass",
|
|
79
|
+
message: `package.json: ${deps.devflare}, resolved: ${resolvedVersion}`
|
|
80
|
+
});
|
|
81
|
+
} else checks.push({
|
|
82
|
+
name: "devflare dep",
|
|
83
|
+
status: "warn",
|
|
84
|
+
message: "devflare not in dependencies"
|
|
85
|
+
});
|
|
86
|
+
} catch {
|
|
87
|
+
checks.push({
|
|
88
|
+
name: "package.json",
|
|
89
|
+
status: "fail",
|
|
90
|
+
message: "package.json not found"
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
if (viteProject.wantsViteIntegration) {
|
|
94
|
+
checks.push({
|
|
95
|
+
name: "Vite Integration",
|
|
96
|
+
status: "pass",
|
|
97
|
+
message: "Enabled for this package"
|
|
98
|
+
});
|
|
99
|
+
if (viteProject.hasLocalViteDependency) checks.push({
|
|
100
|
+
name: "vite dep",
|
|
101
|
+
status: "pass",
|
|
102
|
+
message: "Found in package.json"
|
|
103
|
+
});
|
|
104
|
+
else checks.push({
|
|
105
|
+
name: "vite dep",
|
|
106
|
+
status: "warn",
|
|
107
|
+
message: "Not declared in this package.json (workspace-hoisted installs may still work)"
|
|
108
|
+
});
|
|
109
|
+
if (viteProject.hasLocalCloudflareVitePluginDependency) checks.push({
|
|
110
|
+
name: "@cloudflare/vite-plugin",
|
|
111
|
+
status: "pass",
|
|
112
|
+
message: "Found in package.json"
|
|
113
|
+
});
|
|
114
|
+
else checks.push({
|
|
115
|
+
name: "@cloudflare/vite-plugin",
|
|
116
|
+
status: "pass",
|
|
117
|
+
message: "Optional: not declared in this package.json. Install it only when your Vite config calls the Cloudflare Vite plugin directly."
|
|
118
|
+
});
|
|
119
|
+
if (viteProject.viteConfigPath) checks.push({
|
|
120
|
+
name: "Vite Config",
|
|
121
|
+
status: "pass",
|
|
122
|
+
message: `Found: ${viteProject.viteConfigPath}`
|
|
123
|
+
});
|
|
124
|
+
else checks.push({
|
|
125
|
+
name: "Vite Config",
|
|
126
|
+
status: "warn",
|
|
127
|
+
message: "No vite.config found. Create one with @cloudflare/vite-plugin"
|
|
128
|
+
});
|
|
129
|
+
} else checks.push({
|
|
130
|
+
name: "Vite Integration",
|
|
131
|
+
status: "pass",
|
|
132
|
+
message: "Not enabled for this package (worker-only mode)"
|
|
133
|
+
});
|
|
134
|
+
try {
|
|
135
|
+
await fs.access(resolve(cwd, "tsconfig.json"));
|
|
136
|
+
checks.push({
|
|
137
|
+
name: "tsconfig.json",
|
|
138
|
+
status: "pass",
|
|
139
|
+
message: "Found"
|
|
140
|
+
});
|
|
141
|
+
} catch {
|
|
142
|
+
checks.push({
|
|
143
|
+
name: "tsconfig.json",
|
|
144
|
+
status: "warn",
|
|
145
|
+
message: "tsconfig.json not found"
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
const artifactPaths = getGeneratedArtifactPaths(cwd);
|
|
149
|
+
if (scope === "all" || scope === "local") try {
|
|
150
|
+
await fs.access(artifactPaths.devWranglerConfigPath);
|
|
151
|
+
checks.push({
|
|
152
|
+
name: "Generated dev config",
|
|
153
|
+
status: "pass",
|
|
154
|
+
message: `Found: ${relative(cwd, artifactPaths.devWranglerConfigPath)}`
|
|
155
|
+
});
|
|
156
|
+
} catch {
|
|
157
|
+
checks.push({
|
|
158
|
+
name: "Generated dev config",
|
|
159
|
+
status: "warn",
|
|
160
|
+
message: "Local readiness: not found. Run `devflare dev` or start `devflare/vite` to populate `.devflare/wrangler.jsonc`."
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
if (scope === "all" || scope === "deploy") {
|
|
164
|
+
try {
|
|
165
|
+
await fs.access(artifactPaths.buildWranglerConfigPath);
|
|
166
|
+
checks.push({
|
|
167
|
+
name: "Generated deploy config",
|
|
168
|
+
status: "pass",
|
|
169
|
+
message: `Found: ${relative(cwd, artifactPaths.buildWranglerConfigPath)}`
|
|
170
|
+
});
|
|
171
|
+
} catch {
|
|
172
|
+
checks.push({
|
|
173
|
+
name: "Generated deploy config",
|
|
174
|
+
status: "warn",
|
|
175
|
+
message: "Deploy readiness: not found. Run `devflare build` or `devflare deploy` to generate `.devflare/build/wrangler.jsonc`."
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
try {
|
|
179
|
+
await fs.access(artifactPaths.deployRedirectPath);
|
|
180
|
+
checks.push({
|
|
181
|
+
name: "Wrangler deploy redirect",
|
|
182
|
+
status: "pass",
|
|
183
|
+
message: `Found: ${relative(cwd, artifactPaths.deployRedirectPath)}`
|
|
184
|
+
});
|
|
185
|
+
} catch {
|
|
186
|
+
checks.push({
|
|
187
|
+
name: "Wrangler deploy redirect",
|
|
188
|
+
status: "warn",
|
|
189
|
+
message: "Deploy readiness: not found. Run `devflare build` or `devflare deploy` to generate `.wrangler/deploy/config.json`."
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
let hasFailures = false;
|
|
194
|
+
let hasWarnings = false;
|
|
195
|
+
for (const check of checks) {
|
|
196
|
+
const icon = check.status === "pass" ? "✓" : check.status === "warn" ? "⚠" : "✗";
|
|
197
|
+
if (check.status === "pass") logLine(logger, `${green(icon, theme)} ${bold(check.name, theme)}${dim(" — ", theme)}${check.message}`);
|
|
198
|
+
else if (check.status === "warn") {
|
|
199
|
+
logLine(logger, `${yellow(icon, theme)} ${bold(check.name, theme)}${dim(" — ", theme)}${check.message}`);
|
|
200
|
+
hasWarnings = true;
|
|
201
|
+
} else {
|
|
202
|
+
logLine(logger, `${red(icon, theme)} ${bold(check.name, theme)}${dim(" — ", theme)}${check.message}`);
|
|
203
|
+
hasFailures = true;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
logLine(logger);
|
|
207
|
+
if (hasFailures) {
|
|
208
|
+
logger.error("Some checks failed. Please fix the issues above.");
|
|
209
|
+
return { exitCode: 1 };
|
|
210
|
+
}
|
|
211
|
+
if (hasWarnings) {
|
|
212
|
+
logger.warn("All critical checks passed, but there are warnings.");
|
|
213
|
+
return { exitCode: 0 };
|
|
214
|
+
}
|
|
215
|
+
logger.success("All checks passed!");
|
|
216
|
+
return { exitCode: 0 };
|
|
217
|
+
}
|
|
218
|
+
//#endregion
|
|
219
|
+
export { runDoctorCommand };
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-CvQ6eiug.js";
|
|
2
|
+
import MagicString from "magic-string";
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
//#region src/transform/durable-object.ts
|
|
5
|
+
var durable_object_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
findDurableObjectClasses: () => findDurableObjectClasses,
|
|
7
|
+
findDurableObjectClassesDetailed: () => findDurableObjectClassesDetailed,
|
|
8
|
+
transformDurableObject: () => transformDurableObject
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* Returns the trailing identifier name of an expression used as a class base.
|
|
12
|
+
* Handles `DurableObject`, `Cloudflare.DurableObject`, `DurableObject<Env>`.
|
|
13
|
+
*/
|
|
14
|
+
function getBaseIdentifierName(expr) {
|
|
15
|
+
if (ts.isIdentifier(expr)) return expr.text;
|
|
16
|
+
if (ts.isPropertyAccessExpression(expr)) return expr.name.text;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Returns true when the given heritage clause expression refers to DurableObject.
|
|
20
|
+
*/
|
|
21
|
+
function extendsDurableObject(node) {
|
|
22
|
+
const clauses = node.heritageClauses;
|
|
23
|
+
if (!clauses) return false;
|
|
24
|
+
for (const clause of clauses) {
|
|
25
|
+
if (clause.token !== ts.SyntaxKind.ExtendsKeyword) continue;
|
|
26
|
+
for (const type of clause.types) if (getBaseIdentifierName(type.expression) === "DurableObject") return true;
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Returns the `@durableObject` decorator (if any) on a class declaration,
|
|
32
|
+
* preferring `ts.getDecorators` which understands both legacy and modifier-style decorators.
|
|
33
|
+
*/
|
|
34
|
+
function getDurableObjectDecorator(node) {
|
|
35
|
+
const decorators = ts.canHaveDecorators(node) ? ts.getDecorators(node) : void 0;
|
|
36
|
+
if (!decorators) return void 0;
|
|
37
|
+
for (const decorator of decorators) {
|
|
38
|
+
const expr = decorator.expression;
|
|
39
|
+
if (ts.isCallExpression(expr) && ts.isIdentifier(expr.expression) && expr.expression.text === "durableObject") return decorator;
|
|
40
|
+
if (ts.isIdentifier(expr) && expr.text === "durableObject") return decorator;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Parse the first argument of the `@durableObject(...)` decorator into a plain options object.
|
|
45
|
+
* Only supports the shapes the runtime uses: boolean literals and arrays of string literals.
|
|
46
|
+
*/
|
|
47
|
+
function parseDecoratorOptions(decorator) {
|
|
48
|
+
const expr = decorator.expression;
|
|
49
|
+
if (!ts.isCallExpression(expr)) return void 0;
|
|
50
|
+
const arg = expr.arguments[0];
|
|
51
|
+
if (!arg || !ts.isObjectLiteralExpression(arg)) return void 0;
|
|
52
|
+
const result = {};
|
|
53
|
+
for (const prop of arg.properties) {
|
|
54
|
+
if (!ts.isPropertyAssignment(prop)) continue;
|
|
55
|
+
let key;
|
|
56
|
+
if (ts.isIdentifier(prop.name)) key = prop.name.text;
|
|
57
|
+
else if (ts.isStringLiteral(prop.name)) key = prop.name.text;
|
|
58
|
+
if (!key) continue;
|
|
59
|
+
const value = prop.initializer;
|
|
60
|
+
if (value.kind === ts.SyntaxKind.TrueKeyword) result[key] = true;
|
|
61
|
+
else if (value.kind === ts.SyntaxKind.FalseKeyword) result[key] = false;
|
|
62
|
+
else if (ts.isStringLiteralLike(value)) result[key] = value.text;
|
|
63
|
+
else if (ts.isNumericLiteral(value)) result[key] = Number(value.text);
|
|
64
|
+
else if (ts.isArrayLiteralExpression(value)) {
|
|
65
|
+
const items = [];
|
|
66
|
+
for (const el of value.elements) if (ts.isStringLiteralLike(el)) items.push(el.text);
|
|
67
|
+
result[key] = items;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Walk top-level statements and collect DO class information.
|
|
74
|
+
*/
|
|
75
|
+
function collectDurableObjectClasses(code) {
|
|
76
|
+
const sourceFile = ts.createSourceFile("durable-object.tsx", code, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);
|
|
77
|
+
const classMap = /* @__PURE__ */ new Map();
|
|
78
|
+
const inspect = (node) => {
|
|
79
|
+
if (!node.name) return;
|
|
80
|
+
if (!((ts.canHaveModifiers(node) ? ts.getModifiers(node) : void 0)?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword) ?? false)) return;
|
|
81
|
+
const name = node.name.text;
|
|
82
|
+
const extendsBase = extendsDurableObject(node);
|
|
83
|
+
const decorator = getDurableObjectDecorator(node);
|
|
84
|
+
const hasDecorator = decorator !== void 0;
|
|
85
|
+
if (!extendsBase && !hasDecorator) return;
|
|
86
|
+
const info = classMap.get(name) ?? {
|
|
87
|
+
name,
|
|
88
|
+
extendsBase: false,
|
|
89
|
+
hasDecorator: false
|
|
90
|
+
};
|
|
91
|
+
if (extendsBase) info.extendsBase = true;
|
|
92
|
+
if (hasDecorator) {
|
|
93
|
+
info.hasDecorator = true;
|
|
94
|
+
const options = parseDecoratorOptions(decorator);
|
|
95
|
+
if (options) info.decoratorOptions = options;
|
|
96
|
+
}
|
|
97
|
+
classMap.set(name, info);
|
|
98
|
+
};
|
|
99
|
+
for (const statement of sourceFile.statements) if (ts.isClassDeclaration(statement)) inspect(statement);
|
|
100
|
+
return Array.from(classMap.values());
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Finds all class names that extend DurableObject or have @durableObject decorator
|
|
104
|
+
*/
|
|
105
|
+
function findDurableObjectClasses(code) {
|
|
106
|
+
return collectDurableObjectClasses(code).map((info) => info.name);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Finds detailed info about all Durable Object classes
|
|
110
|
+
*/
|
|
111
|
+
function findDurableObjectClassesDetailed(code) {
|
|
112
|
+
return collectDurableObjectClasses(code);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Transforms a source file to wrap Durable Object classes
|
|
116
|
+
*
|
|
117
|
+
* @param code - Source code to transform
|
|
118
|
+
* @param id - File path/id for source mapping
|
|
119
|
+
* @returns Transformed code with source map, or null if no transforms needed
|
|
120
|
+
*/
|
|
121
|
+
async function transformDurableObject(code, id) {
|
|
122
|
+
const doClasses = findDurableObjectClassesDetailed(code);
|
|
123
|
+
if (doClasses.length === 0) return null;
|
|
124
|
+
const s = new MagicString(code);
|
|
125
|
+
for (const classInfo of doClasses) {
|
|
126
|
+
const className = classInfo.name;
|
|
127
|
+
if (classInfo.extendsBase) {
|
|
128
|
+
const exportPattern = new RegExp(`export\\s+class\\s+${className}\\s+extends\\s+DurableObject`, "g");
|
|
129
|
+
let match = exportPattern.exec(code);
|
|
130
|
+
while (match !== null) {
|
|
131
|
+
const start = match.index;
|
|
132
|
+
const exportKeywordEnd = start + 7;
|
|
133
|
+
s.overwrite(start, exportKeywordEnd, "");
|
|
134
|
+
const classNameStart = start + match[0].indexOf(className);
|
|
135
|
+
const classNameEnd = classNameStart + className.length;
|
|
136
|
+
s.overwrite(classNameStart, classNameEnd, `__Original${className}`);
|
|
137
|
+
match = exportPattern.exec(code);
|
|
138
|
+
}
|
|
139
|
+
} else if (classInfo.hasDecorator) {
|
|
140
|
+
const decoratorPattern = new RegExp(`@durableObject\\s*\\([^)]*\\)\\s*\\n?\\s*export\\s+class\\s+${className}(?:\\s+extends\\s+(\\w+))?`, "g");
|
|
141
|
+
let match = decoratorPattern.exec(code);
|
|
142
|
+
while (match !== null) {
|
|
143
|
+
const start = match.index;
|
|
144
|
+
const existingBaseClass = match[1];
|
|
145
|
+
const decoratorEnd = code.indexOf(")", start) + 1;
|
|
146
|
+
const exportStart = code.indexOf("export", decoratorEnd);
|
|
147
|
+
const classDefEnd = start + match[0].length;
|
|
148
|
+
s.overwrite(start, exportStart, "");
|
|
149
|
+
const classNameStart = code.indexOf(className, exportStart);
|
|
150
|
+
const classNameEnd = classNameStart + className.length;
|
|
151
|
+
if (existingBaseClass) s.overwrite(classNameStart, classNameEnd, `__Original${className}`);
|
|
152
|
+
else s.overwrite(classNameStart, classDefEnd, `__Original${className} extends DurableObject`);
|
|
153
|
+
match = decoratorPattern.exec(code);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
s.prepend(`\nimport { createDurableObjectAlarmEvent, createDurableObjectFetchEvent, createDurableObjectWebSocketCloseEvent, createDurableObjectWebSocketErrorEvent, createDurableObjectWebSocketMessageEvent, runWithEventContext } from 'devflare/runtime'\n`);
|
|
158
|
+
for (const classInfo of doClasses) {
|
|
159
|
+
const className = classInfo.name;
|
|
160
|
+
const options = classInfo.decoratorOptions || {};
|
|
161
|
+
const wrapper = generateWrapperCodeInternal(className, {
|
|
162
|
+
alarms: options.alarms === true,
|
|
163
|
+
websockets: options.websockets === true
|
|
164
|
+
});
|
|
165
|
+
s.append(wrapper);
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
code: s.toString(),
|
|
169
|
+
map: s.generateMap({
|
|
170
|
+
source: id,
|
|
171
|
+
file: id + ".map",
|
|
172
|
+
includeContent: true
|
|
173
|
+
})
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Generate wrapper code for a DO class (internal - omits import since transform adds it)
|
|
178
|
+
*/
|
|
179
|
+
function generateWrapperCodeInternal(className, options) {
|
|
180
|
+
let wrapper = `
|
|
181
|
+
|
|
182
|
+
// ============ Devflare DO Wrapper for ${className} ============
|
|
183
|
+
class ${className}Wrapper extends __Original${className} {
|
|
184
|
+
async fetch(request: Request): Promise<Response> {
|
|
185
|
+
const __devflareEvent = createDurableObjectFetchEvent(request, this.env, this.ctx)
|
|
186
|
+
return runWithEventContext(
|
|
187
|
+
__devflareEvent,
|
|
188
|
+
() => super.fetch(__devflareEvent)
|
|
189
|
+
)
|
|
190
|
+
}
|
|
191
|
+
`;
|
|
192
|
+
if (options.alarms) wrapper += `
|
|
193
|
+
async alarm(): Promise<void> {
|
|
194
|
+
const __devflareEvent = createDurableObjectAlarmEvent(this.env, this.ctx)
|
|
195
|
+
return runWithEventContext(
|
|
196
|
+
__devflareEvent,
|
|
197
|
+
() => super.alarm?.(__devflareEvent) ?? Promise.resolve()
|
|
198
|
+
)
|
|
199
|
+
}
|
|
200
|
+
`;
|
|
201
|
+
if (options.websockets) wrapper += `
|
|
202
|
+
async webSocketMessage(ws: WebSocket, message: string | ArrayBuffer): Promise<void> {
|
|
203
|
+
const __devflareEvent = createDurableObjectWebSocketMessageEvent(ws, message, this.env, this.ctx)
|
|
204
|
+
return runWithEventContext(
|
|
205
|
+
__devflareEvent,
|
|
206
|
+
() => super.webSocketMessage?.(__devflareEvent, message) ?? Promise.resolve()
|
|
207
|
+
)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
async webSocketClose(ws: WebSocket, code: number, reason: string, wasClean: boolean): Promise<void> {
|
|
211
|
+
const __devflareEvent = createDurableObjectWebSocketCloseEvent(ws, code, reason, wasClean, this.env, this.ctx)
|
|
212
|
+
return runWithEventContext(
|
|
213
|
+
__devflareEvent,
|
|
214
|
+
() => super.webSocketClose?.(__devflareEvent, code, reason, wasClean) ?? Promise.resolve()
|
|
215
|
+
)
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
async webSocketError(ws: WebSocket, error: unknown): Promise<void> {
|
|
219
|
+
const __devflareEvent = createDurableObjectWebSocketErrorEvent(ws, error, this.env, this.ctx)
|
|
220
|
+
return runWithEventContext(
|
|
221
|
+
__devflareEvent,
|
|
222
|
+
() => super.webSocketError?.(__devflareEvent, error) ?? Promise.resolve()
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
`;
|
|
226
|
+
wrapper += `}
|
|
227
|
+
|
|
228
|
+
export { ${className}Wrapper as ${className} }
|
|
229
|
+
// ============ End Devflare DO Wrapper ============
|
|
230
|
+
`;
|
|
231
|
+
return wrapper;
|
|
232
|
+
}
|
|
233
|
+
//#endregion
|
|
234
|
+
export { findDurableObjectClasses as n, transformDurableObject as r, durable_object_exports as t };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { j as bridgeEnv, n as getContextOrNull } from "./context-CX50Y2Kb.js";
|
|
2
|
+
//#region src/env.ts
|
|
3
|
+
let testContextEnv = null;
|
|
4
|
+
let testContextDispose = null;
|
|
5
|
+
/**
|
|
6
|
+
* Called by createTestContext to set up the unified env
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
function __setTestContext(envBindings, dispose) {
|
|
10
|
+
testContextEnv = envBindings;
|
|
11
|
+
testContextDispose = dispose;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Called after dispose to clear the test context
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
function __clearTestContext() {
|
|
18
|
+
testContextEnv = null;
|
|
19
|
+
testContextDispose = null;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Unified environment bindings proxy
|
|
23
|
+
*
|
|
24
|
+
* Automatically selects the right source:
|
|
25
|
+
* - Request context (if inside a request handler)
|
|
26
|
+
* - Test context (if set up by createTestContext)
|
|
27
|
+
* - Bridge to Miniflare (if outside, in dev mode)
|
|
28
|
+
*
|
|
29
|
+
* Includes `dispose()` method for cleanup in tests.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* import { env } from 'devflare'
|
|
34
|
+
*
|
|
35
|
+
* // Works in request handlers
|
|
36
|
+
* export default {
|
|
37
|
+
* async fetch(request) {
|
|
38
|
+
* const value = await env.MY_KV.get('key')
|
|
39
|
+
* return new Response(value)
|
|
40
|
+
* }
|
|
41
|
+
* }
|
|
42
|
+
*
|
|
43
|
+
* // Also works in tests (after createTestContext)
|
|
44
|
+
* beforeAll(() => createTestContext())
|
|
45
|
+
* afterAll(() => env.dispose())
|
|
46
|
+
* test('works', async () => {
|
|
47
|
+
* const result = await env.MY_BINDING.method()
|
|
48
|
+
* })
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
const env = new Proxy({}, {
|
|
52
|
+
get(_target, prop) {
|
|
53
|
+
if (prop === "dispose") return async () => {
|
|
54
|
+
if (testContextDispose) {
|
|
55
|
+
await testContextDispose();
|
|
56
|
+
__clearTestContext();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const ctx = getContextOrNull();
|
|
60
|
+
if (ctx?.env) return ctx.env[prop];
|
|
61
|
+
if (testContextEnv) return testContextEnv[prop];
|
|
62
|
+
return bridgeEnv[prop];
|
|
63
|
+
},
|
|
64
|
+
has(_target, prop) {
|
|
65
|
+
if (prop === "dispose") return true;
|
|
66
|
+
const ctx = getContextOrNull();
|
|
67
|
+
if (ctx?.env) return prop in ctx.env;
|
|
68
|
+
if (testContextEnv) return prop in testContextEnv;
|
|
69
|
+
return prop in bridgeEnv;
|
|
70
|
+
},
|
|
71
|
+
ownKeys(_target) {
|
|
72
|
+
const ctx = getContextOrNull();
|
|
73
|
+
if (ctx?.env) return Reflect.ownKeys(ctx.env);
|
|
74
|
+
if (testContextEnv) return Reflect.ownKeys(testContextEnv);
|
|
75
|
+
return Reflect.ownKeys(bridgeEnv);
|
|
76
|
+
},
|
|
77
|
+
getOwnPropertyDescriptor(_target, prop) {
|
|
78
|
+
if (prop === "dispose") return {
|
|
79
|
+
configurable: true,
|
|
80
|
+
enumerable: false,
|
|
81
|
+
writable: false
|
|
82
|
+
};
|
|
83
|
+
const source = getContextOrNull()?.env ?? testContextEnv ?? bridgeEnv;
|
|
84
|
+
return Reflect.getOwnPropertyDescriptor(source, prop);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
/**
|
|
88
|
+
* Unified runtime variables proxy.
|
|
89
|
+
*
|
|
90
|
+
* This reads from the same active environment object as {@link env}, but is
|
|
91
|
+
* typed from config `vars` via generated `env.d.ts` declarations. It is useful
|
|
92
|
+
* for nested typed values authored with `defineConfig({ vars })`.
|
|
93
|
+
*/
|
|
94
|
+
const vars = new Proxy({}, {
|
|
95
|
+
get(_target, prop) {
|
|
96
|
+
const ctx = getContextOrNull();
|
|
97
|
+
if (ctx?.env) return ctx.env[prop];
|
|
98
|
+
if (testContextEnv) return testContextEnv[prop];
|
|
99
|
+
return bridgeEnv[prop];
|
|
100
|
+
},
|
|
101
|
+
has(_target, prop) {
|
|
102
|
+
const ctx = getContextOrNull();
|
|
103
|
+
if (ctx?.env) return prop in ctx.env;
|
|
104
|
+
if (testContextEnv) return prop in testContextEnv;
|
|
105
|
+
return prop in bridgeEnv;
|
|
106
|
+
},
|
|
107
|
+
ownKeys(_target) {
|
|
108
|
+
const ctx = getContextOrNull();
|
|
109
|
+
if (ctx?.env) return Reflect.ownKeys(ctx.env);
|
|
110
|
+
if (testContextEnv) return Reflect.ownKeys(testContextEnv);
|
|
111
|
+
return Reflect.ownKeys(bridgeEnv);
|
|
112
|
+
},
|
|
113
|
+
getOwnPropertyDescriptor(_target, prop) {
|
|
114
|
+
const source = getContextOrNull()?.env ?? testContextEnv ?? bridgeEnv;
|
|
115
|
+
return Reflect.getOwnPropertyDescriptor(source, prop);
|
|
116
|
+
},
|
|
117
|
+
set(_target, prop) {
|
|
118
|
+
throw new TypeError(`Cannot assign to '${String(prop)}' on 'vars' because it is read-only.`);
|
|
119
|
+
},
|
|
120
|
+
deleteProperty(_target, prop) {
|
|
121
|
+
throw new TypeError(`Cannot delete property '${String(prop)}' from 'vars' because it is read-only.`);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
//#endregion
|
|
125
|
+
export { vars as i, __setTestContext as n, env as r, __clearTestContext as t };
|