devflare 1.0.0-next.14 → 1.0.0-next.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LLM.md +9360 -1784
- package/README.md +391 -32
- package/bin/devflare.js +17 -7
- package/dist/account-0w8wdzjv.js +475 -0
- package/dist/account-eygq6qx7.js +475 -0
- package/dist/account-fw8nafav.js +475 -0
- package/dist/account-pzq69nys.js +475 -0
- package/dist/account-s66jb15j.js +475 -0
- package/dist/api-d6ekexs5.js +25 -0
- package/dist/bridge/index.d.ts +1 -1
- package/dist/bridge/index.d.ts.map +1 -1
- package/dist/bridge/miniflare.d.ts.map +1 -1
- package/dist/bridge/protocol.d.ts +1 -1
- package/dist/bridge/protocol.d.ts.map +1 -1
- package/dist/bridge/proxy.d.ts +0 -4
- package/dist/bridge/proxy.d.ts.map +1 -1
- package/dist/bridge/serialization.d.ts.map +1 -1
- package/dist/bridge/server.d.ts +1 -1
- package/dist/bridge/server.d.ts.map +1 -1
- package/dist/browser-shim/handler.d.ts +1 -1
- package/dist/browser-shim/handler.d.ts.map +1 -1
- package/dist/browser.d.ts +1651 -34
- package/dist/browser.d.ts.map +1 -1
- package/dist/build-1kmkwqgh.js +53 -0
- package/dist/build-506kjhcm.js +53 -0
- package/dist/build-66866ahs.js +53 -0
- package/dist/build-g1adm3ww.js +53 -0
- package/dist/build-p3r3117t.js +53 -0
- package/dist/bundler/do-bundler.d.ts.map +1 -1
- package/dist/bundler/rolldown-shared.d.ts +24 -0
- package/dist/bundler/rolldown-shared.d.ts.map +1 -0
- package/dist/bundler/worker-bundler.d.ts +0 -1
- package/dist/bundler/worker-bundler.d.ts.map +1 -1
- package/dist/cli/command-utils.d.ts +18 -0
- package/dist/cli/command-utils.d.ts.map +1 -0
- package/dist/cli/commands/account.d.ts +1 -1
- package/dist/cli/commands/account.d.ts.map +1 -1
- package/dist/cli/commands/build-artifacts.d.ts +27 -0
- package/dist/cli/commands/build-artifacts.d.ts.map +1 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/config.d.ts +4 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/deploy.d.ts.map +1 -1
- package/dist/cli/commands/dev.d.ts.map +1 -1
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/login.d.ts +4 -0
- package/dist/cli/commands/login.d.ts.map +1 -0
- package/dist/cli/commands/previews-support/cleanup.d.ts +9 -0
- package/dist/cli/commands/previews-support/cleanup.d.ts.map +1 -0
- package/dist/cli/commands/previews-support/family.d.ts +10 -0
- package/dist/cli/commands/previews-support/family.d.ts.map +1 -0
- package/dist/cli/commands/previews-support/render.d.ts +8 -0
- package/dist/cli/commands/previews-support/render.d.ts.map +1 -0
- package/dist/cli/commands/previews-support/theme.d.ts +10 -0
- package/dist/cli/commands/previews-support/theme.d.ts.map +1 -0
- package/dist/cli/commands/previews-support/types.d.ts +70 -0
- package/dist/cli/commands/previews-support/types.d.ts.map +1 -0
- package/dist/cli/commands/previews.d.ts +4 -0
- package/dist/cli/commands/previews.d.ts.map +1 -0
- package/dist/cli/commands/productions.d.ts +4 -0
- package/dist/cli/commands/productions.d.ts.map +1 -0
- package/dist/cli/commands/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 +44 -0
- package/dist/cli/commands/type-generation/generator.d.ts.map +1 -0
- package/dist/cli/commands/type-generation/models.d.ts +27 -0
- package/dist/cli/commands/type-generation/models.d.ts.map +1 -0
- package/dist/cli/commands/types.d.ts.map +1 -1
- package/dist/cli/commands/worker.d.ts +4 -0
- package/dist/cli/commands/worker.d.ts.map +1 -0
- package/dist/cli/config-path.d.ts +2 -1
- package/dist/cli/config-path.d.ts.map +1 -1
- package/dist/cli/deploy-strategy.d.ts +17 -0
- package/dist/cli/deploy-strategy.d.ts.map +1 -0
- package/dist/cli/deploy-target.d.ts +17 -0
- package/dist/cli/deploy-target.d.ts.map +1 -0
- package/dist/cli/generated-artifacts.d.ts +12 -0
- package/dist/cli/generated-artifacts.d.ts.map +1 -0
- package/dist/cli/help-pages/pages/account.d.ts +3 -0
- package/dist/cli/help-pages/pages/account.d.ts.map +1 -0
- package/dist/cli/help-pages/pages/core.d.ts +4 -0
- package/dist/cli/help-pages/pages/core.d.ts.map +1 -0
- package/dist/cli/help-pages/pages/index.d.ts +3 -0
- package/dist/cli/help-pages/pages/index.d.ts.map +1 -0
- package/dist/cli/help-pages/pages/misc.d.ts +3 -0
- package/dist/cli/help-pages/pages/misc.d.ts.map +1 -0
- package/dist/cli/help-pages/pages/previews.d.ts +3 -0
- package/dist/cli/help-pages/pages/previews.d.ts.map +1 -0
- package/dist/cli/help-pages/pages/productions.d.ts +3 -0
- package/dist/cli/help-pages/pages/productions.d.ts.map +1 -0
- package/dist/cli/help-pages/render.d.ts +12 -0
- package/dist/cli/help-pages/render.d.ts.map +1 -0
- package/dist/cli/help-pages/shared.d.ts +15 -0
- package/dist/cli/help-pages/shared.d.ts.map +1 -0
- package/dist/cli/help-pages/types.d.ts +23 -0
- package/dist/cli/help-pages/types.d.ts.map +1 -0
- package/dist/cli/help.d.ts +6 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/preview-bindings.d.ts +42 -0
- package/dist/cli/preview-bindings.d.ts.map +1 -0
- package/dist/cli/preview.d.ts +11 -0
- package/dist/cli/preview.d.ts.map +1 -0
- package/dist/cli/ui.d.ts +37 -0
- package/dist/cli/ui.d.ts.map +1 -0
- package/dist/cli/workspace-build-guard.d.ts +14 -0
- package/dist/cli/workspace-build-guard.d.ts.map +1 -0
- package/dist/cloudflare/account-core.d.ts +6 -0
- package/dist/cloudflare/account-core.d.ts.map +1 -0
- package/dist/cloudflare/account-resources.d.ts +40 -0
- package/dist/cloudflare/account-resources.d.ts.map +1 -0
- package/dist/cloudflare/account-status.d.ts +11 -0
- package/dist/cloudflare/account-status.d.ts.map +1 -0
- package/dist/cloudflare/account-workers.d.ts +14 -0
- package/dist/cloudflare/account-workers.d.ts.map +1 -0
- package/dist/cloudflare/account.d.ts +7 -64
- package/dist/cloudflare/account.d.ts.map +1 -1
- package/dist/cloudflare/api.d.ts +4 -0
- package/dist/cloudflare/api.d.ts.map +1 -1
- package/dist/cloudflare/index.d.ts +57 -2
- package/dist/cloudflare/index.d.ts.map +1 -1
- package/dist/cloudflare/kv-namespace.d.ts +3 -0
- package/dist/cloudflare/kv-namespace.d.ts.map +1 -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-records.d.ts +61 -0
- package/dist/cloudflare/preview-registry-records.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-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/registry-schema.d.ts +253 -0
- package/dist/cloudflare/registry-schema.d.ts.map +1 -0
- package/dist/cloudflare/tokens.d.ts +18 -0
- package/dist/cloudflare/tokens.d.ts.map +1 -0
- package/dist/cloudflare/types.d.ts +122 -5
- package/dist/cloudflare/types.d.ts.map +1 -1
- package/dist/cloudflare/usage.d.ts.map +1 -1
- package/dist/config/compiler.d.ts +4 -0
- package/dist/config/compiler.d.ts.map +1 -1
- 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 +5 -3
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/loader.d.ts +1 -0
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/preview-resources.d.ts +77 -0
- package/dist/config/preview-resources.d.ts.map +1 -0
- package/dist/config/preview.d.ts +31 -0
- package/dist/config/preview.d.ts.map +1 -0
- package/dist/config/ref.d.ts +0 -22
- package/dist/config/ref.d.ts.map +1 -1
- package/dist/config/resolve.d.ts +1 -0
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resource-resolution.d.ts +60 -0
- package/dist/config/resource-resolution.d.ts.map +1 -0
- package/dist/config/schema-bindings.d.ts +693 -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 +1341 -0
- package/dist/config/schema-env.d.ts.map +1 -0
- package/dist/config/schema-normalization.d.ts +64 -0
- package/dist/config/schema-normalization.d.ts.map +1 -0
- package/dist/config/schema-runtime.d.ts +230 -0
- package/dist/config/schema-runtime.d.ts.map +1 -0
- package/dist/config/schema.d.ts +640 -3669
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config-entry.d.ts +5 -0
- package/dist/config-entry.d.ts.map +1 -0
- package/dist/config-fjwke42y.js +59 -0
- package/dist/config-hwdqjse7.js +59 -0
- package/dist/config-pxvewrhv.js +59 -0
- package/dist/config-q0g5qdga.js +59 -0
- package/dist/decorators/durable-object.d.ts.map +1 -1
- package/dist/deploy-7nmzc9r8.js +609 -0
- package/dist/deploy-csfhdr64.js +691 -0
- package/dist/deploy-ex4g5avz.js +621 -0
- package/dist/deploy-jnb0bhka.js +609 -0
- package/dist/deploy-tp0g6qdp.js +609 -0
- package/dist/deploy-ykpcjkc2.js +690 -0
- package/dist/{dev-c1xc1gq9.js → dev-2pd33m28.js} +392 -348
- package/dist/dev-7ef5e2j1.js +2409 -0
- package/dist/dev-8nssqatr.js +2409 -0
- package/dist/dev-grznx8fn.js +2409 -0
- package/dist/dev-server/d1-migrations.d.ts +14 -0
- package/dist/dev-server/d1-migrations.d.ts.map +1 -0
- package/dist/dev-server/gateway-script.d.ts +8 -0
- package/dist/dev-server/gateway-script.d.ts.map +1 -0
- package/dist/dev-server/runtime-stdio.d.ts.map +1 -1
- package/dist/dev-server/server.d.ts.map +1 -1
- package/dist/dev-server/vite-process.d.ts +14 -0
- package/dist/dev-server/vite-process.d.ts.map +1 -0
- package/dist/dev-server/vite-utils.d.ts +1 -1
- package/dist/dev-server/vite-utils.d.ts.map +1 -1
- package/dist/dev-server/worker-source-watcher.d.ts +11 -0
- package/dist/dev-server/worker-source-watcher.d.ts.map +1 -0
- package/dist/dev-server/worker-surface-paths.d.ts +6 -0
- package/dist/dev-server/worker-surface-paths.d.ts.map +1 -0
- package/dist/{doctor-z4ffybce.js → doctor-04ammrrh.js} +67 -31
- package/dist/doctor-fmjj65mc.js +245 -0
- package/dist/doctor-fzkznce1.js +245 -0
- package/dist/doctor-sa5xv1bz.js +245 -0
- package/dist/index-091sh1ma.js +1229 -0
- package/dist/index-0apbm26n.js +788 -0
- package/dist/index-0eqksag4.js +418 -0
- package/dist/{index-dr6sbp8d.js → index-0kfzdywd.js} +15 -2
- package/dist/index-0w826dsr.js +379 -0
- package/dist/{index-rfhx0yd5.js → index-11m5a8wd.js} +110 -32
- package/dist/{index-xxwbb2nt.js → index-1sp39f2f.js} +114 -58
- package/dist/index-2jnrqbny.js +1301 -0
- package/dist/index-2pb7b9mw.js +378 -0
- package/dist/{index-0kzg8wed.js → index-2x53aqjm.js} +1071 -890
- package/dist/index-3ke5d2vn.js +1229 -0
- package/dist/index-43dq8yx8.js +788 -0
- package/dist/index-4rrttqj5.js +378 -0
- package/dist/index-4v9bc2pc.js +1367 -0
- package/dist/index-61jsjnsv.js +280 -0
- package/dist/index-6jef5emv.js +176 -0
- package/dist/index-6psz1h4c.js +788 -0
- package/dist/index-72mve6vh.js +168 -0
- package/dist/{index-zbvmtcn2.js → index-74198nxd.js} +179 -77
- package/dist/index-7g8zyws4.js +192 -0
- package/dist/index-7kcxjhta.js +456 -0
- package/dist/index-7v583xan.js +418 -0
- package/dist/index-7x0ybbtx.js +133 -0
- package/dist/index-816krz9p.js +52 -0
- package/dist/index-82f1z98k.js +41 -0
- package/dist/index-8t5nb4qx.js +133 -0
- package/dist/index-9az6s7ad.js +52 -0
- package/dist/{index-59df49vn.js → index-9ba1etyz.js} +29 -51
- package/dist/{index-001mw014.js → index-9fbtk7gv.js} +134 -248
- package/dist/index-9n6djthj.js +490 -0
- package/dist/index-aabgympv.js +39 -0
- package/dist/index-b8m6883k.js +74 -0
- package/dist/{index-5yxg30va.js → index-cgbvmse6.js} +15 -6
- package/dist/index-d8etnfef.js +1229 -0
- package/dist/index-e9yw4d6y.js +133 -0
- package/dist/index-epw1jxz5.js +1204 -0
- package/dist/index-f85s8gj3.js +2649 -0
- package/dist/index-fe2ngvh7.js +1229 -0
- package/dist/index-fvsadj32.js +192 -0
- package/dist/index-gs4y9gdf.js +456 -0
- package/dist/{index-fef08w43.js → index-h18pxvzs.js} +7 -6
- package/dist/index-hfj1a2c4.js +2649 -0
- package/dist/{index-8gtqgb3q.js → index-hjy8ctpc.js} +14 -92
- package/dist/index-htzf0py1.js +1204 -0
- package/dist/index-j185x270.js +897 -0
- package/dist/index-jb75kwa4.js +519 -0
- package/dist/index-jwd8pcb2.js +897 -0
- package/dist/index-k29yjhv0.js +52 -0
- package/dist/index-k6vq6kkt.js +456 -0
- package/dist/{index-vky23txa.js → index-m3fmw6mx.js} +2 -2
- package/dist/index-maxpsfk8.js +402 -0
- package/dist/index-mbdmrner.js +402 -0
- package/dist/index-mea5bc45.js +418 -0
- package/dist/index-mqekt778.js +185 -0
- package/dist/index-na3mnm1k.js +74 -0
- package/dist/index-p03n4qet.js +1367 -0
- package/dist/index-p296ban8.js +191 -0
- package/dist/index-pnbs1b8k.js +280 -0
- package/dist/index-q4kaz181.js +1207 -0
- package/dist/index-ry131z23.js +378 -0
- package/dist/index-sgb7c8nm.js +402 -0
- package/dist/index-sqrksgb2.js +133 -0
- package/dist/index-stgn34cr.js +148 -0
- package/dist/{index-v8vvsn9x.js → index-t08te69w.js} +1 -18
- package/dist/index-thna1tkd.js +280 -0
- package/dist/index-v5nmqthy.js +74 -0
- package/dist/{index-n932ytmq.js → index-vt4yxkmf.js} +2 -2
- package/dist/index-wyq6c6yj.js +402 -0
- package/dist/index-wztc9stx.js +418 -0
- package/dist/index-x9cwdxw5.js +456 -0
- package/dist/index-xk9djfjp.js +519 -0
- package/dist/index-yc0gcchc.js +418 -0
- package/dist/index-yqbxjysa.js +897 -0
- package/dist/index-yzddwp02.js +788 -0
- package/dist/index-zfhq6s96.js +74 -0
- package/dist/index-zt22fe2j.js +54 -0
- package/dist/index-zyt5byt6.js +2649 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/{init-na2atvz2.js → init-r4hnxan3.js} +24 -17
- package/dist/login-2hnz4m4n.js +77 -0
- package/dist/login-5bsxxpvc.js +77 -0
- package/dist/login-6tzvczw2.js +77 -0
- package/dist/login-bhaw72zc.js +77 -0
- package/dist/login-x8tgckqm.js +77 -0
- package/dist/previews-3rn8mz2c.js +1168 -0
- package/dist/previews-d487qde5.js +1200 -0
- package/dist/previews-gm3z0syj.js +1168 -0
- package/dist/previews-j9ymq4ys.js +1169 -0
- package/dist/previews-q031mx34.js +1168 -0
- package/dist/productions-120xg0aq.js +505 -0
- package/dist/productions-5ev5qweg.js +505 -0
- package/dist/productions-me3tdvr9.js +505 -0
- package/dist/productions-p5rbgp2f.js +505 -0
- package/dist/productions-x9p0pym1.js +505 -0
- package/dist/runtime/context-events.d.ts +13 -0
- package/dist/runtime/context-events.d.ts.map +1 -0
- package/dist/runtime/context-types.d.ts +82 -0
- package/dist/runtime/context-types.d.ts.map +1 -0
- package/dist/runtime/context.d.ts +6 -267
- package/dist/runtime/context.d.ts.map +1 -1
- package/dist/runtime/exports.d.ts +3 -3
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/middleware.d.ts +8 -38
- package/dist/runtime/middleware.d.ts.map +1 -1
- package/dist/src/browser.js +23 -14
- package/dist/src/cli/index.js +3 -1
- package/dist/src/cloudflare/index.js +49 -2
- package/dist/src/config-entry.js +14 -0
- package/dist/src/index.js +33 -20
- package/dist/src/runtime/index.js +3 -9
- package/dist/src/sveltekit/index.js +10 -7
- package/dist/src/test/index.js +16 -18
- package/dist/src/vite/index.js +7 -4
- package/dist/sveltekit/platform.d.ts +1 -1
- package/dist/sveltekit/platform.d.ts.map +1 -1
- package/dist/test/cf.d.ts +10 -10
- package/dist/test/email.d.ts.map +1 -1
- package/dist/test/index.d.ts +1 -6
- package/dist/test/index.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/test/scheduled.d.ts.map +1 -1
- package/dist/test/should-skip.d.ts +0 -18
- package/dist/test/should-skip.d.ts.map +1 -1
- 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-gateway-script.d.ts +2 -0
- package/dist/test/simple-context-gateway-script.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.d.ts +1 -23
- package/dist/test/simple-context.d.ts.map +1 -1
- package/dist/test/tail.d.ts.map +1 -1
- package/dist/test/worker.d.ts.map +1 -1
- package/dist/token-kedhcret.js +419 -0
- package/dist/token-m8jmnjwk.js +419 -0
- package/dist/{types-sffr9681.js → types-0sqwkp7x.js} +244 -139
- package/dist/types-1gwr2ex6.js +572 -0
- package/dist/types-6e5yx6km.js +572 -0
- package/dist/types-p0gckpn6.js +572 -0
- package/dist/utils/send-email.d.ts.map +1 -1
- package/dist/vite/config-file.d.ts.map +1 -1
- package/dist/vite/plugin.d.ts.map +1 -1
- package/dist/worker-0srh2jfr.js +513 -0
- package/dist/worker-4xrfd10a.js +513 -0
- package/dist/worker-entry/composed-worker.d.ts +0 -7
- package/dist/worker-entry/composed-worker.d.ts.map +1 -1
- package/dist/worker-entry/surface-paths.d.ts +15 -0
- package/dist/worker-entry/surface-paths.d.ts.map +1 -0
- package/dist/worker-qtam8grz.js +513 -0
- package/dist/worker-qzm0b7br.js +513 -0
- package/dist/worker-y9ha6g44.js +513 -0
- package/package.json +17 -10
- package/R2.md +0 -200
- package/dist/account-8psavtg6.js +0 -420
- package/dist/build-n639efmn.js +0 -101
- package/dist/deploy-zvnq6xh7.js +0 -117
- package/dist/index-2q3pmzrx.js +0 -90
- package/dist/index-f4q0jbnj.js +0 -195
- package/dist/index-n7rs26ft.js +0 -77
- package/dist/index-tfyxa77h.js +0 -850
- package/dist/index-wyf3s77s.js +0 -343
- package/dist/test/multi-worker-context.d.ts +0 -114
- package/dist/test/multi-worker-context.d.ts.map +0 -1
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getSingleBrowserBindingName,
|
|
3
|
+
normalizeD1Binding,
|
|
4
|
+
normalizeDOBinding,
|
|
5
|
+
normalizeHyperdriveBinding,
|
|
6
|
+
normalizeKVBinding,
|
|
7
|
+
resolveConfigForEnvironment
|
|
8
|
+
} from "./index-0apbm26n.js";
|
|
9
|
+
import {
|
|
10
|
+
__require
|
|
11
|
+
} from "./index-37x76zdn.js";
|
|
12
|
+
|
|
13
|
+
// src/config/compiler.ts
|
|
14
|
+
import { basename, isAbsolute, relative, resolve } from "pathe";
|
|
15
|
+
function getWranglerD1DatabaseId(bindingName, bindingConfig) {
|
|
16
|
+
const normalized = normalizeD1Binding(bindingConfig);
|
|
17
|
+
if (normalized.databaseId) {
|
|
18
|
+
return normalized.databaseId;
|
|
19
|
+
}
|
|
20
|
+
throw new Error(`D1 binding "${bindingName}" is configured by name (${normalized.name}) and must be resolved before compiling Wrangler config. Use loadResolvedConfig() or resolveConfigResources() for build/deploy/automation flows.`);
|
|
21
|
+
}
|
|
22
|
+
function getWranglerKVNamespaceId(bindingName, bindingConfig) {
|
|
23
|
+
const normalized = normalizeKVBinding(bindingConfig);
|
|
24
|
+
if (normalized.namespaceId) {
|
|
25
|
+
return normalized.namespaceId;
|
|
26
|
+
}
|
|
27
|
+
throw new Error(`KV binding "${bindingName}" is configured by name (${normalized.name}) and must be resolved before compiling Wrangler config. Use loadResolvedConfig() or resolveConfigResources() for build/deploy/automation flows.`);
|
|
28
|
+
}
|
|
29
|
+
function getWranglerHyperdriveId(bindingName, bindingConfig) {
|
|
30
|
+
const normalized = normalizeHyperdriveBinding(bindingConfig);
|
|
31
|
+
if (normalized.configurationId) {
|
|
32
|
+
return normalized.configurationId;
|
|
33
|
+
}
|
|
34
|
+
throw new Error(`Hyperdrive binding "${bindingName}" is configured by name (${normalized.name}) and must be resolved before compiling Wrangler config. Use loadResolvedConfig() or resolveConfigResources() for build/deploy/automation flows.`);
|
|
35
|
+
}
|
|
36
|
+
function getWranglerBrowserBinding(browserBindings) {
|
|
37
|
+
const bindingName = getSingleBrowserBindingName(browserBindings);
|
|
38
|
+
return bindingName ? { binding: bindingName } : undefined;
|
|
39
|
+
}
|
|
40
|
+
function compileWranglerMigrations(migrations) {
|
|
41
|
+
return migrations.map((migration) => ({
|
|
42
|
+
tag: migration.tag,
|
|
43
|
+
...migration.new_classes && { new_classes: migration.new_classes },
|
|
44
|
+
...migration.renamed_classes && {
|
|
45
|
+
renamed_classes: migration.renamed_classes.map((renamedClass) => ({
|
|
46
|
+
from: renamedClass.from,
|
|
47
|
+
to: renamedClass.to
|
|
48
|
+
}))
|
|
49
|
+
},
|
|
50
|
+
...migration.deleted_classes && { deleted_classes: migration.deleted_classes },
|
|
51
|
+
...migration.new_sqlite_classes && { new_sqlite_classes: migration.new_sqlite_classes }
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
function compileConfig(config, environment) {
|
|
55
|
+
const mergedConfig = resolveConfigForEnvironment(config, environment);
|
|
56
|
+
const result = {
|
|
57
|
+
name: mergedConfig.name,
|
|
58
|
+
compatibility_date: mergedConfig.compatibilityDate,
|
|
59
|
+
preview_urls: true,
|
|
60
|
+
workers_dev: true
|
|
61
|
+
};
|
|
62
|
+
if (mergedConfig.accountId) {
|
|
63
|
+
result.account_id = mergedConfig.accountId;
|
|
64
|
+
}
|
|
65
|
+
const mainEntry = mergedConfig.files?.fetch;
|
|
66
|
+
if (typeof mainEntry === "string") {
|
|
67
|
+
result.main = mainEntry;
|
|
68
|
+
}
|
|
69
|
+
if (mergedConfig.compatibilityFlags && mergedConfig.compatibilityFlags.length > 0) {
|
|
70
|
+
result.compatibility_flags = mergedConfig.compatibilityFlags;
|
|
71
|
+
}
|
|
72
|
+
if (mergedConfig.bindings) {
|
|
73
|
+
compileBindings(mergedConfig.bindings, result);
|
|
74
|
+
}
|
|
75
|
+
if (mergedConfig.triggers?.crons && mergedConfig.triggers.crons.length > 0) {
|
|
76
|
+
result.triggers = { crons: mergedConfig.triggers.crons };
|
|
77
|
+
}
|
|
78
|
+
if (mergedConfig.vars && Object.keys(mergedConfig.vars).length > 0) {
|
|
79
|
+
result.vars = mergedConfig.vars;
|
|
80
|
+
}
|
|
81
|
+
if (mergedConfig.routes && mergedConfig.routes.length > 0) {
|
|
82
|
+
result.routes = mergedConfig.routes.map((route) => ({
|
|
83
|
+
pattern: route.pattern,
|
|
84
|
+
...route.zone_name && { zone_name: route.zone_name },
|
|
85
|
+
...route.zone_id && { zone_id: route.zone_id },
|
|
86
|
+
...route.custom_domain !== undefined && { custom_domain: route.custom_domain }
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
if (mergedConfig.assets && mergedConfig.assets.directory) {
|
|
90
|
+
result.assets = {
|
|
91
|
+
directory: mergedConfig.assets.directory,
|
|
92
|
+
...mergedConfig.assets.binding && { binding: mergedConfig.assets.binding }
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
if (mergedConfig.observability) {
|
|
96
|
+
result.observability = mergedConfig.observability;
|
|
97
|
+
}
|
|
98
|
+
if (mergedConfig.limits) {
|
|
99
|
+
result.limits = mergedConfig.limits;
|
|
100
|
+
}
|
|
101
|
+
if (mergedConfig.migrations && mergedConfig.migrations.length > 0) {
|
|
102
|
+
result.migrations = compileWranglerMigrations(mergedConfig.migrations);
|
|
103
|
+
}
|
|
104
|
+
if (mergedConfig.wrangler?.passthrough) {
|
|
105
|
+
Object.assign(result, mergedConfig.wrangler.passthrough);
|
|
106
|
+
}
|
|
107
|
+
return result;
|
|
108
|
+
}
|
|
109
|
+
function compileToProgrammaticConfig(config, environment) {
|
|
110
|
+
const wranglerConfig = compileConfig(config, environment);
|
|
111
|
+
return { ...wranglerConfig };
|
|
112
|
+
}
|
|
113
|
+
function compileBindings(bindings, result) {
|
|
114
|
+
if (bindings.kv) {
|
|
115
|
+
result.kv_namespaces = Object.entries(bindings.kv).map(([binding, namespace]) => ({
|
|
116
|
+
binding,
|
|
117
|
+
id: getWranglerKVNamespaceId(binding, namespace)
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
if (bindings.d1) {
|
|
121
|
+
result.d1_databases = Object.entries(bindings.d1).map(([binding, database_id]) => ({
|
|
122
|
+
binding,
|
|
123
|
+
database_id: getWranglerD1DatabaseId(binding, database_id)
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
if (bindings.r2) {
|
|
127
|
+
result.r2_buckets = Object.entries(bindings.r2).map(([binding, bucket_name]) => ({
|
|
128
|
+
binding,
|
|
129
|
+
bucket_name
|
|
130
|
+
}));
|
|
131
|
+
}
|
|
132
|
+
if (bindings.durableObjects) {
|
|
133
|
+
result.durable_objects = {
|
|
134
|
+
bindings: Object.entries(bindings.durableObjects).map(([name, config]) => {
|
|
135
|
+
const normalized = normalizeDOBinding(config);
|
|
136
|
+
const binding = {
|
|
137
|
+
name,
|
|
138
|
+
class_name: normalized.className
|
|
139
|
+
};
|
|
140
|
+
if (normalized.scriptName) {
|
|
141
|
+
binding.script_name = normalized.scriptName;
|
|
142
|
+
}
|
|
143
|
+
return binding;
|
|
144
|
+
})
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
if (bindings.queues) {
|
|
148
|
+
result.queues = {};
|
|
149
|
+
if (bindings.queues.producers) {
|
|
150
|
+
result.queues.producers = Object.entries(bindings.queues.producers).map(([binding, queue]) => ({ binding, queue }));
|
|
151
|
+
}
|
|
152
|
+
if (bindings.queues.consumers) {
|
|
153
|
+
result.queues.consumers = bindings.queues.consumers.map((consumer) => ({
|
|
154
|
+
queue: consumer.queue,
|
|
155
|
+
...consumer.maxBatchSize && { max_batch_size: consumer.maxBatchSize },
|
|
156
|
+
...consumer.maxBatchTimeout && { max_batch_timeout: consumer.maxBatchTimeout },
|
|
157
|
+
...consumer.maxRetries && { max_retries: consumer.maxRetries },
|
|
158
|
+
...consumer.deadLetterQueue && { dead_letter_queue: consumer.deadLetterQueue },
|
|
159
|
+
...consumer.maxConcurrency && { max_concurrency: consumer.maxConcurrency },
|
|
160
|
+
...consumer.retryDelay && { retry_delay: consumer.retryDelay }
|
|
161
|
+
}));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (bindings.services) {
|
|
165
|
+
result.services = Object.entries(bindings.services).map(([binding, config]) => ({
|
|
166
|
+
binding,
|
|
167
|
+
service: config.service,
|
|
168
|
+
...config.entrypoint && { entrypoint: config.entrypoint },
|
|
169
|
+
...config.environment && { environment: config.environment }
|
|
170
|
+
}));
|
|
171
|
+
}
|
|
172
|
+
if (bindings.ai && bindings.ai.binding) {
|
|
173
|
+
result.ai = { binding: bindings.ai.binding };
|
|
174
|
+
}
|
|
175
|
+
if (bindings.vectorize) {
|
|
176
|
+
result.vectorize = Object.entries(bindings.vectorize).map(([binding, config]) => ({
|
|
177
|
+
binding,
|
|
178
|
+
index_name: config.indexName
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
181
|
+
if (bindings.hyperdrive) {
|
|
182
|
+
result.hyperdrive = Object.entries(bindings.hyperdrive).map(([binding, config]) => ({
|
|
183
|
+
binding,
|
|
184
|
+
id: getWranglerHyperdriveId(binding, config)
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
187
|
+
const browserBinding = getWranglerBrowserBinding(bindings.browser);
|
|
188
|
+
if (browserBinding) {
|
|
189
|
+
result.browser = browserBinding;
|
|
190
|
+
}
|
|
191
|
+
if (bindings.analyticsEngine) {
|
|
192
|
+
result.analytics_engine_datasets = Object.entries(bindings.analyticsEngine).map(([binding, config]) => ({
|
|
193
|
+
binding,
|
|
194
|
+
dataset: config.dataset
|
|
195
|
+
}));
|
|
196
|
+
}
|
|
197
|
+
if (bindings.sendEmail) {
|
|
198
|
+
result.send_email = Object.entries(bindings.sendEmail).map(([name, config]) => ({
|
|
199
|
+
name,
|
|
200
|
+
...config.destinationAddress && {
|
|
201
|
+
destination_address: config.destinationAddress
|
|
202
|
+
},
|
|
203
|
+
...config.allowedDestinationAddresses && {
|
|
204
|
+
allowed_destination_addresses: config.allowedDestinationAddresses
|
|
205
|
+
},
|
|
206
|
+
...config.allowedSenderAddresses && {
|
|
207
|
+
allowed_sender_addresses: config.allowedSenderAddresses
|
|
208
|
+
}
|
|
209
|
+
}));
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
function stringifyConfig(config) {
|
|
213
|
+
const header = `// Generated by devflare — Do not edit directly
|
|
214
|
+
// Edit devflare.config.ts instead
|
|
215
|
+
|
|
216
|
+
`;
|
|
217
|
+
return header + JSON.stringify(config, null, "\t");
|
|
218
|
+
}
|
|
219
|
+
function rebasePathForConfigDir(projectRoot, configDir, pathValue) {
|
|
220
|
+
const absolutePath = isAbsolute(pathValue) ? pathValue : resolve(projectRoot, pathValue);
|
|
221
|
+
return relative(configDir, absolutePath).replace(/\\/g, "/");
|
|
222
|
+
}
|
|
223
|
+
function pathIsInsideDirectory(directoryPath, candidatePath) {
|
|
224
|
+
const normalizedDirectoryPath = directoryPath.replace(/\\/g, "/");
|
|
225
|
+
const normalizedCandidatePath = candidatePath.replace(/\\/g, "/");
|
|
226
|
+
return normalizedCandidatePath === normalizedDirectoryPath || normalizedCandidatePath.startsWith(`${normalizedDirectoryPath}/`);
|
|
227
|
+
}
|
|
228
|
+
function isolateViteBuildOutputPaths(projectRoot, config) {
|
|
229
|
+
const assetsDirectory = config.assets?.directory;
|
|
230
|
+
if (!assetsDirectory) {
|
|
231
|
+
return config;
|
|
232
|
+
}
|
|
233
|
+
const isolatedAssetsDirectoryPath = resolve(projectRoot, ".devflare", "vite-build-output", basename(assetsDirectory));
|
|
234
|
+
const isolatedAssetsDirectory = relative(projectRoot, isolatedAssetsDirectoryPath).replace(/\\/g, "/");
|
|
235
|
+
const isolatedConfig = {
|
|
236
|
+
...config,
|
|
237
|
+
assets: config.assets ? {
|
|
238
|
+
...config.assets,
|
|
239
|
+
directory: isolatedAssetsDirectory
|
|
240
|
+
} : config.assets
|
|
241
|
+
};
|
|
242
|
+
if (!config.main) {
|
|
243
|
+
return isolatedConfig;
|
|
244
|
+
}
|
|
245
|
+
const originalAssetsDirectoryPath = resolve(projectRoot, assetsDirectory);
|
|
246
|
+
const originalMainEntryPath = resolve(projectRoot, config.main);
|
|
247
|
+
if (!pathIsInsideDirectory(originalAssetsDirectoryPath, originalMainEntryPath)) {
|
|
248
|
+
return isolatedConfig;
|
|
249
|
+
}
|
|
250
|
+
const relativeMainEntryPath = relative(originalAssetsDirectoryPath, originalMainEntryPath);
|
|
251
|
+
const isolatedMainEntryPath = resolve(isolatedAssetsDirectoryPath, relativeMainEntryPath);
|
|
252
|
+
return {
|
|
253
|
+
...isolatedConfig,
|
|
254
|
+
main: relative(projectRoot, isolatedMainEntryPath).replace(/\\/g, "/")
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function rebaseWranglerConfigPaths(projectRoot, configDir, config) {
|
|
258
|
+
return {
|
|
259
|
+
...config,
|
|
260
|
+
...config.main ? { main: rebasePathForConfigDir(projectRoot, configDir, config.main) } : {},
|
|
261
|
+
...config.assets?.directory ? {
|
|
262
|
+
assets: {
|
|
263
|
+
...config.assets,
|
|
264
|
+
directory: rebasePathForConfigDir(projectRoot, configDir, config.assets.directory)
|
|
265
|
+
}
|
|
266
|
+
} : {}
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
async function writeWranglerConfig(cwd, config, filename = "wrangler.jsonc") {
|
|
270
|
+
const { resolve: resolve2 } = await import("pathe");
|
|
271
|
+
const fs = await import("node:fs/promises");
|
|
272
|
+
try {
|
|
273
|
+
await fs.mkdir(cwd, { recursive: true });
|
|
274
|
+
} catch {}
|
|
275
|
+
const content = stringifyConfig(config);
|
|
276
|
+
const wranglerPath = resolve2(cwd, filename);
|
|
277
|
+
await fs.writeFile(wranglerPath, content, "utf-8");
|
|
278
|
+
return wranglerPath;
|
|
279
|
+
}
|
|
280
|
+
export { compileConfig, compileToProgrammaticConfig, stringifyConfig, isolateViteBuildOutputPaths, rebaseWranglerConfigPaths, writeWranglerConfig };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadConfig,
|
|
3
|
+
resolveConfigPath
|
|
4
|
+
} from "./index-6psz1h4c.js";
|
|
5
|
+
import {
|
|
6
|
+
getEffectiveAccountId,
|
|
7
|
+
getPrimaryAccount,
|
|
8
|
+
getWorkspaceAccountId
|
|
9
|
+
} from "./index-xk9djfjp.js";
|
|
10
|
+
|
|
11
|
+
// src/cli/command-utils.ts
|
|
12
|
+
function asOptionalString(value) {
|
|
13
|
+
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
14
|
+
}
|
|
15
|
+
function resolveNamedSelection(options) {
|
|
16
|
+
if (options.explicitValue) {
|
|
17
|
+
return {
|
|
18
|
+
value: options.explicitValue,
|
|
19
|
+
source: "option"
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
if (options.fallbackValue) {
|
|
23
|
+
return {
|
|
24
|
+
value: options.fallbackValue,
|
|
25
|
+
source: "arg"
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
if (options.configuredValue) {
|
|
29
|
+
return {
|
|
30
|
+
value: options.configuredValue,
|
|
31
|
+
source: "config"
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
value: undefined,
|
|
36
|
+
source: "none"
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async function getConfiguredAccountId(cwd) {
|
|
40
|
+
const workspaceAccountId = getWorkspaceAccountId();
|
|
41
|
+
if (workspaceAccountId) {
|
|
42
|
+
return workspaceAccountId;
|
|
43
|
+
}
|
|
44
|
+
const envAccountId = process.env.CLOUDFLARE_ACCOUNT_ID?.trim();
|
|
45
|
+
if (envAccountId) {
|
|
46
|
+
return envAccountId;
|
|
47
|
+
}
|
|
48
|
+
const configPath = await resolveConfigPath(cwd);
|
|
49
|
+
if (!configPath) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
const config = await loadConfig({ cwd });
|
|
54
|
+
return config.accountId;
|
|
55
|
+
} catch {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async function resolveCloudflareAccountId(options) {
|
|
60
|
+
if (options.explicitAccountId) {
|
|
61
|
+
return options.explicitAccountId;
|
|
62
|
+
}
|
|
63
|
+
if (options.configuredAccountId) {
|
|
64
|
+
return options.configuredAccountId;
|
|
65
|
+
}
|
|
66
|
+
const primaryAccount = await getPrimaryAccount(options.apiOptions);
|
|
67
|
+
if (!primaryAccount) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const effective = await getEffectiveAccountId(primaryAccount.id);
|
|
71
|
+
return effective.accountId;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export { asOptionalString, resolveNamedSelection, getConfiguredAccountId, resolveCloudflareAccountId };
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
parseJsonMsg,
|
|
10
10
|
serializeValue,
|
|
11
11
|
stringifyJsonMsg
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-9ba1etyz.js";
|
|
13
13
|
import {
|
|
14
14
|
normalizeSendEmailMessage
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-h18pxvzs.js";
|
|
16
16
|
|
|
17
17
|
// src/bridge/server.ts
|
|
18
18
|
var server_default = {
|