alchemy 0.12.2 → 0.12.4

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 (617) hide show
  1. package/lib/ai/ark.d.ts +1 -0
  2. package/lib/ai/ark.d.ts.map +1 -0
  3. package/lib/ai/ark.js +1 -0
  4. package/lib/ai/ark.js.map +1 -0
  5. package/lib/ai/astro-file.d.ts +5 -4
  6. package/lib/ai/astro-file.d.ts.map +1 -0
  7. package/lib/ai/astro-file.js +4 -3
  8. package/lib/ai/astro-file.js.map +1 -0
  9. package/lib/ai/client.d.ts +2 -1
  10. package/lib/ai/client.d.ts.map +1 -0
  11. package/lib/ai/client.js +1 -0
  12. package/lib/ai/client.js.map +1 -0
  13. package/lib/ai/css-file.d.ts +5 -4
  14. package/lib/ai/css-file.d.ts.map +1 -0
  15. package/lib/ai/css-file.js +4 -3
  16. package/lib/ai/css-file.js.map +1 -0
  17. package/lib/ai/data.d.ts +5 -4
  18. package/lib/ai/data.d.ts.map +1 -0
  19. package/lib/ai/data.js +4 -3
  20. package/lib/ai/data.js.map +1 -0
  21. package/lib/ai/document.d.ts +6 -5
  22. package/lib/ai/document.d.ts.map +1 -0
  23. package/lib/ai/document.js +4 -3
  24. package/lib/ai/document.js.map +1 -0
  25. package/lib/ai/html-file.d.ts +5 -4
  26. package/lib/ai/html-file.d.ts.map +1 -0
  27. package/lib/ai/html-file.js +4 -3
  28. package/lib/ai/html-file.js.map +1 -0
  29. package/lib/ai/index.d.ts +11 -10
  30. package/lib/ai/index.d.ts.map +1 -0
  31. package/lib/ai/index.js +11 -10
  32. package/lib/ai/index.js.map +1 -0
  33. package/lib/ai/json-file.d.ts +5 -4
  34. package/lib/ai/json-file.d.ts.map +1 -0
  35. package/lib/ai/json-file.js +5 -4
  36. package/lib/ai/json-file.js.map +1 -0
  37. package/lib/ai/typescript-file.d.ts +5 -4
  38. package/lib/ai/typescript-file.d.ts.map +1 -0
  39. package/lib/ai/typescript-file.js +4 -3
  40. package/lib/ai/typescript-file.js.map +1 -0
  41. package/lib/ai/vue-file.d.ts +5 -4
  42. package/lib/ai/vue-file.d.ts.map +1 -0
  43. package/lib/ai/vue-file.js +4 -3
  44. package/lib/ai/vue-file.js.map +1 -0
  45. package/lib/ai/yaml-file.d.ts +5 -4
  46. package/lib/ai/yaml-file.d.ts.map +1 -0
  47. package/lib/ai/yaml-file.js +5 -4
  48. package/lib/ai/yaml-file.js.map +1 -0
  49. package/lib/alchemy.d.ts +6 -5
  50. package/lib/alchemy.d.ts.map +1 -0
  51. package/lib/alchemy.js +5 -4
  52. package/lib/alchemy.js.map +1 -0
  53. package/lib/apply.d.ts +2 -1
  54. package/lib/apply.d.ts.map +1 -0
  55. package/lib/apply.js +5 -4
  56. package/lib/apply.js.map +1 -0
  57. package/lib/aws/account-id.d.ts +1 -0
  58. package/lib/aws/account-id.d.ts.map +1 -0
  59. package/lib/aws/account-id.js +1 -0
  60. package/lib/aws/account-id.js.map +1 -0
  61. package/lib/aws/bucket.d.ts +3 -2
  62. package/lib/aws/bucket.d.ts.map +1 -0
  63. package/lib/aws/bucket.js +3 -2
  64. package/lib/aws/bucket.js.map +1 -0
  65. package/lib/aws/credentials.d.ts +2 -1
  66. package/lib/aws/credentials.d.ts.map +1 -0
  67. package/lib/aws/credentials.js +1 -0
  68. package/lib/aws/credentials.js.map +1 -0
  69. package/lib/aws/function.d.ts +4 -3
  70. package/lib/aws/function.d.ts.map +1 -0
  71. package/lib/aws/function.js +3 -2
  72. package/lib/aws/function.js.map +1 -0
  73. package/lib/aws/index.d.ts +10 -9
  74. package/lib/aws/index.d.ts.map +1 -0
  75. package/lib/aws/index.js +10 -9
  76. package/lib/aws/index.js.map +1 -0
  77. package/lib/aws/oidc/github-oidc-provider.d.ts +2 -1
  78. package/lib/aws/oidc/github-oidc-provider.d.ts.map +1 -0
  79. package/lib/aws/oidc/github-oidc-provider.js +2 -1
  80. package/lib/aws/oidc/github-oidc-provider.js.map +1 -0
  81. package/lib/aws/oidc/index.d.ts +3 -2
  82. package/lib/aws/oidc/index.d.ts.map +1 -0
  83. package/lib/aws/oidc/index.js +3 -2
  84. package/lib/aws/oidc/index.js.map +1 -0
  85. package/lib/aws/oidc/oidc-provider.d.ts +3 -2
  86. package/lib/aws/oidc/oidc-provider.d.ts.map +1 -0
  87. package/lib/aws/oidc/oidc-provider.js +3 -2
  88. package/lib/aws/oidc/oidc-provider.js.map +1 -0
  89. package/lib/aws/policy-attachment.d.ts +3 -2
  90. package/lib/aws/policy-attachment.d.ts.map +1 -0
  91. package/lib/aws/policy-attachment.js +3 -2
  92. package/lib/aws/policy-attachment.js.map +1 -0
  93. package/lib/aws/policy.d.ts +3 -2
  94. package/lib/aws/policy.d.ts.map +1 -0
  95. package/lib/aws/policy.js +2 -1
  96. package/lib/aws/policy.js.map +1 -0
  97. package/lib/aws/queue.d.ts +3 -2
  98. package/lib/aws/queue.d.ts.map +1 -0
  99. package/lib/aws/queue.js +2 -1
  100. package/lib/aws/queue.js.map +1 -0
  101. package/lib/aws/role.d.ts +4 -3
  102. package/lib/aws/role.d.ts.map +1 -0
  103. package/lib/aws/role.js +3 -2
  104. package/lib/aws/role.js.map +1 -0
  105. package/lib/aws/ses.d.ts +3 -2
  106. package/lib/aws/ses.d.ts.map +1 -0
  107. package/lib/aws/ses.js +3 -2
  108. package/lib/aws/ses.js.map +1 -0
  109. package/lib/aws/table.d.ts +3 -2
  110. package/lib/aws/table.d.ts.map +1 -0
  111. package/lib/aws/table.js +4 -3
  112. package/lib/aws/table.js.map +1 -0
  113. package/lib/cloudflare/account-api-token.d.ts +5 -4
  114. package/lib/cloudflare/account-api-token.d.ts.map +1 -0
  115. package/lib/cloudflare/account-api-token.js +6 -5
  116. package/lib/cloudflare/account-api-token.js.map +1 -0
  117. package/lib/cloudflare/account-id.d.ts +2 -1
  118. package/lib/cloudflare/account-id.d.ts.map +1 -0
  119. package/lib/cloudflare/account-id.js +2 -1
  120. package/lib/cloudflare/account-id.js.map +1 -0
  121. package/lib/cloudflare/api-error.d.ts +1 -0
  122. package/lib/cloudflare/api-error.d.ts.map +1 -0
  123. package/lib/cloudflare/api-error.js +1 -0
  124. package/lib/cloudflare/api-error.js.map +1 -0
  125. package/lib/cloudflare/api.d.ts +2 -1
  126. package/lib/cloudflare/api.d.ts.map +1 -0
  127. package/lib/cloudflare/api.js +3 -2
  128. package/lib/cloudflare/api.js.map +1 -0
  129. package/lib/cloudflare/asset-manifest.d.ts +1 -0
  130. package/lib/cloudflare/asset-manifest.d.ts.map +1 -0
  131. package/lib/cloudflare/asset-manifest.js +1 -0
  132. package/lib/cloudflare/asset-manifest.js.map +1 -0
  133. package/lib/cloudflare/assets.d.ts +3 -2
  134. package/lib/cloudflare/assets.d.ts.map +1 -0
  135. package/lib/cloudflare/assets.js +3 -2
  136. package/lib/cloudflare/assets.js.map +1 -0
  137. package/lib/cloudflare/auth.d.ts +3 -2
  138. package/lib/cloudflare/auth.d.ts.map +1 -0
  139. package/lib/cloudflare/auth.js +3 -2
  140. package/lib/cloudflare/auth.js.map +1 -0
  141. package/lib/cloudflare/bindings.d.ts +12 -11
  142. package/lib/cloudflare/bindings.d.ts.map +1 -0
  143. package/lib/cloudflare/bindings.js +1 -0
  144. package/lib/cloudflare/bindings.js.map +1 -0
  145. package/lib/cloudflare/bound.d.ts +13 -12
  146. package/lib/cloudflare/bound.d.ts.map +1 -0
  147. package/lib/cloudflare/bound.js +1 -0
  148. package/lib/cloudflare/bound.js.map +1 -0
  149. package/lib/cloudflare/bucket.d.ts +5 -4
  150. package/lib/cloudflare/bucket.d.ts.map +1 -0
  151. package/lib/cloudflare/bucket.js +4 -3
  152. package/lib/cloudflare/bucket.js.map +1 -0
  153. package/lib/cloudflare/custom-domain.d.ts +4 -3
  154. package/lib/cloudflare/custom-domain.d.ts.map +1 -0
  155. package/lib/cloudflare/custom-domain.js +4 -3
  156. package/lib/cloudflare/custom-domain.js.map +1 -0
  157. package/lib/cloudflare/d1-database.d.ts +6 -5
  158. package/lib/cloudflare/d1-database.d.ts.map +1 -0
  159. package/lib/cloudflare/d1-database.js +6 -5
  160. package/lib/cloudflare/d1-database.js.map +1 -0
  161. package/lib/cloudflare/d1-migrations.d.ts +2 -1
  162. package/lib/cloudflare/d1-migrations.d.ts.map +1 -0
  163. package/lib/cloudflare/d1-migrations.js +4 -3
  164. package/lib/cloudflare/d1-migrations.js.map +1 -0
  165. package/lib/cloudflare/dns-records.d.ts +5 -4
  166. package/lib/cloudflare/dns-records.d.ts.map +1 -0
  167. package/lib/cloudflare/dns-records.js +3 -2
  168. package/lib/cloudflare/dns-records.js.map +1 -0
  169. package/lib/cloudflare/durable-object-namespace.d.ts +1 -0
  170. package/lib/cloudflare/durable-object-namespace.d.ts.map +1 -0
  171. package/lib/cloudflare/durable-object-namespace.js +1 -0
  172. package/lib/cloudflare/durable-object-namespace.js.map +1 -0
  173. package/lib/cloudflare/index.d.ts +28 -25
  174. package/lib/cloudflare/index.d.ts.map +1 -0
  175. package/lib/cloudflare/index.js +28 -25
  176. package/lib/cloudflare/index.js.map +1 -0
  177. package/lib/cloudflare/kv-namespace.d.ts +4 -3
  178. package/lib/cloudflare/kv-namespace.d.ts.map +1 -0
  179. package/lib/cloudflare/kv-namespace.js +5 -4
  180. package/lib/cloudflare/kv-namespace.js.map +1 -0
  181. package/lib/cloudflare/local-dev-cloudflare-shim.d.ts +1 -0
  182. package/lib/cloudflare/local-dev-cloudflare-shim.d.ts.map +1 -0
  183. package/lib/cloudflare/local-dev-cloudflare-shim.js +1 -0
  184. package/lib/cloudflare/local-dev-cloudflare-shim.js.map +1 -0
  185. package/lib/cloudflare/nuxt.d.ts +49 -0
  186. package/lib/cloudflare/nuxt.d.ts.map +1 -0
  187. package/lib/cloudflare/nuxt.js +45 -0
  188. package/lib/cloudflare/nuxt.js.map +1 -0
  189. package/lib/cloudflare/permission-groups.d.ts +4 -3
  190. package/lib/cloudflare/permission-groups.d.ts.map +1 -0
  191. package/lib/cloudflare/permission-groups.js +3 -2
  192. package/lib/cloudflare/permission-groups.js.map +1 -0
  193. package/lib/cloudflare/pipeline.d.ts +5 -4
  194. package/lib/cloudflare/pipeline.d.ts.map +1 -0
  195. package/lib/cloudflare/pipeline.js +4 -3
  196. package/lib/cloudflare/pipeline.js.map +1 -0
  197. package/lib/cloudflare/queue.d.ts +4 -3
  198. package/lib/cloudflare/queue.d.ts.map +1 -0
  199. package/lib/cloudflare/queue.js +4 -3
  200. package/lib/cloudflare/queue.js.map +1 -0
  201. package/lib/cloudflare/r2-rest-state-store.d.ts +4 -3
  202. package/lib/cloudflare/r2-rest-state-store.d.ts.map +1 -0
  203. package/lib/cloudflare/r2-rest-state-store.js +5 -4
  204. package/lib/cloudflare/r2-rest-state-store.js.map +1 -0
  205. package/lib/cloudflare/redwood.d.ts +71 -0
  206. package/lib/cloudflare/redwood.d.ts.map +1 -0
  207. package/lib/cloudflare/redwood.js +83 -0
  208. package/lib/cloudflare/redwood.js.map +1 -0
  209. package/lib/cloudflare/response.d.ts +1 -0
  210. package/lib/cloudflare/response.d.ts.map +1 -0
  211. package/lib/cloudflare/response.js +1 -0
  212. package/lib/cloudflare/response.js.map +1 -0
  213. package/lib/cloudflare/tanstack-start.d.ts +5 -4
  214. package/lib/cloudflare/tanstack-start.d.ts.map +1 -0
  215. package/lib/cloudflare/tanstack-start.js +2 -1
  216. package/lib/cloudflare/tanstack-start.js.map +1 -0
  217. package/lib/cloudflare/types.d.ts +1 -0
  218. package/lib/cloudflare/types.d.ts.map +1 -0
  219. package/lib/cloudflare/types.js +1 -0
  220. package/lib/cloudflare/types.js.map +1 -0
  221. package/lib/cloudflare/vectorize-index.d.ts +4 -3
  222. package/lib/cloudflare/vectorize-index.d.ts.map +1 -0
  223. package/lib/cloudflare/vectorize-index.js +4 -3
  224. package/lib/cloudflare/vectorize-index.js.map +1 -0
  225. package/lib/cloudflare/vectorize-metadata-index.d.ts +5 -4
  226. package/lib/cloudflare/vectorize-metadata-index.d.ts.map +1 -0
  227. package/lib/cloudflare/vectorize-metadata-index.js +5 -4
  228. package/lib/cloudflare/vectorize-metadata-index.js.map +1 -0
  229. package/lib/cloudflare/vite.d.ts +5 -4
  230. package/lib/cloudflare/vite.d.ts.map +1 -0
  231. package/lib/cloudflare/vite.js +2 -1
  232. package/lib/cloudflare/vite.js.map +1 -0
  233. package/lib/cloudflare/website.d.ts +4 -3
  234. package/lib/cloudflare/website.d.ts.map +1 -0
  235. package/lib/cloudflare/website.js +6 -5
  236. package/lib/cloudflare/website.js.map +1 -0
  237. package/lib/cloudflare/worker-metadata.d.ts +1 -0
  238. package/lib/cloudflare/worker-metadata.d.ts.map +1 -0
  239. package/lib/cloudflare/worker-metadata.js +1 -0
  240. package/lib/cloudflare/worker-metadata.js.map +1 -0
  241. package/lib/cloudflare/worker-migration.d.ts +1 -0
  242. package/lib/cloudflare/worker-migration.d.ts.map +1 -0
  243. package/lib/cloudflare/worker-migration.js +1 -0
  244. package/lib/cloudflare/worker-migration.js.map +1 -0
  245. package/lib/cloudflare/worker.d.ts +16 -7
  246. package/lib/cloudflare/worker.d.ts.map +1 -0
  247. package/lib/cloudflare/worker.js +21 -12
  248. package/lib/cloudflare/worker.js.map +1 -0
  249. package/lib/cloudflare/workflow.d.ts +2 -1
  250. package/lib/cloudflare/workflow.d.ts.map +1 -0
  251. package/lib/cloudflare/workflow.js +2 -1
  252. package/lib/cloudflare/workflow.js.map +1 -0
  253. package/lib/cloudflare/wrangler.json.d.ts +4 -3
  254. package/lib/cloudflare/wrangler.json.d.ts.map +1 -0
  255. package/lib/cloudflare/wrangler.json.js +5 -3
  256. package/lib/cloudflare/wrangler.json.js.map +1 -0
  257. package/lib/cloudflare/zone-settings.d.ts +1 -0
  258. package/lib/cloudflare/zone-settings.d.ts.map +1 -0
  259. package/lib/cloudflare/zone-settings.js +1 -0
  260. package/lib/cloudflare/zone-settings.js.map +1 -0
  261. package/lib/cloudflare/zone.d.ts +5 -4
  262. package/lib/cloudflare/zone.d.ts.map +1 -0
  263. package/lib/cloudflare/zone.js +3 -2
  264. package/lib/cloudflare/zone.js.map +1 -0
  265. package/lib/context.d.ts +4 -3
  266. package/lib/context.d.ts.map +1 -0
  267. package/lib/context.js +2 -1
  268. package/lib/context.js.map +1 -0
  269. package/lib/destroy.d.ts +3 -2
  270. package/lib/destroy.d.ts.map +1 -0
  271. package/lib/destroy.js +5 -4
  272. package/lib/destroy.js.map +1 -0
  273. package/lib/dns/godaddy.d.ts +1 -0
  274. package/lib/dns/godaddy.d.ts.map +1 -0
  275. package/lib/dns/godaddy.js +1 -0
  276. package/lib/dns/godaddy.js.map +1 -0
  277. package/lib/dns/import-dns.d.ts +4 -3
  278. package/lib/dns/import-dns.d.ts.map +1 -0
  279. package/lib/dns/import-dns.js +3 -2
  280. package/lib/dns/import-dns.js.map +1 -0
  281. package/lib/dns/index.d.ts +3 -2
  282. package/lib/dns/index.d.ts.map +1 -0
  283. package/lib/dns/index.js +3 -2
  284. package/lib/dns/index.js.map +1 -0
  285. package/lib/dns/record.d.ts +1 -0
  286. package/lib/dns/record.d.ts.map +1 -0
  287. package/lib/dns/record.js +1 -0
  288. package/lib/dns/record.js.map +1 -0
  289. package/lib/encrypt.d.ts +1 -0
  290. package/lib/encrypt.d.ts.map +1 -0
  291. package/lib/encrypt.js +1 -0
  292. package/lib/encrypt.js.map +1 -0
  293. package/lib/env.d.ts +1 -0
  294. package/lib/env.d.ts.map +1 -0
  295. package/lib/env.js +1 -0
  296. package/lib/env.js.map +1 -0
  297. package/lib/esbuild/bundle.d.ts +3 -2
  298. package/lib/esbuild/bundle.d.ts.map +1 -0
  299. package/lib/esbuild/bundle.js +3 -2
  300. package/lib/esbuild/bundle.js.map +1 -0
  301. package/lib/esbuild/index.d.ts +2 -1
  302. package/lib/esbuild/index.d.ts.map +1 -0
  303. package/lib/esbuild/index.js +2 -1
  304. package/lib/esbuild/index.js.map +1 -0
  305. package/lib/fs/copy-file.d.ts +3 -2
  306. package/lib/fs/copy-file.d.ts.map +1 -0
  307. package/lib/fs/copy-file.js +3 -2
  308. package/lib/fs/copy-file.js.map +1 -0
  309. package/lib/fs/file-collection.d.ts +1 -0
  310. package/lib/fs/file-collection.d.ts.map +1 -0
  311. package/lib/fs/file-collection.js +1 -0
  312. package/lib/fs/file-collection.js.map +1 -0
  313. package/lib/fs/file-ref.d.ts +1 -0
  314. package/lib/fs/file-ref.d.ts.map +1 -0
  315. package/lib/fs/file-ref.js +1 -0
  316. package/lib/fs/file-ref.js.map +1 -0
  317. package/lib/fs/file-system-state-store.d.ts +3 -2
  318. package/lib/fs/file-system-state-store.d.ts.map +1 -0
  319. package/lib/fs/file-system-state-store.js +3 -2
  320. package/lib/fs/file-system-state-store.js.map +1 -0
  321. package/lib/fs/file.d.ts +5 -4
  322. package/lib/fs/file.d.ts.map +1 -0
  323. package/lib/fs/file.js +4 -3
  324. package/lib/fs/file.js.map +1 -0
  325. package/lib/fs/folder.d.ts +3 -2
  326. package/lib/fs/folder.d.ts.map +1 -0
  327. package/lib/fs/folder.js +3 -2
  328. package/lib/fs/folder.js.map +1 -0
  329. package/lib/fs/index.d.ts +15 -14
  330. package/lib/fs/index.d.ts.map +1 -0
  331. package/lib/fs/index.js +15 -14
  332. package/lib/fs/index.js.map +1 -0
  333. package/lib/fs/static-astro-file.d.ts +2 -1
  334. package/lib/fs/static-astro-file.d.ts.map +1 -0
  335. package/lib/fs/static-astro-file.js +2 -1
  336. package/lib/fs/static-astro-file.js.map +1 -0
  337. package/lib/fs/static-css-file.d.ts +2 -1
  338. package/lib/fs/static-css-file.d.ts.map +1 -0
  339. package/lib/fs/static-css-file.js +2 -1
  340. package/lib/fs/static-css-file.js.map +1 -0
  341. package/lib/fs/static-html-file.d.ts +2 -1
  342. package/lib/fs/static-html-file.d.ts.map +1 -0
  343. package/lib/fs/static-html-file.js +2 -1
  344. package/lib/fs/static-html-file.js.map +1 -0
  345. package/lib/fs/static-json-file.d.ts +2 -1
  346. package/lib/fs/static-json-file.d.ts.map +1 -0
  347. package/lib/fs/static-json-file.js +2 -1
  348. package/lib/fs/static-json-file.js.map +1 -0
  349. package/lib/fs/static-text-file.d.ts +2 -1
  350. package/lib/fs/static-text-file.d.ts.map +1 -0
  351. package/lib/fs/static-text-file.js +2 -1
  352. package/lib/fs/static-text-file.js.map +1 -0
  353. package/lib/fs/static-typescript-file.d.ts +2 -1
  354. package/lib/fs/static-typescript-file.d.ts.map +1 -0
  355. package/lib/fs/static-typescript-file.js +2 -1
  356. package/lib/fs/static-typescript-file.js.map +1 -0
  357. package/lib/fs/static-vue-file.d.ts +2 -1
  358. package/lib/fs/static-vue-file.d.ts.map +1 -0
  359. package/lib/fs/static-vue-file.js +2 -1
  360. package/lib/fs/static-vue-file.js.map +1 -0
  361. package/lib/fs/static-yaml-file.d.ts +2 -1
  362. package/lib/fs/static-yaml-file.d.ts.map +1 -0
  363. package/lib/fs/static-yaml-file.js +2 -1
  364. package/lib/fs/static-yaml-file.js.map +1 -0
  365. package/lib/github/client.d.ts +1 -0
  366. package/lib/github/client.d.ts.map +1 -0
  367. package/lib/github/client.js +3 -2
  368. package/lib/github/client.js.map +1 -0
  369. package/lib/github/index.d.ts +3 -2
  370. package/lib/github/index.d.ts.map +1 -0
  371. package/lib/github/index.js +3 -2
  372. package/lib/github/index.js.map +1 -0
  373. package/lib/github/repository-environment.d.ts +3 -2
  374. package/lib/github/repository-environment.d.ts.map +1 -0
  375. package/lib/github/repository-environment.js +3 -2
  376. package/lib/github/repository-environment.js.map +1 -0
  377. package/lib/github/secret.d.ts +4 -3
  378. package/lib/github/secret.d.ts.map +1 -0
  379. package/lib/github/secret.js +3 -2
  380. package/lib/github/secret.js.map +1 -0
  381. package/lib/index.d.ts +8 -7
  382. package/lib/index.d.ts.map +1 -0
  383. package/lib/index.js +6 -5
  384. package/lib/index.js.map +1 -0
  385. package/lib/internal/docs/providers.d.ts +3 -2
  386. package/lib/internal/docs/providers.d.ts.map +1 -0
  387. package/lib/internal/docs/providers.js +5 -4
  388. package/lib/internal/docs/providers.js.map +1 -0
  389. package/lib/os/exec.d.ts +3 -2
  390. package/lib/os/exec.d.ts.map +1 -0
  391. package/lib/os/exec.js +4 -3
  392. package/lib/os/exec.js.map +1 -0
  393. package/lib/os/index.d.ts +2 -1
  394. package/lib/os/index.d.ts.map +1 -0
  395. package/lib/os/index.js +2 -1
  396. package/lib/os/index.js.map +1 -0
  397. package/lib/resource.d.ts +3 -2
  398. package/lib/resource.d.ts.map +1 -0
  399. package/lib/resource.js +3 -2
  400. package/lib/resource.js.map +1 -0
  401. package/lib/scope.d.ts +3 -2
  402. package/lib/scope.d.ts.map +1 -0
  403. package/lib/scope.js +3 -2
  404. package/lib/scope.js.map +1 -0
  405. package/lib/secret.d.ts +1 -0
  406. package/lib/secret.d.ts.map +1 -0
  407. package/lib/secret.js +2 -1
  408. package/lib/secret.js.map +1 -0
  409. package/lib/serde.d.ts +2 -1
  410. package/lib/serde.d.ts.map +1 -0
  411. package/lib/serde.js +4 -3
  412. package/lib/serde.js.map +1 -0
  413. package/lib/state.d.ts +3 -2
  414. package/lib/state.d.ts.map +1 -0
  415. package/lib/state.js +1 -0
  416. package/lib/state.js.map +1 -0
  417. package/lib/stripe/index.d.ts +4 -3
  418. package/lib/stripe/index.d.ts.map +1 -0
  419. package/lib/stripe/index.js +4 -3
  420. package/lib/stripe/index.js.map +1 -0
  421. package/lib/stripe/price.d.ts +3 -2
  422. package/lib/stripe/price.d.ts.map +1 -0
  423. package/lib/stripe/price.js +2 -1
  424. package/lib/stripe/price.js.map +1 -0
  425. package/lib/stripe/product.d.ts +3 -2
  426. package/lib/stripe/product.d.ts.map +1 -0
  427. package/lib/stripe/product.js +2 -1
  428. package/lib/stripe/product.js.map +1 -0
  429. package/lib/stripe/webhook.d.ts +3 -2
  430. package/lib/stripe/webhook.d.ts.map +1 -0
  431. package/lib/stripe/webhook.js +2 -1
  432. package/lib/stripe/webhook.js.map +1 -0
  433. package/lib/test/bun.d.ts +3 -2
  434. package/lib/test/bun.d.ts.map +1 -0
  435. package/lib/test/bun.js +4 -3
  436. package/lib/test/bun.js.map +1 -0
  437. package/lib/test/prune.d.ts +1 -0
  438. package/lib/test/prune.d.ts.map +1 -0
  439. package/lib/test/prune.js +3 -3
  440. package/lib/test/prune.js.map +1 -0
  441. package/lib/util/content-type.d.ts +1 -0
  442. package/lib/util/content-type.d.ts.map +1 -0
  443. package/lib/util/content-type.js +1 -0
  444. package/lib/util/content-type.js.map +1 -0
  445. package/lib/util/ignore.d.ts +1 -0
  446. package/lib/util/ignore.d.ts.map +1 -0
  447. package/lib/util/ignore.js +1 -0
  448. package/lib/util/ignore.js.map +1 -0
  449. package/lib/util/retry.d.ts +1 -0
  450. package/lib/util/retry.d.ts.map +1 -0
  451. package/lib/util/retry.js +1 -0
  452. package/lib/util/retry.js.map +1 -0
  453. package/lib/util/rm.d.ts +1 -0
  454. package/lib/util/rm.d.ts.map +1 -0
  455. package/lib/util/rm.js +1 -0
  456. package/lib/util/rm.js.map +1 -0
  457. package/lib/util/sha256.d.ts +1 -0
  458. package/lib/util/sha256.d.ts.map +1 -0
  459. package/lib/util/sha256.js +1 -0
  460. package/lib/util/sha256.js.map +1 -0
  461. package/lib/util/slugify.d.ts +1 -0
  462. package/lib/util/slugify.d.ts.map +1 -0
  463. package/lib/util/slugify.js +1 -0
  464. package/lib/util/slugify.js.map +1 -0
  465. package/lib/web/astro.d.ts +3 -2
  466. package/lib/web/astro.d.ts.map +1 -0
  467. package/lib/web/astro.js +9 -8
  468. package/lib/web/astro.js.map +1 -0
  469. package/lib/web/shadcn-component.d.ts +3 -2
  470. package/lib/web/shadcn-component.d.ts.map +1 -0
  471. package/lib/web/shadcn-component.js +5 -4
  472. package/lib/web/shadcn-component.js.map +1 -0
  473. package/lib/web/shadcn.d.ts +4 -3
  474. package/lib/web/shadcn.d.ts.map +1 -0
  475. package/lib/web/shadcn.js +7 -6
  476. package/lib/web/shadcn.js.map +1 -0
  477. package/lib/web/tailwind.d.ts +3 -2
  478. package/lib/web/tailwind.d.ts.map +1 -0
  479. package/lib/web/tailwind.js +6 -5
  480. package/lib/web/tailwind.js.map +1 -0
  481. package/lib/web/vite.d.ts +3 -2
  482. package/lib/web/vite.d.ts.map +1 -0
  483. package/lib/web/vite.js +10 -9
  484. package/lib/web/vite.js.map +1 -0
  485. package/lib/web/vitepress/config.d.ts +2 -1
  486. package/lib/web/vitepress/config.d.ts.map +1 -0
  487. package/lib/web/vitepress/config.js +2 -1
  488. package/lib/web/vitepress/config.js.map +1 -0
  489. package/lib/web/vitepress/custom-theme.d.ts +5 -4
  490. package/lib/web/vitepress/custom-theme.d.ts.map +1 -0
  491. package/lib/web/vitepress/custom-theme.js +8 -7
  492. package/lib/web/vitepress/custom-theme.js.map +1 -0
  493. package/lib/web/vitepress/dependencies.d.ts +3 -2
  494. package/lib/web/vitepress/dependencies.d.ts.map +1 -0
  495. package/lib/web/vitepress/dependencies.js +4 -3
  496. package/lib/web/vitepress/dependencies.js.map +1 -0
  497. package/lib/web/vitepress/home-page.d.ts +4 -3
  498. package/lib/web/vitepress/home-page.d.ts.map +1 -0
  499. package/lib/web/vitepress/home-page.js +4 -3
  500. package/lib/web/vitepress/home-page.js.map +1 -0
  501. package/lib/web/vitepress/index.d.ts +6 -5
  502. package/lib/web/vitepress/index.d.ts.map +1 -0
  503. package/lib/web/vitepress/index.js +6 -5
  504. package/lib/web/vitepress/index.js.map +1 -0
  505. package/lib/web/vitepress/process-front-matter-files.d.ts +1 -0
  506. package/lib/web/vitepress/process-front-matter-files.d.ts.map +1 -0
  507. package/lib/web/vitepress/process-front-matter-files.js +1 -0
  508. package/lib/web/vitepress/process-front-matter-files.js.map +1 -0
  509. package/lib/web/vitepress/vitepress.d.ts +3 -2
  510. package/lib/web/vitepress/vitepress.d.ts.map +1 -0
  511. package/lib/web/vitepress/vitepress.js +8 -7
  512. package/lib/web/vitepress/vitepress.js.map +1 -0
  513. package/package.json +1 -1
  514. package/src/ai/astro-file.ts +5 -5
  515. package/src/ai/client.ts +1 -1
  516. package/src/ai/css-file.ts +5 -5
  517. package/src/ai/data.ts +5 -5
  518. package/src/ai/document.ts +5 -5
  519. package/src/ai/html-file.ts +5 -5
  520. package/src/ai/index.ts +10 -10
  521. package/src/ai/json-file.ts +6 -6
  522. package/src/ai/typescript-file.ts +5 -5
  523. package/src/ai/vue-file.ts +5 -5
  524. package/src/ai/yaml-file.ts +6 -6
  525. package/src/alchemy.ts +6 -6
  526. package/src/apply.ts +5 -5
  527. package/src/aws/bucket.ts +13 -13
  528. package/src/aws/credentials.ts +1 -1
  529. package/src/aws/function.ts +4 -4
  530. package/src/aws/index.ts +9 -9
  531. package/src/aws/oidc/github-oidc-provider.ts +2 -2
  532. package/src/aws/oidc/index.ts +2 -2
  533. package/src/aws/oidc/oidc-provider.ts +3 -3
  534. package/src/aws/policy-attachment.ts +8 -8
  535. package/src/aws/policy.ts +16 -16
  536. package/src/aws/queue.ts +14 -14
  537. package/src/aws/role.ts +4 -4
  538. package/src/aws/ses.ts +20 -20
  539. package/src/aws/table.ts +4 -4
  540. package/src/cloudflare/account-api-token.ts +6 -6
  541. package/src/cloudflare/account-id.ts +1 -1
  542. package/src/cloudflare/api.ts +3 -3
  543. package/src/cloudflare/assets.ts +3 -3
  544. package/src/cloudflare/auth.ts +8 -8
  545. package/src/cloudflare/bindings.ts +11 -11
  546. package/src/cloudflare/bound.ts +12 -12
  547. package/src/cloudflare/bucket.ts +5 -5
  548. package/src/cloudflare/custom-domain.ts +4 -4
  549. package/src/cloudflare/d1-database.ts +32 -33
  550. package/src/cloudflare/d1-migrations.ts +3 -3
  551. package/src/cloudflare/dns-records.ts +5 -5
  552. package/src/cloudflare/index.ts +27 -25
  553. package/src/cloudflare/kv-namespace.ts +5 -5
  554. package/src/cloudflare/nuxt.ts +66 -0
  555. package/src/cloudflare/permission-groups.ts +3 -3
  556. package/src/cloudflare/pipeline.ts +5 -5
  557. package/src/cloudflare/queue.ts +4 -4
  558. package/src/cloudflare/r2-rest-state-store.ts +6 -6
  559. package/src/cloudflare/redwood.ts +96 -0
  560. package/src/cloudflare/tanstack-start.ts +4 -4
  561. package/src/cloudflare/vectorize-index.ts +5 -5
  562. package/src/cloudflare/vectorize-metadata-index.ts +6 -6
  563. package/src/cloudflare/vite.ts +4 -4
  564. package/src/cloudflare/website.ts +6 -6
  565. package/src/cloudflare/worker.ts +39 -17
  566. package/src/cloudflare/workflow.ts +2 -2
  567. package/src/cloudflare/wrangler.json.ts +8 -7
  568. package/src/cloudflare/zone.ts +4 -4
  569. package/src/context.ts +4 -4
  570. package/src/destroy.ts +4 -4
  571. package/src/dns/import-dns.ts +3 -3
  572. package/src/dns/index.ts +2 -2
  573. package/src/esbuild/bundle.ts +3 -3
  574. package/src/esbuild/index.ts +1 -1
  575. package/src/fs/copy-file.ts +3 -3
  576. package/src/fs/file-system-state-store.ts +4 -4
  577. package/src/fs/file.ts +6 -6
  578. package/src/fs/folder.ts +7 -7
  579. package/src/fs/index.ts +14 -14
  580. package/src/fs/static-astro-file.ts +1 -1
  581. package/src/fs/static-css-file.ts +1 -1
  582. package/src/fs/static-html-file.ts +1 -1
  583. package/src/fs/static-json-file.ts +1 -1
  584. package/src/fs/static-text-file.ts +2 -4
  585. package/src/fs/static-typescript-file.ts +1 -1
  586. package/src/fs/static-vue-file.ts +1 -1
  587. package/src/fs/static-yaml-file.ts +1 -1
  588. package/src/github/client.ts +12 -12
  589. package/src/github/index.ts +2 -2
  590. package/src/github/repository-environment.ts +3 -3
  591. package/src/github/secret.ts +4 -4
  592. package/src/index.ts +7 -7
  593. package/src/internal/docs/providers.ts +4 -4
  594. package/src/os/exec.ts +4 -4
  595. package/src/os/index.ts +1 -1
  596. package/src/resource.ts +6 -6
  597. package/src/scope.ts +4 -4
  598. package/src/secret.ts +1 -1
  599. package/src/serde.ts +3 -3
  600. package/src/state.ts +2 -2
  601. package/src/stripe/index.ts +3 -3
  602. package/src/stripe/price.ts +4 -4
  603. package/src/stripe/product.ts +4 -4
  604. package/src/stripe/webhook.ts +5 -5
  605. package/src/test/bun.ts +4 -4
  606. package/src/test/prune.ts +2 -3
  607. package/src/web/astro.ts +9 -9
  608. package/src/web/shadcn-component.ts +5 -5
  609. package/src/web/shadcn.ts +7 -7
  610. package/src/web/tailwind.ts +6 -6
  611. package/src/web/vite.ts +10 -10
  612. package/src/web/vitepress/config.ts +1 -1
  613. package/src/web/vitepress/custom-theme.ts +10 -10
  614. package/src/web/vitepress/dependencies.ts +8 -8
  615. package/src/web/vitepress/home-page.ts +4 -4
  616. package/src/web/vitepress/index.ts +5 -5
  617. package/src/web/vitepress/vitepress.ts +8 -8
