devflare 1.0.0-next.31 → 1.0.0-next.33

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.
Files changed (290) hide show
  1. package/bin/devflare.js +1 -3
  2. package/dist/{account-g99mzrqp.js → account-p9eywryw.js} +27 -16
  3. package/dist/ai-r3zqmxan.js +261 -0
  4. package/dist/{api-2n6dd2ws.js → api-6z01z734.js} +1 -1
  5. package/dist/bridge/client.d.ts.map +1 -1
  6. package/dist/bridge/miniflare.d.ts.map +1 -1
  7. package/dist/bridge/proxy.d.ts.map +1 -1
  8. package/dist/bridge/server.d.ts.map +1 -1
  9. package/dist/bridge/v2/body-streams.d.ts.map +1 -1
  10. package/dist/bridge/v2/codec.d.ts.map +1 -1
  11. package/dist/bridge/v2/frames.d.ts.map +1 -1
  12. package/dist/bridge/v2/value-codec.d.ts.map +1 -1
  13. package/dist/bridge/v2/value-serialization.d.ts.map +1 -1
  14. package/dist/bridge/v2/wire.d.ts.map +1 -1
  15. package/dist/bridge/v2/ws-relay.d.ts +1 -1
  16. package/dist/bridge/v2/ws-relay.d.ts.map +1 -1
  17. package/dist/browser-shim/handler.d.ts +1 -1
  18. package/dist/browser-shim/handler.d.ts.map +1 -1
  19. package/dist/browser-shim/server.d.ts.map +1 -1
  20. package/dist/browser.d.ts.map +1 -1
  21. package/dist/browser.js +5 -5
  22. package/dist/{build-4tyjywn9.js → build-8bn7frg8.js} +16 -16
  23. package/dist/bundler/do-bundler.d.ts.map +1 -1
  24. package/dist/bundler/rolldown-shared.d.ts.map +1 -1
  25. package/dist/bundler/worker-bundler.d.ts.map +1 -1
  26. package/dist/bundler/worker-compat.d.ts.map +1 -1
  27. package/dist/cli/build-manifest.d.ts.map +1 -1
  28. package/dist/cli/command-utils.d.ts.map +1 -1
  29. package/dist/cli/commands/account.d.ts +1 -1
  30. package/dist/cli/commands/account.d.ts.map +1 -1
  31. package/dist/cli/commands/ai.d.ts.map +1 -1
  32. package/dist/cli/commands/build-artifacts.d.ts +3 -3
  33. package/dist/cli/commands/build-artifacts.d.ts.map +1 -1
  34. package/dist/cli/commands/build.d.ts +2 -2
  35. package/dist/cli/commands/build.d.ts.map +1 -1
  36. package/dist/cli/commands/config.d.ts +2 -2
  37. package/dist/cli/commands/config.d.ts.map +1 -1
  38. package/dist/cli/commands/deploy.d.ts.map +1 -1
  39. package/dist/cli/commands/dev.d.ts +1 -1
  40. package/dist/cli/commands/dev.d.ts.map +1 -1
  41. package/dist/cli/commands/doctor.d.ts +2 -2
  42. package/dist/cli/commands/doctor.d.ts.map +1 -1
  43. package/dist/cli/commands/init.d.ts +2 -2
  44. package/dist/cli/commands/init.d.ts.map +1 -1
  45. package/dist/cli/commands/login.d.ts +1 -1
  46. package/dist/cli/commands/login.d.ts.map +1 -1
  47. package/dist/cli/commands/previews-support/cleanup.d.ts.map +1 -1
  48. package/dist/cli/commands/previews-support/family.d.ts.map +1 -1
  49. package/dist/cli/commands/previews-support/render.d.ts +1 -1
  50. package/dist/cli/commands/previews-support/render.d.ts.map +1 -1
  51. package/dist/cli/commands/previews-support/theme.d.ts +1 -1
  52. package/dist/cli/commands/previews-support/theme.d.ts.map +1 -1
  53. package/dist/cli/commands/previews-support/types.d.ts +1 -1
  54. package/dist/cli/commands/previews-support/types.d.ts.map +1 -1
  55. package/dist/cli/commands/previews.d.ts.map +1 -1
  56. package/dist/cli/commands/productions.d.ts +1 -1
  57. package/dist/cli/commands/productions.d.ts.map +1 -1
  58. package/dist/cli/commands/remote.d.ts +1 -1
  59. package/dist/cli/commands/remote.d.ts.map +1 -1
  60. package/dist/cli/commands/secrets.d.ts.map +1 -1
  61. package/dist/cli/commands/token.d.ts +2 -2
  62. package/dist/cli/commands/token.d.ts.map +1 -1
  63. package/dist/cli/commands/type-generation/discovery.d.ts.map +1 -1
  64. package/dist/cli/commands/type-generation/generator.d.ts.map +1 -1
  65. package/dist/cli/commands/types.d.ts +2 -2
  66. package/dist/cli/commands/types.d.ts.map +1 -1
  67. package/dist/cli/commands/worker.d.ts +2 -2
  68. package/dist/cli/commands/worker.d.ts.map +1 -1
  69. package/dist/cli/dependencies.d.ts +1 -1
  70. package/dist/cli/dependencies.d.ts.map +1 -1
  71. package/dist/cli/deploy-strategy.d.ts.map +1 -1
  72. package/dist/cli/deploy-target.d.ts.map +1 -1
  73. package/dist/cli/generated-artifacts.d.ts.map +1 -1
  74. package/dist/cli/help-pages/pages/account.d.ts.map +1 -1
  75. package/dist/cli/help-pages/pages/core.d.ts.map +1 -1
  76. package/dist/cli/help-pages/pages/misc.d.ts.map +1 -1
  77. package/dist/cli/help-pages/pages/previews.d.ts.map +1 -1
  78. package/dist/cli/help-pages/pages/productions.d.ts.map +1 -1
  79. package/dist/cli/help-pages/render.d.ts +1 -1
  80. package/dist/cli/help-pages/render.d.ts.map +1 -1
  81. package/dist/cli/help-pages/shared.d.ts.map +1 -1
  82. package/dist/cli/help.d.ts.map +1 -1
  83. package/dist/cli/index.d.ts.map +1 -1
  84. package/dist/cli/index.js +2 -2
  85. package/dist/cli/preview-bindings.d.ts.map +1 -1
  86. package/dist/cli/preview.d.ts.map +1 -1
  87. package/dist/cli/ui.d.ts.map +1 -1
  88. package/dist/cli/workspace-build-guard.d.ts.map +1 -1
  89. package/dist/cloudflare/account-core.d.ts.map +1 -1
  90. package/dist/cloudflare/account-resources.d.ts.map +1 -1
  91. package/dist/cloudflare/account-status.d.ts.map +1 -1
  92. package/dist/cloudflare/account-workers.d.ts.map +1 -1
  93. package/dist/cloudflare/api.d.ts.map +1 -1
  94. package/dist/cloudflare/auth.d.ts.map +1 -1
  95. package/dist/cloudflare/index.d.ts +6 -6
  96. package/dist/cloudflare/index.d.ts.map +1 -1
  97. package/dist/cloudflare/index.js +6 -6
  98. package/dist/cloudflare/kv-namespace.d.ts.map +1 -1
  99. package/dist/cloudflare/preferences.d.ts.map +1 -1
  100. package/dist/cloudflare/preview-registry-cache.d.ts.map +1 -1
  101. package/dist/cloudflare/preview-registry-inference.d.ts +1 -1
  102. package/dist/cloudflare/preview-registry-inference.d.ts.map +1 -1
  103. package/dist/cloudflare/preview-registry-shape.d.ts +1 -1
  104. package/dist/cloudflare/preview-registry-shape.d.ts.map +1 -1
  105. package/dist/cloudflare/preview-registry-types.d.ts +1 -1
  106. package/dist/cloudflare/preview-registry-types.d.ts.map +1 -1
  107. package/dist/cloudflare/preview-registry.d.ts +1 -1
  108. package/dist/cloudflare/preview-registry.d.ts.map +1 -1
  109. package/dist/cloudflare/preview-urls.d.ts.map +1 -1
  110. package/dist/cloudflare/registry-schema.d.ts.map +1 -1
  111. package/dist/cloudflare/remote-config.d.ts.map +1 -1
  112. package/dist/cloudflare/tokens.d.ts.map +1 -1
  113. package/dist/cloudflare/usage.d.ts.map +1 -1
  114. package/dist/config/binding-resolution-helpers.d.ts.map +1 -1
  115. package/dist/config/define.d.ts +1 -1
  116. package/dist/config/define.d.ts.map +1 -1
  117. package/dist/config/deploy-resources.d.ts +2 -2
  118. package/dist/config/deploy-resources.d.ts.map +1 -1
  119. package/dist/config/env-vars.d.ts.map +1 -1
  120. package/dist/config/framework-providers.d.ts.map +1 -1
  121. package/dist/config/loader.d.ts.map +1 -1
  122. package/dist/config/preview-resources.d.ts.map +1 -1
  123. package/dist/config/preview.d.ts +1 -3
  124. package/dist/config/preview.d.ts.map +1 -1
  125. package/dist/config/ref.d.ts +1 -1
  126. package/dist/config/ref.d.ts.map +1 -1
  127. package/dist/config/resolve-phased.d.ts.map +1 -1
  128. package/dist/config/resource-resolution.d.ts +3 -3
  129. package/dist/config/resource-resolution.d.ts.map +1 -1
  130. package/dist/config/schema-bindings.d.ts.map +1 -1
  131. package/dist/config/schema-build.d.ts.map +1 -1
  132. package/dist/config/schema-env.d.ts.map +1 -1
  133. package/dist/config/schema-normalization.d.ts +1 -1
  134. package/dist/config/schema-normalization.d.ts.map +1 -1
  135. package/dist/config/schema-runtime.d.ts.map +1 -1
  136. package/dist/config/schema-types-bindings-resources.d.ts +1 -2
  137. package/dist/config/schema-types-bindings-resources.d.ts.map +1 -1
  138. package/dist/config/schema-types-bindings.d.ts +1 -1
  139. package/dist/config/schema-types-bindings.d.ts.map +1 -1
  140. package/dist/config/schema-types-runtime.d.ts +2 -2
  141. package/dist/config/schema-types-runtime.d.ts.map +1 -1
  142. package/dist/config/schema-types.d.ts +1 -1
  143. package/dist/config/schema-types.d.ts.map +1 -1
  144. package/dist/config/schema.d.ts.map +1 -1
  145. package/dist/config/service-bindings-validation.d.ts.map +1 -1
  146. package/dist/config-entry.js +2 -2
  147. package/dist/{config-88sdhx3w.js → config-gphd6wx7.js} +6 -6
  148. package/dist/decorators/durable-object.d.ts.map +1 -1
  149. package/dist/decorators/index.js +1 -1
  150. package/dist/{deploy-8fpav2cw.js → deploy-vpcp41fw.js} +19 -19
  151. package/dist/{dev-nxevkfdv.js → dev-9scy9gap.js} +251 -255
  152. package/dist/dev-server/d1-migrations.d.ts.map +1 -1
  153. package/dist/dev-server/dev-server-state.d.ts +2 -2
  154. package/dist/dev-server/dev-server-state.d.ts.map +1 -1
  155. package/dist/dev-server/gateway-script.d.ts.map +1 -1
  156. package/dist/dev-server/miniflare-bindings.d.ts.map +1 -1
  157. package/dist/dev-server/miniflare-dev-config.d.ts +2 -2
  158. package/dist/dev-server/miniflare-dev-config.d.ts.map +1 -1
  159. package/dist/dev-server/miniflare-log.d.ts.map +1 -1
  160. package/dist/dev-server/miniflare-worker-config.d.ts +1 -1
  161. package/dist/dev-server/miniflare-worker-config.d.ts.map +1 -1
  162. package/dist/dev-server/server-startup-helpers.d.ts +2 -2
  163. package/dist/dev-server/server-startup-helpers.d.ts.map +1 -1
  164. package/dist/dev-server/server.d.ts.map +1 -1
  165. package/dist/dev-server/vite-process.d.ts.map +1 -1
  166. package/dist/dev-server/vite-utils.d.ts.map +1 -1
  167. package/dist/dev-server/worker-source-watcher.d.ts.map +1 -1
  168. package/dist/dev-server/worker-surface-paths.d.ts +1 -1
  169. package/dist/dev-server/worker-surface-paths.d.ts.map +1 -1
  170. package/dist/{doctor-ztwx1y95.js → doctor-swfeeqny.js} +12 -12
  171. package/dist/{durable-object-v3gsnybk.js → durable-object-pf6gabpn.js} +1 -1
  172. package/dist/env.d.ts.map +1 -1
  173. package/dist/{index-mg8vwqxf.js → index-04wh9bxx.js} +2 -2
  174. package/dist/{index-fcmj6641.js → index-13sfensw.js} +1 -1
  175. package/dist/{index-6sj0v0dk.js → index-1trss579.js} +1373 -1358
  176. package/dist/{index-3jme4hgw.js → index-2xz4etye.js} +25 -33
  177. package/dist/{index-q8f4kawk.js → index-34dejneh.js} +12 -2
  178. package/dist/{index-rzp9ejrh.js → index-3t0e51a0.js} +1 -1
  179. package/dist/{index-ptwem1nt.js → index-3z20d3kd.js} +160 -208
  180. package/dist/{index-d8bdkx2h.js → index-4xmtkg9g.js} +2 -2
  181. package/dist/{index-qwgr4q7s.js → index-5dkjffqz.js} +2 -14
  182. package/dist/{index-aqrwyy57.js → index-7m557715.js} +2 -7
  183. package/dist/{index-85yjb686.js → index-97rfy7n2.js} +1 -1
  184. package/dist/{index-11p28kxx.js → index-atwc3csp.js} +1 -1
  185. package/dist/{index-ft3trvra.js → index-b20xx2vk.js} +5 -19
  186. package/dist/{index-s3km3y34.js → index-bhxj7ff6.js} +234 -219
  187. package/dist/{index-3edvz3hs.js → index-by27mzra.js} +4 -4
  188. package/dist/{index-t9y0sve5.js → index-c4zd39tc.js} +1 -1
  189. package/dist/{index-69c0ed4a.js → index-dem45895.js} +6 -11
  190. package/dist/{index-k9x5v335.js → index-dgx495pv.js} +30 -27
  191. package/dist/{index-7qd7nmdd.js → index-e7xn30bh.js} +2 -2
  192. package/dist/{index-1d4jg11n.js → index-h7r11y4a.js} +5 -8
  193. package/dist/{index-vez803pp.js → index-ksqth51q.js} +2 -2
  194. package/dist/{index-stgn34cr.js → index-maw0jjnn.js} +0 -1
  195. package/dist/{index-hpwa6vsw.js → index-n4xkaymm.js} +1 -4
  196. package/dist/{index-dfcp9hsd.js → index-pd97hk2j.js} +64 -72
  197. package/dist/{index-67gr49zr.js → index-pmnb7eke.js} +3 -3
  198. package/dist/{index-xz18tstn.js → index-t0r7evpw.js} +9 -9
  199. package/dist/{index-qz6nbwpw.js → index-t23wq5js.js} +1 -1
  200. package/dist/{index-hjjfxv02.js → index-w8c8tjc5.js} +1 -1
  201. package/dist/{index-c8p4njqy.js → index-wxdcrzcp.js} +1 -5
  202. package/dist/{index-15fpa5tx.js → index-x0wpeb3x.js} +2 -2
  203. package/dist/{index-qmmqww7h.js → index-x2fd1361.js} +5 -5
  204. package/dist/{index-a855bdsx.js → index-y7w3x9p1.js} +1 -1
  205. package/dist/{index-gn5wy09x.js → index-zdd0d9qa.js} +3 -9
  206. package/dist/index.js +12 -12
  207. package/dist/{init-cwpergap.js → init-tb8jqgvr.js} +2 -2
  208. package/dist/{login-r5ve73kf.js → login-7vyzeqy4.js} +10 -10
  209. package/dist/{previews-qjj98rpp.js → previews-jfbectpc.js} +25 -22
  210. package/dist/{productions-gzdtge0e.js → productions-49ct4kjm.js} +21 -18
  211. package/dist/{remote-q59qk463.js → remote-6876k6mz.js} +3 -3
  212. package/dist/runtime/context-events.d.ts.map +1 -1
  213. package/dist/runtime/context-types.d.ts.map +1 -1
  214. package/dist/runtime/context.d.ts.map +1 -1
  215. package/dist/runtime/exports.d.ts +21 -21
  216. package/dist/runtime/exports.d.ts.map +1 -1
  217. package/dist/runtime/index.js +5 -5
  218. package/dist/runtime/middleware.d.ts.map +1 -1
  219. package/dist/runtime/router/index.d.ts +1 -1
  220. package/dist/runtime/router/index.d.ts.map +1 -1
  221. package/dist/runtime/router/types.d.ts.map +1 -1
  222. package/dist/secrets/local-secrets.d.ts.map +1 -1
  223. package/dist/{secrets-4w5166km.js → secrets-9ne7armr.js} +7 -7
  224. package/dist/shims/local-hyperdrive.d.ts.map +1 -1
  225. package/dist/shims/local-media-bindings.d.ts.map +1 -1
  226. package/dist/shims/local-worker-loader.d.ts.map +1 -1
  227. package/dist/sveltekit/index.d.ts.map +1 -1
  228. package/dist/sveltekit/index.js +12 -15
  229. package/dist/sveltekit/local-bindings.d.ts.map +1 -1
  230. package/dist/sveltekit/platform.d.ts.map +1 -1
  231. package/dist/test/binding-hints.d.ts +1 -1
  232. package/dist/test/binding-hints.d.ts.map +1 -1
  233. package/dist/test/cf.d.ts +1 -1
  234. package/dist/test/containers.d.ts.map +1 -1
  235. package/dist/test/email.d.ts +4 -4
  236. package/dist/test/email.d.ts.map +1 -1
  237. package/dist/test/index.js +1404 -1402
  238. package/dist/test/offline-bindings.d.ts.map +1 -1
  239. package/dist/test/queue.d.ts.map +1 -1
  240. package/dist/test/remote-ai.d.ts.map +1 -1
  241. package/dist/test/remote-cloudflare.d.ts.map +1 -1
  242. package/dist/test/remote-vectorize.d.ts.map +1 -1
  243. package/dist/test/resolve-service-bindings.d.ts.map +1 -1
  244. package/dist/test/scheduled.d.ts.map +1 -1
  245. package/dist/test/simple-context-bindings.d.ts.map +1 -1
  246. package/dist/test/simple-context-durable-objects.d.ts.map +1 -1
  247. package/dist/test/simple-context-env.d.ts.map +1 -1
  248. package/dist/test/simple-context-handlers.d.ts.map +1 -1
  249. package/dist/test/simple-context-lifecycle.d.ts +1 -1
  250. package/dist/test/simple-context-lifecycle.d.ts.map +1 -1
  251. package/dist/test/simple-context-mfconfig.d.ts.map +1 -1
  252. package/dist/test/simple-context-multi-worker.d.ts +1 -1
  253. package/dist/test/simple-context-multi-worker.d.ts.map +1 -1
  254. package/dist/test/simple-context-paths.d.ts.map +1 -1
  255. package/dist/test/simple-context-runtime.d.ts.map +1 -1
  256. package/dist/test/simple-context-startup.d.ts.map +1 -1
  257. package/dist/test/simple-context.d.ts.map +1 -1
  258. package/dist/test/tail.d.ts +1 -1
  259. package/dist/test/tail.d.ts.map +1 -1
  260. package/dist/test/utilities/env.d.ts.map +1 -1
  261. package/dist/test/worker.d.ts.map +1 -1
  262. package/dist/{token-35jcdqq8.js → token-yp1qa70y.js} +4 -4
  263. package/dist/transform/durable-object.d.ts.map +1 -1
  264. package/dist/transform/worker-entrypoint.d.ts.map +1 -1
  265. package/dist/{types-6vc02evc.js → types-zekmbebk.js} +16 -18
  266. package/dist/utils/glob.d.ts.map +1 -1
  267. package/dist/utils/resolve-package.d.ts.map +1 -1
  268. package/dist/utils/send-email.d.ts.map +1 -1
  269. package/dist/utils/send-email.js +1 -1
  270. package/dist/vite/config-file.d.ts +1 -1
  271. package/dist/vite/config-file.d.ts.map +1 -1
  272. package/dist/vite/index.js +12 -12
  273. package/dist/vite/plugin-config-hook.d.ts.map +1 -1
  274. package/dist/vite/plugin-context.d.ts.map +1 -1
  275. package/dist/vite/plugin-durable-objects.d.ts +1 -1
  276. package/dist/vite/plugin-durable-objects.d.ts.map +1 -1
  277. package/dist/vite/plugin-programmatic.d.ts.map +1 -1
  278. package/dist/vite/plugin-service-bindings.d.ts.map +1 -1
  279. package/dist/vite/plugin-transform.d.ts.map +1 -1
  280. package/dist/vite/plugin.d.ts.map +1 -1
  281. package/dist/{worker-f2v85f7d.js → worker-706g8qeh.js} +14 -14
  282. package/dist/worker-entry/composed-worker.d.ts.map +1 -1
  283. package/dist/worker-entry/extensions.d.ts.map +1 -1
  284. package/dist/worker-entry/routes.d.ts.map +1 -1
  285. package/dist/worker-entry/surface-paths.d.ts.map +1 -1
  286. package/dist/{worker-entrypoint-3rmzd4c1.js → worker-entrypoint-y8s9kdcx.js} +1 -1
  287. package/dist/workflows/local-workflow-entrypoints.d.ts.map +1 -1
  288. package/package.json +2 -1
  289. package/dist/ai-dx4fr9jh.js +0 -107
  290. package/dist/{index-vhqww6tt.js → index-p93cngdp.js} +1 -1
