effect-start 0.26.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 (654) 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 -21
  574. package/src/ChildProcess.ts +3 -6
  575. package/src/Docker.ts +190 -0
  576. package/src/Effectify.ts +7 -10
  577. package/src/Entity.ts +6 -6
  578. package/src/FileRouterCodegen.ts +4 -4
  579. package/src/FileSystem.ts +4 -11
  580. package/src/GlobalLayer.ts +85 -0
  581. package/src/PlatformRuntime.ts +8 -1
  582. package/src/RouteHook.ts +2 -2
  583. package/src/RouteSse.ts +3 -3
  584. package/src/SqlIntrospect.ts +13 -11
  585. package/src/Start.ts +112 -1
  586. package/src/System.ts +60 -3
  587. package/src/Unique.ts +59 -0
  588. package/src/Values.ts +11 -0
  589. package/src/bun/BunChildProcessSpawner.ts +1 -8
  590. package/src/bun/BunRoute.ts +2 -1
  591. package/src/bun/BunRuntime.ts +6 -12
  592. package/src/bun/BunServer.ts +54 -2
  593. package/src/datastar/watchers/patchElements.ts +0 -1
  594. package/src/hyper/HyperHtml.ts +11 -7
  595. package/src/hyper/jsx.d.ts +1 -1
  596. package/src/lint/plugin.js +239 -4
  597. package/src/sql/SqlCache.ts +50 -0
  598. package/src/sql/SqlClient.ts +400 -0
  599. package/src/sql/bun/index.ts +126 -57
  600. package/src/sql/index.ts +2 -1
  601. package/src/sql/libsql/index.ts +133 -85
  602. package/src/sql/libsql/libsql.d.ts +4 -1
  603. package/src/sql/mssql/index.ts +149 -120
  604. package/src/sql/mssql/mssql.d.ts +1 -0
  605. package/src/sql/postgres/index.ts +254 -0
  606. package/src/testing/TestLogger.ts +4 -4
  607. package/src/{console → tower}/Simulation.ts +10 -48
  608. package/src/tower/Tower.ts +47 -0
  609. package/src/{console/ConsoleErrors.ts → tower/TowerErrors.ts} +34 -23
  610. package/src/tower/TowerLogger.ts +52 -0
  611. package/src/{console/ConsoleMetrics.ts → tower/TowerMetrics.ts} +5 -5
  612. package/src/{console/ConsoleProcess.ts → tower/TowerProcess.ts} +4 -4
  613. package/src/tower/TowerStore.ts +505 -0
  614. package/src/tower/TowerTracer.ts +128 -0
  615. package/src/tower/index.ts +3 -0
  616. package/src/{console → tower}/routes/errors/route.tsx +26 -33
  617. package/src/{console → tower}/routes/fiberDetail.tsx +12 -15
  618. package/src/tower/routes/fibers/route.tsx +46 -0
  619. package/src/{console/console.html → tower/routes/layout.html} +1 -1
  620. package/src/{console → tower}/routes/layout.tsx +1 -1
  621. package/src/{console → tower}/routes/logs/route.tsx +12 -16
  622. package/src/{console → tower}/routes/metrics/route.tsx +5 -5
  623. package/src/tower/routes/route.tsx +8 -0
  624. package/src/{console → tower}/routes/routes/route.tsx +2 -2
  625. package/src/{console → tower}/routes/services/route.tsx +2 -2
  626. package/src/{console → tower}/routes/system/route.tsx +5 -5
  627. package/src/tower/routes/traceDetail.tsx +30 -0
  628. package/src/{console → tower}/routes/traces/route.tsx +25 -34
  629. package/src/{console → tower}/routes/tree.ts +0 -2
  630. package/src/{console → tower}/ui/Errors.tsx +19 -15
  631. package/src/{console → tower}/ui/Fibers.tsx +83 -68
  632. package/src/{console → tower}/ui/Logs.tsx +20 -16
  633. package/src/{console → tower}/ui/Metrics.tsx +18 -18
  634. package/src/{console → tower}/ui/Routes.tsx +14 -14
  635. package/src/{console → tower}/ui/Services.tsx +9 -9
  636. package/src/tower/ui/Shell.tsx +74 -0
  637. package/src/{console → tower}/ui/System.tsx +40 -30
  638. package/src/{console → tower}/ui/Traces.tsx +73 -80
  639. package/src/x/cloudflare/CloudflareTunnel.ts +1 -1
  640. package/src/x/tailscale/TailscaleTunnel.ts +3 -3
  641. package/src/x/tailwind/compile.ts +11 -14
  642. package/src/console/Console.ts +0 -42
  643. package/src/console/ConsoleLogger.ts +0 -56
  644. package/src/console/ConsoleStore.ts +0 -187
  645. package/src/console/ConsoleTracer.ts +0 -107
  646. package/src/console/index.ts +0 -3
  647. package/src/console/routes/fibers/route.tsx +0 -45
  648. package/src/console/routes/git/route.tsx +0 -64
  649. package/src/console/routes/route.tsx +0 -8
  650. package/src/console/routes/traceDetail.tsx +0 -22
  651. package/src/console/ui/Git.tsx +0 -182
  652. package/src/console/ui/Shell.tsx +0 -62
  653. package/src/sql/Sql.ts +0 -51
  654. package/src/sql/mssql/docker.ts +0 -117
