effect-start 0.23.0 → 0.25.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 (356) hide show
  1. package/dist/ChildProcess.js +32 -20
  2. package/dist/Commander.js +377 -293
  3. package/dist/ContentNegotiation.js +424 -318
  4. package/dist/Cookies.js +340 -271
  5. package/dist/Development.js +85 -49
  6. package/dist/Effectify.js +22 -14
  7. package/dist/Entity.js +260 -195
  8. package/dist/Fetch.js +192 -0
  9. package/dist/FilePathPattern.js +88 -77
  10. package/dist/FileRouter.js +192 -136
  11. package/dist/FileRouterCodegen.js +262 -191
  12. package/dist/FileSystem.js +126 -64
  13. package/dist/Http.js +96 -77
  14. package/dist/PathPattern.js +311 -273
  15. package/dist/PlatformError.js +36 -21
  16. package/dist/PlatformRuntime.js +65 -40
  17. package/dist/Route.js +122 -79
  18. package/dist/RouteBody.js +83 -58
  19. package/dist/RouteError.js +46 -25
  20. package/dist/RouteHook.js +58 -34
  21. package/dist/RouteHttp.js +346 -237
  22. package/dist/RouteHttpTracer.js +86 -58
  23. package/dist/RouteMount.js +81 -58
  24. package/dist/RouteSchema.js +253 -170
  25. package/dist/RouteSse.js +87 -72
  26. package/dist/RouteTree.js +99 -73
  27. package/dist/RouteTrie.js +160 -133
  28. package/dist/SchemaExtra.js +87 -62
  29. package/dist/Socket.js +32 -21
  30. package/dist/SqlIntrospect.js +317 -268
  31. package/dist/Start.js +55 -25
  32. package/dist/StartApp.js +3 -21
  33. package/dist/StreamExtra.js +109 -74
  34. package/dist/System.js +37 -21
  35. package/dist/TuplePathPattern.js +64 -58
  36. package/dist/Unique.js +159 -120
  37. package/dist/Values.js +48 -32
  38. package/dist/bun/BunBundle.js +158 -109
  39. package/dist/bun/BunChildProcessSpawner.js +121 -82
  40. package/dist/bun/BunImportTrackerPlugin.js +85 -63
  41. package/dist/bun/BunRoute.js +135 -99
  42. package/dist/bun/BunRuntime.js +39 -29
  43. package/dist/bun/BunServer.js +268 -140
  44. package/dist/bun/BunVirtualFilesPlugin.js +47 -33
  45. package/dist/bun/_BunEnhancedResolve.js +107 -82
  46. package/dist/bun/index.js +5 -5
  47. package/dist/bundler/Bundle.js +82 -38
  48. package/dist/bundler/BundleFiles.js +140 -82
  49. package/dist/bundler/BundleRoute.js +49 -38
  50. package/dist/client/Overlay.js +29 -28
  51. package/dist/client/ScrollState.js +94 -82
  52. package/dist/client/index.js +79 -61
  53. package/dist/console/Console.js +40 -24
  54. package/dist/console/ConsoleErrors.js +189 -178
  55. package/dist/console/ConsoleLogger.js +52 -43
  56. package/dist/console/ConsoleMetrics.js +69 -58
  57. package/dist/console/ConsoleProcess.js +57 -47
  58. package/dist/console/ConsoleStore.js +56 -45
  59. package/dist/console/ConsoleTracer.js +101 -88
  60. package/dist/console/Simulation.js +714 -563
  61. package/dist/console/index.js +3 -3
  62. package/dist/console/routes/tree.js +29 -28
  63. package/dist/datastar/actions/fetch.js +514 -381
  64. package/dist/datastar/actions/peek.js +12 -12
  65. package/dist/datastar/actions/setAll.js +18 -11
  66. package/dist/datastar/actions/toggleAll.js +18 -11
  67. package/dist/datastar/attributes/attr.js +48 -47
  68. package/dist/datastar/attributes/bind.js +186 -167
  69. package/dist/datastar/attributes/class.js +51 -44
  70. package/dist/datastar/attributes/computed.js +23 -24
  71. package/dist/datastar/attributes/effect.js +9 -8
  72. package/dist/datastar/attributes/indicator.js +32 -29
  73. package/dist/datastar/attributes/init.js +26 -25
  74. package/dist/datastar/attributes/jsonSignals.js +32 -29
  75. package/dist/datastar/attributes/on.js +76 -73
  76. package/dist/datastar/attributes/onIntersect.js +51 -51
  77. package/dist/datastar/attributes/onInterval.js +30 -29
  78. package/dist/datastar/attributes/onSignalPatch.js +49 -40
  79. package/dist/datastar/attributes/ref.js +10 -9
  80. package/dist/datastar/attributes/show.js +31 -30
  81. package/dist/datastar/attributes/signals.js +17 -16
  82. package/dist/datastar/attributes/style.js +56 -49
  83. package/dist/datastar/attributes/text.js +28 -25
  84. package/dist/datastar/engine.js +1079 -933
  85. package/dist/datastar/index.js +25 -24
  86. package/dist/datastar/utils.js +203 -155
  87. package/dist/datastar/watchers/patchElements.js +459 -372
  88. package/dist/datastar/watchers/patchSignals.js +13 -13
  89. package/dist/experimental/EncryptedCookies.js +305 -189
  90. package/dist/experimental/index.js +1 -1
  91. package/dist/hyper/Hyper.js +22 -17
  92. package/dist/hyper/HyperHtml.js +138 -123
  93. package/dist/hyper/HyperNode.js +11 -9
  94. package/dist/hyper/HyperRoute.js +41 -28
  95. package/dist/hyper/html.js +27 -27
  96. package/dist/hyper/index.js +5 -5
  97. package/dist/hyper/jsx-runtime.js +11 -5
  98. package/dist/index.js +8 -8
  99. package/dist/node/NodeFileSystem.js +606 -341
  100. package/dist/node/NodeUtils.js +21 -18
  101. package/dist/sql/Sql.js +8 -0
  102. package/dist/sql/bun/index.js +134 -67
  103. package/dist/sql/index.js +1 -0
  104. package/dist/sql/libsql/index.js +156 -0
  105. package/dist/sql/mssql/docker.js +103 -60
  106. package/dist/sql/mssql/index.js +182 -101
  107. package/dist/testing/TestLogger.js +39 -29
  108. package/dist/testing/index.js +2 -2
  109. package/dist/testing/utils.js +45 -23
  110. package/dist/x/cloudflare/CloudflareTunnel.js +61 -28
  111. package/dist/x/cloudflare/index.js +1 -1
  112. package/dist/x/tailscale/TailscaleTunnel.js +86 -60
  113. package/dist/x/tailscale/index.js +1 -1
  114. package/dist/x/tailwind/TailwindPlugin.js +280 -205
  115. package/dist/x/tailwind/compile.js +185 -129
  116. package/dist/x/tailwind/plugin.js +13 -11
  117. package/package.json +1 -1
  118. package/src/Development.ts +3 -1
  119. package/src/Entity.ts +17 -0
  120. package/src/Fetch.ts +271 -0
  121. package/src/SqlIntrospect.ts +64 -70
  122. package/src/Start.ts +24 -22
  123. package/src/StartApp.ts +11 -0
  124. package/src/bun/BunServer.ts +89 -16
  125. package/src/hyper/HyperHtml.ts +0 -1
  126. package/src/sql/bun/index.ts +1 -1
  127. package/src/sql/index.ts +1 -0
  128. package/src/sql/libsql/index.ts +173 -0
  129. package/src/sql/libsql/libsql.d.ts +39 -0
  130. package/src/sql/mssql/index.ts +1 -1
  131. package/src/x/tailscale/TailscaleTunnel.ts +7 -5
  132. package/dist/BlobStore.d.ts +0 -80
  133. package/dist/BlobStore.js +0 -19
  134. package/dist/ChildProcess.d.ts +0 -60
  135. package/dist/Commander.d.ts +0 -100
  136. package/dist/ContentNegotiation.d.ts +0 -12
  137. package/dist/Cookies.d.ts +0 -47
  138. package/dist/Development.d.ts +0 -39
  139. package/dist/Effectify.d.ts +0 -209
  140. package/dist/Entity.d.ts +0 -47
  141. package/dist/FilePathPattern.d.ts +0 -29
  142. package/dist/FileRouter.d.ts +0 -56
  143. package/dist/FileRouterCodegen.d.ts +0 -18
  144. package/dist/FileRouterPattern.d.ts +0 -9
  145. package/dist/FileRouterPattern.js +0 -35
  146. package/dist/FileSystem.d.ts +0 -158
  147. package/dist/Http.d.ts +0 -37
  148. package/dist/HttpAppExtra.d.ts +0 -7
  149. package/dist/HttpAppExtra.js +0 -320
  150. package/dist/HttpUtils.d.ts +0 -3
  151. package/dist/HttpUtils.js +0 -11
  152. package/dist/PathPattern.d.ts +0 -134
  153. package/dist/PlatformError.d.ts +0 -38
  154. package/dist/PlatformRuntime.d.ts +0 -27
  155. package/dist/Route.d.ts +0 -97
  156. package/dist/RouteBody.d.ts +0 -47
  157. package/dist/RouteError.d.ts +0 -98
  158. package/dist/RouteHook.d.ts +0 -12
  159. package/dist/RouteHttp.d.ts +0 -21
  160. package/dist/RouteHttpTracer.d.ts +0 -10
  161. package/dist/RouteMount.d.ts +0 -86
  162. package/dist/RouteSchema.d.ts +0 -86
  163. package/dist/RouteSse.d.ts +0 -21
  164. package/dist/RouteTree.d.ts +0 -57
  165. package/dist/RouteTrie.d.ts +0 -20
  166. package/dist/RouterPattern.d.ts +0 -118
  167. package/dist/RouterPattern.js +0 -269
  168. package/dist/SchemaExtra.d.ts +0 -7
  169. package/dist/Socket.d.ts +0 -27
  170. package/dist/Sql.d.ts +0 -34
  171. package/dist/Sql.js +0 -5
  172. package/dist/SqlIntrospect.d.ts +0 -91
  173. package/dist/Start.d.ts +0 -44
  174. package/dist/StartApp.d.ts +0 -19
  175. package/dist/StreamExtra.d.ts +0 -28
  176. package/dist/System.d.ts +0 -7
  177. package/dist/TuplePathPattern.d.ts +0 -9
  178. package/dist/Unique.d.ts +0 -50
  179. package/dist/Values.d.ts +0 -27
  180. package/dist/bun/BunBlobStoreDisk.d.ts +0 -6
  181. package/dist/bun/BunBlobStoreDisk.js +0 -116
  182. package/dist/bun/BunBlobStoreS3.d.ts +0 -11
  183. package/dist/bun/BunBlobStoreS3.js +0 -89
  184. package/dist/bun/BunBlobWatcherDisk.d.ts +0 -6
  185. package/dist/bun/BunBlobWatcherDisk.js +0 -60
  186. package/dist/bun/BunBlobWatcherQueue.d.ts +0 -6
  187. package/dist/bun/BunBlobWatcherQueue.js +0 -17
  188. package/dist/bun/BunBundle.d.ts +0 -11
  189. package/dist/bun/BunChildProcessSpawner.d.ts +0 -3
  190. package/dist/bun/BunHttpServer.d.ts +0 -44
  191. package/dist/bun/BunHttpServer.js +0 -186
  192. package/dist/bun/BunHttpServer_web.d.ts +0 -60
  193. package/dist/bun/BunHttpServer_web.js +0 -252
  194. package/dist/bun/BunImportTrackerPlugin.d.ts +0 -13
  195. package/dist/bun/BunPlatformHttpServer.d.ts +0 -10
  196. package/dist/bun/BunPlatformHttpServer.js +0 -53
  197. package/dist/bun/BunRoute.d.ts +0 -48
  198. package/dist/bun/BunRuntime.d.ts +0 -2
  199. package/dist/bun/BunServer.d.ts +0 -40
  200. package/dist/bun/BunServerRequest.d.ts +0 -60
  201. package/dist/bun/BunServerRequest.js +0 -252
  202. package/dist/bun/BunSql.d.ts +0 -4
  203. package/dist/bun/BunSql.js +0 -81
  204. package/dist/bun/BunVirtualFilesPlugin.d.ts +0 -4
  205. package/dist/bun/_BunEnhancedResolve.d.ts +0 -45
  206. package/dist/bun/index.d.ts +0 -5
  207. package/dist/bundler/Bundle.d.ts +0 -61
  208. package/dist/bundler/BundleFiles.d.ts +0 -13
  209. package/dist/bundler/BundleHttp.d.ts +0 -45
  210. package/dist/bundler/BundleHttp.js +0 -176
  211. package/dist/bundler/BundleRoute.d.ts +0 -27
  212. package/dist/client/Overlay.d.ts +0 -2
  213. package/dist/client/ScrollState.d.ts +0 -6
  214. package/dist/client/index.d.ts +0 -6
  215. package/dist/console/Console.d.ts +0 -6
  216. package/dist/console/ConsoleErrors.d.ts +0 -3
  217. package/dist/console/ConsoleLogger.d.ts +0 -3
  218. package/dist/console/ConsoleMetrics.d.ts +0 -3
  219. package/dist/console/ConsoleProcess.d.ts +0 -3
  220. package/dist/console/ConsoleStore.d.ts +0 -144
  221. package/dist/console/ConsoleTracer.d.ts +0 -3
  222. package/dist/console/Simulation.d.ts +0 -2
  223. package/dist/console/index.d.ts +0 -3
  224. package/dist/console/routes/errors/route.d.ts +0 -10
  225. package/dist/console/routes/errors/route.js +0 -47
  226. package/dist/console/routes/fiberDetail.d.ts +0 -16
  227. package/dist/console/routes/fiberDetail.js +0 -38
  228. package/dist/console/routes/fibers/route.d.ts +0 -10
  229. package/dist/console/routes/fibers/route.js +0 -19
  230. package/dist/console/routes/git/route.d.ts +0 -11
  231. package/dist/console/routes/git/route.js +0 -33
  232. package/dist/console/routes/layout.d.ts +0 -9
  233. package/dist/console/routes/layout.js +0 -3
  234. package/dist/console/routes/logs/route.d.ts +0 -10
  235. package/dist/console/routes/logs/route.js +0 -32
  236. package/dist/console/routes/metrics/route.d.ts +0 -10
  237. package/dist/console/routes/metrics/route.js +0 -17
  238. package/dist/console/routes/route.d.ts +0 -6
  239. package/dist/console/routes/route.js +0 -5
  240. package/dist/console/routes/routes/route.d.ts +0 -6
  241. package/dist/console/routes/routes/route.js +0 -20
  242. package/dist/console/routes/services/route.d.ts +0 -6
  243. package/dist/console/routes/services/route.js +0 -12
  244. package/dist/console/routes/system/route.d.ts +0 -10
  245. package/dist/console/routes/system/route.js +0 -18
  246. package/dist/console/routes/traceDetail.d.ts +0 -16
  247. package/dist/console/routes/traceDetail.js +0 -14
  248. package/dist/console/routes/traces/route.d.ts +0 -10
  249. package/dist/console/routes/traces/route.js +0 -39
  250. package/dist/console/routes/tree.d.ts +0 -153
  251. package/dist/console/ui/Errors.d.ts +0 -4
  252. package/dist/console/ui/Errors.js +0 -15
  253. package/dist/console/ui/Fibers.d.ts +0 -24
  254. package/dist/console/ui/Fibers.js +0 -121
  255. package/dist/console/ui/Git.d.ts +0 -20
  256. package/dist/console/ui/Git.js +0 -95
  257. package/dist/console/ui/Logs.d.ts +0 -4
  258. package/dist/console/ui/Logs.js +0 -25
  259. package/dist/console/ui/Metrics.d.ts +0 -4
  260. package/dist/console/ui/Metrics.js +0 -26
  261. package/dist/console/ui/Routes.d.ts +0 -8
  262. package/dist/console/ui/Routes.js +0 -70
  263. package/dist/console/ui/Services.d.ts +0 -10
  264. package/dist/console/ui/Services.js +0 -246
  265. package/dist/console/ui/Shell.d.ts +0 -10
  266. package/dist/console/ui/Shell.js +0 -7
  267. package/dist/console/ui/System.d.ts +0 -4
  268. package/dist/console/ui/System.js +0 -35
  269. package/dist/console/ui/Traces.d.ts +0 -12
  270. package/dist/console/ui/Traces.js +0 -179
  271. package/dist/datastar/actions/fetch.d.ts +0 -30
  272. package/dist/datastar/actions/peek.d.ts +0 -1
  273. package/dist/datastar/actions/setAll.d.ts +0 -1
  274. package/dist/datastar/actions/toggleAll.d.ts +0 -1
  275. package/dist/datastar/attributes/attr.d.ts +0 -1
  276. package/dist/datastar/attributes/bind.d.ts +0 -1
  277. package/dist/datastar/attributes/class.d.ts +0 -1
  278. package/dist/datastar/attributes/computed.d.ts +0 -1
  279. package/dist/datastar/attributes/effect.d.ts +0 -1
  280. package/dist/datastar/attributes/indicator.d.ts +0 -1
  281. package/dist/datastar/attributes/init.d.ts +0 -1
  282. package/dist/datastar/attributes/jsonSignals.d.ts +0 -1
  283. package/dist/datastar/attributes/on.d.ts +0 -1
  284. package/dist/datastar/attributes/onIntersect.d.ts +0 -1
  285. package/dist/datastar/attributes/onInterval.d.ts +0 -1
  286. package/dist/datastar/attributes/onSignalPatch.d.ts +0 -1
  287. package/dist/datastar/attributes/ref.d.ts +0 -1
  288. package/dist/datastar/attributes/show.d.ts +0 -1
  289. package/dist/datastar/attributes/signals.d.ts +0 -1
  290. package/dist/datastar/attributes/style.d.ts +0 -1
  291. package/dist/datastar/attributes/text.d.ts +0 -1
  292. package/dist/datastar/engine.d.ts +0 -162
  293. package/dist/datastar/happydom.d.ts +0 -1
  294. package/dist/datastar/happydom.js +0 -8
  295. package/dist/datastar/index.d.ts +0 -24
  296. package/dist/datastar/load.d.ts +0 -24
  297. package/dist/datastar/load.js +0 -24
  298. package/dist/datastar/utils.d.ts +0 -51
  299. package/dist/datastar/watchers/patchElements.d.ts +0 -1
  300. package/dist/datastar/watchers/patchSignals.d.ts +0 -1
  301. package/dist/experimental/EncryptedCookies.d.ts +0 -48
  302. package/dist/experimental/SseHttpResponse.d.ts +0 -7
  303. package/dist/experimental/SseHttpResponse.js +0 -28
  304. package/dist/experimental/index.d.ts +0 -1
  305. package/dist/hyper/Hyper.d.ts +0 -25
  306. package/dist/hyper/HyperHtml.d.ts +0 -23
  307. package/dist/hyper/HyperHtml.test.d.ts +0 -1
  308. package/dist/hyper/HyperHtml.test.js +0 -197
  309. package/dist/hyper/HyperNode.d.ts +0 -14
  310. package/dist/hyper/HyperRoute.d.ts +0 -8
  311. package/dist/hyper/HyperRoute.test.d.ts +0 -1
  312. package/dist/hyper/HyperRoute.test.js +0 -83
  313. package/dist/hyper/html.d.ts +0 -11
  314. package/dist/hyper/index.d.ts +0 -6
  315. package/dist/hyper/jsx-runtime.d.ts +0 -7
  316. package/dist/index.d.ts +0 -8
  317. package/dist/inference_check.d.ts +0 -1
  318. package/dist/inference_check.js +0 -15
  319. package/dist/lint/plugin.d.ts +0 -86
  320. package/dist/lint/plugin.js +0 -341
  321. package/dist/middlewares/BasicAuthMiddleware.d.ts +0 -8
  322. package/dist/middlewares/BasicAuthMiddleware.js +0 -22
  323. package/dist/middlewares/index.d.ts +0 -1
  324. package/dist/middlewares/index.js +0 -1
  325. package/dist/node/Effectify.d.ts +0 -209
  326. package/dist/node/Effectify.js +0 -19
  327. package/dist/node/FileSystem.d.ts +0 -7
  328. package/dist/node/FileSystem.js +0 -420
  329. package/dist/node/NodeFileSystem.d.ts +0 -7
  330. package/dist/node/NodeUtils.d.ts +0 -2
  331. package/dist/node/PlatformError.d.ts +0 -46
  332. package/dist/node/PlatformError.js +0 -43
  333. package/dist/node/Utils.d.ts +0 -1
  334. package/dist/node/Utils.js +0 -19
  335. package/dist/repro_fail.d.ts +0 -1
  336. package/dist/repro_fail.js +0 -14
  337. package/dist/sql/bun/index.d.ts +0 -3
  338. package/dist/sql/mssql/docker.d.ts +0 -2
  339. package/dist/sql/mssql/index.d.ts +0 -21
  340. package/dist/testing/TestHttpClient.d.ts +0 -13
  341. package/dist/testing/TestHttpClient.js +0 -68
  342. package/dist/testing/TestLogger.d.ts +0 -13
  343. package/dist/testing/index.d.ts +0 -2
  344. package/dist/testing/utils.d.ts +0 -9
  345. package/dist/x/cloudflare/CloudflareTunnel.d.ts +0 -10
  346. package/dist/x/cloudflare/index.d.ts +0 -1
  347. package/dist/x/datastar/Datastar.d.ts +0 -6
  348. package/dist/x/datastar/Datastar.js +0 -47
  349. package/dist/x/datastar/index.d.ts +0 -1
  350. package/dist/x/datastar/index.js +0 -1
  351. package/dist/x/tailscale/TailscaleTunnel.d.ts +0 -15
  352. package/dist/x/tailscale/index.d.ts +0 -1
  353. package/dist/x/tailwind/TailwindPlugin.d.ts +0 -23
  354. package/dist/x/tailwind/compile.d.ts +0 -19
  355. package/dist/x/tailwind/plugin.d.ts +0 -2
  356. /package/src/{Sql.ts → sql/Sql.ts} +0 -0