@@ -1,12 +1,12 @@
1
- import type { Context } from "../context";
2
- import { Resource } from "../resource";
1
+ import type { Context } from "../context.js";
2
+ import { Resource } from "../resource.js";
3
+ import { CloudflareApiError, handleApiError } from "./api-error.js";
3
4
  import {
4
5
  CloudflareApi,
5
6
  createCloudflareApi,
6
7
  type CloudflareApiOptions,
7
- } from "./api";
8
- import { CloudflareApiError, handleApiError } from "./api-error";
9
- import { applyMigrations, listMigrationsFiles } from "./d1-migrations";
8
+ } from "./api.js";
9
+ import { applyMigrations, listMigrationsFiles } from "./d1-migrations.js";
10
10
 
11
11
  /**
12
12
  * Properties for creating or updating a D1 Database
@@ -82,40 +82,39 @@ export interface D1DatabaseProps extends CloudflareApiOptions {
82
82
  /**
83
83
  * Output returned after D1 Database creation/update
84
84
  */
85
- export interface D1Database
86
- extends Resource<"cloudflare::D1Database">,
87
- D1DatabaseProps {
88
- type: "d1";
89
- /**
90
- * The unique ID of the database (UUID)
91
- */
92
- id: string;
85
+ export type D1Database = Resource<"cloudflare::D1Database"> &
86
+ D1DatabaseProps & {
87
+ type: "d1";
88
+ /**
89
+ * The unique ID of the database (UUID)
90
+ */
91
+ id: string;
93
92
 
94
- /**
95
- * File size of the database
96
- */
97
- fileSize: number;
93
+ /**
94
+ * File size of the database
95
+ */
96
+ fileSize: number;
98
97
 
99
- /**
100
- * Number of tables in the database
101
- */
102
- numTables: number;
98
+ /**
99
+ * Number of tables in the database
100
+ */
101
+ numTables: number;
103
102
 
104
- /**
105
- * Version of the database
106
- */
107
- version: string;
103
+ /**
104
+ * Version of the database
105
+ */
106
+ version: string;
108
107
 
109
- /**
110
- * Read replication configuration
111
- */
112
- readReplication?: {
113
108
  /**
114
- * Read replication mode
109
+ * Read replication configuration
115
110
  */
116
- mode: "auto" | "disabled";
111
+ readReplication?: {
112
+ /**
113
+ * Read replication mode
114
+ */
115
+ mode: "auto" | "disabled";
116
+ };
117
117
  };
118
- }
119
118
 
120
119
  export async function D1Database(
121
120
  id: string,
@@ -278,7 +277,7 @@ export const D1DatabaseResource = Resource(
278
277
  readReplication: dbData.result.read_replication,
279
278
  primaryLocationHint: props.primaryLocationHint,
280
279
  accountId: api.accountId,
281
- migrationsDir: props.migrationsDir
280
+ migrationsDir: props.migrationsDir,
282
281
  });
283
282
  }
