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,13 +1,21 @@
1
1
  import {
2
2
  resolveConfigCandidatePath
3
- } from "./index-k8vh558d.js";
3
+ } from "./index-816krz9p.js";
4
4
  import {
5
5
  getDependencies
6
6
  } from "./index-1xpj0m4r.js";
7
7
  import {
8
- discoverEntrypointsAsync,
8
+ bold,
9
+ createCliTheme,
10
+ dim
11
+ } from "./index-stgn34cr.js";
12
+ import"./index-3t6rypgc.js";
13
+ import {
14
+ discoverEntrypointsAsync
15
+ } from "./index-zt22fe2j.js";
16
+ import {
9
17
  resolvePackageSpecifier
10
- } from "./index-2q3pmzrx.js";
18
+ } from "./index-82f1z98k.js";
11
19
  import {
12
20
  DEFAULT_DO_PATTERN,
13
21
  DEFAULT_ENTRYPOINT_PATTERN,
@@ -16,91 +24,179 @@ import {
16
24
  import {
17
25
  findDurableObjectClasses
18
26
  } from "./index-9wt9x09k.js";
19
- import"./index-5s1bz1e0.js";
27
+ import"./index-thna1tkd.js";
20
28
  import {
21
29
  loadConfig,
22
30
  normalizeDOBinding
23
- } from "./index-tksw7gpy.js";
24
- import"./index-v8vvsn9x.js";
25
- import"./index-xdq9ery1.js";
26
- import {
27
- __require
28
- } from "./index-37x76zdn.js";
31
+ } from "./index-0apbm26n.js";
32
+ import"./index-jb75kwa4.js";
33
+ import"./index-0w826dsr.js";
34
+ import"./index-6jef5emv.js";
35
+ import"./index-t08te69w.js";
36
+ import"./index-37x76zdn.js";
29
37
 
30
38
  // src/cli/commands/types.ts
31
- import { resolve, relative, dirname } from "pathe";
39
+ import { resolve } from "pathe";
40
+
41
+ // src/cli/commands/type-generation/discovery.ts
42
+ import { readFile } from "node:fs/promises";
43
+ import { dirname, relative } from "pathe";
44
+ var DEFAULT_INTERFACE_LOOKUP_KEYS = new Set(["Worker", "Default", "MathService"]);
45
+ var interfaceTypeCache = new Map;
46
+ async function readFileIfAvailable(filePath) {
47
+ try {
48
+ return await readFile(filePath, "utf-8");
49
+ } catch {
50
+ return null;
51
+ }
52
+ }
53
+ function getInterfaceSearchKey(searchDirs) {
54
+ return [...new Set(searchDirs)].sort((left, right) => left.localeCompare(right)).join("\x00");
55
+ }
56
+ function getPatternMatches(pattern, code) {
57
+ const matches = [];
58
+ pattern.lastIndex = 0;
59
+ let nextMatch = pattern.exec(code);
60
+ while (nextMatch !== null) {
61
+ matches.push(nextMatch);
62
+ nextMatch = pattern.exec(code);
63
+ }
64
+ return matches;
65
+ }
66
+ function getInterfaceBaseName(interfaceName) {
67
+ if (interfaceName.endsWith("Interface")) {
68
+ return interfaceName.slice(0, -9);
69
+ }
70
+ if (interfaceName.endsWith("Rpc")) {
71
+ return interfaceName.slice(0, -3);
72
+ }
73
+ return null;
74
+ }
75
+ function registerInterfaceType(interfaces, baseName, interfaceInfo) {
76
+ if (!interfaces.has(baseName)) {
77
+ interfaces.set(baseName, interfaceInfo);
78
+ }
79
+ if (!interfaces.has("__default__") && DEFAULT_INTERFACE_LOOKUP_KEYS.has(baseName)) {
80
+ interfaces.set("__default__", interfaceInfo);
81
+ }
82
+ }
83
+ async function collectInterfaceTypesFromFile(interfaces, filePath) {
84
+ const code = await readFileIfAvailable(filePath);
85
+ if (!code) {
86
+ return;
87
+ }
88
+ const interfacePattern = /export\s+interface\s+(\w+(?:Interface|Rpc))\s*\{/g;
89
+ for (const match of getPatternMatches(interfacePattern, code)) {
90
+ const interfaceName = match[1];
91
+ const baseName = getInterfaceBaseName(interfaceName);
92
+ if (!baseName) {
93
+ continue;
94
+ }
95
+ registerInterfaceType(interfaces, baseName, {
96
+ filePath,
97
+ interfaceName
98
+ });
99
+ }
100
+ }
32
101
  async function parseConfigForRefs(configPath) {
33
- const fs = await import("node:fs/promises");
34
102
  const refs = [];
35
103
  const serviceBindings = [];
36
104
  const doBindings = [];
37
- try {
38
- const code = await fs.readFile(configPath, "utf-8");
39
- const refPattern = /const\s+(\w+)\s*=\s*ref\s*\(\s*(?:'[^']*'\s*,\s*)?(?:\(\s*\)\s*=>\s*)?import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
40
- let match;
41
- while ((match = refPattern.exec(code)) !== null) {
42
- refs.push({
43
- varName: match[1],
44
- importPath: match[2]
45
- });
46
- }
47
- const servicePattern = /(\w+)\s*:\s*(\w+)\.worker(?:\s*\(\s*['"](\w+)['"]\s*\))?/g;
48
- while ((match = servicePattern.exec(code)) !== null) {
49
- serviceBindings.push({
50
- bindingName: match[1],
51
- varName: match[2],
52
- entrypoint: match[3]
53
- });
54
- }
55
- const doPattern = /(\w+)\s*:\s*(\w+)\.([A-Z][A-Z0-9_]*)\s*[,\n\r}]/g;
56
- while ((match = doPattern.exec(code)) !== null) {
57
- if (match[3] === "worker")
58
- continue;
59
- doBindings.push({
60
- bindingName: match[1],
61
- varName: match[2],
62
- doName: match[3]
63
- });
105
+ const code = await readFileIfAvailable(configPath);
106
+ if (!code) {
107
+ return {
108
+ refs,
109
+ serviceBindings,
110
+ doBindings
111
+ };
112
+ }
113
+ const refPattern = /const\s+(\w+)\s*=\s*ref\s*\(\s*(?:'[^']*'\s*,\s*)?(?:\(\s*\)\s*=>\s*)?import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
114
+ for (const match of getPatternMatches(refPattern, code)) {
115
+ refs.push({
116
+ varName: match[1],
117
+ importPath: match[2]
118
+ });
119
+ }
120
+ const servicePattern = /(\w+)\s*:\s*(\w+)\.worker(?:\s*\(\s*['"](\w+)['"]\s*\))?/g;
121
+ for (const match of getPatternMatches(servicePattern, code)) {
122
+ serviceBindings.push({
123
+ bindingName: match[1],
124
+ varName: match[2],
125
+ entrypoint: match[3]
126
+ });
127
+ }
128
+ const doPattern = /(\w+)\s*:\s*(\w+)\.([A-Z][A-Z0-9_]*)\s*[,\n\r}]/g;
129
+ for (const match of getPatternMatches(doPattern, code)) {
130
+ if (match[3] === "worker") {
131
+ continue;
64
132
  }
65
- } catch {}
66
- return { refs, serviceBindings, doBindings };
133
+ doBindings.push({
134
+ bindingName: match[1],
135
+ varName: match[2],
136
+ doName: match[3]
137
+ });
138
+ }
139
+ return {
140
+ refs,
141
+ serviceBindings,
142
+ doBindings
143
+ };
67
144
  }
68
145
  async function findInterfaceTypes(searchDirs) {
69
- const fs = await import("node:fs/promises");
70
146
  const interfaces = new Map;
71
- for (const dir of searchDirs) {
147
+ for (const dir of [...new Set(searchDirs)]) {
72
148
  const typeFiles = await findFiles("**/*.types.ts", { cwd: dir });
73
149
  const srcFiles = await findFiles("src/**/*.ts", { cwd: dir });
74
150
  const allFiles = [...new Set([...typeFiles, ...srcFiles])];
75
151
  for (const filePath of allFiles) {
76
- try {
77
- const code = await fs.readFile(filePath, "utf-8");
78
- const interfacePattern = /export\s+interface\s+(\w+(?:Interface|Rpc))\s*\{/g;
79
- let match;
80
- while ((match = interfacePattern.exec(code)) !== null) {
81
- const interfaceName = match[1];
82
- let baseName;
83
- if (interfaceName.endsWith("Interface")) {
84
- baseName = interfaceName.slice(0, -9);
85
- } else if (interfaceName.endsWith("Rpc")) {
86
- baseName = interfaceName.slice(0, -3);
87
- } else {
88
- continue;
89
- }
90
- if (!interfaces.has(baseName)) {
91
- interfaces.set(baseName, { filePath, interfaceName });
92
- }
93
- if (!interfaces.has("__default__")) {
94
- if (baseName === "Worker" || baseName === "Default" || baseName === "MathService") {
95
- interfaces.set("__default__", { filePath, interfaceName });
96
- }
97
- }
98
- }
99
- } catch {}
152
+ await collectInterfaceTypesFromFile(interfaces, filePath);
100
153
  }
101
154
  }
102
155
  return interfaces;
103
156
  }
157
+ async function getCachedInterfaceTypes(searchDirs) {
158
+ const cacheKey = getInterfaceSearchKey(searchDirs);
159
+ const cached = interfaceTypeCache.get(cacheKey);
160
+ if (cached) {
161
+ return cached;
162
+ }
163
+ const pending = findInterfaceTypes(searchDirs);
164
+ interfaceTypeCache.set(cacheKey, pending);
165
+ try {
166
+ return await pending;
167
+ } catch (error) {
168
+ interfaceTypeCache.delete(cacheKey);
169
+ throw error;
170
+ }
171
+ }
172
+ async function discoverDurableObjects(cwd, pattern = DEFAULT_DO_PATTERN) {
173
+ const discovered = [];
174
+ const files = await findFiles(pattern, { cwd });
175
+ for (const filePath of files) {
176
+ const code = await readFileIfAvailable(filePath);
177
+ if (!code) {
178
+ continue;
179
+ }
180
+ const classNames = findDurableObjectClasses(code);
181
+ for (const className of classNames) {
182
+ const bindingName = className.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").toUpperCase();
183
+ discovered.push({
184
+ className,
185
+ filePath,
186
+ bindingName
187
+ });
188
+ }
189
+ }
190
+ return discovered;
191
+ }
192
+ function generateImportPath(cwd, filePath) {
193
+ let relativePath = relative(cwd, filePath);
194
+ relativePath = relativePath.replace(/\.(ts|tsx|js|jsx)$/, "");
195
+ if (!relativePath.startsWith(".") && !relativePath.startsWith("/")) {
196
+ relativePath = `./${relativePath}`;
197
+ }
198
+ return relativePath;
199
+ }
104
200
  async function resolveReferencedConfigs(configPath, cwd) {
105
201
  const referenced = [];
106
202
  const { refs, serviceBindings, doBindings } = await parseConfigForRefs(configPath);
@@ -108,6 +204,7 @@ async function resolveReferencedConfigs(configPath, cwd) {
108
204
  return referenced;
109
205
  }
110
206
  const configDir = dirname(configPath);
207
+ const referencedConfigDetailsByPath = new Map;
111
208
  for (const ref of refs) {
112
209
  const refImportPath = resolvePackageSpecifier(ref.importPath, configDir);
113
210
  const refConfigPath = await resolveConfigCandidatePath(refImportPath);
@@ -115,17 +212,32 @@ async function resolveReferencedConfigs(configPath, cwd) {
115
212
  continue;
116
213
  }
117
214
  try {
118
- const refDir = dirname(refConfigPath);
119
- const entrypoints = await discoverEntrypointsAsync(refDir, DEFAULT_ENTRYPOINT_PATTERN);
120
- const refDOs = await discoverDurableObjects(refDir, DEFAULT_DO_PATTERN);
121
- const interfaceMap = await findInterfaceTypes([configDir, refDir]);
122
- const bindings = serviceBindings.filter((sb) => sb.varName === ref.varName).map((sb) => {
215
+ let referencedConfigDetails = referencedConfigDetailsByPath.get(refConfigPath);
216
+ if (!referencedConfigDetails) {
217
+ referencedConfigDetails = (async () => {
218
+ const refDir2 = dirname(refConfigPath);
219
+ return {
220
+ refDir: refDir2,
221
+ entrypoints: await discoverEntrypointsAsync(refDir2, DEFAULT_ENTRYPOINT_PATTERN),
222
+ refDOs: await discoverDurableObjects(refDir2, DEFAULT_DO_PATTERN),
223
+ interfaceMap: await getCachedInterfaceTypes([configDir, refDir2])
224
+ };
225
+ })();
226
+ referencedConfigDetailsByPath.set(refConfigPath, referencedConfigDetails);
227
+ }
228
+ const {
229
+ refDir,
230
+ entrypoints,
231
+ refDOs,
232
+ interfaceMap
233
+ } = await referencedConfigDetails;
234
+ const bindings = serviceBindings.filter((serviceBinding) => serviceBinding.varName === ref.varName).map((serviceBinding) => {
123
235
  const info = {
124
- bindingName: sb.bindingName,
125
- entrypoint: sb.entrypoint
236
+ bindingName: serviceBinding.bindingName,
237
+ entrypoint: serviceBinding.entrypoint
126
238
  };
127
- const lookupKey = sb.entrypoint || "__default__";
128
- const interfaceInfo = interfaceMap.get(lookupKey) || sb.entrypoint && interfaceMap.get(sb.entrypoint);
239
+ const lookupKey = serviceBinding.entrypoint || "__default__";
240
+ const interfaceInfo = interfaceMap.get(lookupKey) || (serviceBinding.entrypoint ? interfaceMap.get(serviceBinding.entrypoint) : undefined);
129
241
  if (interfaceInfo) {
130
242
  info.interfaceImport = generateImportPath(cwd, interfaceInfo.filePath);
131
243
  info.interfaceType = interfaceInfo.interfaceName;
@@ -133,16 +245,17 @@ async function resolveReferencedConfigs(configPath, cwd) {
133
245
  return info;
134
246
  });
135
247
  const crossWorkerDOs = doBindings.filter((doBinding) => doBinding.varName === ref.varName).map((doBinding) => {
136
- const matchingDO = refDOs.find((do_) => do_.bindingName === doBinding.doName);
137
- if (matchingDO) {
138
- return {
139
- bindingName: doBinding.bindingName,
140
- doName: doBinding.doName,
141
- className: matchingDO.className,
142
- filePath: matchingDO.filePath
143
- };
248
+ const matchingDO = refDOs.find((doInfo) => doInfo.bindingName === doBinding.doName);
249
+ if (!matchingDO) {
250
+ return null;
144
251
  }
145
- return null;
252
+ const crossWorkerDO = {
253
+ bindingName: doBinding.bindingName,
254
+ doName: doBinding.doName,
255
+ className: matchingDO.className,
256
+ filePath: matchingDO.filePath
257
+ };
258
+ return crossWorkerDO;
146
259
  }).filter((item) => item !== null);
147
260
  referenced.push({
148
261
  varName: ref.varName,
@@ -156,34 +269,8 @@ async function resolveReferencedConfigs(configPath, cwd) {
156
269
  }
157
270
  return referenced;
158
271
  }
159
- async function discoverDurableObjects(cwd, pattern) {
160
- const fs = await import("node:fs/promises");
161
- const discovered = [];
162
- const files = await findFiles(pattern, { cwd });
163
- for (const filePath of files) {
164
- try {
165
- const code = await fs.readFile(filePath, "utf-8");
166
- const classNames = findDurableObjectClasses(code);
167
- for (const className of classNames) {
168
- const bindingName = className.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").toUpperCase();
169
- discovered.push({
170
- className,
171
- filePath,
172
- bindingName
173
- });
174
- }
175
- } catch {}
176
- }
177
- return discovered;
178
- }
179
- function generateImportPath(cwd, filePath) {
180
- let relativePath = relative(cwd, filePath);
181
- relativePath = relativePath.replace(/\.(ts|tsx|js|jsx)$/, "");
182
- if (!relativePath.startsWith(".") && !relativePath.startsWith("/")) {
183
- relativePath = "./" + relativePath;
184
- }
185
- return relativePath;
186
- }
272
+
273
+ // src/cli/commands/type-generation/generator.ts
187
274
  function generateBindingMembers(config, doClassMap, crossWorkerDOMap, serviceBindingMap, cwd, indent) {
188
275
  const lines = [];
189
276
  const imports = [];
@@ -233,9 +320,9 @@ function generateBindingMembers(config, doClassMap, crossWorkerDOMap, serviceBin
233
320
  if (serviceInfo?.interfaceType && serviceInfo.interfaceImport) {
234
321
  imports.push(`import type { ${serviceInfo.interfaceType} } from '${serviceInfo.interfaceImport}'`);
235
322
  lines.push(`${indent}${binding}: ${serviceInfo.interfaceType}`);
236
- } else {
237
- lines.push(`${indent}${binding}: Fetcher`);
323
+ continue;
238
324
  }
325
+ lines.push(`${indent}${binding}: Fetcher`);
239
326
  }
240
327
  }
241
328
  if (config.bindings.ai) {
@@ -252,7 +339,9 @@ function generateBindingMembers(config, doClassMap, crossWorkerDOMap, serviceBin
252
339
  }
253
340
  }
254
341
  if (config.bindings.browser) {
255
- lines.push(`${indent}${config.bindings.browser.binding}: Fetcher`);
342
+ for (const binding of Object.keys(config.bindings.browser)) {
343
+ lines.push(`${indent}${binding}: Fetcher`);
344
+ }
256
345
  }
257
346
  if (config.bindings.analyticsEngine) {
258
347
  for (const binding of Object.keys(config.bindings.analyticsEngine)) {
@@ -279,10 +368,10 @@ function generateBindingMembers(config, doClassMap, crossWorkerDOMap, serviceBin
279
368
  }
280
369
  function generateBindingTypes(config, discoveredDOs, discoveredEntrypoints, referencedConfigs, cwd) {
281
370
  const doClassMap = new Map;
282
- for (const do_ of discoveredDOs) {
283
- doClassMap.set(do_.className, {
284
- importPath: generateImportPath(cwd, do_.filePath),
285
- className: do_.className
371
+ for (const doInfo of discoveredDOs) {
372
+ doClassMap.set(doInfo.className, {
373
+ importPath: generateImportPath(cwd, doInfo.filePath),
374
+ className: doInfo.className
286
375
  });
287
376
  }
288
377
  const crossWorkerDOMap = new Map;
@@ -293,8 +382,8 @@ function generateBindingTypes(config, discoveredDOs, discoveredEntrypoints, refe
293
382
  }
294
383
  const serviceBindingMap = new Map;
295
384
  for (const ref of referencedConfigs) {
296
- for (const sb of ref.serviceBindings) {
297
- serviceBindingMap.set(sb.bindingName, sb);
385
+ for (const serviceBinding of ref.serviceBindings) {
386
+ serviceBindingMap.set(serviceBinding.bindingName, serviceBinding);
298
387
  }
299
388
  }
300
389
  const usedTypes = new Set;
@@ -320,7 +409,7 @@ function generateBindingTypes(config, discoveredDOs, discoveredEntrypoints, refe
320
409
  usedTypes.add("VectorizeIndex");
321
410
  if (config.bindings.hyperdrive && Object.keys(config.bindings.hyperdrive).length > 0)
322
411
  usedTypes.add("Hyperdrive");
323
- if (config.bindings.browser)
412
+ if (config.bindings.browser && Object.keys(config.bindings.browser).length > 0)
324
413
  usedTypes.add("Fetcher");
325
414
  if (config.bindings.analyticsEngine && Object.keys(config.bindings.analyticsEngine).length > 0)
326
415
  usedTypes.add("AnalyticsEngineDataset");
@@ -332,7 +421,7 @@ function generateBindingTypes(config, discoveredDOs, discoveredEntrypoints, refe
332
421
  "// Run `devflare types` to regenerate",
333
422
  ""
334
423
  ];
335
- const hasLocalDOsWithClasses = config.bindings?.durableObjects && Object.values(config.bindings.durableObjects).some((doConfig) => doConfig.className && doClassMap.has(doConfig.className));
424
+ const hasLocalDOsWithClasses = Boolean(config.bindings?.durableObjects && Object.values(config.bindings.durableObjects).some((doConfig) => doConfig.className && doClassMap.has(doConfig.className)));
336
425
  const hasCrossWorkerDOs = crossWorkerDOMap.size > 0;
337
426
  const hasDOsWithClasses = hasLocalDOsWithClasses || hasCrossWorkerDOs;
338
427
  if (usedTypes.size > 0) {
@@ -357,7 +446,7 @@ function generateBindingTypes(config, discoveredDOs, discoveredEntrypoints, refe
357
446
  lines.push("}");
358
447
  lines.push("");
359
448
  if (discoveredEntrypoints.length > 0) {
360
- const entrypointNames = discoveredEntrypoints.map((ep) => `'${ep.className}'`).join(" | ");
449
+ const entrypointNames = discoveredEntrypoints.map((entrypoint) => `'${entrypoint.className}'`).join(" | ");
361
450
  lines.push("/**");
362
451
  lines.push(" * Named entrypoints discovered from ep.*.ts files.");
363
452
  lines.push(" * Use with defineConfig<Entrypoints>() for type-safe cross-worker references.");
@@ -374,11 +463,24 @@ function generateBindingTypes(config, discoveredDOs, discoveredEntrypoints, refe
374
463
  return lines.join(`
375
464
  `);
376
465
  }
466
+
467
+ // src/cli/commands/types.ts
468
+ function logTypesLine(logger, message = "") {
469
+ if (typeof logger.log === "function") {
470
+ logger.log(message);
471
+ return;
472
+ }
473
+ if (typeof logger.info === "function") {
474
+ logger.info(message);
475
+ }
476
+ }
377
477
  async function runTypesCommand(parsed, logger, options) {
378
478
  const cwd = options.cwd || process.cwd();
379
479
  const configPath = parsed.options.config;
380
480
  const outputPath = parsed.options.output || "env.d.ts";
381
- logger.info("Generating TypeScript types...");
481
+ const theme = createCliTheme(parsed.options);
482
+ logTypesLine(logger);
483
+ logTypesLine(logger, `${bold("types", theme)} ${dim("Generating TypeScript bindings", theme)}`);
382
484
  try {
383
485
  const config = await loadConfig({ cwd, configFile: configPath });
384
486
  const requestedConfigPath = configPath ? resolve(cwd, configPath) : cwd;
@@ -391,9 +493,9 @@ async function runTypesCommand(parsed, logger, options) {
391
493
  if (config.files?.durableObjects !== false) {
392
494
  discoveredDOs = await discoverDurableObjects(cwd, doPattern);
393
495
  if (discoveredDOs.length > 0) {
394
- logger.info(`Discovered ${discoveredDOs.length} Durable Object class(es):`);
395
- for (const do_ of discoveredDOs) {
396
- logger.info(` • ${do_.className} → ${do_.bindingName}`);
496
+ logTypesLine(logger, `Discovered ${discoveredDOs.length} Durable Object class(es):`);
497
+ for (const doInfo of discoveredDOs) {
498
+ logTypesLine(logger, ` • ${doInfo.className} → ${doInfo.bindingName}`);
397
499
  }
398
500
  }
399
501
  }
@@ -401,11 +503,13 @@ async function runTypesCommand(parsed, logger, options) {
401
503
  for (const [bindingName, doConfig] of Object.entries(config.bindings.durableObjects)) {
402
504
  const normalized = normalizeDOBinding(doConfig);
403
505
  const className = normalized.className;
404
- if (!className)
506
+ if (!className) {
405
507
  continue;
406
- const existing = discoveredDOs.find((d) => d.className === className);
407
- if (existing)
508
+ }
509
+ const existing = discoveredDOs.find((doInfo) => doInfo.className === className);
510
+ if (existing) {
408
511
  continue;
512
+ }
409
513
  if (normalized.scriptName && (normalized.scriptName.endsWith(".ts") || normalized.scriptName.endsWith(".js"))) {
410
514
  const filePath = resolve(cwd, "src", normalized.scriptName);
411
515
  discoveredDOs.push({
@@ -416,24 +520,24 @@ async function runTypesCommand(parsed, logger, options) {
416
520
  }
417
521
  }
418
522
  }
419
- const epPattern = typeof config.files?.entrypoints === "string" ? config.files.entrypoints : DEFAULT_ENTRYPOINT_PATTERN;
523
+ const entrypointPattern = typeof config.files?.entrypoints === "string" ? config.files.entrypoints : DEFAULT_ENTRYPOINT_PATTERN;
420
524
  let discoveredEntrypoints = [];
421
525
  if (config.files?.entrypoints !== false) {
422
- discoveredEntrypoints = await discoverEntrypointsAsync(cwd, epPattern);
526
+ discoveredEntrypoints = await discoverEntrypointsAsync(cwd, entrypointPattern);
423
527
  if (discoveredEntrypoints.length > 0) {
424
- logger.info(`Discovered ${discoveredEntrypoints.length} entrypoint class(es):`);
425
- for (const ep of discoveredEntrypoints) {
426
- logger.info(` • ${ep.className}`);
528
+ logTypesLine(logger, `Discovered ${discoveredEntrypoints.length} entrypoint class(es):`);
529
+ for (const entrypoint of discoveredEntrypoints) {
530
+ logTypesLine(logger, ` • ${entrypoint.className}`);
427
531
  }
428
532
  }
429
533
  }
430
534
  const referencedConfigs = await resolveReferencedConfigs(actualConfigPath, cwd);
431
535
  if (referencedConfigs.length > 0) {
432
- logger.info(`Found ${referencedConfigs.length} referenced worker(s):`);
536
+ logTypesLine(logger, `Found ${referencedConfigs.length} referenced worker(s):`);
433
537
  for (const ref of referencedConfigs) {
434
- const typedBindings = ref.serviceBindings.filter((sb) => sb.interfaceType);
538
+ const typedBindings = ref.serviceBindings.filter((serviceBinding) => serviceBinding.interfaceType);
435
539
  if (typedBindings.length > 0) {
436
- logger.info(` • ${ref.varName}: ${typedBindings.map((sb) => `${sb.bindingName} → ${sb.interfaceType}`).join(", ")}`);
540
+ logTypesLine(logger, ` • ${ref.varName}: ${typedBindings.map((serviceBinding) => `${serviceBinding.bindingName} → ${serviceBinding.interfaceType}`).join(", ")}`);
437
541
  }
438
542
  }
439
543
  }