@@ -9,13 +9,7 @@ async function findFiles(pattern, options) {
9
9
  cwd,
10
10
  absolute,
11
11
  gitignore,
12
- ignore: [
13
- "**/node_modules/**",
14
- "**/.devflare/**",
15
- "**/dist/**",
16
- "**/build/**",
17
- "**/.git/**"
18
- ]
12
+ ignore: ["**/node_modules/**", "**/.devflare/**", "**/dist/**", "**/build/**", "**/.git/**"]
19
13
  });
20
14
  }
21
15
  function findFilesSync(pattern, options) {
@@ -24,13 +18,7 @@ function findFilesSync(pattern, options) {
24
18
  cwd,
25
19
  absolute,
26
20
  gitignore,
27
- ignore: [
28
- "**/node_modules/**",
29
- "**/.devflare/**",
30
- "**/dist/**",
31
- "**/build/**",
32
- "**/.git/**"
33
- ]
21
+ ignore: ["**/node_modules/**", "**/.devflare/**", "**/dist/**", "**/build/**", "**/.git/**"]
34
22
  });
35
23
  }
36
24
 
@@ -1,6 +1,6 @@
1
1
  // src/transform/worker-entrypoint.ts
2
- import ts from "typescript";
3
2
  import MagicString from "magic-string";