284
283
  }
@@ -1,7 +1,7 @@
1
- import * as fs from "fs/promises";
1
+ import * as fs from "node:fs/promises";
2
2
  import * as path from "node:path";
3
- import { CloudflareApi } from "./api";
4
- import { handleApiError } from "./api-error";
3
+ import { handleApiError } from "./api-error.js";
4
+ import { CloudflareApi } from "./api.js";
5
5
 
6
6
  export interface D1MigrationOptions {
7
7
  migrationsFiles: Array<{ id: string; sql: string }>;
@@ -1,16 +1,16 @@
1
- import type { Context } from "../context";
1
+ import type { Context } from "../context.js";
2
2
  import type {
3
3
  DnsRecord as BaseDnsRecord,
4
4
  DnsRecordType,
5
5
  DnsRecordWithMetadata,
6
- } from "../dns/record";
7
- import { Resource } from "../resource";
6
+ } from "../dns/record.js";
7
+ import { Resource } from "../resource.js";
8
8
  import {
9
9
  type CloudflareApi,
10
10
  type CloudflareApiOptions,
11
11
  createCloudflareApi,
12
- } from "./api";
13
- import type { CloudflareResponse } from "./response";
12
+ } from "./api.js";
13
+ import type { CloudflareResponse } from "./response.js";
14
14
 
