devflare 1.0.0-next.5 → 1.0.0-next.50
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 +394 -605
- package/bin/devflare.js +30 -14
- package/dist/_chunks/account-BI3WZMDy.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-artifacts-DU5V0J0Z.js +483 -0
- package/dist/_chunks/build-e0KR38-4.js +24 -0
- package/dist/_chunks/cli-DuUz10Mn.js +1163 -0
- package/dist/_chunks/cloudflare-BaloqI3H.js +157 -0
- package/dist/_chunks/colors-DiK6wPJ5.js +13 -0
- package/dist/_chunks/command-utils-DA0Qx9_K.js +45 -0
- package/dist/_chunks/compiler-Zw16C9Pi.js +489 -0
- package/dist/_chunks/config-Brju62xy.js +78 -0
- package/dist/_chunks/config-path-DaL1ylZ_.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-B-Kku1Vk.js +1032 -0
- package/dist/_chunks/dev-D4e_RRZn.js +3471 -0
- package/dist/_chunks/doctor-jm_K4dxL.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-_9-mGSfO.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-Cr0_OWPy.js +1288 -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-DMPkmOn3.js +123 -0
- package/dist/_chunks/local-workflow-entrypoints-Cq_WJajd.js +90 -0
- package/dist/_chunks/login-FjTAAQbi.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-CGMBjsYB.js +359 -0
- package/dist/_chunks/previews-C7hs9-BT.js +1134 -0
- package/dist/_chunks/productions-T9Als4fE.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-BFYCqHb-.js +833 -0
- package/dist/_chunks/runtime-DL-Nz3k8.js +550 -0
- package/dist/_chunks/schema-normalization-BCwTLTGp.js +660 -0
- package/dist/_chunks/secrets-DIpJGe6C.js +95 -0
- package/dist/_chunks/tail-IY-ijYmv.js +239 -0
- package/dist/_chunks/token-Dmi0KXyX.js +333 -0
- package/dist/_chunks/tokens-iVcgNXi-.js +221 -0
- package/dist/_chunks/types-DoKsMYfm.js +484 -0
- package/dist/_chunks/ui-BUoZApvE.js +103 -0
- package/dist/_chunks/usage-BBTGzjon.js +272 -0
- package/dist/_chunks/vite-CGtVNf5E.js +1267 -0
- package/dist/_chunks/vite-utils-OVLMV605.js +183 -0
- package/dist/_chunks/worker-BEZI4od1.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 +82 -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 +5411 -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 +298 -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 +2025 -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 +3579 -0
- package/dist/config/schema-env.d.ts.map +1 -0
- package/dist/config/schema-normalization.d.ts +265 -0
- package/dist/config/schema-normalization.d.ts.map +1 -0
- package/dist/config/schema-runtime.d.ts +508 -0
- package/dist/config/schema-runtime.d.ts.map +1 -0
- package/dist/config/schema-types-bindings-platform.d.ts +508 -0
- package/dist/config/schema-types-bindings-platform.d.ts.map +1 -0
- package/dist/config/schema-types-bindings-resources.d.ts +767 -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.d.ts +917 -0
- package/dist/config/schema-types-runtime.d.ts.map +1 -0
- package/dist/config/schema-types.d.ts +424 -0
- package/dist/config/schema-types.d.ts.map +1 -0
- package/dist/config/schema.d.ts +5324 -2011
- 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 +81 -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 +82 -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 +4971 -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,143 @@
|
|
|
1
|
+
import { u as resolveConfigForEnvironment } from "./loader-Cr0_OWPy.js";
|
|
2
|
+
//#region src/cli/commands/previews-support/family.ts
|
|
3
|
+
function compareConfiguredWorkerFamilies(left, right) {
|
|
4
|
+
if (left.role === "primary" && right.role !== "primary") return -1;
|
|
5
|
+
if (left.role !== "primary" && right.role === "primary") return 1;
|
|
6
|
+
return left.baseName.localeCompare(right.baseName);
|
|
7
|
+
}
|
|
8
|
+
function comparePreviewScopeRows(left, right) {
|
|
9
|
+
const leftTime = left.updatedAt?.getTime() ?? 0;
|
|
10
|
+
const rightTime = right.updatedAt?.getTime() ?? 0;
|
|
11
|
+
if (rightTime !== leftTime) return rightTime - leftTime;
|
|
12
|
+
return left.scope.localeCompare(right.scope);
|
|
13
|
+
}
|
|
14
|
+
function collectConfiguredWorkerFamilies(config, environment) {
|
|
15
|
+
const resolvedConfig = resolveConfigForEnvironment(config, environment);
|
|
16
|
+
const families = /* @__PURE__ */ new Map();
|
|
17
|
+
families.set(resolvedConfig.name, {
|
|
18
|
+
baseName: resolvedConfig.name,
|
|
19
|
+
roleLabel: "primary",
|
|
20
|
+
role: "primary"
|
|
21
|
+
});
|
|
22
|
+
for (const [bindingName, binding] of Object.entries(resolvedConfig.bindings?.services ?? {})) {
|
|
23
|
+
if (families.get(binding.service)) continue;
|
|
24
|
+
families.set(binding.service, {
|
|
25
|
+
baseName: binding.service,
|
|
26
|
+
roleLabel: bindingName,
|
|
27
|
+
role: "service"
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return Array.from(families.values()).sort(compareConfiguredWorkerFamilies);
|
|
31
|
+
}
|
|
32
|
+
function getWorkerUrl(workerName, workersSubdomain) {
|
|
33
|
+
if (!workersSubdomain) return;
|
|
34
|
+
return `https://${workerName}.${workersSubdomain}.workers.dev`;
|
|
35
|
+
}
|
|
36
|
+
function getWorkerScopeSuffix(workerName, baseName) {
|
|
37
|
+
if (!workerName.startsWith(`${baseName}-`)) return;
|
|
38
|
+
return workerName.slice(baseName.length + 1).trim() || void 0;
|
|
39
|
+
}
|
|
40
|
+
function buildStableWorkerRowsFromLiveWorkers(families, workers, workersSubdomain) {
|
|
41
|
+
const workersByName = new Map(workers.map((worker) => [worker.name, worker]));
|
|
42
|
+
return families.map((family) => {
|
|
43
|
+
const worker = workersByName.get(family.baseName);
|
|
44
|
+
const status = worker ? "active" : "missing";
|
|
45
|
+
return {
|
|
46
|
+
workerName: family.baseName,
|
|
47
|
+
role: family.roleLabel,
|
|
48
|
+
status,
|
|
49
|
+
updatedAt: worker?.modifiedOn,
|
|
50
|
+
url: worker ? getWorkerUrl(family.baseName, workersSubdomain) : void 0
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function getDedicatedPreviewFamilyNamesFromWorkers(families, workers) {
|
|
55
|
+
const familyNames = /* @__PURE__ */ new Set();
|
|
56
|
+
const workerNames = workers.map((worker) => worker.name);
|
|
57
|
+
for (const family of families) {
|
|
58
|
+
if (family.role === "primary") {
|
|
59
|
+
familyNames.add(family.baseName);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (workerNames.some((workerName) => Boolean(getWorkerScopeSuffix(workerName, family.baseName)))) familyNames.add(family.baseName);
|
|
63
|
+
}
|
|
64
|
+
return familyNames;
|
|
65
|
+
}
|
|
66
|
+
function buildPreviewScopeRowsFromLiveWorkers(families, workers, workersSubdomain) {
|
|
67
|
+
const workersByName = new Map(workers.map((worker) => [worker.name, worker]));
|
|
68
|
+
const previewFamilyNames = getDedicatedPreviewFamilyNamesFromWorkers(families, workers);
|
|
69
|
+
const expectedFamilies = families.filter((family) => previewFamilyNames.has(family.baseName));
|
|
70
|
+
const workerCandidatesByScope = buildPreviewWorkerCandidatesByScope(families, workers);
|
|
71
|
+
return Array.from(workerCandidatesByScope.keys()).map((scope) => {
|
|
72
|
+
const resolvedFamilies = expectedFamilies.map((family) => ({
|
|
73
|
+
family,
|
|
74
|
+
worker: workersByName.get(`${family.baseName}-${scope}`)
|
|
75
|
+
}));
|
|
76
|
+
const presentFamilies = resolvedFamilies.filter((entry) => entry.worker);
|
|
77
|
+
const updatedAt = presentFamilies.reduce((latest, entry) => {
|
|
78
|
+
const currentDate = entry.worker?.modifiedOn;
|
|
79
|
+
if (!currentDate) return latest;
|
|
80
|
+
if (!latest || currentDate.getTime() > latest.getTime()) return currentDate;
|
|
81
|
+
return latest;
|
|
82
|
+
}, void 0);
|
|
83
|
+
const entryWorker = resolvedFamilies.find((entry) => entry.family.role === "primary")?.worker ?? presentFamilies[0]?.worker;
|
|
84
|
+
const missingLabels = resolvedFamilies.filter((entry) => !entry.worker).map((entry) => entry.family.role === "primary" ? "primary" : entry.family.roleLabel);
|
|
85
|
+
const notes = [];
|
|
86
|
+
if (missingLabels.length > 0) notes.push(`missing ${missingLabels.join(", ")}`);
|
|
87
|
+
const strategy = "dedicated workers";
|
|
88
|
+
const status = presentFamilies.length === resolvedFamilies.length ? "ready" : "partial";
|
|
89
|
+
return {
|
|
90
|
+
scope,
|
|
91
|
+
strategy,
|
|
92
|
+
workersLabel: `${presentFamilies.length}/${resolvedFamilies.length}`,
|
|
93
|
+
status,
|
|
94
|
+
updatedAt,
|
|
95
|
+
notes: notes.length > 0 ? notes.join(" · ") : void 0,
|
|
96
|
+
entryUrl: entryWorker ? getWorkerUrl(entryWorker.name, workersSubdomain) : void 0
|
|
97
|
+
};
|
|
98
|
+
}).sort(comparePreviewScopeRows);
|
|
99
|
+
}
|
|
100
|
+
function buildPreviewWorkerCandidatesByScope(families, workers) {
|
|
101
|
+
const candidates = /* @__PURE__ */ new Map();
|
|
102
|
+
for (const worker of workers) for (const family of families) {
|
|
103
|
+
const scope = getWorkerScopeSuffix(worker.name, family.baseName);
|
|
104
|
+
if (!scope) continue;
|
|
105
|
+
const names = candidates.get(scope) ?? /* @__PURE__ */ new Set();
|
|
106
|
+
names.add(worker.name);
|
|
107
|
+
candidates.set(scope, names);
|
|
108
|
+
}
|
|
109
|
+
return new Map(Array.from(candidates.entries()).map(([scope, workerNames]) => {
|
|
110
|
+
return [scope, Array.from(workerNames).sort((left, right) => left.localeCompare(right))];
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
function orderPreviewWorkerNamesForDeletion(workerNames, scope, families) {
|
|
114
|
+
const familyPriority = /* @__PURE__ */ new Map();
|
|
115
|
+
for (const family of families) familyPriority.set(family.baseName, {
|
|
116
|
+
priority: family.role === "primary" ? 0 : 1,
|
|
117
|
+
roleLabel: family.roleLabel
|
|
118
|
+
});
|
|
119
|
+
const resolveFamilyForWorker = (workerName) => {
|
|
120
|
+
for (const family of families) if (getWorkerScopeSuffix(workerName, family.baseName) === scope) {
|
|
121
|
+
const resolved = familyPriority.get(family.baseName);
|
|
122
|
+
if (resolved) return {
|
|
123
|
+
priority: resolved.priority,
|
|
124
|
+
roleLabel: resolved.roleLabel,
|
|
125
|
+
baseName: family.baseName
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
priority: 2,
|
|
130
|
+
roleLabel: workerName
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
return [...workerNames].sort((left, right) => {
|
|
134
|
+
const leftFamily = resolveFamilyForWorker(left);
|
|
135
|
+
const rightFamily = resolveFamilyForWorker(right);
|
|
136
|
+
if (leftFamily.priority !== rightFamily.priority) return leftFamily.priority - rightFamily.priority;
|
|
137
|
+
if (leftFamily.roleLabel !== rightFamily.roleLabel) return leftFamily.roleLabel.localeCompare(rightFamily.roleLabel);
|
|
138
|
+
if (leftFamily.baseName && rightFamily.baseName && leftFamily.baseName !== rightFamily.baseName) return leftFamily.baseName.localeCompare(rightFamily.baseName);
|
|
139
|
+
return left.localeCompare(right);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
//#endregion
|
|
143
|
+
export { orderPreviewWorkerNamesForDeletion as a, collectConfiguredWorkerFamilies as i, buildPreviewWorkerCandidatesByScope as n, buildStableWorkerRowsFromLiveWorkers as r, buildPreviewScopeRowsFromLiveWorkers as t };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { resolve } from "pathe";
|
|
2
|
+
//#region src/cli/generated-artifacts.ts
|
|
3
|
+
const DEVFLARE_DIR = [".devflare"];
|
|
4
|
+
const DEVFLARE_BUILD_DIR = [".devflare", "build"];
|
|
5
|
+
const WRANGLER_DEPLOY_DIR = [".wrangler", "deploy"];
|
|
6
|
+
function getGeneratedArtifactPaths(cwd) {
|
|
7
|
+
const devflareDir = resolve(cwd, ...DEVFLARE_DIR);
|
|
8
|
+
const buildDir = resolve(cwd, ...DEVFLARE_BUILD_DIR);
|
|
9
|
+
const deployDir = resolve(cwd, ...WRANGLER_DEPLOY_DIR);
|
|
10
|
+
return {
|
|
11
|
+
devflareDir,
|
|
12
|
+
devWranglerConfigPath: resolve(devflareDir, "wrangler.jsonc"),
|
|
13
|
+
buildDir,
|
|
14
|
+
buildWorkerPath: resolve(buildDir, "worker.js"),
|
|
15
|
+
buildWranglerConfigPath: resolve(buildDir, "wrangler.jsonc"),
|
|
16
|
+
deployDir,
|
|
17
|
+
deployRedirectPath: resolve(deployDir, "config.json")
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
async function ensureGeneratedDirectory(dirPath, writeGitignore = false) {
|
|
21
|
+
const fs = await import("node:fs/promises");
|
|
22
|
+
await fs.mkdir(dirPath, { recursive: true });
|
|
23
|
+
if (!writeGitignore) return;
|
|
24
|
+
const gitignorePath = resolve(dirPath, ".gitignore");
|
|
25
|
+
try {
|
|
26
|
+
await fs.access(gitignorePath);
|
|
27
|
+
} catch {
|
|
28
|
+
await fs.writeFile(gitignorePath, "*\n", "utf-8");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { getGeneratedArtifactPaths as n, ensureGeneratedDirectory as t };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { globby, globbySync } from "globby";
|
|
2
|
+
//#region src/utils/glob.ts
|
|
3
|
+
/** Default glob pattern for Durable Object discovery */
|
|
4
|
+
const DEFAULT_DO_PATTERN = "**/do.*.{ts,js}";
|
|
5
|
+
/** Default glob pattern for WorkerEntrypoint discovery */
|
|
6
|
+
const DEFAULT_ENTRYPOINT_PATTERN = "**/ep.*.{ts,js}";
|
|
7
|
+
/** Default glob pattern for Workflow discovery */
|
|
8
|
+
const DEFAULT_WORKFLOW_PATTERN = "**/wf.*.{ts,js}";
|
|
9
|
+
/**
|
|
10
|
+
* Find files matching a glob pattern with .gitignore support.
|
|
11
|
+
* This is the async version for use in CLI commands and bundlers.
|
|
12
|
+
*
|
|
13
|
+
* @param pattern - Glob pattern (e.g., '**/do.*.{ts,js}')
|
|
14
|
+
* @param options - Glob options
|
|
15
|
+
* @returns Array of matching file paths
|
|
16
|
+
*/
|
|
17
|
+
async function findFiles(pattern, options) {
|
|
18
|
+
const { cwd, absolute = true, gitignore = true } = options;
|
|
19
|
+
return globby(pattern, {
|
|
20
|
+
cwd,
|
|
21
|
+
absolute,
|
|
22
|
+
gitignore,
|
|
23
|
+
ignore: [
|
|
24
|
+
"**/node_modules/**",
|
|
25
|
+
"**/.devflare/**",
|
|
26
|
+
"**/dist/**",
|
|
27
|
+
"**/build/**",
|
|
28
|
+
"**/.git/**"
|
|
29
|
+
]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Find files matching a glob pattern synchronously.
|
|
34
|
+
* Use sparingly — prefer async version for better performance.
|
|
35
|
+
*
|
|
36
|
+
* @param pattern - Glob pattern (e.g., '**/do.*.{ts,js}')
|
|
37
|
+
* @param options - Glob options
|
|
38
|
+
* @returns Array of matching file paths
|
|
39
|
+
*/
|
|
40
|
+
function findFilesSync(pattern, options) {
|
|
41
|
+
const { cwd, absolute = true, gitignore = true } = options;
|
|
42
|
+
return globbySync(pattern, {
|
|
43
|
+
cwd,
|
|
44
|
+
absolute,
|
|
45
|
+
gitignore,
|
|
46
|
+
ignore: [
|
|
47
|
+
"**/node_modules/**",
|
|
48
|
+
"**/.devflare/**",
|
|
49
|
+
"**/dist/**",
|
|
50
|
+
"**/build/**",
|
|
51
|
+
"**/.git/**"
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { findFilesSync as a, findFiles as i, DEFAULT_ENTRYPOINT_PATTERN as n, DEFAULT_WORKFLOW_PATTERN as r, DEFAULT_DO_PATTERN as t };
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { a as cyanBold, d as green, f as logLine, o as dim, r as createCliTheme } from "./ui-BUoZApvE.js";
|
|
2
|
+
import { t as getInitDependencyVersions } from "./package-metadata-DjHBLB-z.js";
|
|
3
|
+
import { t as getDependencies } from "./dependencies-C2oxFjU_.js";
|
|
4
|
+
import { join, resolve } from "pathe";
|
|
5
|
+
//#region src/cli/commands/init.ts
|
|
6
|
+
const MINIMAL_TEMPLATE = {
|
|
7
|
+
name: "minimal",
|
|
8
|
+
description: "Minimal starter with single handler",
|
|
9
|
+
files: {
|
|
10
|
+
"devflare.config.ts": `import { defineConfig } from 'devflare/config'
|
|
11
|
+
|
|
12
|
+
export default defineConfig({
|
|
13
|
+
name: '{{PROJECT_NAME}}',
|
|
14
|
+
compatibilityDate: '${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}',
|
|
15
|
+
files: {
|
|
16
|
+
fetch: 'src/fetch.ts'
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
`,
|
|
20
|
+
"src/fetch.ts": `import type { FetchEvent } from 'devflare/runtime'
|
|
21
|
+
|
|
22
|
+
export async function fetch({ url }: FetchEvent): Promise<Response> {
|
|
23
|
+
return new Response(
|
|
24
|
+
url.pathname === '/'
|
|
25
|
+
? 'Hello from Devflare'
|
|
26
|
+
: \`Hello from Devflare: \${url.pathname}\`
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
`,
|
|
30
|
+
"package.json": `{
|
|
31
|
+
"name": "{{PROJECT_NAME}}",
|
|
32
|
+
"version": "0.0.1",
|
|
33
|
+
"private": true,
|
|
34
|
+
"type": "module",
|
|
35
|
+
"scripts": {
|
|
36
|
+
"dev": "devflare dev",
|
|
37
|
+
"build": "devflare build",
|
|
38
|
+
"deploy": "devflare deploy",
|
|
39
|
+
"types": "devflare types"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@cloudflare/workers-types": "{{WORKERS_TYPES_VERSION}}",
|
|
43
|
+
"devflare": "{{DEVFLARE_VERSION}}",
|
|
44
|
+
"typescript": "{{TYPESCRIPT_VERSION}}",
|
|
45
|
+
"wrangler": "{{WRANGLER_VERSION}}"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`,
|
|
49
|
+
"tsconfig.json": `{
|
|
50
|
+
"compilerOptions": {
|
|
51
|
+
"target": "ESNext",
|
|
52
|
+
"module": "ESNext",
|
|
53
|
+
"moduleResolution": "bundler",
|
|
54
|
+
"strict": true,
|
|
55
|
+
"skipLibCheck": true,
|
|
56
|
+
"types": ["@cloudflare/workers-types"]
|
|
57
|
+
},
|
|
58
|
+
"include": ["src/**/*", "env.d.ts", "devflare.config.ts"]
|
|
59
|
+
}
|
|
60
|
+
`
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const TEMPLATES = {
|
|
64
|
+
minimal: MINIMAL_TEMPLATE,
|
|
65
|
+
api: {
|
|
66
|
+
name: "api",
|
|
67
|
+
description: "API starter with request-wide middleware",
|
|
68
|
+
files: {
|
|
69
|
+
"devflare.config.ts": `import { defineConfig } from 'devflare/config'
|
|
70
|
+
|
|
71
|
+
export default defineConfig({
|
|
72
|
+
name: '{{PROJECT_NAME}}',
|
|
73
|
+
compatibilityDate: '${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}',
|
|
74
|
+
files: {
|
|
75
|
+
fetch: 'src/fetch.ts'
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
`,
|
|
79
|
+
"src/fetch.ts": `import { sequence } from 'devflare/runtime'
|
|
80
|
+
import { corsHandle } from './middleware/cors'
|
|
81
|
+
import { appFetch } from './app'
|
|
82
|
+
|
|
83
|
+
export const handle = sequence(corsHandle, appFetch)
|
|
84
|
+
`,
|
|
85
|
+
"src/middleware/cors.ts": `import type { FetchEvent, ResolveFetch } from 'devflare/runtime'
|
|
86
|
+
|
|
87
|
+
export async function corsHandle(event: FetchEvent, resolve: ResolveFetch): Promise<Response> {
|
|
88
|
+
// Handle preflight
|
|
89
|
+
if (event.request.method === 'OPTIONS') {
|
|
90
|
+
return new Response(null, {
|
|
91
|
+
headers: {
|
|
92
|
+
'Access-Control-Allow-Origin': '*',
|
|
93
|
+
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
|
|
94
|
+
'Access-Control-Allow-Headers': 'Content-Type, Authorization'
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const response = await resolve(event)
|
|
100
|
+
const next = new Response(response.body, response)
|
|
101
|
+
next.headers.set('Access-Control-Allow-Origin', '*')
|
|
102
|
+
return next
|
|
103
|
+
}
|
|
104
|
+
`,
|
|
105
|
+
"src/app.ts": `import type { FetchEvent } from 'devflare/runtime'
|
|
106
|
+
|
|
107
|
+
export async function appFetch({ url }: FetchEvent): Promise<Response> {
|
|
108
|
+
if (url.pathname === '/api/health') {
|
|
109
|
+
return Response.json({ status: 'ok' })
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (url.pathname.startsWith('/api/')) {
|
|
113
|
+
return Response.json({ error: 'Not found' }, { status: 404 })
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return new Response('Not Found', { status: 404 })
|
|
117
|
+
}
|
|
118
|
+
`,
|
|
119
|
+
"package.json": MINIMAL_TEMPLATE.files["package.json"],
|
|
120
|
+
"tsconfig.json": MINIMAL_TEMPLATE.files["tsconfig.json"]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
async function runInitCommand(parsed, logger, options) {
|
|
125
|
+
const projectName = parsed.args[0] || "my-devflare-app";
|
|
126
|
+
const templateName = parsed.options.template || "minimal";
|
|
127
|
+
const cwd = options.cwd || process.cwd();
|
|
128
|
+
const theme = createCliTheme(parsed.options);
|
|
129
|
+
logLine(logger);
|
|
130
|
+
logLine(logger, `${cyanBold("init", theme)} ${dim("Creating a new Devflare project", theme)}`);
|
|
131
|
+
logLine(logger, `${dim("project", theme)} ${green(projectName, theme)}`);
|
|
132
|
+
const template = TEMPLATES[templateName];
|
|
133
|
+
if (!template) {
|
|
134
|
+
logger.error(`Unknown template: ${templateName}`);
|
|
135
|
+
logger.info(`Available templates: ${Object.keys(TEMPLATES).join(", ")}`);
|
|
136
|
+
return { exitCode: 1 };
|
|
137
|
+
}
|
|
138
|
+
const projectDir = resolve(cwd, projectName);
|
|
139
|
+
const dependencyVersions = await getInitDependencyVersions();
|
|
140
|
+
const { fs } = await getDependencies();
|
|
141
|
+
try {
|
|
142
|
+
await fs.access(projectDir);
|
|
143
|
+
logger.error(`Directory already exists: ${projectDir}`);
|
|
144
|
+
return { exitCode: 1 };
|
|
145
|
+
} catch {}
|
|
146
|
+
await fs.mkdir(projectDir, { recursive: true });
|
|
147
|
+
for (const [filePath, content] of Object.entries(template.files)) {
|
|
148
|
+
const fullPath = join(projectDir, filePath);
|
|
149
|
+
const dir = fullPath.substring(0, fullPath.lastIndexOf("/"));
|
|
150
|
+
await fs.mkdir(dir, { recursive: true }).catch(() => {});
|
|
151
|
+
const processedContent = content.replace(/\{\{PROJECT_NAME\}\}/g, projectName).replace(/\{\{DEVFLARE_VERSION\}\}/g, dependencyVersions.devflare).replace(/\{\{TYPESCRIPT_VERSION\}\}/g, dependencyVersions.typescript).replace(/\{\{WRANGLER_VERSION\}\}/g, dependencyVersions.wrangler).replace(/\{\{WORKERS_TYPES_VERSION\}\}/g, dependencyVersions.workersTypes);
|
|
152
|
+
await fs.writeFile(fullPath, processedContent, "utf-8");
|
|
153
|
+
logLine(logger, ` ${dim("created", theme)} ${filePath}`);
|
|
154
|
+
}
|
|
155
|
+
logger.success("Project created successfully!");
|
|
156
|
+
logLine(logger);
|
|
157
|
+
logLine(logger, dim("next steps", theme));
|
|
158
|
+
logLine(logger, ` cd ${projectName}`);
|
|
159
|
+
logLine(logger, " bun install");
|
|
160
|
+
logLine(logger, " bun run types");
|
|
161
|
+
logLine(logger, " bun run dev");
|
|
162
|
+
return { exitCode: 0 };
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
165
|
+
export { runInitCommand };
|