3
+ import ts from "typescript";
4
4
 
5
5
  // src/worker-entry/extensions.ts
6
6
  var SUPPORTED_WORKER_EXTENSIONS = [
@@ -13,12 +13,7 @@ var SUPPORTED_WORKER_EXTENSIONS = [
13
13
  ".js",
14
14
  ".jsx"
15
15
  ];
16
- var TS_WORKER_EXTENSIONS = [
17
- ".ts",
18
- ".tsx",
19
- ".mts",
20
- ".cts"
21
- ];
16
+ var TS_WORKER_EXTENSIONS = [".ts", ".tsx", ".mts", ".cts"];
22
17
 
23
18
  // src/transform/worker-entrypoint.ts
24
19
  function findExportedFunctions(code) {
@@ -3,7 +3,7 @@ import {
3
3
  createFetchEvent,
4
4
  getContextOrNull,
5
5
  runWithEventContext
6
- } from "./index-6sj0v0dk.js";
6
+ } from "./index-1trss579.js";
7
7
 
8
8
  // src/runtime/exports.ts
9
9
  function createReadonlyProxy(getter, name) {
@@ -3,7 +3,7 @@ import {
3
3
  apiGetAll,
4
4
  apiPost,
5
5
  apiPut
6
- } from "./index-mg8vwqxf.js";
6
+ } from "./index-04wh9bxx.js";
7
7
 
8
8
  // src/cloudflare/known-permission-group-ids.generated.ts
9
9
  var KNOWN_PERMISSION_GROUP_IDS_DATA = {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  mergeConfigForEnvironment
3
- } from "./index-dfcp9hsd.js";
3
+ } from "./index-pd97hk2j.js";
4
4
  import {
5
5
  createD1Database,
6
6
  createKVNamespace,
@@ -21,12 +21,12 @@ import {
21
21
  listQueues,
22
22
  listR2Buckets,
23
23
  listVectorizeIndexes
24
- } from "./index-1d4jg11n.js";
24
+ } from "./index-h7r11y4a.js";
25
25
  import {
26
26
  isPreviewScopedName,
27
27
  materializePreviewScopedConfig,
28
28
  materializePreviewScopedString
29
- } from "./index-c8p4njqy.js";
29
+ } from "./index-wxdcrzcp.js";
30
30
 
