davaux 0.8.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 (333) hide show
  1. package/BASELINE.md +169 -0
  2. package/CLAUDE.md +518 -0
  3. package/LICENSE +21 -0
  4. package/README.md +36 -0
  5. package/ROADMAP.md +198 -0
  6. package/build.mjs +101 -0
  7. package/client/control.ts +247 -0
  8. package/client/hydrate.ts +37 -0
  9. package/client/index.ts +19 -0
  10. package/client/jsx-runtime.ts +209 -0
  11. package/client/resource.ts +122 -0
  12. package/client/signal.ts +211 -0
  13. package/client/store.ts +110 -0
  14. package/client/useHead.ts +63 -0
  15. package/dist/build/config.d.ts +3 -0
  16. package/dist/build/config.d.ts.map +1 -0
  17. package/dist/build/config.js +38 -0
  18. package/dist/build/config.js.map +7 -0
  19. package/dist/build/index.d.ts +2 -0
  20. package/dist/build/index.d.ts.map +1 -0
  21. package/dist/build/index.js +13 -0
  22. package/dist/build/index.js.map +7 -0
  23. package/dist/build/plugins.d.ts +7 -0
  24. package/dist/build/plugins.d.ts.map +1 -0
  25. package/dist/build/plugins.js +85 -0
  26. package/dist/build/plugins.js.map +7 -0
  27. package/dist/cli.d.ts +2 -0
  28. package/dist/cli.d.ts.map +1 -0
  29. package/dist/cli.js +427 -0
  30. package/dist/cli.js.map +7 -0
  31. package/dist/client/control.d.ts +49 -0
  32. package/dist/client/control.d.ts.map +1 -0
  33. package/dist/client/control.js +154 -0
  34. package/dist/client/control.js.map +7 -0
  35. package/dist/client/hydrate.d.ts +7 -0
  36. package/dist/client/hydrate.d.ts.map +1 -0
  37. package/dist/client/hydrate.js +23 -0
  38. package/dist/client/hydrate.js.map +7 -0
  39. package/dist/client/index.d.ts +12 -0
  40. package/dist/client/index.d.ts.map +1 -0
  41. package/dist/client/index.js +32 -0
  42. package/dist/client/index.js.map +7 -0
  43. package/dist/client/jsx-runtime.d.ts +40 -0
  44. package/dist/client/jsx-runtime.d.ts.map +1 -0
  45. package/dist/client/jsx-runtime.js +139 -0
  46. package/dist/client/jsx-runtime.js.map +7 -0
  47. package/dist/client/resource.d.ts +31 -0
  48. package/dist/client/resource.d.ts.map +1 -0
  49. package/dist/client/resource.js +64 -0
  50. package/dist/client/resource.js.map +7 -0
  51. package/dist/client/signal.d.ts +90 -0
  52. package/dist/client/signal.d.ts.map +1 -0
  53. package/dist/client/signal.js +115 -0
  54. package/dist/client/signal.js.map +7 -0
  55. package/dist/client/store.d.ts +26 -0
  56. package/dist/client/store.d.ts.map +1 -0
  57. package/dist/client/store.js +63 -0
  58. package/dist/client/store.js.map +7 -0
  59. package/dist/client/useHead.d.ts +28 -0
  60. package/dist/client/useHead.d.ts.map +1 -0
  61. package/dist/client/useHead.js +33 -0
  62. package/dist/client/useHead.js.map +7 -0
  63. package/dist/config.d.ts +182 -0
  64. package/dist/config.d.ts.map +1 -0
  65. package/dist/config.js +21 -0
  66. package/dist/config.js.map +7 -0
  67. package/dist/create-multisite.d.ts +2 -0
  68. package/dist/create-multisite.d.ts.map +1 -0
  69. package/dist/create-multisite.js +291 -0
  70. package/dist/create-multisite.js.map +7 -0
  71. package/dist/create.d.ts +2 -0
  72. package/dist/create.d.ts.map +1 -0
  73. package/dist/create.js +179 -0
  74. package/dist/create.js.map +7 -0
  75. package/dist/dev/blueprints.d.ts +11 -0
  76. package/dist/dev/blueprints.d.ts.map +1 -0
  77. package/dist/dev/blueprints.js +65 -0
  78. package/dist/dev/blueprints.js.map +7 -0
  79. package/dist/dev/components.d.ts +19 -0
  80. package/dist/dev/components.d.ts.map +1 -0
  81. package/dist/dev/components.js +87 -0
  82. package/dist/dev/components.js.map +7 -0
  83. package/dist/dev/insert.d.ts +11 -0
  84. package/dist/dev/insert.d.ts.map +1 -0
  85. package/dist/dev/insert.js +160 -0
  86. package/dist/dev/insert.js.map +7 -0
  87. package/dist/dev/remove.d.ts +53 -0
  88. package/dist/dev/remove.d.ts.map +1 -0
  89. package/dist/dev/remove.js +518 -0
  90. package/dist/dev/remove.js.map +7 -0
  91. package/dist/dev/watch.d.ts +26 -0
  92. package/dist/dev/watch.d.ts.map +1 -0
  93. package/dist/dev/watch.js +2905 -0
  94. package/dist/dev/watch.js.map +7 -0
  95. package/dist/errors.d.ts +6 -0
  96. package/dist/errors.d.ts.map +1 -0
  97. package/dist/errors.js +63 -0
  98. package/dist/errors.js.map +7 -0
  99. package/dist/generate.d.ts +2 -0
  100. package/dist/generate.d.ts.map +1 -0
  101. package/dist/generate.js +191 -0
  102. package/dist/generate.js.map +7 -0
  103. package/dist/index.d.ts +9 -0
  104. package/dist/index.d.ts.map +1 -0
  105. package/dist/index.js +57 -0
  106. package/dist/index.js.map +7 -0
  107. package/dist/island.d.ts +24 -0
  108. package/dist/island.d.ts.map +1 -0
  109. package/dist/island.js +15 -0
  110. package/dist/island.js.map +7 -0
  111. package/dist/jsx-runtime.d.ts +406 -0
  112. package/dist/jsx-runtime.d.ts.map +1 -0
  113. package/dist/jsx-runtime.js +90 -0
  114. package/dist/jsx-runtime.js.map +7 -0
  115. package/dist/link.d.ts +27 -0
  116. package/dist/link.d.ts.map +1 -0
  117. package/dist/link.js +29 -0
  118. package/dist/link.js.map +7 -0
  119. package/dist/oml/fragment.d.ts +16 -0
  120. package/dist/oml/fragment.d.ts.map +1 -0
  121. package/dist/oml/fragment.js +26 -0
  122. package/dist/oml/fragment.js.map +7 -0
  123. package/dist/oml/index.d.ts +11 -0
  124. package/dist/oml/index.d.ts.map +1 -0
  125. package/dist/oml/index.js +21 -0
  126. package/dist/oml/index.js.map +7 -0
  127. package/dist/oml/jsx-runtime.d.ts +34 -0
  128. package/dist/oml/jsx-runtime.d.ts.map +1 -0
  129. package/dist/oml/jsx-runtime.js +59 -0
  130. package/dist/oml/jsx-runtime.js.map +7 -0
  131. package/dist/oml/jsx.d.ts +14 -0
  132. package/dist/oml/jsx.d.ts.map +1 -0
  133. package/dist/oml/jsx.js +96 -0
  134. package/dist/oml/jsx.js.map +7 -0
  135. package/dist/oml/page.d.ts +7 -0
  136. package/dist/oml/page.d.ts.map +1 -0
  137. package/dist/oml/page.js +6 -0
  138. package/dist/oml/page.js.map +7 -0
  139. package/dist/oml/render.d.ts +13 -0
  140. package/dist/oml/render.d.ts.map +1 -0
  141. package/dist/oml/render.js +117 -0
  142. package/dist/oml/render.js.map +7 -0
  143. package/dist/oml/types.d.ts +79 -0
  144. package/dist/oml/types.d.ts.map +1 -0
  145. package/dist/oml/types.js +64 -0
  146. package/dist/oml/types.js.map +7 -0
  147. package/dist/router/handler.d.ts +53 -0
  148. package/dist/router/handler.d.ts.map +1 -0
  149. package/dist/router/handler.js +342 -0
  150. package/dist/router/handler.js.map +7 -0
  151. package/dist/router/matcher.d.ts +21 -0
  152. package/dist/router/matcher.d.ts.map +1 -0
  153. package/dist/router/matcher.js +28 -0
  154. package/dist/router/matcher.js.map +7 -0
  155. package/dist/router/scanner.d.ts +17 -0
  156. package/dist/router/scanner.d.ts.map +1 -0
  157. package/dist/router/scanner.js +197 -0
  158. package/dist/router/scanner.js.map +7 -0
  159. package/dist/server/index.d.ts +23 -0
  160. package/dist/server/index.d.ts.map +1 -0
  161. package/dist/server/index.js +29 -0
  162. package/dist/server/index.js.map +7 -0
  163. package/dist/signal.d.ts +15 -0
  164. package/dist/signal.d.ts.map +1 -0
  165. package/dist/signal.js +29 -0
  166. package/dist/signal.js.map +7 -0
  167. package/dist/ssg.d.ts +45 -0
  168. package/dist/ssg.d.ts.map +1 -0
  169. package/dist/ssg.js +175 -0
  170. package/dist/ssg.js.map +7 -0
  171. package/dist/test/actions.test.d.ts +2 -0
  172. package/dist/test/actions.test.d.ts.map +1 -0
  173. package/dist/test/body-limits.test.d.ts +2 -0
  174. package/dist/test/body-limits.test.d.ts.map +1 -0
  175. package/dist/test/errors.test.d.ts +2 -0
  176. package/dist/test/errors.test.d.ts.map +1 -0
  177. package/dist/test/fixtures/routes/[id].page.d.ts +4 -0
  178. package/dist/test/fixtures/routes/[id].page.d.ts.map +1 -0
  179. package/dist/test/fixtures/routes/_error.d.ts +3 -0
  180. package/dist/test/fixtures/routes/_error.d.ts.map +1 -0
  181. package/dist/test/fixtures/routes/_global.d.ts +3 -0
  182. package/dist/test/fixtures/routes/_global.d.ts.map +1 -0
  183. package/dist/test/fixtures/routes/_layout-template.d.ts +3 -0
  184. package/dist/test/fixtures/routes/_layout-template.d.ts.map +1 -0
  185. package/dist/test/fixtures/routes/_layout.d.ts +3 -0
  186. package/dist/test/fixtures/routes/_layout.d.ts.map +1 -0
  187. package/dist/test/fixtures/routes/_layout_scripts.d.ts +3 -0
  188. package/dist/test/fixtures/routes/_layout_scripts.d.ts.map +1 -0
  189. package/dist/test/fixtures/routes/_middleware.d.ts +3 -0
  190. package/dist/test/fixtures/routes/_middleware.d.ts.map +1 -0
  191. package/dist/test/fixtures/routes/_redirect301_mw.d.ts +3 -0
  192. package/dist/test/fixtures/routes/_redirect301_mw.d.ts.map +1 -0
  193. package/dist/test/fixtures/routes/_redirect_mw.d.ts +3 -0
  194. package/dist/test/fixtures/routes/_redirect_mw.d.ts.map +1 -0
  195. package/dist/test/fixtures/routes/about.page.d.ts +3 -0
  196. package/dist/test/fixtures/routes/about.page.d.ts.map +1 -0
  197. package/dist/test/fixtures/routes/action.page.d.ts +6 -0
  198. package/dist/test/fixtures/routes/action.page.d.ts.map +1 -0
  199. package/dist/test/fixtures/routes/api/form-all.post.d.ts +3 -0
  200. package/dist/test/fixtures/routes/api/form-all.post.d.ts.map +1 -0
  201. package/dist/test/fixtures/routes/api/form-limited.post.d.ts +6 -0
  202. package/dist/test/fixtures/routes/api/form-limited.post.d.ts.map +1 -0
  203. package/dist/test/fixtures/routes/api/response-obj.get.d.ts +3 -0
  204. package/dist/test/fixtures/routes/api/response-obj.get.d.ts.map +1 -0
  205. package/dist/test/fixtures/routes/api/upload.post.d.ts +12 -0
  206. package/dist/test/fixtures/routes/api/upload.post.d.ts.map +1 -0
  207. package/dist/test/fixtures/routes/api/users.get.d.ts +6 -0
  208. package/dist/test/fixtures/routes/api/users.get.d.ts.map +1 -0
  209. package/dist/test/fixtures/routes/api/xml.get.d.ts +3 -0
  210. package/dist/test/fixtures/routes/api/xml.get.d.ts.map +1 -0
  211. package/dist/test/fixtures/routes/auth/_middleware.d.ts +3 -0
  212. package/dist/test/fixtures/routes/auth/_middleware.d.ts.map +1 -0
  213. package/dist/test/fixtures/routes/auth/protected.page.d.ts +3 -0
  214. package/dist/test/fixtures/routes/auth/protected.page.d.ts.map +1 -0
  215. package/dist/test/fixtures/routes/index.page.d.ts +3 -0
  216. package/dist/test/fixtures/routes/index.page.d.ts.map +1 -0
  217. package/dist/test/fixtures/routes/oml.page.d.ts +3 -0
  218. package/dist/test/fixtures/routes/oml.page.d.ts.map +1 -0
  219. package/dist/test/fixtures/routes/redirect.page.d.ts +3 -0
  220. package/dist/test/fixtures/routes/redirect.page.d.ts.map +1 -0
  221. package/dist/test/fixtures/routes/ssg/[slug].page.d.ts +5 -0
  222. package/dist/test/fixtures/routes/ssg/[slug].page.d.ts.map +1 -0
  223. package/dist/test/fixtures/routes/ssg/server.page.d.ts +4 -0
  224. package/dist/test/fixtures/routes/ssg/server.page.d.ts.map +1 -0
  225. package/dist/test/fixtures/routes/state.page.d.ts +3 -0
  226. package/dist/test/fixtures/routes/state.page.d.ts.map +1 -0
  227. package/dist/test/fixtures/routes/throw.page.d.ts +3 -0
  228. package/dist/test/fixtures/routes/throw.page.d.ts.map +1 -0
  229. package/dist/test/fixtures/routes/wiki/[...slug].page.d.ts +3 -0
  230. package/dist/test/fixtures/routes/wiki/[...slug].page.d.ts.map +1 -0
  231. package/dist/test/helpers.d.ts +37 -0
  232. package/dist/test/helpers.d.ts.map +1 -0
  233. package/dist/test/layouts.test.d.ts +2 -0
  234. package/dist/test/layouts.test.d.ts.map +1 -0
  235. package/dist/test/middleware.test.d.ts +2 -0
  236. package/dist/test/middleware.test.d.ts.map +1 -0
  237. package/dist/test/multipart.test.d.ts +2 -0
  238. package/dist/test/multipart.test.d.ts.map +1 -0
  239. package/dist/test/oml-routing.test.d.ts +2 -0
  240. package/dist/test/oml-routing.test.d.ts.map +1 -0
  241. package/dist/test/oml.test.d.ts +2 -0
  242. package/dist/test/oml.test.d.ts.map +1 -0
  243. package/dist/test/redirects.test.d.ts +2 -0
  244. package/dist/test/redirects.test.d.ts.map +1 -0
  245. package/dist/test/routing.test.d.ts +2 -0
  246. package/dist/test/routing.test.d.ts.map +1 -0
  247. package/dist/test/ssg.test.d.ts +2 -0
  248. package/dist/test/ssg.test.d.ts.map +1 -0
  249. package/dist/test/web-response.test.d.ts +2 -0
  250. package/dist/test/web-response.test.d.ts.map +1 -0
  251. package/dist/types.d.ts +314 -0
  252. package/dist/types.d.ts.map +1 -0
  253. package/dist/types.js +292 -0
  254. package/dist/types.js.map +7 -0
  255. package/package.json +103 -0
  256. package/pka.config.json +32 -0
  257. package/src/build/config.ts +42 -0
  258. package/src/build/index.ts +6 -0
  259. package/src/build/plugins.ts +118 -0
  260. package/src/cli.ts +502 -0
  261. package/src/config.ts +197 -0
  262. package/src/create-multisite.ts +310 -0
  263. package/src/create.ts +194 -0
  264. package/src/dev/blueprints.ts +75 -0
  265. package/src/dev/components.ts +108 -0
  266. package/src/dev/insert.ts +221 -0
  267. package/src/dev/remove.ts +677 -0
  268. package/src/dev/watch.ts +3098 -0
  269. package/src/env.d.ts +5 -0
  270. package/src/errors.ts +64 -0
  271. package/src/generate.ts +228 -0
  272. package/src/index.ts +67 -0
  273. package/src/island.ts +47 -0
  274. package/src/jsx-runtime.d.ts +408 -0
  275. package/src/jsx-runtime.d.ts.map +1 -0
  276. package/src/jsx-runtime.ts +536 -0
  277. package/src/link.ts +49 -0
  278. package/src/oml/fragment.ts +54 -0
  279. package/src/oml/index.ts +21 -0
  280. package/src/oml/jsx-runtime.ts +121 -0
  281. package/src/oml/jsx.ts +151 -0
  282. package/src/oml/page.ts +13 -0
  283. package/src/oml/render.ts +181 -0
  284. package/src/oml/types.ts +159 -0
  285. package/src/router/handler.ts +515 -0
  286. package/src/router/matcher.ts +52 -0
  287. package/src/router/scanner.ts +272 -0
  288. package/src/server/index.ts +49 -0
  289. package/src/signal.ts +39 -0
  290. package/src/ssg.ts +253 -0
  291. package/src/test/actions.test.ts +40 -0
  292. package/src/test/body-limits.test.ts +83 -0
  293. package/src/test/errors.test.ts +53 -0
  294. package/src/test/fixtures/routes/[id].page.ts +3 -0
  295. package/src/test/fixtures/routes/_error.ts +6 -0
  296. package/src/test/fixtures/routes/_global.ts +8 -0
  297. package/src/test/fixtures/routes/_layout-template.ts +7 -0
  298. package/src/test/fixtures/routes/_layout.ts +7 -0
  299. package/src/test/fixtures/routes/_layout_scripts.ts +8 -0
  300. package/src/test/fixtures/routes/_middleware.ts +8 -0
  301. package/src/test/fixtures/routes/_redirect301_mw.ts +5 -0
  302. package/src/test/fixtures/routes/_redirect_mw.ts +5 -0
  303. package/src/test/fixtures/routes/about.page.ts +6 -0
  304. package/src/test/fixtures/routes/action.page.ts +11 -0
  305. package/src/test/fixtures/routes/api/form-all.post.ts +5 -0
  306. package/src/test/fixtures/routes/api/form-limited.post.ts +6 -0
  307. package/src/test/fixtures/routes/api/response-obj.get.ts +17 -0
  308. package/src/test/fixtures/routes/api/upload.post.ts +14 -0
  309. package/src/test/fixtures/routes/api/users.get.ts +3 -0
  310. package/src/test/fixtures/routes/api/xml.get.ts +5 -0
  311. package/src/test/fixtures/routes/auth/_middleware.ts +11 -0
  312. package/src/test/fixtures/routes/auth/protected.page.ts +3 -0
  313. package/src/test/fixtures/routes/index.page.ts +3 -0
  314. package/src/test/fixtures/routes/oml.page.ts +7 -0
  315. package/src/test/fixtures/routes/redirect.page.ts +3 -0
  316. package/src/test/fixtures/routes/ssg/[slug].page.ts +8 -0
  317. package/src/test/fixtures/routes/ssg/server.page.ts +5 -0
  318. package/src/test/fixtures/routes/state.page.ts +4 -0
  319. package/src/test/fixtures/routes/throw.page.ts +5 -0
  320. package/src/test/fixtures/routes/wiki/[...slug].page.ts +3 -0
  321. package/src/test/helpers.ts +132 -0
  322. package/src/test/layouts.test.ts +76 -0
  323. package/src/test/middleware.test.ts +69 -0
  324. package/src/test/multipart.test.ts +91 -0
  325. package/src/test/oml-routing.test.ts +59 -0
  326. package/src/test/oml.test.ts +429 -0
  327. package/src/test/redirects.test.ts +32 -0
  328. package/src/test/routing.test.ts +118 -0
  329. package/src/test/ssg.test.ts +273 -0
  330. package/src/test/web-response.test.ts +33 -0
  331. package/src/types.ts +670 -0
  332. package/tsconfig.client.json +17 -0
  333. package/tsconfig.json +20 -0
