effect-start 0.22.0 → 0.23.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 (313) hide show
  1. package/dist/BlobStore.d.ts +80 -0
  2. package/dist/BlobStore.js +19 -0
  3. package/dist/ChildProcess.d.ts +60 -0
  4. package/dist/ChildProcess.js +30 -0
  5. package/dist/Commander.d.ts +3 -6
  6. package/dist/Commander.js +6 -13
  7. package/dist/ContentNegotiation.d.ts +8 -9
  8. package/dist/ContentNegotiation.js +32 -37
  9. package/dist/Cookies.d.ts +47 -0
  10. package/dist/Cookies.js +273 -363
  11. package/dist/Development.d.ts +2 -2
  12. package/dist/Development.js +3 -4
  13. package/dist/Effectify.d.ts +1 -4
  14. package/dist/FilePathPattern.d.ts +3 -3
  15. package/dist/FileRouter.d.ts +5 -8
  16. package/dist/FileRouter.js +9 -10
  17. package/dist/FileRouterCodegen.d.ts +1 -1
  18. package/dist/FileRouterCodegen.js +33 -13
  19. package/dist/FileSystem.d.ts +158 -0
  20. package/dist/FileSystem.js +64 -125
  21. package/dist/Http.js +2 -6
  22. package/dist/PathPattern.d.ts +7 -7
  23. package/dist/PathPattern.js +1 -3
  24. package/dist/PlatformError.d.ts +24 -32
  25. package/dist/PlatformError.js +3 -21
  26. package/dist/PlatformRuntime.js +5 -10
  27. package/dist/Route.d.ts +14 -19
  28. package/dist/Route.js +8 -11
  29. package/dist/RouteBody.d.ts +6 -12
  30. package/dist/RouteBody.js +2 -2
  31. package/dist/RouteError.d.ts +98 -0
  32. package/dist/RouteError.js +55 -0
  33. package/dist/RouteHook.js +6 -11
  34. package/dist/RouteHttp.d.ts +3 -3
  35. package/dist/RouteHttp.js +27 -22
  36. package/dist/RouteMount.d.ts +16 -50
  37. package/dist/RouteMount.js +6 -20
  38. package/dist/RouteSchema.d.ts +22 -1
  39. package/dist/RouteSchema.js +33 -0
  40. package/dist/RouteSse.js +4 -10
  41. package/dist/RouteTree.d.ts +2 -1
  42. package/dist/RouteTree.js +17 -15
  43. package/dist/RouteTrie.d.ts +2 -2
  44. package/dist/RouteTrie.js +4 -9
  45. package/dist/SchemaExtra.d.ts +1 -1
  46. package/dist/Socket.d.ts +27 -0
  47. package/dist/Socket.js +20 -28
  48. package/dist/Sql.d.ts +34 -0
  49. package/dist/Sql.js +5 -0
  50. package/dist/SqlIntrospect.d.ts +91 -0
  51. package/dist/SqlIntrospect.js +466 -0
  52. package/dist/Start.d.ts +4 -6
  53. package/dist/Start.js +10 -2
  54. package/dist/StreamExtra.d.ts +1 -1
  55. package/dist/StreamExtra.js +9 -9
  56. package/dist/System.d.ts +7 -0
  57. package/dist/System.js +22 -0
  58. package/dist/TuplePathPattern.js +55 -50
  59. package/dist/Unique.js +7 -7
  60. package/dist/Values.d.ts +2 -1
  61. package/dist/Values.js +19 -13
  62. package/dist/bun/BunBlobStoreDisk.d.ts +6 -0
  63. package/dist/bun/BunBlobStoreDisk.js +116 -0
  64. package/dist/bun/BunBlobStoreS3.d.ts +11 -0
  65. package/dist/bun/BunBlobStoreS3.js +89 -0
  66. package/dist/bun/BunBlobWatcherDisk.d.ts +6 -0
  67. package/dist/bun/BunBlobWatcherDisk.js +60 -0
  68. package/dist/bun/BunBlobWatcherQueue.d.ts +6 -0
  69. package/dist/bun/BunBlobWatcherQueue.js +17 -0
  70. package/dist/bun/BunBundle.d.ts +5 -6
  71. package/dist/bun/BunBundle.js +7 -15
  72. package/dist/bun/BunChildProcessSpawner.d.ts +3 -0
  73. package/dist/bun/BunChildProcessSpawner.js +103 -0
  74. package/dist/bun/BunImportTrackerPlugin.d.ts +1 -1
  75. package/dist/bun/BunImportTrackerPlugin.js +3 -5
  76. package/dist/bun/BunRoute.d.ts +3 -2
  77. package/dist/bun/BunRoute.js +5 -7
  78. package/dist/bun/BunRuntime.js +1 -1
  79. package/dist/bun/BunServer.d.ts +11 -4
  80. package/dist/bun/BunServer.js +35 -11
  81. package/dist/bun/BunSql.d.ts +4 -0
  82. package/dist/bun/BunSql.js +81 -0
  83. package/dist/bun/_BunEnhancedResolve.d.ts +3 -3
  84. package/dist/bun/_BunEnhancedResolve.js +2 -4
  85. package/dist/bun/index.d.ts +1 -0
  86. package/dist/bun/index.js +1 -0
  87. package/dist/bundler/Bundle.d.ts +2 -1
  88. package/dist/bundler/Bundle.js +1 -1
  89. package/dist/bundler/BundleFiles.d.ts +5 -5
  90. package/dist/bundler/BundleFiles.js +10 -8
  91. package/dist/bundler/BundleRoute.d.ts +27 -0
  92. package/dist/bundler/BundleRoute.js +51 -0
  93. package/dist/client/ScrollState.js +2 -6
  94. package/dist/client/index.js +6 -8
  95. package/dist/console/Console.d.ts +6 -0
  96. package/dist/console/Console.js +26 -0
  97. package/dist/console/ConsoleErrors.d.ts +3 -0
  98. package/dist/console/ConsoleErrors.js +200 -0
  99. package/dist/console/ConsoleLogger.d.ts +3 -0
  100. package/dist/console/ConsoleLogger.js +47 -0
  101. package/dist/console/ConsoleMetrics.d.ts +3 -0
  102. package/dist/console/ConsoleMetrics.js +61 -0
  103. package/dist/console/ConsoleProcess.d.ts +3 -0
  104. package/dist/console/ConsoleProcess.js +49 -0
  105. package/dist/console/ConsoleStore.d.ts +144 -0
  106. package/dist/console/ConsoleStore.js +61 -0
  107. package/dist/console/ConsoleTracer.d.ts +3 -0
  108. package/dist/console/ConsoleTracer.js +94 -0
  109. package/dist/console/Simulation.d.ts +2 -0
  110. package/dist/console/Simulation.js +633 -0
  111. package/dist/console/index.d.ts +3 -0
  112. package/dist/console/index.js +3 -0
  113. package/dist/console/routes/errors/route.d.ts +10 -0
  114. package/dist/console/routes/errors/route.js +47 -0
  115. package/dist/console/routes/fiberDetail.d.ts +16 -0
  116. package/dist/console/routes/fiberDetail.js +38 -0
  117. package/dist/console/routes/fibers/route.d.ts +10 -0
  118. package/dist/console/routes/fibers/route.js +19 -0
  119. package/dist/console/routes/git/route.d.ts +11 -0
  120. package/dist/console/routes/git/route.js +33 -0
  121. package/dist/console/routes/layout.d.ts +9 -0
  122. package/dist/console/routes/layout.js +3 -0
  123. package/dist/console/routes/logs/route.d.ts +10 -0
  124. package/dist/console/routes/logs/route.js +32 -0
  125. package/dist/console/routes/metrics/route.d.ts +10 -0
  126. package/dist/console/routes/metrics/route.js +17 -0
  127. package/dist/console/routes/route.d.ts +6 -0
  128. package/dist/console/routes/route.js +5 -0
  129. package/dist/console/routes/routes/route.d.ts +6 -0
  130. package/dist/console/routes/routes/route.js +20 -0
  131. package/dist/console/routes/services/route.d.ts +6 -0
  132. package/dist/console/routes/services/route.js +12 -0
  133. package/dist/console/routes/system/route.d.ts +10 -0
  134. package/dist/console/routes/system/route.js +18 -0
  135. package/dist/console/routes/traceDetail.d.ts +16 -0
  136. package/dist/console/routes/traceDetail.js +14 -0
  137. package/dist/console/routes/traces/route.d.ts +10 -0
  138. package/dist/console/routes/traces/route.js +39 -0
  139. package/dist/console/routes/tree.d.ts +153 -0
  140. package/dist/console/routes/tree.js +29 -0
  141. package/dist/console/ui/Errors.d.ts +4 -0
  142. package/dist/console/ui/Errors.js +15 -0
  143. package/dist/console/ui/Fibers.d.ts +24 -0
  144. package/dist/console/ui/Fibers.js +121 -0
  145. package/dist/console/ui/Git.d.ts +20 -0
  146. package/dist/console/ui/Git.js +95 -0
  147. package/dist/console/ui/Logs.d.ts +4 -0
  148. package/dist/console/ui/Logs.js +25 -0
  149. package/dist/console/ui/Metrics.d.ts +4 -0
  150. package/dist/console/ui/Metrics.js +26 -0
  151. package/dist/console/ui/Routes.d.ts +8 -0
  152. package/dist/console/ui/Routes.js +70 -0
  153. package/dist/console/ui/Services.d.ts +10 -0
  154. package/dist/console/ui/Services.js +246 -0
  155. package/dist/console/ui/Shell.d.ts +10 -0
  156. package/dist/console/ui/Shell.js +7 -0
  157. package/dist/console/ui/System.d.ts +4 -0
  158. package/dist/console/ui/System.js +35 -0
  159. package/dist/console/ui/Traces.d.ts +12 -0
  160. package/dist/console/ui/Traces.js +179 -0
  161. package/dist/datastar/actions/fetch.d.ts +1 -1
  162. package/dist/datastar/actions/fetch.js +10 -18
  163. package/dist/datastar/actions/peek.js +1 -2
  164. package/dist/datastar/actions/setAll.js +1 -2
  165. package/dist/datastar/actions/toggleAll.js +1 -2
  166. package/dist/datastar/attributes/attr.js +1 -2
  167. package/dist/datastar/attributes/bind.js +10 -18
  168. package/dist/datastar/attributes/class.js +2 -5
  169. package/dist/datastar/attributes/computed.js +2 -3
  170. package/dist/datastar/attributes/effect.js +1 -2
  171. package/dist/datastar/attributes/indicator.js +2 -4
  172. package/dist/datastar/attributes/init.js +2 -3
  173. package/dist/datastar/attributes/jsonSignals.js +1 -2
  174. package/dist/datastar/attributes/on.js +41 -22
  175. package/dist/datastar/attributes/onIntersect.js +2 -3
  176. package/dist/datastar/attributes/onInterval.js +2 -3
  177. package/dist/datastar/attributes/onSignalPatch.js +2 -4
  178. package/dist/datastar/attributes/ref.js +1 -2
  179. package/dist/datastar/attributes/show.js +1 -2
  180. package/dist/datastar/attributes/signals.js +1 -2
  181. package/dist/datastar/attributes/style.js +6 -12
  182. package/dist/datastar/attributes/text.js +1 -2
  183. package/dist/datastar/engine.d.ts +13 -7
  184. package/dist/datastar/engine.js +76 -48
  185. package/dist/datastar/happydom.d.ts +1 -0
  186. package/dist/datastar/happydom.js +8 -0
  187. package/dist/datastar/index.d.ts +1 -1
  188. package/dist/datastar/index.js +1 -1
  189. package/dist/datastar/utils.js +4 -7
  190. package/dist/datastar/watchers/patchElements.js +24 -45
  191. package/dist/datastar/watchers/patchSignals.js +1 -2
  192. package/dist/experimental/EncryptedCookies.d.ts +2 -5
  193. package/dist/experimental/EncryptedCookies.js +17 -48
  194. package/dist/experimental/index.d.ts +0 -1
  195. package/dist/experimental/index.js +0 -1
  196. package/dist/hyper/Hyper.d.ts +2 -9
  197. package/dist/hyper/Hyper.js +1 -12
  198. package/dist/hyper/HyperHtml.d.ts +1 -1
  199. package/dist/hyper/HyperHtml.js +18 -12
  200. package/dist/hyper/HyperHtml.test.d.ts +1 -0
  201. package/dist/hyper/HyperHtml.test.js +197 -0
  202. package/dist/hyper/HyperRoute.test.js +14 -3
  203. package/dist/hyper/html.d.ts +11 -0
  204. package/dist/hyper/html.js +30 -0
  205. package/dist/hyper/index.d.ts +2 -0
  206. package/dist/hyper/index.js +1 -0
  207. package/dist/hyper/jsx-runtime.d.ts +1 -1
  208. package/dist/hyper/jsx-runtime.js +1 -1
  209. package/dist/index.d.ts +1 -0
  210. package/dist/index.js +1 -0
  211. package/dist/lint/plugin.d.ts +86 -0
  212. package/dist/lint/plugin.js +341 -0
  213. package/dist/node/NodeFileSystem.d.ts +2 -2
  214. package/dist/node/NodeFileSystem.js +4 -14
  215. package/dist/sql/bun/index.d.ts +3 -0
  216. package/dist/sql/bun/index.js +75 -0
  217. package/dist/sql/mssql/docker.d.ts +2 -0
  218. package/dist/sql/mssql/docker.js +67 -0
  219. package/dist/sql/mssql/index.d.ts +21 -0
  220. package/dist/sql/mssql/index.js +113 -0
  221. package/dist/testing/TestLogger.js +4 -1
  222. package/dist/testing/index.d.ts +0 -1
  223. package/dist/testing/index.js +0 -1
  224. package/dist/testing/utils.d.ts +3 -3
  225. package/dist/testing/utils.js +4 -4
  226. package/dist/x/cloudflare/CloudflareTunnel.d.ts +2 -5
  227. package/dist/x/cloudflare/CloudflareTunnel.js +14 -27
  228. package/dist/x/datastar/Datastar.d.ts +1 -1
  229. package/dist/x/datastar/Datastar.js +13 -12
  230. package/dist/x/datastar/index.d.ts +1 -2
  231. package/dist/x/datastar/index.js +1 -2
  232. package/dist/x/tailscale/TailscaleTunnel.d.ts +15 -0
  233. package/dist/x/tailscale/TailscaleTunnel.js +68 -0
  234. package/dist/x/tailscale/index.d.ts +1 -0
  235. package/dist/x/tailscale/index.js +1 -0
  236. package/dist/x/tailwind/TailwindPlugin.js +19 -19
  237. package/dist/x/tailwind/compile.d.ts +2 -2
  238. package/dist/x/tailwind/compile.js +2 -4
  239. package/package.json +22 -10
  240. package/src/ChildProcess.ts +145 -0
  241. package/src/PlatformError.ts +27 -50
  242. package/src/Route.ts +2 -2
  243. package/src/RouteError.ts +76 -0
  244. package/src/RouteHttp.ts +13 -5
  245. package/src/RouteSchema.ts +96 -1
  246. package/src/RouteTree.ts +12 -0
  247. package/src/Sql.ts +51 -0
  248. package/src/SqlIntrospect.ts +620 -0
  249. package/src/Start.ts +15 -3
  250. package/src/System.ts +43 -0
  251. package/src/Values.ts +7 -0
  252. package/src/bun/BunChildProcessSpawner.ts +143 -0
  253. package/src/bun/BunRoute.ts +5 -2
  254. package/src/bun/BunServer.ts +22 -1
  255. package/src/bun/index.ts +1 -0
  256. package/src/bundler/BundleRoute.ts +66 -0
  257. package/src/console/Console.ts +42 -0
  258. package/src/console/ConsoleErrors.ts +213 -0
  259. package/src/console/ConsoleLogger.ts +56 -0
  260. package/src/console/ConsoleMetrics.ts +72 -0
  261. package/src/console/ConsoleProcess.ts +59 -0
  262. package/src/console/ConsoleStore.ts +187 -0
  263. package/src/console/ConsoleTracer.ts +107 -0
  264. package/src/console/Simulation.ts +814 -0
  265. package/src/console/console.html +340 -0
  266. package/src/console/index.ts +3 -0
  267. package/src/console/routes/errors/route.tsx +97 -0
  268. package/src/console/routes/fiberDetail.tsx +54 -0
  269. package/src/console/routes/fibers/route.tsx +45 -0
  270. package/src/console/routes/git/route.tsx +64 -0
  271. package/src/console/routes/layout.tsx +4 -0
  272. package/src/console/routes/logs/route.tsx +77 -0
  273. package/src/console/routes/metrics/route.tsx +36 -0
  274. package/src/console/routes/route.tsx +8 -0
  275. package/src/console/routes/routes/route.tsx +30 -0
  276. package/src/console/routes/services/route.tsx +21 -0
  277. package/src/console/routes/system/route.tsx +43 -0
  278. package/src/console/routes/traceDetail.tsx +22 -0
  279. package/src/console/routes/traces/route.tsx +81 -0
  280. package/src/console/routes/tree.ts +30 -0
  281. package/src/console/ui/Errors.tsx +76 -0
  282. package/src/console/ui/Fibers.tsx +321 -0
  283. package/src/console/ui/Git.tsx +182 -0
  284. package/src/console/ui/Logs.tsx +46 -0
  285. package/src/console/ui/Metrics.tsx +78 -0
  286. package/src/console/ui/Routes.tsx +125 -0
  287. package/src/console/ui/Services.tsx +273 -0
  288. package/src/console/ui/Shell.tsx +62 -0
  289. package/src/console/ui/System.tsx +131 -0
  290. package/src/console/ui/Traces.tsx +426 -0
  291. package/src/datastar/README.md +6 -1
  292. package/src/datastar/actions/fetch.ts +0 -1
  293. package/src/datastar/attributes/on.ts +40 -20
  294. package/src/datastar/engine.ts +51 -0
  295. package/src/datastar/jsx.d.ts +79 -0
  296. package/src/hyper/Hyper.ts +1 -16
  297. package/src/hyper/HyperHtml.ts +6 -4
  298. package/src/hyper/HyperRoute.ts +2 -1
  299. package/src/hyper/html.ts +47 -0
  300. package/src/hyper/index.ts +2 -0
  301. package/src/hyper/jsx.d.ts +5 -3
  302. package/src/index.ts +1 -0
  303. package/src/lint/plugin.js +129 -0
  304. package/src/sql/bun/index.ts +147 -0
  305. package/src/sql/mssql/docker.ts +117 -0
  306. package/src/sql/mssql/index.ts +223 -0
  307. package/src/sql/mssql/mssql.d.ts +41 -0
  308. package/src/x/cloudflare/CloudflareTunnel.ts +8 -36
  309. package/src/x/tailscale/TailscaleTunnel.ts +113 -0
  310. package/src/x/tailscale/index.ts +1 -0
  311. package/src/x/datastar/Datastar.ts +0 -61
  312. package/src/x/datastar/index.ts +0 -2
  313. package/src/x/datastar/jsx-datastar.d.ts +0 -60