15
15
  /**
16
16
  * Cloudflare DNS Record response format
@@ -1,25 +1,27 @@
1
- export * from "./account-api-token";
2
- export * from "./api";
3
- export * from "./api-error";
4
- export * from "./assets";
5
- export * from "./bindings";
6
- export * from "./bucket";
7
- export * from "./custom-domain";
8
- export * from "./d1-database";
9
- export * from "./dns-records";
10
- export * from "./durable-object-namespace";
11
- export * from "./kv-namespace";
12
- export * from "./local-dev-cloudflare-shim";
13
- export * from "./permission-groups";
14
- export * from "./pipeline";
15
- export * from "./queue";
16
- export * from "./r2-rest-state-store";
17
- export * from "./tanstack-start";
18
- export * from "./vectorize-index";
19
- export * from "./vectorize-metadata-index";
20
- export * from "./vite";
21
- export * from "./website";
22
- export * from "./worker";
23
- export { Workflow } from "./workflow";
24
- export * from "./wrangler.json";
25
- export * from "./zone";
1
+ export * from "./account-api-token.js";
2
+ export * from "./api-error.js";
3
+ export * from "./api.js";
4
+ export * from "./assets.js";
5
+ export * from "./bindings.js";
6
+ export * from "./bucket.js";
7
+ export * from "./custom-domain.js";
8
+ export * from "./d1-database.js";
9
+ export * from "./dns-records.js";
10
+ export * from "./durable-object-namespace.js";
11
+ export * from "./kv-namespace.js";
12
+ export * from "./local-dev-cloudflare-shim.js";
13
+ export * from "./nuxt.js";
14
+ export * from "./permission-groups.js";
15
+ export * from "./pipeline.js";
16
+ export * from "./queue.js";
17
+ export * from "./r2-rest-state-store.js";
18
+ export * from "./redwood.js";
19
+ export * from "./tanstack-start.js";
20
+ export * from "./vectorize-index.js";
21
+ export * from "./vectorize-metadata-index.js";
22
+ export * from "./vite.js";
23
+ export * from "./website.js";
24
+ export * from "./worker.js";
25
+ export { Workflow } from "./workflow.js";
26
+ export * from "./wrangler.json.js";
27
+ export * from "./zone.js";
@@ -1,12 +1,12 @@
1
- import type { Context } from "../context";
2
- import { Resource } from "../resource";
3
- import { withExponentialBackoff } from "../util/retry";
1
+ import type { Context } from "../context.js";
2
+ import { Resource } from "../resource.js";
3
+ import { withExponentialBackoff } from "../util/retry.js";
4
+ import { handleApiError } from "./api-error.js";
4
5
  import {
5
6
  CloudflareApi,
6
7
  createCloudflareApi,
7
8
  type CloudflareApiOptions,
8
- } from "./api";
9
- import { handleApiError } from "./api-error";
9
+ } from "./api.js";
10
10
 
11
11
  /**
12
12
  * Properties for creating or updating a KV Namespace
@@ -0,0 +1,66 @@
1
+ import type { Assets } from "./assets.js";
2
+ import type { Bindings } from "./bindings.js";
3
+ import { Website, type WebsiteProps } from "./website.js";
4
+ import type { Worker } from "./worker.js";
5
+
6
+ /**
7
+ * Properties for creating a Nuxt resource.
8
+ * Extends WebsiteProps, allowing customization of the underlying Website.
9
+ */
10
+ export interface NuxtProps<B extends Bindings> extends WebsiteProps<B> {}
11
+
12
+ /**
13
+ * Represents the output of a Nuxt resource deployment.
14
+ * It resolves to the underlying Cloudflare Worker type, ensuring type safety.
15
+ * Prevents overriding the internal ASSETS binding.
16
+ */
17
+ export type Nuxt<B extends Bindings> = B extends { ASSETS: any }
18
+ ? never
19
+ : Worker<B & { ASSETS: Assets }>;
20
+
21
+ /**
22
+ * Creates and deploys a Nuxt application using the Cloudflare Workers preset.
23
+ *
24
+ * This resource simplifies deploying Nuxt applications by providing sensible
25
+ * defaults for the build command, main entrypoint, and assets directory
26
+ * based on the `cloudflare-module` preset output.
27
+ *
28
+ * It wraps the underlying `Website` resource.
29
+ *
30
+ * @param id A unique identifier for the resource.
31
+ * @param props Configuration options for the Nuxt deployment, overriding defaults.
32
+ * @returns A promise that resolves to the deployed Cloudflare Worker details.
33
+ *
34
+ * @example
35
+ * // Deploy a basic Nuxt site with default settings
36
+ * const nuxtSite = await Nuxt("my-nuxt-app");
37
+ *
38
+ * @example
39
+ * // Deploy with custom bindings and build command
40
+ * const db = await D1Database("my-db");
41
+ * const nuxtSiteWithDb = await Nuxt("my-nuxt-app-with-db", {
42
+ * command: "npm run build:cloudflare", // Specify a custom build command
43
+ * bindings: {
44
+ * DB: db, // Add custom bindings
45
+ * },
46
+ * });
47
+ */
48
+ export async function Nuxt<B extends Bindings>(
49
+ id: string,
50
+ props?: Partial<NuxtProps<B>>
51
+ ): Promise<Nuxt<B>> {
52
+ // Call the underlying Website resource with Nuxt defaults
53
+ return Website(id, {
54
+ ...props,
55
+ // Default build command, can be overridden by props.command
56
+ command: props?.command ?? "bun run build",
57
+ // Default entry point for cloudflare-module preset
58
+ main: props?.main ?? "./index.ts",
59
+ // Default static assets directory for cloudflare-module preset
60
+ assets: props?.assets ?? "./.output/public",
61
+ // Ensure nodejs_compat flag is included for Nuxt compatibility
62
+ compatibilityFlags: ["nodejs_compat", ...(props?.compatibilityFlags ?? [])],
63
+ // Enable wrangler by default, common for Nuxt/Cloudflare deployments
64
+ wrangler: props?.wrangler ?? true,
65
+ });
66
+ }
@@ -1,6 +1,6 @@
1
- import type { Context } from "../context";
2
- import { Resource } from "../resource";
3
- import { createCloudflareApi, type CloudflareApiOptions } from "./api";
1
+ import type { Context } from "../context.js";
2
+ import { Resource } from "../resource.js";
3
+ import { createCloudflareApi, type CloudflareApiOptions } from "./api.js";
4
4
 
