devflare 1.0.0-next.15 → 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 (377) hide show
  1. package/LLM.md +9360 -1819
  2. package/README.md +313 -39
  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 +1648 -38
  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/deploy.d.ts.map +1 -1
  42. package/dist/cli/commands/dev.d.ts.map +1 -1
  43. package/dist/cli/commands/doctor.d.ts.map +1 -1
  44. package/dist/cli/commands/init.d.ts.map +1 -1
  45. package/dist/cli/commands/login.d.ts +4 -0
  46. package/dist/cli/commands/login.d.ts.map +1 -0
  47. package/dist/cli/commands/previews-support/cleanup.d.ts +9 -0
  48. package/dist/cli/commands/previews-support/cleanup.d.ts.map +1 -0
  49. package/dist/cli/commands/previews-support/family.d.ts +10 -0
  50. package/dist/cli/commands/previews-support/family.d.ts.map +1 -0
  51. package/dist/cli/commands/previews-support/render.d.ts +8 -0
  52. package/dist/cli/commands/previews-support/render.d.ts.map +1 -0
  53. package/dist/cli/commands/previews-support/theme.d.ts +10 -0
  54. package/dist/cli/commands/previews-support/theme.d.ts.map +1 -0
  55. package/dist/cli/commands/previews-support/types.d.ts +70 -0
  56. package/dist/cli/commands/previews-support/types.d.ts.map +1 -0
  57. package/dist/cli/commands/previews.d.ts +4 -0
  58. package/dist/cli/commands/previews.d.ts.map +1 -0
  59. package/dist/cli/commands/productions.d.ts +4 -0
  60. package/dist/cli/commands/productions.d.ts.map +1 -0
  61. package/dist/cli/commands/token.d.ts +4 -0
  62. package/dist/cli/commands/token.d.ts.map +1 -0
  63. package/dist/cli/commands/type-generation/discovery.d.ts +7 -0
  64. package/dist/cli/commands/type-generation/discovery.d.ts.map +1 -0
  65. package/dist/cli/commands/type-generation/generator.d.ts +44 -0
  66. package/dist/cli/commands/type-generation/generator.d.ts.map +1 -0
  67. package/dist/cli/commands/type-generation/models.d.ts +27 -0
  68. package/dist/cli/commands/type-generation/models.d.ts.map +1 -0
  69. package/dist/cli/commands/types.d.ts.map +1 -1
  70. package/dist/cli/commands/worker.d.ts +4 -0
  71. package/dist/cli/commands/worker.d.ts.map +1 -0
  72. package/dist/cli/config-path.d.ts +2 -1
  73. package/dist/cli/config-path.d.ts.map +1 -1
  74. package/dist/cli/deploy-strategy.d.ts +17 -0
  75. package/dist/cli/deploy-strategy.d.ts.map +1 -0
  76. package/dist/cli/deploy-target.d.ts +17 -0
  77. package/dist/cli/deploy-target.d.ts.map +1 -0
  78. package/dist/cli/generated-artifacts.d.ts +12 -0
  79. package/dist/cli/generated-artifacts.d.ts.map +1 -0
  80. package/dist/cli/help-pages/pages/account.d.ts +3 -0
  81. package/dist/cli/help-pages/pages/account.d.ts.map +1 -0
  82. package/dist/cli/help-pages/pages/core.d.ts +4 -0
  83. package/dist/cli/help-pages/pages/core.d.ts.map +1 -0
  84. package/dist/cli/help-pages/pages/index.d.ts +3 -0
  85. package/dist/cli/help-pages/pages/index.d.ts.map +1 -0
  86. package/dist/cli/help-pages/pages/misc.d.ts +3 -0
  87. package/dist/cli/help-pages/pages/misc.d.ts.map +1 -0
  88. package/dist/cli/help-pages/pages/previews.d.ts +3 -0
  89. package/dist/cli/help-pages/pages/previews.d.ts.map +1 -0
  90. package/dist/cli/help-pages/pages/productions.d.ts +3 -0
  91. package/dist/cli/help-pages/pages/productions.d.ts.map +1 -0
  92. package/dist/cli/help-pages/render.d.ts +12 -0
  93. package/dist/cli/help-pages/render.d.ts.map +1 -0
  94. package/dist/cli/help-pages/shared.d.ts +15 -0
  95. package/dist/cli/help-pages/shared.d.ts.map +1 -0
  96. package/dist/cli/help-pages/types.d.ts +23 -0
  97. package/dist/cli/help-pages/types.d.ts.map +1 -0
  98. package/dist/cli/help.d.ts +6 -0
  99. package/dist/cli/help.d.ts.map +1 -0
  100. package/dist/cli/index.d.ts +1 -0
  101. package/dist/cli/index.d.ts.map +1 -1
  102. package/dist/cli/preview-bindings.d.ts +42 -0
  103. package/dist/cli/preview-bindings.d.ts.map +1 -0
  104. package/dist/cli/preview.d.ts +11 -0
  105. package/dist/cli/preview.d.ts.map +1 -0
  106. package/dist/cli/ui.d.ts +37 -0
  107. package/dist/cli/ui.d.ts.map +1 -0
  108. package/dist/cli/workspace-build-guard.d.ts +14 -0
  109. package/dist/cli/workspace-build-guard.d.ts.map +1 -0
  110. package/dist/cloudflare/account-core.d.ts +6 -0
  111. package/dist/cloudflare/account-core.d.ts.map +1 -0
  112. package/dist/cloudflare/account-resources.d.ts +40 -0
  113. package/dist/cloudflare/account-resources.d.ts.map +1 -0
  114. package/dist/cloudflare/account-status.d.ts +11 -0
  115. package/dist/cloudflare/account-status.d.ts.map +1 -0
  116. package/dist/cloudflare/account-workers.d.ts +14 -0
  117. package/dist/cloudflare/account-workers.d.ts.map +1 -0
  118. package/dist/cloudflare/account.d.ts +7 -64
  119. package/dist/cloudflare/account.d.ts.map +1 -1
  120. package/dist/cloudflare/api.d.ts +4 -0
  121. package/dist/cloudflare/api.d.ts.map +1 -1
  122. package/dist/cloudflare/index.d.ts +57 -2
  123. package/dist/cloudflare/index.d.ts.map +1 -1
  124. package/dist/cloudflare/kv-namespace.d.ts +3 -0
  125. package/dist/cloudflare/kv-namespace.d.ts.map +1 -0
  126. package/dist/cloudflare/preferences.d.ts.map +1 -1
  127. package/dist/cloudflare/preview-registry-cache.d.ts +6 -0
  128. package/dist/cloudflare/preview-registry-cache.d.ts.map +1 -0
  129. package/dist/cloudflare/preview-registry-records.d.ts +61 -0
  130. package/dist/cloudflare/preview-registry-records.d.ts.map +1 -0
  131. package/dist/cloudflare/preview-registry-store.d.ts +14 -0
  132. package/dist/cloudflare/preview-registry-store.d.ts.map +1 -0
  133. package/dist/cloudflare/preview-registry-types.d.ts +103 -0
  134. package/dist/cloudflare/preview-registry-types.d.ts.map +1 -0
  135. package/dist/cloudflare/preview-registry.d.ts +42 -0
  136. package/dist/cloudflare/preview-registry.d.ts.map +1 -0
  137. package/dist/cloudflare/registry-schema.d.ts +253 -0
  138. package/dist/cloudflare/registry-schema.d.ts.map +1 -0
  139. package/dist/cloudflare/tokens.d.ts +18 -0
  140. package/dist/cloudflare/tokens.d.ts.map +1 -0
  141. package/dist/cloudflare/types.d.ts +122 -5
  142. package/dist/cloudflare/types.d.ts.map +1 -1
  143. package/dist/cloudflare/usage.d.ts.map +1 -1
  144. package/dist/config/compiler.d.ts +4 -0
  145. package/dist/config/compiler.d.ts.map +1 -1
  146. package/dist/config/framework-providers.d.ts +9 -0
  147. package/dist/config/framework-providers.d.ts.map +1 -0
  148. package/dist/config/index.d.ts +4 -3
  149. package/dist/config/index.d.ts.map +1 -1
  150. package/dist/config/loader.d.ts.map +1 -1
  151. package/dist/config/preview-resources.d.ts +77 -0
  152. package/dist/config/preview-resources.d.ts.map +1 -0
  153. package/dist/config/preview.d.ts +31 -0
  154. package/dist/config/preview.d.ts.map +1 -0
  155. package/dist/config/ref.d.ts +0 -22
  156. package/dist/config/ref.d.ts.map +1 -1
  157. package/dist/config/resolve.d.ts +1 -0
  158. package/dist/config/resolve.d.ts.map +1 -1
  159. package/dist/config/resource-resolution.d.ts +21 -5
  160. package/dist/config/resource-resolution.d.ts.map +1 -1
  161. package/dist/config/schema-bindings.d.ts +693 -0
  162. package/dist/config/schema-bindings.d.ts.map +1 -0
  163. package/dist/config/schema-build.d.ts +67 -0
  164. package/dist/config/schema-build.d.ts.map +1 -0
  165. package/dist/config/schema-env.d.ts +1341 -0
  166. package/dist/config/schema-env.d.ts.map +1 -0
  167. package/dist/config/schema-normalization.d.ts +64 -0
  168. package/dist/config/schema-normalization.d.ts.map +1 -0
  169. package/dist/config/schema-runtime.d.ts +230 -0
  170. package/dist/config/schema-runtime.d.ts.map +1 -0
  171. package/dist/config/schema.d.ts +542 -3736
  172. package/dist/config/schema.d.ts.map +1 -1
  173. package/dist/config-entry.d.ts +5 -0
  174. package/dist/config-entry.d.ts.map +1 -0
  175. package/dist/{config-v9tr4rts.js → config-fjwke42y.js} +6 -4
  176. package/dist/config-hwdqjse7.js +59 -0
  177. package/dist/config-pxvewrhv.js +59 -0
  178. package/dist/config-q0g5qdga.js +59 -0
  179. package/dist/decorators/durable-object.d.ts.map +1 -1
  180. package/dist/deploy-7nmzc9r8.js +609 -0
  181. package/dist/deploy-csfhdr64.js +691 -0
  182. package/dist/deploy-ex4g5avz.js +621 -0
  183. package/dist/deploy-jnb0bhka.js +609 -0
  184. package/dist/deploy-tp0g6qdp.js +609 -0
  185. package/dist/deploy-ykpcjkc2.js +690 -0
  186. package/dist/{dev-ymtphbkg.js → dev-2pd33m28.js} +386 -348
  187. package/dist/dev-7ef5e2j1.js +2409 -0
  188. package/dist/dev-8nssqatr.js +2409 -0
  189. package/dist/dev-grznx8fn.js +2409 -0
  190. package/dist/dev-server/d1-migrations.d.ts +14 -0
  191. package/dist/dev-server/d1-migrations.d.ts.map +1 -0
  192. package/dist/dev-server/gateway-script.d.ts +8 -0
  193. package/dist/dev-server/gateway-script.d.ts.map +1 -0
  194. package/dist/dev-server/runtime-stdio.d.ts.map +1 -1
  195. package/dist/dev-server/server.d.ts.map +1 -1
  196. package/dist/dev-server/vite-process.d.ts +14 -0
  197. package/dist/dev-server/vite-process.d.ts.map +1 -0
  198. package/dist/dev-server/vite-utils.d.ts +1 -1
  199. package/dist/dev-server/vite-utils.d.ts.map +1 -1
  200. package/dist/dev-server/worker-source-watcher.d.ts +11 -0
  201. package/dist/dev-server/worker-source-watcher.d.ts.map +1 -0
  202. package/dist/dev-server/worker-surface-paths.d.ts +6 -0
  203. package/dist/dev-server/worker-surface-paths.d.ts.map +1 -0
  204. package/dist/{doctor-xv4gm1h4.js → doctor-04ammrrh.js} +67 -32
  205. package/dist/doctor-fmjj65mc.js +245 -0
  206. package/dist/doctor-fzkznce1.js +245 -0
  207. package/dist/doctor-sa5xv1bz.js +245 -0
  208. package/dist/index-091sh1ma.js +1229 -0
  209. package/dist/index-0apbm26n.js +788 -0
  210. package/dist/index-0eqksag4.js +418 -0
  211. package/dist/{index-k8vh558d.js → index-0kfzdywd.js} +15 -2
  212. package/dist/index-0w826dsr.js +379 -0
  213. package/dist/{index-5s1bz1e0.js → index-11m5a8wd.js} +100 -22
  214. package/dist/{index-0rsa2c1t.js → index-1sp39f2f.js} +110 -57
  215. package/dist/index-2jnrqbny.js +1301 -0
  216. package/dist/index-2pb7b9mw.js +378 -0
  217. package/dist/{index-3a4mmn57.js → index-2x53aqjm.js} +1065 -890
  218. package/dist/index-3ke5d2vn.js +1229 -0
  219. package/dist/index-43dq8yx8.js +788 -0
  220. package/dist/index-4rrttqj5.js +378 -0
  221. package/dist/index-4v9bc2pc.js +1367 -0
  222. package/dist/index-61jsjnsv.js +280 -0
  223. package/dist/index-6jef5emv.js +176 -0
  224. package/dist/index-6psz1h4c.js +788 -0
  225. package/dist/index-72mve6vh.js +168 -0
  226. package/dist/{index-zvgc3e0c.js → index-74198nxd.js} +159 -63
  227. package/dist/{index-7bq4xq84.js → index-7g8zyws4.js} +7 -12
  228. package/dist/index-7kcxjhta.js +456 -0
  229. package/dist/index-7v583xan.js +418 -0
  230. package/dist/index-7x0ybbtx.js +133 -0
  231. package/dist/index-816krz9p.js +52 -0
  232. package/dist/index-82f1z98k.js +41 -0
  233. package/dist/index-8t5nb4qx.js +133 -0
  234. package/dist/index-9az6s7ad.js +52 -0
  235. package/dist/{index-59df49vn.js → index-9ba1etyz.js} +29 -51
  236. package/dist/{index-001mw014.js → index-9fbtk7gv.js} +134 -248
  237. package/dist/index-9n6djthj.js +490 -0
  238. package/dist/index-aabgympv.js +39 -0
  239. package/dist/index-b8m6883k.js +74 -0
  240. package/dist/{index-5yxg30va.js → index-cgbvmse6.js} +15 -6
  241. package/dist/index-d8etnfef.js +1229 -0
  242. package/dist/index-e9yw4d6y.js +133 -0
  243. package/dist/index-epw1jxz5.js +1204 -0
  244. package/dist/index-f85s8gj3.js +2649 -0
  245. package/dist/index-fe2ngvh7.js +1229 -0
  246. package/dist/index-fvsadj32.js +192 -0
  247. package/dist/index-gs4y9gdf.js +456 -0
  248. package/dist/{index-fef08w43.js → index-h18pxvzs.js} +7 -6
  249. package/dist/index-hfj1a2c4.js +2649 -0
  250. package/dist/{index-8gtqgb3q.js → index-hjy8ctpc.js} +14 -92
  251. package/dist/index-htzf0py1.js +1204 -0
  252. package/dist/index-j185x270.js +897 -0
  253. package/dist/index-jb75kwa4.js +519 -0
  254. package/dist/index-jwd8pcb2.js +897 -0
  255. package/dist/index-k29yjhv0.js +52 -0
  256. package/dist/index-k6vq6kkt.js +456 -0
  257. package/dist/{index-vky23txa.js → index-m3fmw6mx.js} +2 -2
  258. package/dist/index-maxpsfk8.js +402 -0
  259. package/dist/index-mbdmrner.js +402 -0
  260. package/dist/index-mea5bc45.js +418 -0
  261. package/dist/index-mqekt778.js +185 -0
  262. package/dist/index-na3mnm1k.js +74 -0
  263. package/dist/index-p03n4qet.js +1367 -0
  264. package/dist/index-p296ban8.js +191 -0
  265. package/dist/index-pnbs1b8k.js +280 -0
  266. package/dist/index-q4kaz181.js +1207 -0
  267. package/dist/index-ry131z23.js +378 -0
  268. package/dist/index-sgb7c8nm.js +402 -0
  269. package/dist/index-sqrksgb2.js +133 -0
  270. package/dist/index-stgn34cr.js +148 -0
  271. package/dist/{index-v8vvsn9x.js → index-t08te69w.js} +1 -18
  272. package/dist/index-thna1tkd.js +280 -0
  273. package/dist/index-v5nmqthy.js +74 -0
  274. package/dist/{index-n932ytmq.js → index-vt4yxkmf.js} +2 -2
  275. package/dist/index-wyq6c6yj.js +402 -0
  276. package/dist/index-wztc9stx.js +418 -0
  277. package/dist/index-x9cwdxw5.js +456 -0
  278. package/dist/index-xk9djfjp.js +519 -0
  279. package/dist/index-yc0gcchc.js +418 -0
  280. package/dist/index-yqbxjysa.js +897 -0
  281. package/dist/index-yzddwp02.js +788 -0
  282. package/dist/index-zfhq6s96.js +74 -0
  283. package/dist/index-zt22fe2j.js +54 -0
  284. package/dist/index-zyt5byt6.js +2649 -0
  285. package/dist/index.d.ts +2 -2
  286. package/dist/index.d.ts.map +1 -1
  287. package/dist/{init-na2atvz2.js → init-r4hnxan3.js} +24 -17
  288. package/dist/login-2hnz4m4n.js +77 -0
  289. package/dist/login-5bsxxpvc.js +77 -0
  290. package/dist/login-6tzvczw2.js +77 -0
  291. package/dist/login-bhaw72zc.js +77 -0
  292. package/dist/login-x8tgckqm.js +77 -0
  293. package/dist/previews-3rn8mz2c.js +1168 -0
  294. package/dist/previews-d487qde5.js +1200 -0
  295. package/dist/previews-gm3z0syj.js +1168 -0
  296. package/dist/previews-j9ymq4ys.js +1169 -0
  297. package/dist/previews-q031mx34.js +1168 -0
  298. package/dist/productions-120xg0aq.js +505 -0
  299. package/dist/productions-5ev5qweg.js +505 -0
  300. package/dist/productions-me3tdvr9.js +505 -0
  301. package/dist/productions-p5rbgp2f.js +505 -0
  302. package/dist/productions-x9p0pym1.js +505 -0
  303. package/dist/runtime/context-events.d.ts +13 -0
  304. package/dist/runtime/context-events.d.ts.map +1 -0
  305. package/dist/runtime/context-types.d.ts +82 -0
  306. package/dist/runtime/context-types.d.ts.map +1 -0
  307. package/dist/runtime/context.d.ts +6 -267
  308. package/dist/runtime/context.d.ts.map +1 -1
  309. package/dist/runtime/exports.d.ts +3 -3
  310. package/dist/runtime/index.d.ts +1 -1
  311. package/dist/runtime/index.d.ts.map +1 -1
  312. package/dist/runtime/middleware.d.ts +8 -38
  313. package/dist/runtime/middleware.d.ts.map +1 -1
  314. package/dist/src/browser.js +9 -17
  315. package/dist/src/cli/index.js +3 -1
  316. package/dist/src/cloudflare/index.js +49 -3
  317. package/dist/src/config-entry.js +14 -0
  318. package/dist/src/index.js +24 -20
  319. package/dist/src/runtime/index.js +3 -9
  320. package/dist/src/sveltekit/index.js +10 -8
  321. package/dist/src/test/index.js +16 -19
  322. package/dist/src/vite/index.js +7 -5
  323. package/dist/sveltekit/platform.d.ts +1 -1
  324. package/dist/sveltekit/platform.d.ts.map +1 -1
  325. package/dist/test/cf.d.ts +10 -10
  326. package/dist/test/email.d.ts.map +1 -1
  327. package/dist/test/index.d.ts +1 -6
  328. package/dist/test/index.d.ts.map +1 -1
  329. package/dist/test/queue.d.ts.map +1 -1
  330. package/dist/test/remote-ai.d.ts.map +1 -1
  331. package/dist/test/remote-cloudflare.d.ts +13 -0
  332. package/dist/test/remote-cloudflare.d.ts.map +1 -0
  333. package/dist/test/remote-vectorize.d.ts.map +1 -1
  334. package/dist/test/resolve-service-bindings.d.ts.map +1 -1
  335. package/dist/test/scheduled.d.ts.map +1 -1
  336. package/dist/test/should-skip.d.ts +0 -18
  337. package/dist/test/should-skip.d.ts.map +1 -1
  338. package/dist/test/simple-context-durable-objects.d.ts +6 -0
  339. package/dist/test/simple-context-durable-objects.d.ts.map +1 -0
  340. package/dist/test/simple-context-gateway-script.d.ts +2 -0
  341. package/dist/test/simple-context-gateway-script.d.ts.map +1 -0
  342. package/dist/test/simple-context-paths.d.ts +40 -0
  343. package/dist/test/simple-context-paths.d.ts.map +1 -0
  344. package/dist/test/simple-context.d.ts +1 -23
  345. package/dist/test/simple-context.d.ts.map +1 -1
  346. package/dist/test/tail.d.ts.map +1 -1
  347. package/dist/test/worker.d.ts.map +1 -1
  348. package/dist/token-kedhcret.js +419 -0
  349. package/dist/token-m8jmnjwk.js +419 -0
  350. package/dist/{types-158m16vd.js → types-0sqwkp7x.js} +244 -140
  351. package/dist/types-1gwr2ex6.js +572 -0
  352. package/dist/types-6e5yx6km.js +572 -0
  353. package/dist/types-p0gckpn6.js +572 -0
  354. package/dist/utils/send-email.d.ts.map +1 -1
  355. package/dist/vite/config-file.d.ts.map +1 -1
  356. package/dist/vite/plugin.d.ts.map +1 -1
  357. package/dist/worker-0srh2jfr.js +513 -0
  358. package/dist/worker-4xrfd10a.js +513 -0
  359. package/dist/worker-entry/composed-worker.d.ts +0 -7
  360. package/dist/worker-entry/composed-worker.d.ts.map +1 -1
  361. package/dist/worker-entry/surface-paths.d.ts +15 -0
  362. package/dist/worker-entry/surface-paths.d.ts.map +1 -0
  363. package/dist/worker-qtam8grz.js +513 -0
  364. package/dist/worker-qzm0b7br.js +513 -0
  365. package/dist/worker-y9ha6g44.js +513 -0
  366. package/package.json +17 -10
  367. package/R2.md +0 -200
  368. package/dist/account-spa7gzsn.js +0 -421
  369. package/dist/build-zv25ke4s.js +0 -102
  370. package/dist/deploy-6xmqvv06.js +0 -118
  371. package/dist/index-2q3pmzrx.js +0 -90
  372. package/dist/index-6nb7w45m.js +0 -79
  373. package/dist/index-tksw7gpy.js +0 -503
  374. package/dist/index-v43z02tr.js +0 -205
  375. package/dist/index-xdq9ery1.js +0 -664
  376. package/dist/test/multi-worker-context.d.ts +0 -114
  377. package/dist/test/multi-worker-context.d.ts.map +0 -1