31
31
  // src/config/preview-resources.ts
32
32
  var defaultPreviewScopedResourceLifecycleApi = {
@@ -284,14 +284,7 @@ async function preparePreviewScopedResourcesForDeploy(config, options = {}) {
284
284
  }
285
285
  const cloudflareApi = resolvePreviewScopedResourceLifecycleApi(options.cloudflare);
286
286
  const accountId = await resolveLifecycleAccountId(config, options, cloudflareApi);
287
- const {
288
- namespaces,
289
- databases,
290
- buckets,
291
- queues,
292
- vectorizeIndexes,
293
- hyperdrives
294
- } = await loadPreviewScopedResourceLifecycleState(accountId, plan, cloudflareApi);
287
+ const { namespaces, databases, buckets, queues, vectorizeIndexes, hyperdrives } = await loadPreviewScopedResourceLifecycleState(accountId, plan, cloudflareApi);
295
288
  for (const ref of plan.kv) {
296
289
  if (findKVNamespaceByName(namespaces, ref.previewName)) {
297
290
  existing.kv.push(ref.previewName);
@@ -395,14 +388,7 @@ async function cleanupPreviewScopedResources(config, options = {}) {
395
388
  const cloudflareApi = resolvePreviewScopedResourceLifecycleApi(options.cloudflare);
396
389
  const accountId = await resolveLifecycleAccountId(config, options, cloudflareApi);
397
390
  const apply = options.apply === true;
398
- const {
399
- namespaces,
400
- databases,
401
- buckets,
402
- queues,
403
- vectorizeIndexes,
404
- hyperdrives
405
- } = await loadPreviewScopedResourceLifecycleState(accountId, plan, cloudflareApi);
391
+ const { namespaces, databases, buckets, queues, vectorizeIndexes, hyperdrives } = await loadPreviewScopedResourceLifecycleState(accountId, plan, cloudflareApi);
406
392
  const kvCandidates = plan.kv.map((ref) => findKVNamespaceByName(namespaces, ref.previewName)).filter((namespace) => namespace !== undefined);
407
393
  for (const namespace of kvCandidates) {
408
394
  candidates.kv.push(namespace.name);
@@ -3,13 +3,13 @@ import {
3
3
  discoverDurableObjects,
4
4
  discoverRoutes,
5
5
  resolveServiceBindings
6
- } from "./index-k9x5v335.js";
6
+ } from "./index-dgx495pv.js";
7
7
  import {
8
8
  DEFAULT_DO_PATTERN
9
- } from "./index-qwgr4q7s.js";
9
+ } from "./index-5dkjffqz.js";
10
10
  import {
11
11
  SUPPORTED_WORKER_EXTENSIONS
12
- } from "./index-aqrwyy57.js";
12
+ } from "./index-7m557715.js";
13
13
  import {
14
14
  compileBuildConfig,
15
15
  compileConfig,
@@ -17,7 +17,7 @@ import {
17
17
  isolateViteBuildOutputPaths,
18
18
  rebaseWranglerConfigPaths,
19
19
  writeWranglerConfig
20
- } from "./index-hjjfxv02.js";
20
+ } from "./index-w8c8tjc5.js";
21
21
  import {
22
22
  loadConfig,
23
23
  loadResolvedConfig,
@@ -25,10 +25,10 @@ import {
25
25
  resolveConfigForEnvironment,
26
26
  resolveConfigPath,
27
27
  resolveResources
28
- } from "./index-dfcp9hsd.js";
28
+ } from "./index-pd97hk2j.js";
29
29
  import {
30
30
  resolveConfigEnvVars
31
- } from "./index-c8p4njqy.js";
31
+ } from "./index-wxdcrzcp.js";
32
32
  import {
33
33
  __require
34
34
  } from "./index-37x76zdn.js";
@@ -36,154 +36,67 @@ import {
36
36
  // src/vite/plugin.ts
37
37
  import { dirname as dirname2, resolve as resolve4 } from "pathe";
38
38
 
39
- // src/vite/plugin-durable-objects.ts
40
- var VIRTUAL_DO_ENTRY = "virtual:devflare-do-entry";
41
- var RESOLVED_VIRTUAL_DO_ENTRY = "\x00" + VIRTUAL_DO_ENTRY;
42
- function generateVirtualDOEntry(discovery) {
43
- const lines = [
44
- "// Auto-generated by devflare — DO entry module",
45
- "// Re-exports all Durable Object classes discovered from files.durableObjects pattern",
46
- ""
47
- ];
48
- for (const [filePath, classNames] of discovery.files) {
49
- const normalizedPath = filePath.replace(/\\/g, "/");
50
- lines.push(`export { ${classNames.join(", ")} } from '${normalizedPath}'`);
39
+ // src/vite/plugin-config-hook.ts
40
+ async function tryLoadDevflareConfig(cwd, configPath, command) {
41
+ try {
42
+ return await loadConfig({ cwd, configFile: configPath });
43
+ } catch (error) {
44
+ if (command === "build") {
45
+ console.warn("[devflare] Could not load config:", error);
46
+ }
47
+ return null;
51
48
  }
52
- lines.push("");
53
- lines.push("// Default fetch handler for DO worker");
54
- lines.push("export default {");
55
- lines.push("\tasync fetch(request: Request): Promise<Response> {");
56
- lines.push('\t\treturn new Response("Devflare DO Worker", { status: 200 })');
57
- lines.push("\t}");
58
- lines.push("}");
59
- return lines.join(`
60
- `);
61
49
  }
62
- function createAuxiliaryWorkerConfig(wranglerConfig, discovery) {
63
- const doBindings = wranglerConfig.durable_objects?.bindings?.map((binding) => ({
64
- name: binding.name,
65
- class_name: binding.class_name
66
- })) ?? [];
50
+ function buildWorkerNameDefine(lfConfig, existing) {
51
+ const workerNameValue = lfConfig.name ?? "unknown";
67
52
  return {
68
- config: {
69
- name: discovery.workerName,
70
- main: VIRTUAL_DO_ENTRY,
71
- compatibility_date: wranglerConfig.compatibility_date,
72
- compatibility_flags: wranglerConfig.compatibility_flags,
73
- durable_objects: { bindings: doBindings },
74
- migrations: wranglerConfig.migrations,
75
- kv_namespaces: wranglerConfig.kv_namespaces,
76
- d1_databases: wranglerConfig.d1_databases,
77
- r2_buckets: wranglerConfig.r2_buckets,
78
- browser: wranglerConfig.browser
79
- }
53
+ ...existing,
54
+ __DEVFLARE_WORKER_NAME__: JSON.stringify(workerNameValue)
80
55
  };
81
56
  }
82
- function logDiscoveredDurableObjects(projectRoot, discovery) {
83
- if (!discovery || discovery.files.size === 0) {
84
- return;
57
+ function buildWebSocketProxyConfig(lfConfig, bridgePort, wsProxyPatterns) {
58
+ const patterns = [...wsProxyPatterns];
59
+ if (lfConfig.wsRoutes && lfConfig.wsRoutes.length > 0) {
60
+ for (const route of lfConfig.wsRoutes) {
61
+ if (!patterns.includes(route.pattern)) {
62
+ patterns.push(route.pattern);
63
+ }
64
+ }
85
65
  }
86
- console.log(`[devflare] Discovered ${discovery.files.size} DO file(s):`);
87
- for (const [filePath, classes] of discovery.files) {
88
- console.log(` ${filePath.replace(projectRoot, ".")} → ${classes.join(", ")}`);
66
+ if (patterns.length === 0)
67
+ return null;
68
+ const proxyConfig = {};
69
+ for (const pattern of patterns) {
70
+ proxyConfig[pattern] = {
71
+ target: `http://127.0.0.1:${bridgePort}`,
72
+ changeOrigin: true,
73
+ ws: true,
74
+ configure: (proxy) => {
75
+ proxy.on("error", (err) => {
76
+ console.error(`[devflare] Proxy error: ${err.message}`);
77
+ });
78
+ }
79
+ };
89
80
  }
81
+ if (Object.keys(proxyConfig).length === 0)
82
+ return null;
83
+ console.log(`[devflare] WebSocket proxy configured for: ${patterns.join(", ")}`);
84
+ return proxyConfig;
90
85
  }
91
-
92
- // src/vite/plugin-service-bindings.ts
93
- var VIRTUAL_SERVICE_WORKER_PREFIX = "virtual:devflare-service-worker/";
94
- var RESOLVED_VIRTUAL_SERVICE_WORKER_PREFIX = "\x00" + VIRTUAL_SERVICE_WORKER_PREFIX;
95
- function virtualServiceWorkerId(workerName) {
96
- return `${VIRTUAL_SERVICE_WORKER_PREFIX}${encodeURIComponent(workerName)}`;
97
- }
98
- function resolvedVirtualServiceWorkerId(workerName) {
99
- return `${RESOLVED_VIRTUAL_SERVICE_WORKER_PREFIX}${encodeURIComponent(workerName)}`;
100
- }
101
- function objectEntries(record) {
102
- return record ? Object.entries(record) : [];
103
- }
104
- function toWranglerDurableObjectBinding(name, value) {
105
- if (typeof value === "string") {
106
- return { name, class_name: value };
86
+ async function buildPluginConfigHookResult(cwd, options, command, existingDefine) {
87
+ const lfConfig = await tryLoadDevflareConfig(cwd, options.configPath, command);
88
+ const returnConfig = {};
89
+ if (lfConfig) {
90
+ returnConfig.define = buildWorkerNameDefine(lfConfig, existingDefine);
107
91
  }
108
- return {
109
- name,
110
- class_name: value.className,
111
- script_name: value.scriptName
112
- };
113
- }
114
- function toWranglerWorkerConfig(worker) {
115
- const queueProducers = worker.queueProducers ? objectEntries(worker.queueProducers).map(([binding, producer]) => ({
116
- binding,
117
- queue: producer.queueName
118
- })) : undefined;
119
- const queueConsumers = worker.queueConsumers ? objectEntries(worker.queueConsumers).map(([queue, consumer]) => ({
120
- queue,
121
- ...consumer.maxBatchSize !== undefined && { max_batch_size: consumer.maxBatchSize },
122
- ...consumer.maxBatchTimeout !== undefined && { max_batch_timeout: consumer.maxBatchTimeout },
123
- ...consumer.maxRetries !== undefined && { max_retries: consumer.maxRetries },
124
- ...typeof consumer.deadLetterQueue === "string" && { dead_letter_queue: consumer.deadLetterQueue },
125
- ...consumer.maxConcurrency !== undefined && { max_concurrency: consumer.maxConcurrency },
126
- ...consumer.retryDelay !== undefined && { retry_delay: consumer.retryDelay }
127
- })) : undefined;
128
- const queues = queueProducers || queueConsumers ? {
129
- ...queueProducers && { producers: queueProducers },
130
- ...queueConsumers && { consumers: queueConsumers }
131
- } : undefined;
132
- const durableObjectBindings = worker.durableObjects ? objectEntries(worker.durableObjects).map(([name, value]) => toWranglerDurableObjectBinding(name, value)) : [];
133
- const serviceBindings = worker.serviceBindings ? objectEntries(worker.serviceBindings).map(([binding, target]) => ({
134
- binding,
135
- service: target.name,
136
- ...target.entrypoint && { entrypoint: target.entrypoint }
137
- })) : [];
138
- const config = {
139
- name: worker.name,
140
- main: virtualServiceWorkerId(worker.name),
141
- compatibility_date: worker.compatibilityDate,
142
- ...worker.compatibilityFlags && { compatibility_flags: worker.compatibilityFlags },
143
- ...worker.bindings && { vars: worker.bindings },
144
- ...worker.kvNamespaces && {
145
- kv_namespaces: objectEntries(worker.kvNamespaces).map(([binding, id]) => ({
146
- binding,
147
- id
148
- }))
149
- },
150
- ...worker.r2Buckets && {
151
- r2_buckets: objectEntries(worker.r2Buckets).map(([binding, bucket_name]) => ({
152
- binding,
153
- bucket_name
154
- }))
155
- },
156
- ...worker.d1Databases && {
157
- d1_databases: objectEntries(worker.d1Databases).map(([binding, database_id]) => ({
158
- binding,
159
- database_id,
160
- database_name: database_id
161
- }))
162
- },
163
- ...durableObjectBindings.length > 0 && {
164
- durable_objects: {
165
- bindings: durableObjectBindings
166
- }
167
- },
168
- ...serviceBindings.length > 0 && {
169
- services: serviceBindings
170
- },
171
- ...queues && { queues }
172
- };
173
- return config;
174
- }
175
- function createAuxiliaryServiceWorkerConfigs(resolution) {
176
- if (!resolution || resolution.workers.length === 0) {
177
- return { auxiliaryWorkers: [], virtualModules: new Map };
92
+ if (command === "serve" && process.env.DEVFLARE_DEV && lfConfig) {
93
+ const port = options.bridgePort ?? 8787;
94
+ const proxyConfig = buildWebSocketProxyConfig(lfConfig, port, options.wsProxyPatterns);
95
+ if (proxyConfig) {
96
+ returnConfig.server = { proxy: proxyConfig };
97
+ }
178
98
  }
179
- const virtualModules = new Map;
180
- const auxiliaryWorkers = resolution.workers.map((worker) => {
181
- virtualModules.set(resolvedVirtualServiceWorkerId(worker.name), worker.script);
182
- return {
183
- config: toWranglerWorkerConfig(worker)
184
- };
185
- });
186
- return { auxiliaryWorkers, virtualModules };
99
+ return Object.keys(returnConfig).length > 0 ? returnConfig : undefined;
187
100
  }
188
101
 
189
102
  // src/vite/plugin-context.ts
@@ -254,9 +167,7 @@ or move the handler to a source file that exists at config time.`);
254
167
  try {
255
168
  await fs.access(absolutePath);
256
169
  return absolutePath;
257
- } catch {
258
- continue;
259
- }
170
+ } catch {}
260
171
  }
261
172
  return null;
262
173
  }
@@ -687,6 +598,164 @@ async function prepareComposedWorkerEntrypoint(cwd, config, environment, options
687
598
  return entryPath;
688
599
  }
689
600
 
601
+ // src/vite/plugin-durable-objects.ts
602
+ var VIRTUAL_DO_ENTRY = "virtual:devflare-do-entry";
603
+ var RESOLVED_VIRTUAL_DO_ENTRY = "\x00" + VIRTUAL_DO_ENTRY;
604
+ function generateVirtualDOEntry(discovery) {
605
+ const lines = [
606
+ "// Auto-generated by devflare — DO entry module",
607
+ "// Re-exports all Durable Object classes discovered from files.durableObjects pattern",
608
+ ""
609
+ ];
610
+ for (const [filePath, classNames] of discovery.files) {
611
+ const normalizedPath = filePath.replace(/\\/g, "/");
612
+ lines.push(`export { ${classNames.join(", ")} } from '${normalizedPath}'`);
613
+ }
614
+ lines.push("");
615
+ lines.push("// Default fetch handler for DO worker");
616
+ lines.push("export default {");
617
+ lines.push("\tasync fetch(request: Request): Promise<Response> {");
618
+ lines.push('\t\treturn new Response("Devflare DO Worker", { status: 200 })');
619
+ lines.push("\t}");
620
+ lines.push("}");
621
+ return lines.join(`
622
+ `);
623
+ }
624
+ function createAuxiliaryWorkerConfig(wranglerConfig, discovery) {
625
+ const doBindings = wranglerConfig.durable_objects?.bindings?.map((binding) => ({
626
+ name: binding.name,
627
+ class_name: binding.class_name
628
+ })) ?? [];
629
+ return {
630
+ config: {
631
+ name: discovery.workerName,
632
+ main: VIRTUAL_DO_ENTRY,
633
+ compatibility_date: wranglerConfig.compatibility_date,
634
+ compatibility_flags: wranglerConfig.compatibility_flags,
635
+ durable_objects: { bindings: doBindings },
636
+ migrations: wranglerConfig.migrations,
637
+ kv_namespaces: wranglerConfig.kv_namespaces,
638
+ d1_databases: wranglerConfig.d1_databases,
639
+ r2_buckets: wranglerConfig.r2_buckets,
640
+ browser: wranglerConfig.browser
641
+ }
642
+ };
643
+ }
644
+ function logDiscoveredDurableObjects(projectRoot, discovery) {
645
+ if (!discovery || discovery.files.size === 0) {
646
+ return;
647
+ }
648
+ console.log(`[devflare] Discovered ${discovery.files.size} DO file(s):`);
649
+ for (const [filePath, classes] of discovery.files) {
650
+ console.log(` • ${filePath.replace(projectRoot, ".")} → ${classes.join(", ")}`);
651
+ }
652
+ }
653
+
654
+ // src/vite/plugin-service-bindings.ts
655
+ var VIRTUAL_SERVICE_WORKER_PREFIX = "virtual:devflare-service-worker/";
656
+ var RESOLVED_VIRTUAL_SERVICE_WORKER_PREFIX = "\x00" + VIRTUAL_SERVICE_WORKER_PREFIX;
657
+ function virtualServiceWorkerId(workerName) {
658
+ return `${VIRTUAL_SERVICE_WORKER_PREFIX}${encodeURIComponent(workerName)}`;
659
+ }
660
+ function resolvedVirtualServiceWorkerId(workerName) {
661
+ return `${RESOLVED_VIRTUAL_SERVICE_WORKER_PREFIX}${encodeURIComponent(workerName)}`;
662
+ }
663
+ function objectEntries(record) {
664
+ return record ? Object.entries(record) : [];
665
+ }
666
+ function toWranglerDurableObjectBinding(name, value) {
667
+ if (typeof value === "string") {
668
+ return { name, class_name: value };
669
+ }
670
+ return {
671
+ name,
672
+ class_name: value.className,
673
+ script_name: value.scriptName
674
+ };
675
+ }
676
+ function toWranglerWorkerConfig(worker) {
677
+ const queueProducers = worker.queueProducers ? objectEntries(worker.queueProducers).map(([binding, producer]) => ({
678
+ binding,
679
+ queue: producer.queueName
680
+ })) : undefined;
681
+ const queueConsumers = worker.queueConsumers ? objectEntries(worker.queueConsumers).map(([queue, consumer]) => ({
682
+ queue,
683
+ ...consumer.maxBatchSize !== undefined && {
684
+ max_batch_size: consumer.maxBatchSize
685
+ },
686
+ ...consumer.maxBatchTimeout !== undefined && {
687
+ max_batch_timeout: consumer.maxBatchTimeout
688
+ },
689
+ ...consumer.maxRetries !== undefined && { max_retries: consumer.maxRetries },
690
+ ...typeof consumer.deadLetterQueue === "string" && {
691
+ dead_letter_queue: consumer.deadLetterQueue
692
+ },
693
+ ...consumer.maxConcurrency !== undefined && {
694
+ max_concurrency: consumer.maxConcurrency
695
+ },
696
+ ...consumer.retryDelay !== undefined && { retry_delay: consumer.retryDelay }
697
+ })) : undefined;
698
+ const queues = queueProducers || queueConsumers ? {
699
+ ...queueProducers && { producers: queueProducers },
700
+ ...queueConsumers && { consumers: queueConsumers }
701
+ } : undefined;
702
+ const durableObjectBindings = worker.durableObjects ? objectEntries(worker.durableObjects).map(([name, value]) => toWranglerDurableObjectBinding(name, value)) : [];
703
+ const serviceBindings = worker.serviceBindings ? objectEntries(worker.serviceBindings).map(([binding, target]) => ({
704
+ binding,
705
+ service: target.name,
706
+ ...target.entrypoint && { entrypoint: target.entrypoint }
707
+ })) : [];
708
+ const config = {
709
+ name: worker.name,
710
+ main: virtualServiceWorkerId(worker.name),
711
+ compatibility_date: worker.compatibilityDate,
712
+ ...worker.compatibilityFlags && { compatibility_flags: worker.compatibilityFlags },
713
+ ...worker.bindings && { vars: worker.bindings },
714
+ ...worker.kvNamespaces && {
715
+ kv_namespaces: objectEntries(worker.kvNamespaces).map(([binding, id]) => ({
716
+ binding,
717
+ id
718
+ }))
719
+ },
720
+ ...worker.r2Buckets && {
721
+ r2_buckets: objectEntries(worker.r2Buckets).map(([binding, bucket_name]) => ({
722
+ binding,
723
+ bucket_name
724
+ }))
725
+ },
726
+ ...worker.d1Databases && {
727
+ d1_databases: objectEntries(worker.d1Databases).map(([binding, database_id]) => ({
728
+ binding,
729
+ database_id,
730
+ database_name: database_id
731
+ }))
732
+ },
733
+ ...durableObjectBindings.length > 0 && {
734
+ durable_objects: {
735
+ bindings: durableObjectBindings
736
+ }
737
+ },
738
+ ...serviceBindings.length > 0 && {
739
+ services: serviceBindings
740
+ },
741
+ ...queues && { queues }
742
+ };
743
+ return config;
744
+ }
745
+ function createAuxiliaryServiceWorkerConfigs(resolution) {
746
+ if (!resolution || resolution.workers.length === 0) {
747
+ return { auxiliaryWorkers: [], virtualModules: new Map };
748
+ }
749
+ const virtualModules = new Map;
750
+ const auxiliaryWorkers = resolution.workers.map((worker) => {
751
+ virtualModules.set(resolvedVirtualServiceWorkerId(worker.name), worker.script);
752
+ return {
753
+ config: toWranglerWorkerConfig(worker)
754
+ };
755
+ });
756
+ return { auxiliaryWorkers, virtualModules };
757
+ }
758
+
690
759
  // src/vite/plugin-context.ts
691
760
  var CONFIG_DIR = ".devflare";
692
761
  function removeDevflareHandledServeBindings(config) {
@@ -704,7 +773,9 @@ async function buildPluginContextState(projectRoot, devflareConfig, environment,
704
773
  const compiledWranglerConfig = mode === "build" ? compileBuildConfig(effectiveConfig) : compileConfig(effectiveConfig);
705
774
  const wranglerConfig = mode === "build" ? isolateViteBuildOutputPaths(projectRoot, compiledWranglerConfig) : removeDevflareHandledServeBindings(compiledWranglerConfig);
706
775
  const cloudflareConfig = {
707
- ...mode === "build" ? isolateViteBuildOutputPaths(projectRoot, compileToProgrammaticConfig(effectiveConfig, environment, { preserveNamedBindings: true })) : removeDevflareHandledServeBindings(compileToProgrammaticConfig(effectiveConfig, environment))
776
+ ...mode === "build" ? isolateViteBuildOutputPaths(projectRoot, compileToProgrammaticConfig(effectiveConfig, environment, {
777
+ preserveNamedBindings: true
778
+ })) : removeDevflareHandledServeBindings(compileToProgrammaticConfig(effectiveConfig, environment))
708
779
  };
709
780
  const composedMainEntry = mode === "build" ? null : await prepareComposedWorkerEntrypoint(projectRoot, effectiveConfig, environment);
710
781
  if (composedMainEntry) {
@@ -781,69 +852,6 @@ async function resolvePluginConfigPath(projectRoot, configPath) {
781
852
  return await resolveConfigPath(projectRoot) ?? null;
782
853
  }
783
854
 
784
- // src/vite/plugin-config-hook.ts
785
- async function tryLoadDevflareConfig(cwd, configPath, command) {
786
- try {
787
- return await loadConfig({ cwd, configFile: configPath });
788
- } catch (error) {
789
- if (command === "build") {
790
- console.warn("[devflare] Could not load config:", error);
791
- }
792
- return null;
793
- }
794
- }
795
- function buildWorkerNameDefine(lfConfig, existing) {
796
- const workerNameValue = lfConfig.name ?? "unknown";
797
- return {
798
- ...existing,
799
- __DEVFLARE_WORKER_NAME__: JSON.stringify(workerNameValue)
800
- };
801
- }
802
- function buildWebSocketProxyConfig(lfConfig, bridgePort, wsProxyPatterns) {
803
- const patterns = [...wsProxyPatterns];
804
- if (lfConfig.wsRoutes && lfConfig.wsRoutes.length > 0) {
805
- for (const route of lfConfig.wsRoutes) {
806
- if (!patterns.includes(route.pattern)) {
807
- patterns.push(route.pattern);
808
- }
809
- }
810
- }
811
- if (patterns.length === 0)
812
- return null;
813
- const proxyConfig = {};
814
- for (const pattern of patterns) {
815
- proxyConfig[pattern] = {
816
- target: `http://127.0.0.1:${bridgePort}`,
817
- changeOrigin: true,
818
- ws: true,
819
- configure: (proxy) => {
820
- proxy.on("error", (err) => {
821
- console.error(`[devflare] Proxy error: ${err.message}`);
822
- });
823
- }
824
- };
825
- }
826
- if (Object.keys(proxyConfig).length === 0)
827
- return null;
828
- console.log(`[devflare] WebSocket proxy configured for: ${patterns.join(", ")}`);
829
- return proxyConfig;
830
- }
831
- async function buildPluginConfigHookResult(cwd, options, command, existingDefine) {
832
- const lfConfig = await tryLoadDevflareConfig(cwd, options.configPath, command);
833
- const returnConfig = {};
834
- if (lfConfig) {
835
- returnConfig.define = buildWorkerNameDefine(lfConfig, existingDefine);
836
- }
837
- if (command === "serve" && process.env.DEVFLARE_DEV && lfConfig) {
838
- const port = options.bridgePort ?? 8787;
839
- const proxyConfig = buildWebSocketProxyConfig(lfConfig, port, options.wsProxyPatterns);
840
- if (proxyConfig) {
841
- returnConfig.server = { proxy: proxyConfig };
842
- }
843
- }
844
- return Object.keys(returnConfig).length > 0 ? returnConfig : undefined;
845
- }
846
-
847
855
  // src/vite/plugin-transform.ts
848
856
  var TRANSFORMABLE_EXTENSIONS = [".ts", ".tsx", ".js"];
849
857
  function isTransformCandidate(id) {
@@ -855,10 +863,7 @@ async function runWorkerEntryTransform(code, id) {
855
863
  if (!id.endsWith("worker.ts") && !id.endsWith("worker.js")) {
856
864
  return null;
857
865
  }
858
- const {
859
- shouldTransformWorker,
860
- transformWorkerEntrypoint
861
- } = await import("./worker-entrypoint-3rmzd4c1.js");
866
+ const { shouldTransformWorker, transformWorkerEntrypoint } = await import("./worker-entrypoint-y8s9kdcx.js");
862
867
  if (!shouldTransformWorker(code, id)) {
863
868
  return null;
864
869
  }
@@ -876,7 +881,7 @@ async function runDurableObjectTransform(code, id, options) {
876
881
  if (!code.includes("DurableObject") && !code.includes("@durableObject")) {
877
882
  return null;
878
883
  }
879
- const { transformDurableObject } = await import("./durable-object-v3gsnybk.js");
884
+ const { transformDurableObject } = await import("./durable-object-pf6gabpn.js");
880
885
  return transformDurableObject(code, id);
881
886
  }
882
887
  async function runDevflareTransform(code, id, options) {
@@ -897,7 +902,10 @@ async function loadProgrammaticDevflareConfig(options) {
897
902
  cwd,
898
903
  configFile: options.configPath,
899
904
  environment: options.environment
900
- }) : await resolveResources(await loadConfig({ cwd, configFile: options.configPath }), { phase: "local", environment: options.environment });
905
+ }) : await resolveResources(await loadConfig({ cwd, configFile: options.configPath }), {
906
+ phase: "local",
907
+ environment: options.environment
908
+ });
901
909
  const devflareConfig = await resolveConfigEnvVars(resourceResolvedConfig, {
902
910
  cwd,
903
911
  configPath: options.configPath,
@@ -935,7 +943,14 @@ async function buildProgrammaticArtifacts(options, mode) {
935
943
  const serviceBindingResolution = await resolveServiceBindings(devflareConfig, cwd);
936
944
  auxiliaryWorkers.push(...createAuxiliaryServiceWorkerConfigs(serviceBindingResolution).auxiliaryWorkers);
937
945
  }
938
- return { cwd, devflareConfig, composedMainEntry, wranglerConfig, cloudflareConfig, auxiliaryWorkers };
946
+ return {
947
+ cwd,
948
+ devflareConfig,
949
+ composedMainEntry,
950
+ wranglerConfig,
951
+ cloudflareConfig,
952
+ auxiliaryWorkers
953
+ };
939
954
  }
940
955
  async function getCloudflareConfig(options = {}) {
941
956
  const { cloudflareConfig } = await buildProgrammaticArtifacts(options, "programmatic");
@@ -988,7 +1003,7 @@ function devflarePlugin(options = {}) {
988
1003
  environment,
989
1004
  doTransforms = true,
990
1005
  watchConfig = true,
991
- bridgePort = process.env.DEVFLARE_BRIDGE_PORT ? parseInt(process.env.DEVFLARE_BRIDGE_PORT, 10) : undefined,
1006
+ bridgePort = process.env.DEVFLARE_BRIDGE_PORT ? Number.parseInt(process.env.DEVFLARE_BRIDGE_PORT, 10) : undefined,
992
1007
  wsProxyPatterns = []
993
1008
  } = options;
994
1009
  const state = createPluginState();