5
5
  /**
6
6
  * Cloudflare permission group as returned by the API
@@ -1,12 +1,12 @@
1
- import type { Context } from "../context";
2
- import { Resource } from "../resource";
3
- import type { Secret } from "../secret";
1
+ import type { Context } from "../context.js";
2
+ import { Resource } from "../resource.js";
3
+ import type { Secret } from "../secret.js";
4
+ import { CloudflareApiError, handleApiError } from "./api-error.js";
4
5
  import {
5
6
  CloudflareApi,
6
7
  createCloudflareApi,
7
8
  type CloudflareApiOptions,
8
- } from "./api";
9
- import { CloudflareApiError, handleApiError } from "./api-error";
9
+ } from "./api.js";
10
10
 
11
11
  /**
12
12
  * Settings for compression of pipeline output
@@ -1,11 +1,11 @@
1
- import type { Context } from "../context";
2
- import { Resource } from "../resource";
1
+ import type { Context } from "../context.js";
2
+ import { Resource } from "../resource.js";
3
+ import { CloudflareApiError, handleApiError } from "./api-error.js";
3
4
  import {
4
5
  CloudflareApi,
5
6
  createCloudflareApi,
6
7
  type CloudflareApiOptions,
7
- } from "./api";
8
- import { CloudflareApiError, handleApiError } from "./api-error";
8
+ } from "./api.js";
9
9
 
10
10
  /**
11
11
  * Settings for a Cloudflare Queue
@@ -1,13 +1,13 @@
1
- import type { Scope } from "../scope";
2
- import { deserialize, serialize } from "../serde";
3
- import type { State, StateStore } from "../state";
4
- import { withExponentialBackoff } from "../util/retry";
1
+ import type { Scope } from "../scope.js";
2
+ import { deserialize, serialize } from "../serde.js";
3
+ import type { State, StateStore } from "../state.js";
4
+ import { withExponentialBackoff } from "../util/retry.js";
5
+ import { CloudflareApiError, handleApiError } from "./api-error.js";
5
6
  import {
6
7
  type CloudflareApi,
7
8
  type CloudflareApiOptions,
8
9
  createCloudflareApi,
9
- } from "./api";
10
- import { CloudflareApiError, handleApiError } from "./api-error";
10
+ } from "./api.js";
11
11
 
12
12
  /**
13
13
  * Options for CloudflareR2StateStore
@@ -0,0 +1,96 @@
1
+ import path from "node:path";
2
+ import type { Assets } from "./assets.js";
3
+ import type { Bindings } from "./bindings.js";
4
+ import { Website, type WebsiteProps } from "./website.js";
5
+ import type { Worker } from "./worker.js";
6
+
7
+ export interface RedwoodProps<B extends Bindings> extends WebsiteProps<B> {}
8
+
9
+ // don't allow the ASSETS to be overridden
10
+ export type Redwood<B extends Bindings> = B extends { ASSETS: any }
11
+ ? never
12
+ : Worker<B & { ASSETS: Assets }>;
13
+
14
+ /**
15
+ * Deploy a RedwoodJS application to Cloudflare Pages with automatically configured defaults.
16
+ *
17
+ * This resource handles the deployment of RedwoodJS applications with optimized settings for
18
+ * Cloudflare Workers, including proper build commands and compatibility flags.
19
+ *
20
+ * @example
21
+ * // Deploy a basic RedwoodJS application with default settings
22
+ * const redwoodApp = await Redwood("my-redwood-app");
23
+ *
24
+ * @example
25
+ * // Deploy with a database binding
26
+ * import { D1Database } from "../cloudflare/d1-database";
27
+ *
28
+ * const database = await D1Database("redwood-db");
29
+ *
30
+ * const redwoodApp = await Redwood("redwood-with-db", {
31
+ * bindings: {
32
+ * DB: database
33
+ * }
34
+ * });
35
+ *
36
+ * @example
37
+ * // Deploy with custom build command and environment variables
38
+ * const redwoodApp = await Redwood("custom-redwood", {
39
+ * command: "bun run test && RWSDK_DEPLOY=1 bun run build:production",
40
+ * bindings: {
41
+ * API_KEY: alchemy.secret("api-key-secret")
42
+ * },
43
+ * vars: {
44
+ * NODE_ENV: "production",
45
+ * APP_ENV: "staging"
46
+ * }
47
+ * });
48
+ *
49
+ * @example
50
+ * // Deploy with custom paths and additional compatibility flags
51
+ * const redwoodApp = await Redwood("redwood-custom-paths", {
52
+ * main: "custom/worker.js",
53
+ * assets: "custom/static",
54
+ * compatibilityFlags: ["nodejs_compat", "fetch_refused_to_set_cookies"]
55
+ * });
56
+ *
57
+ * @example
58
+ * // Deploy with custom bundle configuration
59
+ * const redwoodApp = await Redwood("redwood-custom-bundle", {
60
+ * bundle: {
61
+ * options: {
62
+ * external: ["node:events", "node:stream", "node:crypto"],
63
+ * format: "esm"
64
+ * }
65
+ * }
66
+ * });
67
+ *
68
+ * @param id - Unique identifier for the RedwoodJS application
69
+ * @param props - Configuration properties for the RedwoodJS deployment
70
+ * @returns A Cloudflare Worker resource representing the deployed RedwoodJS application
71
+ */
72
+ export async function Redwood<B extends Bindings>(
73
+ id: string,
74
+ props?: Partial<RedwoodProps<B>>
75
+ ): Promise<Redwood<B>> {
76
+ return Website(id, {
77
+ ...props,
78
+ command: props?.command ?? "bun run clean && RWSDK_DEPLOY=1 bun run build",
79
+ wrangler: props?.wrangler ?? true,
80
+ main: props?.main ?? path.join("src", "worker.tsx"),
81
+ assets: props?.assets ?? path.join("dist", "client"),
82
+ compatibilityFlags: ["nodejs_compat", ...(props?.compatibilityFlags ?? [])],
83
+ compatibilityDate: props?.compatibilityDate ?? "2025-04-02",
84
+ bundle: {
85
+ ...props?.bundle,
86
+ options: {
87
+ ...props?.bundle?.options,
88
+ external: [
89
+ "node:events",
90
+ "node:stream",
91
+ ...(props?.bundle?.options?.external ?? []),
92
+ ],
93
+ },
94
+ },
95
+ });
96
+ }
@@ -1,7 +1,7 @@
1
- import type { Assets } from "./assets";
2
- import type { Bindings } from "./bindings";
3
- import { Website, type WebsiteProps } from "./website";
4
- import type { Worker } from "./worker";
1
+ import type { Assets } from "./assets.js";
2
+ import type { Bindings } from "./bindings.js";
3
+ import { Website, type WebsiteProps } from "./website.js";
4
+ import type { Worker } from "./worker.js";
5
5
 