@@ -1,503 +0,0 @@
1
- import {
2
- getEffectiveAccountId,
3
- getPrimaryAccount,
4
- listD1Databases
5
- } from "./index-xdq9ery1.js";
6
-
7
- // src/config/schema.ts
8
- import { z } from "zod";
9
- var dateRegex = /^\d{4}-\d{2}-\d{2}$/;
10
- var compatibilityDateSchema = z.string().regex(dateRegex, {
11
- message: "Compatibility date must be in YYYY-MM-DD format"
12
- });
13
- var routesConfigSchema = z.object({
14
- dir: z.string(),
15
- prefix: z.string().optional()
16
- });
17
- var filesSchema = z.object({
18
- fetch: z.union([z.string(), z.literal(false)]).optional(),
19
- queue: z.union([z.string(), z.literal(false)]).optional(),
20
- scheduled: z.union([z.string(), z.literal(false)]).optional(),
21
- email: z.union([z.string(), z.literal(false)]).optional(),
22
- durableObjects: z.union([z.string(), z.literal(false)]).optional(),
23
- entrypoints: z.union([z.string(), z.literal(false)]).optional(),
24
- workflows: z.union([z.string(), z.literal(false)]).optional(),
25
- routes: z.union([routesConfigSchema, z.literal(false)]).optional(),
26
- transport: z.union([z.string(), z.null()]).optional()
27
- }).optional();
28
- var durableObjectBindingSchema = z.custom((val) => {
29
- if (typeof val === "string")
30
- return true;
31
- if (val && typeof val === "object" && "className" in val) {
32
- const obj = val;
33
- return typeof obj.className === "string";
34
- }
35
- return false;
36
- }, {
37
- message: "Expected string or { className: string, scriptName?: string }"
38
- });
39
- var queueConsumerSchema = z.object({
40
- queue: z.string(),
41
- maxBatchSize: z.number().optional(),
42
- maxBatchTimeout: z.number().optional(),
43
- maxRetries: z.number().optional(),
44
- deadLetterQueue: z.string().optional(),
45
- maxConcurrency: z.number().optional(),
46
- retryDelay: z.number().optional()
47
- });
48
- var queuesConfigSchema = z.object({
49
- producers: z.record(z.string(), z.string()).optional(),
50
- consumers: z.array(queueConsumerSchema).optional()
51
- });
52
- var serviceBindingSchema = z.custom((val) => {
53
- if (typeof val !== "object" && typeof val !== "function")
54
- return false;
55
- const obj = val;
56
- const service = obj.service;
57
- if (typeof service !== "string")
58
- return false;
59
- return true;
60
- }, {
61
- message: "Expected service binding object with { service: string } or ref().worker"
62
- });
63
- var aiBindingSchema = z.object({
64
- binding: z.string()
65
- });
66
- var vectorizeBindingSchema = z.object({
67
- indexName: z.string()
68
- });
69
- var hyperdriveBindingSchema = z.object({
70
- id: z.string()
71
- });
72
- var browserBindingSchema = z.object({
73
- binding: z.string()
74
- });
75
- var analyticsBindingSchema = z.object({
76
- dataset: z.string()
77
- });
78
- var sendEmailBindingSchema = z.object({
79
- destinationAddress: z.string().optional(),
80
- allowedDestinationAddresses: z.array(z.string()).optional(),
81
- allowedSenderAddresses: z.array(z.string()).optional()
82
- }).refine((binding) => {
83
- return !(binding.destinationAddress && binding.allowedDestinationAddresses);
84
- }, {
85
- message: "sendEmail bindings must use either destinationAddress or allowedDestinationAddresses, not both",
86
- path: ["allowedDestinationAddresses"]
87
- });
88
- var d1BindingByIdSchema = z.object({
89
- id: z.string()
90
- }).strict();
91
- var d1BindingByNameSchema = z.object({
92
- name: z.string()
93
- }).strict();
94
- var d1BindingSchema = z.union([
95
- z.string(),
96
- d1BindingByIdSchema,
97
- d1BindingByNameSchema
98
- ]);
99
- var bindingsSchema = z.object({
100
- kv: z.record(z.string(), z.string()).optional(),
101
- d1: z.record(z.string(), d1BindingSchema).optional(),
102
- r2: z.record(z.string(), z.string()).optional(),
103
- durableObjects: z.record(z.string(), durableObjectBindingSchema).optional(),
104
- queues: queuesConfigSchema.optional(),
105
- services: z.record(z.string(), serviceBindingSchema).optional(),
106
- ai: aiBindingSchema.optional(),
107
- vectorize: z.record(z.string(), vectorizeBindingSchema).optional(),
108
- hyperdrive: z.record(z.string(), hyperdriveBindingSchema).optional(),
109
- browser: browserBindingSchema.optional(),
110
- analyticsEngine: z.record(z.string(), analyticsBindingSchema).optional(),
111
- sendEmail: z.record(z.string(), sendEmailBindingSchema).optional()
112
- }).optional();
113
- var triggersSchema = z.object({
114
- crons: z.array(z.string()).optional()
115
- }).optional();
116
- var secretConfigSchema = z.object({
117
- required: z.boolean().optional().default(true)
118
- });
119
- var routeConfigSchema = z.object({
120
- pattern: z.string(),
121
- zone_name: z.string().optional(),
122
- zone_id: z.string().optional(),
123
- custom_domain: z.boolean().optional()
124
- });
125
- var wsRouteConfigSchema = z.object({
126
- pattern: z.string(),
127
- doNamespace: z.string(),
128
- idParam: z.string().default("id"),
129
- forwardPath: z.string().default("/websocket")
130
- });
131
- var assetsConfigSchema = z.object({
132
- directory: z.string(),
133
- binding: z.string().optional()
134
- }).optional();
135
- var observabilitySchema = z.object({
136
- enabled: z.boolean().optional(),
137
- head_sampling_rate: z.number().min(0).max(1).optional()
138
- }).optional();
139
- var limitsSchema = z.object({
140
- cpu_ms: z.number().optional()
141
- }).optional();
142
- var rolldownOptionsSchema = z.custom((value) => {
143
- return typeof value === "object" && value !== null && !Array.isArray(value);
144
- }, {
145
- message: "Expected Rolldown options object"
146
- });
147
- var rolldownConfigSchema = z.object({
148
- target: z.string().optional(),
149
- minify: z.boolean().optional(),
150
- sourcemap: z.boolean().optional(),
151
- options: rolldownOptionsSchema.optional()
152
- }).optional();
153
- var viteConfigSchema = z.object({
154
- plugins: z.array(z.unknown()).optional()
155
- }).catchall(z.unknown()).optional();
156
- var buildConfigSchema = z.object({
157
- target: z.string().optional(),
158
- minify: z.boolean().optional(),
159
- sourcemap: z.boolean().optional(),
160
- rolldownOptions: rolldownOptionsSchema.optional()
161
- }).optional();
162
- function normalizeViteConfig(vite, plugins) {
163
- const normalizedVite = {
164
- ...plugins !== undefined ? { plugins } : {},
165
- ...vite ?? {}
166
- };
167
- return Object.keys(normalizedVite).length > 0 ? normalizedVite : undefined;
168
- }
169
- function normalizeRolldownConfig(rolldown, build) {
170
- const normalizedRolldown = {
171
- ...build?.target !== undefined ? { target: build.target } : {},
172
- ...build?.minify !== undefined ? { minify: build.minify } : {},
173
- ...build?.sourcemap !== undefined ? { sourcemap: build.sourcemap } : {},
174
- ...build?.rolldownOptions !== undefined ? { options: build.rolldownOptions } : {},
175
- ...rolldown ?? {}
176
- };
177
- return Object.keys(normalizedRolldown).length > 0 ? normalizedRolldown : undefined;
178
- }
179
- var migrationSchema = z.object({
180
- tag: z.string(),
181
- new_classes: z.array(z.string()).optional(),
182
- renamed_classes: z.array(z.object({
183
- from: z.string(),
184
- to: z.string()
185
- })).optional(),
186
- deleted_classes: z.array(z.string()).optional(),
187
- new_sqlite_classes: z.array(z.string()).optional()
188
- });
189
- var wranglerConfigSchema = z.object({
190
- passthrough: z.record(z.string(), z.unknown()).optional()
191
- }).optional();
192
- var envConfigSchema = z.object({
193
- name: z.string().optional(),
194
- compatibilityDate: compatibilityDateSchema.optional(),
195
- compatibilityFlags: z.array(z.string()).optional(),
196
- files: filesSchema,
197
- bindings: bindingsSchema,
198
- triggers: triggersSchema,
199
- vars: z.record(z.string(), z.string()).optional(),
200
- secrets: z.record(z.string(), secretConfigSchema).optional(),
201
- routes: z.array(routeConfigSchema).optional(),
202
- assets: assetsConfigSchema,
203
- limits: limitsSchema,
204
- observability: observabilitySchema,
205
- migrations: z.array(migrationSchema).optional(),
206
- rolldown: rolldownConfigSchema,
207
- vite: viteConfigSchema,
208
- wrangler: wranglerConfigSchema
209
- }).partial();
210
- var envConfigSchemaInner = envConfigSchema.extend({
211
- build: buildConfigSchema,
212
- plugins: z.array(z.unknown()).optional()
213
- }).transform((config) => {
214
- const normalizedVite = normalizeViteConfig(config.vite, config.plugins);
215
- const normalizedRolldown = normalizeRolldownConfig(config.rolldown, config.build);
216
- const {
217
- build: _legacyBuild,
218
- plugins: _legacyPlugins,
219
- vite: _vite,
220
- rolldown: _rolldown,
221
- ...rest
222
- } = config;
223
- return {
224
- ...rest,
225
- ...normalizedVite ? { vite: normalizedVite } : {},
226
- ...normalizedRolldown ? { rolldown: normalizedRolldown } : {}
227
- };
228
- });
229
- function getCurrentDate() {
230
- const now = new Date;
231
- return now.toISOString().split("T")[0];
232
- }
233
- var FORCED_COMPATIBILITY_FLAGS = ["nodejs_compat", "nodejs_als"];
234
- var canonicalConfigSchema = z.object({
235
- name: z.string({
236
- required_error: "Worker name is required"
237
- }),
238
- accountId: z.string().optional(),
239
- compatibilityDate: compatibilityDateSchema.optional().default(getCurrentDate),
240
- compatibilityFlags: z.array(z.string()).optional().transform((flags = []) => {
241
- const merged = new Set([...FORCED_COMPATIBILITY_FLAGS, ...flags]);
242
- return [...merged];
243
- }),
244
- files: filesSchema,
245
- bindings: bindingsSchema,
246
- triggers: triggersSchema,
247
- vars: z.record(z.string(), z.string()).optional(),
248
- secrets: z.record(z.string(), secretConfigSchema).optional(),
249
- routes: z.array(routeConfigSchema).optional(),
250
- wsRoutes: z.array(wsRouteConfigSchema).optional(),
251
- assets: assetsConfigSchema,
252
- limits: limitsSchema,
253
- observability: observabilitySchema,
254
- migrations: z.array(migrationSchema).optional(),
255
- rolldown: rolldownConfigSchema,
256
- vite: viteConfigSchema,
257
- env: z.record(z.string(), envConfigSchemaInner).optional(),
258
- wrangler: wranglerConfigSchema
259
- });
260
- var configSchema = canonicalConfigSchema.extend({
261
- build: buildConfigSchema,
262
- plugins: z.array(z.unknown()).optional()
263
- }).transform((config) => {
264
- const normalizedVite = normalizeViteConfig(config.vite, config.plugins);
265
- const normalizedRolldown = normalizeRolldownConfig(config.rolldown, config.build);
266
- const {
267
- build: _legacyBuild,
268
- plugins: _legacyPlugins,
269
- vite: _vite,
270
- rolldown: _rolldown,
271
- ...rest
272
- } = config;
273
- return {
274
- ...rest,
275
- ...normalizedVite ? { vite: normalizedVite } : {},
276
- ...normalizedRolldown ? { rolldown: normalizedRolldown } : {}
277
- };
278
- });
279
- function normalizeDOBinding(config) {
280
- if (typeof config === "string") {
281
- return { className: config };
282
- }
283
- return {
284
- className: config.className,
285
- scriptName: config.scriptName,
286
- __ref: config.__ref
287
- };
288
- }
289
- function normalizeD1Binding(config) {
290
- if (typeof config === "string") {
291
- return { databaseId: config };
292
- }
293
- if ("id" in config) {
294
- return { databaseId: config.id };
295
- }
296
- return { name: config.name };
297
- }
298
- function getLocalD1DatabaseIdentifier(config) {
299
- const normalized = normalizeD1Binding(config);
300
- return normalized.databaseId ?? normalized.name ?? "";
301
- }
302
-
303
- // src/config/loader.ts
304
- import { loadConfig as c12LoadConfig } from "c12";
305
- import { existsSync } from "node:fs";
306
- import { join } from "pathe";
307
- var CONFIG_FILES = [
308
- "devflare.config.ts",
309
- "devflare.config.mts",
310
- "devflare.config.js",
311
- "devflare.config.mjs"
312
- ];
313
- async function resolveConfigPath(cwd) {
314
- for (const file of CONFIG_FILES) {
315
- const path = join(cwd, file);
316
- if (existsSync(path)) {
317
- return path;
318
- }
319
- }
320
- return;
321
- }
322
- async function loadConfig(options = {}) {
323
- const cwd = options.cwd ?? process.cwd();
324
- const configFile = options.configFile ?? "devflare.config";
325
- const { config, configFile: loadedFile } = await c12LoadConfig({
326
- name: "devflare",
327
- cwd,
328
- configFile,
329
- defaultConfig: undefined,
330
- rcFile: false,
331
- globalRc: false,
332
- dotenv: false
333
- });
334
- if (!config || !loadedFile) {
335
- throw new ConfigNotFoundError(cwd, configFile);
336
- }
337
- const result = configSchema.safeParse(config);
338
- if (!result.success) {
339
- throw new ConfigValidationError(result.error.issues, loadedFile);
340
- }
341
- return result.data;
342
- }
343
-
344
- class ConfigNotFoundError extends Error {
345
- cwd;
346
- configFile;
347
- code = "CONFIG_NOT_FOUND";
348
- constructor(cwd, configFile) {
349
- super(`Config file not found in ${cwd}.
350
- ` + `Expected one of: ${CONFIG_FILES.join(", ")}
351
- ` + `Run 'devflare init' to create a new config.`);
352
- this.cwd = cwd;
353
- this.configFile = configFile;
354
- this.name = "ConfigNotFoundError";
355
- }
356
- }
357
-
358
- class ConfigValidationError extends Error {
359
- issues;
360
- configFile;
361
- code = "CONFIG_VALIDATION_ERROR";
362
- constructor(issues, configFile) {
363
- const issueMessages = issues.map((i) => ` - ${i.path.join(".")}: ${i.message}`).join(`
364
- `);
365
- super(`Invalid config in ${configFile}:
366
- ${issueMessages}`);
367
- this.issues = issues;
368
- this.configFile = configFile;
369
- this.name = "ConfigValidationError";
370
- }
371
- }
372
-
373
- // src/config/resolve.ts
374
- import { defu } from "defu";
375
- function resolveConfigForEnvironment(config, environment) {
376
- if (environment && config.env?.[environment]) {
377
- return defu(config.env[environment], config);
378
- }
379
- return config;
380
- }
381
-
382
- // src/config/resource-resolution.ts
383
- var defaultCloudflareApi = {
384
- getPrimaryAccount,
385
- getEffectiveAccountId,
386
- listD1Databases
387
- };
388
-
389
- class ConfigResourceResolutionError extends Error {
390
- code = "CONFIG_RESOURCE_RESOLUTION_ERROR";
391
- constructor(message, cause) {
392
- super(message);
393
- this.name = "ConfigResourceResolutionError";
394
- if (cause !== undefined) {
395
- this.cause = cause;
396
- }
397
- }
398
- }
399
- function resolveCloudflareApi(overrides) {
400
- return {
401
- ...defaultCloudflareApi,
402
- ...overrides ?? {}
403
- };
404
- }
405
- function materializeLocalD1Bindings(bindings) {
406
- return Object.fromEntries(Object.entries(bindings).map(([bindingName, bindingConfig]) => {
407
- return [bindingName, getLocalD1DatabaseIdentifier(bindingConfig)];
408
- }));
409
- }
410
- async function resolveLookupAccountId(config, options, cloudflareApi) {
411
- const explicitAccountId = options.accountId ?? config.accountId;
412
- if (explicitAccountId) {
413
- return explicitAccountId;
414
- }
415
- let primaryAccount;
416
- try {
417
- primaryAccount = await cloudflareApi.getPrimaryAccount();
418
- } catch (error) {
419
- throw new ConfigResourceResolutionError("Could not resolve D1 database names because Devflare could not read your Cloudflare accounts. Set accountId in devflare.config.ts, configure a workspace/global default account, or log in with Wrangler.", error);
420
- }
421
- if (!primaryAccount) {
422
- throw new ConfigResourceResolutionError("Could not resolve D1 database names because no Cloudflare account is available. Set accountId in devflare.config.ts, configure a workspace/global default account, or log in with Wrangler.");
423
- }
424
- try {
425
- const { accountId } = await cloudflareApi.getEffectiveAccountId(primaryAccount.id);
426
- return accountId;
427
- } catch (error) {
428
- throw new ConfigResourceResolutionError(`Could not determine the effective Cloudflare account for D1 name resolution after selecting primary account ${primaryAccount.id}.`, error);
429
- }
430
- }
431
- function formatMissingD1Bindings(missing) {
432
- return missing.map(({ bindingName, databaseName }) => `${bindingName} → ${databaseName}`).join(", ");
433
- }
434
- function resolveConfigForLocalRuntime(config, environment) {
435
- const resolvedConfig = resolveConfigForEnvironment(config, environment);
436
- if (!resolvedConfig.bindings?.d1) {
437
- return resolvedConfig;
438
- }
439
- return {
440
- ...resolvedConfig,
441
- bindings: {
442
- ...resolvedConfig.bindings,
443
- d1: materializeLocalD1Bindings(resolvedConfig.bindings.d1)
444
- }
445
- };
446
- }
447
- async function resolveConfigResources(config, options = {}) {
448
- const resolvedConfig = resolveConfigForEnvironment(config, options.environment);
449
- const d1Bindings = resolvedConfig.bindings?.d1;
450
- if (!d1Bindings) {
451
- return resolvedConfig;
452
- }
453
- const pendingNameBindings = Object.entries(d1Bindings).map(([bindingName, bindingConfig]) => {
454
- const normalized = normalizeD1Binding(bindingConfig);
455
- return normalized.databaseId ? null : {
456
- bindingName,
457
- databaseName: normalized.name ?? ""
458
- };
459
- }).filter((binding) => binding !== null);
460
- if (pendingNameBindings.length === 0) {
461
- return {
462
- ...resolvedConfig,
463
- bindings: {
464
- ...resolvedConfig.bindings,
465
- d1: materializeLocalD1Bindings(d1Bindings)
466
- }
467
- };
468
- }
469
- const cloudflareApi = resolveCloudflareApi(options.cloudflare);
470
- const accountId = await resolveLookupAccountId(resolvedConfig, options, cloudflareApi);
471
- let databases;
472
- try {
473
- databases = await cloudflareApi.listD1Databases(accountId);
474
- } catch (error) {
475
- throw new ConfigResourceResolutionError(`Could not list D1 databases for Cloudflare account ${accountId} while resolving name-based D1 bindings.`, error);
476
- }
477
- const databaseIdsByName = new Map(databases.map((database) => [database.name, database.id]));
478
- const missingBindings = pendingNameBindings.filter(({ databaseName }) => {
479
- return !databaseIdsByName.has(databaseName);
480
- });
481
- if (missingBindings.length > 0) {
482
- throw new ConfigResourceResolutionError(`Could not find D1 database(s) for ${formatMissingD1Bindings(missingBindings)} in Cloudflare account ${accountId}.`);
483
- }
484
- return {
485
- ...resolvedConfig,
486
- bindings: {
487
- ...resolvedConfig.bindings,
488
- d1: Object.fromEntries(Object.entries(d1Bindings).map(([bindingName, bindingConfig]) => {
489
- const normalized = normalizeD1Binding(bindingConfig);
490
- return [
491
- bindingName,
492
- normalized.databaseId ?? databaseIdsByName.get(normalized.name ?? "") ?? ""
493
- ];
494
- }))
495
- }
496
- };
497
- }
498
- async function loadResolvedConfig(options = {}) {
499
- const config = await loadConfig(options);
500
- return resolveConfigResources(config, options);
501
- }
502
-
503
- export { configSchema, normalizeDOBinding, normalizeD1Binding, getLocalD1DatabaseIdentifier, resolveConfigForEnvironment, ConfigResourceResolutionError, resolveConfigForLocalRuntime, resolveConfigResources, loadResolvedConfig, resolveConfigPath, loadConfig, ConfigNotFoundError, ConfigValidationError };
@@ -1,205 +0,0 @@
1
- import {
2
- getPackageVersion
3
- } from "./index-6h8xbs75.js";
4
- import {
5
- __require
6
- } from "./index-37x76zdn.js";
7
-
8
- // src/cli/index.ts
9
- import { createConsola } from "consola";
10
- var COMMANDS = ["init", "dev", "build", "deploy", "types", "doctor", "config", "account", "ai", "remote", "help", "version"];
11
- function parseArgs(argv) {
12
- const args = [];
13
- const options = {};
14
- let command = "help";
15
- let unknownCommand;
16
- let i = 0;
17
- while (i < argv.length) {
18
- const arg = argv[i];
19
- if (arg === "--help" || arg === "-h") {
20
- return { command: "help", args: [], options: {} };
21
- }
22
- if (arg === "--version" || arg === "-v") {
23
- return { command: "version", args: [], options: {} };
24
- }
25
- if (arg.startsWith("-") && !/^-\d/.test(arg)) {
26
- const isLongFlag = arg.startsWith("--");
27
- const key = isLongFlag ? arg.slice(2) : arg.slice(1);
28
- const nextArg = argv[i + 1];
29
- if (nextArg && !nextArg.startsWith("-")) {
30
- options[key] = nextArg;
31
- i += 2;
32
- } else {
33
- options[key] = true;
34
- i++;
35
- }
36
- } else if (!command || command === "help") {
37
- if (COMMANDS.includes(arg)) {
38
- command = arg;
39
- } else {
40
- command = "help";
41
- unknownCommand = arg;
42
- }
43
- i++;
44
- } else {
45
- args.push(arg);
46
- i++;
47
- }
48
- }
49
- return { command, args, options, unknownCommand };
50
- }
51
- function getHelpText() {
52
- return `
53
- devflare - Config compiler + CLI orchestrator for Cloudflare Workers
54
-
55
- Usage:
56
- devflare <command> [options]
57
-
58
- Commands:
59
- init [name] Create a new devflare project
60
- dev Start the development server
61
- build Build for production
62
- deploy Deploy to Cloudflare
63
- types Generate TypeScript types
64
- doctor Check project configuration
65
- config Print resolved Devflare/Wrangler config
66
- account View Cloudflare account info
67
- ai View AI models and pricing
68
- remote Manage remote test mode (AI, Vectorize)
69
- help Show command overview
70
- version Show the installed devflare version
71
-
72
- Common Options:
73
- --config <path> Used by dev, build, deploy, types, doctor, and config
74
- --env <name> Used by build, deploy, and config to select config.env[name]
75
- --debug Enable debug output for supported commands
76
- -h, --help Show help
77
- -v, --version Show version
78
-
79
- Dev Options:
80
- --port <port> Preferred Vite dev server port (default: 5173)
81
- --persist Persist Miniflare storage data
82
- --verbose Enable verbose logging
83
- --log Log all output to a timestamped .log-* file and the terminal
84
- --log-temp Log all output to .log (overwritten) and the terminal
85
-
86
- Build / Deploy:
87
- build --env <name> Use config.env[name]
88
- deploy --env <name> Use config.env[name]
89
- deploy --dry-run Print the generated Wrangler config without deploying
90
-
91
- Types / Doctor:
92
- types --output <path> Write generated types to a custom path
93
- doctor --config <path> Check a specific devflare config file
94
- config print --json Print resolved config as JSON
95
- config print --format wrangler Print resolved Wrangler config JSON
96
-
97
- Account / Remote:
98
- account --account <id> Use a specific Cloudflare account
99
- remote status Show current remote-mode status
100
- remote enable [minutes] Enable remote mode (default: 30 minutes)
101
- remote disable Disable remote mode
102
-
103
- Notes:
104
- • Worker-only mode is the default when the current package has no local vite.config.*
105
- • Vite is started only when the current package provides a local vite.config.*
106
- • Higher-level build flows currently synthesize a composed worker entry when worker surfaces are discovered
107
-
108
- Examples:
109
- devflare init my-app
110
- devflare dev # Start worker-only or unified dev server
111
- devflare dev --port 3000 # Custom Vite port when Vite is enabled
112
- devflare dev --persist # Persist storage between restarts
113
- devflare dev --log-temp # Log output to .log file
114
- devflare build
115
- devflare deploy --env production
116
- `.trim();
117
- }
118
- async function runCli(argv, options = {}) {
119
- const logger = createConsola({
120
- level: options.silent ? -999 : 3,
121
- formatOptions: {
122
- date: false
123
- }
124
- });
125
- const parsed = parseArgs(argv);
126
- if (parsed.unknownCommand) {
127
- logger.error(`Unknown command: ${parsed.unknownCommand}`);
128
- logger.info("Run `devflare --help` for available commands");
129
- return { exitCode: 1 };
130
- }
131
- switch (parsed.command) {
132
- case "help":
133
- logger.info(getHelpText());
134
- return { exitCode: 0, output: getHelpText() };
135
- case "version":
136
- const version = await getPackageVersion();
137
- logger.info(`devflare v${version}`);
138
- return { exitCode: 0, output: version };
139
- case "init":
140
- return runInit(parsed, logger, options);
141
- case "dev":
142
- return runDev(parsed, logger, options);
143
- case "build":
144
- return runBuild(parsed, logger, options);
145
- case "deploy":
146
- return runDeploy(parsed, logger, options);
147
- case "types":
148
- return runTypes(parsed, logger, options);
149
- case "doctor":
150
- return runDoctor(parsed, logger, options);
151
- case "config":
152
- return runConfig(parsed, logger, options);
153
- case "account":
154
- return runAccount(parsed, logger, options);
155
- case "ai":
156
- return runAI();
157
- case "remote":
158
- return runRemote(parsed, logger, options);
159
- default:
160
- logger.error(`Unknown command: ${parsed.command}`);
161
- return { exitCode: 1 };
162
- }
163
- }
164
- async function runInit(parsed, logger, options) {
165
- const { runInitCommand } = await import("./init-na2atvz2.js");
166
- return runInitCommand(parsed, logger, options);
167
- }
168
- async function runDev(parsed, logger, options) {
169
- const { runDevCommand } = await import("./dev-ymtphbkg.js");
170
- return runDevCommand(parsed, logger, options);
171
- }
172
- async function runBuild(parsed, logger, options) {
173
- const { runBuildCommand } = await import("./build-zv25ke4s.js");
174
- return runBuildCommand(parsed, logger, options);
175
- }
176
- async function runDeploy(parsed, logger, options) {
177
- const { runDeployCommand } = await import("./deploy-6xmqvv06.js");
178
- return runDeployCommand(parsed, logger, options);
179
- }
180
- async function runTypes(parsed, logger, options) {
181
- const { runTypesCommand } = await import("./types-158m16vd.js");
182
- return runTypesCommand(parsed, logger, options);
183
- }
184
- async function runDoctor(parsed, logger, options) {
185
- const { runDoctorCommand } = await import("./doctor-xv4gm1h4.js");
186
- return runDoctorCommand(parsed, logger, options);
187
- }
188
- async function runConfig(parsed, logger, options) {
189
- const { runConfigCommand } = await import("./config-v9tr4rts.js");
190
- return runConfigCommand(parsed, logger, options);
191
- }
192
- async function runAccount(parsed, logger, options) {
193
- const { runAccountCommand } = await import("./account-spa7gzsn.js");
194
- return runAccountCommand(parsed, logger, options);
195
- }
196
- async function runAI() {
197
- const { runAICommand } = await import("./ai-dx4fr9jh.js");
198
- return runAICommand();
199
- }
200
- async function runRemote(parsed, logger, options) {
201
- const { runRemoteCommand } = await import("./remote-q59qk463.js");
202
- return runRemoteCommand(parsed, logger, options);
203
- }
204
-
205
- export { parseArgs, runCli };