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.
Files changed (380) hide show
  1. package/LLM.md +9360 -1784
  2. package/README.md +391 -32
  3. package/bin/devflare.js +17 -7
  4. package/dist/account-0w8wdzjv.js +475 -0
  5. package/dist/account-eygq6qx7.js +475 -0
  6. package/dist/account-fw8nafav.js +475 -0
  7. package/dist/account-pzq69nys.js +475 -0
  8. package/dist/account-s66jb15j.js +475 -0
  9. package/dist/api-d6ekexs5.js +25 -0
  10. package/dist/bridge/index.d.ts +1 -1
  11. package/dist/bridge/index.d.ts.map +1 -1
  12. package/dist/bridge/miniflare.d.ts.map +1 -1
  13. package/dist/bridge/protocol.d.ts +1 -1
  14. package/dist/bridge/protocol.d.ts.map +1 -1
  15. package/dist/bridge/proxy.d.ts +0 -4
  16. package/dist/bridge/proxy.d.ts.map +1 -1
  17. package/dist/bridge/serialization.d.ts.map +1 -1
  18. package/dist/bridge/server.d.ts +1 -1
  19. package/dist/bridge/server.d.ts.map +1 -1
  20. package/dist/browser-shim/handler.d.ts +1 -1
  21. package/dist/browser-shim/handler.d.ts.map +1 -1
  22. package/dist/browser.d.ts +1651 -34
  23. package/dist/browser.d.ts.map +1 -1
  24. package/dist/build-1kmkwqgh.js +53 -0
  25. package/dist/build-506kjhcm.js +53 -0
  26. package/dist/build-66866ahs.js +53 -0
  27. package/dist/build-g1adm3ww.js +53 -0
  28. package/dist/build-p3r3117t.js +53 -0
  29. package/dist/bundler/do-bundler.d.ts.map +1 -1
  30. package/dist/bundler/rolldown-shared.d.ts +24 -0
  31. package/dist/bundler/rolldown-shared.d.ts.map +1 -0
  32. package/dist/bundler/worker-bundler.d.ts +0 -1
  33. package/dist/bundler/worker-bundler.d.ts.map +1 -1
  34. package/dist/cli/command-utils.d.ts +18 -0
  35. package/dist/cli/command-utils.d.ts.map +1 -0
  36. package/dist/cli/commands/account.d.ts +1 -1
  37. package/dist/cli/commands/account.d.ts.map +1 -1
  38. package/dist/cli/commands/build-artifacts.d.ts +27 -0
  39. package/dist/cli/commands/build-artifacts.d.ts.map +1 -0
  40. package/dist/cli/commands/build.d.ts.map +1 -1
  41. package/dist/cli/commands/config.d.ts +4 -0
  42. package/dist/cli/commands/config.d.ts.map +1 -0
  43. package/dist/cli/commands/deploy.d.ts.map +1 -1
  44. package/dist/cli/commands/dev.d.ts.map +1 -1
  45. package/dist/cli/commands/doctor.d.ts.map +1 -1
  46. package/dist/cli/commands/init.d.ts.map +1 -1
  47. package/dist/cli/commands/login.d.ts +4 -0
  48. package/dist/cli/commands/login.d.ts.map +1 -0
  49. package/dist/cli/commands/previews-support/cleanup.d.ts +9 -0
  50. package/dist/cli/commands/previews-support/cleanup.d.ts.map +1 -0
  51. package/dist/cli/commands/previews-support/family.d.ts +10 -0
  52. package/dist/cli/commands/previews-support/family.d.ts.map +1 -0
  53. package/dist/cli/commands/previews-support/render.d.ts +8 -0
  54. package/dist/cli/commands/previews-support/render.d.ts.map +1 -0
  55. package/dist/cli/commands/previews-support/theme.d.ts +10 -0
  56. package/dist/cli/commands/previews-support/theme.d.ts.map +1 -0
  57. package/dist/cli/commands/previews-support/types.d.ts +70 -0
  58. package/dist/cli/commands/previews-support/types.d.ts.map +1 -0
  59. package/dist/cli/commands/previews.d.ts +4 -0
  60. package/dist/cli/commands/previews.d.ts.map +1 -0
  61. package/dist/cli/commands/productions.d.ts +4 -0
  62. package/dist/cli/commands/productions.d.ts.map +1 -0
  63. package/dist/cli/commands/token.d.ts +4 -0
  64. package/dist/cli/commands/token.d.ts.map +1 -0
  65. package/dist/cli/commands/type-generation/discovery.d.ts +7 -0
  66. package/dist/cli/commands/type-generation/discovery.d.ts.map +1 -0
  67. package/dist/cli/commands/type-generation/generator.d.ts +44 -0
  68. package/dist/cli/commands/type-generation/generator.d.ts.map +1 -0
  69. package/dist/cli/commands/type-generation/models.d.ts +27 -0
  70. package/dist/cli/commands/type-generation/models.d.ts.map +1 -0
  71. package/dist/cli/commands/types.d.ts.map +1 -1
  72. package/dist/cli/commands/worker.d.ts +4 -0
  73. package/dist/cli/commands/worker.d.ts.map +1 -0
  74. package/dist/cli/config-path.d.ts +2 -1
  75. package/dist/cli/config-path.d.ts.map +1 -1
  76. package/dist/cli/deploy-strategy.d.ts +17 -0
  77. package/dist/cli/deploy-strategy.d.ts.map +1 -0
  78. package/dist/cli/deploy-target.d.ts +17 -0
  79. package/dist/cli/deploy-target.d.ts.map +1 -0
  80. package/dist/cli/generated-artifacts.d.ts +12 -0
  81. package/dist/cli/generated-artifacts.d.ts.map +1 -0
  82. package/dist/cli/help-pages/pages/account.d.ts +3 -0
  83. package/dist/cli/help-pages/pages/account.d.ts.map +1 -0
  84. package/dist/cli/help-pages/pages/core.d.ts +4 -0
  85. package/dist/cli/help-pages/pages/core.d.ts.map +1 -0
  86. package/dist/cli/help-pages/pages/index.d.ts +3 -0
  87. package/dist/cli/help-pages/pages/index.d.ts.map +1 -0
  88. package/dist/cli/help-pages/pages/misc.d.ts +3 -0
  89. package/dist/cli/help-pages/pages/misc.d.ts.map +1 -0
  90. package/dist/cli/help-pages/pages/previews.d.ts +3 -0
  91. package/dist/cli/help-pages/pages/previews.d.ts.map +1 -0
  92. package/dist/cli/help-pages/pages/productions.d.ts +3 -0
  93. package/dist/cli/help-pages/pages/productions.d.ts.map +1 -0
  94. package/dist/cli/help-pages/render.d.ts +12 -0
  95. package/dist/cli/help-pages/render.d.ts.map +1 -0
  96. package/dist/cli/help-pages/shared.d.ts +15 -0
  97. package/dist/cli/help-pages/shared.d.ts.map +1 -0
  98. package/dist/cli/help-pages/types.d.ts +23 -0
  99. package/dist/cli/help-pages/types.d.ts.map +1 -0
  100. package/dist/cli/help.d.ts +6 -0
  101. package/dist/cli/help.d.ts.map +1 -0
  102. package/dist/cli/index.d.ts +1 -0
  103. package/dist/cli/index.d.ts.map +1 -1
  104. package/dist/cli/preview-bindings.d.ts +42 -0
  105. package/dist/cli/preview-bindings.d.ts.map +1 -0
  106. package/dist/cli/preview.d.ts +11 -0
  107. package/dist/cli/preview.d.ts.map +1 -0
  108. package/dist/cli/ui.d.ts +37 -0
  109. package/dist/cli/ui.d.ts.map +1 -0
  110. package/dist/cli/workspace-build-guard.d.ts +14 -0
  111. package/dist/cli/workspace-build-guard.d.ts.map +1 -0
  112. package/dist/cloudflare/account-core.d.ts +6 -0
  113. package/dist/cloudflare/account-core.d.ts.map +1 -0
  114. package/dist/cloudflare/account-resources.d.ts +40 -0
  115. package/dist/cloudflare/account-resources.d.ts.map +1 -0
  116. package/dist/cloudflare/account-status.d.ts +11 -0
  117. package/dist/cloudflare/account-status.d.ts.map +1 -0
  118. package/dist/cloudflare/account-workers.d.ts +14 -0
  119. package/dist/cloudflare/account-workers.d.ts.map +1 -0
  120. package/dist/cloudflare/account.d.ts +7 -64
  121. package/dist/cloudflare/account.d.ts.map +1 -1
  122. package/dist/cloudflare/api.d.ts +4 -0
  123. package/dist/cloudflare/api.d.ts.map +1 -1
  124. package/dist/cloudflare/index.d.ts +57 -2
  125. package/dist/cloudflare/index.d.ts.map +1 -1
  126. package/dist/cloudflare/kv-namespace.d.ts +3 -0
  127. package/dist/cloudflare/kv-namespace.d.ts.map +1 -0
  128. package/dist/cloudflare/preferences.d.ts.map +1 -1
  129. package/dist/cloudflare/preview-registry-cache.d.ts +6 -0
  130. package/dist/cloudflare/preview-registry-cache.d.ts.map +1 -0
  131. package/dist/cloudflare/preview-registry-records.d.ts +61 -0
  132. package/dist/cloudflare/preview-registry-records.d.ts.map +1 -0
  133. package/dist/cloudflare/preview-registry-store.d.ts +14 -0
  134. package/dist/cloudflare/preview-registry-store.d.ts.map +1 -0
  135. package/dist/cloudflare/preview-registry-types.d.ts +103 -0
  136. package/dist/cloudflare/preview-registry-types.d.ts.map +1 -0
  137. package/dist/cloudflare/preview-registry.d.ts +42 -0
  138. package/dist/cloudflare/preview-registry.d.ts.map +1 -0
  139. package/dist/cloudflare/registry-schema.d.ts +253 -0
  140. package/dist/cloudflare/registry-schema.d.ts.map +1 -0
  141. package/dist/cloudflare/tokens.d.ts +18 -0
  142. package/dist/cloudflare/tokens.d.ts.map +1 -0
  143. package/dist/cloudflare/types.d.ts +122 -5
  144. package/dist/cloudflare/types.d.ts.map +1 -1
  145. package/dist/cloudflare/usage.d.ts.map +1 -1
  146. package/dist/config/compiler.d.ts +4 -0
  147. package/dist/config/compiler.d.ts.map +1 -1
  148. package/dist/config/framework-providers.d.ts +9 -0
  149. package/dist/config/framework-providers.d.ts.map +1 -0
  150. package/dist/config/index.d.ts +5 -3
  151. package/dist/config/index.d.ts.map +1 -1
  152. package/dist/config/loader.d.ts +1 -0
  153. package/dist/config/loader.d.ts.map +1 -1
  154. package/dist/config/preview-resources.d.ts +77 -0
  155. package/dist/config/preview-resources.d.ts.map +1 -0
  156. package/dist/config/preview.d.ts +31 -0
  157. package/dist/config/preview.d.ts.map +1 -0
  158. package/dist/config/ref.d.ts +0 -22
  159. package/dist/config/ref.d.ts.map +1 -1
  160. package/dist/config/resolve.d.ts +1 -0
  161. package/dist/config/resolve.d.ts.map +1 -1
  162. package/dist/config/resource-resolution.d.ts +60 -0
  163. package/dist/config/resource-resolution.d.ts.map +1 -0
  164. package/dist/config/schema-bindings.d.ts +693 -0
  165. package/dist/config/schema-bindings.d.ts.map +1 -0
  166. package/dist/config/schema-build.d.ts +67 -0
  167. package/dist/config/schema-build.d.ts.map +1 -0
  168. package/dist/config/schema-env.d.ts +1341 -0
  169. package/dist/config/schema-env.d.ts.map +1 -0
  170. package/dist/config/schema-normalization.d.ts +64 -0
  171. package/dist/config/schema-normalization.d.ts.map +1 -0
  172. package/dist/config/schema-runtime.d.ts +230 -0
  173. package/dist/config/schema-runtime.d.ts.map +1 -0
  174. package/dist/config/schema.d.ts +640 -3669
  175. package/dist/config/schema.d.ts.map +1 -1
  176. package/dist/config-entry.d.ts +5 -0
  177. package/dist/config-entry.d.ts.map +1 -0
  178. package/dist/config-fjwke42y.js +59 -0
  179. package/dist/config-hwdqjse7.js +59 -0
  180. package/dist/config-pxvewrhv.js +59 -0
  181. package/dist/config-q0g5qdga.js +59 -0
  182. package/dist/decorators/durable-object.d.ts.map +1 -1
  183. package/dist/deploy-7nmzc9r8.js +609 -0
  184. package/dist/deploy-csfhdr64.js +691 -0
  185. package/dist/deploy-ex4g5avz.js +621 -0
  186. package/dist/deploy-jnb0bhka.js +609 -0
  187. package/dist/deploy-tp0g6qdp.js +609 -0
  188. package/dist/deploy-ykpcjkc2.js +690 -0
  189. package/dist/{dev-c1xc1gq9.js → dev-2pd33m28.js} +392 -348
  190. package/dist/dev-7ef5e2j1.js +2409 -0
  191. package/dist/dev-8nssqatr.js +2409 -0
  192. package/dist/dev-grznx8fn.js +2409 -0
  193. package/dist/dev-server/d1-migrations.d.ts +14 -0
  194. package/dist/dev-server/d1-migrations.d.ts.map +1 -0
  195. package/dist/dev-server/gateway-script.d.ts +8 -0
  196. package/dist/dev-server/gateway-script.d.ts.map +1 -0
  197. package/dist/dev-server/runtime-stdio.d.ts.map +1 -1
  198. package/dist/dev-server/server.d.ts.map +1 -1
  199. package/dist/dev-server/vite-process.d.ts +14 -0
  200. package/dist/dev-server/vite-process.d.ts.map +1 -0
  201. package/dist/dev-server/vite-utils.d.ts +1 -1
  202. package/dist/dev-server/vite-utils.d.ts.map +1 -1
  203. package/dist/dev-server/worker-source-watcher.d.ts +11 -0
  204. package/dist/dev-server/worker-source-watcher.d.ts.map +1 -0
  205. package/dist/dev-server/worker-surface-paths.d.ts +6 -0
  206. package/dist/dev-server/worker-surface-paths.d.ts.map +1 -0
  207. package/dist/{doctor-z4ffybce.js → doctor-04ammrrh.js} +67 -31
  208. package/dist/doctor-fmjj65mc.js +245 -0
  209. package/dist/doctor-fzkznce1.js +245 -0
  210. package/dist/doctor-sa5xv1bz.js +245 -0
  211. package/dist/index-091sh1ma.js +1229 -0
  212. package/dist/index-0apbm26n.js +788 -0
  213. package/dist/index-0eqksag4.js +418 -0
  214. package/dist/{index-dr6sbp8d.js → index-0kfzdywd.js} +15 -2
  215. package/dist/index-0w826dsr.js +379 -0
  216. package/dist/{index-rfhx0yd5.js → index-11m5a8wd.js} +110 -32
  217. package/dist/{index-xxwbb2nt.js → index-1sp39f2f.js} +114 -58
  218. package/dist/index-2jnrqbny.js +1301 -0
  219. package/dist/index-2pb7b9mw.js +378 -0
  220. package/dist/{index-0kzg8wed.js → index-2x53aqjm.js} +1071 -890
  221. package/dist/index-3ke5d2vn.js +1229 -0
  222. package/dist/index-43dq8yx8.js +788 -0
  223. package/dist/index-4rrttqj5.js +378 -0
  224. package/dist/index-4v9bc2pc.js +1367 -0
  225. package/dist/index-61jsjnsv.js +280 -0
  226. package/dist/index-6jef5emv.js +176 -0
  227. package/dist/index-6psz1h4c.js +788 -0
  228. package/dist/index-72mve6vh.js +168 -0
  229. package/dist/{index-zbvmtcn2.js → index-74198nxd.js} +179 -77
  230. package/dist/index-7g8zyws4.js +192 -0
  231. package/dist/index-7kcxjhta.js +456 -0
  232. package/dist/index-7v583xan.js +418 -0
  233. package/dist/index-7x0ybbtx.js +133 -0
  234. package/dist/index-816krz9p.js +52 -0
  235. package/dist/index-82f1z98k.js +41 -0
  236. package/dist/index-8t5nb4qx.js +133 -0
  237. package/dist/index-9az6s7ad.js +52 -0
  238. package/dist/{index-59df49vn.js → index-9ba1etyz.js} +29 -51
  239. package/dist/{index-001mw014.js → index-9fbtk7gv.js} +134 -248
  240. package/dist/index-9n6djthj.js +490 -0
  241. package/dist/index-aabgympv.js +39 -0
  242. package/dist/index-b8m6883k.js +74 -0
  243. package/dist/{index-5yxg30va.js → index-cgbvmse6.js} +15 -6
  244. package/dist/index-d8etnfef.js +1229 -0
  245. package/dist/index-e9yw4d6y.js +133 -0
  246. package/dist/index-epw1jxz5.js +1204 -0
  247. package/dist/index-f85s8gj3.js +2649 -0
  248. package/dist/index-fe2ngvh7.js +1229 -0
  249. package/dist/index-fvsadj32.js +192 -0
  250. package/dist/index-gs4y9gdf.js +456 -0
  251. package/dist/{index-fef08w43.js → index-h18pxvzs.js} +7 -6
  252. package/dist/index-hfj1a2c4.js +2649 -0
  253. package/dist/{index-8gtqgb3q.js → index-hjy8ctpc.js} +14 -92
  254. package/dist/index-htzf0py1.js +1204 -0
  255. package/dist/index-j185x270.js +897 -0
  256. package/dist/index-jb75kwa4.js +519 -0
  257. package/dist/index-jwd8pcb2.js +897 -0
  258. package/dist/index-k29yjhv0.js +52 -0
  259. package/dist/index-k6vq6kkt.js +456 -0
  260. package/dist/{index-vky23txa.js → index-m3fmw6mx.js} +2 -2
  261. package/dist/index-maxpsfk8.js +402 -0
  262. package/dist/index-mbdmrner.js +402 -0
  263. package/dist/index-mea5bc45.js +418 -0
  264. package/dist/index-mqekt778.js +185 -0
  265. package/dist/index-na3mnm1k.js +74 -0
  266. package/dist/index-p03n4qet.js +1367 -0
  267. package/dist/index-p296ban8.js +191 -0
  268. package/dist/index-pnbs1b8k.js +280 -0
  269. package/dist/index-q4kaz181.js +1207 -0
  270. package/dist/index-ry131z23.js +378 -0
  271. package/dist/index-sgb7c8nm.js +402 -0
  272. package/dist/index-sqrksgb2.js +133 -0
  273. package/dist/index-stgn34cr.js +148 -0
  274. package/dist/{index-v8vvsn9x.js → index-t08te69w.js} +1 -18
  275. package/dist/index-thna1tkd.js +280 -0
  276. package/dist/index-v5nmqthy.js +74 -0
  277. package/dist/{index-n932ytmq.js → index-vt4yxkmf.js} +2 -2
  278. package/dist/index-wyq6c6yj.js +402 -0
  279. package/dist/index-wztc9stx.js +418 -0
  280. package/dist/index-x9cwdxw5.js +456 -0
  281. package/dist/index-xk9djfjp.js +519 -0
  282. package/dist/index-yc0gcchc.js +418 -0
  283. package/dist/index-yqbxjysa.js +897 -0
  284. package/dist/index-yzddwp02.js +788 -0
  285. package/dist/index-zfhq6s96.js +74 -0
  286. package/dist/index-zt22fe2j.js +54 -0
  287. package/dist/index-zyt5byt6.js +2649 -0
  288. package/dist/index.d.ts +2 -2
  289. package/dist/index.d.ts.map +1 -1
  290. package/dist/{init-na2atvz2.js → init-r4hnxan3.js} +24 -17
  291. package/dist/login-2hnz4m4n.js +77 -0
  292. package/dist/login-5bsxxpvc.js +77 -0
  293. package/dist/login-6tzvczw2.js +77 -0
  294. package/dist/login-bhaw72zc.js +77 -0
  295. package/dist/login-x8tgckqm.js +77 -0
  296. package/dist/previews-3rn8mz2c.js +1168 -0
  297. package/dist/previews-d487qde5.js +1200 -0
  298. package/dist/previews-gm3z0syj.js +1168 -0
  299. package/dist/previews-j9ymq4ys.js +1169 -0
  300. package/dist/previews-q031mx34.js +1168 -0
  301. package/dist/productions-120xg0aq.js +505 -0
  302. package/dist/productions-5ev5qweg.js +505 -0
  303. package/dist/productions-me3tdvr9.js +505 -0
  304. package/dist/productions-p5rbgp2f.js +505 -0
  305. package/dist/productions-x9p0pym1.js +505 -0
  306. package/dist/runtime/context-events.d.ts +13 -0
  307. package/dist/runtime/context-events.d.ts.map +1 -0
  308. package/dist/runtime/context-types.d.ts +82 -0
  309. package/dist/runtime/context-types.d.ts.map +1 -0
  310. package/dist/runtime/context.d.ts +6 -267
  311. package/dist/runtime/context.d.ts.map +1 -1
  312. package/dist/runtime/exports.d.ts +3 -3
  313. package/dist/runtime/index.d.ts +1 -1
  314. package/dist/runtime/index.d.ts.map +1 -1
  315. package/dist/runtime/middleware.d.ts +8 -38
  316. package/dist/runtime/middleware.d.ts.map +1 -1
  317. package/dist/src/browser.js +23 -14
  318. package/dist/src/cli/index.js +3 -1
  319. package/dist/src/cloudflare/index.js +49 -2
  320. package/dist/src/config-entry.js +14 -0
  321. package/dist/src/index.js +33 -20
  322. package/dist/src/runtime/index.js +3 -9
  323. package/dist/src/sveltekit/index.js +10 -7
  324. package/dist/src/test/index.js +16 -18
  325. package/dist/src/vite/index.js +7 -4
  326. package/dist/sveltekit/platform.d.ts +1 -1
  327. package/dist/sveltekit/platform.d.ts.map +1 -1
  328. package/dist/test/cf.d.ts +10 -10
  329. package/dist/test/email.d.ts.map +1 -1
  330. package/dist/test/index.d.ts +1 -6
  331. package/dist/test/index.d.ts.map +1 -1
  332. package/dist/test/queue.d.ts.map +1 -1
  333. package/dist/test/remote-ai.d.ts.map +1 -1
  334. package/dist/test/remote-cloudflare.d.ts +13 -0
  335. package/dist/test/remote-cloudflare.d.ts.map +1 -0
  336. package/dist/test/remote-vectorize.d.ts.map +1 -1
  337. package/dist/test/resolve-service-bindings.d.ts.map +1 -1
  338. package/dist/test/scheduled.d.ts.map +1 -1
  339. package/dist/test/should-skip.d.ts +0 -18
  340. package/dist/test/should-skip.d.ts.map +1 -1
  341. package/dist/test/simple-context-durable-objects.d.ts +6 -0
  342. package/dist/test/simple-context-durable-objects.d.ts.map +1 -0
  343. package/dist/test/simple-context-gateway-script.d.ts +2 -0
  344. package/dist/test/simple-context-gateway-script.d.ts.map +1 -0
  345. package/dist/test/simple-context-paths.d.ts +40 -0
  346. package/dist/test/simple-context-paths.d.ts.map +1 -0
  347. package/dist/test/simple-context.d.ts +1 -23
  348. package/dist/test/simple-context.d.ts.map +1 -1
  349. package/dist/test/tail.d.ts.map +1 -1
  350. package/dist/test/worker.d.ts.map +1 -1
  351. package/dist/token-kedhcret.js +419 -0
  352. package/dist/token-m8jmnjwk.js +419 -0
  353. package/dist/{types-sffr9681.js → types-0sqwkp7x.js} +244 -139
  354. package/dist/types-1gwr2ex6.js +572 -0
  355. package/dist/types-6e5yx6km.js +572 -0
  356. package/dist/types-p0gckpn6.js +572 -0
  357. package/dist/utils/send-email.d.ts.map +1 -1
  358. package/dist/vite/config-file.d.ts.map +1 -1
  359. package/dist/vite/plugin.d.ts.map +1 -1
  360. package/dist/worker-0srh2jfr.js +513 -0
  361. package/dist/worker-4xrfd10a.js +513 -0
  362. package/dist/worker-entry/composed-worker.d.ts +0 -7
  363. package/dist/worker-entry/composed-worker.d.ts.map +1 -1
  364. package/dist/worker-entry/surface-paths.d.ts +15 -0
  365. package/dist/worker-entry/surface-paths.d.ts.map +1 -0
  366. package/dist/worker-qtam8grz.js +513 -0
  367. package/dist/worker-qzm0b7br.js +513 -0
  368. package/dist/worker-y9ha6g44.js +513 -0
  369. package/package.json +17 -10
  370. package/R2.md +0 -200
  371. package/dist/account-8psavtg6.js +0 -420
  372. package/dist/build-n639efmn.js +0 -101
  373. package/dist/deploy-zvnq6xh7.js +0 -117
  374. package/dist/index-2q3pmzrx.js +0 -90
  375. package/dist/index-f4q0jbnj.js +0 -195
  376. package/dist/index-n7rs26ft.js +0 -77
  377. package/dist/index-tfyxa77h.js +0 -850
  378. package/dist/index-wyf3s77s.js +0 -343
  379. package/dist/test/multi-worker-context.d.ts +0 -114
  380. package/dist/test/multi-worker-context.d.ts.map +0 -1