package/src/System.ts CHANGED
@@ -1,11 +1,69 @@
1
1
  import * as Effect from "effect/Effect"
2
2
  import type * as Scope from "effect/Scope"
3
+ import * as NNet from "node:net"
3
4
 
4
5
  import * as ChildProcess from "./ChildProcess.ts"
5
6
  import * as PlatformError from "./PlatformError.ts"
6
7
 
7
8
  export const cwd: Effect.Effect<string> = Effect.sync(() => process.cwd())
8
9
 
10
+ export const randomFreePort: Effect.Effect<number, PlatformError.SystemError> = Effect.async<
11
+ number,
12
+ PlatformError.SystemError
13
+ >((resume) => {
14
+ const server = NNet.createServer()
15
+ server.unref()
16
+ server.on("error", (err) =>
17
+ resume(
18
+ Effect.fail(
19
+ new PlatformError.SystemError({
20
+ reason: "Unknown",
21
+ module: "System",
22
+ method: "randomFreePort",
23
+ description: err.message,
24
+ cause: err,
25
+ }),
26
+ ),
27
+ ),
28
+ )
29
+ server.listen(0, "127.0.0.1", () => {
30
+ const address = server.address()
31
+ if (!address || typeof address === "string") {
32
+ server.close(() =>
33
+ resume(
34
+ Effect.fail(
35
+ new PlatformError.SystemError({
36
+ reason: "Unknown",
37
+ module: "System",
38
+ method: "randomFreePort",
39
+ description: "Failed to allocate a free port",
40
+ }),
41
+ ),
42
+ ),
43
+ )
44
+ return
45
+ }
46
+ const port = address.port
47
+ server.close((err) => {
48
+ if (err) {
49
+ resume(
50
+ Effect.fail(
51
+ new PlatformError.SystemError({
52
+ reason: "Unknown",
53
+ module: "System",
54
+ method: "randomFreePort",
55
+ description: err.message,
56
+ cause: err,
57
+ }),
58
+ ),
59
+ )
60
+ return
61
+ }
62
+ resume(Effect.succeed(port))
63
+ })
64
+ })
65
+ })
66
+
9
67
  export const which = (name: string): Effect.Effect<string, PlatformError.SystemError> =>
10
68
  Effect.flatMap(
11
69
  Effect.try({
@@ -33,11 +91,10 @@ export const which = (name: string): Effect.Effect<string, PlatformError.SystemE
33
91
  )
34
92
 
35
93
  export const spawn = (
36
- command: string,
37
- args?: ReadonlyArray<string>,
94
+ cmd: readonly [string, ...Array<string>],
38
95
  options?: ChildProcess.Command.Options,
39
96
  ): Effect.Effect<
40
97
  ChildProcess.ChildProcessHandle,
41
98
  PlatformError.PlatformError,
42
99
  ChildProcess.ChildProcessSpawner | Scope.Scope
43
- > => ChildProcess.spawn(ChildProcess.make(command, args, options))
100
+ > => ChildProcess.spawn(ChildProcess.make(cmd, options))
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
  *
package/src/Values.ts CHANGED
@@ -73,9 +73,20 @@ export const firstValue = <T>(record: Record<string, T>): T | undefined => {
73
73
  return undefined
74
74
  }
75
75
 
76
+ export const isTemplateStringsArray = (value: unknown): value is TemplateStringsArray =>
77
+ Array.isArray(value) && "raw" in value
78
+
76
79
  export const concatBytes = (a: Uint8Array, b: Uint8Array): Uint8Array => {
77
80
  const result = new Uint8Array(a.byteLength + b.byteLength)
78
81
  result.set(a)
79
82
  result.set(b, a.byteLength)
80
83
  return result
81
84
  }
85
+
86
+ export const compact = (record: Record<string, unknown | undefined>): Record<string, unknown> => {
87
+ const out: Record<string, unknown> = {}
88
+ for (const [key, value] of Object.entries(record)) {
89
+ if (value !== undefined) out[key] = value
90
+ }
91
+ return out
92
+ }
@@ -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",
@@ -113,7 +113,7 @@ export function htmlBundle(load: () => HTMLBundleModule | Promise<HTMLBundleModu
113
113
  }),
114
114
  })