6
6
  export interface TanStackStartProps<B extends Bindings>
7
7
  extends WebsiteProps<B> {}
@@ -1,11 +1,11 @@
1
- import type { Context } from "../context";
2
- import { Resource } from "../resource";
1
+ import type { Context } from "../context.js";
2
+ import { Resource } from "../resource.js";
3
+ import { CloudflareApiError, handleApiError } from "./api-error.js";
3
4
  import {
4
- CloudflareApi,
5
5
  createCloudflareApi,
6
+ type CloudflareApi,
6
7
  type CloudflareApiOptions,
7
- } from "./api";
8
- import { CloudflareApiError, handleApiError } from "./api-error";
8
+ } from "./api.js";
9
9
 
10
10
  /**
11
11
  * Properties for creating or updating a Vectorize Index
@@ -1,12 +1,12 @@
1
- import type { Context } from "../context";
2
- import { Resource } from "../resource";
1
+ import type { Context } from "../context.js";
2
+ import { Resource } from "../resource.js";
3
+ import { CloudflareApiError, handleApiError } from "./api-error.js";
3
4
  import {
4
- CloudflareApi,
5
5
  createCloudflareApi,
6
+ type CloudflareApi,
6
7
  type CloudflareApiOptions,
7
- } from "./api";
8
- import { CloudflareApiError, handleApiError } from "./api-error";
9
- import { VectorizeIndex } from "./vectorize-index";
8
+ } from "./api.js";
9
+ import { VectorizeIndex } from "./vectorize-index.js";
10
10
 
11
11
  /**
12
12
  * Properties for creating or deleting a Vectorize Metadata Index
@@ -1,9 +1,9 @@
1
1
  import fs from "node:fs/promises";
2
2
  import path from "node:path";
3
- import type { Assets } from "./assets";
4
- import type { Bindings } from "./bindings";
5
- import { Website, type WebsiteProps } from "./website";
6
- import type { Worker } from "./worker";
3
+ import type { Assets } from "./assets.js";
4
+ import type { Bindings } from "./bindings.js";
5
+ import { Website, type WebsiteProps } from "./website.js";
6
+ import type { Worker } from "./worker.js";
7
7
 
8
8
  export interface ViteProps<B extends Bindings> extends WebsiteProps<B> {}
9
9
 
@@ -1,11 +1,11 @@
1
1
  import fs from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { alchemy } from "../alchemy";
4
- import { Exec } from "../os";
5
- import { Assets } from "./assets";
6
- import type { Bindings } from "./bindings";
7
- import { Worker, type AssetsConfig, type WorkerProps } from "./worker";
8
- import { WranglerJson } from "./wrangler.json";
3
+ import { alchemy } from "../alchemy.js";
4
+ import { Exec } from "../os/exec.js";
5
+ import { Assets } from "./assets.js";
6
+ import type { Bindings } from "./bindings.js";
7
+ import { Worker, type AssetsConfig, type WorkerProps } from "./worker.js";
8
+ import { WranglerJson } from "./wrangler.json.js";
9
9
 
10
10
  export interface WebsiteProps<B extends Bindings>
11
11
  extends Omit<WorkerProps<B>, "name" | "assets" | "entrypoint"> {
@@ -1,23 +1,23 @@
1
1
  import * as crypto from "node:crypto";
2
2
  import * as fs from "node:fs/promises";
3
- import type { Context } from "../context";
4
- import { Bundle, type BundleProps } from "../esbuild/bundle";
5
- import { Resource } from "../resource";
6
- import { getContentType } from "../util/content-type";
7
- import { withExponentialBackoff } from "../util/retry";
8
- import { slugify } from "../util/slugify";
3
+ import type { Context } from "../context.js";
4
+ import { Bundle, type BundleProps } from "../esbuild/bundle.js";
5
+ import { Resource } from "../resource.js";
6
+ import { getContentType } from "../util/content-type.js";
7
+ import { withExponentialBackoff } from "../util/retry.js";
8
+ import { slugify } from "../util/slugify.js";
9
9
  import {
10
10
  createCloudflareApi,
11
11
  type CloudflareApi,
12
12
  type CloudflareApiOptions,
13
- } from "./api";
14
- import { type Assets } from "./assets";
15
- import { type Bindings, type WorkerBindingSpec } from "./bindings";
16
- import type { Bound } from "./bound";
17
- import { type DurableObjectNamespace } from "./durable-object-namespace";
18
- import type { WorkerScriptMetadata } from "./worker-metadata";
19
- import type { SingleStepMigration } from "./worker-migration";
20
- import { upsertWorkflow, type Workflow } from "./workflow";
13
+ } from "./api.js";
14
+ import { type Assets } from "./assets.js";
15
+ import { type Bindings, type WorkerBindingSpec } from "./bindings.js";
16
+ import type { Bound } from "./bound.js";
17
+ import { type DurableObjectNamespace } from "./durable-object-namespace.js";
18
+ import type { WorkerScriptMetadata } from "./worker-metadata.js";
19
+ import type { SingleStepMigration } from "./worker-migration.js";
20
+ import { upsertWorkflow, type Workflow } from "./workflow.js";
21
21
 
22
22
  /**
23
23
  * Configuration options for static assets
@@ -204,6 +204,16 @@ export interface Worker<B extends Bindings = Bindings>
204
204
  Env: {
205
205
  [bindingName in keyof B]: Bound<B[bindingName]>;
206
206
  };
207
+
208
+ /**
209
+ * The compatibility date for the worker
210
+ */
211
+ compatibilityDate: string;
212
+
213
+ /**
214
+ * The compatibility flags for the worker
215
+ */
216
+ compatibilityFlags: string[];
207
217
  }
