@wrikka/solid-framework 0.0.0-stage → 0.15.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 (925) hide show
  1. package/README.md +104 -3
  2. package/dist/vite.d.ts +661 -0
  3. package/dist/vite.d.ts.map +1 -0
  4. package/dist/vite.js +10 -0
  5. package/dist/vite.js.map +1 -0
  6. package/package.json +247 -5
  7. package/src/actions/index.ts +5 -0
  8. package/src/actions/modules/action/adapters/http/handler.ts +80 -0
  9. package/src/actions/modules/action/application/index.ts +1 -0
  10. package/src/actions/modules/action/application/usecases/create-action.ts +92 -0
  11. package/src/actions/modules/action/application/usecases/index.ts +2 -0
  12. package/src/actions/modules/action/application/usecases/registry.ts +20 -0
  13. package/src/actions/modules/action/index.ts +2 -0
  14. package/src/actions/presentation/index.ts +1 -0
  15. package/src/actions/presentation/useSubmission.ts +46 -0
  16. package/src/actions/types/index.ts +35 -0
  17. package/src/app/index.ts +126 -0
  18. package/src/app/modules/ai/domain/operations/handler.ts +46 -0
  19. package/src/app/modules/ai/domain/operations/llms.ts +54 -0
  20. package/src/app/modules/ai/domain/operations/mcp.ts +134 -0
  21. package/src/app/modules/ai/index.ts +3 -0
  22. package/src/app/modules/api-docs/domain/operations/openapi.ts +113 -0
  23. package/src/app/modules/api-docs/index.ts +1 -0
  24. package/src/app/modules/app-def/index.ts +225 -0
  25. package/src/app/modules/auth/application/usecases/auth.ts +161 -0
  26. package/src/app/modules/auth/application/usecases/oauth.ts +105 -0
  27. package/src/app/modules/auth/index.ts +2 -0
  28. package/src/app/modules/cache/adapters/edge-kv.ts +55 -0
  29. package/src/app/modules/cache/adapters/fs.ts +58 -0
  30. package/src/app/modules/cache/adapters/memory.ts +13 -0
  31. package/src/app/modules/cache/domain/operations/tags.ts +114 -0
  32. package/src/app/modules/cache/index.ts +7 -0
  33. package/src/app/modules/cache/ports/store.ts +14 -0
  34. package/src/app/modules/config/domain/index.ts +1 -0
  35. package/src/app/modules/config/domain/models/config.ts +72 -0
  36. package/src/app/modules/config/domain/models/index.ts +1 -0
  37. package/src/app/modules/config/index.ts +1 -0
  38. package/src/app/modules/content/domain/operations/collection.ts +109 -0
  39. package/src/app/modules/content/index.ts +8 -0
  40. package/src/app/modules/content/presentation/Markdown.tsx +78 -0
  41. package/src/app/modules/conventions/domain/index.ts +1 -0
  42. package/src/app/modules/conventions/domain/operations/index.ts +1 -0
  43. package/src/app/modules/conventions/domain/operations/scan.ts +73 -0
  44. package/src/app/modules/conventions/index.ts +1 -0
  45. package/src/app/modules/db/application/usecases/db.ts +49 -0
  46. package/src/app/modules/db/index.ts +1 -0
  47. package/src/app/modules/deploy/adapters/aws-lambda.ts +54 -0
  48. package/src/app/modules/deploy/adapters/bun.ts +15 -0
  49. package/src/app/modules/deploy/adapters/cloudflare.ts +15 -0
  50. package/src/app/modules/deploy/adapters/deno.ts +15 -0
  51. package/src/app/modules/deploy/adapters/netlify.ts +18 -0
  52. package/src/app/modules/deploy/adapters/node.ts +63 -0
  53. package/src/app/modules/deploy/adapters/vercel.ts +22 -0
  54. package/src/app/modules/deploy/domain/models/preset.ts +38 -0
  55. package/src/app/modules/deploy/domain/operations/presets.ts +92 -0
  56. package/src/app/modules/deploy/index.ts +9 -0
  57. package/src/app/modules/draft/domain/operations/draft-mode.ts +125 -0
  58. package/src/app/modules/draft/index.ts +1 -0
  59. package/src/app/modules/env/domain/operations/create-env.ts +156 -0
  60. package/src/app/modules/env/index.ts +1 -0
  61. package/src/app/modules/file-routes/application/usecases/api-client.ts +120 -0
  62. package/src/app/modules/file-routes/domain/errors.ts +61 -0
  63. package/src/app/modules/file-routes/domain/index.ts +63 -0
  64. package/src/app/modules/file-routes/domain/models/index.ts +1 -0
  65. package/src/app/modules/file-routes/domain/models/route.ts +38 -0
  66. package/src/app/modules/file-routes/domain/operations/actions.ts +107 -0
  67. package/src/app/modules/file-routes/domain/operations/api.ts +87 -0
  68. package/src/app/modules/file-routes/domain/operations/codegen.ts +76 -0
  69. package/src/app/modules/file-routes/domain/operations/content.ts +61 -0
  70. package/src/app/modules/file-routes/domain/operations/defer.ts +245 -0
  71. package/src/app/modules/file-routes/domain/operations/index.ts +65 -0
  72. package/src/app/modules/file-routes/domain/operations/loader.ts +138 -0
  73. package/src/app/modules/file-routes/domain/operations/manifest.ts +229 -0
  74. package/src/app/modules/file-routes/domain/operations/match.ts +75 -0
  75. package/src/app/modules/file-routes/domain/operations/static-params.ts +58 -0
  76. package/src/app/modules/file-routes/domain/operations/typed.ts +127 -0
  77. package/src/app/modules/file-routes/index.ts +143 -0
  78. package/src/app/modules/file-routes/presentation/DevtoolsOverlay.tsx +234 -0
  79. package/src/app/modules/file-routes/presentation/FileRoutes.ts +254 -0
  80. package/src/app/modules/file-routes/presentation/Form.tsx +122 -0
  81. package/src/app/modules/file-routes/presentation/Link.tsx +132 -0
  82. package/src/app/modules/file-routes/presentation/ServerComponent.tsx +100 -0
  83. package/src/app/modules/file-routes/presentation/content-page.tsx +26 -0
  84. package/src/app/modules/file-routes/presentation/dev-events.ts +112 -0
  85. package/src/app/modules/file-routes/presentation/index.ts +98 -0
  86. package/src/app/modules/file-routes/presentation/loader-cache.ts +96 -0
  87. package/src/app/modules/file-routes/presentation/loader-data.ts +207 -0
  88. package/src/app/modules/file-routes/presentation/location.ts +217 -0
  89. package/src/app/modules/file-routes/presentation/normalize-route.ts +155 -0
  90. package/src/app/modules/file-routes/presentation/page-tree.ts +211 -0
  91. package/src/app/modules/file-routes/presentation/route-contexts.ts +89 -0
  92. package/src/app/modules/file-routes/presentation/route-def.ts +154 -0
  93. package/src/app/modules/file-routes/presentation/route-fallbacks.ts +66 -0
  94. package/src/app/modules/file-routes/presentation/route-modules.ts +138 -0
  95. package/src/app/modules/file-routes/presentation/slot.tsx +43 -0
  96. package/src/app/modules/file-routes/presentation/status.ts +13 -0
  97. package/src/app/modules/file-routes/presentation/use-action.ts +81 -0
  98. package/src/app/modules/file-routes/presentation/use-optimistic.ts +50 -0
  99. package/src/app/modules/file-routes/presentation/use-preload.ts +38 -0
  100. package/src/app/modules/file-routes/presentation/use-route.ts +254 -0
  101. package/src/app/modules/flash/domain/operations/flash.ts +70 -0
  102. package/src/app/modules/flash/index.ts +1 -0
  103. package/src/app/modules/fonts/domain/operations/font.ts +91 -0
  104. package/src/app/modules/fonts/index.ts +1 -0
  105. package/src/app/modules/i18n/domain/operations/i18n-middleware.ts +76 -0
  106. package/src/app/modules/i18n/domain/operations/locale.ts +39 -0
  107. package/src/app/modules/i18n/index.ts +3 -0
  108. package/src/app/modules/i18n/presentation/use-locale.ts +16 -0
  109. package/src/app/modules/middleware/domain/operations/request-id.ts +33 -0
  110. package/src/app/modules/middleware/domain/operations/run.ts +29 -0
  111. package/src/app/modules/middleware/index.ts +7 -0
  112. package/src/app/modules/route-rules/domain/index.ts +1 -0
  113. package/src/app/modules/route-rules/domain/operations/ab-variant.ts +58 -0
  114. package/src/app/modules/route-rules/domain/operations/index.ts +4 -0
  115. package/src/app/modules/route-rules/domain/operations/match.ts +51 -0
  116. package/src/app/modules/route-rules/domain/operations/rate-limit.ts +63 -0
  117. package/src/app/modules/route-rules/domain/operations/security.ts +67 -0
  118. package/src/app/modules/route-rules/index.ts +1 -0
  119. package/src/app/modules/runtime-config/application/index.ts +1 -0
  120. package/src/app/modules/runtime-config/application/usecases/index.ts +1 -0
  121. package/src/app/modules/runtime-config/application/usecases/runtime-config.ts +42 -0
  122. package/src/app/modules/runtime-config/index.ts +1 -0
  123. package/src/app/modules/seo/domain/operations/og.ts +66 -0
  124. package/src/app/modules/seo/domain/operations/site.ts +106 -0
  125. package/src/app/modules/seo/index.ts +2 -0
  126. package/src/app/modules/server-entry/application/index.ts +1 -0
  127. package/src/app/modules/server-entry/application/usecases/create-app-server.ts +205 -0
  128. package/src/app/modules/server-entry/application/usecases/devtools-handler.ts +31 -0
  129. package/src/app/modules/server-entry/application/usecases/image-handler.ts +38 -0
  130. package/src/app/modules/server-entry/application/usecases/index.ts +3 -0
  131. package/src/app/modules/server-entry/application/usecases/ops-handler.ts +55 -0
  132. package/src/app/modules/server-entry/application/usecases/prerender-cache.ts +59 -0
  133. package/src/app/modules/server-entry/application/usecases/route-render.ts +276 -0
  134. package/src/app/modules/server-entry/application/usecases/routed-entry.ts +194 -0
  135. package/src/app/modules/server-entry/application/usecases/static-handler.ts +20 -0
  136. package/src/app/modules/server-entry/application/usecases/zone-handler.ts +37 -0
  137. package/src/app/modules/server-entry/index.ts +1 -0
  138. package/src/app/modules/session/index.ts +77 -0
  139. package/src/app/modules/static/domain/operations/serve.ts +88 -0
  140. package/src/app/modules/static/index.ts +1 -0
  141. package/src/app/presentation/App.tsx +34 -0
  142. package/src/app/presentation/define-config.ts +11 -0
  143. package/src/app/presentation/index.ts +3 -0
  144. package/src/app/presentation/providers.ts +80 -0
  145. package/src/app/types/index.ts +273 -0
  146. package/src/assets/adapters/sharp.ts +83 -0
  147. package/src/assets/index.ts +6 -0
  148. package/src/assets/modules/assets/domain/index.ts +1 -0
  149. package/src/assets/modules/assets/domain/operations/image.ts +67 -0
  150. package/src/assets/modules/assets/domain/operations/index.ts +2 -0
  151. package/src/assets/modules/assets/domain/operations/manifest.ts +29 -0
  152. package/src/assets/modules/assets/index.ts +1 -0
  153. package/src/assets/presentation/Image.tsx +90 -0
  154. package/src/assets/presentation/index.ts +1 -0
  155. package/src/assets/types/index.ts +21 -0
  156. package/src/cli/bin.ts +8 -0
  157. package/src/cli/commands.ts +145 -0
  158. package/src/cli/doctor.ts +111 -0
  159. package/src/cli/index.ts +3 -0
  160. package/src/cli/infra.ts +38 -0
  161. package/src/cli/migrate.ts +119 -0
  162. package/src/cli/nav.ts +164 -0
  163. package/src/cli/ops.ts +135 -0
  164. package/src/cli/routes.ts +240 -0
  165. package/src/cli/scaffold.ts +217 -0
  166. package/src/devtools/App.tsx +14 -0
  167. package/src/devtools/adapters/connector.ts +23 -0
  168. package/src/devtools/adapters/index.ts +4 -0
  169. package/src/devtools/index.ts +26 -0
  170. package/src/devtools/modules/component-inspector/application/index.ts +4 -0
  171. package/src/devtools/modules/component-inspector/application/usecases/component-inspector.ts +67 -0
  172. package/src/devtools/modules/component-inspector/application/usecases/index.ts +5 -0
  173. package/src/devtools/modules/component-inspector/application/usecases/useComponentInspector.ts +52 -0
  174. package/src/devtools/modules/component-inspector/domain/events/component-events.ts +37 -0
  175. package/src/devtools/modules/component-inspector/domain/events/index.ts +4 -0
  176. package/src/devtools/modules/component-inspector/domain/index.ts +7 -0
  177. package/src/devtools/modules/component-inspector/domain/models/component-node.ts +30 -0
  178. package/src/devtools/modules/component-inspector/domain/models/component-tree.ts +20 -0
  179. package/src/devtools/modules/component-inspector/domain/models/index.ts +5 -0
  180. package/src/devtools/modules/component-inspector/domain/operations/component-operations.ts +63 -0
  181. package/src/devtools/modules/component-inspector/domain/operations/index.ts +4 -0
  182. package/src/devtools/modules/component-inspector/index.ts +7 -0
  183. package/src/devtools/modules/devtools/application/index.ts +4 -0
  184. package/src/devtools/modules/devtools/application/usecases/devtools.ts +60 -0
  185. package/src/devtools/modules/devtools/application/usecases/index.ts +5 -0
  186. package/src/devtools/modules/devtools/application/usecases/useDevtools.ts +47 -0
  187. package/src/devtools/modules/devtools/domain/events/devtools-events.ts +56 -0
  188. package/src/devtools/modules/devtools/domain/events/index.ts +4 -0
  189. package/src/devtools/modules/devtools/domain/index.ts +8 -0
  190. package/src/devtools/modules/devtools/domain/models/devtools-state.ts +15 -0
  191. package/src/devtools/modules/devtools/domain/models/index.ts +4 -0
  192. package/src/devtools/modules/devtools/domain/operations/devtools-operations.ts +27 -0
  193. package/src/devtools/modules/devtools/domain/operations/index.ts +4 -0
  194. package/src/devtools/modules/devtools/domain/validators/devtools-validators.ts +36 -0
  195. package/src/devtools/modules/devtools/domain/validators/index.ts +4 -0
  196. package/src/devtools/modules/devtools/index.ts +7 -0
  197. package/src/devtools/modules/devtools/ports/connector.ts +10 -0
  198. package/src/devtools/modules/devtools/ports/index.ts +4 -0
  199. package/src/devtools/modules/timeline/application/index.ts +4 -0
  200. package/src/devtools/modules/timeline/application/usecases/index.ts +5 -0
  201. package/src/devtools/modules/timeline/application/usecases/timeline.ts +61 -0
  202. package/src/devtools/modules/timeline/application/usecases/useTimeline.ts +37 -0
  203. package/src/devtools/modules/timeline/domain/events/index.ts +4 -0
  204. package/src/devtools/modules/timeline/domain/events/timeline-events.ts +34 -0
  205. package/src/devtools/modules/timeline/domain/index.ts +7 -0
  206. package/src/devtools/modules/timeline/domain/models/index.ts +4 -0
  207. package/src/devtools/modules/timeline/domain/models/timeline-event.ts +27 -0
  208. package/src/devtools/modules/timeline/domain/operations/index.ts +4 -0
  209. package/src/devtools/modules/timeline/domain/operations/timeline-operations.ts +28 -0
  210. package/src/devtools/modules/timeline/index.ts +7 -0
  211. package/src/devtools/presentation/DevtoolsPanel.tsx +80 -0
  212. package/src/devtools/presentation/components/ComponentTreeView.tsx +79 -0
  213. package/src/devtools/presentation/components/StateInspector.tsx +70 -0
  214. package/src/devtools/presentation/components/TimelineView.tsx +52 -0
  215. package/src/devtools/presentation/components/index.ts +7 -0
  216. package/src/devtools/presentation/composables/index.ts +7 -0
  217. package/src/devtools/presentation/composables/useComponentInspector.ts +52 -0
  218. package/src/devtools/presentation/index.ts +5 -0
  219. package/src/devtools/shared/errors/index.ts +23 -0
  220. package/src/devtools/shared/index.ts +7 -0
  221. package/src/devtools/shared/types/index.ts +6 -0
  222. package/src/devtools/shared/types/option.ts +58 -0
  223. package/src/devtools/shared/types/result.ts +53 -0
  224. package/src/devtools/shared/utils/index.ts +32 -0
  225. package/src/devtools/style.css +2 -0
  226. package/src/head/index.ts +5 -0
  227. package/src/head/modules/head/application/index.ts +1 -0
  228. package/src/head/modules/head/application/usecases/head-manager.ts +68 -0
  229. package/src/head/modules/head/application/usecases/index.ts +1 -0
  230. package/src/head/modules/head/domain/index.ts +3 -0
  231. package/src/head/modules/head/domain/models/head-tag.ts +73 -0
  232. package/src/head/modules/head/domain/models/index.ts +1 -0
  233. package/src/head/modules/head/domain/operations/dedupe.ts +18 -0
  234. package/src/head/modules/head/domain/operations/index.ts +2 -0
  235. package/src/head/modules/head/domain/operations/render-tags.ts +43 -0
  236. package/src/head/modules/head/domain/validators/index.ts +12 -0
  237. package/src/head/modules/head/index.ts +3 -0
  238. package/src/head/modules/head/ports/index.ts +11 -0
  239. package/src/head/presentation/HeadProvider.tsx +42 -0
  240. package/src/head/presentation/Tags.tsx +90 -0
  241. package/src/head/presentation/head-context.ts +11 -0
  242. package/src/head/presentation/index.ts +3 -0
  243. package/src/head/presentation/useHead.ts +77 -0
  244. package/src/head/shared/index.ts +1 -0
  245. package/src/head/shared/types/index.ts +5 -0
  246. package/src/head/types/index.ts +47 -0
  247. package/src/hooks/adapters/config/constants.ts +12 -0
  248. package/src/hooks/adapters/config/index.ts +48 -0
  249. package/src/hooks/adapters/index.ts +13 -0
  250. package/src/hooks/adapters/monaco/index.ts +96 -0
  251. package/src/hooks/adapters/qr/index.ts +65 -0
  252. package/src/hooks/index.ts +21 -0
  253. package/src/hooks/modules/array/application/index.ts +2 -0
  254. package/src/hooks/modules/array/application/usecases/index.ts +123 -0
  255. package/src/hooks/modules/array/domain/events/index.ts +5 -0
  256. package/src/hooks/modules/array/domain/index.ts +3 -0
  257. package/src/hooks/modules/array/domain/models/index.ts +2 -0
  258. package/src/hooks/modules/array/domain/operations/create.ts +10 -0
  259. package/src/hooks/modules/array/domain/operations/index.ts +31 -0
  260. package/src/hooks/modules/array/domain/operations/modify.ts +61 -0
  261. package/src/hooks/modules/array/domain/operations/query.ts +36 -0
  262. package/src/hooks/modules/array/domain/validators/index.ts +5 -0
  263. package/src/hooks/modules/array/index.ts +5 -0
  264. package/src/hooks/modules/array/types/index.ts +9 -0
  265. package/src/hooks/modules/counter/application/index.ts +12 -0
  266. package/src/hooks/modules/counter/application/usecases/index.ts +156 -0
  267. package/src/hooks/modules/counter/domain/events/index.ts +6 -0
  268. package/src/hooks/modules/counter/domain/index.ts +21 -0
  269. package/src/hooks/modules/counter/domain/models/index.ts +2 -0
  270. package/src/hooks/modules/counter/domain/operations/calculate.ts +22 -0
  271. package/src/hooks/modules/counter/domain/operations/create.ts +22 -0
  272. package/src/hooks/modules/counter/domain/operations/index.ts +25 -0
  273. package/src/hooks/modules/counter/domain/operations/modify.ts +78 -0
  274. package/src/hooks/modules/counter/domain/operations/query.ts +38 -0
  275. package/src/hooks/modules/counter/domain/operations/validate.ts +58 -0
  276. package/src/hooks/modules/counter/domain/validators/counter-validators.ts +19 -0
  277. package/src/hooks/modules/counter/domain/validators/index.ts +2 -0
  278. package/src/hooks/modules/counter/index.ts +6 -0
  279. package/src/hooks/modules/counter/ports/index.ts +7 -0
  280. package/src/hooks/modules/counter/types/index.ts +13 -0
  281. package/src/hooks/modules/editor/application/index.ts +6 -0
  282. package/src/hooks/modules/editor/application/useCodeEditor.ts +81 -0
  283. package/src/hooks/modules/editor/domain/events/editor-events.ts +16 -0
  284. package/src/hooks/modules/editor/domain/events/index.ts +6 -0
  285. package/src/hooks/modules/editor/domain/index.ts +7 -0
  286. package/src/hooks/modules/editor/domain/models/editor.ts +16 -0
  287. package/src/hooks/modules/editor/domain/models/index.ts +6 -0
  288. package/src/hooks/modules/editor/domain/validators/index.ts +34 -0
  289. package/src/hooks/modules/editor/index.ts +8 -0
  290. package/src/hooks/modules/editor/types/index.ts +34 -0
  291. package/src/hooks/modules/sensor/application/index.ts +2 -0
  292. package/src/hooks/modules/sensor/application/usecases/index.ts +25 -0
  293. package/src/hooks/modules/sensor/domain/events/index.ts +12 -0
  294. package/src/hooks/modules/sensor/domain/index.ts +10 -0
  295. package/src/hooks/modules/sensor/domain/models/index.ts +7 -0
  296. package/src/hooks/modules/sensor/domain/operations/gamepad.ts +16 -0
  297. package/src/hooks/modules/sensor/domain/operations/index.ts +12 -0
  298. package/src/hooks/modules/sensor/domain/operations/motion.ts +10 -0
  299. package/src/hooks/modules/sensor/domain/operations/orientation.ts +10 -0
  300. package/src/hooks/modules/sensor/domain/validators/index.ts +2 -0
  301. package/src/hooks/modules/sensor/index.ts +10 -0
  302. package/src/hooks/modules/sensor/ports/index.ts +8 -0
  303. package/src/hooks/modules/sensor/types/index.ts +29 -0
  304. package/src/hooks/modules/storage/application/index.ts +2 -0
  305. package/src/hooks/modules/storage/application/usecases/index.ts +18 -0
  306. package/src/hooks/modules/storage/domain/events/index.ts +5 -0
  307. package/src/hooks/modules/storage/domain/index.ts +6 -0
  308. package/src/hooks/modules/storage/domain/models/index.ts +6 -0
  309. package/src/hooks/modules/storage/domain/models/storage.ts +11 -0
  310. package/src/hooks/modules/storage/domain/operations/index.ts +8 -0
  311. package/src/hooks/modules/storage/domain/operations/serialize.ts +22 -0
  312. package/src/hooks/modules/storage/domain/operations/validate.ts +7 -0
  313. package/src/hooks/modules/storage/domain/validators/index.ts +2 -0
  314. package/src/hooks/modules/storage/index.ts +6 -0
  315. package/src/hooks/modules/storage/ports/index.ts +7 -0
  316. package/src/hooks/modules/storage/types/index.ts +6 -0
  317. package/src/hooks/modules/time/application/index.ts +2 -0
  318. package/src/hooks/modules/time/application/usecases/index.ts +5 -0
  319. package/src/hooks/modules/time/application/usecases/use-debounce.ts +10 -0
  320. package/src/hooks/modules/time/application/usecases/use-interval.ts +10 -0
  321. package/src/hooks/modules/time/application/usecases/use-throttle.ts +10 -0
  322. package/src/hooks/modules/time/application/usecases/use-timeout.ts +10 -0
  323. package/src/hooks/modules/time/domain/events/index.ts +6 -0
  324. package/src/hooks/modules/time/domain/index.ts +12 -0
  325. package/src/hooks/modules/time/domain/models/index.ts +6 -0
  326. package/src/hooks/modules/time/domain/models/time.ts +16 -0
  327. package/src/hooks/modules/time/domain/operations/calculate.ts +8 -0
  328. package/src/hooks/modules/time/domain/operations/index.ts +11 -0
  329. package/src/hooks/modules/time/domain/operations/validate.ts +11 -0
  330. package/src/hooks/modules/time/domain/validators/index.ts +2 -0
  331. package/src/hooks/modules/time/index.ts +5 -0
  332. package/src/hooks/modules/time/ports/index.ts +9 -0
  333. package/src/hooks/modules/time/types/index.ts +18 -0
  334. package/src/hooks/modules/toggle/application/index.ts +2 -0
  335. package/src/hooks/modules/toggle/application/usecases/index.ts +48 -0
  336. package/src/hooks/modules/toggle/domain/events/index.ts +4 -0
  337. package/src/hooks/modules/toggle/domain/index.ts +11 -0
  338. package/src/hooks/modules/toggle/domain/models/index.ts +7 -0
  339. package/src/hooks/modules/toggle/domain/operations/create.ts +11 -0
  340. package/src/hooks/modules/toggle/domain/operations/index.ts +12 -0
  341. package/src/hooks/modules/toggle/domain/operations/modify.ts +18 -0
  342. package/src/hooks/modules/toggle/domain/operations/query.ts +9 -0
  343. package/src/hooks/modules/toggle/domain/validators/index.ts +2 -0
  344. package/src/hooks/modules/toggle/index.ts +6 -0
  345. package/src/hooks/modules/toggle/ports/index.ts +5 -0
  346. package/src/hooks/modules/toggle/types/index.ts +9 -0
  347. package/src/hooks/presentation/index.ts +2 -0
  348. package/src/hooks/presentation/solid/animation/index.ts +11 -0
  349. package/src/hooks/presentation/solid/animation/useElapsedTime.ts +75 -0
  350. package/src/hooks/presentation/solid/animation/useInterval.ts +68 -0
  351. package/src/hooks/presentation/solid/animation/useIntervalFn.ts +54 -0
  352. package/src/hooks/presentation/solid/animation/useNow.ts +57 -0
  353. package/src/hooks/presentation/solid/animation/useRafFn.ts +57 -0
  354. package/src/hooks/presentation/solid/animation/useTimeout.ts +55 -0
  355. package/src/hooks/presentation/solid/animation/useTimeoutFn.ts +55 -0
  356. package/src/hooks/presentation/solid/animation/useTimestamp.ts +61 -0
  357. package/src/hooks/presentation/solid/animation/useTransition.ts +87 -0
  358. package/src/hooks/presentation/solid/array/index.ts +14 -0
  359. package/src/hooks/presentation/solid/array/useArrayConcat.ts +18 -0
  360. package/src/hooks/presentation/solid/array/useArrayEvery.ts +8 -0
  361. package/src/hooks/presentation/solid/array/useArrayFilter.ts +8 -0
  362. package/src/hooks/presentation/solid/array/useArrayFind.ts +8 -0
  363. package/src/hooks/presentation/solid/array/useArrayIncludes.ts +8 -0
  364. package/src/hooks/presentation/solid/array/useArrayMap.ts +8 -0
  365. package/src/hooks/presentation/solid/array/useArrayPop.ts +18 -0
  366. package/src/hooks/presentation/solid/array/useArrayPush.ts +15 -0
  367. package/src/hooks/presentation/solid/array/useArrayReduce.ts +9 -0
  368. package/src/hooks/presentation/solid/array/useArrayShift.ts +18 -0
  369. package/src/hooks/presentation/solid/array/useArraySome.ts +8 -0
  370. package/src/hooks/presentation/solid/array/useArraySort.ts +12 -0
  371. package/src/hooks/presentation/solid/browser/index.ts +35 -0
  372. package/src/hooks/presentation/solid/browser/useBarcode.ts +15 -0
  373. package/src/hooks/presentation/solid/browser/useBattery.ts +37 -0
  374. package/src/hooks/presentation/solid/browser/useBeacon.ts +4 -0
  375. package/src/hooks/presentation/solid/browser/useBluetooth.ts +15 -0
  376. package/src/hooks/presentation/solid/browser/useClipboard.ts +17 -0
  377. package/src/hooks/presentation/solid/browser/useClipboardAdvanced.ts +54 -0
  378. package/src/hooks/presentation/solid/browser/useConnection.ts +22 -0
  379. package/src/hooks/presentation/solid/browser/useCredential.ts +18 -0
  380. package/src/hooks/presentation/solid/browser/useDisplayMedia.ts +24 -0
  381. package/src/hooks/presentation/solid/browser/useFaceDetection.ts +20 -0
  382. package/src/hooks/presentation/solid/browser/useFullscreen.ts +33 -0
  383. package/src/hooks/presentation/solid/browser/useGeolocation.ts +64 -0
  384. package/src/hooks/presentation/solid/browser/useLocalStorage.ts +11 -0
  385. package/src/hooks/presentation/solid/browser/useMediaDevices.ts +24 -0
  386. package/src/hooks/presentation/solid/browser/useMemory.ts +9 -0
  387. package/src/hooks/presentation/solid/browser/useNetwork.ts +43 -0
  388. package/src/hooks/presentation/solid/browser/useNotification.ts +21 -0
  389. package/src/hooks/presentation/solid/browser/usePayment.ts +17 -0
  390. package/src/hooks/presentation/solid/browser/usePerformance.ts +13 -0
  391. package/src/hooks/presentation/solid/browser/usePush.ts +12 -0
  392. package/src/hooks/presentation/solid/browser/useQrCode.ts +11 -0
  393. package/src/hooks/presentation/solid/browser/useScreenOrientation.ts +37 -0
  394. package/src/hooks/presentation/solid/browser/useServiceWorker.ts +29 -0
  395. package/src/hooks/presentation/solid/browser/useSessionStorage.ts +11 -0
  396. package/src/hooks/presentation/solid/browser/useShare.ts +12 -0
  397. package/src/hooks/presentation/solid/browser/useSpeechRecognition.ts +71 -0
  398. package/src/hooks/presentation/solid/browser/useSpeechSynthesis.ts +54 -0
  399. package/src/hooks/presentation/solid/browser/useStorage.ts +22 -0
  400. package/src/hooks/presentation/solid/browser/useTextDetection.ts +20 -0
  401. package/src/hooks/presentation/solid/browser/useUsb.ts +15 -0
  402. package/src/hooks/presentation/solid/browser/useUserMedia.ts +24 -0
  403. package/src/hooks/presentation/solid/browser/useVibration.ts +12 -0
  404. package/src/hooks/presentation/solid/browser/useWakeLock.ts +29 -0
  405. package/src/hooks/presentation/solid/browser/useWebAuthn.ts +35 -0
  406. package/src/hooks/presentation/solid/elements/index.ts +51 -0
  407. package/src/hooks/presentation/solid/elements/useActive.ts +33 -0
  408. package/src/hooks/presentation/solid/elements/useAudio.ts +82 -0
  409. package/src/hooks/presentation/solid/elements/useBreakpoints.ts +56 -0
  410. package/src/hooks/presentation/solid/elements/useCanvas.ts +43 -0
  411. package/src/hooks/presentation/solid/elements/useClick.ts +49 -0
  412. package/src/hooks/presentation/solid/elements/useDrag.ts +56 -0
  413. package/src/hooks/presentation/solid/elements/useDraggable.ts +57 -0
  414. package/src/hooks/presentation/solid/elements/useDraggableHandle.ts +92 -0
  415. package/src/hooks/presentation/solid/elements/useDrop.ts +54 -0
  416. package/src/hooks/presentation/solid/elements/useDropZone.ts +67 -0
  417. package/src/hooks/presentation/solid/elements/useElementBounding.ts +52 -0
  418. package/src/hooks/presentation/solid/elements/useElementSize.ts +30 -0
  419. package/src/hooks/presentation/solid/elements/useElementVisibility.ts +33 -0
  420. package/src/hooks/presentation/solid/elements/useFileDialog.ts +33 -0
  421. package/src/hooks/presentation/solid/elements/useFileInput.ts +20 -0
  422. package/src/hooks/presentation/solid/elements/useFocus.ts +49 -0
  423. package/src/hooks/presentation/solid/elements/useHover.ts +33 -0
  424. package/src/hooks/presentation/solid/elements/useImagePreview.ts +27 -0
  425. package/src/hooks/presentation/solid/elements/useImageUpload.ts +66 -0
  426. package/src/hooks/presentation/solid/elements/useInfiniteScroll.ts +52 -0
  427. package/src/hooks/presentation/solid/elements/useIntersectionAdvanced.ts +43 -0
  428. package/src/hooks/presentation/solid/elements/useIntersectionObserver.ts +40 -0
  429. package/src/hooks/presentation/solid/elements/useLayout.ts +47 -0
  430. package/src/hooks/presentation/solid/elements/useLongPress.ts +54 -0
  431. package/src/hooks/presentation/solid/elements/useMagicKeys.ts +60 -0
  432. package/src/hooks/presentation/solid/elements/useMediaQuery.ts +24 -0
  433. package/src/hooks/presentation/solid/elements/useModal.ts +24 -0
  434. package/src/hooks/presentation/solid/elements/useMouse.ts +51 -0
  435. package/src/hooks/presentation/solid/elements/useMutationObserver.ts +38 -0
  436. package/src/hooks/presentation/solid/elements/useOnClickOutside.ts +25 -0
  437. package/src/hooks/presentation/solid/elements/useOnKeyStroke.ts +33 -0
  438. package/src/hooks/presentation/solid/elements/useParallax.ts +34 -0
  439. package/src/hooks/presentation/solid/elements/usePerformanceObserver.ts +30 -0
  440. package/src/hooks/presentation/solid/elements/usePinch.ts +61 -0
  441. package/src/hooks/presentation/solid/elements/usePopover.ts +54 -0
  442. package/src/hooks/presentation/solid/elements/useResize.ts +34 -0
  443. package/src/hooks/presentation/solid/elements/useResizeObserver.ts +42 -0
  444. package/src/hooks/presentation/solid/elements/useRotate.ts +42 -0
  445. package/src/hooks/presentation/solid/elements/useScroll.ts +97 -0
  446. package/src/hooks/presentation/solid/elements/useScrollTo.ts +30 -0
  447. package/src/hooks/presentation/solid/elements/useSortable.ts +22 -0
  448. package/src/hooks/presentation/solid/elements/useSplitter.ts +61 -0
  449. package/src/hooks/presentation/solid/elements/useSticky.ts +33 -0
  450. package/src/hooks/presentation/solid/elements/useSvg.ts +31 -0
  451. package/src/hooks/presentation/solid/elements/useSwipe.ts +87 -0
  452. package/src/hooks/presentation/solid/elements/useTabs.ts +44 -0
  453. package/src/hooks/presentation/solid/elements/useTooltip.ts +57 -0
  454. package/src/hooks/presentation/solid/elements/useVideo.ts +83 -0
  455. package/src/hooks/presentation/solid/elements/useVirtualList.ts +43 -0
  456. package/src/hooks/presentation/solid/elements/useWebgl.ts +36 -0
  457. package/src/hooks/presentation/solid/index.ts +11 -0
  458. package/src/hooks/presentation/solid/math/index.ts +10 -0
  459. package/src/hooks/presentation/solid/math/useAbs.ts +9 -0
  460. package/src/hooks/presentation/solid/math/useCeil.ts +9 -0
  461. package/src/hooks/presentation/solid/math/useClamp.ts +24 -0
  462. package/src/hooks/presentation/solid/math/useExp.ts +9 -0
  463. package/src/hooks/presentation/solid/math/useFloor.ts +9 -0
  464. package/src/hooks/presentation/solid/math/useLog.ts +21 -0
  465. package/src/hooks/presentation/solid/math/useMath.ts +3 -0
  466. package/src/hooks/presentation/solid/math/useOffset.ts +20 -0
  467. package/src/hooks/presentation/solid/math/usePow.ts +16 -0
  468. package/src/hooks/presentation/solid/math/useRound.ts +24 -0
  469. package/src/hooks/presentation/solid/math/useSign.ts +9 -0
  470. package/src/hooks/presentation/solid/math/useSqrt.ts +9 -0
  471. package/src/hooks/presentation/solid/network/index.ts +5 -0
  472. package/src/hooks/presentation/solid/network/useEventSource.ts +87 -0
  473. package/src/hooks/presentation/solid/network/useFetch.ts +187 -0
  474. package/src/hooks/presentation/solid/network/useWebSocket.ts +120 -0
  475. package/src/hooks/presentation/solid/sensors/index.ts +21 -0
  476. package/src/hooks/presentation/solid/sensors/useAbsoluteOrientation.ts +41 -0
  477. package/src/hooks/presentation/solid/sensors/useAccelerometer.ts +39 -0
  478. package/src/hooks/presentation/solid/sensors/useAmbientLight.ts +35 -0
  479. package/src/hooks/presentation/solid/sensors/useDeviceMotion.ts +50 -0
  480. package/src/hooks/presentation/solid/sensors/useDeviceOrientation.ts +38 -0
  481. package/src/hooks/presentation/solid/sensors/useGamepad.ts +52 -0
  482. package/src/hooks/presentation/solid/sensors/useGamepadRumble.ts +28 -0
  483. package/src/hooks/presentation/solid/sensors/useGravity.ts +39 -0
  484. package/src/hooks/presentation/solid/sensors/useGyroscope.ts +39 -0
  485. package/src/hooks/presentation/solid/sensors/useHID.ts +19 -0
  486. package/src/hooks/presentation/solid/sensors/useLinearAcceleration.ts +41 -0
  487. package/src/hooks/presentation/solid/sensors/useMagnetometer.ts +39 -0
  488. package/src/hooks/presentation/solid/sensors/useMotion.ts +31 -0
  489. package/src/hooks/presentation/solid/sensors/useNFC.ts +19 -0
  490. package/src/hooks/presentation/solid/sensors/usePressure.ts +35 -0
  491. package/src/hooks/presentation/solid/sensors/useProximity.ts +38 -0
  492. package/src/hooks/presentation/solid/sensors/useRelativeOrientation.ts +41 -0
  493. package/src/hooks/presentation/solid/sensors/useSerial.ts +18 -0
  494. package/src/hooks/presentation/solid/sensors/useShake.ts +54 -0
  495. package/src/hooks/presentation/solid/sensors/useTilt.ts +31 -0
  496. package/src/hooks/presentation/solid/state/createSharedComposable.ts +24 -0
  497. package/src/hooks/presentation/solid/state/index.ts +14 -0
  498. package/src/hooks/presentation/solid/state/reactivity.ts +43 -0
  499. package/src/hooks/presentation/solid/state/refDebounced.ts +27 -0
  500. package/src/hooks/presentation/solid/state/refThrottled.ts +39 -0
  501. package/src/hooks/presentation/solid/state/syncRef.ts +24 -0
  502. package/src/hooks/presentation/solid/state/toRef.ts +18 -0
  503. package/src/hooks/presentation/solid/state/useArray.ts +55 -0
  504. package/src/hooks/presentation/solid/state/useCounter.ts +24 -0
  505. package/src/hooks/presentation/solid/state/useToggle.ts +20 -0
  506. package/src/hooks/presentation/solid/time/index.ts +6 -0
  507. package/src/hooks/presentation/solid/time/useDebounceFn.ts +18 -0
  508. package/src/hooks/presentation/solid/time/useInterval.ts +44 -0
  509. package/src/hooks/presentation/solid/time/useThrottleFn.ts +30 -0
  510. package/src/hooks/presentation/solid/time/useTimeout.ts +37 -0
  511. package/src/hooks/presentation/solid/time/watchDebounced.ts +19 -0
  512. package/src/hooks/presentation/solid/time/watchPausable.ts +29 -0
  513. package/src/hooks/presentation/solid/time/whenever.ts +13 -0
  514. package/src/hooks/presentation/solid/utilities/index.ts +8 -0
  515. package/src/hooks/presentation/solid/utilities/useArrayEvery.ts +8 -0
  516. package/src/hooks/presentation/solid/utilities/useArrayFilter.ts +11 -0
  517. package/src/hooks/presentation/solid/utilities/useArrayFind.ts +8 -0
  518. package/src/hooks/presentation/solid/utilities/useArrayIncludes.ts +8 -0
  519. package/src/hooks/presentation/solid/utilities/useArrayMap.ts +8 -0
  520. package/src/hooks/presentation/solid/utilities/useArrayReduce.ts +9 -0
  521. package/src/hooks/presentation/solid/utilities/useArraySome.ts +8 -0
  522. package/src/hooks/presentation/solid/utilities/useArraySort.ts +12 -0
  523. package/src/hooks/presentation/solid/utilities/useClamp.ts +24 -0
  524. package/src/hooks/presentation/solid/utilities/useDebounce.ts +32 -0
  525. package/src/hooks/presentation/solid/utilities/useEventBus.ts +57 -0
  526. package/src/hooks/presentation/solid/utilities/useMemoize.ts +15 -0
  527. package/src/hooks/presentation/solid/utilities/useOffset.ts +20 -0
  528. package/src/hooks/presentation/solid/utilities/useRound.ts +24 -0
  529. package/src/hooks/presentation/solid/utilities/useSorted.ts +12 -0
  530. package/src/hooks/presentation/solid/utilities/useThrottle.ts +44 -0
  531. package/src/hooks/presentation/solid/utilities/useToNumber.ts +11 -0
  532. package/src/hooks/presentation/solid/utilities/useToString.ts +10 -0
  533. package/src/hooks/realtime/use-sse.ts +70 -0
  534. package/src/hooks/shared/constants/index.ts +4 -0
  535. package/src/hooks/shared/errors/index.ts +1 -0
  536. package/src/hooks/shared/errors/validation-error.ts +28 -0
  537. package/src/hooks/shared/index.ts +8 -0
  538. package/src/hooks/shared/types/index.ts +17 -0
  539. package/src/hooks/shared/types/option.ts +17 -0
  540. package/src/hooks/shared/types/result.ts +34 -0
  541. package/src/hooks/shared/types/utilities.ts +102 -0
  542. package/src/hooks/shared/utils/identity.ts +2 -0
  543. package/src/hooks/shared/utils/index.ts +4 -0
  544. package/src/hooks/shared/utils/logger.ts +69 -0
  545. package/src/hooks/shared/utils/pipe.ts +5 -0
  546. package/src/hooks/shared/utils/result.ts +9 -0
  547. package/src/hooks/test/counter.test.ts +25 -0
  548. package/src/index.ts +16 -0
  549. package/src/internal.ts +61 -0
  550. package/src/query/adapters/devtools/index.ts +29 -0
  551. package/src/query/adapters/persistence/index.ts +62 -0
  552. package/src/query/adapters/solid/index.ts +10 -0
  553. package/src/query/adapters/solid/solid-query-context.ts +29 -0
  554. package/src/query/adapters/solid/solid-query-empty-result.ts +34 -0
  555. package/src/query/adapters/solid/solid-query-options.ts +52 -0
  556. package/src/query/adapters/solid/solid-query-use-infinite.ts +228 -0
  557. package/src/query/adapters/solid/solid-query-use-mutation.ts +54 -0
  558. package/src/query/adapters/solid/solid-query-use-query.ts +75 -0
  559. package/src/query/adapters/solid/solid.test.ts +53 -0
  560. package/src/query/adapters/validation/index.ts +20 -0
  561. package/src/query/index.test.ts +203 -0
  562. package/src/query/index.ts +4 -0
  563. package/src/query/modules/query/application/usecases/query-client-data.ts +29 -0
  564. package/src/query/modules/query/application/usecases/query-client-helpers.ts +49 -0
  565. package/src/query/modules/query/application/usecases/query-client-infinite.ts +39 -0
  566. package/src/query/modules/query/application/usecases/query-client.ts +251 -0
  567. package/src/query/modules/query/domain/models/mutation-cache.ts +115 -0
  568. package/src/query/modules/query/domain/models/mutation.ts +207 -0
  569. package/src/query/modules/query/domain/models/query-cache.ts +119 -0
  570. package/src/query/modules/query/domain/models/query-environment.ts +16 -0
  571. package/src/query/modules/query/domain/models/query-observer.ts +162 -0
  572. package/src/query/modules/query/domain/models/query-operations.ts +76 -0
  573. package/src/query/modules/query/domain/models/query.ts +239 -0
  574. package/src/query/modules/query/domain/operations/index.ts +76 -0
  575. package/src/query/modules/query/index.ts +9 -0
  576. package/src/query/modules/query/ports/index.ts +53 -0
  577. package/src/query/modules/query/types/index.ts +239 -0
  578. package/src/query/shared/index.ts +48 -0
  579. package/src/render/adapters/index.ts +1 -0
  580. package/src/render/adapters/solid-web/hydration.ts +35 -0
  581. package/src/render/adapters/solid-web/index.ts +3 -0
  582. package/src/render/adapters/solid-web/renderer.ts +20 -0
  583. package/src/render/index.ts +7 -0
  584. package/src/render/modules/render/application/index.ts +1 -0
  585. package/src/render/modules/render/application/usecases/index.ts +4 -0
  586. package/src/render/modules/render/application/usecases/remote-island.ts +46 -0
  587. package/src/render/modules/render/application/usecases/render-page.ts +86 -0
  588. package/src/render/modules/render/application/usecases/render-shell.ts +56 -0
  589. package/src/render/modules/render/application/usecases/stream-page.ts +159 -0
  590. package/src/render/modules/render/domain/index.ts +3 -0
  591. package/src/render/modules/render/domain/models/context.ts +34 -0
  592. package/src/render/modules/render/domain/models/document.ts +26 -0
  593. package/src/render/modules/render/domain/models/index.ts +2 -0
  594. package/src/render/modules/render/domain/operations/document.ts +58 -0
  595. package/src/render/modules/render/domain/operations/hydration.ts +58 -0
  596. package/src/render/modules/render/domain/operations/index.ts +3 -0
  597. package/src/render/modules/render/domain/operations/rsc.ts +53 -0
  598. package/src/render/modules/render/domain/validators/index.ts +11 -0
  599. package/src/render/modules/render/index.ts +3 -0
  600. package/src/render/modules/render/ports/index.ts +17 -0
  601. package/src/render/presentation/ClientComponent.tsx +42 -0
  602. package/src/render/presentation/Document.tsx +45 -0
  603. package/src/render/presentation/Island.tsx +146 -0
  604. package/src/render/presentation/RemoteIsland.tsx +68 -0
  605. package/src/render/presentation/entries.ts +83 -0
  606. package/src/render/presentation/index.ts +5 -0
  607. package/src/render/shared/index.ts +2 -0
  608. package/src/render/shared/types/index.ts +9 -0
  609. package/src/render/shared/utils/index.ts +1 -0
  610. package/src/render/shared/utils/result.ts +30 -0
  611. package/src/render/types/index.ts +58 -0
  612. package/src/router/adapters/index.ts +1 -0
  613. package/src/router/adapters/solid-start/index.ts +42 -0
  614. package/src/router/cli/bundle-analyzer.ts +142 -0
  615. package/src/router/cli/index.ts +3 -0
  616. package/src/router/cli/migration-cli.ts +217 -0
  617. package/src/router/cli/route-generator-config.ts +109 -0
  618. package/src/router/cli/route-generator-templates.ts +117 -0
  619. package/src/router/cli/route-generator-types.ts +9 -0
  620. package/src/router/cli/route-generator-utils.ts +40 -0
  621. package/src/router/cli/route-generator.ts +64 -0
  622. package/src/router/index.test.ts +7 -0
  623. package/src/router/index.ts +21 -0
  624. package/src/router/modules/navigation/application/index.ts +1 -0
  625. package/src/router/modules/navigation/application/usecases.ts +42 -0
  626. package/src/router/modules/navigation/domain/index.ts +2 -0
  627. package/src/router/modules/navigation/domain/models.ts +44 -0
  628. package/src/router/modules/navigation/domain/operations.ts +28 -0
  629. package/src/router/modules/navigation/index.ts +3 -0
  630. package/src/router/modules/navigation/types/index.ts +15 -0
  631. package/src/router/modules/route-cache/application/usecases/index.ts +74 -0
  632. package/src/router/modules/route-cache/domain/models/index.ts +63 -0
  633. package/src/router/modules/route-cache/domain/operations/cache-evict.ts +104 -0
  634. package/src/router/modules/route-cache/domain/operations/cache-invalidate.ts +101 -0
  635. package/src/router/modules/route-cache/domain/operations/cache-read.ts +74 -0
  636. package/src/router/modules/route-cache/domain/operations/cache-write.ts +62 -0
  637. package/src/router/modules/route-cache/domain/operations/index.ts +4 -0
  638. package/src/router/modules/route-cache/domain/validators/index.ts +25 -0
  639. package/src/router/modules/route-cache/index.ts +8 -0
  640. package/src/router/modules/route-cache/ports/index.ts +20 -0
  641. package/src/router/modules/route-cache/types/index.ts +8 -0
  642. package/src/router/modules/route-error-tracking/application/usecases/index.ts +182 -0
  643. package/src/router/modules/route-error-tracking/domain/index.ts +5 -0
  644. package/src/router/modules/route-error-tracking/domain/models/index.ts +130 -0
  645. package/src/router/modules/route-error-tracking/domain/operations/error-cleanup.ts +50 -0
  646. package/src/router/modules/route-error-tracking/domain/operations/error-queries.ts +103 -0
  647. package/src/router/modules/route-error-tracking/domain/operations/error-recording.ts +112 -0
  648. package/src/router/modules/route-error-tracking/domain/operations/error-reporting.ts +55 -0
  649. package/src/router/modules/route-error-tracking/domain/operations/index.ts +4 -0
  650. package/src/router/modules/route-error-tracking/domain/validators/index.ts +46 -0
  651. package/src/router/modules/route-error-tracking/index.ts +8 -0
  652. package/src/router/modules/route-error-tracking/ports/index.ts +20 -0
  653. package/src/router/modules/route-error-tracking/types/index.ts +6 -0
  654. package/src/router/modules/route-feature-flags/application/usecases/index.ts +159 -0
  655. package/src/router/modules/route-feature-flags/domain/index.ts +5 -0
  656. package/src/router/modules/route-feature-flags/domain/models/index.ts +102 -0
  657. package/src/router/modules/route-feature-flags/domain/operations/feature-flag-audit.ts +37 -0
  658. package/src/router/modules/route-feature-flags/domain/operations/feature-flag-conditions.ts +52 -0
  659. package/src/router/modules/route-feature-flags/domain/operations/feature-flag-flags.ts +205 -0
  660. package/src/router/modules/route-feature-flags/domain/operations/feature-flag-routes.ts +54 -0
  661. package/src/router/modules/route-feature-flags/domain/operations/feature-flag-segments.ts +22 -0
  662. package/src/router/modules/route-feature-flags/domain/operations/feature-flag-statistics.ts +22 -0
  663. package/src/router/modules/route-feature-flags/domain/operations/index.ts +6 -0
  664. package/src/router/modules/route-feature-flags/domain/validators/index.ts +40 -0
  665. package/src/router/modules/route-feature-flags/index.ts +8 -0
  666. package/src/router/modules/route-feature-flags/ports/index.ts +23 -0
  667. package/src/router/modules/route-feature-flags/types/index.ts +7 -0
  668. package/src/router/modules/route-i18n/application/usecases/index.ts +81 -0
  669. package/src/router/modules/route-i18n/domain/models/index.ts +85 -0
  670. package/src/router/modules/route-i18n/domain/operations/index.ts +201 -0
  671. package/src/router/modules/route-i18n/domain/validators/index.ts +43 -0
  672. package/src/router/modules/route-i18n/index.ts +8 -0
  673. package/src/router/modules/route-i18n/ports/index.ts +20 -0
  674. package/src/router/modules/route-i18n/types/index.ts +7 -0
  675. package/src/router/modules/route-navigation-timeline/application/usecases/index.ts +182 -0
  676. package/src/router/modules/route-navigation-timeline/domain/index.ts +5 -0
  677. package/src/router/modules/route-navigation-timeline/domain/models/index.ts +143 -0
  678. package/src/router/modules/route-navigation-timeline/domain/operations/index.ts +177 -0
  679. package/src/router/modules/route-navigation-timeline/domain/validators/index.ts +19 -0
  680. package/src/router/modules/route-navigation-timeline/index.ts +8 -0
  681. package/src/router/modules/route-navigation-timeline/ports/index.ts +30 -0
  682. package/src/router/modules/route-navigation-timeline/types/index.ts +5 -0
  683. package/src/router/modules/route-performance/application/usecases/index.ts +166 -0
  684. package/src/router/modules/route-performance/domain/models/index.ts +96 -0
  685. package/src/router/modules/route-performance/domain/operations/index.ts +5 -0
  686. package/src/router/modules/route-performance/domain/operations/performance-cleanup.ts +29 -0
  687. package/src/router/modules/route-performance/domain/operations/performance-queries.ts +91 -0
  688. package/src/router/modules/route-performance/domain/operations/performance-recording.ts +151 -0
  689. package/src/router/modules/route-performance/domain/operations/performance-reporting.ts +32 -0
  690. package/src/router/modules/route-performance/domain/operations/performance-tracking.ts +75 -0
  691. package/src/router/modules/route-performance/domain/validators/index.ts +55 -0
  692. package/src/router/modules/route-performance/index.ts +8 -0
  693. package/src/router/modules/route-performance/ports/index.ts +25 -0
  694. package/src/router/modules/route-performance/types/index.ts +6 -0
  695. package/src/router/modules/route-security/application/usecases/index.ts +153 -0
  696. package/src/router/modules/route-security/domain/models/index.ts +216 -0
  697. package/src/router/modules/route-security/domain/operations/index.ts +165 -0
  698. package/src/router/modules/route-security/domain/validators/index.ts +32 -0
  699. package/src/router/modules/route-security/index.ts +8 -0
  700. package/src/router/modules/route-security/ports/index.ts +31 -0
  701. package/src/router/modules/route-security/types/index.ts +11 -0
  702. package/src/router/modules/route-testing/application/usecases/index.ts +131 -0
  703. package/src/router/modules/route-testing/domain/models/index.ts +217 -0
  704. package/src/router/modules/route-testing/domain/operations/contract-testing-operations.ts +239 -0
  705. package/src/router/modules/route-testing/domain/operations/e2e-testing-operations.ts +167 -0
  706. package/src/router/modules/route-testing/domain/operations/index.ts +3 -0
  707. package/src/router/modules/route-testing/domain/operations/route-testing-core.ts +48 -0
  708. package/src/router/modules/route-testing/domain/validators/index.ts +34 -0
  709. package/src/router/modules/route-testing/index.ts +8 -0
  710. package/src/router/modules/route-testing/ports/index.ts +21 -0
  711. package/src/router/modules/route-testing/types/index.ts +13 -0
  712. package/src/router/modules/routing/application/index.ts +7 -0
  713. package/src/router/modules/routing/application/usecases.ts +49 -0
  714. package/src/router/modules/routing/domain/ab-testing.ts +86 -0
  715. package/src/router/modules/routing/domain/analytics.ts +88 -0
  716. package/src/router/modules/routing/domain/caching-evict.ts +104 -0
  717. package/src/router/modules/routing/domain/caching-invalidate.ts +101 -0
  718. package/src/router/modules/routing/domain/caching-read.ts +74 -0
  719. package/src/router/modules/routing/domain/caching-state.ts +38 -0
  720. package/src/router/modules/routing/domain/caching-types.ts +38 -0
  721. package/src/router/modules/routing/domain/caching-write.ts +62 -0
  722. package/src/router/modules/routing/domain/caching.ts +6 -0
  723. package/src/router/modules/routing/domain/code-splitting.ts +226 -0
  724. package/src/router/modules/routing/domain/contract-factory.ts +37 -0
  725. package/src/router/modules/routing/domain/contract-testing.ts +13 -0
  726. package/src/router/modules/routing/domain/contract-types.ts +32 -0
  727. package/src/router/modules/routing/domain/contract-validator.ts +246 -0
  728. package/src/router/modules/routing/domain/dynamic-imports.ts +67 -0
  729. package/src/router/modules/routing/domain/e2e-testing.ts +267 -0
  730. package/src/router/modules/routing/domain/error-boundaries.ts +54 -0
  731. package/src/router/modules/routing/domain/error-tracking.ts +277 -0
  732. package/src/router/modules/routing/domain/feature-flags.ts +255 -0
  733. package/src/router/modules/routing/domain/guards.ts +104 -0
  734. package/src/router/modules/routing/domain/i18n.ts +230 -0
  735. package/src/router/modules/routing/domain/index.ts +30 -0
  736. package/src/router/modules/routing/domain/interactive-docs-advanced-sections.ts +164 -0
  737. package/src/router/modules/routing/domain/interactive-docs-core-sections.ts +198 -0
  738. package/src/router/modules/routing/domain/interactive-docs.ts +154 -0
  739. package/src/router/modules/routing/domain/isr.ts +35 -0
  740. package/src/router/modules/routing/domain/middleware.ts +79 -0
  741. package/src/router/modules/routing/domain/models.ts +95 -0
  742. package/src/router/modules/routing/domain/navigation-timeline.ts +243 -0
  743. package/src/router/modules/routing/domain/operations.ts +36 -0
  744. package/src/router/modules/routing/domain/optimized-matcher.ts +75 -0
  745. package/src/router/modules/routing/domain/performance-alert-manager.ts +28 -0
  746. package/src/router/modules/routing/domain/performance-monitoring.ts +287 -0
  747. package/src/router/modules/routing/domain/performance-report.ts +29 -0
  748. package/src/router/modules/routing/domain/performance-types.ts +19 -0
  749. package/src/router/modules/routing/domain/predictive-preloading.ts +296 -0
  750. package/src/router/modules/routing/domain/rbac.ts +219 -0
  751. package/src/router/modules/routing/domain/resource-routes.ts +64 -0
  752. package/src/router/modules/routing/domain/route-autocomplete.ts +176 -0
  753. package/src/router/modules/routing/domain/route-groups.ts +63 -0
  754. package/src/router/modules/routing/domain/security-scanner.ts +225 -0
  755. package/src/router/modules/routing/domain/server-actions.ts +71 -0
  756. package/src/router/modules/routing/domain/testing.ts +80 -0
  757. package/src/router/modules/routing/domain/type-safe-links.ts +72 -0
  758. package/src/router/modules/routing/domain/validators.ts +23 -0
  759. package/src/router/modules/routing/index.ts +4 -0
  760. package/src/router/modules/routing/ports/index.ts +1 -0
  761. package/src/router/modules/routing/ports/router-port.ts +15 -0
  762. package/src/router/modules/routing/types/index.ts +14 -0
  763. package/src/router/modules/routing-core/application/usecases/index.ts +49 -0
  764. package/src/router/modules/routing-core/domain/models/index.ts +95 -0
  765. package/src/router/modules/routing-core/domain/operations/index.ts +36 -0
  766. package/src/router/modules/routing-core/domain/validators/index.ts +28 -0
  767. package/src/router/modules/routing-core/index.ts +8 -0
  768. package/src/router/modules/routing-core/ports/index.ts +16 -0
  769. package/src/router/modules/routing-core/types/index.ts +25 -0
  770. package/src/router/presentation/index.ts +1 -0
  771. package/src/router/presentation/solid/components/index.ts +1 -0
  772. package/src/router/presentation/solid/components/route-visualizer-details.tsx +37 -0
  773. package/src/router/presentation/solid/components/route-visualizer-helpers.ts +56 -0
  774. package/src/router/presentation/solid/components/route-visualizer-tree.tsx +99 -0
  775. package/src/router/presentation/solid/components/route-visualizer-types.ts +41 -0
  776. package/src/router/presentation/solid/components/route-visualizer.tsx +110 -0
  777. package/src/router/presentation/solid/components/router.ts +82 -0
  778. package/src/router/presentation/solid/devtools/index.ts +2 -0
  779. package/src/router/presentation/solid/devtools/router-devtools-panel.tsx +141 -0
  780. package/src/router/presentation/solid/devtools/router-inspector.ts +54 -0
  781. package/src/router/presentation/solid/hmr.ts +77 -0
  782. package/src/router/presentation/solid/index.ts +7 -0
  783. package/src/router/presentation/solid/lazy-loading.ts +111 -0
  784. package/src/router/presentation/solid/preloading.ts +81 -0
  785. package/src/router/presentation/solid/route-state.ts +58 -0
  786. package/src/router/presentation/solid/signals/index.ts +2 -0
  787. package/src/router/presentation/solid/signals/route-state.ts +39 -0
  788. package/src/router/presentation/solid/signals/search-params.ts +31 -0
  789. package/src/router/shared/constants/index.ts +6 -0
  790. package/src/router/shared/errors/enhanced-errors.ts +94 -0
  791. package/src/router/shared/errors/index.ts +30 -0
  792. package/src/router/shared/index.ts +4 -0
  793. package/src/router/shared/types/either.ts +55 -0
  794. package/src/router/shared/types/index.ts +5 -0
  795. package/src/router/shared/types/option.ts +20 -0
  796. package/src/router/shared/types/result.ts +34 -0
  797. package/src/router/shared/types/route-inference.ts +49 -0
  798. package/src/router/shared/types/routing.ts +31 -0
  799. package/src/router/shared/utils/index.ts +3 -0
  800. package/src/router/shared/utils/path.ts +43 -0
  801. package/src/router/shared/utils/result.ts +5 -0
  802. package/src/router/shared/utils/time-condition.ts +53 -0
  803. package/src/router/vite-plugin/index.ts +2 -0
  804. package/src/router/vite-plugin/vite-plugin-core.ts +79 -0
  805. package/src/router/vite-plugin/vite-plugin-options-advanced.ts +127 -0
  806. package/src/router/vite-plugin/vite-plugin-options-features.ts +117 -0
  807. package/src/router/vite-plugin/vite-plugin-options-routing.ts +70 -0
  808. package/src/router/vite-plugin/vite-plugin-options.ts +23 -0
  809. package/src/server/adapters/index.ts +2 -0
  810. package/src/server/adapters/platforms.ts +79 -0
  811. package/src/server/adapters/web-server/index.ts +281 -0
  812. package/src/server/index.ts +13 -0
  813. package/src/server/modules/http/domain/operations/cookies.ts +151 -0
  814. package/src/server/modules/http/domain/operations/metrics.ts +103 -0
  815. package/src/server/modules/http/domain/operations/request-context.ts +36 -0
  816. package/src/server/modules/http/domain/operations/session-store.ts +98 -0
  817. package/src/server/modules/http/index.ts +15 -0
  818. package/src/server/modules/loaders/application/index.ts +1 -0
  819. package/src/server/modules/loaders/application/usecases/create-route-loader.ts +88 -0
  820. package/src/server/modules/loaders/application/usecases/dehydrate.ts +21 -0
  821. package/src/server/modules/loaders/application/usecases/index.ts +2 -0
  822. package/src/server/modules/loaders/index.ts +1 -0
  823. package/src/server/modules/realtime/domain/operations/channels.ts +241 -0
  824. package/src/server/modules/realtime/domain/operations/sse.ts +63 -0
  825. package/src/server/modules/realtime/index.ts +2 -0
  826. package/src/server/modules/server-functions/adapters/http/handler.ts +128 -0
  827. package/src/server/modules/server-functions/application/index.ts +1 -0
  828. package/src/server/modules/server-functions/application/usecases/batch.ts +135 -0
  829. package/src/server/modules/server-functions/application/usecases/create-server-fn.ts +272 -0
  830. package/src/server/modules/server-functions/application/usecases/csrf.ts +67 -0
  831. package/src/server/modules/server-functions/application/usecases/index.ts +6 -0
  832. package/src/server/modules/server-functions/application/usecases/live.ts +172 -0
  833. package/src/server/modules/server-functions/application/usecases/registry.ts +22 -0
  834. package/src/server/modules/server-functions/application/usecases/scheduler.ts +115 -0
  835. package/src/server/modules/server-functions/domain/index.ts +24 -0
  836. package/src/server/modules/server-functions/domain/models/execution-result.ts +18 -0
  837. package/src/server/modules/server-functions/domain/models/index.ts +1 -0
  838. package/src/server/modules/server-functions/domain/operations/result.ts +61 -0
  839. package/src/server/modules/server-functions/domain/operations/serialize.ts +134 -0
  840. package/src/server/modules/server-functions/domain/operations/stream.ts +107 -0
  841. package/src/server/modules/server-functions/index.ts +3 -0
  842. package/src/server/modules/server-only/index.ts +30 -0
  843. package/src/server/node.ts +10 -0
  844. package/src/server/shared/errors/index.ts +1 -0
  845. package/src/server/shared/errors/server-fn-error.ts +27 -0
  846. package/src/server/shared/index.ts +2 -0
  847. package/src/server/shared/types/index.ts +5 -0
  848. package/src/server/types/index.ts +65 -0
  849. package/src/stores/adapters/analytics/index.ts +5 -0
  850. package/src/stores/adapters/analytics/monitoring.ts +164 -0
  851. package/src/stores/adapters/devtools/index.ts +80 -0
  852. package/src/stores/adapters/persistence/index.ts +5 -0
  853. package/src/stores/adapters/persistence/versioning.ts +142 -0
  854. package/src/stores/adapters/router/index.ts +144 -0
  855. package/src/stores/adapters/storage/index.ts +6 -0
  856. package/src/stores/adapters/storage/indexed-db.ts +83 -0
  857. package/src/stores/adapters/storage/local-storage.ts +44 -0
  858. package/src/stores/adapters/storage/session-storage.ts +44 -0
  859. package/src/stores/adapters/sync/index.ts +5 -0
  860. package/src/stores/adapters/sync/tab-sync.ts +148 -0
  861. package/src/stores/adapters/validation/arktype-validator.ts +32 -0
  862. package/src/stores/adapters/validation/error-handling.ts +27 -0
  863. package/src/stores/adapters/validation/index.ts +61 -0
  864. package/src/stores/adapters/validation/schemas/api-schemas.ts +30 -0
  865. package/src/stores/adapters/validation/schemas/common-schemas.ts +32 -0
  866. package/src/stores/adapters/validation/schemas/config-schemas.ts +22 -0
  867. package/src/stores/adapters/validation/schemas/constraint-schemas.ts +34 -0
  868. package/src/stores/adapters/validation/schemas/ecommerce-schemas.ts +43 -0
  869. package/src/stores/adapters/validation/schemas/form-schemas.ts +27 -0
  870. package/src/stores/adapters/validation/schemas/primitive-schemas.ts +9 -0
  871. package/src/stores/adapters/validation/schemas/store-schemas.ts +52 -0
  872. package/src/stores/adapters/validation/schemas.ts +11 -0
  873. package/src/stores/index.ts +13 -0
  874. package/src/stores/modules/query/index.ts +24 -0
  875. package/src/stores/modules/query/mutation-state.ts +33 -0
  876. package/src/stores/modules/query/mutation-store.ts +59 -0
  877. package/src/stores/modules/query/query-builder.ts +25 -0
  878. package/src/stores/modules/query/query-cache.ts +65 -0
  879. package/src/stores/modules/query/query-manager.ts +103 -0
  880. package/src/stores/modules/query/query-state.ts +39 -0
  881. package/src/stores/modules/query/query-store.ts +81 -0
  882. package/src/stores/modules/store/application/usecases/index.ts +217 -0
  883. package/src/stores/modules/store/domain/models/index.ts +38 -0
  884. package/src/stores/modules/store/domain/operations/actions.ts +120 -0
  885. package/src/stores/modules/store/domain/operations/composition.ts +205 -0
  886. package/src/stores/modules/store/domain/operations/derived-operations.ts +21 -0
  887. package/src/stores/modules/store/domain/operations/diffing.ts +272 -0
  888. package/src/stores/modules/store/domain/operations/event-bus.ts +255 -0
  889. package/src/stores/modules/store/domain/operations/history-operations.ts +101 -0
  890. package/src/stores/modules/store/domain/operations/hydration.ts +159 -0
  891. package/src/stores/modules/store/domain/operations/immutable.ts +173 -0
  892. package/src/stores/modules/store/domain/operations/index.ts +21 -0
  893. package/src/stores/modules/store/domain/operations/middleware.ts +193 -0
  894. package/src/stores/modules/store/domain/operations/mutations.ts +14 -0
  895. package/src/stores/modules/store/domain/operations/normalization.ts +195 -0
  896. package/src/stores/modules/store/domain/operations/optimistic.ts +171 -0
  897. package/src/stores/modules/store/domain/operations/persistence-operations.ts +26 -0
  898. package/src/stores/modules/store/domain/operations/queries.ts +296 -0
  899. package/src/stores/modules/store/domain/operations/selectors.ts +112 -0
  900. package/src/stores/modules/store/domain/operations/store-operations.ts +52 -0
  901. package/src/stores/modules/store/domain/operations/time-machine.ts +240 -0
  902. package/src/stores/modules/store/domain/operations/transactions.ts +198 -0
  903. package/src/stores/modules/store/domain/validators/action-validators.ts +20 -0
  904. package/src/stores/modules/store/domain/validators/history-validators.ts +19 -0
  905. package/src/stores/modules/store/domain/validators/index.ts +7 -0
  906. package/src/stores/modules/store/domain/validators/persistence-validators.ts +23 -0
  907. package/src/stores/modules/store/domain/validators/store-validators.ts +41 -0
  908. package/src/stores/modules/store/index.ts +9 -0
  909. package/src/stores/modules/store/ports/index.ts +104 -0
  910. package/src/stores/modules/store/types/index.ts +35 -0
  911. package/src/stores/shared/constants/index.ts +50 -0
  912. package/src/stores/shared/errors/index.ts +122 -0
  913. package/src/stores/shared/index.ts +7 -0
  914. package/src/stores/shared/schema-generator.ts +262 -0
  915. package/src/stores/shared/types/index.ts +147 -0
  916. package/src/testing/index.ts +90 -0
  917. package/src/vite/auto-imports.ts +65 -0
  918. package/src/vite/client.d.ts +25 -0
  919. package/src/vite/dev-middleware.ts +142 -0
  920. package/src/vite/index.ts +9 -0
  921. package/src/vite/plugin.ts +277 -0
  922. package/src/vite/prerender.ts +72 -0
  923. package/src/vite/server-fn-ids.ts +52 -0
  924. package/src/vite/types/index.ts +24 -0
  925. package/src/vite/virtual-modules.ts +68 -0
