sibujs 1.0.0-beta.1

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 (302) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1630 -0
  3. package/dist/browser.cjs +815 -0
  4. package/dist/browser.d.cts +174 -0
  5. package/dist/browser.d.ts +174 -0
  6. package/dist/browser.js +458 -0
  7. package/dist/build.cjs +4970 -0
  8. package/dist/build.d.cts +630 -0
  9. package/dist/build.d.ts +630 -0
  10. package/dist/build.js +2478 -0
  11. package/dist/cdn.global.js +115 -0
  12. package/dist/chunk-27QC4FPL.js +67 -0
  13. package/dist/chunk-2ABBWCGC.js +65 -0
  14. package/dist/chunk-2MUNQYZ7.js +26 -0
  15. package/dist/chunk-2PSPKNUI.js +1711 -0
  16. package/dist/chunk-35CDLDX5.js +1758 -0
  17. package/dist/chunk-36MU4CFV.js +41 -0
  18. package/dist/chunk-3FIQOFI6.js +182 -0
  19. package/dist/chunk-3GHNC2BN.js +28 -0
  20. package/dist/chunk-3HLWWEPU.js +909 -0
  21. package/dist/chunk-3IVI3J54.js +252 -0
  22. package/dist/chunk-3KZ72WNW.js +944 -0
  23. package/dist/chunk-4AU64SQV.js +182 -0
  24. package/dist/chunk-4MOK7HAR.js +84 -0
  25. package/dist/chunk-4QK6FBDH.js +1429 -0
  26. package/dist/chunk-566Z7HXB.js +737 -0
  27. package/dist/chunk-5CRBB7XP.js +358 -0
  28. package/dist/chunk-5G67D3IZ.js +168 -0
  29. package/dist/chunk-5NCPAWBE.js +99 -0
  30. package/dist/chunk-5O2RKXR3.js +1444 -0
  31. package/dist/chunk-6BTBDO6A.js +633 -0
  32. package/dist/chunk-6IWEHW57.js +43 -0
  33. package/dist/chunk-6JGMNCD6.js +282 -0
  34. package/dist/chunk-6QRLJNXR.js +1425 -0
  35. package/dist/chunk-7HM5UE5T.js +270 -0
  36. package/dist/chunk-7JOLTGUH.js +58 -0
  37. package/dist/chunk-7MCWJCQK.js +909 -0
  38. package/dist/chunk-7RIIFP3E.js +1758 -0
  39. package/dist/chunk-7UASYN3G.js +254 -0
  40. package/dist/chunk-7W2WYHDI.js +741 -0
  41. package/dist/chunk-7Y35RDSJ.js +872 -0
  42. package/dist/chunk-A65GFJBL.js +65 -0
  43. package/dist/chunk-AD6ZIEDK.js +67 -0
  44. package/dist/chunk-AK5Y72F3.js +1426 -0
  45. package/dist/chunk-APOMMWH4.js +282 -0
  46. package/dist/chunk-ARZVTWIQ.js +1750 -0
  47. package/dist/chunk-AWWBM2BI.js +664 -0
  48. package/dist/chunk-AX5VEQTY.js +58 -0
  49. package/dist/chunk-AYTXVOW3.js +1708 -0
  50. package/dist/chunk-BG4A246G.js +1746 -0
  51. package/dist/chunk-BNFJJA2L.js +1425 -0
  52. package/dist/chunk-BPKPBVU5.js +59 -0
  53. package/dist/chunk-BPKPPSXC.js +282 -0
  54. package/dist/chunk-BPWKKK7F.js +1711 -0
  55. package/dist/chunk-CCKX6YTC.js +1735 -0
  56. package/dist/chunk-CIF5Z3MP.js +58 -0
  57. package/dist/chunk-CSXYU7IO.js +457 -0
  58. package/dist/chunk-D6JD4FDC.js +26 -0
  59. package/dist/chunk-E7NGA7X2.js +59 -0
  60. package/dist/chunk-EEPPJKAE.js +443 -0
  61. package/dist/chunk-EJMYGAGQ.js +717 -0
  62. package/dist/chunk-EL6Z5MDY.js +55 -0
  63. package/dist/chunk-EP7VRLEB.js +41 -0
  64. package/dist/chunk-ETMEC6FH.js +99 -0
  65. package/dist/chunk-EZ2WHYVL.js +65 -0
  66. package/dist/chunk-EZRVMSZK.js +67 -0
  67. package/dist/chunk-F2TRGINX.js +254 -0
  68. package/dist/chunk-F5JCIH3Q.js +642 -0
  69. package/dist/chunk-FGK3JKMN.js +909 -0
  70. package/dist/chunk-FQWPKSTD.js +1437 -0
  71. package/dist/chunk-FWHVLMCI.js +26 -0
  72. package/dist/chunk-GBEYQRO2.js +303 -0
  73. package/dist/chunk-GBLES3NK.js +248 -0
  74. package/dist/chunk-GQVGUQW6.js +1436 -0
  75. package/dist/chunk-HCV2T76T.js +457 -0
  76. package/dist/chunk-HS7ZKVPR.js +182 -0
  77. package/dist/chunk-HXDVV7HZ.js +909 -0
  78. package/dist/chunk-IB23VMO3.js +1746 -0
  79. package/dist/chunk-IEMZ7RTT.js +99 -0
  80. package/dist/chunk-IPGRSN42.js +1750 -0
  81. package/dist/chunk-IVMOK2QN.js +1750 -0
  82. package/dist/chunk-JCLGQO7T.js +443 -0
  83. package/dist/chunk-JDXL7KDB.js +1436 -0
  84. package/dist/chunk-JIIFW636.js +270 -0
  85. package/dist/chunk-JWGEEH7H.js +944 -0
  86. package/dist/chunk-K2BESAG7.js +1688 -0
  87. package/dist/chunk-K2U5YGF4.js +877 -0
  88. package/dist/chunk-K45FQ4Y4.js +175 -0
  89. package/dist/chunk-K7BPE427.js +1432 -0
  90. package/dist/chunk-KL3266RS.js +26 -0
  91. package/dist/chunk-KNN4P7DZ.js +84 -0
  92. package/dist/chunk-KP2DZH5Q.js +254 -0
  93. package/dist/chunk-KZHAJSQR.js +1636 -0
  94. package/dist/chunk-LBKGHMQV.js +1750 -0
  95. package/dist/chunk-LBTEPL7A.js +1731 -0
  96. package/dist/chunk-LEBBPTDB.js +1444 -0
  97. package/dist/chunk-LLH63WVQ.js +98 -0
  98. package/dist/chunk-LWVR2C4G.js +1711 -0
  99. package/dist/chunk-M3MDTVV2.js +896 -0
  100. package/dist/chunk-M5GNLDEO.js +303 -0
  101. package/dist/chunk-MFHVGKET.js +267 -0
  102. package/dist/chunk-MGWSG3PM.js +358 -0
  103. package/dist/chunk-MJNB47HB.js +19 -0
  104. package/dist/chunk-MLKGABMK.js +9 -0
  105. package/dist/chunk-MQWTY3JY.js +944 -0
  106. package/dist/chunk-MZZOQHNI.js +642 -0
  107. package/dist/chunk-NIHWGZS4.js +1426 -0
  108. package/dist/chunk-NSVVHQK5.js +41 -0
  109. package/dist/chunk-NVI2WE7D.js +443 -0
  110. package/dist/chunk-O7QBO3PH.js +58 -0
  111. package/dist/chunk-OAUPQBO2.js +270 -0
  112. package/dist/chunk-OB2LMD7C.js +297 -0
  113. package/dist/chunk-OHEYBWQU.js +58 -0
  114. package/dist/chunk-OI6OXUHJ.js +443 -0
  115. package/dist/chunk-OX2VMRMV.js +633 -0
  116. package/dist/chunk-P4FYE5TX.js +866 -0
  117. package/dist/chunk-P5KFWM4H.js +98 -0
  118. package/dist/chunk-PUMLE7RJ.js +1711 -0
  119. package/dist/chunk-Q4MFANBF.js +282 -0
  120. package/dist/chunk-QLEKZMMU.js +282 -0
  121. package/dist/chunk-RGGNGVO3.js +98 -0
  122. package/dist/chunk-RKJDRVV6.js +443 -0
  123. package/dist/chunk-S5BHU353.js +43 -0
  124. package/dist/chunk-SHQUSFH7.js +1426 -0
  125. package/dist/chunk-SMB4DBMD.js +182 -0
  126. package/dist/chunk-SNYHQP3D.js +743 -0
  127. package/dist/chunk-T24L3TBF.js +1717 -0
  128. package/dist/chunk-TAQNSOKT.js +692 -0
  129. package/dist/chunk-TDNY4SUA.js +41 -0
  130. package/dist/chunk-TNNF56IQ.js +1750 -0
  131. package/dist/chunk-TR7E6LYX.js +457 -0
  132. package/dist/chunk-URWUFH45.js +98 -0
  133. package/dist/chunk-UUSIH3XH.js +1429 -0
  134. package/dist/chunk-UYFNXLKR.js +1436 -0
  135. package/dist/chunk-V6F7KUWD.js +270 -0
  136. package/dist/chunk-VCZLXRMR.js +254 -0
  137. package/dist/chunk-VDHXSSBT.js +1426 -0
  138. package/dist/chunk-VM4QMKVK.js +254 -0
  139. package/dist/chunk-VWGYKYL2.js +737 -0
  140. package/dist/chunk-VX2OFBJN.js +1426 -0
  141. package/dist/chunk-VXVIE6DG.js +84 -0
  142. package/dist/chunk-W4OH7HG4.js +40 -0
  143. package/dist/chunk-WBVJX4GZ.js +98 -0
  144. package/dist/chunk-WDU2ZV4I.js +1426 -0
  145. package/dist/chunk-X6VUCICU.js +457 -0
  146. package/dist/chunk-XAY7FM7Y.js +618 -0
  147. package/dist/chunk-XJZ5Z2CM.js +642 -0
  148. package/dist/chunk-XKVFQTJJ.js +254 -0
  149. package/dist/chunk-XRLFASCY.js +22 -0
  150. package/dist/chunk-XYU6TZOW.js +182 -0
  151. package/dist/chunk-Y745CBVB.js +944 -0
  152. package/dist/chunk-YLBJSXYY.js +944 -0
  153. package/dist/chunk-YQJIKVPZ.js +1429 -0
  154. package/dist/chunk-YRM2VCZF.js +457 -0
  155. package/dist/chunk-YS33KBVJ.js +944 -0
  156. package/dist/chunk-Z27DZPDG.js +41 -0
  157. package/dist/chunk-ZXQ5NAEN.js +32 -0
  158. package/dist/contracts-B552GopR.d.cts +245 -0
  159. package/dist/contracts-B552GopR.d.ts +245 -0
  160. package/dist/contracts-Bg1ECISC.d.cts +245 -0
  161. package/dist/contracts-Bg1ECISC.d.ts +245 -0
  162. package/dist/contracts-CMriKJ6P.d.cts +245 -0
  163. package/dist/contracts-CMriKJ6P.d.ts +245 -0
  164. package/dist/contracts-DOrhwbke.d.cts +245 -0
  165. package/dist/contracts-DOrhwbke.d.ts +245 -0
  166. package/dist/data.cjs +1373 -0
  167. package/dist/data.d.cts +434 -0
  168. package/dist/data.d.ts +434 -0
  169. package/dist/data.js +945 -0
  170. package/dist/devtools.cjs +1357 -0
  171. package/dist/devtools.d.cts +473 -0
  172. package/dist/devtools.d.ts +473 -0
  173. package/dist/devtools.js +1084 -0
  174. package/dist/ecosystem.cjs +1046 -0
  175. package/dist/ecosystem.d.cts +247 -0
  176. package/dist/ecosystem.d.ts +247 -0
  177. package/dist/ecosystem.js +369 -0
  178. package/dist/extras.cjs +8457 -0
  179. package/dist/extras.d.cts +2356 -0
  180. package/dist/extras.d.ts +2356 -0
  181. package/dist/extras.js +5152 -0
  182. package/dist/index.cjs +2648 -0
  183. package/dist/index.d.cts +869 -0
  184. package/dist/index.d.ts +869 -0
  185. package/dist/index.js +386 -0
  186. package/dist/motion.cjs +604 -0
  187. package/dist/motion.d.cts +146 -0
  188. package/dist/motion.d.ts +146 -0
  189. package/dist/motion.js +346 -0
  190. package/dist/patterns.cjs +815 -0
  191. package/dist/patterns.d.cts +163 -0
  192. package/dist/patterns.d.ts +163 -0
  193. package/dist/patterns.js +296 -0
  194. package/dist/performance.cjs +927 -0
  195. package/dist/performance.d.cts +416 -0
  196. package/dist/performance.d.ts +416 -0
  197. package/dist/performance.js +654 -0
  198. package/dist/plugins.cjs +2487 -0
  199. package/dist/plugins.d.cts +393 -0
  200. package/dist/plugins.d.ts +393 -0
  201. package/dist/plugins.js +1504 -0
  202. package/dist/signal-BnWpq6WB.d.cts +5 -0
  203. package/dist/signal-BnWpq6WB.d.ts +5 -0
  204. package/dist/src/components/ErrorBoundary.d.ts +15 -0
  205. package/dist/src/components/ErrorBoundary.js +119 -0
  206. package/dist/src/core/catch.d.ts +11 -0
  207. package/dist/src/core/catch.js +28 -0
  208. package/dist/src/core/each.d.ts +13 -0
  209. package/dist/src/core/each.js +68 -0
  210. package/dist/src/core/for.d.ts +12 -0
  211. package/dist/src/core/for.js +67 -0
  212. package/dist/src/core/html.d.ts +137 -0
  213. package/dist/src/core/html.js +155 -0
  214. package/dist/src/core/htmlIf.d.ts +11 -0
  215. package/dist/src/core/htmlIf.js +18 -0
  216. package/dist/src/core/lazy.d.ts +7 -0
  217. package/dist/src/core/lazy.js +16 -0
  218. package/dist/src/core/mount.d.ts +7 -0
  219. package/dist/src/core/mount.js +12 -0
  220. package/dist/src/core/slots.d.ts +3 -0
  221. package/dist/src/core/slots.js +3 -0
  222. package/dist/src/core/suspense.d.ts +10 -0
  223. package/dist/src/core/suspense.js +33 -0
  224. package/dist/src/core/tagFactory.d.ts +13 -0
  225. package/dist/src/core/tagFactory.js +86 -0
  226. package/dist/src/core/test.d.ts +11 -0
  227. package/dist/src/core/test.js +28 -0
  228. package/dist/src/core/types.d.ts +2 -0
  229. package/dist/src/core/types.js +1 -0
  230. package/dist/src/core/useComputed.d.ts +6 -0
  231. package/dist/src/core/useComputed.js +30 -0
  232. package/dist/src/core/useEffect.d.ts +6 -0
  233. package/dist/src/core/useEffect.js +23 -0
  234. package/dist/src/core/useState.d.ts +10 -0
  235. package/dist/src/core/useState.js +34 -0
  236. package/dist/src/core/useStore.d.ts +19 -0
  237. package/dist/src/core/useStore.js +53 -0
  238. package/dist/src/core/useWatch.d.ts +8 -0
  239. package/dist/src/core/useWatch.js +23 -0
  240. package/dist/src/plugins/i18n.d.ts +6 -0
  241. package/dist/src/plugins/i18n.js +16 -0
  242. package/dist/src/plugins/router.d.ts +188 -0
  243. package/dist/src/plugins/router.js +1178 -0
  244. package/dist/src/reactivity/bindAttribute.d.ts +5 -0
  245. package/dist/src/reactivity/bindAttribute.js +31 -0
  246. package/dist/src/reactivity/bindChildNode.d.ts +10 -0
  247. package/dist/src/reactivity/bindChildNode.js +46 -0
  248. package/dist/src/reactivity/bindTextNode.d.ts +10 -0
  249. package/dist/src/reactivity/bindTextNode.js +27 -0
  250. package/dist/src/reactivity/signal.d.ts +3 -0
  251. package/dist/src/reactivity/signal.js +1 -0
  252. package/dist/src/reactivity/track.d.ts +18 -0
  253. package/dist/src/reactivity/track.js +73 -0
  254. package/dist/src/reactivity/useComputed.d.ts +6 -0
  255. package/dist/src/reactivity/useComputed.js +30 -0
  256. package/dist/src/reactivity/useEffect.d.ts +6 -0
  257. package/dist/src/reactivity/useEffect.js +23 -0
  258. package/dist/src/reactivity/useState.d.ts +10 -0
  259. package/dist/src/reactivity/useState.js +34 -0
  260. package/dist/src/reactivity/useStore.d.ts +19 -0
  261. package/dist/src/reactivity/useStore.js +53 -0
  262. package/dist/src/reactivity/useWatch.d.ts +8 -0
  263. package/dist/src/reactivity/useWatch.js +23 -0
  264. package/dist/src/utils/sanitize.d.ts +1 -0
  265. package/dist/src/utils/sanitize.js +8 -0
  266. package/dist/ssr-27FOM46T.js +35 -0
  267. package/dist/ssr-GFUTTSJD.js +22 -0
  268. package/dist/ssr-K7DCR6BZ.js +35 -0
  269. package/dist/ssr-O6LFMRFP.js +35 -0
  270. package/dist/ssr-QZEVGMMK.js +35 -0
  271. package/dist/ssr-SGVBCAGC.js +35 -0
  272. package/dist/ssr-UB2IXCYX.js +35 -0
  273. package/dist/ssr-XBZQNV4O.js +22 -0
  274. package/dist/ssr-Y76FSXDU.js +35 -0
  275. package/dist/ssr-YQJ4AYBD.js +35 -0
  276. package/dist/ssr.cjs +1757 -0
  277. package/dist/ssr.d.cts +478 -0
  278. package/dist/ssr.d.ts +478 -0
  279. package/dist/ssr.js +743 -0
  280. package/dist/tagFactory-CZPO4RXF.d.cts +34 -0
  281. package/dist/tagFactory-CZPO4RXF.d.ts +34 -0
  282. package/dist/tagFactory-CgImPVMY.d.cts +22 -0
  283. package/dist/tagFactory-CgImPVMY.d.ts +22 -0
  284. package/dist/tagFactory-Cw1iv5if.d.cts +22 -0
  285. package/dist/tagFactory-Cw1iv5if.d.ts +22 -0
  286. package/dist/tagFactory-DeAXq9ef.d.cts +30 -0
  287. package/dist/tagFactory-DeAXq9ef.d.ts +30 -0
  288. package/dist/tagFactory-SkY0a7L1.d.cts +22 -0
  289. package/dist/tagFactory-SkY0a7L1.d.ts +22 -0
  290. package/dist/testing.cjs +1919 -0
  291. package/dist/testing.d.cts +491 -0
  292. package/dist/testing.d.ts +491 -0
  293. package/dist/testing.js +1862 -0
  294. package/dist/ui.cjs +1497 -0
  295. package/dist/ui.d.cts +264 -0
  296. package/dist/ui.d.ts +264 -0
  297. package/dist/ui.js +900 -0
  298. package/dist/widgets.cjs +919 -0
  299. package/dist/widgets.d.cts +165 -0
  300. package/dist/widgets.d.ts +165 -0
  301. package/dist/widgets.js +545 -0
  302. package/package.json +134 -0
