effect-start 0.27.0 → 0.28.0

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 (633) hide show
  1. package/dist/ChildProcess.d.ts +60 -0
  2. package/dist/ChildProcess.d.ts.map +1 -0
  3. package/dist/ChildProcess.js +30 -0
  4. package/dist/ChildProcess.js.map +1 -0
  5. package/dist/Commander.d.ts +101 -0
  6. package/dist/Commander.d.ts.map +1 -0
  7. package/dist/Commander.js +327 -0
  8. package/dist/Commander.js.map +1 -0
  9. package/dist/ContentNegotiation.d.ts +13 -0
  10. package/dist/ContentNegotiation.d.ts.map +1 -0
  11. package/dist/ContentNegotiation.js +360 -0
  12. package/dist/ContentNegotiation.js.map +1 -0
  13. package/dist/Cookies.d.ts +78 -0
  14. package/dist/Cookies.d.ts.map +1 -0
  15. package/dist/Cookies.js +303 -0
  16. package/dist/Cookies.js.map +1 -0
  17. package/dist/Development.d.ts +42 -0
  18. package/dist/Development.d.ts.map +1 -0
  19. package/dist/Development.js +60 -0
  20. package/dist/Development.js.map +1 -0
  21. package/dist/Docker.d.ts +51 -0
  22. package/dist/Docker.d.ts.map +1 -0
  23. package/dist/Docker.js +88 -0
  24. package/dist/Docker.js.map +1 -0
  25. package/dist/Effectify.d.ts +210 -0
  26. package/dist/Effectify.d.ts.map +1 -0
  27. package/dist/Effectify.js +20 -0
  28. package/dist/Effectify.js.map +1 -0
  29. package/dist/Entity.d.ts +48 -0
  30. package/dist/Entity.d.ts.map +1 -0
  31. package/dist/Entity.js +235 -0
  32. package/dist/Entity.js.map +1 -0
  33. package/dist/Fetch.d.ts +50 -0
  34. package/dist/Fetch.d.ts.map +1 -0
  35. package/dist/Fetch.js +136 -0
  36. package/dist/Fetch.js.map +1 -0
  37. package/dist/FilePathPattern.d.ts +30 -0
  38. package/dist/FilePathPattern.d.ts.map +1 -0
  39. package/dist/FilePathPattern.js +87 -0
  40. package/dist/FilePathPattern.js.map +1 -0
  41. package/dist/FileRouter.d.ts +57 -0
  42. package/dist/FileRouter.d.ts.map +1 -0
  43. package/dist/FileRouter.js +149 -0
  44. package/dist/FileRouter.js.map +1 -0
  45. package/dist/FileRouterCodegen.d.ts +19 -0
  46. package/dist/FileRouterCodegen.d.ts.map +1 -0
  47. package/dist/FileRouterCodegen.js +228 -0
  48. package/dist/FileRouterCodegen.js.map +1 -0
  49. package/dist/FileSystem.d.ts +159 -0
  50. package/dist/FileSystem.d.ts.map +1 -0
  51. package/dist/FileSystem.js +71 -0
  52. package/dist/FileSystem.js.map +1 -0
  53. package/dist/GlobalLayer.d.ts +4 -0
  54. package/dist/GlobalLayer.d.ts.map +1 -0
  55. package/dist/GlobalLayer.js +51 -0
  56. package/dist/GlobalLayer.js.map +1 -0
  57. package/dist/Http.d.ts +38 -0
  58. package/dist/Http.d.ts.map +1 -0
  59. package/dist/Http.js +89 -0
  60. package/dist/Http.js.map +1 -0
  61. package/dist/PathPattern.d.ts +135 -0
  62. package/dist/PathPattern.d.ts.map +1 -0
  63. package/dist/PathPattern.js +414 -0
  64. package/dist/PathPattern.js.map +1 -0
  65. package/dist/PlatformError.d.ts +39 -0
  66. package/dist/PlatformError.d.ts.map +1 -0
  67. package/dist/PlatformError.js +26 -0
  68. package/dist/PlatformError.js.map +1 -0
  69. package/dist/PlatformRuntime.d.ts +30 -0
  70. package/dist/PlatformRuntime.d.ts.map +1 -0
  71. package/dist/PlatformRuntime.js +50 -0
  72. package/dist/PlatformRuntime.js.map +1 -0
  73. package/dist/Route.d.ts +98 -0
  74. package/dist/Route.d.ts.map +1 -0
  75. package/dist/Route.js +101 -0
  76. package/dist/Route.js.map +1 -0
  77. package/dist/RouteBody.d.ts +48 -0
  78. package/dist/RouteBody.d.ts.map +1 -0
  79. package/dist/RouteBody.js +68 -0
  80. package/dist/RouteBody.js.map +1 -0
  81. package/dist/RouteError.d.ts +99 -0
  82. package/dist/RouteError.d.ts.map +1 -0
  83. package/dist/RouteError.js +56 -0
  84. package/dist/RouteError.js.map +1 -0
  85. package/dist/RouteHook.d.ts +13 -0
  86. package/dist/RouteHook.d.ts.map +1 -0
  87. package/dist/RouteHook.js +40 -0
  88. package/dist/RouteHook.js.map +1 -0
  89. package/dist/RouteHttp.d.ts +22 -0
  90. package/dist/RouteHttp.d.ts.map +1 -0
  91. package/dist/RouteHttp.js +259 -0
  92. package/dist/RouteHttp.js.map +1 -0
  93. package/dist/RouteHttpTracer.d.ts +11 -0
  94. package/dist/RouteHttpTracer.d.ts.map +1 -0
  95. package/dist/RouteHttpTracer.js +63 -0
  96. package/dist/RouteHttpTracer.js.map +1 -0
  97. package/dist/RouteMount.d.ts +87 -0
  98. package/dist/RouteMount.d.ts.map +1 -0
  99. package/dist/RouteMount.js +64 -0
  100. package/dist/RouteMount.js.map +1 -0
  101. package/dist/RouteSchema.d.ts +87 -0
  102. package/dist/RouteSchema.d.ts.map +1 -0
  103. package/dist/RouteSchema.js +189 -0
  104. package/dist/RouteSchema.js.map +1 -0
  105. package/dist/RouteSse.d.ts +22 -0
  106. package/dist/RouteSse.d.ts.map +1 -0
  107. package/dist/RouteSse.js +80 -0
  108. package/dist/RouteSse.js.map +1 -0
  109. package/dist/RouteTree.d.ts +58 -0
  110. package/dist/RouteTree.d.ts.map +1 -0
  111. package/dist/RouteTree.js +94 -0
  112. package/dist/RouteTree.js.map +1 -0
  113. package/dist/RouteTrie.d.ts +21 -0
  114. package/dist/RouteTrie.d.ts.map +1 -0
  115. package/dist/RouteTrie.js +153 -0
  116. package/dist/RouteTrie.js.map +1 -0
  117. package/dist/SchemaExtra.d.ts +8 -0
  118. package/dist/SchemaExtra.d.ts.map +1 -0
  119. package/dist/SchemaExtra.js +75 -0
  120. package/dist/SchemaExtra.js.map +1 -0
  121. package/dist/Socket.d.ts +28 -0
  122. package/dist/Socket.d.ts.map +1 -0
  123. package/dist/Socket.js +30 -0
  124. package/dist/Socket.js.map +1 -0
  125. package/dist/SqlIntrospect.d.ts +92 -0
  126. package/dist/SqlIntrospect.d.ts.map +1 -0
  127. package/dist/SqlIntrospect.js +478 -0
  128. package/dist/SqlIntrospect.js.map +1 -0
  129. package/dist/Start.d.ts +90 -0
  130. package/dist/Start.d.ts.map +1 -0
  131. package/dist/Start.js +91 -0
  132. package/dist/Start.js.map +1 -0
  133. package/dist/StartApp.d.ts +13 -0
  134. package/dist/StartApp.d.ts.map +1 -0
  135. package/dist/StartApp.js +4 -0
  136. package/dist/StartApp.js.map +1 -0
  137. package/dist/StreamExtra.d.ts +29 -0
  138. package/dist/StreamExtra.d.ts.map +1 -0
  139. package/dist/StreamExtra.js +101 -0
  140. package/dist/StreamExtra.js.map +1 -0
  141. package/dist/System.d.ts +9 -0
  142. package/dist/System.d.ts.map +1 -0
  143. package/dist/System.js +61 -0
  144. package/dist/System.js.map +1 -0
  145. package/dist/TuplePathPattern.d.ts +10 -0
  146. package/dist/TuplePathPattern.d.ts.map +1 -0
  147. package/dist/TuplePathPattern.js +69 -0
  148. package/dist/TuplePathPattern.js.map +1 -0
  149. package/dist/Unique.d.ts +68 -0
  150. package/dist/Unique.d.ts.map +1 -0
  151. package/dist/Unique.js +225 -0
  152. package/dist/Unique.js.map +1 -0
  153. package/dist/Values.d.ts +30 -0
  154. package/dist/Values.d.ts.map +1 -0
  155. package/dist/Values.js +46 -0
  156. package/dist/Values.js.map +1 -0
  157. package/dist/bun/BunBundle.d.ts +12 -0
  158. package/dist/bun/BunBundle.d.ts.map +1 -0
  159. package/dist/bun/BunBundle.js +138 -0
  160. package/dist/bun/BunBundle.js.map +1 -0
  161. package/dist/bun/BunChildProcessSpawner.d.ts +4 -0
  162. package/dist/bun/BunChildProcessSpawner.d.ts.map +1 -0
  163. package/dist/bun/BunChildProcessSpawner.js +99 -0
  164. package/dist/bun/BunChildProcessSpawner.js.map +1 -0
  165. package/dist/bun/BunImportTrackerPlugin.d.ts +14 -0
  166. package/dist/bun/BunImportTrackerPlugin.d.ts.map +1 -0
  167. package/dist/bun/BunImportTrackerPlugin.js +70 -0
  168. package/dist/bun/BunImportTrackerPlugin.js.map +1 -0
  169. package/dist/bun/BunRoute.d.ts +49 -0
  170. package/dist/bun/BunRoute.d.ts.map +1 -0
  171. package/dist/bun/BunRoute.js +122 -0
  172. package/dist/bun/BunRoute.js.map +1 -0
  173. package/dist/bun/BunRuntime.d.ts +3 -0
  174. package/dist/bun/BunRuntime.d.ts.map +1 -0
  175. package/dist/bun/BunRuntime.js +30 -0
  176. package/dist/bun/BunRuntime.js.map +1 -0
  177. package/dist/bun/BunServer.d.ts +52 -0
  178. package/dist/bun/BunServer.d.ts.map +1 -0
  179. package/dist/bun/BunServer.js +262 -0
  180. package/dist/bun/BunServer.js.map +1 -0
  181. package/dist/bun/BunVirtualFilesPlugin.d.ts +5 -0
  182. package/dist/bun/BunVirtualFilesPlugin.d.ts.map +1 -0
  183. package/dist/bun/BunVirtualFilesPlugin.js +41 -0
  184. package/dist/bun/BunVirtualFilesPlugin.js.map +1 -0
  185. package/dist/bun/_BunEnhancedResolve.d.ts +46 -0
  186. package/dist/bun/_BunEnhancedResolve.d.ts.map +1 -0
  187. package/dist/bun/_BunEnhancedResolve.js +103 -0
  188. package/dist/bun/_BunEnhancedResolve.js.map +1 -0
  189. package/dist/bun/index.d.ts +6 -0
  190. package/dist/bun/index.d.ts.map +1 -0
  191. package/dist/bun/index.js +6 -0
  192. package/dist/bun/index.js.map +1 -0
  193. package/dist/bundler/Bundle.d.ts +62 -0
  194. package/dist/bundler/Bundle.d.ts.map +1 -0
  195. package/dist/bundler/Bundle.js +49 -0
  196. package/dist/bundler/Bundle.js.map +1 -0
  197. package/dist/bundler/BundleFiles.d.ts +14 -0
  198. package/dist/bundler/BundleFiles.d.ts.map +1 -0
  199. package/dist/bundler/BundleFiles.js +97 -0
  200. package/dist/bundler/BundleFiles.js.map +1 -0
  201. package/dist/bundler/BundleRoute.d.ts +27 -0
  202. package/dist/bundler/BundleRoute.d.ts.map +1 -0
  203. package/dist/bundler/BundleRoute.js +52 -0
  204. package/dist/bundler/BundleRoute.js.map +1 -0
  205. package/dist/client/Overlay.d.ts +3 -0
  206. package/dist/client/Overlay.d.ts.map +1 -0
  207. package/dist/client/Overlay.js +33 -0
  208. package/dist/client/Overlay.js.map +1 -0
  209. package/dist/client/ScrollState.d.ts +7 -0
  210. package/dist/client/ScrollState.d.ts.map +1 -0
  211. package/dist/client/ScrollState.js +95 -0
  212. package/dist/client/ScrollState.js.map +1 -0
  213. package/dist/client/index.d.ts +7 -0
  214. package/dist/client/index.d.ts.map +1 -0
  215. package/dist/client/index.js +80 -0
  216. package/dist/client/index.js.map +1 -0
  217. package/dist/datastar/actions/fetch.d.ts +31 -0
  218. package/dist/datastar/actions/fetch.d.ts.map +1 -0
  219. package/dist/datastar/actions/fetch.js +404 -0
  220. package/dist/datastar/actions/fetch.js.map +1 -0
  221. package/dist/datastar/actions/peek.d.ts +2 -0
  222. package/dist/datastar/actions/peek.d.ts.map +1 -0
  223. package/dist/datastar/actions/peek.js +14 -0
  224. package/dist/datastar/actions/peek.js.map +1 -0
  225. package/dist/datastar/actions/setAll.d.ts +2 -0
  226. package/dist/datastar/actions/setAll.d.ts.map +1 -0
  227. package/dist/datastar/actions/setAll.js +13 -0
  228. package/dist/datastar/actions/setAll.js.map +1 -0
  229. package/dist/datastar/actions/toggleAll.d.ts +2 -0
  230. package/dist/datastar/actions/toggleAll.d.ts.map +1 -0
  231. package/dist/datastar/actions/toggleAll.js +13 -0
  232. package/dist/datastar/actions/toggleAll.js.map +1 -0
  233. package/dist/datastar/attributes/attr.d.ts +2 -0
  234. package/dist/datastar/attributes/attr.d.ts.map +1 -0
  235. package/dist/datastar/attributes/attr.js +49 -0
  236. package/dist/datastar/attributes/attr.js.map +1 -0
  237. package/dist/datastar/attributes/bind.d.ts +2 -0
  238. package/dist/datastar/attributes/bind.d.ts.map +1 -0
  239. package/dist/datastar/attributes/bind.js +176 -0
  240. package/dist/datastar/attributes/bind.js.map +1 -0
  241. package/dist/datastar/attributes/class.d.ts +2 -0
  242. package/dist/datastar/attributes/class.d.ts.map +1 -0
  243. package/dist/datastar/attributes/class.js +48 -0
  244. package/dist/datastar/attributes/class.js.map +1 -0
  245. package/dist/datastar/attributes/computed.d.ts +2 -0
  246. package/dist/datastar/attributes/computed.d.ts.map +1 -0
  247. package/dist/datastar/attributes/computed.js +27 -0
  248. package/dist/datastar/attributes/computed.js.map +1 -0
  249. package/dist/datastar/attributes/effect.d.ts +2 -0
  250. package/dist/datastar/attributes/effect.d.ts.map +1 -0
  251. package/dist/datastar/attributes/effect.js +10 -0
  252. package/dist/datastar/attributes/effect.js.map +1 -0
  253. package/dist/datastar/attributes/indicator.d.ts +2 -0
  254. package/dist/datastar/attributes/indicator.d.ts.map +1 -0
  255. package/dist/datastar/attributes/indicator.js +31 -0
  256. package/dist/datastar/attributes/indicator.js.map +1 -0
  257. package/dist/datastar/attributes/init.d.ts +2 -0
  258. package/dist/datastar/attributes/init.d.ts.map +1 -0
  259. package/dist/datastar/attributes/init.js +27 -0
  260. package/dist/datastar/attributes/init.js.map +1 -0
  261. package/dist/datastar/attributes/jsonSignals.d.ts +2 -0
  262. package/dist/datastar/attributes/jsonSignals.d.ts.map +1 -0
  263. package/dist/datastar/attributes/jsonSignals.js +31 -0
  264. package/dist/datastar/attributes/jsonSignals.js.map +1 -0
  265. package/dist/datastar/attributes/on.d.ts +2 -0
  266. package/dist/datastar/attributes/on.d.ts.map +1 -0
  267. package/dist/datastar/attributes/on.js +79 -0
  268. package/dist/datastar/attributes/on.js.map +1 -0
  269. package/dist/datastar/attributes/onIntersect.d.ts +2 -0
  270. package/dist/datastar/attributes/onIntersect.d.ts.map +1 -0
  271. package/dist/datastar/attributes/onIntersect.js +54 -0
  272. package/dist/datastar/attributes/onIntersect.js.map +1 -0
  273. package/dist/datastar/attributes/onInterval.d.ts +2 -0
  274. package/dist/datastar/attributes/onInterval.d.ts.map +1 -0
  275. package/dist/datastar/attributes/onInterval.js +31 -0
  276. package/dist/datastar/attributes/onInterval.js.map +1 -0
  277. package/dist/datastar/attributes/onSignalPatch.d.ts +2 -0
  278. package/dist/datastar/attributes/onSignalPatch.d.ts.map +1 -0
  279. package/dist/datastar/attributes/onSignalPatch.js +43 -0
  280. package/dist/datastar/attributes/onSignalPatch.js.map +1 -0
  281. package/dist/datastar/attributes/ref.d.ts +2 -0
  282. package/dist/datastar/attributes/ref.d.ts.map +1 -0
  283. package/dist/datastar/attributes/ref.js +11 -0
  284. package/dist/datastar/attributes/ref.js.map +1 -0
  285. package/dist/datastar/attributes/show.d.ts +2 -0
  286. package/dist/datastar/attributes/show.d.ts.map +1 -0
  287. package/dist/datastar/attributes/show.js +32 -0
  288. package/dist/datastar/attributes/show.js.map +1 -0
  289. package/dist/datastar/attributes/signals.d.ts +2 -0
  290. package/dist/datastar/attributes/signals.d.ts.map +1 -0
  291. package/dist/datastar/attributes/signals.js +18 -0
  292. package/dist/datastar/attributes/signals.js.map +1 -0
  293. package/dist/datastar/attributes/style.d.ts +2 -0
  294. package/dist/datastar/attributes/style.d.ts.map +1 -0
  295. package/dist/datastar/attributes/style.js +51 -0
  296. package/dist/datastar/attributes/style.js.map +1 -0
  297. package/dist/datastar/attributes/text.d.ts +2 -0
  298. package/dist/datastar/attributes/text.d.ts.map +1 -0
  299. package/dist/datastar/attributes/text.js +27 -0
  300. package/dist/datastar/attributes/text.js.map +1 -0
  301. package/dist/datastar/engine.d.ts +163 -0
  302. package/dist/datastar/engine.d.ts.map +1 -0
  303. package/dist/datastar/engine.js +1000 -0
  304. package/dist/datastar/engine.js.map +1 -0
  305. package/dist/datastar/index.d.ts +25 -0
  306. package/dist/datastar/index.d.ts.map +1 -0
  307. package/dist/datastar/index.js +25 -0
  308. package/dist/datastar/index.js.map +1 -0
  309. package/dist/datastar/utils.d.ts +52 -0
  310. package/dist/datastar/utils.d.ts.map +1 -0
  311. package/dist/datastar/utils.js +203 -0
  312. package/dist/datastar/utils.js.map +1 -0
  313. package/dist/datastar/watchers/patchElements.d.ts +2 -0
  314. package/dist/datastar/watchers/patchElements.d.ts.map +1 -0
  315. package/dist/datastar/watchers/patchElements.js +398 -0
  316. package/dist/datastar/watchers/patchElements.js.map +1 -0
  317. package/dist/datastar/watchers/patchSignals.d.ts +2 -0
  318. package/dist/datastar/watchers/patchSignals.d.ts.map +1 -0
  319. package/dist/datastar/watchers/patchSignals.js +15 -0
  320. package/dist/datastar/watchers/patchSignals.js.map +1 -0
  321. package/dist/experimental/EncryptedCookies.d.ts +49 -0
  322. package/dist/experimental/EncryptedCookies.d.ts.map +1 -0
  323. package/dist/experimental/EncryptedCookies.js +213 -0
  324. package/dist/experimental/EncryptedCookies.js.map +1 -0
  325. package/dist/experimental/index.d.ts +2 -0
  326. package/dist/experimental/index.d.ts.map +1 -0
  327. package/dist/experimental/index.js +2 -0
  328. package/dist/experimental/index.js.map +1 -0
  329. package/dist/hyper/Hyper.d.ts +26 -0
  330. package/dist/hyper/Hyper.d.ts.map +1 -0
  331. package/dist/hyper/Hyper.js +24 -0
  332. package/dist/hyper/Hyper.js.map +1 -0
  333. package/dist/hyper/HyperHtml.d.ts +24 -0
  334. package/dist/hyper/HyperHtml.d.ts.map +1 -0
  335. package/dist/hyper/HyperHtml.js +153 -0
  336. package/dist/hyper/HyperHtml.js.map +1 -0
  337. package/dist/hyper/HyperHtml.test.d.ts +2 -0
  338. package/dist/hyper/HyperHtml.test.d.ts.map +1 -0
  339. package/dist/hyper/HyperHtml.test.js +283 -0
  340. package/dist/hyper/HyperHtml.test.js.map +1 -0
  341. package/dist/hyper/HyperNode.d.ts +15 -0
  342. package/dist/hyper/HyperNode.d.ts.map +1 -0
  343. package/dist/hyper/HyperNode.js +12 -0
  344. package/dist/hyper/HyperNode.js.map +1 -0
  345. package/dist/hyper/HyperRoute.d.ts +9 -0
  346. package/dist/hyper/HyperRoute.d.ts.map +1 -0
  347. package/dist/hyper/HyperRoute.js +33 -0
  348. package/dist/hyper/HyperRoute.js.map +1 -0
  349. package/dist/hyper/HyperRoute.test.d.ts +2 -0
  350. package/dist/hyper/HyperRoute.test.d.ts.map +1 -0
  351. package/dist/hyper/HyperRoute.test.js +86 -0
  352. package/dist/hyper/HyperRoute.test.js.map +1 -0
  353. package/dist/hyper/html.d.ts +11 -0
  354. package/dist/hyper/html.d.ts.map +1 -0
  355. package/dist/hyper/html.js +31 -0
  356. package/dist/hyper/html.js.map +1 -0
  357. package/dist/hyper/index.d.ts +7 -0
  358. package/dist/hyper/index.d.ts.map +1 -0
  359. package/dist/hyper/index.js +6 -0
  360. package/dist/hyper/index.js.map +1 -0
  361. package/dist/hyper/jsx-runtime.d.ts +8 -0
  362. package/dist/hyper/jsx-runtime.d.ts.map +1 -0
  363. package/dist/hyper/jsx-runtime.js +9 -0
  364. package/dist/hyper/jsx-runtime.js.map +1 -0
  365. package/dist/index.d.ts +9 -0
  366. package/dist/index.d.ts.map +1 -0
  367. package/dist/index.js +9 -0
  368. package/dist/index.js.map +1 -0
  369. package/dist/lint/plugin.d.ts +121 -0
  370. package/dist/lint/plugin.d.ts.map +1 -0
  371. package/dist/lint/plugin.js +537 -0
  372. package/dist/lint/plugin.js.map +1 -0
  373. package/dist/node/NodeFileSystem.d.ts +8 -0
  374. package/dist/node/NodeFileSystem.d.ts.map +1 -0
  375. package/dist/node/NodeFileSystem.js +411 -0
  376. package/dist/node/NodeFileSystem.js.map +1 -0
  377. package/dist/node/NodeUtils.d.ts +3 -0
  378. package/dist/node/NodeUtils.d.ts.map +1 -0
  379. package/dist/node/NodeUtils.js +21 -0
  380. package/dist/node/NodeUtils.js.map +1 -0
  381. package/dist/sql/SqlCache.d.ts +18 -0
  382. package/dist/sql/SqlCache.d.ts.map +1 -0
  383. package/dist/sql/SqlCache.js +31 -0
  384. package/dist/sql/SqlCache.js.map +1 -0
  385. package/dist/sql/SqlClient.d.ts +88 -0
  386. package/dist/sql/SqlClient.d.ts.map +1 -0
  387. package/dist/sql/SqlClient.js +171 -0
  388. package/dist/sql/SqlClient.js.map +1 -0
  389. package/dist/sql/bun/index.d.ts +6 -0
  390. package/dist/sql/bun/index.d.ts.map +1 -0
  391. package/dist/sql/bun/index.js +132 -0
  392. package/dist/sql/bun/index.js.map +1 -0
  393. package/dist/sql/index.d.ts +3 -0
  394. package/dist/sql/index.d.ts.map +1 -0
  395. package/dist/sql/index.js +3 -0
  396. package/dist/sql/index.js.map +1 -0
  397. package/dist/sql/libsql/index.d.ts +15 -0
  398. package/dist/sql/libsql/index.d.ts.map +1 -0
  399. package/dist/sql/libsql/index.js +132 -0
  400. package/dist/sql/libsql/index.js.map +1 -0
  401. package/dist/sql/mssql/index.d.ts +8 -0
  402. package/dist/sql/mssql/index.d.ts.map +1 -0
  403. package/dist/sql/mssql/index.js +145 -0
  404. package/dist/sql/mssql/index.js.map +1 -0
  405. package/dist/sql/postgres/index.d.ts +7 -0
  406. package/dist/sql/postgres/index.d.ts.map +1 -0
  407. package/dist/sql/postgres/index.js +136 -0
  408. package/dist/sql/postgres/index.js.map +1 -0
  409. package/dist/testing/TestLogger.d.ts +14 -0
  410. package/dist/testing/TestLogger.d.ts.map +1 -0
  411. package/dist/testing/TestLogger.js +33 -0
  412. package/dist/testing/TestLogger.js.map +1 -0
  413. package/dist/testing/index.d.ts +3 -0
  414. package/dist/testing/index.d.ts.map +1 -0
  415. package/dist/testing/index.js +3 -0
  416. package/dist/testing/index.js.map +1 -0
  417. package/dist/testing/utils.d.ts +10 -0
  418. package/dist/testing/utils.d.ts.map +1 -0
  419. package/dist/testing/utils.js +40 -0
  420. package/dist/testing/utils.js.map +1 -0
  421. package/dist/tower/Simulation.d.ts +3 -0
  422. package/dist/tower/Simulation.d.ts.map +1 -0
  423. package/dist/tower/Simulation.js +606 -0
  424. package/dist/tower/Simulation.js.map +1 -0
  425. package/dist/tower/Tower.d.ts +11 -0
  426. package/dist/tower/Tower.d.ts.map +1 -0
  427. package/dist/tower/Tower.js +30 -0
  428. package/dist/tower/Tower.js.map +1 -0
  429. package/dist/tower/TowerErrors.d.ts +4 -0
  430. package/dist/tower/TowerErrors.d.ts.map +1 -0
  431. package/dist/tower/TowerErrors.js +200 -0
  432. package/dist/tower/TowerErrors.js.map +1 -0
  433. package/dist/tower/TowerLogger.d.ts +2 -0
  434. package/dist/tower/TowerLogger.d.ts.map +1 -0
  435. package/dist/tower/TowerLogger.js +46 -0
  436. package/dist/tower/TowerLogger.js.map +1 -0
  437. package/dist/tower/TowerMetrics.d.ts +4 -0
  438. package/dist/tower/TowerMetrics.d.ts.map +1 -0
  439. package/dist/tower/TowerMetrics.js +62 -0
  440. package/dist/tower/TowerMetrics.js.map +1 -0
  441. package/dist/tower/TowerProcess.d.ts +4 -0
  442. package/dist/tower/TowerProcess.d.ts.map +1 -0
  443. package/dist/tower/TowerProcess.js +50 -0
  444. package/dist/tower/TowerProcess.js.map +1 -0
  445. package/dist/tower/TowerStore.d.ts +199 -0
  446. package/dist/tower/TowerStore.d.ts.map +1 -0
  447. package/dist/tower/TowerStore.js +307 -0
  448. package/dist/tower/TowerStore.js.map +1 -0
  449. package/dist/tower/TowerTracer.d.ts +4 -0
  450. package/dist/tower/TowerTracer.d.ts.map +1 -0
  451. package/dist/tower/TowerTracer.js +111 -0
  452. package/dist/tower/TowerTracer.js.map +1 -0
  453. package/dist/tower/index.d.ts +4 -0
  454. package/dist/tower/index.d.ts.map +1 -0
  455. package/dist/tower/index.js +4 -0
  456. package/dist/tower/index.js.map +1 -0
  457. package/dist/tower/routes/errors/route.d.ts +11 -0
  458. package/dist/tower/routes/errors/route.d.ts.map +1 -0
  459. package/dist/tower/routes/errors/route.js +47 -0
  460. package/dist/tower/routes/errors/route.js.map +1 -0
  461. package/dist/tower/routes/fiberDetail.d.ts +17 -0
  462. package/dist/tower/routes/fiberDetail.d.ts.map +1 -0
  463. package/dist/tower/routes/fiberDetail.js +35 -0
  464. package/dist/tower/routes/fiberDetail.js.map +1 -0
  465. package/dist/tower/routes/fibers/route.d.ts +11 -0
  466. package/dist/tower/routes/fibers/route.d.ts.map +1 -0
  467. package/dist/tower/routes/fibers/route.js +27 -0
  468. package/dist/tower/routes/fibers/route.js.map +1 -0
  469. package/dist/tower/routes/layout.d.ts +10 -0
  470. package/dist/tower/routes/layout.d.ts.map +1 -0
  471. package/dist/tower/routes/layout.js +4 -0
  472. package/dist/tower/routes/layout.js.map +1 -0
  473. package/dist/tower/routes/logs/route.d.ts +11 -0
  474. package/dist/tower/routes/logs/route.d.ts.map +1 -0
  475. package/dist/tower/routes/logs/route.js +36 -0
  476. package/dist/tower/routes/logs/route.js.map +1 -0
  477. package/dist/tower/routes/metrics/route.d.ts +11 -0
  478. package/dist/tower/routes/metrics/route.d.ts.map +1 -0
  479. package/dist/tower/routes/metrics/route.js +20 -0
  480. package/dist/tower/routes/metrics/route.js.map +1 -0
  481. package/dist/tower/routes/route.d.ts +7 -0
  482. package/dist/tower/routes/route.d.ts.map +1 -0
  483. package/dist/tower/routes/route.js +6 -0
  484. package/dist/tower/routes/route.js.map +1 -0
  485. package/dist/tower/routes/routes/route.d.ts +7 -0
  486. package/dist/tower/routes/routes/route.d.ts.map +1 -0
  487. package/dist/tower/routes/routes/route.js +23 -0
  488. package/dist/tower/routes/routes/route.js.map +1 -0
  489. package/dist/tower/routes/services/route.d.ts +7 -0
  490. package/dist/tower/routes/services/route.d.ts.map +1 -0
  491. package/dist/tower/routes/services/route.js +15 -0
  492. package/dist/tower/routes/services/route.js.map +1 -0
  493. package/dist/tower/routes/system/route.d.ts +11 -0
  494. package/dist/tower/routes/system/route.d.ts.map +1 -0
  495. package/dist/tower/routes/system/route.js +21 -0
  496. package/dist/tower/routes/system/route.js.map +1 -0
  497. package/dist/tower/routes/traceDetail.d.ts +17 -0
  498. package/dist/tower/routes/traceDetail.d.ts.map +1 -0
  499. package/dist/tower/routes/traceDetail.js +20 -0
  500. package/dist/tower/routes/traceDetail.js.map +1 -0
  501. package/dist/tower/routes/traces/route.d.ts +11 -0
  502. package/dist/tower/routes/traces/route.d.ts.map +1 -0
  503. package/dist/tower/routes/traces/route.js +36 -0
  504. package/dist/tower/routes/traces/route.js.map +1 -0
  505. package/dist/tower/routes/tree.d.ts +142 -0
  506. package/dist/tower/routes/tree.d.ts.map +1 -0
  507. package/dist/tower/routes/tree.js +28 -0
  508. package/dist/tower/routes/tree.js.map +1 -0
  509. package/dist/tower/ui/Errors.d.ts +5 -0
  510. package/dist/tower/ui/Errors.d.ts.map +1 -0
  511. package/dist/tower/ui/Errors.js +30 -0
  512. package/dist/tower/ui/Errors.js.map +1 -0
  513. package/dist/tower/ui/Fibers.d.ts +25 -0
  514. package/dist/tower/ui/Fibers.d.ts.map +1 -0
  515. package/dist/tower/ui/Fibers.js +157 -0
  516. package/dist/tower/ui/Fibers.js.map +1 -0
  517. package/dist/tower/ui/Logs.d.ts +5 -0
  518. package/dist/tower/ui/Logs.d.ts.map +1 -0
  519. package/dist/tower/ui/Logs.js +28 -0
  520. package/dist/tower/ui/Logs.js.map +1 -0
  521. package/dist/tower/ui/Metrics.d.ts +5 -0
  522. package/dist/tower/ui/Metrics.d.ts.map +1 -0
  523. package/dist/tower/ui/Metrics.js +34 -0
  524. package/dist/tower/ui/Metrics.js.map +1 -0
  525. package/dist/tower/ui/Routes.d.ts +9 -0
  526. package/dist/tower/ui/Routes.d.ts.map +1 -0
  527. package/dist/tower/ui/Routes.js +79 -0
  528. package/dist/tower/ui/Routes.js.map +1 -0
  529. package/dist/tower/ui/Services.d.ts +11 -0
  530. package/dist/tower/ui/Services.d.ts.map +1 -0
  531. package/dist/tower/ui/Services.js +254 -0
  532. package/dist/tower/ui/Services.js.map +1 -0
  533. package/dist/tower/ui/Shell.d.ts +11 -0
  534. package/dist/tower/ui/Shell.d.ts.map +1 -0
  535. package/dist/tower/ui/Shell.js +12 -0
  536. package/dist/tower/ui/Shell.js.map +1 -0
  537. package/dist/tower/ui/System.d.ts +5 -0
  538. package/dist/tower/ui/System.d.ts.map +1 -0
  539. package/dist/tower/ui/System.js +65 -0
  540. package/dist/tower/ui/System.js.map +1 -0
  541. package/dist/tower/ui/Traces.d.ts +13 -0
  542. package/dist/tower/ui/Traces.d.ts.map +1 -0
  543. package/dist/tower/ui/Traces.js +219 -0
  544. package/dist/tower/ui/Traces.js.map +1 -0
  545. package/dist/x/cloudflare/CloudflareTunnel.d.ts +11 -0
  546. package/dist/x/cloudflare/CloudflareTunnel.d.ts.map +1 -0
  547. package/dist/x/cloudflare/CloudflareTunnel.js +31 -0
  548. package/dist/x/cloudflare/CloudflareTunnel.js.map +1 -0
  549. package/dist/x/cloudflare/index.d.ts +2 -0
  550. package/dist/x/cloudflare/index.d.ts.map +1 -0
  551. package/dist/x/cloudflare/index.js +2 -0
  552. package/dist/x/cloudflare/index.js.map +1 -0
  553. package/dist/x/tailscale/TailscaleTunnel.d.ts +16 -0
  554. package/dist/x/tailscale/TailscaleTunnel.d.ts.map +1 -0
  555. package/dist/x/tailscale/TailscaleTunnel.js +66 -0
  556. package/dist/x/tailscale/TailscaleTunnel.js.map +1 -0
  557. package/dist/x/tailscale/index.d.ts +2 -0
  558. package/dist/x/tailscale/index.d.ts.map +1 -0
  559. package/dist/x/tailscale/index.js +2 -0
  560. package/dist/x/tailscale/index.js.map +1 -0
  561. package/dist/x/tailwind/TailwindPlugin.d.ts +24 -0
  562. package/dist/x/tailwind/TailwindPlugin.d.ts.map +1 -0
  563. package/dist/x/tailwind/TailwindPlugin.js +220 -0
  564. package/dist/x/tailwind/TailwindPlugin.js.map +1 -0
  565. package/dist/x/tailwind/compile.d.ts +20 -0
  566. package/dist/x/tailwind/compile.d.ts.map +1 -0
  567. package/dist/x/tailwind/compile.js +155 -0
  568. package/dist/x/tailwind/compile.js.map +1 -0
  569. package/dist/x/tailwind/plugin.d.ts +3 -0
  570. package/dist/x/tailwind/plugin.d.ts.map +1 -0
  571. package/dist/x/tailwind/plugin.js +16 -0
  572. package/dist/x/tailwind/plugin.js.map +1 -0
  573. package/package.json +104 -23
  574. package/src/ChildProcess.ts +3 -6
  575. package/src/Docker.ts +190 -0
  576. package/src/Effectify.ts +7 -10
  577. package/src/FileSystem.ts +1 -4
  578. package/src/GlobalLayer.ts +85 -0
  579. package/src/PlatformRuntime.ts +8 -1
  580. package/src/RouteHook.ts +1 -1
  581. package/src/SqlIntrospect.ts +13 -11
  582. package/src/Start.ts +40 -29
  583. package/src/System.ts +60 -3
  584. package/src/Unique.ts +59 -0
  585. package/src/bun/BunChildProcessSpawner.ts +1 -8
  586. package/src/bun/BunRoute.ts +1 -0
  587. package/src/bun/BunRuntime.ts +2 -8
  588. package/src/bun/BunServer.ts +54 -2
  589. package/src/datastar/watchers/patchElements.ts +0 -1
  590. package/src/lint/plugin.js +146 -81
  591. package/src/sql/SqlCache.ts +50 -0
  592. package/src/sql/SqlClient.ts +59 -14
  593. package/src/sql/bun/index.ts +28 -26
  594. package/src/sql/index.ts +1 -0
  595. package/src/sql/libsql/index.ts +62 -28
  596. package/src/sql/mssql/index.ts +53 -57
  597. package/src/sql/postgres/index.ts +254 -0
  598. package/src/tower/Simulation.ts +776 -0
  599. package/src/tower/Tower.ts +47 -0
  600. package/src/tower/TowerErrors.ts +224 -0
  601. package/src/tower/TowerLogger.ts +52 -0
  602. package/src/tower/TowerMetrics.ts +72 -0
  603. package/src/tower/TowerProcess.ts +59 -0
  604. package/src/tower/TowerStore.ts +505 -0
  605. package/src/tower/TowerTracer.ts +128 -0
  606. package/src/tower/index.ts +3 -0
  607. package/src/tower/routes/errors/route.tsx +90 -0
  608. package/src/tower/routes/fiberDetail.tsx +51 -0
  609. package/src/tower/routes/fibers/route.tsx +46 -0
  610. package/src/tower/routes/layout.html +340 -0
  611. package/src/tower/routes/layout.tsx +4 -0
  612. package/src/tower/routes/logs/route.tsx +73 -0
  613. package/src/tower/routes/metrics/route.tsx +36 -0
  614. package/src/tower/routes/route.tsx +8 -0
  615. package/src/tower/routes/routes/route.tsx +30 -0
  616. package/src/tower/routes/services/route.tsx +21 -0
  617. package/src/tower/routes/system/route.tsx +43 -0
  618. package/src/tower/routes/traceDetail.tsx +30 -0
  619. package/src/tower/routes/traces/route.tsx +72 -0
  620. package/src/tower/routes/tree.ts +28 -0
  621. package/src/tower/ui/Errors.tsx +80 -0
  622. package/src/tower/ui/Fibers.tsx +336 -0
  623. package/src/tower/ui/Logs.tsx +50 -0
  624. package/src/tower/ui/Metrics.tsx +78 -0
  625. package/src/tower/ui/Routes.tsx +125 -0
  626. package/src/tower/ui/Services.tsx +273 -0
  627. package/src/tower/ui/Shell.tsx +74 -0
  628. package/src/tower/ui/System.tsx +141 -0
  629. package/src/tower/ui/Traces.tsx +419 -0
  630. package/src/x/cloudflare/CloudflareTunnel.ts +1 -1
  631. package/src/x/tailscale/TailscaleTunnel.ts +3 -3
  632. package/src/x/tailwind/compile.ts +6 -1
  633. package/src/sql/mssql/docker.ts +0 -117