@@ -0,0 +1,164 @@
1
+ // Store Module - Monitoring and Analytics
2
+ // Clean Architecture: Store monitoring and analytics adapter
3
+
4
+ import type { Store } from "#stores/modules/store/types";
5
+
6
+ // ============================================
7
+ // MONITORING TYPES
8
+ // ============================================
9
+
10
+ export interface StoreMetrics {
11
+ changeCount: number;
12
+ lastChangeTime: number;
13
+ averageChangeFrequency: number;
14
+ }
15
+
16
+ export interface AnalyticsEvent {
17
+ timestamp: number;
18
+ type: "state_change" | "subscription" | "unsubscription";
19
+ storeId: string;
20
+ data?: unknown;
21
+ }
22
+
23
+ export interface MonitoringOptions {
24
+ trackChanges?: boolean;
25
+ trackSubscriptions?: boolean;
26
+ maxEvents?: number;
27
+ onEvent?: (event: AnalyticsEvent) => void;
28
+ }
29
+
30
+ // ============================================
31
+ // MONITORING ADAPTER
32
+ // ============================================
33
+
34
+ export const createMonitoringAdapter = <T>(
35
+ store: Store<T>,
36
+ options: MonitoringOptions = {},
37
+ now: number = Date.now(),
38
+ random: () => number = Math.random,
39
+ ) => {
40
+ const storeId = `store-${now}-${random()}`;
41
+ const events: AnalyticsEvent[] = [];
42
+ const metrics: StoreMetrics = {
43
+ changeCount: 0,
44
+ lastChangeTime: 0,
45
+ averageChangeFrequency: 0,
46
+ };
47
+
48
+ const maxEvents = options.maxEvents || 1000;
49
+
50
+ const trackEvent = (event: AnalyticsEvent): void => {
51
+ events.push(event);
52
+
53
+ if (events.length > maxEvents) {
54
+ events.shift();
55
+ }
56
+
57
+ options.onEvent?.(event);
58
+ };
59
+
60
+ // Create monitored store wrapper
61
+ const monitoredStore: Store<T> = {
62
+ getState: store.getState,
63
+ setState: (state: T | ((prev: T) => T), now: number = Date.now()): void => {
64
+ const startTime = performance.now();
65
+ store.setState(state);
66
+ const endTime = performance.now();
67
+
68
+ if (options.trackChanges) {
69
+ metrics.changeCount++;
70
+ metrics.lastChangeTime = now;
71
+
72
+ const timeDiff =
73
+ metrics.lastChangeTime -
74
+ (events[0]?.timestamp || metrics.lastChangeTime);
75
+ if (timeDiff > 0) {
76
+ metrics.averageChangeFrequency =
77
+ metrics.changeCount / (timeDiff / 1000);
78
+ }
79
+
80
+ trackEvent({
81
+ timestamp: now,
82
+ type: "state_change",
83
+ storeId,
84
+ data: {
85
+ duration: endTime - startTime,
86
+ },
87
+ });
88
+ }
89
+ },
90
+ subscribe: (
91
+ listener: (state: T) => void,
92
+ now: number = Date.now(),
93
+ ): (() => void) => {
94
+ if (options.trackSubscriptions) {
95
+ trackEvent({
96
+ timestamp: now,
97
+ type: "subscription",
98
+ storeId,
99
+ });
100
+ }
101
+
102
+ const unsubscribe = store.subscribe(listener);
103
+
104
+ return (now: number = Date.now()) => {
105
+ if (options.trackSubscriptions) {
106
+ trackEvent({
107
+ timestamp: now,
108
+ type: "unsubscription",
109
+ storeId,
110
+ });
111
+ }
112
+ unsubscribe();
113
+ };
114
+ },
115
+ };
116
+
117
+ return {
118
+ store: monitoredStore,
119
+ getMetrics: () => metrics,
120
+ getEvents: () => [...events],
121
+ getEventsByType: (type: AnalyticsEvent["type"]) => {
122
+ return events.filter((e) => e.type === type);
123
+ },
124
+ clearEvents: () => {
125
+ events.length = 0;
126
+ },
127
+ resetMetrics: () => {
128
+ metrics.changeCount = 0;
129
+ metrics.lastChangeTime = 0;
130
+ metrics.averageChangeFrequency = 0;
131
+ },
132
+ };
133
+ };
134
+
135
+ // ============================================
136
+ // ANALYTICS MIDDLEWARE
137
+ // ============================================
138
+
139
+ export const createAnalyticsMiddleware = (options?: MonitoringOptions) => {
140
+ const adapters = new Map<
141
+ Store<any>,
142
+ ReturnType<typeof createMonitoringAdapter<any>>
143
+ >();
144
+
145
+ return (store: Store<any>) => {
146
+ const adapter = createMonitoringAdapter(store, options);
147
+ adapters.set(store, adapter);
148
+
149
+ return {
150
+ getMetrics: () => adapter.getMetrics(),
151
+ getEvents: () => adapter.getEvents(),
152
+ getAllMetrics: () => {
153
+ const allMetrics = new Map<string, StoreMetrics>();
154
+ adapters.forEach((adapter, store) => {
155
+ allMetrics.set(
156
+ JSON.stringify(store.getState()),
157
+ adapter.getMetrics(),
158
+ );
159
+ });
160
+ return allMetrics;
161
+ },
162
+ };
163
+ };
164
+ };
@@ -0,0 +1,80 @@
1
+ // Store Module - DevTools Adapter
2
+ // Clean Architecture: DevTools implementation
3
+
4
+ import type { IStoreDevtools } from "#stores/modules/store/ports";
5
+ import type { StoreConfig } from "#stores/modules/store/types";
6
+
7
+ // ============================================
8
+ // DEVTOOLS ADAPTER
9
+ // ============================================
10
+
11
+ export const createDevtoolsAdapter = (): IStoreDevtools => {
12
+ const stores = new Map<string, { getState: () => unknown }>();
13
+ let timeTravelEnabled = false;
14
+
15
+ return {
16
+ registerStore<T>(
17
+ name: string,
18
+ store: { getState: () => T },
19
+ config: StoreConfig,
20
+ ): void {
21
+ stores.set(name, store);
22
+
23
+ if (
24
+ typeof window !== "undefined" &&
25
+ (window as any).__SOLID_DEVTOOLS_GLOBAL_HOOK__
26
+ ) {
27
+ const hook = (window as any).__SOLID_DEVTOOLS_GLOBAL_HOOK__;
28
+ hook.emit("init", { name, state: store.getState(), config });
29
+ }
30
+ },
31
+ unregisterStore(name: string): void {
32
+ stores.delete(name);
33
+
34
+ if (
35
+ typeof window !== "undefined" &&
36
+ (window as any).__SOLID_DEVTOOLS_GLOBAL_HOOK__
37
+ ) {
38
+ const hook = (window as any).__SOLID_DEVTOOLS_GLOBAL_HOOK__;
39
+ hook.emit("unregister", { name });
40
+ }
41
+ },
42
+ updateStore<T>(name: string, state: T): void {
43
+ if (timeTravelEnabled) return;
44
+
45
+ if (
46
+ typeof window !== "undefined" &&
47
+ (window as any).__SOLID_DEVTOOLS_GLOBAL_HOOK__
48
+ ) {
49
+ const hook = (window as any).__SOLID_DEVTOOLS_GLOBAL_HOOK__;
50
+ hook.emit("update", { name, state });
51
+ }
52
+ },
53
+ logAction<T>(
54
+ name: string,
55
+ action: string,
56
+ prevState: T,
57
+ nextState: T,
58
+ ): void {
59
+ if (
60
+ typeof window !== "undefined" &&
61
+ (window as any).__SOLID_DEVTOOLS_GLOBAL_HOOK__
62
+ ) {
63
+ const hook = (window as any).__SOLID_DEVTOOLS_GLOBAL_HOOK__;
64
+ hook.emit("action", { name, action, prevState, nextState });
65
+ }
66
+ },
67
+ startTimeTravel(): void {
68
+ timeTravelEnabled = true;
69
+ },
70
+ stopTimeTravel(): void {
71
+ timeTravelEnabled = false;
72
+ },
73
+ jumpToState<T>(name: string, state: T): void {
74
+ const store = stores.get(name);
75
+ if (store && typeof (store as any).setState === "function") {
76
+ (store as any).setState(state);
77
+ }
78
+ },
79
+ };
80
+ };
@@ -0,0 +1,5 @@
1
+ // Store Module - Persistence Adapter
2
+ // Clean Architecture: Storage implementation
3
+
4
+ // Re-export versioning utilities
5
+ export * from "./versioning";
@@ -0,0 +1,142 @@
1
+ // Store Module - Persistence Versioning
2
+ // Clean Architecture: Schema migration and version management
3
+
4
+ import type { PersistenceModel } from "#stores/modules/store/domain/models";
5
+
6
+ // ============================================
7
+ // MIGRATION TYPES
8
+ // ============================================
9
+
10
+ export type Migration<T, U> = (oldState: T) => U;
11
+
12
+ export interface SchemaVersion<T> {
13
+ version: string;
14
+ migrateTo?: (state: unknown) => T;
15
+ validate?: (state: unknown) => state is T;
16
+ }
17
+
18
+ export interface VersionedPersistence<T> {
19
+ model: PersistenceModel<T>;
20
+ currentVersion: string;
21
+ schemaVersions: SchemaVersion<T>[];
22
+ }
23
+
24
+ // ============================================
25
+ // VERSION REGISTRY
26
+ // ============================================
27
+
28
+ const versionRegistry = new Map<string, SchemaVersion<any>[]>();
29
+
30
+ export const registerSchemaVersions = <T>(
31
+ key: string,
32
+ versions: SchemaVersion<T>[],
33
+ ): void => {
34
+ versionRegistry.set(key, versions);
35
+ };
36
+
37
+ export const getSchemaVersions = <T>(key: string): SchemaVersion<T>[] => {
38
+ return versionRegistry.get(key) || [];
39
+ };
40
+
41
+ // ============================================
42
+ // MIGRATION HELPER
43
+ // ============================================
44
+
45
+ export const migrateState = <T>(
46
+ state: unknown,
47
+ fromVersion: string,
48
+ toVersion: string,
49
+ versions: SchemaVersion<T>[],
50
+ ): T => {
51
+ const fromIndex = versions.findIndex((v) => v.version === fromVersion);
52
+ const toIndex = versions.findIndex((v) => v.version === toVersion);
53
+
54
+ if (fromIndex === -1 || toIndex === -1) {
55
+ throw new Error(`Invalid version: ${fromVersion} → ${toVersion}`);
56
+ }
57
+
58
+ let currentState = state;
59
+
60
+ for (let i = fromIndex; i < toIndex; i++) {
61
+ const version = versions[i];
62
+ if (version.migrateTo) {
63
+ currentState = version.migrateTo(currentState);
64
+ }
65
+ }
66
+
67
+ return currentState as T;
68
+ };
69
+
70
+ // ============================================
71
+ // VERSIONED PERSISTENCE
72
+ // ============================================
73
+
74
+ export const createVersionedPersistence = <T>(
75
+ key: string,
76
+ initialState: T,
77
+ schemaVersions: SchemaVersion<T>[],
78
+ now: number = Date.now(),
79
+ ): VersionedPersistence<T> => {
80
+ registerSchemaVersions(key, schemaVersions);
81
+
82
+ const latestVersion = schemaVersions[schemaVersions.length - 1].version;
83
+
84
+ return {
85
+ model: {
86
+ key,
87
+ state: initialState,
88
+ version: latestVersion,
89
+ schemaVersion: latestVersion,
90
+ timestamp: now,
91
+ },
92
+ currentVersion: latestVersion,
93
+ schemaVersions,
94
+ };
95
+ };
96
+
97
+ // ============================================
98
+ // LOAD WITH MIGRATION
99
+ // ============================================
100
+
101
+ export const loadWithMigration = <T>(
102
+ key: string,
103
+ loadedModel: PersistenceModel<unknown>,
104
+ now: number = Date.now(),
105
+ ): PersistenceModel<T> => {
106
+ const versions = getSchemaVersions<T>(key);
107
+ const currentVersion = loadedModel.schemaVersion || loadedModel.version;
108
+ const latestVersion = versions[versions.length - 1].version;
109
+
110
+ if (currentVersion === latestVersion) {
111
+ return loadedModel as PersistenceModel<T>;
112
+ }
113
+
114
+ const migratedState = migrateState(
115
+ loadedModel.state,
116
+ currentVersion,
117
+ latestVersion,
118
+ versions,
119
+ );
120
+
121
+ return {
122
+ key: loadedModel.key,
123
+ state: migratedState,
124
+ version: latestVersion,
125
+ schemaVersion: latestVersion,
126
+ timestamp: now,
127
+ };
128
+ };
129
+
130
+ // ============================================
131
+ // VALIDATE VERSION
132
+ // ============================================
133
+
134
+ export const validateVersion = <T>(
135
+ state: unknown,
136
+ version: string,
137
+ versions: SchemaVersion<T>[],
138
+ ): boolean => {
139
+ const versionConfig = versions.find((v) => v.version === version);
140
+ if (!versionConfig?.validate) return true;
141
+ return versionConfig.validate(state);
142
+ };
@@ -0,0 +1,144 @@
1
+ // Router Adapter - Integration with @wrikka/solid-framework/router
2
+ // Clean Architecture: Adapter layer for router integration
3
+
4
+ import { createStore } from "#stores/modules/store";
5
+ import type { Store } from "#stores/modules/store/types";
6
+
7
+ // Router types (will be imported from @wrikka/solid-framework/router when available)
8
+ export interface Match {
9
+ readonly path: string;
10
+ readonly params: Readonly<Record<string, unknown>>;
11
+ readonly searchParams: Readonly<Record<string, unknown>>;
12
+ }
13
+
14
+ // ============================================
15
+ // ROUTER STORE SYNC
16
+ // ============================================
17
+
18
+ export interface RouterSyncOptions<T> {
19
+ selector?: (state: T) => Record<string, unknown>;
20
+ onRouteChange?: (match: Match, state: T) => void;
21
+ }
22
+
23
+ /**
24
+ * Sync store state with router params
25
+ */
26
+ export const syncStoreWithRouter = <T>(
27
+ store: Store<T>,
28
+ getMatch: () => Match | null,
29
+ options?: RouterSyncOptions<T>,
30
+ ): (() => void) => {
31
+ const unsubscribe = store.subscribe((state) => {
32
+ const match = getMatch();
33
+ if (!match) return;
34
+
35
+ // Update route meta based on store state
36
+ if (options?.selector) {
37
+ options.selector(state);
38
+ // Update router meta if needed
39
+ if (options.onRouteChange) {
40
+ options.onRouteChange(match, state);
41
+ }
42
+ }
43
+ });
44
+
45
+ return unsubscribe;
46
+ };
47
+
48
+ // ============================================
49
+ // ROUTER PARAMS STORE
50
+ // ============================================
51
+
52
+ export interface RouterParamsStore {
53
+ params: Record<string, unknown>;
54
+ searchParams: Record<string, unknown>;
55
+ path: string;
56
+ }
57
+
58
+ /**
59
+ * Create a store that syncs with router params
60
+ */
61
+ export const createRouterParamsStore = (
62
+ getMatch: () => Match | null,
63
+ now: number,
64
+ ): Store<RouterParamsStore> => {
65
+ const match = getMatch();
66
+ const initial: RouterParamsStore = {
67
+ params: match?.params ? { ...match.params } : {},
68
+ searchParams: match?.searchParams ? { ...match.searchParams } : {},
69
+ path: match?.path ?? "",
70
+ };
71
+ return createStore(initial, {}, now);
72
+ };
73
+
74
+ // ============================================
75
+ // ROUTER-AWARE ACTIONS
76
+ // ============================================
77
+
78
+ export interface RouterAction<T = unknown> {
79
+ type: string;
80
+ payload?: T;
81
+ navigate?: string;
82
+ replace?: boolean;
83
+ }
84
+
85
+ /**
86
+ * Create action that can trigger navigation
87
+ */
88
+ export const createRouterAction = <T = unknown>(
89
+ type: string,
90
+ navigateTo?: string,
91
+ ): ((payload?: T) => RouterAction<T>) => {
92
+ return (payload?: T): RouterAction<T> => ({
93
+ type,
94
+ payload,
95
+ navigate: navigateTo,
96
+ });
97
+ };
98
+
99
+ // ============================================
100
+ // ROUTER MIDDLEWARE
101
+ // ============================================
102
+
103
+ export interface RouterMiddlewareOptions {
104
+ persistState?: boolean;
105
+ restoreState?: boolean;
106
+ stateKey?: string;
107
+ }
108
+
109
+ /**
110
+ * Middleware to persist/restore state based on route
111
+ */
112
+ export const createRouterMiddleware = (options?: RouterMiddlewareOptions) => {
113
+ const {
114
+ persistState = true,
115
+ restoreState = true,
116
+ stateKey = "routeState",
117
+ } = options || {};
118
+
119
+ return {
120
+ onBeforeNavigation: (match: Match) => {
121
+ if (restoreState) {
122
+ // Restore state from storage based on route
123
+ const stored = sessionStorage.getItem(`${stateKey}:${match.path}`);
124
+ if (stored) {
125
+ try {
126
+ return JSON.parse(stored);
127
+ } catch {
128
+ return null;
129
+ }
130
+ }
131
+ }
132
+ return null;
133
+ },
134
+ onAfterNavigation: (match: Match, state: unknown) => {
135
+ if (persistState) {
136
+ // Persist state to storage based on route
137
+ sessionStorage.setItem(
138
+ `${stateKey}:${match.path}`,
139
+ JSON.stringify(state),
140
+ );
141
+ }
142
+ },
143
+ };
144
+ };
@@ -0,0 +1,6 @@
1
+ // Store Module - Storage Adapters
2
+ // Clean Architecture: Re-export all storage adapters
3
+
4
+ export * from "./indexed-db";
5
+ export * from "./local-storage";
6
+ export * from "./session-storage";
@@ -0,0 +1,83 @@
1
+ // Store Module - Storage Adapters
2
+ // Clean Architecture: IndexedDB implementation
3
+
4
+ import type { IIndexedDBStorage } from "#stores/modules/store/ports";
5
+
6
+ export const createIndexedDBAdapter = (): IIndexedDBStorage => {
7
+ let db: IDBDatabase | null = null;
8
+
9
+ return {
10
+ open: async (dbName: string, version: number): Promise<void> => {
11
+ return new Promise((resolve, reject) => {
12
+ const request = indexedDB.open(dbName, version);
13
+
14
+ request.onerror = () => reject(request.error);
15
+ request.onsuccess = () => {
16
+ db = request.result;
17
+ resolve();
18
+ };
19
+
20
+ request.onupgradeneeded = (event) => {
21
+ const database = (event.target as IDBOpenDBRequest).result;
22
+ if (!database.objectStoreNames.contains("stores")) {
23
+ database.createObjectStore("stores", { keyPath: "key" });
24
+ }
25
+ };
26
+ });
27
+ },
28
+ get: async <T>(storeName: string, key: string): Promise<T | null> => {
29
+ const database = db;
30
+ if (!database) return null;
31
+
32
+ return new Promise((resolve, reject) => {
33
+ const transaction = database.transaction([storeName], "readonly");
34
+ const store = transaction.objectStore(storeName);
35
+ const request = store.get(key);
36
+
37
+ request.onerror = () => reject(request.error);
38
+ request.onsuccess = () => {
39
+ resolve(request.result ? (request.result.value as T) : null);
40
+ };
41
+ });
42
+ },
43
+ set: async <T>(storeName: string, key: string, value: T): Promise<void> => {
44
+ const database = db;
45
+ if (!database) return;
46
+
47
+ return new Promise((resolve, reject) => {
48
+ const transaction = database.transaction([storeName], "readwrite");
49
+ const store = transaction.objectStore(storeName);
50
+ const request = store.put({ key, value });
51
+
52
+ request.onerror = () => reject(request.error);
53
+ request.onsuccess = () => resolve();
54
+ });
55
+ },
56
+ remove: async (storeName: string, key: string): Promise<void> => {
57
+ const database = db;
58
+ if (!database) return;
59
+
60
+ return new Promise((resolve, reject) => {
61
+ const transaction = database.transaction([storeName], "readwrite");
62
+ const store = transaction.objectStore(storeName);
63
+ const request = store.delete(key);
64
+
65
+ request.onerror = () => reject(request.error);
66
+ request.onsuccess = () => resolve();
67
+ });
68
+ },
69
+ clear: async (storeName: string): Promise<void> => {
70
+ const database = db;
71
+ if (!database) return;
72
+
73
+ return new Promise((resolve, reject) => {
74
+ const transaction = database.transaction([storeName], "readwrite");
75
+ const store = transaction.objectStore(storeName);
76
+ const request = store.clear();
77
+
78
+ request.onerror = () => reject(request.error);
79
+ request.onsuccess = () => resolve();
80
+ });
81
+ },
82
+ };
83
+ };
@@ -0,0 +1,44 @@
1
+ // Store Module - Storage Adapters
2
+ // Clean Architecture: LocalStorage implementation
3
+
4
+ import type { ILocalStorage } from "#stores/modules/store/ports";
5
+
6
+ export const createLocalStorageAdapter = (): ILocalStorage => {
7
+ const storage = typeof window !== "undefined" ? window.localStorage : null;
8
+
9
+ return {
10
+ get: <T>(key: string): T | null => {
11
+ if (!storage) return null;
12
+ try {
13
+ const item = storage.getItem(key);
14
+ return item ? (JSON.parse(item) as T) : null;
15
+ } catch {
16
+ return null;
17
+ }
18
+ },
19
+ set: <T>(key: string, value: T): void => {
20
+ if (!storage) return;
21
+ try {
22
+ storage.setItem(key, JSON.stringify(value));
23
+ } catch (error) {
24
+ console.error("Failed to set localStorage item:", error);
25
+ }
26
+ },
27
+ remove: (key: string): void => {
28
+ if (!storage) return;
29
+ try {
30
+ storage.removeItem(key);
31
+ } catch (error) {
32
+ console.error("Failed to remove localStorage item:", error);
33
+ }
34
+ },
35
+ clear: (): void => {
36
+ if (!storage) return;
37
+ try {
38
+ storage.clear();
39
+ } catch (error) {
40
+ console.error("Failed to clear localStorage:", error);
41
+ }
42
+ },
43
+ };
44
+ };