@@ -0,0 +1,630 @@
1
+ /**
2
+ * Official Vite plugin for SibuJS.
3
+ * Provides optimized builds, automatic component detection, and development enhancements.
4
+ */
5
+ interface SibuVitePluginOptions {
6
+ /** Enable HMR support for SibuJS components */
7
+ hmr?: boolean;
8
+ /** Enable automatic pure annotations for tree-shaking */
9
+ pureAnnotations?: boolean;
10
+ /** Component file patterns to watch */
11
+ include?: string[];
12
+ /** File patterns to exclude */
13
+ exclude?: string[];
14
+ /** Enable dev mode features (devtools, debug logging) */
15
+ devMode?: boolean;
16
+ /** Enable static template optimization (default: true in production) */
17
+ staticOptimize?: boolean;
18
+ /** Compile html`` tagged templates to direct function calls (default: true in production) */
19
+ compileTemplates?: boolean;
20
+ }
21
+ /**
22
+ * Vite plugin configuration for SibuJS projects.
23
+ * Returns a Vite-compatible plugin object.
24
+ *
25
+ * Note: This is a configuration helper. For full Vite plugin functionality,
26
+ * users should install @sibu/vite-plugin (when available).
27
+ */
28
+ declare function sibuVitePlugin(options?: SibuVitePluginOptions): {
29
+ name: string;
30
+ enforce?: "pre" | "post";
31
+ config?: () => Record<string, unknown>;
32
+ transform?: (code: string, id: string) => {
33
+ code: string;
34
+ map?: unknown;
35
+ } | null;
36
+ handleHotUpdate?: (ctx: {
37
+ file: string;
38
+ modules: unknown[];
39
+ }) => void;
40
+ };
41
+ /**
42
+ * Generate an optimized Vite configuration for SibuJS projects.
43
+ */
44
+ declare function createViteConfig(options?: {
45
+ /** Entry point */
46
+ entry?: string;
47
+ /** Output directory */
48
+ outDir?: string;
49
+ /** Enable SSR mode */
50
+ ssr?: boolean;
51
+ /** Additional Vite config overrides */
52
+ overrides?: Record<string, unknown>;
53
+ }): Record<string, unknown>;
54
+
55
+ /**
56
+ * Webpack plugin configuration for SibuJS projects.
57
+ * Provides build optimization, pure annotations, and development enhancements.
58
+ */
59
+ interface SibuWebpackPluginOptions {
60
+ /** Enable automatic pure annotations for tree-shaking */
61
+ pureAnnotations?: boolean;
62
+ /** Enable dev mode features (devtools, debug logging) */
63
+ devMode?: boolean;
64
+ }
65
+ /**
66
+ * Webpack plugin configuration helper for SibuJS.
67
+ * Returns webpack-compatible plugin and loader configurations.
68
+ *
69
+ * Usage:
70
+ * ```js
71
+ * const { sibuWebpackPlugin } = require('sibu/src/build/webpack');
72
+ * module.exports = {
73
+ * plugins: [sibuWebpackPlugin()],
74
+ * };
75
+ * ```
76
+ */
77
+ /** Minimal webpack compiler interface for plugin compatibility. */
78
+ interface WebpackCompiler {
79
+ hooks?: Record<string, {
80
+ tap: (name: string, callback: (...args: unknown[]) => void) => void;
81
+ } | undefined>;
82
+ options: {
83
+ module?: {
84
+ rules?: unknown[];
85
+ };
86
+ resolve?: {
87
+ mainFields?: string[];
88
+ };
89
+ plugins?: unknown[];
90
+ [key: string]: unknown;
91
+ };
92
+ [key: string]: unknown;
93
+ }
94
+ declare function sibuWebpackPlugin(options?: SibuWebpackPluginOptions): {
95
+ /** Plugin name */
96
+ name: string;
97
+ /** Apply function for webpack plugin API */
98
+ apply: (compiler: WebpackCompiler) => void;
99
+ };
100
+ /**
101
+ * Create a standalone webpack loader function for pure annotation injection.
102
+ * Can be used directly in webpack module rules.
103
+ */
104
+ declare function createPureAnnotationsLoader(): (source: string) => string;
105
+ /**
106
+ * Generate Webpack configuration for SibuJS projects.
107
+ *
108
+ * Usage:
109
+ * ```js
110
+ * const { createWebpackConfig } = require('sibu/src/build/webpack');
111
+ * module.exports = createWebpackConfig({
112
+ * entry: './src/index.ts',
113
+ * mode: 'production',
114
+ * });
115
+ * ```
116
+ */
117
+ declare function createWebpackConfig(options?: {
118
+ /** Entry point file */
119
+ entry?: string;
120
+ /** Output directory path */
121
+ outputPath?: string;
122
+ /** Build mode */
123
+ mode?: "development" | "production";
124
+ }): Record<string, unknown>;
125
+
126
+ /**
127
+ * CDN distribution utilities for SibuJS.
128
+ * Supports UMD builds for script tag usage and CDN delivery.
129
+ */
130
+ /**
131
+ * Register SibuJS on the global window object for CDN/script tag usage.
132
+ * Makes all exports available as window.Sibu.
133
+ *
134
+ * Usage (in a script tag):
135
+ * ```html
136
+ * <script src="https://unpkg.com/sibu@latest/dist/cdn.global.js"></script>
137
+ * <script>
138
+ * const { div, span, mount, signal } = window.Sibu;
139
+ * // Use SibuJS without a bundler
140
+ * </script>
141
+ * ```
142
+ */
143
+ declare function registerGlobal(): void;
144
+ /**
145
+ * Generate a UMD (Universal Module Definition) wrapper for a SibuJS module.
146
+ * The wrapper supports AMD (RequireJS), CommonJS (Node.js), and browser globals.
147
+ *
148
+ * @param name - The global variable name for browser usage
149
+ * @param factory - Factory function that returns the module's exports
150
+ * @returns The UMD wrapper code as a string
151
+ */
152
+ declare function umdWrapper(name: string, factory: () => unknown): string;
153
+ /**
154
+ * CDN URL helpers for common CDN providers.
155
+ * Generates URLs for including SibuJS from popular CDN services.
156
+ */
157
+ declare const cdnUrls: {
158
+ /**
159
+ * Generate an unpkg CDN URL.
160
+ * @param version - Package version (defaults to 'latest')
161
+ */
162
+ unpkg: (version?: string) => string;
163
+ /**
164
+ * Generate a jsDelivr CDN URL.
165
+ * @param version - Package version (defaults to 'latest')
166
+ */
167
+ jsdelivr: (version?: string) => string;
168
+ /**
169
+ * Generate a Skypack CDN URL (ESM-native).
170
+ * @param version - Package version (defaults to 'latest')
171
+ */
172
+ skypack: (version?: string) => string;
173
+ /**
174
+ * Generate a complete HTML script tag for including SibuJS from a CDN.
175
+ *
176
+ * @param provider - CDN provider to use (defaults to 'jsdelivr')
177
+ * @param version - Package version (defaults to 'latest')
178
+ * @returns An HTML script tag string
179
+ *
180
+ * @example
181
+ * ```ts
182
+ * cdnUrls.scriptTag('jsdelivr', '1.0.0')
183
+ * // => '<script src="https://cdn.jsdelivr.net/npm/sibu@1.0.0/dist/cdn.global.js"></script>'
184
+ * ```
185
+ */
186
+ scriptTag: (provider?: "unpkg" | "jsdelivr" | "skypack", version?: string) => string;
187
+ };
188
+ /**
189
+ * Generate an import map for SibuJS modules.
190
+ * Useful for browser-native ES modules without a bundler.
191
+ *
192
+ * Import maps allow browsers to resolve bare module specifiers like
193
+ * `import { div } from 'sibu'` without a build step.
194
+ *
195
+ * @param baseUrl - Base URL for module resolution (defaults to jsDelivr)
196
+ * @returns An import map object with serialization helpers
197
+ *
198
+ * @example
199
+ * ```ts
200
+ * const map = generateImportMap();
201
+ * document.head.innerHTML += map.toScriptTag();
202
+ *
203
+ * // Now you can use bare specifiers in module scripts:
204
+ * // <script type="module">
205
+ * // import { div, mount } from 'sibu';
206
+ * // </script>
207
+ * ```
208
+ */
209
+ declare function generateImportMap(baseUrl?: string): {
210
+ imports: Record<string, string>;
211
+ toJSON: () => string;
212
+ toScriptTag: () => string;
213
+ };
214
+
215
+ /**
216
+ * TypeScript declaration map utilities for SibuJS.
217
+ * Provides tsconfig helpers and declaration generation support
218
+ * for improved IDE experience and type-safe development.
219
+ */
220
+ /**
221
+ * Generate a recommended tsconfig.json for SibuJS projects.
222
+ *
223
+ * @param options - Customization options for the generated configuration
224
+ * @returns A complete tsconfig.json object
225
+ *
226
+ * @example
227
+ * ```ts
228
+ * import { generateTsConfig } from 'sibu/src/build/declarations';
229
+ * import { writeFileSync } from 'fs';
230
+ *
231
+ * const config = generateTsConfig({ outDir: './dist' });
232
+ * writeFileSync('tsconfig.json', JSON.stringify(config, null, 2));
233
+ * ```
234
+ */
235
+ declare function generateTsConfig(options?: {
236
+ /** TypeScript compilation target (default: 'ES2020') */
237
+ target?: string;
238
+ /** Output directory for compiled files */
239
+ outDir?: string;
240
+ /** Enable declaration map generation (default: true) */
241
+ declarationMap?: boolean;
242
+ /** Additional path aliases */
243
+ paths?: Record<string, string[]>;
244
+ }): Record<string, unknown>;
245
+ /**
246
+ * Validate that a project's TypeScript configuration is compatible with SibuJS.
247
+ *
248
+ * Checks for required settings, warns about suboptimal configurations,
249
+ * and suggests improvements for the best development experience.
250
+ *
251
+ * @param config - The tsconfig.json object to validate (the full config, including compilerOptions)
252
+ * @returns Validation result with warnings and suggestions
253
+ *
254
+ * @example
255
+ * ```ts
256
+ * import { validateTsConfig } from 'sibu/src/build/declarations';
257
+ * import { readFileSync } from 'fs';
258
+ *
259
+ * const tsconfig = JSON.parse(readFileSync('tsconfig.json', 'utf-8'));
260
+ * const result = validateTsConfig(tsconfig);
261
+ *
262
+ * if (!result.valid) {
263
+ * console.error('TypeScript configuration issues:', result.warnings);
264
+ * }
265
+ * result.suggestions.forEach(s => console.log('Suggestion:', s));
266
+ * ```
267
+ */
268
+ declare function validateTsConfig(config: Record<string, unknown>): {
269
+ valid: boolean;
270
+ warnings: string[];
271
+ suggestions: string[];
272
+ };
273
+
274
+ /**
275
+ * Bundle size analysis utilities for SibuJS.
276
+ * Provides tools to analyze, estimate, and report on bundle sizes
277
+ * for SibuJS projects.
278
+ */
279
+ /**
280
+ * Known approximate sizes (in bytes, minified + gzipped) for SibuJS modules.
281
+ * These estimates are based on the typical compiled output of each module
282
+ * and are useful for pre-build size budgeting.
283
+ */
284
+ declare const moduleSizes: Record<string, number>;
285
+ /**
286
+ * Analyze module sizes and dependencies.
287
+ *
288
+ * Takes a record of module names to their source code and computes
289
+ * size statistics for each module and the total bundle.
290
+ *
291
+ * @param modules - A map of module names to their source code strings
292
+ * @returns Analysis results with sizes, sorted rankings, and a report generator
293
+ *
294
+ * @example
295
+ * ```ts
296
+ * import { analyzeBundle } from 'sibu/src/build/analyzer';
297
+ *
298
+ * const result = analyzeBundle({
299
+ * 'app.ts': appSourceCode,
300
+ * 'components/Header.ts': headerSourceCode,
301
+ * 'components/Footer.ts': footerSourceCode,
302
+ * });
303
+ *
304
+ * console.log(result.report());
305
+ * // Total: 12.5 KB
306
+ * // app.ts: 8.2 KB (65.6%)
307
+ * // components/Header.ts: 2.8 KB (22.4%)
308
+ * // components/Footer.ts: 1.5 KB (12.0%)
309
+ * ```
310
+ */
311
+ declare function analyzeBundle(modules: Record<string, string>): {
312
+ /** Total bundle size in bytes */
313
+ totalSize: number;
314
+ /** Size per module in bytes */
315
+ moduleSizes: Record<string, number>;
316
+ /** Modules sorted by size (largest first) */
317
+ sorted: Array<{
318
+ name: string;
319
+ size: number;
320
+ percentage: number;
321
+ }>;
322
+ /** Format as human-readable report */
323
+ report: () => string;
324
+ };
325
+ /**
326
+ * Estimate the impact of importing specific SibuJS modules.
327
+ * Based on known approximate sizes of each module (minified + gzipped).
328
+ *
329
+ * This is useful for understanding the cost of specific imports
330
+ * before building, enabling informed decisions about which features to use.
331
+ *
332
+ * @param imports - Array of module paths to estimate (e.g., ['core/signal', 'core/html'])
333
+ * @returns Estimated size information with breakdown
334
+ *
335
+ * @example
336
+ * ```ts
337
+ * import { estimateImportSize } from 'sibu/src/build/analyzer';
338
+ *
339
+ * // Estimate cost of a minimal SibuJS app
340
+ * const estimate = estimateImportSize([
341
+ * 'core/html',
342
+ * 'core/mount',
343
+ * 'core/signal',
344
+ * 'core/effect',
345
+ * 'reactivity/track',
346
+ * 'reactivity/batch',
347
+ * ]);
348
+ *
349
+ * console.log(estimate.formatted);
350
+ * // Estimated bundle size: 3.17 KB (minified + gzipped)
351
+ * // core/html: 1.76 KB
352
+ * // core/effect: 0.34 KB
353
+ * // ...
354
+ * ```
355
+ */
356
+ declare function estimateImportSize(imports: string[]): {
357
+ /** Total estimated size in bytes */
358
+ estimated: number;
359
+ /** Size breakdown per module */
360
+ breakdown: Record<string, number>;
361
+ /** Human-readable formatted output */
362
+ formatted: string;
363
+ };
364
+
365
+ /**
366
+ * ESLint plugin configuration for SibuJS best practices.
367
+ * Provides rule definitions that can be used with an ESLint plugin.
368
+ */
369
+ interface LintViolation {
370
+ rule: string;
371
+ message: string;
372
+ severity: "error" | "warning";
373
+ line?: number;
374
+ column?: number;
375
+ }
376
+ /**
377
+ * Static analysis rules for SibuJS code.
378
+ * These check source code strings for common mistakes and anti-patterns.
379
+ */
380
+ declare const lintRules: {
381
+ /** Detect signal inside loops or conditionals */
382
+ "no-signals-in-conditionals": {
383
+ name: "no-signals-in-conditionals";
384
+ description: string;
385
+ check(source: string): LintViolation[];
386
+ };
387
+ /** Detect missing cleanup in effect */
388
+ "effect-cleanup": {
389
+ name: "effect-cleanup";
390
+ description: string;
391
+ check(source: string): LintViolation[];
392
+ };
393
+ /** Detect direct DOM mutation outside of reactive context */
394
+ "no-direct-dom-mutation": {
395
+ name: "no-direct-dom-mutation";
396
+ description: string;
397
+ check(source: string): LintViolation[];
398
+ };
399
+ /** Detect missing key prop in each() calls */
400
+ "each-requires-key": {
401
+ name: "each-requires-key";
402
+ description: string;
403
+ check(source: string): LintViolation[];
404
+ };
405
+ /** Detect unused reactive state */
406
+ "no-unused-state": {
407
+ name: "no-unused-state";
408
+ description: string;
409
+ check(source: string): LintViolation[];
410
+ };
411
+ };
412
+ /**
413
+ * Run all lint rules on source code.
414
+ */
415
+ declare function lintSource(source: string, rules?: string[]): LintViolation[];
416
+ /**
417
+ * Generate ESLint plugin configuration.
418
+ * Returns a config object that can be used in .eslintrc.
419
+ */
420
+ declare function generateEslintConfig(options?: {
421
+ severity?: "error" | "warning";
422
+ }): Record<string, unknown>;
423
+
424
+ /**
425
+ * IDE extension support for SibuJS.
426
+ * Provides metadata and utilities for VS Code and other IDE integrations.
427
+ */
428
+ /**
429
+ * Component metadata for IDE IntelliSense.
430
+ */
431
+ interface ComponentMeta {
432
+ name: string;
433
+ description: string;
434
+ props: Array<{
435
+ name: string;
436
+ type: string;
437
+ required: boolean;
438
+ default?: string;
439
+ description: string;
440
+ }>;
441
+ events?: Array<{
442
+ name: string;
443
+ description: string;
444
+ }>;
445
+ }
446
+ /**
447
+ * SibuJS component registry for IDE auto-completion.
448
+ * Returns metadata about all built-in SibuJS exports.
449
+ */
450
+ declare function getComponentMetadata(): ComponentMeta[];
451
+ /**
452
+ * Generate VS Code snippets for SibuJS.
453
+ */
454
+ declare function generateVSCodeSnippets(): Record<string, {
455
+ prefix: string;
456
+ body: string[];
457
+ description: string;
458
+ }>;
459
+ /**
460
+ * Generate a language configuration for SibuJS files.
461
+ * Provides bracket matching, comment toggling, and auto-close pairs.
462
+ */
463
+ declare function generateLanguageConfig(): {
464
+ comments: {
465
+ lineComment: string;
466
+ blockComment: [string, string];
467
+ };
468
+ brackets: [string, string][];
469
+ autoClosingPairs: Array<{
470
+ open: string;
471
+ close: string;
472
+ }>;
473
+ };
474
+ /**
475
+ * Generate type stubs for common SibuJS patterns.
476
+ * Useful for IDE auto-import suggestions.
477
+ */
478
+ declare function generateTypeStubs(): Record<string, string>;
479
+
480
+ /**
481
+ * Static analysis utilities for SibuJS build-time optimizations.
482
+ * Detects tagFactory calls that can be converted to template cloning.
483
+ */
484
+ interface StaticAnalysisResult {
485
+ /** Whether any static patterns were found */
486
+ hasStaticPatterns: boolean;
487
+ /** Detected static patterns with replacement info */
488
+ patterns: Array<{
489
+ /** Original source code of the call */
490
+ original: string;
491
+ /** The tag name (e.g., "div", "span") */
492
+ tag: string;
493
+ /** Static HTML that can be used as a template */
494
+ templateHtml: string;
495
+ /** Start index in original source */
496
+ start: number;
497
+ /** End index in original source */
498
+ end: number;
499
+ }>;
500
+ }
501
+ /**
502
+ * Analyze source code for static tagFactory patterns that can be
503
+ * converted to template cloning at build time.
504
+ *
505
+ * Detects patterns like:
506
+ * div({ class: "card", id: "main", nodes: "Hello" })
507
+ *
508
+ * And identifies them as candidates for:
509
+ * staticTemplate('<div class="card" id="main">Hello</div>')
510
+ */
511
+ declare function analyzeStaticTemplates(code: string): StaticAnalysisResult;
512
+
513
+ /**
514
+ * Build-time compiler for SibuJS html tagged templates.
515
+ *
516
+ * Transforms:
517
+ * html`<div class=${cls}><span>${() => count()}</span></div>`
518
+ *
519
+ * Into direct tagFactory calls:
520
+ * div({ class: __v[0], nodes: [span({ nodes: __v[1] })] })
521
+ *
522
+ * This eliminates the runtime template parser entirely, removing the ~1.5x
523
+ * overhead of the html`` authoring style vs direct function calls.
524
+ *
525
+ * The runtime parser remains available as a fallback for users who don't
526
+ * use a build step.
527
+ */
528
+ interface CompileResult {
529
+ /** The transformed source code, or null if no templates found */
530
+ code: string | null;
531
+ /** Set of HTML tag names used (need to be imported from sibu) */
532
+ usedTags: Set<string>;
533
+ /** Whether any SVG tags were used (needs tagFactory + SVG_NS import) */
534
+ usesSvg: boolean;
535
+ /** Number of templates compiled */
536
+ compiledCount: number;
537
+ }
538
+ /**
539
+ * Compile all html`` tagged templates in source code to direct tagFactory calls.
540
+ *
541
+ * Transforms:
542
+ * html`<div class=${cls}><span>${text}</span></div>`
543
+ *
544
+ * Into:
545
+ * ((v) => div({ class: v[0], nodes: [span({ nodes: v[1] })] }))([cls, text])
546
+ *
547
+ * This eliminates the runtime template parser entirely.
548
+ */
549
+ declare function compileHtmlTemplates(code: string): CompileResult;
550
+
551
+ /**
552
+ * Vite plugin for automatic route-based code splitting.
553
+ * Scans a routes directory and generates lazy-loaded route definitions.
554
+ */
555
+ interface RouteSplittingOptions {
556
+ /** Directory containing route files (default: "src/routes") */
557
+ routesDir?: string;
558
+ /** Glob patterns to exclude */
559
+ exclude?: string[];
560
+ /** Chunk name prefix (default: "route-") */
561
+ chunkPrefix?: string;
562
+ }
563
+ interface RouteEntry {
564
+ /** URL path pattern (e.g., "/users/:id") */
565
+ path: string;
566
+ /** Import path relative to project root */
567
+ importPath: string;
568
+ /** Generated chunk name */
569
+ chunkName: string;
570
+ /** Whether route has dynamic segments */
571
+ isDynamic: boolean;
572
+ }
573
+ /**
574
+ * Convert a file path within the routes directory to a URL pattern.
575
+ *
576
+ * Conventions:
577
+ * - index.ts -> /
578
+ * - about.ts -> /about
579
+ * - users/[id].ts -> /users/:id
580
+ * - blog/[...slug].ts -> /blog/*
581
+ * - _layout.ts -> skipped (layout file)
582
+ * - _middleware.ts -> skipped
583
+ */
584
+ declare function fileToRoute(relativePath: string): string | null;
585
+ /**
586
+ * Generate route entries from scanned files.
587
+ */
588
+ declare function buildRouteEntries(files: string[], chunkPrefix: string): RouteEntry[];
589
+ /**
590
+ * Vite plugin for automatic route-based code splitting.
591
+ *
592
+ * Scans the routes directory and generates a virtual module `virtual:sibu-routes`
593
+ * that exports lazy-loaded route definitions compatible with Sibu's router.
594
+ *
595
+ * @example
596
+ * ```ts
597
+ * // vite.config.ts
598
+ * import { sibuVitePlugin } from "sibu/build";
599
+ * import { sibuRouteSplitting } from "sibu/build";
600
+ *
601
+ * export default {
602
+ * plugins: [sibuVitePlugin(), sibuRouteSplitting()],
603
+ * };
604
+ *
605
+ * // In your app:
606
+ * import { routes } from "virtual:sibu-routes";
607
+ * import { setRoutes } from "sibu/plugins";
608
+ * setRoutes(routes);
609
+ * ```
610
+ */
611
+ declare function sibuRouteSplitting(options?: RouteSplittingOptions): {
612
+ name: string;
613
+ enforce: "pre";
614
+ resolveId: (id: string) => string | undefined;
615
+ load: (id: string) => Promise<string | undefined>;
616
+ handleHotUpdate?: (ctx: {
617
+ file: string;
618
+ server: {
619
+ moduleGraph: {
620
+ invalidateModule: (mod: unknown) => void;
621
+ getModuleById: (id: string) => unknown;
622
+ };
623
+ ws: {
624
+ send: (msg: unknown) => void;
625
+ };
626
+ };
627
+ }) => void;
628
+ };
629
+
630
+ export { type CompileResult, type ComponentMeta, type LintViolation, type RouteSplittingOptions, type SibuVitePluginOptions, type SibuWebpackPluginOptions, type StaticAnalysisResult, analyzeBundle, analyzeStaticTemplates, buildRouteEntries, cdnUrls, compileHtmlTemplates, createPureAnnotationsLoader, createViteConfig, createWebpackConfig, estimateImportSize, fileToRoute, generateEslintConfig, generateImportMap, generateLanguageConfig, generateTsConfig, generateTypeStubs, generateVSCodeSnippets, getComponentMetadata, lintRules, lintSource, moduleSizes, registerGlobal, sibuRouteSplitting, sibuVitePlugin, sibuWebpackPlugin, umdWrapper, validateTsConfig };