@@ -9,9 +9,13 @@ import {
9
9
  __require
10
10
  } from "./index-37x76zdn.js";
11
11
 
12
- // src/bundler/worker-bundler.ts
13
- import { fileURLToPath } from "node:url";
14
- import { dirname, resolve } from "pathe";
12
+ // src/bundler/do-bundler.ts
13
+ import { resolve as resolve2, dirname, relative } from "pathe";
14
+ import picomatch from "picomatch";
15
+
16
+ // src/bundler/rolldown-shared.ts
17
+ import { existsSync } from "node:fs";
18
+ import { resolve } from "pathe";
15
19
 
16
20
  // src/bundler/worker-compat.ts
17
21
  import MagicString from "magic-string";
@@ -315,7 +319,31 @@ function createWorkerDynamicImportPlugin() {
315
319
  };
316
320
  }
317
321
 
318
- // src/bundler/worker-bundler.ts
322
+ // src/bundler/rolldown-shared.ts
323
+ var DEFAULT_EXTERNAL_MODULES = [
324
+ /^cloudflare:/,
325
+ /^node:/,
326
+ "buffer",
327
+ "crypto",
328
+ "events",
329
+ "http",
330
+ "https",
331
+ "net",
332
+ "os",
333
+ "path",
334
+ "stream",
335
+ "tls",
336
+ "url",
337
+ "util",
338
+ "zlib",
339
+ "fs",
340
+ "child_process",
341
+ "async_hooks",
342
+ "querystring",
343
+ "string_decoder",
344
+ "assert",
345
+ "dns"
346
+ ];
319
347
  function toArray(value) {
320
348
  return Array.isArray(value) ? value : [value];
321
349
  }