@@ -0,0 +1,113 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Exit from "effect/Exit";
3
+ import * as FiberRef from "effect/FiberRef";
4
+ import * as GlobalValue from "effect/GlobalValue";
5
+ import * as Layer from "effect/Layer";
6
+ import * as Option from "effect/Option";
7
+ import * as Sql from "../../Sql.js";
8
+ const wrapError = (error) => new Sql.SqlError({
9
+ code: error?.code ??
10
+ (error?.number != null ? String(error.number) : "UNKNOWN"),
11
+ message: error instanceof Error ? error.message : String(error),
12
+ cause: error,
13
+ });
14
+ const makeValues = (obj, ...columns) => {
15
+ const items = Array.isArray(obj) ? obj : [obj];
16
+ const cols = columns.length > 0 ? columns : Object.keys(items[0]);
17
+ return { value: items, columns: cols };
18
+ };
19
+ const buildQuery = (strings, values) => {
20
+ let text = strings[0];
21
+ for (let i = 0; i < values.length; i++)
22
+ text += `@p${i + 1}` + strings[i + 1];
23
+ return { text, values };
24
+ };
25
+ const addInputs = (request, values) => {
26
+ for (let i = 0; i < values.length; i++) {
27
+ request.input(`p${i + 1}`, values[i]);
28
+ }
29
+ };
30
+ const loadMssql = () => import("mssql");
31
+ const currentTransaction = GlobalValue.globalValue(Symbol.for("effect-start/sql/mssql/currentTransaction"), () => FiberRef.unsafeMake(Option.none()));
32
+ const executeQuery = (pool, text, values) => Effect.flatMap(FiberRef.get(currentTransaction), (txOpt) => {
33
+ const request = Option.isSome(txOpt) ? txOpt.value.transaction.request() : pool.request();
34
+ addInputs(request, values);
35
+ return Effect.tryPromise({
36
+ try: () => request.query(text),
37
+ catch: wrapError,
38
+ }).pipe(Effect.map((result) => result.recordset ?? []));
39
+ });
40
+ const runQuery = (pool, strings, values) => {
41
+ const { text, values: params } = buildQuery(strings, values);
42
+ return executeQuery(pool, text, params);
43
+ };
44
+ const runUnsafe = (pool, query, values) => Effect.flatMap(FiberRef.get(currentTransaction), (txOpt) => {
45
+ const request = Option.isSome(txOpt) ? txOpt.value.transaction.request() : pool.request();
46
+ if (values)
47
+ addInputs(request, values);
48
+ return Effect.tryPromise({
49
+ try: () => request.query(query),
50
+ catch: wrapError,
51
+ }).pipe(Effect.map((result) => result.recordset ?? []));
52
+ });
53
+ const makeWithTransaction = (pool) => (self) => Effect.uninterruptibleMask((restore) => Effect.flatMap(FiberRef.get(currentTransaction), (txOpt) => {
54
+ if (Option.isSome(txOpt)) {
55
+ const { transaction, depth } = txOpt.value;
56
+ const name = `sp_${depth}`;
57
+ return Effect.gen(function* () {
58
+ const req = transaction.request();
59
+ yield* Effect.tryPromise({
60
+ try: () => req.query(`SAVE TRANSACTION ${name}`),
61
+ catch: wrapError,
62
+ });
63
+ const exit = yield* Effect.exit(restore(Effect.locally(self, currentTransaction, Option.some({ transaction, depth: depth + 1 }))));
64
+ if (Exit.isSuccess(exit)) {
65
+ return exit.value;
66
+ }
67
+ const rbReq = transaction.request();
68
+ yield* Effect.tryPromise({
69
+ try: () => rbReq.query(`ROLLBACK TRANSACTION ${name}`),
70
+ catch: wrapError,
71
+ }).pipe(Effect.orDie);
72
+ return yield* exit;
73
+ });
74
+ }
75
+ return Effect.gen(function* () {
76
+ const transaction = pool.transaction();
77
+ yield* Effect.tryPromise({ try: () => transaction.begin(), catch: wrapError });
78
+ const exit = yield* Effect.exit(restore(Effect.locally(self, currentTransaction, Option.some({ transaction, depth: 1 }))));
79
+ if (Exit.isSuccess(exit)) {
80
+ yield* Effect.tryPromise({ try: () => transaction.commit(), catch: wrapError });
81
+ return exit.value;
82
+ }
83
+ yield* Effect.tryPromise({ try: () => transaction.rollback(), catch: wrapError }).pipe(Effect.orDie);
84
+ return yield* exit;
85
+ });
86
+ }));
87
+ export const layer = (config) => Layer.scoped(Sql.SqlClient, Effect.acquireRelease(Effect.tryPromise({
88
+ try: async () => {
89
+ const mssql = await loadMssql();
90
+ const pool = await new mssql.ConnectionPool(config).connect();
91
+ return { mssql, pool };
92
+ },
93
+ catch: wrapError,
94
+ }).pipe(Effect.map(({ mssql, pool }) => {
95
+ const use = (fn) => Effect.tryPromise({ try: () => Promise.resolve(fn(pool)), catch: wrapError });
96
+ return Object.assign((strings, ...values) => runQuery(pool, strings, values), {
97
+ unsafe: (query, values) => runUnsafe(pool, query, values),
98
+ values: makeValues,
99
+ withTransaction: makeWithTransaction(pool),
100
+ reserve: Effect.acquireRelease(Effect.tryPromise({
101
+ try: () => new mssql.ConnectionPool({
102
+ ...config,
103
+ pool: { max: 1, min: 1 },
104
+ }).connect(),
105
+ catch: wrapError,
106
+ }), (reserved) => Effect.tryPromise({ try: () => reserved.close(), catch: () => void 0 }).pipe(Effect.asVoid, Effect.orDie)).pipe(Effect.map((reserved) => Object.assign((strings, ...values) => runQuery(reserved, strings, values), {
107
+ unsafe: (query, values) => runUnsafe(reserved, query, values),
108
+ values: makeValues,
109
+ }))),
110
+ close: () => use((pool) => pool.close()),
111
+ use,
112
+ });
113
+ })), (client) => client.close().pipe(Effect.orDie)));
@@ -17,7 +17,10 @@ export function layer() {
17
17
  const causeStr = !Cause.isEmpty(cause)
18
18
  ? ` ${Cause.pretty(cause, { renderErrorCause: true })}`
19
19
  : "";
20
- MutableRef.update(mutableRef, (msgs) => [...msgs, `[${logLevel._tag}] ${String(message)}${causeStr}`]);
20
+ MutableRef.update(mutableRef, (msgs) => [
21
+ ...msgs,
22
+ `[${logLevel._tag}] ${String(message)}${causeStr}`,
23
+ ]);
21
24
  });