package/src/Unique.ts CHANGED
@@ -4,6 +4,56 @@ export const ALPHABET_BASE64_URL =
4
4
  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
5
5
  export const ALPHABET_HEX = "0123456789abcdef"
6
6
 
7
+ interface SnowflakeState {
8
+ timestampMs: bigint
9
+ sequence: bigint
10
+ }
11
+
12
+ interface Snowflake {
13
+ (): bigint
14
+ readonly state: SnowflakeState
15
+ readonly timestamp: (id: bigint) => bigint
16
+ }
17
+
18
+ function buildSnowflake(): {
19
+ (): bigint
20
+ readonly state: SnowflakeState
21
+ readonly timestamp: (id: bigint) => bigint
22
+ } {
23
+ const timestampBits = 48n
24
+ const seqBits = 16n
25
+ const seqMax = (1n << seqBits) - 1n
26
+ const timestampMask = (1n << timestampBits) - 1n
27
+
28
+ const fn = Object.assign(
29
+ () => {
30
+ const nowMs = BigInt(Date.now())
31
+ const timestampMs = nowMs > fn.state.timestampMs ? nowMs : fn.state.timestampMs
32
+
33
+ if (timestampMs > fn.state.timestampMs) {
34
+ fn.state.timestampMs = timestampMs
35
+ fn.state.sequence = 0n
36
+ } else {
37
+ fn.state.sequence += 1n
38
+ if (fn.state.sequence > seqMax) {
39
+ fn.state.timestampMs += 1n
40
+ fn.state.sequence = 0n
41
+ }
42
+ }
43
+
44
+ return ((fn.state.timestampMs & timestampMask) << seqBits) | fn.state.sequence
45
+ },
46
+ {
47
+ state: {
48
+ timestampMs: 0n,
49
+ sequence: -1n,
50
+ },
51
+ timestamp: (id: bigint): bigint => id >> seqBits,
52
+ },
53
+ )
54
+ return fn
55
+ }
56
+
7
57
  /**
8
58
  * Generate a random string for ids, session tokens, and API keys.
9
59
  * It uses human-friendly crockford base32 encoding (5 bit of entropy per char)
@@ -169,6 +219,15 @@ function toSafeTime(time: number): number {
169
219
  return Math.max(0, Math.trunc(time))
170
220
  }
171
221
 
222
+ /**
223
+ * Monotonic Snowflake variant:
224
+ * - 48-bit unix timestamp (ms)
225
+ * - 16-bit sequence
226
+ * - sequence resets on timestamp increment
227
+ * - over-capacity sequence carries into next millisecond
228
+ */
229
+ export const snowflake = buildSnowflake()
230
+
172
231
  /**
173
232
  * Generate a nanoid-style random string.
174
233
  *
@@ -6,21 +6,14 @@ import type * as BunTypes from "bun"
6
6
  import * as ChildProcess from "../ChildProcess.ts"
7
7
  import * as PlatformError from "../PlatformError.ts"
8
8
 
9
- const toCmd = (command: ChildProcess.Command): ReadonlyArray<string> => [
10
- command.command,
11
- ...command.args,
12
- ]
13
-
14
9
  export const layer: Layer.Layer<ChildProcess.ChildProcessSpawner> = Layer.succeed(
15
10
  ChildProcess.ChildProcessSpawner,
16
11
  {
17
12
  spawn: (command) =>
18
13
  Effect.gen(function* () {
19
- const cmd = toCmd(command)
20
-
21
14
  const proc = yield* Effect.try({
22
15
  try: () =>
23
- Bun.spawn(cmd as Array<string>, {
16
+ Bun.spawn([...command.cmd], {
24
17
  cwd: command.cwd,
25
18
  env: command.env,
26
19
  stdin: command.stdin ?? "ignore",
@@ -156,6 +156,7 @@ type BunServerFetchHandler = (
156
156
 
157
157
  type BunServerRouteHandler =
158
158
  | Bun.HTMLBundle
159
+ | Bun.BunFile
159
160
  | BunServerFetchHandler
160
161
  | Partial<Record<Bun.Serve.HTTPMethod, BunServerFetchHandler>>
161
162
 
@@ -1,16 +1,10 @@
1
- import type * as Fiber from "effect/Fiber"
2
- import * as GlobalValue from "effect/GlobalValue"
3
1
  import * as MutableRef from "effect/MutableRef"
4
2
  import * as PlatformRuntime from "../PlatformRuntime.ts"
5
3
 
6
- const mainFiber = GlobalValue.globalValue(Symbol.for("effect-start/BunRuntime/existingFiber"), () =>
7
- MutableRef.make<Fiber.RuntimeFiber<unknown, unknown> | undefined>(undefined),
8
- )
9
-
10
4
  export const runMain = PlatformRuntime.makeRunMain((options) => {
11
- const prevFiber = MutableRef.get(mainFiber)
5
+ const prevFiber = MutableRef.get(PlatformRuntime.mainFiber)
12
6
 
13
- MutableRef.set(mainFiber, options.fiber)
7
+ MutableRef.set(PlatformRuntime.mainFiber, options.fiber)
14
8
 
15
9
  let receivedSignal = false
16
10
 
@@ -12,7 +12,7 @@ import type * as Scope from "effect/Scope"
12
12
  import * as NOs from "node:os"
13
13
  import * as NPath from "node:path"
14
14
  import * as PathPattern from "../PathPattern.ts"
15
- import * as PlataformRuntime from "../PlatformRuntime.ts"
15
+ import * as PlatformRuntime from "../PlatformRuntime.ts"
16
16
  import * as Route from "../Route.ts"
17
17
  import * as RouteHttp from "../RouteHttp.ts"
18
18
  import * as StartApp from "../StartApp.ts"
@@ -60,7 +60,7 @@ export const make = (
60
60
  Effect.gen(function* () {
61
61
  const port = yield* Config.number("PORT").pipe(
62
62
  Effect.catchTag("ConfigError", () => {
63
- return PlataformRuntime.isAgentHarness()
63
+ return PlatformRuntime.isAgentHarness()
64
64
  ? Effect.succeed(0) // random port
65
65
  : Effect.succeed(3000)
66
66
  }),
@@ -228,11 +228,14 @@ function walkBunRoutes(runtime: Runtime.Runtime<BunServer>, tree: RouteTree.Rout
228
228
  const pathGroups = new Map<string, Array<RouteMount.MountedRoute>>()
229
229
  const toWebHandler = RouteHttp.toWebHandlerRuntime(runtime)
230
230
 
231
+ let hasPrebuiltBundles = false
232
+
231
233
  for (const route of RouteTree.walk(tree)) {
232
234
  const bunDescriptors = BunRoute.descriptors(route)
233
235
  if (bunDescriptors) {
234
236
  const htmlBundle = yield* Effect.promise(bunDescriptors.bunLoad)
235
237
  if (htmlBundle.files) {
238
+ hasPrebuiltBundles = true
236
239
  registerPrebuiltBundle(bunDescriptors.bunPrefix, htmlBundle, bunRoutes)
237
240
  } else {
238
241
  bunRoutes[`${bunDescriptors.bunPrefix}/*`] = htmlBundle
@@ -252,6 +255,15 @@ function walkBunRoutes(runtime: Runtime.Runtime<BunServer>, tree: RouteTree.Rout
252
255
  }
253
256
  }
254
257
 
258
+ if (hasPrebuiltBundles) {
259
+ const mainDir = NPath.dirname(Bun.main)
260
+ for (const output of discoverStaticOutputs(mainDir)) {
261
+ const routePath = `/${NPath.basename(output.path)}`
262
+ if (routePath in bunRoutes) continue
263
+ bunRoutes[routePath] = Bun.file(output.path)
264
+ }
265
+ }
266
+
255
267
  return bunRoutes
256
268
  })
257
269
  }
@@ -274,6 +286,38 @@ function registerPrebuiltBundle(prefix: string, bundle: any, bunRoutes: BunRoute
274
286
  }
275
287
  }
276
288
 
289
+ type StaticOutput = Pick<Bun.BuildArtifact, "path" | "loader" | "kind">
290
+
291
+ function discoverStaticOutputs(dir: string): Array<StaticOutput> {
292
+ const loaderByExt: Record<string, Bun.Loader> = {
293
+ ".js": "js",
294
+ ".mjs": "js",
295
+ ".cjs": "js",
296
+ ".jsx": "jsx",
297
+ ".tsx": "tsx",
298
+ ".ts": "ts",
299
+ ".css": "css",
300
+ ".html": "html",
301
+ ".json": "json",
302
+ ".jsonc": "jsonc",
303
+ ".toml": "toml",
304
+ ".yaml": "yaml",
305
+ ".wasm": "wasm",
306
+ ".txt": "text",
307
+ }
308
+
309
+ const outputs: Array<StaticOutput> = []
310
+ for (const entry of new Bun.Glob("*").scanSync({ cwd: dir, onlyFiles: true })) {
311
+ const ext = NPath.extname(entry).toLowerCase()
312
+ outputs.push({
313
+ path: NPath.resolve(dir, entry),
314
+ loader: loaderByExt[ext] ?? "file",
315
+ kind: "asset",
316
+ })
317
+ }
318
+ return outputs
319
+ }
320
+
277
321
  function rewriteRelativeAssetPaths(html: string | Promise<string>): Promise<string> {
278
322
  const rewriter = new HTMLRewriter()
279
323
  .on("link[href]", {
@@ -292,6 +336,14 @@ function rewriteRelativeAssetPaths(html: string | Promise<string>): Promise<stri
292
336
  }
293
337
  },
294
338
  })
339
+ .on("img[src]", {
340
+ element(el) {
341
+ const src = el.getAttribute("src")
342
+ if (src && isRelativePath(src)) {
343
+ el.setAttribute("src", "/" + assetBasename(src))
344
+ }
345
+ },
346
+ })
295
347
 
296
348
  return Promise.resolve(html).then((h) => rewriter.transform(new Response(h)).text())
297
349
  }
@@ -403,7 +403,6 @@ const removeNode = (node: Node): void => {
403
403
  }
404
404
 
405
405
  const moveBefore: (parentNode: Node, node: Node, after: Node | null) => void =
406
- // @ts-expect-error
407
406
  removeNode.call.bind(ctxPantry.moveBefore ?? ctxPantry.insertBefore)
408
407
 
409
408
  const aliasedPreserveAttr = aliasify("preserve-attr")
@@ -63,10 +63,7 @@ export default {
63
63
  data: { source, baseName, typePrefix },
64
64
  fix(fixer) {
65
65
  const fixes = [
66
- fixer.replaceText(
67
- node,
68
- `import ${typePrefix}* as ${baseName} from "${source}"`,
69
- ),
66
+ fixer.replaceText(node, `import ${typePrefix}* as ${baseName} from "${source}"`),
70
67
  ]
71
68
 
72
69
  for (const specifier of node.specifiers) {
@@ -243,18 +240,15 @@ export default {
243
240
  const ancestors = sourceCode.getAncestors(node)
244
241
  const parent = ancestors[ancestors.length - 1]
245
242
  if (!parent) return false
246
- if (parent.type === "MethodDefinition" || parent.type === "Property" && parent.method) return true
247
- if (
248
- parent.type === "VariableDeclarator" &&
249
- parent.init === node
250
- ) return true
243
+ if (parent.type === "MethodDefinition" || (parent.type === "Property" && parent.method))
244
+ return true
245
+ if (parent.type === "VariableDeclarator" && parent.init === node) return true
251
246
  return false
252
247
  }
253
248
 
254
249
  function checkParams(node) {
255
250
  for (const param of node.params) {
256
- const pattern =
257
- param.type === "AssignmentPattern" ? param.left : param
251
+ const pattern = param.type === "AssignmentPattern" ? param.left : param
258
252
  if (pattern.type !== "ObjectPattern") continue
259
253
 
260
254
  const baseName = isDefinition(node) ? "options" : "v"
@@ -262,84 +256,77 @@ export default {
262
256
  const name = findUnusedName(outerScope, baseName)
263
257
 
264
258
  const hasPropertyDefaults = pattern.properties.some(
265
- (prop) =>
266
- prop.type !== "RestElement" &&
267
- prop.value.type === "AssignmentPattern",
259
+ (prop) => prop.type !== "RestElement" && prop.value.type === "AssignmentPattern",
268
260
  )
269
261
 
270
262
  context.report({
271
263
  node: pattern,
272
264
  messageId: "noDestructuredParam",
273
- fix: hasPropertyDefaults ? undefined : (fixer) => {
274
- const fixes = []
275
-
276
- const typeAnnotation = pattern.typeAnnotation
277
- ? sourceCode.getText(pattern.typeAnnotation)
278
- : ""
279
- const hasDefault = param.type === "AssignmentPattern"
280
- const defaultValue = hasDefault
281
- ? " = " + sourceCode.getText(param.right)
282
- : ""
283
-
284
- fixes.push(
285
- fixer.replaceTextRange(
286
- param.range,
287
- name + typeAnnotation + defaultValue,
288
- ),
289
- )
290
-
291
- const fnScope = sourceCode.getScope(node)
292
- const localToKey = new Map()
293
- for (const prop of pattern.properties) {
294
- if (prop.type === "RestElement") continue
295
- const keyName =
296
- prop.key.type === "Identifier"
297
- ? prop.key.name
298
- : sourceCode.getText(prop.key)
299
- const localNode =
300
- prop.value.type === "AssignmentPattern"
301
- ? prop.value.left
302
- : prop.value
303
- if (localNode.type === "Identifier") {
304
- localToKey.set(localNode.name, keyName)
305
- }
306
- }
265
+ fix: hasPropertyDefaults
266
+ ? undefined
267
+ : (fixer) => {
268
+ const fixes = []
269
+
270
+ const typeAnnotation = pattern.typeAnnotation
271
+ ? sourceCode.getText(pattern.typeAnnotation)
272
+ : ""
273
+ const hasDefault = param.type === "AssignmentPattern"
274
+ const defaultValue = hasDefault ? " = " + sourceCode.getText(param.right) : ""
275
+
276
+ fixes.push(
277
+ fixer.replaceTextRange(param.range, name + typeAnnotation + defaultValue),
278
+ )
307
279
 
308
- for (const variable of fnScope.variables) {
309
- const keyName = localToKey.get(variable.name)
310
- if (keyName === undefined) continue
311
-
312
- for (const ref of variable.references) {
313
- if (ref.identifier.range[0] >= pattern.range[0] &&
314
- ref.identifier.range[1] <= pattern.range[1]) continue
315
-
316
- const ancestors = sourceCode.getAncestors(ref.identifier)
317
- const parent = ancestors[ancestors.length - 1]
318
- if (
319
- parent &&
320
- parent.type === "Property" &&
321
- parent.shorthand &&
322
- parent.value === ref.identifier
323
- ) {
324
- fixes.push(
325
- fixer.replaceTextRange(
326
- parent.range,
327
- keyName + ": " + name + "." + keyName,
328
- ),
329
- )
330
- } else {
331
- fixes.push(
332
- fixer.replaceTextRange(
333
- ref.identifier.range,
334
- name + "." + keyName,
335
- ),
336
- )
280
+ const fnScope = sourceCode.getScope(node)
281
+ const localToKey = new Map()
282
+ for (const prop of pattern.properties) {
283
+ if (prop.type === "RestElement") continue
284
+ const keyName =
285
+ prop.key.type === "Identifier"
286
+ ? prop.key.name
287
+ : sourceCode.getText(prop.key)
288
+ const localNode =
289
+ prop.value.type === "AssignmentPattern" ? prop.value.left : prop.value
290
+ if (localNode.type === "Identifier") {
291
+ localToKey.set(localNode.name, keyName)
292
+ }
337
293
  }
338
- }
339
- }
340
294
 
341
- return fixes
342
- },
295
+ for (const variable of fnScope.variables) {
296
+ const keyName = localToKey.get(variable.name)
297
+ if (keyName === undefined) continue
298
+
299
+ for (const ref of variable.references) {
300
+ if (
301
+ ref.identifier.range[0] >= pattern.range[0] &&
302
+ ref.identifier.range[1] <= pattern.range[1]
303
+ )
304
+ continue
305
+
306
+ const ancestors = sourceCode.getAncestors(ref.identifier)
307
+ const parent = ancestors[ancestors.length - 1]
308
+ if (
309
+ parent &&
310
+ parent.type === "Property" &&
311
+ parent.shorthand &&
312
+ parent.value === ref.identifier
313
+ ) {
314
+ fixes.push(
315
+ fixer.replaceTextRange(
316
+ parent.range,
317
+ keyName + ": " + name + "." + keyName,
318
+ ),
319
+ )
320
+ } else {
321
+ fixes.push(
322
+ fixer.replaceTextRange(ref.identifier.range, name + "." + keyName),
323
+ )
324
+ }
325
+ }
326
+ }
327
+
328
+ return fixes
329
+ },
343
330
  })
344
331
  }
345
332
  }
@@ -352,6 +339,80 @@ export default {
352
339
  },
353
340
  },
354
341
 
342
+ "namespace-import-mismatch": {
343
+ meta: {
344
+ type: "suggestion",
345
+ docs: {
346
+ description:
347
+ "Warn when a namespace import alias doesn't match the basename of the module path",
348
+ },
349
+ fixable: "code",
350
+ schema: [],
351
+ messages: {
352
+ mismatch:
353
+ 'Namespace import alias "{{alias}}" does not match module basename "{{baseName}}"',
354
+ },
355
+ },
356
+ create(context) {
357
+ const importNames = new Set()
358
+
359
+ return {
360
+ ImportDeclaration(node) {
361
+ for (const spec of node.specifiers) {
362
+ importNames.add(spec.local.name)
363
+ }
364
+
365
+ const source = node.source.value
366
+ if (typeof source !== "string") return
367
+
368
+ if (
369
+ node.specifiers.length !== 1 ||
370
+ node.specifiers[0].type !== "ImportNamespaceSpecifier"
371
+ ) {
372
+ return
373
+ }
374
+
375
+ if (!isLocalImport(source)) return
376
+
377
+ const baseName = getBaseName(source)
378
+ if (!baseName) return
379
+ if (!isCapitalized(baseName)) return
380
+
381
+ const alias = node.specifiers[0].local.name
382
+ if (alias === baseName) return
383
+
384
+ const hasCollision = importNames.has(baseName) && alias !== baseName
385
+ const sourceCode = context.sourceCode || context.getSourceCode()
386
+
387
+ context.report({
388
+ node,
389
+ messageId: "mismatch",
390
+ data: { alias, baseName },
391
+ fix: hasCollision
392
+ ? undefined
393
+ : (fixer) => {
394
+ const fixes = [
395
+ fixer.replaceText(
396
+ node,
397
+ `import ${node.importKind === "type" ? "type " : ""}* as ${baseName} from "${source}"`,
398
+ ),
399
+ ]
400
+
401
+ for (const variable of sourceCode.getDeclaredVariables(node.specifiers[0])) {
402
+ for (const ref of variable.references) {
403
+ if (ref.identifier.range[0] === node.specifiers[0].local.range[0]) continue
404
+ fixes.push(fixer.replaceTextRange(ref.identifier.range, baseName))
405
+ }
406
+ }
407
+
408
+ return fixes
409
+ },
410
+ })
411
+ },
412
+ }
413
+ },
414
+ },
415
+
355
416
  "test-assertion-newline": {
356
417
  meta: {
357
418
  type: "layout",
@@ -552,6 +613,10 @@ function getBaseName(source) {
552
613
  return last
553
614
  }
554
615
 
616
+ function isLocalImport(source) {
617
+ return source.startsWith(".") || source.startsWith("/")
618
+ }
619
+
555
620
  function isCapitalized(name) {
556
621
  return name.length > 0 && name[0] >= "A" && name[0] <= "Z"
557
622
  }
@@ -0,0 +1,50 @@
1
+ import * as Cache from "effect/Cache"
2
+ import * as Context from "effect/Context"
3
+ import type * as Duration from "effect/Duration"
4
+ import * as Effect from "effect/Effect"
5
+ import * as Layer from "effect/Layer"
6
+ import type * as SqlClient from "./SqlClient.ts"
7
+
8
+ type SqlCacheInstance = Cache.Cache<string, ReadonlyArray<any>>
9
+
10
+ export class SqlCache extends Context.Tag("effect-start/SqlCache")<SqlCache, SqlCacheInstance>() {}
11
+
12
+ export function layer(options: {
13
+ readonly capacity: number
14
+ readonly timeToLive: Duration.DurationInput
15
+ }): Layer.Layer<SqlCache> {
16
+ return Layer.effect(
17
+ SqlCache,
18
+ Cache.make<string, ReadonlyArray<any>>({
19
+ capacity: options.capacity,
20
+ timeToLive: options.timeToLive,
21
+ lookup: (key) => Effect.die(`cache miss without populate for key: ${key}`),
22
+ }),
23
+ )
24
+ }
25
+
26
+ export function withCache(
27
+ cache: SqlCacheInstance,
28
+ ): <A extends object>(
29
+ self: SqlClient.SqlEffect<A>,
30
+ ) => Effect.Effect<ReadonlyArray<A>, SqlClient.SqlError>
31
+ export function withCache(): <A extends object>(
32
+ self: SqlClient.SqlEffect<A>,
33
+ ) => Effect.Effect<ReadonlyArray<A>, SqlClient.SqlError, SqlCache>
34
+ export function withCache(cache?: SqlCacheInstance) {
35
+ return <A extends object>(self: SqlClient.SqlEffect<A>) => {
36
+ const key = JSON.stringify({ sql: self.sql, parameters: self.parameters })
37
+ if (cache) {
38
+ return Effect.flatMap(cache.getOption(key), (option) => {
39
+ if (option._tag === "Some") return Effect.succeed(option.value as ReadonlyArray<A>)
40
+ return Effect.tap(self, (result) => cache.set(key, result))
41
+ })
42
+ }
43
+ return Effect.flatMap(SqlCache, (c) =>
44
+ Effect.flatMap(c.getOption(key), (option) => {
45
+ if (option._tag === "Some") return Effect.succeed(option.value as ReadonlyArray<A>)
46
+ return Effect.tap(self, (result) => c.set(key, result))
47
+ }),
48
+ )
49
+ }
50
+ }