@@ -1,118 +0,0 @@
1
- export type RouterPattern = `/${string}`;
2
- export type ParamDelimiter = "_" | "-" | "." | "," | ";" | "!" | "@" | "~";
3
- export type ParamPrefix = `${string}${ParamDelimiter}` | "";
4
- export type ParamSuffix = `${ParamDelimiter}${string}` | "";
5
- export type LiteralSegment<Value extends string = string> = {
6
- _tag: "LiteralSegment";
7
- value: Value;
8
- };
9
- export type ParamSegment<Name extends string = string, Optional extends boolean = boolean, Prefix extends ParamPrefix = "", Suffix extends ParamSuffix = ""> = {
10
- _tag: "ParamSegment";
11
- name: Name;
12
- optional?: Optional;
13
- prefix?: Prefix;
14
- suffix?: Suffix;
15
- };
16
- export type RestSegment<Name extends string = string, Optional extends boolean = boolean> = {
17
- _tag: "RestSegment";
18
- name: Name;
19
- optional?: Optional;
20
- };
21
- export type Segment = LiteralSegment | ParamSegment<string, boolean, ParamPrefix, ParamSuffix> | RestSegment;
22
- /**
23
- * Parses a route path string into a tuple of Segment types at compile time.
24
- *
25
- * @example
26
- * ```ts
27
- * type Usage = Segments<"/users/[id]/posts/[...rest]">
28
- * type Expected = [
29
- * LiteralSegment<"users">,
30
- * ParamSegment<"id", false>,
31
- * LiteralSegment<"posts">,
32
- * RestSegment<"rest", false>
33
- * ]
34
- * ```
35
- *
36
- * Supports:
37
- * - Literals: `users` → `LiteralSegment<"users">`
38
- * - Params: `[id]` → `ParamSegment<"id", false>`
39
- * - Params (optional): `[[id]]` → `ParamSegment<"id", true>`
40
- * - Rest: `[...rest]` → `RestSegment<"rest", false>`
41
- * - Rest (optional): `[[...rest]]` → `RestSegment<"rest", true>`
42
- * - {Pre,Suf}fixed params: `prefix_[id]_suffix` → `ParamSegment<"id", false, "prefix_", "_suffix">`
43
- * - Malformed segments: `pk_[id]foo` → `undefined` (suffix must start with delimiter)
44
- *
45
- * @limit Paths with more than 48 segments in TypeScript 5.9.3 will fail with
46
- * `TS2589: Type instantiation is excessively deep and possibly infinite`.
47
- */
48
- export type Segments<Path extends string> = Path extends `/${infer PathRest}` ? Segments<PathRest> : Path extends `${infer Head}/${infer Tail}` ? [ExtractSegment<Head>, ...Segments<Tail>] : Path extends "" ? [] : [ExtractSegment<Path>];
49
- export declare function parseSegment(segment: string): Segment | null;
50
- export declare function parse(pattern: string): Segment[];
51
- export declare function formatSegment(seg: Segment): string;
52
- export declare function format(segments: Segment[]): `/${string}`;
53
- /**
54
- * Converts to colon-style path pattern (used by Hono, Bun, itty-router).
55
- *
56
- * - `[param]` → `:param`
57
- * - `[[param]]` → `:param?`
58
- * - `[...param]` → `*`
59
- * - `[[...param]]` → `/`, `/*`
60
- * - `pk_[id]` → `pk_:id`
61
- */
62
- export declare function toColon(path: RouterPattern): string[];
63
- export declare const toHono: typeof toColon;
64
- /**
65
- * Converts to Express path pattern.
66
- *
67
- * - `[param]` → `:param`
68
- * - `[[param]]` → `{/:param}`
69
- * - `[...param]` → `/*param`
70
- * - `[[...param]]` → `/`, `/*param`
71
- * - `pk_[id]` → `pk_:id`
72
- */
73
- export declare function toExpress(path: RouterPattern): string[];
74
- /**
75
- * Converts to Effect HttpRouter/find-my-way path pattern.
76
- *
77
- * - `[param]` → `:param`
78
- * - `[[param]]` → `:param?` (must be final segment)
79
- * - `[...param]` → `*`
80
- * - `[[...param]]` → `/`, `/*`
81
- * - `pk_[id]` → `pk_:id`
82
- */
83
- export declare function toEffect(path: RouterPattern): string[];
84
- /**
85
- * Converts to URLPattern path pattern.
86
- *
87
- * - `[param]` → `:param`
88
- * - `[[param]]` → `:param?`
89
- * - `[...param]` → `:param+`
90
- * - `[[...param]]` → `:param*`
91
- * - `pk_[id]` → `pk_:id`
92
- */
93
- export declare function toURLPattern(path: RouterPattern): string[];
94
- /**
95
- * Converts to Remix path pattern.
96
- *
97
- * - `[param]` → `$param`
98
- * - `[[param]]` → `($param)`
99
- * - `[...param]` → `$`
100
- * - `[[...param]]` → `/`, `$`
101
- * - `pk_[id]` → (not supported, emits `pk_$id`)
102
- */
103
- export declare function toRemix(path: RouterPattern): string[];
104
- /**
105
- * Converts to Bun.serve path pattern.
106
- *
107
- * Since Bun doesn't support optional params (`:param?`), optional segments
108
- * are expanded into multiple routes recursively.
109
- *
110
- * - `[param]` → `:param`
111
- * - `[[param]]` → `/`, `/:param` (two routes)
112
- * - `[...param]` → `*`
113
- * - `[[...param]]` → `/`, `/*` (two routes)
114
- * - `pk_[id]` → `pk_:id`
115
- */
116
- export declare function toBun(path: RouterPattern): string[];
117
- type ExtractSegment<S extends string> = S extends `[[...${infer Name}]]` ? RestSegment<Name, true> : S extends `[...${infer Name}]` ? RestSegment<Name, false> : S extends `[[${infer Name}]]` ? ParamSegment<Name, true, "", ""> : S extends `${infer Pre extends `${string}${ParamDelimiter}`}[${infer Name}]${infer Suf}` ? Suf extends `${infer Delim extends ParamDelimiter}${infer SufRest}` ? ParamSegment<Name, false, Pre, `${Delim}${SufRest}`> : Suf extends "" ? ParamSegment<Name, false, Pre, ""> : undefined : S extends `[${infer Name}]${infer Suf extends `${ParamDelimiter}${string}`}` ? ParamSegment<Name, false, "", Suf> : S extends `[${infer Name}]` ? ParamSegment<Name, false, "", ""> : LiteralSegment<S>;
118
- export {};
@@ -1,269 +0,0 @@
1
- const PARAM_PATTERN = /^(?<prefix>.*[^a-zA-Z0-9])?\[(?<name>[^\]]+)\](?<suffix>[^a-zA-Z0-9].*)?$/;
2
- export function parseSegment(segment) {
3
- if (segment.startsWith("[[...")
4
- && segment.endsWith("]]")) {
5
- return {
6
- _tag: "RestSegment",
7
- name: segment.slice(5, -2),
8
- optional: true,
9
- };
10
- }
11
- if (segment.startsWith("[...")
12
- && segment.endsWith("]")) {
13
- return {
14
- _tag: "RestSegment",
15
- name: segment.slice(4, -1),
16
- };
17
- }
18
- if (segment.startsWith("[[")
19
- && segment.endsWith("]]")) {
20
- return {
21
- _tag: "ParamSegment",
22
- name: segment.slice(2, -2),
23
- optional: true,
24
- };
25
- }
26
- const match = segment.match(PARAM_PATTERN);
27
- if (match?.groups) {
28
- const { prefix, name, suffix } = match.groups;
29
- return {
30
- _tag: "ParamSegment",
31
- name,
32
- prefix: prefix || undefined,
33
- suffix: suffix || undefined,
34
- };
35
- }
36
- if (/^[\p{L}\p{N}._~-]+$/u.test(segment)) {
37
- return { _tag: "LiteralSegment", value: segment };
38
- }
39
- return null;
40
- }
41
- export function parse(pattern) {
42
- const segments = pattern.split("/").filter(Boolean).map(parseSegment);
43
- if (segments.some((seg) => seg === null)) {
44
- throw new Error(`Invalid path segment in "${pattern}": contains invalid characters or format`);
45
- }
46
- return segments;
47
- }
48
- export function formatSegment(seg) {
49
- switch (seg._tag) {
50
- case "LiteralSegment":
51
- return seg.value;
52
- case "ParamSegment": {
53
- const param = seg.optional ? `[[${seg.name}]]` : `[${seg.name}]`;
54
- return (seg.prefix ?? "") + param + (seg.suffix ?? "");
55
- }
56
- case "RestSegment":
57
- return seg.optional ? `[[...${seg.name}]]` : `[...${seg.name}]`;
58
- }
59
- }
60
- export function format(segments) {
61
- const joined = segments.map(formatSegment).join("/");
62
- return (joined ? `/${joined}` : "/");
63
- }
64
- function buildPaths(segments, mapper, restWildcard) {
65
- const optionalRestIndex = segments.findIndex((s) => s._tag === "RestSegment" && s.optional);
66
- if (optionalRestIndex !== -1) {
67
- const before = segments.slice(0, optionalRestIndex);
68
- const beforeJoined = before.map(mapper).join("/");
69
- const basePath = beforeJoined ? "/" + beforeJoined : "/";
70
- const withWildcard = basePath === "/"
71
- ? restWildcard
72
- : basePath + restWildcard;
73
- return [basePath, withWildcard];
74
- }
75
- const joined = segments.map(mapper).join("/");
76
- return [joined ? "/" + joined : "/"];
77
- }
78
- function colonParamSegment(segment) {
79
- switch (segment._tag) {
80
- case "LiteralSegment":
81
- return segment.value;
82
- case "ParamSegment": {
83
- const param = `:${segment.name}${segment.optional ? "?" : ""}`;
84
- return (segment.prefix ?? "") + param + (segment.suffix ?? "");
85
- }
86
- case "RestSegment":
87
- return "*";
88
- }
89
- }
90
- /**
91
- * Converts to colon-style path pattern (used by Hono, Bun, itty-router).
92
- *
93
- * - `[param]` → `:param`
94
- * - `[[param]]` → `:param?`
95
- * - `[...param]` → `*`
96
- * - `[[...param]]` → `/`, `/*`
97
- * - `pk_[id]` → `pk_:id`
98
- */
99
- export function toColon(path) {
100
- return buildPaths(parse(path), colonParamSegment, "/*");
101
- }
102
- export const toHono = toColon;
103
- /**
104
- * Converts to Express path pattern.
105
- *
106
- * - `[param]` → `:param`
107
- * - `[[param]]` → `{/:param}`
108
- * - `[...param]` → `/*param`
109
- * - `[[...param]]` → `/`, `/*param`
110
- * - `pk_[id]` → `pk_:id`
111
- */
112
- export function toExpress(path) {
113
- const segments = parse(path);
114
- const optionalRestIndex = segments.findIndex((s) => s._tag === "RestSegment" && s.optional);
115
- const mapper = (segment) => {
116
- switch (segment._tag) {
117
- case "LiteralSegment":
118
- return segment.value;
119
- case "ParamSegment": {
120
- const param = `:${segment.name}`;
121
- return (segment.prefix ?? "") + param + (segment.suffix ?? "");
122
- }
123
- case "RestSegment":
124
- return `*${segment.name}`;
125
- }
126
- };
127
- if (optionalRestIndex !== -1) {
128
- const before = segments.slice(0, optionalRestIndex);
129
- const rest = segments[optionalRestIndex];
130
- if (rest._tag !== "RestSegment")
131
- throw new Error("unreachable");
132
- const restName = rest.name;
133
- const beforeJoined = before.map(mapper).join("/");
134
- const basePath = beforeJoined ? "/" + beforeJoined : "/";
135
- const withWildcard = basePath === "/"
136
- ? `/*${restName}`
137
- : basePath + `/*${restName}`;
138
- return [basePath, withWildcard];
139
- }
140
- let result = "";
141
- for (let i = 0; i < segments.length; i++) {
142
- const segment = segments[i];
143
- const isFirst = i === 0;
144
- switch (segment._tag) {
145
- case "LiteralSegment":
146
- result += "/" + segment.value;
147
- break;
148
- case "ParamSegment":
149
- if (segment.optional && !segment.prefix && !segment.suffix) {
150
- result += isFirst
151
- ? "/{/:$name}".replace("$name", segment.name)
152
- : `{/:${segment.name}}`;
153
- }
154
- else {
155
- const param = `:${segment.name}`;
156
- result += "/"
157
- + (segment.prefix ?? "")
158
- + param
159
- + (segment.suffix ?? "");
160
- }
161
- break;
162
- case "RestSegment":
163
- result += `/*${segment.name}`;
164
- break;
165
- }
166
- }
167
- return [result || "/"];
168
- }
169
- /**
170
- * Converts to Effect HttpRouter/find-my-way path pattern.
171
- *
172
- * - `[param]` → `:param`
173
- * - `[[param]]` → `:param?` (must be final segment)
174
- * - `[...param]` → `*`
175
- * - `[[...param]]` → `/`, `/*`
176
- * - `pk_[id]` → `pk_:id`
177
- */
178
- export function toEffect(path) {
179
- return buildPaths(parse(path), colonParamSegment, "/*");
180
- }
181
- /**
182
- * Converts to URLPattern path pattern.
183
- *
184
- * - `[param]` → `:param`
185
- * - `[[param]]` → `:param?`
186
- * - `[...param]` → `:param+`
187
- * - `[[...param]]` → `:param*`
188
- * - `pk_[id]` → `pk_:id`
189
- */
190
- export function toURLPattern(path) {
191
- const segments = parse(path);
192
- const joined = segments
193
- .map((segment) => {
194
- switch (segment._tag) {
195
- case "LiteralSegment":
196
- return segment.value;
197
- case "ParamSegment": {
198
- const param = `:${segment.name}${segment.optional ? "?" : ""}`;
199
- return (segment.prefix ?? "") + param + (segment.suffix ?? "");
200
- }
201
- case "RestSegment":
202
- return `:${segment.name}${segment.optional ? "*" : "+"}`;
203
- }
204
- })
205
- .join("/");
206
- return [joined ? "/" + joined : "/"];
207
- }
208
- /**
209
- * Converts to Remix path pattern.
210
- *
211
- * - `[param]` → `$param`
212
- * - `[[param]]` → `($param)`
213
- * - `[...param]` → `$`
214
- * - `[[...param]]` → `/`, `$`
215
- * - `pk_[id]` → (not supported, emits `pk_$id`)
216
- */
217
- export function toRemix(path) {
218
- const segments = parse(path);
219
- const optionalRestIndex = segments.findIndex((s) => s._tag === "RestSegment" && s.optional);
220
- const mapper = (segment) => {
221
- switch (segment._tag) {
222
- case "LiteralSegment":
223
- return segment.value;
224
- case "ParamSegment": {
225
- const param = segment.optional
226
- ? `($${segment.name})`
227
- : `$${segment.name}`;
228
- return (segment.prefix ?? "") + param + (segment.suffix ?? "");
229
- }
230
- case "RestSegment":
231
- return "$";
232
- }
233
- };
234
- if (optionalRestIndex !== -1) {
235
- const before = segments.slice(0, optionalRestIndex);
236
- const beforeJoined = before.map(mapper).join("/");
237
- const basePath = beforeJoined ? "/" + beforeJoined : "/";
238
- const withWildcard = basePath === "/" ? "$" : basePath + "/$";
239
- return [basePath, withWildcard];
240
- }
241
- const joined = segments.map(mapper).join("/");
242
- return [joined ? "/" + joined : "/"];
243
- }
244
- /**
245
- * Converts to Bun.serve path pattern.
246
- *
247
- * Since Bun doesn't support optional params (`:param?`), optional segments
248
- * are expanded into multiple routes recursively.
249
- *
250
- * - `[param]` → `:param`
251
- * - `[[param]]` → `/`, `/:param` (two routes)
252
- * - `[...param]` → `*`
253
- * - `[[...param]]` → `/`, `/*` (two routes)
254
- * - `pk_[id]` → `pk_:id`
255
- */
256
- export function toBun(path) {
257
- const segments = parse(path);
258
- const optionalIndex = segments.findIndex((s) => (s._tag === "ParamSegment" || s._tag === "RestSegment") && s.optional);
259
- if (optionalIndex === -1) {
260
- return buildPaths(segments, colonParamSegment, "/*");
261
- }
262
- const before = segments.slice(0, optionalIndex);
263
- const optional = { ...segments[optionalIndex], optional: false };
264
- const after = segments.slice(optionalIndex + 1);
265
- return [
266
- ...toBun(format(before)),
267
- ...toBun(format([...before, optional, ...after])),
268
- ];
269
- }
@@ -1,7 +0,0 @@
1
- import type * as Schema from "effect/Schema";
2
- import * as SchemaAST from "effect/SchemaAST";
3
- export declare function getBaseSchemaAST(schema: Schema.Schema.Any): SchemaAST.AST;
4
- export declare function isOptional(schema: Schema.Schema.Any): boolean;
5
- export declare function schemaEqual(userSchema: Schema.Struct<any> | undefined, expectedSchema: Schema.Struct<any> | null): boolean;
6
- export declare function getSchemaTypeName(schema: Schema.Schema.Any): string;
7
- export declare function formatSchemaCode(schema: Schema.Struct<any>): string;
package/dist/Socket.d.ts DELETED
@@ -1,27 +0,0 @@
1
- export declare const SocketErrorTypeId: unique symbol;
2
- export type SocketErrorTypeId = typeof SocketErrorTypeId;
3
- export declare const isSocketError: (u: unknown) => u is SocketError;
4
- export type SocketError = SocketGenericError | SocketCloseError;
5
- declare const SocketGenericError_base: new <A extends Record<string, any>>(args: import("effect/Types").Simplify<A>) => import("effect/Cause").YieldableError & Record<typeof SocketErrorTypeId, typeof SocketErrorTypeId> & {
6
- readonly _tag: "SocketError";
7
- } & Readonly<A>;
8
- export declare class SocketGenericError extends SocketGenericError_base<{
9
- readonly reason: "Write" | "Read" | "Open" | "OpenTimeout";
10
- readonly cause: unknown;
11
- }> {
12
- get message(): string;
13
- }
14
- declare const SocketCloseError_base: new <A extends Record<string, any>>(args: import("effect/Types").Simplify<A>) => import("effect/Cause").YieldableError & Record<typeof SocketErrorTypeId, typeof SocketErrorTypeId> & {
15
- readonly _tag: "SocketError";
16
- } & Readonly<A>;
17
- export declare class SocketCloseError extends SocketCloseError_base<{
18
- readonly reason: "Close";
19
- readonly code: number;
20
- readonly closeReason?: string | undefined;
21
- }> {
22
- static is(u: unknown): u is SocketCloseError;
23
- static isClean(isClean: (code: number) => boolean): (u: unknown) => u is SocketCloseError;
24
- get message(): string;
25
- }
26
- export declare const defaultCloseCodeIsError: (code: number) => boolean;
27
- export {};
package/dist/Sql.d.ts DELETED
@@ -1,34 +0,0 @@
1
- import * as Context from "effect/Context";
2
- import type * as Effect from "effect/Effect";
3
- import type * as Scope from "effect/Scope";
4
- declare const SqlError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
5
- readonly _tag: "SqlError";
6
- } & Readonly<A>;
7
- export declare class SqlError extends SqlError_base<{
8
- readonly code: string;
9
- readonly message: string;
10
- readonly cause?: unknown;
11
- }> {
12
- }
13
- export interface SqlQuery {
14
- <T = any>(strings: TemplateStringsArray, ...values: Array<unknown>): Effect.Effect<ReadonlyArray<T>, SqlError>;
15
- readonly unsafe: <T = any>(query: string, values?: Array<unknown>) => Effect.Effect<ReadonlyArray<T>, SqlError>;
16
- readonly values: {
17
- <T extends Record<string, unknown>>(obj: T | ReadonlyArray<T>): SqlHelper<T>;
18
- <T extends Record<string, unknown>, K extends keyof T>(obj: T | ReadonlyArray<T>, ...columns: [K, ...Array<K>]): SqlHelper<Pick<T, K>>;
19
- };
20
- }
21
- export interface SqlClient extends SqlQuery {
22
- readonly withTransaction: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, SqlError | E, R>;
23
- readonly reserve: Effect.Effect<SqlQuery, SqlError, Scope.Scope>;
24
- readonly close: (options?: {
25
- readonly timeout?: number;
26
- }) => Effect.Effect<void, SqlError>;
27
- readonly use: <T>(fn: (driver: any) => Promise<T> | T) => Effect.Effect<T, SqlError>;
28
- }
29
- export interface SqlHelper<T> {
30
- readonly value: ReadonlyArray<T>;
31
- readonly columns: ReadonlyArray<keyof T>;
32
- }
33
- export declare const SqlClient: Context.Tag<SqlClient, SqlClient>;
34
- export {};
package/dist/Sql.js DELETED
@@ -1,5 +0,0 @@
1
- import * as Context from "effect/Context";
2
- import * as Data from "effect/Data";
3
- export class SqlError extends Data.TaggedError("SqlError") {
4
- }
5
- export const SqlClient = Context.GenericTag("effect-start/Sql/SqlClient");
@@ -1,91 +0,0 @@
1
- import * as Effect from "effect/Effect";
2
- import * as Schema from "effect/Schema";
3
- import * as Sql from "./Sql.ts";
4
- export interface Column {
5
- readonly tableSchema: string;
6
- readonly tableName: string;
7
- readonly columnName: string;
8
- readonly ordinalPosition: number;
9
- readonly columnDefault: string | null;
10
- readonly isNullable: boolean;
11
- readonly dataType: string;
12
- readonly maxLength: number | null;
13
- readonly isPrimaryKey: boolean;
14
- readonly isAutoIncrement: boolean;
15
- readonly isSortable: boolean;
16
- }
17
- export interface ForeignKey {
18
- readonly constraintName: string;
19
- readonly tableSchema: string;
20
- readonly tableName: string;
21
- readonly columnName: string;
22
- readonly referencedSchema: string;
23
- readonly referencedTable: string;
24
- readonly referencedColumn: string;
25
- readonly updateRule: string;
26
- readonly deleteRule: string;
27
- }
28
- export interface Index {
29
- readonly tableSchema: string;
30
- readonly tableName: string;
31
- readonly indexName: string;
32
- readonly columnName: string;
33
- readonly isUnique: boolean;
34
- readonly ordinalPosition: number;
35
- }
36
- export interface Table {
37
- readonly tableSchema: string;
38
- readonly tableName: string;
39
- readonly columns: ReadonlyArray<Column>;
40
- readonly foreignKeys: ReadonlyArray<ForeignKey>;
41
- readonly indexes: ReadonlyArray<Index>;
42
- }
43
- export interface DatabaseSchema {
44
- readonly tables: ReadonlyArray<Table>;
45
- }
46
- export interface IntrospectOptions {
47
- readonly foreignKeys?: boolean;
48
- readonly indexes?: boolean;
49
- }
50
- export type Dialect = "sqlite" | "postgres" | "mssql";
51
- export declare const introspect: (dialect: Dialect, options?: IntrospectOptions) => Effect.Effect<DatabaseSchema, Sql.SqlError, Sql.SqlClient>;
52
- export interface TableSchema {
53
- readonly tableName: string;
54
- readonly tableSchema: string;
55
- readonly schema: Schema.Schema<any, any, never>;
56
- readonly columns: ReadonlyArray<Column>;
57
- }
58
- export declare const tableToSchema: (table: Table) => TableSchema | null;
59
- export declare const toSchemas: (db: DatabaseSchema) => ReadonlyArray<TableSchema>;
60
- export interface SortOrder {
61
- readonly column: string;
62
- readonly reverse?: boolean;
63
- }
64
- export interface Filter {
65
- readonly column: string;
66
- readonly op: "eq" | "neq";
67
- readonly value: unknown;
68
- }
69
- export interface FindAllOptions {
70
- readonly limit?: number;
71
- readonly offset?: number;
72
- readonly sort?: ReadonlyArray<SortOrder>;
73
- readonly filters?: ReadonlyArray<Filter>;
74
- }
75
- export interface TableReader {
76
- readonly tableName: string;
77
- readonly tableSchema: string;
78
- readonly schema: Schema.Schema<any, any, never>;
79
- readonly columns: ReadonlyArray<Column>;
80
- readonly sortableColumns: ReadonlyArray<string>;
81
- readonly findAll: (options?: FindAllOptions) => Effect.Effect<ReadonlyArray<unknown>, Sql.SqlError, Sql.SqlClient>;
82
- readonly findById: (id: unknown) => Effect.Effect<unknown | null, Sql.SqlError, Sql.SqlClient>;
83
- readonly count: (options?: {
84
- readonly filters?: ReadonlyArray<Filter>;
85
- }) => Effect.Effect<number, Sql.SqlError, Sql.SqlClient>;
86
- }
87
- export interface DatabaseReader {
88
- readonly tables: ReadonlyArray<TableReader>;
89
- readonly table: (name: string) => TableReader | undefined;
90
- }
91
- export declare const makeDatabaseReader: (db: DatabaseSchema) => DatabaseReader;
package/dist/Start.d.ts DELETED
@@ -1,44 +0,0 @@
1
- import type * as FileSystem from "./FileSystem.ts";
2
- import * as Layer from "effect/Layer";
3
- import type * as ChildProcess from "./ChildProcess.ts";
4
- import * as BunServer from "./bun/BunServer.ts";
5
- export declare function layer<Layers extends [Layer.Layer<never, any, any>, ...Array<Layer.Layer<never, any, any>>]>(...layers: Layers): Layer.Layer<{
6
- [k in keyof Layers]: Layer.Layer.Success<Layers[k]>;
7
- }[number], {
8
- [k in keyof Layers]: Layer.Layer.Error<Layers[k]>;
9
- }[number], {
10
- [k in keyof Layers]: Layer.Layer.Context<Layers[k]>;
11
- }[number]>;
12
- /**
13
- * Bundles layers together, wiring their dependencies automatically.
14
- *
15
- * Equivalent to chaining `Layer.provide` calls, but more concise.
16
- *
17
- * **Ordering: dependents first, dependencies last.**
18
- *
19
- * @example
20
- * ```ts
21
- * // UserRepo needs Database, Database needs Logger
22
- * const AppLayer = Start.pack(
23
- * UserRepoLive, // needs Database, Logger
24
- * DatabaseLive, // needs Logger
25
- * LoggerLive, // no deps
26
- * )
27
- * // Result: Layer<UserRepo | Database | Logger, never, never>
28
- * ```
29
- *
30
- * @since 1.0.0
31
- * @category constructors
32
- */
33
- export declare function pack<const Layers extends readonly [Layer.Layer.Any, ...Array<Layer.Layer.Any>]>(...layers: Layers): Layer.Layer<{
34
- [K in keyof Layers]: Layer.Layer.Success<Layers[K]>;
35
- }[number], {
36
- [K in keyof Layers]: Layer.Layer.Error<Layers[K]>;
37
- }[number], Exclude<{
38
- [K in keyof Layers]: Layer.Layer.Context<Layers[K]>;
39
- }[number], {
40
- [K in keyof Layers]: Layer.Layer.Success<Layers[K]>;
41
- }[number]>>;
42
- export declare function serve<ROut, E, RIn extends BunServer.BunServer | FileSystem.FileSystem | ChildProcess.ChildProcessSpawner>(load: () => Promise<{
43
- default: Layer.Layer<ROut, E, RIn>;
44
- }>): void;
@@ -1,19 +0,0 @@
1
- import * as HttpApp from "@effect/platform/HttpApp";
2
- import * as Context from "effect/Context";
3
- import * as Effect from "effect/Effect";
4
- import * as Layer from "effect/Layer";
5
- import * as PubSub from "effect/PubSub";
6
- import * as Ref from "effect/Ref";
7
- type StartMiddleware = <E, R>(self: HttpApp.Default<E, R>) => HttpApp.Default<never, never>;
8
- declare const StartApp_base: Context.TagClass<StartApp, "effect-start/StartApp", {
9
- readonly env: "development" | "production" | string;
10
- readonly addMiddleware: (middleware: StartMiddleware) => Effect.Effect<void>;
11
- readonly middleware: Ref.Ref<StartMiddleware>;
12
- readonly events: PubSub.PubSub<any>;
13
- }>;
14
- export declare class StartApp extends StartApp_base {
15
- }
16
- export declare function layer(options?: {
17
- env?: string;
18
- }): Layer.Layer<StartApp, never, never>;
19
- export {};
@@ -1,28 +0,0 @@
1
- import * as Runtime from "effect/Runtime";
2
- import * as Stream from "effect/Stream";
3
- export declare const isStream: (u: unknown) => u is Stream.Stream<unknown, unknown, unknown>;
4
- export type IsStream<T> = T extends Stream.Stream<infer _A, infer _E, infer _R> ? true : false;
5
- export type Chunk<T> = T extends Stream.Stream<infer A, infer _E, infer _R> ? A : never;
6
- export type StreamError<T> = T extends Stream.Stream<infer _A, infer E, infer _R> ? E : never;
7
- export type Context<T> = T extends Stream.Stream<infer _A, infer _E, infer R> ? R : never;
8
- /**
9
- * Patched version of original Stream.toReadableStreamRuntime (v3.14.4) to
10
- * fix an issue in Bun when native stream controller stops working when request
11
- * is terminated by the client:
12
- *
13
- * TypeError: Value of "this" must be of type ReadableStreamDefaultController
14
- *
15
- * See related issues:
16
- * https://github.com/Effect-TS/effect/issues/4538
17
- * https://github.com/oven-sh/bun/issues/17837
18
- */
19
- export declare const toReadableStreamRuntimePatched: (<A, XR>(runtime: Runtime.Runtime<XR>, options?: {
20
- readonly strategy?: QueuingStrategy<A> | undefined;
21
- }) => <E, R extends XR>(self: Stream.Stream<A, E, R>) => ReadableStream<A>) & (<A, E, XR, R extends XR>(self: Stream.Stream<A, E, R>, runtime: Runtime.Runtime<XR>, options?: {
22
- readonly strategy?: QueuingStrategy<A> | undefined;
23
- }) => ReadableStream<A>);
24
- export declare const toReadableStreamRuntimePatched2: (<A, XR>(runtime: Runtime.Runtime<XR>, options?: {
25
- readonly strategy?: QueuingStrategy<A> | undefined;
26
- }) => <E, R extends XR>(self: Stream.Stream<A, E, R>) => ReadableStream<A>) & (<A, E, XR, R extends XR>(self: Stream.Stream<A, E, R>, runtime: Runtime.Runtime<XR>, options?: {
27
- readonly strategy?: QueuingStrategy<A> | undefined;
28
- }) => ReadableStream<A>);
package/dist/System.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import * as Effect from "effect/Effect";
2
- import type * as Scope from "effect/Scope";
3
- import * as ChildProcess from "./ChildProcess.ts";
4
- import * as PlatformError from "./PlatformError.ts";
5
- export declare const cwd: Effect.Effect<string>;
6
- export declare const which: (name: string) => Effect.Effect<string, PlatformError.SystemError>;
7
- export declare const spawn: (command: string, args?: ReadonlyArray<string>, options?: ChildProcess.Command.Options) => Effect.Effect<ChildProcess.ChildProcessHandle, PlatformError.PlatformError, ChildProcess.ChildProcessSpawner | Scope.Scope>;
@@ -1,9 +0,0 @@
1
- export type PathTuple = ReadonlyArray<string | [string, string?, string?] | [[string]]>;
2
- export declare function format(tuple: PathTuple): `/${string}`;
3
- export declare function toColon(tuple: PathTuple): string;
4
- export declare const toHono: typeof toColon;
5
- export declare function toExpress(tuple: PathTuple): string;
6
- export declare const toEffect: typeof toColon;
7
- export declare function toURLPattern(tuple: PathTuple): string;
8
- export declare function toRemix(tuple: PathTuple): string;
9
- export declare const toBun: typeof toColon;