22
25
  yield* FiberRef.update(FiberRef.currentLoggers, (loggers) => HashSet.add(HashSet.remove(loggers, Logger.defaultLogger), customLogger));
23
26
  return { messages };
@@ -1,3 +1,2 @@
1
- export * as TestHttpClient from "./TestHttpClient.ts";
2
1
  export * as TestLogger from "./TestLogger.ts";
3
2
  export * from "./utils.ts";
@@ -1,3 +1,2 @@
1
- export * as TestHttpClient from "./TestHttpClient.js";
2
1
  export * as TestLogger from "./TestLogger.js";
3
2
  export * from "./utils.js";
@@ -1,9 +1,9 @@
1
1
  import * as Effect from "effect/Effect";
2
2
  import * as Layer from "effect/Layer";
3
- import * as Scope from "effect/Scope";
4
- import type { YieldWrap } from "effect/Utils";
3
+ import type * as Scope from "effect/Scope";
4
+ import type * as Utils from "effect/Utils";
5
5
  /**
6
6
  * Creates a scoped Effects and runs is asynchronously.
7
7
  * Useful for testing.
8
8
  */
9
- export declare const effectFn: <RL>(layer?: Layer.Layer<RL, any>) => <Eff extends YieldWrap<Effect.Effect<any, any, RE>>, AEff, RE extends RL | Scope.Scope>(f: () => Generator<Eff, AEff, never>) => Promise<void>;
9
+ export declare const effectFn: <RL>(layer?: Layer.Layer<RL, any>) => <Eff extends Utils.YieldWrap<Effect.Effect<any, any, RE>>, AEff, RE extends RL | Scope.Scope>(f: () => Generator<Eff, AEff, never>) => Promise<void>;
@@ -9,7 +9,7 @@ import * as Logger from "effect/Logger";
9
9
  */