115
115
 
116
- const childEntity = yield* Entity.resolve(next(context))
116
+ const childEntity = yield* next(context)
117
117
  const children = childEntity?.body ?? childEntity
118
118
 
119
119
  let childrenHtml = ""
@@ -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,25 +1,19 @@
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
- )
4
+ export const runMain = PlatformRuntime.makeRunMain((options) => {
5
+ const prevFiber = MutableRef.get(PlatformRuntime.mainFiber)
9
6
 
10
- export const runMain = PlatformRuntime.makeRunMain(({ fiber, teardown }) => {
11
- const prevFiber = MutableRef.get(mainFiber)
12
-
13
- MutableRef.set(mainFiber, fiber)
7
+ MutableRef.set(PlatformRuntime.mainFiber, options.fiber)
14
8
 
15
9
  let receivedSignal = false
16
10
 
17
- fiber.addObserver((exit) => {
11
+ options.fiber.addObserver((exit) => {
18
12
  if (!receivedSignal) {
19
13
  process.removeListener("SIGINT", onSigint)
20
14
  process.removeListener("SIGTERM", onSigint)
21
15
  }
22
- teardown(exit, (code) => {
16
+ options.teardown(exit, (code) => {
23
17
  if (receivedSignal || code !== 0) {
24
18
  process.exit(code)
25
19
  }
@@ -30,7 +24,7 @@ export const runMain = PlatformRuntime.makeRunMain(({ fiber, teardown }) => {
30
24
  receivedSignal = true
31
25
  process.removeListener("SIGINT", onSigint)
32
26
  process.removeListener("SIGTERM", onSigint)
33
- fiber.unsafeInterruptAsFork(fiber.id())
27
+ options.fiber.unsafeInterruptAsFork(options.fiber.id())
34
28
  }
35
29
 
36
30
  process.on("SIGINT", onSigint)
@@ -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")
@@ -53,6 +53,9 @@ let map = {
53
53
 
54
54
  const RAW_TEXT_TAGS = ["script", "style"]
55
55
 
56
+ // Prevents closing html tags in embedded css/js source
57
+ const escapeRawText = (text: string) => text.replaceAll("</", "<\\/")
58
+
56
59
  export function renderToString(
57
60
  node: JSX.Children,
58
61
  hooks?: { onNode?: (node: HyperNode.HyperNode) => void },
@@ -113,8 +116,7 @@ export function renderToString(
113
116
  for (const key in props) {
114
117
  if (
115
118
  key !== "children" &&
116
- key !== "innerHTML" && // Solid-specific
117
- key !== "dangerouslySetInnerHTML" && // React-specific
119
+ key !== "dangerouslySetInnerHTML" &&
118
120
  props[key] !== false &&
119
121
  props[key] != null
120
122
  ) {
@@ -140,17 +142,19 @@ export function renderToString(
140
142
  if (!EMPTY_TAGS.includes(type)) {
141
143
  stack.push(`</${type}>`)
142
144
 
143
- const html = props.dangerouslySetInnerHTML?.__html ?? props.innerHTML
145
+ const isRawText = RAW_TEXT_TAGS.includes(type)
146
+ const html = props.dangerouslySetInnerHTML?.__html
144
147
 
145
148
  if (html) {
146
- result += html
149
+ result += isRawText ? escapeRawText(html) : html
147
150
  } else {
148
151
  const children = props.children
149
152
 
150
153
  if (type === "script" && typeof children === "function") {
151
- result += `(${children.toString()})(window)`
152
- } else if (RAW_TEXT_TAGS.includes(type) && children != null) {
153
- result += Array.isArray(children) ? children.join("") : children
154
+ result += escapeRawText(`(${children.toString()})(window)`)
155
+ } else if (isRawText && children != null) {
156
+ const raw = Array.isArray(children) ? children.join("") : String(children)
157
+ result += escapeRawText(raw)
154
158
  } else if (Array.isArray(children)) {
155
159
  for (let i = children.length - 1; i >= 0; i--) {
156
160
  stack.push(children[i])
@@ -536,7 +536,7 @@ export namespace JSX {
536
536
  // [key: ClassKeys]: boolean;
537
537
 
538
538
  // properties
539
- innerHTML?: string
539
+ dangerouslySetInnerHTML?: { __html: string }
540
540
  textContent?: string | number
541
541
 
542
542
  // attributes
@@ -55,15 +55,38 @@ export default {
55
55
 
56
56
  const typePrefix = node.importKind === "type" ? "type " : ""
57
57
 
58
+ const sourceCode = context.sourceCode || context.getSourceCode()
59
+
58
60
  context.report({
59
61
  node,
60
62
  messageId: "preferNamespace",
61
63
  data: { source, baseName, typePrefix },
62
64
  fix(fixer) {
63
- return fixer.replaceText(
64
- node,
65
- `import ${typePrefix}* as ${baseName} from "${source}"`,
66
- )
65
+ const fixes = [
66
+ fixer.replaceText(node, `import ${typePrefix}* as ${baseName} from "${source}"`),
67
+ ]
68
+
69
+ for (const specifier of node.specifiers) {
70
+ if (specifier.type !== "ImportSpecifier") continue
71
+ const localName = specifier.local.name
72
+ const importedName = specifier.imported.name
73
+
74
+ for (const variable of sourceCode.getDeclaredVariables(specifier)) {
75
+ for (const ref of variable.references) {
76
+ if (ref.identifier.range[0] === specifier.local.range[0]) continue
77
+ fixes.push(
78
+ fixer.replaceTextRange(
79
+ ref.identifier.range,
80
+ localName !== importedName
81
+ ? `${baseName}.${importedName}`
82
+ : `${baseName}.${localName}`,
83
+ ),
84
+ )
85
+ }
86
+ }
87
+ }
88
+
89
+ return fixes
67
90
  },
68
91
  })
69
92
  },
@@ -182,6 +205,214 @@ export default {
182
205
  },
183
206
  },
184
207
 
208
+ "no-destructured-params": {
209
+ meta: {
210
+ type: "suggestion",
211
+ docs: {
212
+ description: "Disallow destructuring objects in function parameters",
213
+ },
214
+ fixable: "code",
215
+ schema: [],
216
+ messages: {
217
+ noDestructuredParam:
218
+ "Avoid destructuring objects in function parameters. Use a single parameter and access properties on it instead.",
219
+ },
220
+ },
221
+ create(context) {
222
+ const sourceCode = context.sourceCode || context.getSourceCode()
223
+
224
+ function findUnusedName(scope, base) {
225
+ const names = new Set()
226
+ let current = scope
227
+ while (current) {
228
+ for (const v of current.variables) names.add(v.name)
229
+ current = current.upper
230
+ }
231
+ if (!names.has(base)) return base
232
+ for (let i = 2; ; i++) {
233
+ const candidate = base + i
234
+ if (!names.has(candidate)) return candidate
235
+ }
236
+ }
237
+
238
+ function isDefinition(node) {
239
+ if (node.type === "FunctionDeclaration") return true
240
+ const ancestors = sourceCode.getAncestors(node)
241
+ const parent = ancestors[ancestors.length - 1]
242
+ if (!parent) return false
243
+ if (parent.type === "MethodDefinition" || (parent.type === "Property" && parent.method))
244
+ return true
245
+ if (parent.type === "VariableDeclarator" && parent.init === node) return true
246
+ return false
247
+ }
248
+
249
+ function checkParams(node) {
250
+ for (const param of node.params) {
251
+ const pattern = param.type === "AssignmentPattern" ? param.left : param
252
+ if (pattern.type !== "ObjectPattern") continue
253
+
254
+ const baseName = isDefinition(node) ? "options" : "v"
255
+ const outerScope = sourceCode.getScope(node).upper || sourceCode.getScope(node)
256
+ const name = findUnusedName(outerScope, baseName)
257
+
258
+ const hasPropertyDefaults = pattern.properties.some(
259
+ (prop) => prop.type !== "RestElement" && prop.value.type === "AssignmentPattern",
260
+ )
261
+
262
+ context.report({
263
+ node: pattern,
264
+ messageId: "noDestructuredParam",
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
+ )
279
+
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
+ }
293
+ }
294
+
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
+ },
330
+ })
331
+ }
332
+ }
333
+
334
+ return {
335
+ FunctionDeclaration: checkParams,
336
+ FunctionExpression: checkParams,
337
+ ArrowFunctionExpression: checkParams,
338
+ }
339
+ },
340
+ },
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
+
185
416
  "test-assertion-newline": {
186
417
  meta: {
187
418
  type: "layout",
@@ -382,6 +613,10 @@ function getBaseName(source) {
382
613
  return last
383
614
  }
384
615
 
616
+ function isLocalImport(source) {
617
+ return source.startsWith(".") || source.startsWith("/")
618
+ }
619
+
385
620
  function isCapitalized(name) {
386
621
  return name.length > 0 && name[0] >= "A" && name[0] <= "Z"
387
622
  }