@@ -0,0 +1,90 @@
1
+ type Subscriber = () => void;
2
+ type Cleanup = (() => void) | void;
3
+ export type Signal<T> = [get: () => T, set: (value: T) => void];
4
+ export type ReadonlySignal<T> = () => T;
5
+ /**
6
+ * Create a reactive signal — a getter/setter pair.
7
+ * Reading the getter inside an effect or reactive JSX child subscribes that
8
+ * context to future updates; calling the setter notifies all subscribers.
9
+ *
10
+ * @example
11
+ * const [count, setCount] = createSignal(0)
12
+ * count() // read: 0
13
+ * setCount(1) // write
14
+ * setCount(n => n + 1) // updater function
15
+ */
16
+ export declare function createSignal<T>(initialValue: T): Signal<T>;
17
+ /**
18
+ * Run a side effect immediately and re-run it whenever its reactive
19
+ * dependencies change. The effect automatically tracks which signals are
20
+ * read during execution and subscribes to each of them.
21
+ *
22
+ * Return a cleanup function (or nothing) — it runs before the next execution
23
+ * and when the enclosing scope is disposed.
24
+ *
25
+ * @example
26
+ * createEffect(() => {
27
+ * document.title = name() // re-runs whenever `name` changes
28
+ * })
29
+ */
30
+ export declare function createEffect(fn: () => Cleanup): void;
31
+ /**
32
+ * Create a memoized derived value. Recomputes only when its reactive
33
+ * dependencies change; all readers share the same cached result.
34
+ *
35
+ * @example
36
+ * const fullName = createMemo(() => `${firstName()} ${lastName()}`)
37
+ * <h1>{() => fullName()}</h1>
38
+ */
39
+ export declare function createMemo<T>(fn: () => T): ReadonlySignal<T>;
40
+ /**
41
+ * Register a teardown tied to the current reactive scope.
42
+ * Called before the enclosing effect re-runs, or when the root is disposed.
43
+ * No-op if called outside any reactive scope.
44
+ *
45
+ * @example
46
+ * createEffect(() => {
47
+ * const id = setInterval(tick, 1000)
48
+ * onCleanup(() => clearInterval(id))
49
+ * })
50
+ */
51
+ export declare function onCleanup(fn: () => void): void;
52
+ /**
53
+ * Create a reactive scope with an explicit lifetime. The `dispose` function
54
+ * tears down all effects and cleanups registered within the scope.
55
+ * Useful for managing reactive state outside the normal component lifecycle.
56
+ *
57
+ * @example
58
+ * const dispose = createRoot((d) => {
59
+ * createEffect(() => console.log(count()))
60
+ * return d
61
+ * })
62
+ * dispose() // tear everything down
63
+ */
64
+ export declare function createRoot<T>(fn: (dispose: () => void) => T): T;
65
+ /**
66
+ * Read signals inside `fn` without registering reactive dependencies.
67
+ * The enclosing effect will not re-run when those signals change.
68
+ *
69
+ * @example
70
+ * createEffect(() => {
71
+ * const a = a() // tracked — effect re-runs when `a` changes
72
+ * const b = untrack(() => b()) // not tracked
73
+ * })
74
+ */
75
+ export declare function untrack<T>(fn: () => T): T;
76
+ /**
77
+ * Batch multiple signal writes into a single downstream notification pass.
78
+ * Without batching, each setter triggers its own update cycle.
79
+ *
80
+ * @example
81
+ * batch(() => {
82
+ * setX(1)
83
+ * setY(2) // effects that read both x and y run once, not twice
84
+ * })
85
+ */
86
+ export declare function batch<T>(fn: () => T): T;
87
+ export declare function trackRead(subs: Set<Subscriber>): void;
88
+ export declare function notifySubs(subs: Set<Subscriber>): void;
89
+ export {};
90
+ //# sourceMappingURL=signal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signal.d.ts","sourceRoot":"","sources":["../../client/signal.ts"],"names":[],"mappings":"AAGA,KAAK,UAAU,GAAG,MAAM,IAAI,CAAA;AAE5B,KAAK,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAA;AAOlC,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAAA;AAC/D,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,MAAM,CAAC,CAAA;AAEvC;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAoB1D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,OAAO,GAAG,IAAI,CAgCpD;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAM5D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI,CAE9C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAa/D;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAQzC;AAED;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAYvC;AAKD,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,GAAG,IAAI,CAErD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,GAAG,IAAI,CAMtD"}
@@ -0,0 +1,115 @@
1
+ let currentSubscriber = null;
2
+ let currentCleanups = null;
3
+ let batchDepth = 0;
4
+ const pendingEffects = /* @__PURE__ */ new Set();
5
+ function createSignal(initialValue) {
6
+ let value = initialValue;
7
+ const subscribers = /* @__PURE__ */ new Set();
8
+ const get = () => {
9
+ if (currentSubscriber) subscribers.add(currentSubscriber);
10
+ return value;
11
+ };
12
+ const set = (next) => {
13
+ if (Object.is(value, next)) return;
14
+ value = next;
15
+ if (batchDepth > 0) {
16
+ for (const sub of subscribers) pendingEffects.add(sub);
17
+ } else {
18
+ for (const sub of [...subscribers]) sub();
19
+ }
20
+ };
21
+ return [get, set];
22
+ }
23
+ function createEffect(fn) {
24
+ const state = { cleanups: [] };
25
+ if (currentCleanups) {
26
+ currentCleanups.push(() => {
27
+ for (const c of state.cleanups) c();
28
+ state.cleanups = [];
29
+ });
30
+ }
31
+ const run = () => {
32
+ for (const c of state.cleanups) c();
33
+ state.cleanups = [];
34
+ const prev = currentSubscriber;
35
+ const prevCleanups = currentCleanups;
36
+ currentSubscriber = run;
37
+ currentCleanups = state.cleanups;
38
+ try {
39
+ const cleanup = fn();
40
+ if (cleanup) state.cleanups.push(cleanup);
41
+ } finally {
42
+ currentSubscriber = prev;
43
+ currentCleanups = prevCleanups;
44
+ }
45
+ };
46
+ run();
47
+ }
48
+ function createMemo(fn) {
49
+ const [get, set] = createSignal(void 0);
50
+ createEffect(() => {
51
+ set(fn());
52
+ });
53
+ return get;
54
+ }
55
+ function onCleanup(fn) {
56
+ currentCleanups?.push(fn);
57
+ }
58
+ function createRoot(fn) {
59
+ const cleanups = [];
60
+ const dispose = () => {
61
+ for (const c of cleanups) c();
62
+ cleanups.length = 0;
63
+ };
64
+ const prev = currentCleanups;
65
+ currentCleanups = cleanups;
66
+ try {
67
+ return fn(dispose);
68
+ } finally {
69
+ currentCleanups = prev;
70
+ }
71
+ }
72
+ function untrack(fn) {
73
+ const prev = currentSubscriber;
74
+ currentSubscriber = null;
75
+ try {
76
+ return fn();
77
+ } finally {
78
+ currentSubscriber = prev;
79
+ }
80
+ }
81
+ function batch(fn) {
82
+ batchDepth++;
83
+ try {
84
+ return fn();
85
+ } finally {
86
+ batchDepth--;
87
+ if (batchDepth === 0) {
88
+ const toRun = [...pendingEffects];
89
+ pendingEffects.clear();
90
+ for (const sub of toRun) sub();
91
+ }
92
+ }
93
+ }
94
+ function trackRead(subs) {
95
+ if (currentSubscriber) subs.add(currentSubscriber);
96
+ }
97
+ function notifySubs(subs) {
98
+ if (batchDepth > 0) {
99
+ for (const sub of subs) pendingEffects.add(sub);
100
+ } else {
101
+ for (const sub of [...subs]) sub();
102
+ }
103
+ }
104
+ export {
105
+ batch,
106
+ createEffect,
107
+ createMemo,
108
+ createRoot,
109
+ createSignal,
110
+ notifySubs,
111
+ onCleanup,
112
+ trackRead,
113
+ untrack
114
+ };
115
+ //# sourceMappingURL=signal.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../client/signal.ts"],
4
+ "sourcesContent": ["// Fine-grained reactivity for browser islands.\n// Signal changes update only the DOM nodes that read them \u2014 no VDOM diffing.\n\ntype Subscriber = () => void\n// biome-ignore lint/suspicious/noConfusingVoidType: void in this union is intentional \u2014 it lets createEffect accept functions that return nothing without an explicit `undefined` return\ntype Cleanup = (() => void) | void\n\nlet currentSubscriber: Subscriber | null = null\nlet currentCleanups: (() => void)[] | null = null\nlet batchDepth = 0\nconst pendingEffects = new Set<Subscriber>()\n\nexport type Signal<T> = [get: () => T, set: (value: T) => void]\nexport type ReadonlySignal<T> = () => T\n\n/**\n * Create a reactive signal \u2014 a getter/setter pair.\n * Reading the getter inside an effect or reactive JSX child subscribes that\n * context to future updates; calling the setter notifies all subscribers.\n *\n * @example\n * const [count, setCount] = createSignal(0)\n * count() // read: 0\n * setCount(1) // write\n * setCount(n => n + 1) // updater function\n */\nexport function createSignal<T>(initialValue: T): Signal<T> {\n let value = initialValue\n const subscribers = new Set<Subscriber>()\n\n const get = (): T => {\n if (currentSubscriber) subscribers.add(currentSubscriber)\n return value\n }\n\n const set = (next: T): void => {\n if (Object.is(value, next)) return\n value = next\n if (batchDepth > 0) {\n for (const sub of subscribers) pendingEffects.add(sub)\n } else {\n for (const sub of [...subscribers]) sub()\n }\n }\n\n return [get, set]\n}\n\n/**\n * Run a side effect immediately and re-run it whenever its reactive\n * dependencies change. The effect automatically tracks which signals are\n * read during execution and subscribes to each of them.\n *\n * Return a cleanup function (or nothing) \u2014 it runs before the next execution\n * and when the enclosing scope is disposed.\n *\n * @example\n * createEffect(() => {\n * document.title = name() // re-runs whenever `name` changes\n * })\n */\nexport function createEffect(fn: () => Cleanup): void {\n // Use an object wrapper so the parent-scope disposal closure always reads\n // the current cleanups array, not a stale reference from an earlier run.\n const state = { cleanups: [] as (() => void)[] }\n\n // If created inside a parent scope (createRoot or another createEffect),\n // register disposal so this effect's cleanups run when the parent disposes.\n if (currentCleanups) {\n currentCleanups.push(() => {\n for (const c of state.cleanups) c()\n state.cleanups = []\n })\n }\n\n const run: Subscriber = () => {\n for (const c of state.cleanups) c()\n state.cleanups = []\n\n const prev = currentSubscriber\n const prevCleanups = currentCleanups\n currentSubscriber = run\n currentCleanups = state.cleanups\n try {\n const cleanup = fn()\n if (cleanup) state.cleanups.push(cleanup)\n } finally {\n currentSubscriber = prev\n currentCleanups = prevCleanups\n }\n }\n\n run()\n}\n\n/**\n * Create a memoized derived value. Recomputes only when its reactive\n * dependencies change; all readers share the same cached result.\n *\n * @example\n * const fullName = createMemo(() => `${firstName()} ${lastName()}`)\n * <h1>{() => fullName()}</h1>\n */\nexport function createMemo<T>(fn: () => T): ReadonlySignal<T> {\n const [get, set] = createSignal<T>(undefined as T)\n createEffect(() => {\n set(fn())\n })\n return get\n}\n\n/**\n * Register a teardown tied to the current reactive scope.\n * Called before the enclosing effect re-runs, or when the root is disposed.\n * No-op if called outside any reactive scope.\n *\n * @example\n * createEffect(() => {\n * const id = setInterval(tick, 1000)\n * onCleanup(() => clearInterval(id))\n * })\n */\nexport function onCleanup(fn: () => void): void {\n currentCleanups?.push(fn)\n}\n\n/**\n * Create a reactive scope with an explicit lifetime. The `dispose` function\n * tears down all effects and cleanups registered within the scope.\n * Useful for managing reactive state outside the normal component lifecycle.\n *\n * @example\n * const dispose = createRoot((d) => {\n * createEffect(() => console.log(count()))\n * return d\n * })\n * dispose() // tear everything down\n */\nexport function createRoot<T>(fn: (dispose: () => void) => T): T {\n const cleanups: (() => void)[] = []\n const dispose = (): void => {\n for (const c of cleanups) c()\n cleanups.length = 0\n }\n const prev = currentCleanups\n currentCleanups = cleanups\n try {\n return fn(dispose)\n } finally {\n currentCleanups = prev\n }\n}\n\n/**\n * Read signals inside `fn` without registering reactive dependencies.\n * The enclosing effect will not re-run when those signals change.\n *\n * @example\n * createEffect(() => {\n * const a = a() // tracked \u2014 effect re-runs when `a` changes\n * const b = untrack(() => b()) // not tracked\n * })\n */\nexport function untrack<T>(fn: () => T): T {\n const prev = currentSubscriber\n currentSubscriber = null\n try {\n return fn()\n } finally {\n currentSubscriber = prev\n }\n}\n\n/**\n * Batch multiple signal writes into a single downstream notification pass.\n * Without batching, each setter triggers its own update cycle.\n *\n * @example\n * batch(() => {\n * setX(1)\n * setY(2) // effects that read both x and y run once, not twice\n * })\n */\nexport function batch<T>(fn: () => T): T {\n batchDepth++\n try {\n return fn()\n } finally {\n batchDepth--\n if (batchDepth === 0) {\n const toRun = [...pendingEffects]\n pendingEffects.clear()\n for (const sub of toRun) sub()\n }\n }\n}\n\n// \u2500\u2500\u2500 Store integration hooks \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Used by store.ts to participate in the same subscriber graph and batching.\n\nexport function trackRead(subs: Set<Subscriber>): void {\n if (currentSubscriber) subs.add(currentSubscriber)\n}\n\nexport function notifySubs(subs: Set<Subscriber>): void {\n if (batchDepth > 0) {\n for (const sub of subs) pendingEffects.add(sub)\n } else {\n for (const sub of [...subs]) sub()\n }\n}\n"],
5
+ "mappings": "AAOA,IAAI,oBAAuC;AAC3C,IAAI,kBAAyC;AAC7C,IAAI,aAAa;AACjB,MAAM,iBAAiB,oBAAI,IAAgB;AAgBpC,SAAS,aAAgB,cAA4B;AAC1D,MAAI,QAAQ;AACZ,QAAM,cAAc,oBAAI,IAAgB;AAExC,QAAM,MAAM,MAAS;AACnB,QAAI,kBAAmB,aAAY,IAAI,iBAAiB;AACxD,WAAO;AAAA,EACT;AAEA,QAAM,MAAM,CAAC,SAAkB;AAC7B,QAAI,OAAO,GAAG,OAAO,IAAI,EAAG;AAC5B,YAAQ;AACR,QAAI,aAAa,GAAG;AAClB,iBAAW,OAAO,YAAa,gBAAe,IAAI,GAAG;AAAA,IACvD,OAAO;AACL,iBAAW,OAAO,CAAC,GAAG,WAAW,EAAG,KAAI;AAAA,IAC1C;AAAA,EACF;AAEA,SAAO,CAAC,KAAK,GAAG;AAClB;AAeO,SAAS,aAAa,IAAyB;AAGpD,QAAM,QAAQ,EAAE,UAAU,CAAC,EAAoB;AAI/C,MAAI,iBAAiB;AACnB,oBAAgB,KAAK,MAAM;AACzB,iBAAW,KAAK,MAAM,SAAU,GAAE;AAClC,YAAM,WAAW,CAAC;AAAA,IACpB,CAAC;AAAA,EACH;AAEA,QAAM,MAAkB,MAAM;AAC5B,eAAW,KAAK,MAAM,SAAU,GAAE;AAClC,UAAM,WAAW,CAAC;AAElB,UAAM,OAAO;AACb,UAAM,eAAe;AACrB,wBAAoB;AACpB,sBAAkB,MAAM;AACxB,QAAI;AACF,YAAM,UAAU,GAAG;AACnB,UAAI,QAAS,OAAM,SAAS,KAAK,OAAO;AAAA,IAC1C,UAAE;AACA,0BAAoB;AACpB,wBAAkB;AAAA,IACpB;AAAA,EACF;AAEA,MAAI;AACN;AAUO,SAAS,WAAc,IAAgC;AAC5D,QAAM,CAAC,KAAK,GAAG,IAAI,aAAgB,MAAc;AACjD,eAAa,MAAM;AACjB,QAAI,GAAG,CAAC;AAAA,EACV,CAAC;AACD,SAAO;AACT;AAaO,SAAS,UAAU,IAAsB;AAC9C,mBAAiB,KAAK,EAAE;AAC1B;AAcO,SAAS,WAAc,IAAmC;AAC/D,QAAM,WAA2B,CAAC;AAClC,QAAM,UAAU,MAAY;AAC1B,eAAW,KAAK,SAAU,GAAE;AAC5B,aAAS,SAAS;AAAA,EACpB;AACA,QAAM,OAAO;AACb,oBAAkB;AAClB,MAAI;AACF,WAAO,GAAG,OAAO;AAAA,EACnB,UAAE;AACA,sBAAkB;AAAA,EACpB;AACF;AAYO,SAAS,QAAW,IAAgB;AACzC,QAAM,OAAO;AACb,sBAAoB;AACpB,MAAI;AACF,WAAO,GAAG;AAAA,EACZ,UAAE;AACA,wBAAoB;AAAA,EACtB;AACF;AAYO,SAAS,MAAS,IAAgB;AACvC;AACA,MAAI;AACF,WAAO,GAAG;AAAA,EACZ,UAAE;AACA;AACA,QAAI,eAAe,GAAG;AACpB,YAAM,QAAQ,CAAC,GAAG,cAAc;AAChC,qBAAe,MAAM;AACrB,iBAAW,OAAO,MAAO,KAAI;AAAA,IAC/B;AAAA,EACF;AACF;AAKO,SAAS,UAAU,MAA6B;AACrD,MAAI,kBAAmB,MAAK,IAAI,iBAAiB;AACnD;AAEO,SAAS,WAAW,MAA6B;AACtD,MAAI,aAAa,GAAG;AAClB,eAAW,OAAO,KAAM,gBAAe,IAAI,GAAG;AAAA,EAChD,OAAO;AACL,eAAW,OAAO,CAAC,GAAG,IAAI,EAAG,KAAI;AAAA,EACnC;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,26 @@
1
+ /** A value or a function that receives the previous value and returns the next. */
2
+ export type Updater<T> = T | ((prev: T) => T);
3
+ /** Typed path-based setter for a store. Supports 1–3 level deep key paths;
4
+ * deeper paths fall through to an untyped escape hatch. */
5
+ export interface SetStoreFn<T extends object> {
6
+ <K extends keyof T>(k: K, v: Updater<T[K]>): void;
7
+ <K1 extends keyof T, K2 extends keyof NonNullable<T[K1]>>(k1: K1, k2: K2, v: Updater<NonNullable<T[K1]>[K2]>): void;
8
+ <K1 extends keyof T, K2 extends keyof NonNullable<T[K1]>, K3 extends keyof NonNullable<NonNullable<T[K1]>[K2]>>(k1: K1, k2: K2, k3: K3, v: Updater<NonNullable<NonNullable<T[K1]>[K2]>[K3]>): void;
9
+ (...args: unknown[]): void;
10
+ }
11
+ /**
12
+ * Create a reactive store for shared inter-island state. Returns a
13
+ * `[store, setStore]` pair. `store` is a deeply reactive readonly proxy —
14
+ * reads inside effects and JSX are tracked at individual property granularity,
15
+ * so only the effects that read a changed key re-run.
16
+ *
17
+ * Use `setStore` with dot-path key segments; functional updaters are supported
18
+ * at every level. Arrays must be updated via functional updaters (not `.push()`).
19
+ *
20
+ * @example
21
+ * const [cart, setCart] = createStore({ items: [] as Item[], total: 0 })
22
+ * setCart('items', items => [...items, newItem])
23
+ * setCart('total', t => t + newItem.price)
24
+ */
25
+ export declare function createStore<T extends object>(init: T): [store: T, setStore: SetStoreFn<T>];
26
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../client/store.ts"],"names":[],"mappings":"AA4DA,mFAAmF;AACnF,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;AAE7C;2DAC2D;AAC3D,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,MAAM;IAC1C,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;IACjD,CAAC,EAAE,SAAS,MAAM,CAAC,EAAE,EAAE,SAAS,MAAM,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EACtD,EAAE,EAAE,EAAE,EACN,EAAE,EAAE,EAAE,EACN,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GACjC,IAAI,CAAA;IACP,CACE,EAAE,SAAS,MAAM,CAAC,EAClB,EAAE,SAAS,MAAM,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EACnC,EAAE,SAAS,MAAM,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAEpD,EAAE,EAAE,EAAE,EACN,EAAE,EAAE,EAAE,EACN,EAAE,EAAE,EAAE,EACN,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAClD,IAAI,CAAA;IACP,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;CAC3B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAU1F"}
@@ -0,0 +1,63 @@
1
+ import { notifySubs, trackRead } from "./signal.js";
2
+ const nodeMap = /* @__PURE__ */ new WeakMap();
3
+ function getSubs(target, key) {
4
+ let keyMap = nodeMap.get(target);
5
+ if (!keyMap) {
6
+ keyMap = /* @__PURE__ */ new Map();
7
+ nodeMap.set(target, keyMap);
8
+ }
9
+ let s = keyMap.get(key);
10
+ if (!s) {
11
+ s = /* @__PURE__ */ new Set();
12
+ keyMap.set(key, s);
13
+ }
14
+ return s;
15
+ }
16
+ function wrap(raw) {
17
+ return new Proxy(raw, {
18
+ get(target, key, receiver) {
19
+ const val = Reflect.get(target, key, receiver);
20
+ if (typeof key === "string" && typeof val !== "function") {
21
+ trackRead(getSubs(target, key));
22
+ }
23
+ if (val !== null && typeof val === "object") return wrap(val);
24
+ return val;
25
+ },
26
+ set() {
27
+ throw new Error("[davaux] Store is read-only \u2014 use setStore() to update");
28
+ },
29
+ deleteProperty() {
30
+ throw new Error("[davaux] Store is read-only \u2014 use setStore() to update");
31
+ }
32
+ });
33
+ }
34
+ function setPath(raw, path, value) {
35
+ const [head, ...tail] = path;
36
+ const key = String(head);
37
+ if (tail.length === 0) {
38
+ const prev = raw[key];
39
+ const next = typeof value === "function" ? value(prev) : value;
40
+ if (Object.is(prev, next)) return;
41
+ raw[key] = next;
42
+ notifySubs(getSubs(raw, key));
43
+ } else {
44
+ const child = raw[key];
45
+ if (child === null || typeof child !== "object") {
46
+ throw new Error(`[davaux] setStore: "${key}" is not an object`);
47
+ }
48
+ setPath(child, tail, value);
49
+ }
50
+ }
51
+ function createStore(init) {
52
+ const raw = structuredClone(init);
53
+ const store = wrap(raw);
54
+ const setStore = (...args) => {
55
+ if (args.length < 2) throw new Error("[davaux] setStore requires a path and a value");
56
+ setPath(raw, args.slice(0, -1), args[args.length - 1]);
57
+ };
58
+ return [store, setStore];
59
+ }
60
+ export {
61
+ createStore
62
+ };
63
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../client/store.ts"],
4
+ "sourcesContent": ["import { notifySubs, trackRead } from './signal.js'\n\ntype PlainObj = Record<string | symbol, unknown>\ntype Subscriber = () => void\n\n// Per-property subscriber sets, keyed on the raw (unwrapped) target object.\nconst nodeMap = new WeakMap<object, Map<string | symbol, Set<Subscriber>>>()\n\nfunction getSubs(target: object, key: string | symbol): Set<Subscriber> {\n let keyMap = nodeMap.get(target)\n if (!keyMap) {\n keyMap = new Map()\n nodeMap.set(target, keyMap)\n }\n let s = keyMap.get(key)\n if (!s) {\n s = new Set()\n keyMap.set(key, s)\n }\n return s\n}\n\nfunction wrap<T extends object>(raw: T): T {\n return new Proxy(raw, {\n get(target, key, receiver) {\n const val = Reflect.get(target, key, receiver)\n // Only track string-keyed data reads (not Symbol builtins or methods)\n if (typeof key === 'string' && typeof val !== 'function') {\n trackRead(getSubs(target, key))\n }\n if (val !== null && typeof val === 'object') return wrap(val as object)\n return val\n },\n set() {\n throw new Error('[davaux] Store is read-only \u2014 use setStore() to update')\n },\n deleteProperty() {\n throw new Error('[davaux] Store is read-only \u2014 use setStore() to update')\n },\n })\n}\n\nfunction setPath(raw: PlainObj, path: (string | number)[], value: unknown): void {\n const [head, ...tail] = path\n const key = String(head)\n if (tail.length === 0) {\n const prev = raw[key]\n const next = typeof value === 'function' ? (value as (p: unknown) => unknown)(prev) : value\n if (Object.is(prev, next)) return\n raw[key] = next\n notifySubs(getSubs(raw, key))\n } else {\n const child = raw[key]\n if (child === null || typeof child !== 'object') {\n throw new Error(`[davaux] setStore: \"${key}\" is not an object`)\n }\n setPath(child as PlainObj, tail, value)\n }\n}\n\n/** A value or a function that receives the previous value and returns the next. */\nexport type Updater<T> = T | ((prev: T) => T)\n\n/** Typed path-based setter for a store. Supports 1\u20133 level deep key paths;\n * deeper paths fall through to an untyped escape hatch. */\nexport interface SetStoreFn<T extends object> {\n <K extends keyof T>(k: K, v: Updater<T[K]>): void\n <K1 extends keyof T, K2 extends keyof NonNullable<T[K1]>>(\n k1: K1,\n k2: K2,\n v: Updater<NonNullable<T[K1]>[K2]>,\n ): void\n <\n K1 extends keyof T,\n K2 extends keyof NonNullable<T[K1]>,\n K3 extends keyof NonNullable<NonNullable<T[K1]>[K2]>,\n >(\n k1: K1,\n k2: K2,\n k3: K3,\n v: Updater<NonNullable<NonNullable<T[K1]>[K2]>[K3]>,\n ): void\n (...args: unknown[]): void\n}\n\n/**\n * Create a reactive store for shared inter-island state. Returns a\n * `[store, setStore]` pair. `store` is a deeply reactive readonly proxy \u2014\n * reads inside effects and JSX are tracked at individual property granularity,\n * so only the effects that read a changed key re-run.\n *\n * Use `setStore` with dot-path key segments; functional updaters are supported\n * at every level. Arrays must be updated via functional updaters (not `.push()`).\n *\n * @example\n * const [cart, setCart] = createStore({ items: [] as Item[], total: 0 })\n * setCart('items', items => [...items, newItem])\n * setCart('total', t => t + newItem.price)\n */\nexport function createStore<T extends object>(init: T): [store: T, setStore: SetStoreFn<T>] {\n const raw = structuredClone(init) as PlainObj\n const store = wrap(raw) as T\n\n const setStore = (...args: unknown[]): void => {\n if (args.length < 2) throw new Error('[davaux] setStore requires a path and a value')\n setPath(raw, args.slice(0, -1) as (string | number)[], args[args.length - 1])\n }\n\n return [store, setStore as unknown as SetStoreFn<T>]\n}\n"],
5
+ "mappings": "AAAA,SAAS,YAAY,iBAAiB;AAMtC,MAAM,UAAU,oBAAI,QAAuD;AAE3E,SAAS,QAAQ,QAAgB,KAAuC;AACtE,MAAI,SAAS,QAAQ,IAAI,MAAM;AAC/B,MAAI,CAAC,QAAQ;AACX,aAAS,oBAAI,IAAI;AACjB,YAAQ,IAAI,QAAQ,MAAM;AAAA,EAC5B;AACA,MAAI,IAAI,OAAO,IAAI,GAAG;AACtB,MAAI,CAAC,GAAG;AACN,QAAI,oBAAI,IAAI;AACZ,WAAO,IAAI,KAAK,CAAC;AAAA,EACnB;AACA,SAAO;AACT;AAEA,SAAS,KAAuB,KAAW;AACzC,SAAO,IAAI,MAAM,KAAK;AAAA,IACpB,IAAI,QAAQ,KAAK,UAAU;AACzB,YAAM,MAAM,QAAQ,IAAI,QAAQ,KAAK,QAAQ;AAE7C,UAAI,OAAO,QAAQ,YAAY,OAAO,QAAQ,YAAY;AACxD,kBAAU,QAAQ,QAAQ,GAAG,CAAC;AAAA,MAChC;AACA,UAAI,QAAQ,QAAQ,OAAO,QAAQ,SAAU,QAAO,KAAK,GAAa;AACtE,aAAO;AAAA,IACT;AAAA,IACA,MAAM;AACJ,YAAM,IAAI,MAAM,6DAAwD;AAAA,IAC1E;AAAA,IACA,iBAAiB;AACf,YAAM,IAAI,MAAM,6DAAwD;AAAA,IAC1E;AAAA,EACF,CAAC;AACH;AAEA,SAAS,QAAQ,KAAe,MAA2B,OAAsB;AAC/E,QAAM,CAAC,MAAM,GAAG,IAAI,IAAI;AACxB,QAAM,MAAM,OAAO,IAAI;AACvB,MAAI,KAAK,WAAW,GAAG;AACrB,UAAM,OAAO,IAAI,GAAG;AACpB,UAAM,OAAO,OAAO,UAAU,aAAc,MAAkC,IAAI,IAAI;AACtF,QAAI,OAAO,GAAG,MAAM,IAAI,EAAG;AAC3B,QAAI,GAAG,IAAI;AACX,eAAW,QAAQ,KAAK,GAAG,CAAC;AAAA,EAC9B,OAAO;AACL,UAAM,QAAQ,IAAI,GAAG;AACrB,QAAI,UAAU,QAAQ,OAAO,UAAU,UAAU;AAC/C,YAAM,IAAI,MAAM,uBAAuB,GAAG,oBAAoB;AAAA,IAChE;AACA,YAAQ,OAAmB,MAAM,KAAK;AAAA,EACxC;AACF;AAyCO,SAAS,YAA8B,MAA8C;AAC1F,QAAM,MAAM,gBAAgB,IAAI;AAChC,QAAM,QAAQ,KAAK,GAAG;AAEtB,QAAM,WAAW,IAAI,SAA0B;AAC7C,QAAI,KAAK,SAAS,EAAG,OAAM,IAAI,MAAM,+CAA+C;AACpF,YAAQ,KAAK,KAAK,MAAM,GAAG,EAAE,GAA0B,KAAK,KAAK,SAAS,CAAC,CAAC;AAAA,EAC9E;AAEA,SAAO,CAAC,OAAO,QAAoC;AACrD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ export interface MetaDescriptor {
2
+ /** `<meta name="...">` value. Mutually exclusive with `property`. */
3
+ name?: string;
4
+ /** `<meta property="...">` value (Open Graph, etc.). Mutually exclusive with `name`. */
5
+ property?: string;
6
+ content: string | (() => string);
7
+ }
8
+ export interface UseHeadOptions {
9
+ /** Reactive document title. A function re-runs whenever its signals change. */
10
+ title?: string | (() => string);
11
+ /** Meta tags to add/update in `<head>`. Existing tags are updated in place. */
12
+ meta?: MetaDescriptor[];
13
+ }
14
+ /**
15
+ * Update `document.title` and `<meta>` tags from inside a client island.
16
+ * String values are set once; function values are wrapped in `createEffect`
17
+ * and update reactively whenever their signals change.
18
+ *
19
+ * No-op on the server — use `ctx.head` from the page handler for initial SSR values.
20
+ *
21
+ * @example
22
+ * useHead({
23
+ * title: () => `${article()} — My Site`,
24
+ * meta: [{ name: 'description', content: () => article().summary }],
25
+ * })
26
+ */
27
+ export declare function useHead(options: UseHeadOptions): void;
28
+ //# sourceMappingURL=useHead.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useHead.d.ts","sourceRoot":"","sources":["../../client/useHead.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,wFAAwF;IACxF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAA;CACjC;AAED,MAAM,WAAW,cAAc;IAC7B,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,CAAA;IAC/B,+EAA+E;IAC/E,IAAI,CAAC,EAAE,cAAc,EAAE,CAAA;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAgCrD"}
@@ -0,0 +1,33 @@
1
+ import { createEffect, onCleanup } from "./signal.js";
2
+ function useHead(options) {
3
+ if (typeof document === "undefined") return;
4
+ if (options.title !== void 0) {
5
+ const title = options.title;
6
+ createEffect(() => {
7
+ document.title = typeof title === "function" ? title() : title;
8
+ });
9
+ }
10
+ for (const descriptor of options.meta ?? []) {
11
+ const attr = descriptor.name !== void 0 ? "name" : "property";
12
+ const attrValue = descriptor.name ?? descriptor.property;
13
+ let el = document.querySelector(`meta[${attr}="${attrValue}"]`);
14
+ const created = !el;
15
+ if (!el) {
16
+ el = document.createElement("meta");
17
+ el.setAttribute(attr, attrValue);
18
+ document.head.appendChild(el);
19
+ }
20
+ const metaEl = el;
21
+ const content = descriptor.content;
22
+ createEffect(() => {
23
+ metaEl.content = typeof content === "function" ? content() : content;
24
+ });
25
+ if (created) {
26
+ onCleanup(() => metaEl.remove());
27
+ }
28
+ }
29
+ }
30
+ export {
31
+ useHead
32
+ };
33
+ //# sourceMappingURL=useHead.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../client/useHead.ts"],
4
+ "sourcesContent": ["import { createEffect, onCleanup } from './signal.js'\n\nexport interface MetaDescriptor {\n /** `<meta name=\"...\">` value. Mutually exclusive with `property`. */\n name?: string\n /** `<meta property=\"...\">` value (Open Graph, etc.). Mutually exclusive with `name`. */\n property?: string\n content: string | (() => string)\n}\n\nexport interface UseHeadOptions {\n /** Reactive document title. A function re-runs whenever its signals change. */\n title?: string | (() => string)\n /** Meta tags to add/update in `<head>`. Existing tags are updated in place. */\n meta?: MetaDescriptor[]\n}\n\n/**\n * Update `document.title` and `<meta>` tags from inside a client island.\n * String values are set once; function values are wrapped in `createEffect`\n * and update reactively whenever their signals change.\n *\n * No-op on the server \u2014 use `ctx.head` from the page handler for initial SSR values.\n *\n * @example\n * useHead({\n * title: () => `${article()} \u2014 My Site`,\n * meta: [{ name: 'description', content: () => article().summary }],\n * })\n */\nexport function useHead(options: UseHeadOptions): void {\n if (typeof document === 'undefined') return\n\n if (options.title !== undefined) {\n const title = options.title\n createEffect(() => {\n document.title = typeof title === 'function' ? title() : title\n })\n }\n\n for (const descriptor of options.meta ?? []) {\n const attr = descriptor.name !== undefined ? 'name' : 'property'\n const attrValue = (descriptor.name ?? descriptor.property) as string\n\n let el = document.querySelector(`meta[${attr}=\"${attrValue}\"]`) as HTMLMetaElement | null\n const created = !el\n if (!el) {\n el = document.createElement('meta')\n el.setAttribute(attr, attrValue)\n document.head.appendChild(el)\n }\n\n const metaEl = el\n const content = descriptor.content\n createEffect(() => {\n metaEl.content = typeof content === 'function' ? content() : content\n })\n\n if (created) {\n onCleanup(() => metaEl.remove())\n }\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,cAAc,iBAAiB;AA8BjC,SAAS,QAAQ,SAA+B;AACrD,MAAI,OAAO,aAAa,YAAa;AAErC,MAAI,QAAQ,UAAU,QAAW;AAC/B,UAAM,QAAQ,QAAQ;AACtB,iBAAa,MAAM;AACjB,eAAS,QAAQ,OAAO,UAAU,aAAa,MAAM,IAAI;AAAA,IAC3D,CAAC;AAAA,EACH;AAEA,aAAW,cAAc,QAAQ,QAAQ,CAAC,GAAG;AAC3C,UAAM,OAAO,WAAW,SAAS,SAAY,SAAS;AACtD,UAAM,YAAa,WAAW,QAAQ,WAAW;AAEjD,QAAI,KAAK,SAAS,cAAc,QAAQ,IAAI,KAAK,SAAS,IAAI;AAC9D,UAAM,UAAU,CAAC;AACjB,QAAI,CAAC,IAAI;AACP,WAAK,SAAS,cAAc,MAAM;AAClC,SAAG,aAAa,MAAM,SAAS;AAC/B,eAAS,KAAK,YAAY,EAAE;AAAA,IAC9B;AAEA,UAAM,SAAS;AACf,UAAM,UAAU,WAAW;AAC3B,iBAAa,MAAM;AACjB,aAAO,UAAU,OAAO,YAAY,aAAa,QAAQ,IAAI;AAAA,IAC/D,CAAC;AAED,QAAI,SAAS;AACX,gBAAU,MAAM,OAAO,OAAO,CAAC;AAAA,IACjC;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,182 @@
1
+ import type { Plugin } from 'esbuild';
2
+ import type { RouteType } from './types.js';
3
+ /**
4
+ * A Davaux plugin — extends the framework with new route file types and/or
5
+ * esbuild transforms. Implement this interface and return it from a factory
6
+ * function, then pass it to `plugins` in `davaux.config.ts`.
7
+ *
8
+ * @example
9
+ * // packages/my-plugin/src/index.ts
10
+ * import type { DavauxPlugin } from 'davaux/config'
11
+ * export function myPlugin(): DavauxPlugin {
12
+ * return {
13
+ * name: 'my-plugin',
14
+ * esbuild: [myEsbuildPlugin()],
15
+ * scanner: { suffixes: [['.page.myext', 'page']] },
16
+ * }
17
+ * }
18
+ */
19
+ export interface DavauxPlugin {
20
+ name: string;
21
+ /** esbuild plugins contributed to every build context (server routes, islands, client) */
22
+ esbuild?: Plugin[];
23
+ /** Additional route file suffixes the scanner should recognize */
24
+ scanner?: {
25
+ suffixes: [suffix: string, type: RouteType][];
26
+ };
27
+ }
28
+ /** Collect esbuild plugins from an array of DavauxPlugins. */
29
+ export declare function collectEsbuildPlugins(plugins?: DavauxPlugin[]): Plugin[];
30
+ /** Collect scanner suffix entries from an array of DavauxPlugins. */
31
+ export declare function collectScannerSuffixes(plugins?: DavauxPlugin[]): [string, RouteType][];
32
+ export interface EditorConfig {
33
+ /**
34
+ * Opt-in to the visual editor and inspector overlay.
35
+ * Must be explicitly set to `true` — disabled by default so the editor
36
+ * endpoints and inspector script are never exposed unless intended.
37
+ */
38
+ enabled?: boolean;
39
+ /** Floating inspector/editor badge options. */
40
+ badge?: {
41
+ /** Corner of the viewport where the badge appears. Default: `'bottom-right'` */
42
+ position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
43
+ /** Custom label text shown on the badge. Default: `'Inspector'` */
44
+ label?: string;
45
+ };
46
+ /**
47
+ * Force a specific colour scheme for the editor UI instead of auto-detecting
48
+ * from the inspected page's theme attribute.
49
+ */
50
+ theme?: 'auto' | 'dark' | 'light';
51
+ /**
52
+ * Raw CSS string injected into the editor frame's `<style>` tag.
53
+ * Use this to override colours, hide elements, or adjust layout.
54
+ */
55
+ css?: string;
56
+ /**
57
+ * Path to a CSS file (relative to the project root) whose contents are
58
+ * injected into the editor frame. Merged with `css` if both are provided.
59
+ * The file is re-read on each request in dev mode, so changes apply without a restart.
60
+ */
61
+ cssFile?: string;
62
+ }
63
+ export interface DavauxConfig {
64
+ /** Server defaults for `davaux dev`, `davaux start`, and `davaux preview`. CLI flags (--port, --hostname) take priority over these. */
65
+ server?: {
66
+ port?: number;
67
+ hostname?: string;
68
+ };
69
+ /**
70
+ * Import path aliases, using the same glob syntax as `tsconfig.json` `paths`.
71
+ * Each entry is forwarded to esbuild `alias` in every build context so TypeScript
72
+ * and the bundler stay in sync without any extra plugin.
73
+ *
74
+ * @example
75
+ * import { defineConfig } from 'davaux/config'
76
+ * export default defineConfig({
77
+ * paths: { '@/*': './src/*' },
78
+ * })
79
+ */
80
+ paths?: Record<string, string>;
81
+ /**
82
+ * Davaux plugins — each plugin can contribute esbuild transforms and/or
83
+ * register new route file extensions with the scanner.
84
+ *
85
+ * @example
86
+ * import { defineConfig } from 'davaux/config'
87
+ * import { markdown } from '@davaux/markdown'
88
+ * export default defineConfig({
89
+ * plugins: [markdown()],
90
+ * })
91
+ */
92
+ plugins?: DavauxPlugin[];
93
+ /**
94
+ * Additional packages to exclude from esbuild bundling. Useful for packages
95
+ * that use native bindings or CJS `require()` that cannot be bundled into ESM.
96
+ * Each entry is added to the esbuild `external` list alongside `node:*` and `davaux`.
97
+ *
98
+ * @example
99
+ * import { defineConfig } from 'davaux/config'
100
+ * export default defineConfig({
101
+ * external: ['@libsql/client', 'libsql'],
102
+ * })
103
+ */
104
+ external?: string[];
105
+ /** Visual editor and inspector overlay configuration. Disabled by default — set `enabled: true` to opt in. */
106
+ editor?: EditorConfig;
107
+ /**
108
+ * OML (Object Markup Language) options. OML is the intermediate representation
109
+ * used by the visual editor and production page caching.
110
+ */
111
+ oml?: {
112
+ /**
113
+ * Control which routes use OML tree construction and result caching in production.
114
+ * By default no routes are cached — this must be explicitly configured.
115
+ *
116
+ * Use `include` for apps that are mostly dynamic with a few cacheable routes,
117
+ * or `exclude` for apps that are mostly static with a few dynamic routes.
118
+ * Routes not covered by the cache config use the string renderer directly in
119
+ * production — no OML tree is built and no result is stored.
120
+ *
121
+ * @example
122
+ * // Whitelist — only these routes are cached
123
+ * oml: { cache: { include: ['/', '/blog/:slug', '/docs/*'] } }
124
+ *
125
+ * // Blacklist — all routes cached except these
126
+ * oml: { cache: { exclude: ['/dashboard', '/account/*'] } }
127
+ */
128
+ cache?: OmlCacheConfig;
129
+ };
130
+ /** Options that only apply to `davaux static` (static site generation). */
131
+ ssg?: {
132
+ /**
133
+ * Override the default `out/` output directory.
134
+ * The `--out` CLI flag takes priority over this value.
135
+ */
136
+ outDir?: string;
137
+ /**
138
+ * Trailing slash behaviour for generated output files.
139
+ * - `'always'` (default) — `/about` → `out/about/index.html` (served as `/about/`)
140
+ * - `'never'` — `/about` → `out/about.html` (served as `/about`)
141
+ */
142
+ trailingSlash?: 'always' | 'never';
143
+ /**
144
+ * Path prefix for subdirectory deployments (e.g. `'/docs'` for GitHub Pages
145
+ * at `user.github.io/my-project/`). Prepended to all injected `/_davaux/*`
146
+ * script and stylesheet URLs in the generated HTML.
147
+ */
148
+ basePath?: string;
149
+ /**
150
+ * Generate a `404.html` at the root of `outDir` for static hosts
151
+ * (Netlify, GitHub Pages) that serve it on unmatched paths.
152
+ * Defaults to `true` when an `_error.tsx` exists in the routes directory.
153
+ */
154
+ notFound?: boolean;
155
+ /**
156
+ * Auto-generate a `sitemap.xml` from all rendered routes.
157
+ * Pass `{ baseUrl: 'https://example.com' }` to enable.
158
+ * Pass `false` to explicitly disable.
159
+ */
160
+ sitemap?: false | {
161
+ baseUrl: string;
162
+ };
163
+ };
164
+ }
165
+ /**
166
+ * Convert tsconfig-style `paths` glob entries to esbuild `alias` entries.
167
+ * `'@/*': './src/*'` → `'@': './src'`
168
+ */
169
+ export declare function pathsToAlias(paths: Record<string, string>): Record<string, string>;
170
+ /**
171
+ * Controls which routes use OML tree construction and caching in production.
172
+ * Use `include` to whitelist specific URL patterns, or `exclude` to blacklist them.
173
+ * Patterns support `:param` (single dynamic segment) and `*` (any characters).
174
+ */
175
+ export type OmlCacheConfig = {
176
+ include: string[];
177
+ } | {
178
+ exclude: string[];
179
+ };
180
+ /** Wraps a config object for TypeScript inference — returns it unchanged. */
181
+ export declare function defineConfig(config: DavauxConfig): DavauxConfig;
182
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAI3C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,0FAA0F;IAC1F,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,kEAAkE;IAClE,OAAO,CAAC,EAAE;QACR,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,CAAA;KAC9C,CAAA;CACF;AAED,8DAA8D;AAC9D,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,YAAY,EAAO,GAAG,MAAM,EAAE,CAE5E;AAED,qEAAqE;AACrE,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,YAAY,EAAO,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,CAE1F;AAID,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,+CAA+C;IAC/C,KAAK,CAAC,EAAE;QACN,gFAAgF;QAChF,QAAQ,CAAC,EAAE,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,CAAA;QACpE,mEAAmE;QACnE,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;IACD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;IACjC;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,uIAAuI;IACvI,MAAM,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,QAAQ,CAAC,EAAE,MAAM,CAAA;KAClB,CAAA;IACD;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,8GAA8G;IAC9G,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB;;;OAGG;IACH,GAAG,CAAC,EAAE;QACJ;;;;;;;;;;;;;;;WAeG;QACH,KAAK,CAAC,EAAE,cAAc,CAAA;KACvB,CAAA;IACD,2EAA2E;IAC3E,GAAG,CAAC,EAAE;QACJ;;;WAGG;QACH,MAAM,CAAC,EAAE,MAAM,CAAA;QACf;;;;WAIG;QACH,aAAa,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;QAClC;;;;WAIG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB;;;;WAIG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAA;QAClB;;;;WAIG;QACH,OAAO,CAAC,EAAE,KAAK,GAAG;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,CAAA;KACtC,CAAA;CACF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIlF;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAE1E,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAE/D"}
package/dist/config.js ADDED
@@ -0,0 +1,21 @@
1
+ function collectEsbuildPlugins(plugins = []) {
2
+ return plugins.flatMap((p) => p.esbuild ?? []);
3
+ }
4
+ function collectScannerSuffixes(plugins = []) {
5
+ return plugins.flatMap((p) => p.scanner?.suffixes ?? []);
6
+ }
7
+ function pathsToAlias(paths) {
8
+ return Object.fromEntries(
9
+ Object.entries(paths).map(([k, v]) => [k.replace(/\/\*$/, ""), v.replace(/\/\*$/, "")])
10
+ );
11
+ }
12
+ function defineConfig(config) {
13
+ return config;
14
+ }
15
+ export {
16
+ collectEsbuildPlugins,
17
+ collectScannerSuffixes,
18
+ defineConfig,
19
+ pathsToAlias
20
+ };
21
+ //# sourceMappingURL=config.js.map