208
218
 
209
219
  /**
@@ -350,11 +360,18 @@ export const Worker = Resource(
350
360
  );
351
361
  }
352
362
 
363
+ const compatibilityDate = props.compatibilityDate ?? "2024-09-09";
364
+ const compatibilityFlags = props.compatibilityFlags ?? [];
365
+
353
366
  // Prepare metadata with bindings
354
367
  const scriptMetadata = await prepareWorkerMetadata(
355
368
  this,
356
369
  oldBindings,
357
- props,
370
+ {
371
+ ...props,
372
+ compatibilityDate,
373
+ compatibilityFlags,
374
+ },
358
375
  assetUploadResult
359
376
  );
360
377
 
@@ -389,6 +406,8 @@ export const Worker = Resource(
389
406
  id,
390
407
  entrypoint: props.entrypoint,
391
408
  name: workerName,
409
+ compatibilityDate,
410
+ compatibilityFlags,
392
411
  script: scriptContent,
393
412
  format: props.format || "esm", // Include format in the output
394
413
  bindings: props.bindings ?? ({} as B),
@@ -586,12 +605,15 @@ function createAssetConfig(config?: AssetsConfig): AssetsConfig {
586
605
  async function prepareWorkerMetadata<B extends Bindings>(
587
606
  ctx: Context<Worker<B>>,
588
607
  oldBindings: Bindings | undefined,
589
- props: WorkerProps,
608
+ props: WorkerProps & {
609
+ compatibilityDate: string;
610
+ compatibilityFlags: string[];
611
+ },
590
612
  assetUploadResult?: AssetUploadResult
591
613
  ): Promise<WorkerMetadata> {
592
614
  // Prepare metadata with bindings
593
615
  const meta: WorkerMetadata = {
594
- compatibility_date: props.compatibilityDate ?? "2024-09-09",
616
+ compatibility_date: props.compatibilityDate,
595
617
  compatibility_flags: props.compatibilityFlags,
596
618
  bindings: [],
597
619
  observability: {
@@ -1,5 +1,5 @@
1
- import type { CloudflareApi } from "./api";
2
- import { handleApiError } from "./api-error";
1
+ import { handleApiError } from "./api-error.js";
2
+ import type { CloudflareApi } from "./api.js";
3
3
 
4
4
  export interface WorkflowProps {
5
5
  /**
@@ -1,9 +1,9 @@
1
- import type { Context } from "../context";
2
- import { StaticJsonFile } from "../fs/static-json-file";
3
- import { Resource } from "../resource";
4
- import type { Bindings } from "./bindings";
5
- import type { DurableObjectNamespace } from "./durable-object-namespace";
6
- import type { Worker } from "./worker";
1
+ import type { Context } from "../context.js";
2
+ import { StaticJsonFile } from "../fs/static-json-file.js";
3
+ import { Resource } from "../resource.js";
4
+ import type { Bindings } from "./bindings.js";
5
+ import type { DurableObjectNamespace } from "./durable-object-namespace.js";
6
+ import type { Worker } from "./worker.js";
7
7
 
8
8
  /**
9
9
  * Properties for wrangler.json configuration file
@@ -74,7 +74,8 @@ export const WranglerJson = Resource(
74
74
  // Use entrypoint as main if it exists
75
75
  main: worker.entrypoint,
76
76
  // see: https://developers.cloudflare.com/workers/configuration/compatibility-dates/
77
- compatibility_date: "2022-04-05",
77
+ compatibility_date: worker.compatibilityDate,
78
+ compatibility_flags: props.worker.compatibilityFlags,
78
79
  };
79
80
 
80
81
  // Process bindings if they exist