@@ -374,6 +402,16 @@ function mergeResolveOptions(base, user) {
374
402
  }
375
403
  };
376
404
  }
405
+ function resolveTsconfigOption(options) {
406
+ if (options.userTsconfig) {
407
+ return { tsconfig: options.userTsconfig };
408
+ }
409
+ const defaultTsconfigPath = resolve(options.cwd, "tsconfig.json");
410
+ if (options.defaultMode === "always" || existsSync(defaultTsconfigPath)) {
411
+ return { tsconfig: defaultTsconfigPath };
412
+ }
413
+ return {};
414
+ }
377
415
  async function ensureDebugShim(outDir) {
378
416
  const fs = await import("node:fs/promises");
379
417
  const debugShimCode = `
@@ -395,43 +433,13 @@ export default createDebug
395
433
  await fs.writeFile(debugShimPath, debugShimCode, "utf-8");
396
434
  return debugShimPath;
397
435
  }
398
- async function resolveInternalModuleEntry(relativeCandidates) {
399
- const fs = await import("node:fs/promises");
400
- const currentFileDir = dirname(fileURLToPath(import.meta.url));
401
- for (const candidate of relativeCandidates) {
402
- const absolutePath = resolve(currentFileDir, candidate);
403
- try {
404
- await fs.access(absolutePath);
405
- return absolutePath;
406
- } catch {
407
- continue;
408
- }
409
- }
410
- return null;
411
- }
412
- async function resolveInternalAliasMap(outDir) {
413
- const debugShimPath = await ensureDebugShim(outDir);
414
- const runtimeEntry = await resolveInternalModuleEntry([
415
- "../runtime/index.ts",
416
- "../runtime/index.js"
417
- ]);
418
- const packageEntry = await resolveInternalModuleEntry([
419
- "../browser.ts",
420
- "../browser.js"
421
- ]);
422
- return {
423
- debug: debugShimPath,
424
- ...runtimeEntry ? { "devflare/runtime": runtimeEntry } : {},
425
- ...packageEntry ? { devflare: packageEntry } : {}
426
- };
427
- }
428
- function resolveWorkerRolldownConfig(options) {
436
+ function resolveWorkerCompatibleRolldownConfig(options) {
429
437
  const {
430
438
  output: userOutputOptions,
431
439
  input: _ignoredInput,
432
440
  cwd: _ignoredCwd,
433
441
  platform: _ignoredPlatform,
434
- target: userTarget,
442
+ target: _ignoredTarget,
435
443
  watch: _ignoredWatch,
436
444
  external: userExternal,
437
445
  plugins: userPlugins,
@@ -447,43 +455,22 @@ function resolveWorkerRolldownConfig(options) {
447
455
  inlineDynamicImports: _ignoredInlineDynamicImports,
448
456
  ...safeUserOutputOptions
449
457
  } = userOutputOptions ?? {};
450
- const defaultExternalModules = [
451
- /^cloudflare:/,
452
- /^node:/,
453
- "buffer",
454
- "crypto",
455
- "events",
456
- "http",
457
- "https",
458
- "net",
459
- "os",
460
- "path",
461
- "stream",
462
- "tls",
463
- "url",
464
- "util",
465
- "zlib",
466
- "fs",
467
- "child_process",
468
- "async_hooks",
469
- "querystring",
470
- "string_decoder",
471
- "assert",
472
- "dns"
473
- ];
474
458
  return {
475
459
  inputOptions: {
476
460
  ...userInputOptions,
477
461
  input: options.inputFile,
478
462
  cwd: options.cwd,
479
- platform: "browser",
480
- target: userTarget ?? options.target,
481
- tsconfig: userTsconfig ?? resolve(options.cwd, "tsconfig.json"),
482
- external: mergeExternalOptions(defaultExternalModules, userExternal),
463
+ platform: options.platform,
464
+ ...resolveTsconfigOption({
465
+ cwd: options.cwd,
466
+ userTsconfig,
467
+ defaultMode: options.defaultTsconfigMode
468
+ }),
469
+ external: mergeExternalOptions(DEFAULT_EXTERNAL_MODULES, userExternal),
483
470
  plugins: mergePluginOptions(createWorkerDynamicImportPlugin(), userPlugins),
484
- resolve: mergeResolveOptions({
471
+ resolve: mergeResolveOptions(options.alias ? {
485
472
  alias: options.alias
486
- }, userResolve)
473
+ } : undefined, userResolve)
487
474
  },
488
475
  outputOptions: {
489
476
  ...safeUserOutputOptions,
@@ -492,42 +479,22 @@ function resolveWorkerRolldownConfig(options) {
492
479
  sourcemap: safeUserOutputOptions.sourcemap ?? options.sourcemap ?? false,
493
480
  minify: safeUserOutputOptions.minify ?? options.minify,
494
481
  codeSplitting: false,
495
- inlineDynamicImports: true
482
+ ...options.inlineDynamicImports !== undefined ? { inlineDynamicImports: options.inlineDynamicImports } : {}
496
483
  }
497
484
  };
498
485
  }
499
- async function bundleWorkerEntry(options) {
486
+ async function writeWorkerCompatibleBundle(options) {
500
487
  const { rolldown } = await import("rolldown");
501
- const fs = await import("node:fs/promises");
502
- const outDir = dirname(options.outFile);
503
- await fs.mkdir(outDir, { recursive: true });
504
- await fs.rm(options.outFile, { force: true });
505
- await fs.rm(`${options.outFile}.map`, { force: true });
506
- const alias = await resolveInternalAliasMap(outDir);
507
- const { inputOptions, outputOptions } = resolveWorkerRolldownConfig({
508
- cwd: options.cwd,
509
- inputFile: options.inputFile,
510
- outFile: options.outFile,
511
- alias,
512
- rolldownOptions: options.rolldownOptions,
513
- sourcemap: options.sourcemap,
514
- minify: options.minify,
515
- target: options.target
516
- });
517
- options.logger?.debug(`Bundling main worker → ${options.outFile}`);
518
- const bundle = await rolldown(inputOptions);
488
+ const bundle = await rolldown(options.inputOptions);
519
489
  try {
520
- await bundle.write(outputOptions);
490
+ await bundle.write(options.outputOptions);
521
491
  await assertWorkerBundleHasNoDynamicImports(options.outFile);
522
492
  } finally {
523
493
  await bundle.close();
524
494
  }
525
- return options.outFile;
526
495
  }
527
496
 
528
497
  // src/bundler/do-bundler.ts
529
- import { resolve as resolve2, dirname as dirname2, relative } from "pathe";
530
- import picomatch from "picomatch";
531
498
  function classToBindingName(className) {
532
499
  return className.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").toUpperCase();
533
500
  }
@@ -562,137 +529,7 @@ function stripDecoratorSyntax(code) {
562
529
  });
563
530
  return result;
564
531
  }
565
- function toArray2(value) {
566
- return Array.isArray(value) ? value : [value];
567
- }
568
- function matchesExternalPattern2(pattern, id) {
569
- if (pattern instanceof RegExp) {
570
- pattern.lastIndex = 0;
571
- return pattern.test(id);
572
- }
573
- return pattern === id;
574
- }
575
- function matchesExternalOption2(option, id, parentId, isResolved) {
576
- if (!option) {
577
- return false;
578
- }
579
- if (typeof option === "function") {
580
- return option(id, parentId, isResolved) ?? false;
581
- }
582
- return toArray2(option).some((pattern) => matchesExternalPattern2(pattern, id));
583
- }
584
- function mergeExternalOptions2(base, user) {
585
- if (!base) {
586
- return user;
587
- }
588
- if (!user) {
589
- return base;
590
- }
591
- if (typeof base !== "function" && typeof user !== "function") {
592
- return [...toArray2(base), ...toArray2(user)];
593
- }
594
- return (id, parentId, isResolved) => {
595
- return matchesExternalOption2(base, id, parentId, isResolved) || matchesExternalOption2(user, id, parentId, isResolved) || false;
596
- };
597
- }
598
- function mergePluginOptions2(base, user) {
599
- if (!base) {
600
- return user;
601
- }
602
- if (!user) {
603
- return base;
604
- }
605
- return [base, user];
606
- }
607
- function mergeResolveOptions2(base, user) {
608
- if (!base) {
609
- return user;
610
- }
611
- if (!user) {
612
- return base;
613
- }
614
- return {
615
- ...user,
616
- ...base,
617
- alias: {
618
- ...user.alias ?? {},
619
- ...base.alias ?? {}
620
- }
621
- };
622
- }
623
- function resolveDOBundleRolldownConfig(options) {
624
- const {
625
- output: userOutputOptions,
626
- input: _ignoredInput,
627
- cwd: _ignoredCwd,
628
- platform: _ignoredPlatform,
629
- watch: _ignoredWatch,
630
- external: userExternal,
631
- plugins: userPlugins,
632
- resolve: userResolve,
633
- tsconfig: userTsconfig,
634
- ...userInputOptions
635
- } = options.rolldownOptions ?? {};
636
- const {
637
- codeSplitting: _ignoredCodeSplitting,
638
- dir: _ignoredDir,
639
- file: _ignoredFile,
640
- format: _ignoredFormat,
641
- inlineDynamicImports: _ignoredInlineDynamicImports,
642
- ...safeUserOutputOptions
643
- } = userOutputOptions ?? {};
644
- const defaultExternalModules = [
645
- /^cloudflare:/,
646
- /^node:/,
647
- "buffer",
648
- "crypto",
649
- "events",
650
- "http",
651
- "https",
652
- "net",
653
- "os",
654
- "path",
655
- "stream",
656
- "tls",
657
- "url",
658
- "util",
659
- "zlib",
660
- "fs",
661
- "child_process",
662
- "async_hooks",
663
- "querystring",
664
- "string_decoder",
665
- "assert",
666
- "dns"
667
- ];
668
- return {
669
- inputOptions: {
670
- ...userInputOptions,
671
- input: options.inputFile,
672
- cwd: options.cwd,
673
- platform: "neutral",
674
- tsconfig: userTsconfig ?? resolve2(options.cwd, "tsconfig.json"),
675
- external: mergeExternalOptions2(defaultExternalModules, userExternal),
676
- plugins: mergePluginOptions2(createWorkerDynamicImportPlugin(), userPlugins),
677
- resolve: mergeResolveOptions2({
678
- alias: {
679
- debug: options.debugShimPath
680
- }
681
- }, userResolve)
682
- },
683
- outputOptions: {
684
- ...safeUserOutputOptions,
685
- file: options.outFile,
686
- format: "esm",
687
- sourcemap: safeUserOutputOptions.sourcemap ?? options.sourcemap ?? false,
688
- minify: safeUserOutputOptions.minify ?? options.minify,
689
- codeSplitting: false,
690
- inlineDynamicImports: true
691
- }
692
- };
693
- }
694
532
  async function bundleDOFile(sourcePath, className, outDir, cwd, bundleOptions) {
695
- const { rolldown } = await import("rolldown");
696
533
  const fs = await import("node:fs/promises");
697
534
  await fs.mkdir(outDir, { recursive: true });
698
535
  const sourceCode = await fs.readFile(sourcePath, "utf-8");
@@ -706,44 +543,34 @@ export default {
706
543
  }
707
544
  };
708
545
  `;
709
- const tempFilePath = resolve2(dirname2(sourcePath), `.devflare-temp-${className}.ts`);
546
+ const tempFilePath = resolve2(dirname(sourcePath), `.devflare-temp-${className}.ts`);
710
547
  await fs.writeFile(tempFilePath, entryCode, "utf-8");
711
548
  const classOutDir = resolve2(outDir, className);
712
549
  try {
713
550
  await fs.rm(classOutDir, { recursive: true, force: true });
714
551
  } catch {}
715
552
  await fs.mkdir(classOutDir, { recursive: true });
716
- const debugShimCode = `
717
- // Debug module shim for local development
718
- const createDebug = (namespace) => {
719
- const logger = (...args) => {
720
- if (createDebug.enabled) console.debug(\`[\${namespace}]\`, ...args)
721
- }
722
- logger.enabled = false
723
- logger.namespace = namespace
724
- logger.extend = (sub) => createDebug(\`\${namespace}:\${sub}\`)
725
- return logger
726
- }
727
- createDebug.enabled = false
728
- createDebug.formatters = {}
729
- export default createDebug
730
- `;
731
- const debugShimPath = resolve2(outDir, "_debug_shim.js");
732
- await fs.writeFile(debugShimPath, debugShimCode, "utf-8");
553
+ const debugShimPath = await ensureDebugShim(outDir);
733
554
  const outFile = resolve2(classOutDir, "index.js");
734
- const { inputOptions, outputOptions } = resolveDOBundleRolldownConfig({
555
+ const { inputOptions, outputOptions } = resolveWorkerCompatibleRolldownConfig({
735
556
  cwd,
736
557
  inputFile: tempFilePath,
737
558
  outFile,
738
- debugShimPath,
559
+ platform: "neutral",
560
+ alias: {
561
+ debug: debugShimPath
562
+ },
739
563
  rolldownOptions: bundleOptions?.rolldownOptions,
740
564
  sourcemap: bundleOptions?.sourcemap,
741
- minify: bundleOptions?.minify
565
+ minify: bundleOptions?.minify,
566
+ inlineDynamicImports: true,
567
+ defaultTsconfigMode: "always"
568
+ });
569
+ await writeWorkerCompatibleBundle({
570
+ inputOptions,
571
+ outputOptions,
572
+ outFile
742
573
  });
743
- const bundle = await rolldown(inputOptions);
744
- await bundle.write(outputOptions);
745
- await assertWorkerBundleHasNoDynamicImports(outFile);
746
- await bundle.close();
747
574
  try {
748
575
  await fs.unlink(tempFilePath);
749
576
  } catch {}
@@ -810,9 +637,9 @@ function createDOBundler(options) {
810
637
  const files = await findFiles(pattern, { cwd });
811
638
  let dirsToWatch;
812
639
  if (files.length > 0) {
813
- dirsToWatch = [...new Set(files.map((f) => dirname2(f)))];
640
+ dirsToWatch = [...new Set(files.map((f) => dirname(f)))];
814
641
  } else {
815
- const patternDir = dirname2(pattern);
642
+ const patternDir = dirname(pattern);
816
643
  const absolutePatternDir = resolve2(cwd, patternDir === "." ? "" : patternDir) || cwd;
817
644
  dirsToWatch = [absolutePatternDir];
818
645
  logger?.debug(`No DO files yet, watching pattern directory: ${absolutePatternDir}`);
@@ -837,7 +664,6 @@ function createDOBundler(options) {
837
664
  return normalized;
838
665
  };
839
666
  const isMatch = picomatch(pattern, {
840
- cwd,
841
667
  dot: true,
842
668
  matchBase: false
843
669
  });
@@ -928,4 +754,64 @@ function createDOBundler(options) {
928
754
  getResult
929
755
  };
930
756
  }
757
+
758
+ // src/bundler/worker-bundler.ts
759
+ import { fileURLToPath } from "node:url";
760
+ import { dirname as dirname2, resolve as resolve3 } from "pathe";
761
+ async function resolveInternalModuleEntry(relativeCandidates) {
762
+ const fs = await import("node:fs/promises");
763
+ const currentFileDir = dirname2(fileURLToPath(import.meta.url));
764
+ for (const candidate of relativeCandidates) {
765
+ const absolutePath = resolve3(currentFileDir, candidate);
766
+ try {
767
+ await fs.access(absolutePath);
768
+ return absolutePath;
769
+ } catch {
770
+ continue;
771
+ }
772
+ }
773
+ return null;
774
+ }
775
+ async function resolveInternalAliasMap(outDir) {
776
+ const debugShimPath = await ensureDebugShim(outDir);
777
+ const runtimeEntry = await resolveInternalModuleEntry([
778
+ "../runtime/index.ts",
779
+ "../runtime/index.js"
780
+ ]);
781
+ const packageEntry = await resolveInternalModuleEntry([
782
+ "../browser.ts",
783
+ "../browser.js"
784
+ ]);
785
+ return {
786
+ debug: debugShimPath,
787
+ ...runtimeEntry ? { "devflare/runtime": runtimeEntry } : {},
788
+ ...packageEntry ? { devflare: packageEntry } : {}
789
+ };
790
+ }
791
+ async function bundleWorkerEntry(options) {
792
+ const fs = await import("node:fs/promises");
793
+ const outDir = dirname2(options.outFile);
794
+ await fs.mkdir(outDir, { recursive: true });
795
+ await fs.rm(options.outFile, { force: true });
796
+ await fs.rm(`${options.outFile}.map`, { force: true });
797
+ const alias = await resolveInternalAliasMap(outDir);
798
+ const { inputOptions, outputOptions } = resolveWorkerCompatibleRolldownConfig({
799
+ cwd: options.cwd,
800
+ inputFile: options.inputFile,
801
+ outFile: options.outFile,
802
+ alias,
803
+ platform: "browser",
804
+ rolldownOptions: options.rolldownOptions,
805
+ sourcemap: options.sourcemap,
806
+ minify: options.minify,
807
+ defaultTsconfigMode: "if-present"
808
+ });
809
+ options.logger?.debug(`Bundling main worker → ${options.outFile}`);
810
+ await writeWorkerCompatibleBundle({
811
+ inputOptions,
812
+ outputOptions,
813
+ outFile: options.outFile
814
+ });
815
+ return options.outFile;
816
+ }
931
817
  export { createDOBundler, bundleWorkerEntry };