10
10
  export const effectFn = (layer) => (f) => Function.pipe(Effect.gen(f), Effect.scoped, Effect.provide(Logger.pretty), Effect.provide(layer ?? Layer.empty),
11
11
  // @ts-expect-error will have to figure out how to clear deps
12
- Effect.runPromise, v => v.then(() => { }, clearStackTraces));
12
+ Effect.runPromise, (v) => v.then(() => { }, clearStackTraces));
13
13
  /*
14
14
  * When effect fails, instead of throwing FiberFailure,
15
15
  * throw a plain Error with the strack trace and hides
@@ -22,18 +22,18 @@ Effect.runPromise, v => v.then(() => { }, clearStackTraces));
22
22
  * files that are then loaded into a runtime.
23
23
  */
24
24
  const clearStackTraces = (err) => {
25
- const ExternalStackTraceLineRegexp = /\(.*\/node_modules\/[^\.]/;
25
+ const ExternalStackTraceLineRegexp = /\(.*\/node_modules\/[^.]/;
26
26
  const message = err instanceof Error
27
27
  ? err.message
28
28
  : typeof err === "object" && err !== null && "message" in err
29
29
  ? String(err.message)
30
30
  : String(err);
31
31
  const stack = err instanceof Error
32
- ? err.stack ?? ""
32
+ ? (err.stack ?? "")
33
33
  : typeof err === "object" && err !== null && "stack" in err
34
34
  ? String(err.stack)
35
35
  : "";
36
36
  const newErr = new Error(message);
37
- newErr.stack = Function.pipe(stack.split("\n"), Array.takeWhile(s => !ExternalStackTraceLineRegexp.test(s)), Array.join("\n"));
37
+ newErr.stack = Function.pipe(stack.split("\n"), Array.takeWhile((s) => !ExternalStackTraceLineRegexp.test(s)), Array.join("\n"));
38
38
  throw newErr;
39
39
  };
@@ -1,7 +1,4 @@
1
1
  import { Effect, Layer, LogLevel } from "effect";
2
- /**
3
- * Starts Cloudflare tunnel using cloudflared cli.
4
- */
5
2
  export declare const start: (opts: {
6
3
  command?: string;
7
4
  tunnelName: string;
@@ -9,5 +6,5 @@ export declare const start: (opts: {
9
6
  cleanLogs?: false;
10
7
  logLevel?: LogLevel.LogLevel;
11
8
  logPrefix?: string;
12
- }) => Effect.Effect<void, import("@effect/platform/Error").PlatformError, import("effect/Scope").Scope | import("@effect/platform/CommandExecutor").CommandExecutor>;
13
- export declare const layer: () => Layer.Layer<never, import("effect/ConfigError").ConfigError, import("@effect/platform/CommandExecutor").CommandExecutor>;
9
+ }) => Effect.Effect<void, import("../../PlatformError.ts").PlatformError, import("../../ChildProcess.ts").ChildProcessSpawner | import("effect/Scope").Scope>;
10
+ export declare const layer: () => Layer.Layer<never, import("effect/ConfigError").ConfigError, import("../../ChildProcess.ts").ChildProcessSpawner>;
@@ -1,31 +1,20 @@
1
- import { Command, } from "@effect/platform";
2
- import { Config, Effect, identity, Layer, LogLevel, Option, pipe, Stream, String, } from "effect";
3
- /**
4
- * Starts Cloudflare tunnel using cloudflared cli.
5
- */
1
+ import * as System from "../../System.js";
2
+ import { Config, Effect, Layer, LogLevel, Option, pipe, Stream, String } from "effect";
6
3
  export const start = (opts) => Effect.gen(function* () {
7
- const logPrefix = String.isString(opts.logPrefix)
8
- ? opts.logPrefix
9
- : "CloudflareTunnel: ";
4
+ const command = opts.command ?? "cloudflared";
5
+ yield* System.which(command);
6
+ const logPrefix = String.isString(opts.logPrefix) ? opts.logPrefix : "CloudflareTunnel: ";
10
7
  const args = [
11
8
  "tunnel",
12
9
  "run",
13
- opts.tunnelUrl
14
- ? [
15
- "--url",
16
- opts.tunnelUrl,
17
- ]
18
- : [],
10
+ opts.tunnelUrl ? ["--url", opts.tunnelUrl] : [],
19
11
  opts.tunnelName,
20
- ]
21
- .flatMap(v => v);
22
- const process = yield* pipe(Command.make(opts.command ?? "cloudflared", ...args), Command.start);
23
- yield* Effect.logInfo(`Cloudflare tunnel started name=${opts.tunnelName} pid=${process.pid} tunnelUrl=${opts.tunnelUrl ?? "<empty>"}`);
24
- yield* pipe(Stream.merge(process.stdout, process.stderr), Stream.decodeText("utf-8"), Stream.splitLines, opts.cleanLogs ?? true
25
- ? Stream.map(v => v.replace(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z\s\w+\s/, ""))
26
- : identity, logPrefix
27
- ? Stream.map(v => logPrefix + v)
28
- : identity, Stream.runForEach(v => Effect.logWithLevel(opts.logLevel ?? LogLevel.Debug, v)));
12
+ ].flatMap((v) => v);
13
+ const proc = yield* System.spawn(command, args);
14
+ yield* Effect.logInfo(`Cloudflare tunnel started name=${opts.tunnelName} pid=${proc.pid} tunnelUrl=${opts.tunnelUrl ?? "<empty>"}`);
15
+ yield* pipe(Stream.merge(proc.stdout, proc.stderr), Stream.decodeText("utf-8"), Stream.splitLines, (opts.cleanLogs ?? true)
16
+ ? Stream.map((v) => v.replace(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z\s\w+\s/, ""))
17
+ : (s) => s, logPrefix ? Stream.map((v) => logPrefix + v) : (s) => s, Stream.runForEach((v) => Effect.logWithLevel(opts.logLevel ?? LogLevel.Debug, v)));
29
18
  });
30
19
  export const layer = () => Layer.scopedDiscard(Effect.gen(function* () {
31
20
  const tunnelName = yield* pipe(Config.string("CLOUDFLARE_TUNNEL_NAME"), Config.option, Effect.andThen(Option.getOrUndefined));
@@ -34,10 +23,8 @@ export const layer = () => Layer.scopedDiscard(Effect.gen(function* () {
34
23
  yield* Effect.logWarning("CLOUDFLARE_TUNNEL_NAME not provided. Skipping.");
35
24
  return;
36
25
  }
37
- yield* Effect
38
- .forkScoped(pipe(start({
26
+ yield* Effect.forkScoped(start({
39
27
  tunnelName,
40
28
  tunnelUrl,
41
- })))
42
- .pipe(Effect.catchAll(err => Effect.logError("Cloudflare tunnel failed", err)));
29
+ }).pipe(Effect.catchAll((err) => Effect.logError("Cloudflare tunnel failed", err))));
43
30
  }));
@@ -1,4 +1,4 @@
1
- import * as HyperNode from "../../hyper/HyperNode.ts";
1
+ import type * as HyperNode from "../../hyper/HyperNode.ts";
2
2
  export declare const HyperHooks: {
3
3
  readonly onNode: typeof onNode;
4
4
  };
@@ -7,21 +7,27 @@ function onNode(node) {
7
7
  node.props["data-signals"] = JSON.stringify(dataSignals);
8
8
  }
9
9
  if (typeof dataClass === "function") {
10
- node.props["data-class"] = `(${dataClass.toString()})()`;
10
+ node.props["data-class"] = dataClass.toString();
11
11
  }
12
12
  else if (typeof dataClass === "object" && dataClass !== null) {
13
13
  node.props["data-class"] = JSON.stringify(dataClass);
14
14
  }
15
- if (typeof dataAttr === "object" && dataAttr !== null) {
15
+ if (typeof dataAttr === "function") {
16
+ node.props["data-attr"] = dataAttr.toString();
17
+ }
18
+ else if (typeof dataAttr === "object" && dataAttr !== null) {
16
19
  node.props["data-attr"] = JSON.stringify(dataAttr);
17
20
  }
18
21
  if (typeof dataStyle === "function") {
19
- node.props["data-style"] = `(${dataStyle.toString()})()`;
22
+ node.props["data-style"] = dataStyle.toString();
20
23
  }
21
24
  else if (typeof dataStyle === "object" && dataStyle !== null) {
22
25
  node.props["data-style"] = JSON.stringify(dataStyle);
23
26
  }
24
- if (typeof dataShow === "boolean") {
27
+ if (typeof dataShow === "function") {
28
+ node.props["data-show"] = dataShow.toString();
29
+ }
30
+ else if (typeof dataShow === "boolean") {
25
31
  node.props["data-show"] = dataShow.toString();
26
32
  }
27
33
  if (dataIgnore !== true && dataIgnore !== undefined) {
@@ -30,17 +36,12 @@ function onNode(node) {
30
36
  if (dataIgnoreMorph !== true && dataIgnoreMorph !== undefined) {
31
37
  delete node.props["data-ignore-morph"];
32
38
  }
33
- // Handle dynamic attributes with suffixes
34
39
  for (const [key, value] of Object.entries(node.props)) {
35
- if (key.startsWith("data-signals-")
36
- && typeof value === "object"
37
- && value !== null) {
40
+ if (key.startsWith("data-signals-") && typeof value === "object" && value !== null) {
38
41
  node.props[key] = JSON.stringify(value);
39
42
  }
40
- if (key.startsWith("data-on-")
41
- && typeof value === "function") {
42
- // @ts-ignore
43
- node.props[key] = `(${value.toString()})()`;
43
+ if (key.startsWith("data-") && key !== "data-signals" && typeof value === "function") {
44
+ node.props[key] = value.toString();
44
45
  }
45
46
  }
46
47
  }
@@ -1,2 +1 @@
1
- export * as Datastar from "./Datastar.ts";
2
- export { HyperHooks, } from "./Datastar.ts";
1
+ export {};
@@ -1,2 +1 @@
1
- export * as Datastar from "./Datastar.js";
2
- export { HyperHooks, } from "./Datastar.js";
1
+ export {};
@@ -0,0 +1,15 @@
1
+ import * as BunServer from "../../bun/BunServer.ts";
2
+ import * as PlatformError from "../../PlatformError.ts";
3
+ import * as Effect from "effect/Effect";
4
+ import * as Layer from "effect/Layer";
5
+ import * as LogLevel from "effect/LogLevel";
6
+ export declare const start: (opts: {
7
+ command?: string;
8
+ port: number;
9
+ public?: boolean;
10
+ logLevel?: LogLevel.LogLevel;
11
+ logPrefix?: string;
12
+ }) => Effect.Effect<void, PlatformError.PlatformError, import("../../ChildProcess.ts").ChildProcessSpawner | import("effect/Scope").Scope>;
13
+ export declare const layer: (opts?: {
14
+ public?: boolean;
15
+ }) => Layer.Layer<never, never, import("../../ChildProcess.ts").ChildProcessSpawner | BunServer.BunServer>;
@@ -0,0 +1,68 @@
1
+ import * as BunServer from "../../bun/BunServer.js";
2
+ import * as PlatformError from "../../PlatformError.js";
3
+ import * as System from "../../System.js";
4
+ import * as Deferred from "effect/Deferred";
5
+ import * as Effect from "effect/Effect";
6
+ import * as Fiber from "effect/Fiber";
7
+ import * as Layer from "effect/Layer";
8
+ import * as LogLevel from "effect/LogLevel";
9
+ import * as Stream from "effect/Stream";
10
+ import * as Function from "effect/Function";
11
+ const getStatus = (command) => Effect.gen(function* () {
12
+ const proc = yield* System.spawn(command, ["status", "--json"]);
13
+ const exitCode = yield* proc.exitCode;
14
+ if (exitCode !== 0) {
15
+ const stderr = yield* proc.stderr.pipe(Stream.decodeText("utf-8"), Stream.mkString);
16
+ return yield* new PlatformError.SystemError({
17
+ reason: "Unknown",
18
+ module: "TailscaleTunnel",
19
+ method: "getStatus",
20
+ description: `tailscale status exited with code ${exitCode}: ${stderr}`,
21
+ });
22
+ }
23
+ const stdout = yield* proc.stdout.pipe(Stream.decodeText("utf-8"), Stream.mkString);
24
+ const json = JSON.parse(stdout);
25
+ if (json.BackendState !== "Running") {
26
+ return yield* new PlatformError.SystemError({
27
+ reason: "Unknown",
28
+ module: "TailscaleTunnel",
29
+ method: "getStatus",
30
+ description: `tailscale is in state "${json.BackendState}", expected "Running"`,
31
+ });
32
+ }
33
+ return json;
34
+ });
35
+ const serve = (opts) => Effect.gen(function* () {
36
+ const logPrefix = opts.logPrefix ?? "TailscaleTunnel: ";
37
+ const args = [opts.public ? "funnel" : "serve", String(opts.port)];
38
+ const proc = yield* System.spawn(opts.command, args);
39
+ yield* Function.pipe(Stream.merge(proc.stdout, proc.stderr), Stream.decodeText("utf-8"), Stream.splitLines, logPrefix ? Stream.map((v) => logPrefix + v) : (s) => s, Stream.runForEach((v) => Effect.logWithLevel(opts.logLevel ?? LogLevel.Debug, v)));
40
+ });
41
+ export const start = (opts) => Effect.gen(function* () {
42
+ const command = opts.command ?? "tailscale";
43
+ yield* System.which(command);
44
+ const status = yield* getStatus(command);
45
+ const dnsName = status.Self?.DNSName?.replace(/\.$/, "");
46
+ yield* serve({ ...opts, command, dnsName });
47
+ });
48
+ export const layer = (opts) => Layer.scopedDiscard(Effect.gen(function* () {
49
+ const { server } = yield* BunServer.BunServer;
50
+ const port = server.port;
51
+ const command = "tailscale";
52
+ const ready = yield* Deferred.make();
53
+ const fiber = yield* Effect.forkScoped(Effect.gen(function* () {
54
+ yield* System.which(command);
55
+ const status = yield* getStatus(command);
56
+ const dnsName = status.Self?.DNSName?.replace(/\.$/, "");
57
+ const serveUrl = dnsName ? `https://${dnsName}` : undefined;
58
+ yield* Effect.logInfo(`Tailscale ${opts?.public ? "funnel" : "serve"}${serveUrl ? ` url=${serveUrl}` : ""}`);
59
+ yield* Deferred.succeed(ready, void 0);
60
+ yield* serve({
61
+ command,
62
+ port,
63
+ dnsName,
64
+ public: opts?.public,
65
+ });
66
+ }).pipe(Effect.orDie));
67
+ yield* Fiber.join(fiber).pipe(Effect.raceFirst(Deferred.await(ready)));
68
+ }));
@@ -0,0 +1 @@
1
+ export * as TailscaleTunnel from "./TailscaleTunnel.ts";
@@ -0,0 +1 @@
1
+ export * as TailscaleTunnel from "./TailscaleTunnel.js";
@@ -17,7 +17,7 @@ export const make = (opts) => {
17
17
  ? async () => {
18
18
  const candidates = await scanFiles(opts.scanPath);
19
19
  scannedCandidates.clear();
20
- candidates.forEach(candidate => scannedCandidates.add(candidate));
20
+ candidates.forEach((candidate) => scannedCandidates.add(candidate));
21
21
  }
22
22
  : null;
23
23
  // Track import relationships when dynamically scanning
@@ -100,17 +100,15 @@ export const make = (opts) => {
100
100
  continue;
101
101
  }
102
102
  const moduleImports = importDescendants.get(currentPath);
103
- moduleImports?.forEach(moduleImport => {
103
+ moduleImports?.forEach((moduleImport) => {
104
104
  const moduleCandidates = classNameCandidates.get(moduleImport);
105
- moduleCandidates?.forEach(candidate => candidates.add(candidate));
105
+ moduleCandidates?.forEach((candidate) => candidates.add(candidate));
106
106
  pendingModules.push(moduleImport);
107
107
  });
108
108
  visitedModules.add(currentPath);
109
109
  }
110
110
  }
111
- const contents = compiler.build([
112
- ...candidates,
113
- ]);
111
+ const contents = compiler.build([...candidates]);
114
112
  return {
115
113
  contents,
116
114
  loader: "css",
@@ -125,15 +123,15 @@ const TEMPLATE_EXPRESSION_REGEX = /\$\{[^}]*\}/g;
125
123
  const TAILWIND_CLASS_REGEX = /^[a-zA-Z0-9_:-]+(\[[^\]]*\])?$/;
126
124
  const CLASS_NAME_PATTERNS = [
127
125
  // HTML class attributes with double quotes: <div class="bg-blue-500 text-white">
128
- "<[^>]*?\\sclass\\s*=\\s*\"([^\"]+)\"",
126
+ '<[^>]*?\\sclass\\s*=\\s*"([^"]+)"',
129
127
  // HTML class attributes with single quotes: <div class='bg-blue-500 text-white'>
130
128
  "<[^>]*?\\sclass\\s*=\\s*'([^']+)'",
131
129
  // JSX className attributes with double quotes: <div className="bg-blue-500 text-white">
132
- "<[^>]*?\\sclassName\\s*=\\s*\"([^\"]+)\"",
130
+ '<[^>]*?\\sclassName\\s*=\\s*"([^"]+)"',
133
131
  // JSX className attributes with single quotes: <div className='bg-blue-500 text-white'>
134
132
  "<[^>]*?\\sclassName\\s*=\\s*'([^']+)'",
135
133
  // JSX className with braces and double quotes: <div className={"bg-blue-500 text-white"}>
136
- "<[^>]*?\\sclassName\\s*=\\s*\\{\\s*\"([^\"]+)\"\\s*\\}",
134
+ '<[^>]*?\\sclassName\\s*=\\s*\\{\\s*"([^"]+)"\\s*\\}',
137
135
  // JSX className with braces and single quotes: <div className={'bg-blue-500 text-white'}>
138
136
  "<[^>]*?\\sclassName\\s*=\\s*\\{\\s*'([^']+)'\\s*\\}",
139
137
  // JSX className with template literals: <div className={`bg-blue-500 ${variable}`}>
@@ -141,15 +139,15 @@ const CLASS_NAME_PATTERNS = [
141
139
  // HTML class with template literals: <div class={`bg-blue-500 ${variable}`}>
142
140
  "<[^>]*?\\sclass\\s*=\\s*\\{\\s*`([^`]*)`\\s*\\}",
143
141
  // HTML class at start of tag with double quotes: <div class="bg-blue-500">
144
- "<\\w+\\s+class\\s*=\\s*\"([^\"]+)\"",
142
+ '<\\w+\\s+class\\s*=\\s*"([^"]+)"',
145
143
  // HTML class at start of tag with single quotes: <div class='bg-blue-500'>
146
144
  "<\\w+\\s+class\\s*=\\s*'([^']+)'",
147
145
  // JSX className at start of tag with double quotes: <div className="bg-blue-500">
148
- "<\\w+\\s+className\\s*=\\s*\"([^\"]+)\"",
146
+ '<\\w+\\s+className\\s*=\\s*"([^"]+)"',
149
147
  // JSX className at start of tag with single quotes: <div className='bg-blue-500'>
150
148
  "<\\w+\\s+className\\s*=\\s*'([^']+)'",
151
149
  // JSX className at start with braces and double quotes: <div className={"bg-blue-500"}>
152
- "<\\w+\\s+className\\s*=\\s*\\{\\s*\"([^\"]+)\"\\s*\\}",
150
+ '<\\w+\\s+className\\s*=\\s*\\{\\s*"([^"]+)"\\s*\\}',
153
151
  // JSX className at start with braces and single quotes: <div className={'bg-blue-500'}>
154
152
  "<\\w+\\s+className\\s*=\\s*\\{\\s*'([^']+)'\\s*\\}",
155
153
  // JSX className at start with template literals: <div className={`bg-blue-500 ${variable}`}>
@@ -157,13 +155,12 @@ const CLASS_NAME_PATTERNS = [
157
155
  // HTML class at start with template literals: <div class={`bg-blue-500 ${variable}`}>
158
156
  "<\\w+\\s+class\\s*=\\s*\\{\\s*`([^`]*)`\\s*\\}",
159
157
  ];
160
- const CLASS_NAME_REGEX = new RegExp(CLASS_NAME_PATTERNS.map(pattern => `(?:${pattern})`).join("|"), "g");
158
+ const CLASS_NAME_REGEX = new RegExp(CLASS_NAME_PATTERNS.map((pattern) => `(?:${pattern})`).join("|"), "g");
161
159
  function hasCssImport(css, specifier) {
162
160
  const [, importPath] = css.match(CSS_IMPORT_REGEX) ?? [];
163
161
  if (!importPath)
164
162
  return false;
165
- return specifier === undefined
166
- || importPath.includes(specifier);
163
+ return specifier === undefined || importPath.includes(specifier);
167
164
  }
168
165
  export function extractClassNames(source) {
169
166
  const candidates = new Set();
@@ -183,20 +180,23 @@ export function extractClassNames(source) {
183
180
  if (classString.includes("${")) {
184
181
  const staticParts = classString.split(TEMPLATE_EXPRESSION_REGEX);
185
182
  for (const part of staticParts) {
186
- const names = part.trim().split(/\s+/).filter(name => {
183
+ const names = part
184
+ .trim()
185
+ .split(/\s+/)
186
+ .filter((name) => {
187
187
  if (name.length === 0)
188
188
  return false;
189
189
  if (name.endsWith("-") || name.startsWith("-"))
190
190
  return false;
191
191
  return TAILWIND_CLASS_REGEX.test(name);
192
192
  });
193
- names.forEach(name => candidates.add(name));
193
+ names.forEach((name) => candidates.add(name));
194
194
  }
195
195
  }
196
196
  else {
197
197
  // Simple case: regular class string without expressions
198
- const names = classString.split(/\s+/).filter(name => name.length > 0);
199
- names.forEach(name => candidates.add(name));
198
+ const names = classString.split(/\s+/).filter((name) => name.length > 0);
199
+ names.forEach((name) => candidates.add(name));
200
200
  }
201
201
  }
202
202
  return candidates;
@@ -1,6 +1,6 @@
1
1
  import { compile as _compile, compileAst as _compileAst, Features, Polyfills } from "tailwindcss";
2
2
  type AstNode = Parameters<typeof _compileAst>[0][number];
3
- export { Features, Polyfills, };
3
+ export { Features, Polyfills };
4
4
  export type Resolver = (id: string, base: string) => Promise<string | false | undefined>;
5
5
  export interface CompileOptions {
6
6
  base: string;
@@ -10,7 +10,7 @@ export interface CompileOptions {
10
10
  customCssResolver?: Resolver;
11
11
  customJsResolver?: Resolver;
12
12
  }
13
- export declare function compileAst(ast: AstNode[], options: CompileOptions): ReturnType<typeof _compileAst>;
13
+ export declare function compileAst(ast: Array<AstNode>, options: CompileOptions): ReturnType<typeof _compileAst>;
14
14
  export declare function compile(css: string, options: CompileOptions): ReturnType<typeof _compile>;
15
15
  export declare function loadModule(id: string, base: string, _onDependency: (path: string) => void, customJsResolver?: Resolver): Promise<{
16
16
  path: string;
@@ -9,7 +9,7 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
9
9
  import fsPromises from "node:fs/promises";
10
10
  import path from "node:path";
11
11
  import { pathToFileURL } from "node:url";
12
- import { compile as _compile, compileAst as _compileAst, } from "tailwindcss";
12
+ import { compile as _compile, compileAst as _compileAst } from "tailwindcss";
13
13
  import * as BunEnhancedResolve from "../../bun/_BunEnhancedResolve";
14
14
  function createCompileOptions({ base, from, polyfills, onDependency, customCssResolver, customJsResolver, }) {
15
15
  return {
@@ -72,9 +72,7 @@ export async function loadModule(id, base, _onDependency, customJsResolver) {
72
72
  if (!resolvedPath) {
73
73
  throw new Error(`Could not resolve '${id}' from '${base}'`);
74
74
  }
75
- let [module] = await Promise.all([
76
- importModule(pathToFileURL(resolvedPath).href + "?id=" + Date.now()),
77
- ]);
75
+ let module = await importModule(pathToFileURL(resolvedPath).href + "?id=" + Date.now());
78
76
  return {
79
77
  path: resolvedPath,
80
78
  base: path.dirname(resolvedPath),