xanix 1.0.20 → 1.0.21

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 (275) hide show
  1. package/dist/bin/bundler/cache/buildCache.js +9 -11
  2. package/dist/bin/bundler/cache/index.js +70 -116
  3. package/dist/bin/bundler/cache/utils.d.ts +3 -2
  4. package/dist/bin/bundler/cache/utils.js +27 -24
  5. package/dist/bin/bundler/client/build.js +1 -1
  6. package/dist/bin/bundler/client/plugins/Transformer/TransformCacheFunction copy.d.ts +3 -0
  7. package/dist/bin/bundler/client/plugins/Transformer/TransformCacheFunction copy.js +32 -0
  8. package/dist/bin/bundler/client/plugins/Transformer/TransformCacheFunction.d.ts +1 -1
  9. package/dist/bin/bundler/client/plugins/Transformer/TransformCacheFunction.js +1 -1
  10. package/dist/bin/bundler/client/plugins/Transformer/TransformCreateSession.d.ts +1 -1
  11. package/dist/bin/bundler/client/plugins/Transformer/TransformCreateSession.js +1 -1
  12. package/dist/bin/bundler/client/plugins/Transformer/TransformDevModule.d.ts +13 -0
  13. package/dist/bin/bundler/client/plugins/Transformer/{transformModuleCache.js → TransformDevModule.js} +6 -18
  14. package/dist/bin/bundler/client/plugins/Transformer/TransformServerFunction.d.ts +1 -1
  15. package/dist/bin/bundler/client/plugins/Transformer/TransformServerFunction.js +1 -1
  16. package/dist/bin/bundler/client/plugins/Transformer/cacheFunctionReplacer.d.ts +3 -0
  17. package/dist/bin/bundler/client/plugins/Transformer/cacheFunctionReplacer.js +32 -0
  18. package/dist/bin/bundler/client/plugins/Transformer/cacheFunctionTransformer.d.ts +3 -0
  19. package/dist/bin/bundler/client/plugins/Transformer/cacheFunctionTransformer.js +32 -0
  20. package/dist/bin/bundler/client/plugins/Transformer/serverFunctionReplacer.d.ts +3 -0
  21. package/dist/bin/bundler/client/plugins/Transformer/serverFunctionReplacer.js +32 -0
  22. package/dist/bin/bundler/client/plugins/Transformer/useServerReplacer.d.ts +3 -0
  23. package/dist/bin/bundler/client/plugins/Transformer/useServerReplacer.js +42 -0
  24. package/dist/bin/bundler/client/plugins/Transformer.js +4 -2
  25. package/dist/bin/bundler/client/plugins/XanixAppRoot.d.ts +2 -0
  26. package/dist/bin/bundler/client/plugins/XanixAppRoot.js +46 -0
  27. package/dist/bin/bundler/client/plugins/XanixPage.js +30 -0
  28. package/dist/bin/bundler/client/plugins/XanixPages.js +8 -8
  29. package/dist/bin/bundler/client/plugins/replacer/cacheFunctionReplacer.d.ts +1 -1
  30. package/dist/bin/bundler/client/plugins/replacer/cacheFunctionReplacer.js +5 -1
  31. package/dist/bin/bundler/client/plugins/replacer/serverFunctionReplacer.d.ts +1 -1
  32. package/dist/bin/bundler/client/plugins/replacer/serverFunctionReplacer.js +5 -1
  33. package/dist/bin/bundler/client/plugins/replacer/useServerReplacer.d.ts +1 -1
  34. package/dist/bin/bundler/client/plugins/replacer/useServerReplacer.js +7 -3
  35. package/dist/bin/bundler/server/build.js +1 -1
  36. package/dist/bin/bundler/server/plugins/Transformer/TransformCacheFunction copy.d.ts +3 -0
  37. package/dist/bin/bundler/server/plugins/Transformer/TransformCacheFunction copy.js +32 -0
  38. package/dist/bin/bundler/server/plugins/Transformer/TransformCacheFunction.d.ts +1 -1
  39. package/dist/bin/bundler/server/plugins/Transformer/TransformCacheFunction.js +1 -1
  40. package/dist/bin/bundler/server/plugins/Transformer/TransformCreateSession.d.ts +1 -1
  41. package/dist/bin/bundler/server/plugins/Transformer/TransformCreateSession.js +1 -1
  42. package/dist/bin/bundler/server/plugins/Transformer/TransformExpressFunction.d.ts +1 -1
  43. package/dist/bin/bundler/server/plugins/Transformer/TransformExpressFunction.js +1 -1
  44. package/dist/bin/bundler/server/plugins/Transformer/TransformPage.js +1 -1
  45. package/dist/bin/bundler/server/plugins/Transformer/TransformServerFunction.d.ts +1 -1
  46. package/dist/bin/bundler/server/plugins/Transformer/TransformServerFunction.js +1 -1
  47. package/dist/bin/bundler/server/plugins/Transformer/cacheFunctionReplacer.d.ts +3 -0
  48. package/dist/bin/bundler/server/plugins/Transformer/cacheFunctionReplacer.js +32 -0
  49. package/dist/bin/bundler/server/plugins/Transformer/expressFunctionReplace.d.ts +3 -0
  50. package/dist/bin/bundler/server/plugins/Transformer/expressFunctionReplace.js +24 -0
  51. package/dist/bin/bundler/server/plugins/Transformer/pageReplacer.d.ts +4 -0
  52. package/dist/bin/bundler/server/plugins/Transformer/pageReplacer.js +31 -0
  53. package/dist/bin/bundler/server/plugins/Transformer/serverFunctionReplacer.d.ts +3 -0
  54. package/dist/bin/bundler/server/plugins/Transformer/serverFunctionReplacer.js +32 -0
  55. package/dist/bin/bundler/server/plugins/Transformer/useServerReplacer.d.ts +3 -0
  56. package/dist/bin/bundler/server/plugins/Transformer/useServerReplacer.js +42 -0
  57. package/dist/bin/bundler/server/plugins/Transformer copy.js +3 -3
  58. package/dist/bin/bundler/server/plugins/Transformer.js +2 -2
  59. package/dist/bin/bundler/server/plugins/replacer/cacheFunctionReplacer.d.ts +1 -1
  60. package/dist/bin/bundler/server/plugins/replacer/cacheFunctionReplacer.js +5 -1
  61. package/dist/bin/bundler/server/plugins/replacer/serverFunctionReplacer copy.d.ts +3 -0
  62. package/dist/bin/bundler/server/plugins/replacer/serverFunctionReplacer copy.js +26 -0
  63. package/dist/bin/bundler/server/plugins/replacer/serverFunctionReplacer.d.ts +1 -1
  64. package/dist/bin/bundler/server/plugins/replacer/serverFunctionReplacer.js +5 -1
  65. package/dist/bin/bundler/server/plugins/replacer/serverReplacer.d.ts +3 -0
  66. package/dist/bin/bundler/server/plugins/replacer/serverReplacer.js +26 -0
  67. package/dist/bin/bundler/server/plugins/replacer/useServerReplacer.d.ts +2 -2
  68. package/dist/bin/bundler/server/plugins/replacer/useServerReplacer.js +9 -5
  69. package/dist/bin/cli/dev.js +85 -71
  70. package/dist/bin/cli/start/index.d.ts +4 -1
  71. package/dist/bin/cli/start/index.js +60 -9
  72. package/dist/bin/finder/callbackReplacer.d.ts +2 -0
  73. package/dist/bin/finder/callbackReplacer.js +52 -0
  74. package/dist/bin/finder/findImport.d.ts +9 -0
  75. package/dist/bin/finder/findImport.js +50 -0
  76. package/dist/bin/finder/findImports.d.ts +16 -0
  77. package/dist/bin/finder/findImports.js +45 -0
  78. package/dist/bin/finder/findPage.d.ts +9 -0
  79. package/dist/bin/finder/findPage.js +30 -0
  80. package/dist/bin/finder/importFinder.d.ts +9 -0
  81. package/dist/bin/finder/importFinder.js +50 -0
  82. package/dist/bin/finder/pageFinder.d.ts +9 -0
  83. package/dist/bin/finder/pageFinder.js +30 -0
  84. package/dist/bin/finder/stripComments.d.ts +3 -0
  85. package/dist/bin/finder/stripComments.js +15 -0
  86. package/dist/bin/include/path.d.ts +5 -1
  87. package/dist/bin/include/path.js +15 -1
  88. package/dist/bin/include/sendFinder.d.ts +4 -1
  89. package/dist/bin/include/sendFinder.js +88 -53
  90. package/dist/bin/index.js +0 -0
  91. package/dist/bin/modifier/callbackReplacer.js +35 -80
  92. package/dist/bin/modifier/findImports.d.ts +16 -0
  93. package/dist/bin/modifier/findImports.js +45 -0
  94. package/dist/bin/modifier/importFinder.js +44 -63
  95. package/dist/bin/modifier/pageFinder.d.ts +1 -1
  96. package/dist/bin/modifier/pageFinder.js +19 -124
  97. package/dist/bin/modifier/sendFinder.d.ts +9 -0
  98. package/dist/bin/modifier/sendFinder.js +135 -0
  99. package/dist/bin/modifier/sriptCommnet.d.ts +1 -0
  100. package/dist/bin/modifier/sriptCommnet.js +12 -5
  101. package/dist/bin/modifier/stripComments.d.ts +3 -0
  102. package/dist/bin/modifier/stripComments.js +15 -0
  103. package/dist/bin/plugins/XanixAssets.js +2 -2
  104. package/dist/bin/plugins/XanixCss.js +13 -13
  105. package/dist/bin/plugins/XanixDocument.js +4 -4
  106. package/dist/components/Head.js +1 -1
  107. package/dist/hooks/encript.d.ts +2 -0
  108. package/dist/hooks/encript.js +13 -0
  109. package/dist/hooks/server.js +2 -2
  110. package/dist/hooks/session.js +2 -2
  111. package/dist/index.js +0 -0
  112. package/dist/libs/encoder.d.ts +2 -0
  113. package/dist/libs/encoder.js +13 -0
  114. package/dist/libs/encript.d.ts +2 -0
  115. package/dist/libs/encript.js +30 -0
  116. package/dist/navigate.js +1 -1
  117. package/dist/server/express/Router.js +4 -4
  118. package/dist/server/express/page.d.ts +1 -1
  119. package/dist/server/express/page.js +1 -1
  120. package/dist/types/assets.d.ts +72 -72
  121. package/dist/types/express.d.ts +11 -11
  122. package/dist/types/globals.d.ts +18 -18
  123. package/dist/types/xanix-virtual.d.ts +35 -35
  124. package/package.json +57 -60
  125. package/dist/bin/bundler/Cache.d.ts +0 -1
  126. package/dist/bin/bundler/Cache.js +0 -210
  127. package/dist/bin/bundler/External.d.ts +0 -3
  128. package/dist/bin/bundler/External.js +0 -6
  129. package/dist/bin/bundler/buildClient.d.ts +0 -3
  130. package/dist/bin/bundler/buildClient.js +0 -42
  131. package/dist/bin/bundler/buildServer.d.ts +0 -7
  132. package/dist/bin/bundler/buildServer.js +0 -50
  133. package/dist/bin/bundler/cache/plugin/Transformer.d.ts +0 -3
  134. package/dist/bin/bundler/cache/plugin/Transformer.js +0 -42
  135. package/dist/bin/bundler/client/plugins/Transformer/TransformExpress.d.ts +0 -9
  136. package/dist/bin/bundler/client/plugins/Transformer/TransformExpress.js +0 -26
  137. package/dist/bin/bundler/client/plugins/Transformer/TransformPage.d.ts +0 -29
  138. package/dist/bin/bundler/client/plugins/Transformer/TransformPage.js +0 -77
  139. package/dist/bin/bundler/client/plugins/Transformer/TransformReactContext.d.ts +0 -17
  140. package/dist/bin/bundler/client/plugins/Transformer/TransformReactContext.js +0 -101
  141. package/dist/bin/bundler/client/plugins/Transformer/transformModuleCache.d.ts +0 -15
  142. package/dist/bin/bundler/client/plugins/Transformer copy.d.ts +0 -3
  143. package/dist/bin/bundler/client/plugins/Transformer copy.js +0 -70
  144. package/dist/bin/bundler/client/plugins/VirtualDev.d.ts +0 -2
  145. package/dist/bin/bundler/client/plugins/VirtualDev.js +0 -34
  146. package/dist/bin/bundler/client/plugins/XanixReactRefresh.d.ts +0 -2
  147. package/dist/bin/bundler/client/plugins/XanixReactRefresh.js +0 -22
  148. package/dist/bin/bundler/config/defines.d.ts +0 -20
  149. package/dist/bin/bundler/config/defines.js +0 -21
  150. package/dist/bin/bundler/config/external.d.ts +0 -1
  151. package/dist/bin/bundler/config/external.js +0 -12
  152. package/dist/bin/bundler/config/loadEnv.d.ts +0 -20
  153. package/dist/bin/bundler/config/loadEnv.js +0 -48
  154. package/dist/bin/bundler/config/output.d.ts +0 -10
  155. package/dist/bin/bundler/config/output.js +0 -52
  156. package/dist/bin/bundler/externalResolver-dep.d.ts +0 -3
  157. package/dist/bin/bundler/externalResolver-dep.js +0 -203
  158. package/dist/bin/bundler/externalResolver.d.ts +0 -3
  159. package/dist/bin/bundler/externalResolver.js +0 -203
  160. package/dist/bin/bundler/plugins/TransformServer/TransformExpress.d.ts +0 -9
  161. package/dist/bin/bundler/plugins/TransformServer/TransformExpress.js +0 -26
  162. package/dist/bin/bundler/plugins/TransformServer/TransformPage.d.ts +0 -25
  163. package/dist/bin/bundler/plugins/TransformServer/TransformPage.js +0 -79
  164. package/dist/bin/bundler/plugins/TransformServer/index.d.ts +0 -3
  165. package/dist/bin/bundler/plugins/TransformServer/index.js +0 -103
  166. package/dist/bin/bundler/plugins/XanixAssets.d.ts +0 -5
  167. package/dist/bin/bundler/plugins/XanixAssets.js +0 -51
  168. package/dist/bin/bundler/plugins/XanixCacheDeps-dep.d.ts +0 -2
  169. package/dist/bin/bundler/plugins/XanixCacheDeps-dep.js +0 -150
  170. package/dist/bin/bundler/plugins/XanixCacheDeps.d.ts +0 -2
  171. package/dist/bin/bundler/plugins/XanixCacheDeps.js +0 -150
  172. package/dist/bin/bundler/plugins/XanixDocument/index.js +0 -53
  173. package/dist/bin/bundler/plugins/XanixEntryFinder/finder.d.ts +0 -11
  174. package/dist/bin/bundler/plugins/XanixEntryFinder/finder.js +0 -149
  175. package/dist/bin/bundler/plugins/XanixEntryFinder/index.d.ts +0 -6
  176. package/dist/bin/bundler/plugins/XanixEntryFinder/index.js +0 -37
  177. package/dist/bin/bundler/plugins/XanixEntryFinder-dep/finder.d.ts +0 -11
  178. package/dist/bin/bundler/plugins/XanixEntryFinder-dep/finder.js +0 -149
  179. package/dist/bin/bundler/plugins/XanixEntryFinder-dep/index.d.ts +0 -6
  180. package/dist/bin/bundler/plugins/XanixEntryFinder-dep/index.js +0 -37
  181. package/dist/bin/bundler/plugins/XanixEnv.d.ts +0 -15
  182. package/dist/bin/bundler/plugins/XanixEnv.js +0 -44
  183. package/dist/bin/bundler/plugins/XanixPageTransform/index.d.ts +0 -2
  184. package/dist/bin/bundler/plugins/XanixPageTransform/index.js +0 -62
  185. package/dist/bin/bundler/plugins/XanixPageTransform/transformer copy.d.ts +0 -18
  186. package/dist/bin/bundler/plugins/XanixPageTransform/transformer copy.js +0 -414
  187. package/dist/bin/bundler/plugins/XanixPageTransform/transformer.d.ts +0 -23
  188. package/dist/bin/bundler/plugins/XanixPageTransform/transformer.js +0 -589
  189. package/dist/bin/bundler/plugins/XanixReactRefresh copy.d.ts +0 -2
  190. package/dist/bin/bundler/plugins/XanixReactRefresh copy.js +0 -121
  191. package/dist/bin/bundler/plugins/XanixReactRefresh.d.ts +0 -2
  192. package/dist/bin/bundler/plugins/XanixReactRefresh.js +0 -170
  193. package/dist/bin/bundler/plugins/XanixResolveCacheDeps/BuildClientCache.d.ts +0 -11
  194. package/dist/bin/bundler/plugins/XanixResolveCacheDeps/BuildClientCache.js +0 -129
  195. package/dist/bin/bundler/plugins/XanixResolveCacheDeps/index copy.d.ts +0 -15
  196. package/dist/bin/bundler/plugins/XanixResolveCacheDeps/index copy.js +0 -228
  197. package/dist/bin/bundler/plugins/XanixResolveCacheDeps/index.d.ts +0 -7
  198. package/dist/bin/bundler/plugins/XanixResolveCacheDeps/index.js +0 -166
  199. package/dist/bin/bundler/plugins/XanixResolveCacheDeps-dep/BuildClientCache.d.ts +0 -11
  200. package/dist/bin/bundler/plugins/XanixResolveCacheDeps-dep/BuildClientCache.js +0 -129
  201. package/dist/bin/bundler/plugins/XanixResolveCacheDeps-dep/index.d.ts +0 -5
  202. package/dist/bin/bundler/plugins/XanixResolveCacheDeps-dep/index.js +0 -26
  203. package/dist/bin/bundler/plugins/XanixResolver.d.ts +0 -11
  204. package/dist/bin/bundler/plugins/XanixResolver.js +0 -55
  205. package/dist/bin/bundler/plugins/XanixServerTransform.d.ts +0 -5
  206. package/dist/bin/bundler/plugins/XanixServerTransform.js +0 -207
  207. package/dist/bin/bundler/plugins/XanixTransform.d.ts +0 -3
  208. package/dist/bin/bundler/plugins/XanixTransform.js +0 -23
  209. package/dist/bin/bundler/plugins/XanixTsconfigAlias.d.ts +0 -19
  210. package/dist/bin/bundler/plugins/XanixTsconfigAlias.js +0 -197
  211. package/dist/bin/bundler/plugins/XanixUseServer.d.ts +0 -7
  212. package/dist/bin/bundler/plugins/XanixUseServer.js +0 -445
  213. package/dist/bin/bundler/plugins/plugins.d.ts +0 -9
  214. package/dist/bin/bundler/plugins/plugins.js +0 -37
  215. package/dist/bin/bundler/requireCache.d.ts +0 -3
  216. package/dist/bin/bundler/requireCache.js +0 -85
  217. package/dist/bin/bundler/server/plugins/ServerAction.d.ts +0 -3
  218. package/dist/bin/bundler/server/plugins/ServerAction.js +0 -9
  219. package/dist/bin/bundler/server/plugins/Transformer/ServerAction.d.ts +0 -11
  220. package/dist/bin/bundler/server/plugins/Transformer/ServerAction.js +0 -28
  221. package/dist/bin/bundler/server/plugins/Transformer/TransformExpress copy.d.ts +0 -11
  222. package/dist/bin/bundler/server/plugins/Transformer/TransformExpress copy.js +0 -22
  223. package/dist/bin/bundler/server/plugins/Transformer/TransformExpress.d.ts +0 -10
  224. package/dist/bin/bundler/server/plugins/Transformer/TransformExpress.js +0 -19
  225. package/dist/bin/bundler/server/plugins/Transformer/TransformReactContext.d.ts +0 -17
  226. package/dist/bin/bundler/server/plugins/Transformer/TransformReactContext.js +0 -101
  227. package/dist/bin/bundler/server/plugins/Transformer/TransformServerAction copy.d.ts +0 -14
  228. package/dist/bin/bundler/server/plugins/Transformer/TransformServerAction copy.js +0 -38
  229. package/dist/bin/bundler/server/types.d.ts +0 -5
  230. package/dist/bin/bundler/server/types.js +0 -1
  231. package/dist/bin/bundler/watchClient.d.ts +0 -12
  232. package/dist/bin/bundler/watchClient.js +0 -104
  233. package/dist/bin/bundler/watchServer.d.ts +0 -10
  234. package/dist/bin/bundler/watchServer.js +0 -139
  235. package/dist/bin/cli/dev/dev.d.ts +0 -2
  236. package/dist/bin/cli/dev/dev.js +0 -178
  237. package/dist/bin/cli/start/start.d.ts +0 -2
  238. package/dist/bin/cli/start/start.js +0 -27
  239. package/dist/bin/include/entry.d.ts +0 -2
  240. package/dist/bin/include/entry.js +0 -21
  241. package/dist/bin/plugins/XanixDocument/XanixDocument.d.ts +0 -2
  242. package/dist/bin/plugins/XanixDocument/XanixDocument.js +0 -50
  243. package/dist/bin/plugins/XanixDocument/index.d.ts +0 -2
  244. package/dist/bin/plugins/XanixDocument/index.js +0 -50
  245. package/dist/bin/plugins/XanixPageTransform-dep/index.d.ts +0 -2
  246. package/dist/bin/plugins/XanixPageTransform-dep/index.js +0 -62
  247. package/dist/bin/plugins/XanixPageTransform-dep/transformer.d.ts +0 -23
  248. package/dist/bin/plugins/XanixPageTransform-dep/transformer.js +0 -589
  249. package/dist/bin/plugins/XanixServerTransform.d.ts +0 -5
  250. package/dist/bin/plugins/XanixServerTransform.js +0 -207
  251. package/dist/bin/plugins/XanixUseServer.d.ts +0 -7
  252. package/dist/bin/plugins/XanixUseServer.js +0 -445
  253. package/dist/bin/plugins/plugins.d.ts +0 -8
  254. package/dist/bin/plugins/plugins.js +0 -31
  255. package/dist/components/Script.d.ts +0 -3
  256. package/dist/components/Script.js +0 -5
  257. package/dist/dev.d.ts +0 -1
  258. package/dist/dev.js +0 -25
  259. package/dist/react/createContext.d.ts +0 -3
  260. package/dist/react/createContext.js +0 -11
  261. package/dist/react/index.d.ts +0 -12
  262. package/dist/react/index.js +0 -3
  263. package/dist/server/express/Ruter.d.ts +0 -2
  264. package/dist/server/express/Ruter.js +0 -15
  265. package/dist/server/runtime/createServer.d.ts +0 -12
  266. package/dist/server/runtime/createServer.js +0 -62
  267. package/dist/server/runtime/index.d.ts +0 -3
  268. package/dist/server/runtime/index.js +0 -3
  269. package/dist/server/runtime/readManifest.d.ts +0 -14
  270. package/dist/server/runtime/readManifest.js +0 -9
  271. package/dist/server/runtime/xanixPage.d.ts +0 -11
  272. package/dist/server/runtime/xanixPage.js +0 -92
  273. /package/dist/bin/bundler/{plugins/XanixDocument/index.d.ts → client/plugins/XanixPage.d.ts} +0 -0
  274. /package/dist/bin/{cli/start/utils.d.ts → bundler/server/plugins/replacer/useServer.d.ts} +0 -0
  275. /package/dist/bin/{cli/start/utils.js → bundler/server/plugins/replacer/useServer.js} +0 -0
@@ -1,72 +1,72 @@
1
- declare module "*.css" {
2
- const mod: { src: string };
3
- export default mod;
4
- }
5
- declare module "*.png" {
6
- const mod: { src: string };
7
- export default mod;
8
- }
9
- declare module "*.jpg" {
10
- const mod: { src: string };
11
- export default mod;
12
- }
13
- declare module "*.jpeg" {
14
- const mod: { src: string };
15
- export default mod;
16
- }
17
- declare module "*.gif" {
18
- const mod: { src: string };
19
- export default mod;
20
- }
21
- declare module "*.svg" {
22
- const mod: { src: string };
23
- export default mod;
24
- }
25
- declare module "*.webp" {
26
- const mod: { src: string };
27
- export default mod;
28
- }
29
- declare module "*.avif" {
30
- const mod: { src: string };
31
- export default mod;
32
- }
33
- declare module "*.ico" {
34
- const mod: { src: string };
35
- export default mod;
36
- }
37
- declare module "*.bmp" {
38
- const mod: { src: string };
39
- export default mod;
40
- }
41
- declare module "*.mp4" {
42
- const mod: { src: string };
43
- export default mod;
44
- }
45
- declare module "*.webm" {
46
- const mod: { src: string };
47
- export default mod;
48
- }
49
- declare module "*.ogg" {
50
- const mod: { src: string };
51
- export default mod;
52
- }
53
- declare module "*.mp3" {
54
- const mod: { src: string };
55
- export default mod;
56
- }
57
- declare module "*.wav" {
58
- const mod: { src: string };
59
- export default mod;
60
- }
61
- declare module "*.woff2?" {
62
- const mod: { src: string };
63
- export default mod;
64
- }
65
- declare module "*.ttf" {
66
- const mod: { src: string };
67
- export default mod;
68
- }
69
- declare module "*.otf" {
70
- const mod: { src: string };
71
- export default mod;
72
- }
1
+ declare module "*.css" {
2
+ const mod: { src: string };
3
+ export default mod;
4
+ }
5
+ declare module "*.png" {
6
+ const mod: { src: string };
7
+ export default mod;
8
+ }
9
+ declare module "*.jpg" {
10
+ const mod: { src: string };
11
+ export default mod;
12
+ }
13
+ declare module "*.jpeg" {
14
+ const mod: { src: string };
15
+ export default mod;
16
+ }
17
+ declare module "*.gif" {
18
+ const mod: { src: string };
19
+ export default mod;
20
+ }
21
+ declare module "*.svg" {
22
+ const mod: { src: string };
23
+ export default mod;
24
+ }
25
+ declare module "*.webp" {
26
+ const mod: { src: string };
27
+ export default mod;
28
+ }
29
+ declare module "*.avif" {
30
+ const mod: { src: string };
31
+ export default mod;
32
+ }
33
+ declare module "*.ico" {
34
+ const mod: { src: string };
35
+ export default mod;
36
+ }
37
+ declare module "*.bmp" {
38
+ const mod: { src: string };
39
+ export default mod;
40
+ }
41
+ declare module "*.mp4" {
42
+ const mod: { src: string };
43
+ export default mod;
44
+ }
45
+ declare module "*.webm" {
46
+ const mod: { src: string };
47
+ export default mod;
48
+ }
49
+ declare module "*.ogg" {
50
+ const mod: { src: string };
51
+ export default mod;
52
+ }
53
+ declare module "*.mp3" {
54
+ const mod: { src: string };
55
+ export default mod;
56
+ }
57
+ declare module "*.wav" {
58
+ const mod: { src: string };
59
+ export default mod;
60
+ }
61
+ declare module "*.woff2?" {
62
+ const mod: { src: string };
63
+ export default mod;
64
+ }
65
+ declare module "*.ttf" {
66
+ const mod: { src: string };
67
+ export default mod;
68
+ }
69
+ declare module "*.otf" {
70
+ const mod: { src: string };
71
+ export default mod;
72
+ }
@@ -1,11 +1,11 @@
1
- declare global {
2
- namespace Express {
3
- interface Request {
4
- session: {
5
- [name: string]: any;
6
- };
7
- }
8
- }
9
- }
10
-
11
- export {};
1
+ declare global {
2
+ namespace Express {
3
+ interface Request {
4
+ session: {
5
+ [name: string]: any;
6
+ };
7
+ }
8
+ }
9
+ }
10
+
11
+ export {};
@@ -1,18 +1,18 @@
1
- declare global {
2
- const __XANIX_PAGE_NAVIGATION_HEADER_VALUE__: string;
3
- const __XANIX_CLIENT__: boolean;
4
- const __XANIX_SERVER__: boolean;
5
- const __XANIX_DEV__: boolean;
6
- const __XANIX_PROD__: boolean;
7
-
8
- // navigation events
9
- const XANIX_NAVIGATE: string;
10
- const XANIX_NAVIGATE_START: string;
11
- const XANIX_NAVIGATE_END: string;
12
- const XANIX_PRELOAD: string;
13
- const XANIX_PRELOAD_START: string;
14
- const XANIX_PRELOAD_END: string;
15
- const XANIX_NAVIGATE_RELOAD: string;
16
- }
17
-
18
- export {};
1
+ declare global {
2
+ const __XANIX_PAGE_NAVIGATION_HEADER_VALUE__: string;
3
+ const __XANIX_CLIENT__: boolean;
4
+ const __XANIX_SERVER__: boolean;
5
+ const __XANIX_DEV__: boolean;
6
+ const __XANIX_PROD__: boolean;
7
+
8
+ // navigation events
9
+ const XANIX_NAVIGATE: string;
10
+ const XANIX_NAVIGATE_START: string;
11
+ const XANIX_NAVIGATE_END: string;
12
+ const XANIX_PRELOAD: string;
13
+ const XANIX_PRELOAD_START: string;
14
+ const XANIX_PRELOAD_END: string;
15
+ const XANIX_NAVIGATE_RELOAD: string;
16
+ }
17
+
18
+ export {};
@@ -1,35 +1,35 @@
1
- declare module "virtual:xanix-pages" {
2
- import type { LazyExoticComponent, ComponentType } from "react";
3
- const pages: Record<string, () => Promise<any>>;
4
- export default pages;
5
- }
6
-
7
- declare module "virtual:xanix-document" {
8
- import type { ComponentType, ReactNode } from "react";
9
- import type { Request, Response } from "express";
10
-
11
- export type XanixDocumentProps = {
12
- children?: ReactNode;
13
- };
14
-
15
- /**
16
- * User-defined document component.
17
- */
18
- const Document: ComponentType<XanixDocumentProps>;
19
-
20
- /**
21
- * Generates document metadata for the current request.
22
- */
23
- export const metadata: (context: {
24
- request: Request;
25
- response: Response;
26
- page: {
27
- id: string;
28
- props: Record<string, any>;
29
- };
30
- }) => Promise<Record<string, any>>;
31
-
32
- export default Document;
33
- }
34
-
35
- declare module "virtual:xanix-dev" {}
1
+ declare module "virtual:xanix-pages" {
2
+ import type { LazyExoticComponent, ComponentType } from "react";
3
+ const pages: Record<string, () => Promise<any>>;
4
+ export default pages;
5
+ }
6
+
7
+ declare module "virtual:xanix-document" {
8
+ import type { ComponentType, ReactNode } from "react";
9
+ import type { Request, Response } from "express";
10
+
11
+ export type XanixDocumentProps = {
12
+ children?: ReactNode;
13
+ };
14
+
15
+ /**
16
+ * User-defined document component.
17
+ */
18
+ const Document: ComponentType<XanixDocumentProps>;
19
+
20
+ /**
21
+ * Generates document metadata for the current request.
22
+ */
23
+ export const metadata: (context: {
24
+ request: Request;
25
+ response: Response;
26
+ page: {
27
+ id: string;
28
+ props: Record<string, any>;
29
+ };
30
+ }) => Promise<Record<string, any>>;
31
+
32
+ export default Document;
33
+ }
34
+
35
+ declare module "virtual:xanix-dev" {}
package/package.json CHANGED
@@ -1,60 +1,57 @@
1
- {
2
- "name": "xanix",
3
- "version": "1.0.20",
4
- "description": "",
5
- "main": "dist/index.js",
6
- "module": "dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "bin": {
9
- "xanix": "dist/bin/index.js"
10
- },
11
- "engines": {
12
- "node": ">=20.0.0"
13
- },
14
- "type": "module",
15
- "files": [
16
- "dist"
17
- ],
18
- "exports": {
19
- ".": {
20
- "import": "./dist/index.js",
21
- "require": "./dist/index.js"
22
- }
23
- },
24
- "scripts": {
25
- "dev": "tsc --watch --preserveWatchOutput",
26
- "build": "tsc && node scripts/build-types.js"
27
- },
28
- "keywords": [],
29
- "author": "Naxrul Ahmed",
30
- "license": "ISC",
31
- "dependencies": {
32
- "@msgpack/msgpack": "^3.1.3",
33
- "commander": "^15.0.0",
34
- "dotenv": "^17.4.2",
35
- "oxc-walker": "^1.1.1",
36
- "picocolors": "^1.1.1",
37
- "react-refresh": "^0.18.0",
38
- "rolldown": "^1.2.9",
39
- "tslib": "^2.8.1",
40
- "typescript": "^5.9.3",
41
- "ws": "^8.21.3"
42
- },
43
- "devDependencies": {
44
- "express": "^5.2.1",
45
- "@iconify-react/ic": "^1.0.2",
46
- "@types/express": "^5.0.6",
47
- "@types/mime-types": "^3.0.1",
48
- "@types/node": "^26.2.0",
49
- "@types/prompts": "^2.4.9",
50
- "@types/react": "^19.2.17",
51
- "@types/react-dom": "^19.2.3",
52
- "@types/react-refresh": "^0.14.7",
53
- "@types/ws": "^8.18.1",
54
- "@xanui/core": "^1.3.38",
55
- "@xanui/icons": "^1.1.14",
56
- "@xanui/ui": "^1.2.24",
57
- "react": "^19.2.8",
58
- "react-dom": "^19.2.8"
59
- }
60
- }
1
+ {
2
+ "name": "xanix",
3
+ "version": "1.0.21",
4
+ "author": "Naxrul Ahmed",
5
+ "description": "",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "bin": {
10
+ "xanix": "dist/bin/index.js"
11
+ },
12
+ "engines": {
13
+ "node": ">=20.0.0"
14
+ },
15
+ "type": "module",
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "exports": {
20
+ ".": {
21
+ "import": "./dist/index.js",
22
+ "require": "./dist/index.js"
23
+ }
24
+ },
25
+ "scripts": {
26
+ "dev": "tsc --watch --preserveWatchOutput",
27
+ "build": "tsc && node scripts/build-types.js"
28
+ },
29
+ "keywords": [],
30
+ "license": "ISC",
31
+ "dependencies": {
32
+ "commander": "^15.0.0",
33
+ "dotenv": "^17.4.2",
34
+ "picocolors": "^1.1.1",
35
+ "react-refresh": "^0.18.0",
36
+ "rolldown": "^1.2.9",
37
+ "tslib": "^2.8.1",
38
+ "typescript": "^5.9.3",
39
+ "ws": "^8.21.3"
40
+ },
41
+ "devDependencies": {
42
+ "@iconify-react/ic": "^1.0.2",
43
+ "@types/express": "^5.0.6",
44
+ "@types/node": "^26.2.0",
45
+ "@types/prompts": "^2.4.9",
46
+ "@types/react": "^19.2.17",
47
+ "@types/react-dom": "^19.2.3",
48
+ "@types/react-refresh": "^0.14.7",
49
+ "@types/ws": "^8.18.1",
50
+ "@xanui/core": "^1.3.38",
51
+ "@xanui/icons": "^1.1.14",
52
+ "@xanui/ui": "^1.2.24",
53
+ "express": "^5.2.1",
54
+ "react": "^19.2.8",
55
+ "react-dom": "^19.2.8"
56
+ }
57
+ }
@@ -1 +0,0 @@
1
- export declare function Caching(): Promise<void>;
@@ -1,210 +0,0 @@
1
- import path from "node:path";
2
- import fs from "node:fs";
3
- import { rolldown, watch } from "rolldown";
4
- const root = process.cwd();
5
- const appEntry = path.resolve(root, "src/index.ts");
6
- const outDir = path.resolve(root, ".xanix");
7
- const cacheDir = path.join(outDir, "cache");
8
- function normalize(id) {
9
- return id.replace(/\\/g, "/");
10
- }
11
- function isNodeModule(id) {
12
- return normalize(id).includes("/node_modules/");
13
- }
14
- function getPackageName(id) {
15
- const normalized = normalize(id);
16
- const match = normalized.match(/\/node_modules\/((?:@[^/]+\/)?[^/]+)/);
17
- if (!match) {
18
- return null;
19
- }
20
- return match[1];
21
- }
22
- function getSafeEntryName(packageName) {
23
- return packageName
24
- .replace(/^@/, "")
25
- .replace(/\//g, "-")
26
- .replace(/[^a-zA-Z0-9._-]/g, "-");
27
- }
28
- /**
29
- * Finds the package root from a node_modules file.
30
- */
31
- function getPackageRoot(id) {
32
- const normalized = normalize(id);
33
- const index = normalized.lastIndexOf("/node_modules/");
34
- if (index === -1) {
35
- return null;
36
- }
37
- const after = normalized.slice(index + "/node_modules/".length);
38
- const parts = after.split("/");
39
- if (parts[0].startsWith("@")) {
40
- if (!parts[1]) {
41
- return null;
42
- }
43
- return path.join(normalized.slice(0, index), "node_modules", parts[0], parts[1]);
44
- }
45
- return path.join(normalized.slice(0, index), "node_modules", parts[0]);
46
- }
47
- /**
48
- * Plugin used only to discover node_modules dependencies.
49
- */
50
- function discoverDependencies() {
51
- const dependencies = new Map();
52
- const plugin = {
53
- name: "xanix-discover-dependencies",
54
- resolveId(source, importer) {
55
- if (!importer) {
56
- return null;
57
- }
58
- return null;
59
- },
60
- load(id) {
61
- if (!isNodeModule(id)) {
62
- return null;
63
- }
64
- const packageName = getPackageName(id);
65
- if (!packageName) {
66
- return null;
67
- }
68
- if (!dependencies.has(packageName)) {
69
- dependencies.set(packageName, id);
70
- }
71
- return null;
72
- },
73
- };
74
- return {
75
- plugin,
76
- dependencies,
77
- };
78
- }
79
- /**
80
- * Build the input object dynamically.
81
- *
82
- * IMPORTANT:
83
- *
84
- * The dependencies need to become independent entries.
85
- */
86
- async function createInputs() {
87
- const discovered = new Map();
88
- const plugin = {
89
- name: "xanix-discover",
90
- resolveId(source, importer) {
91
- return null;
92
- },
93
- load(id) {
94
- if (!isNodeModule(id)) {
95
- return null;
96
- }
97
- const packageName = getPackageName(id);
98
- if (packageName) {
99
- discovered.set(packageName, id);
100
- }
101
- return null;
102
- },
103
- };
104
- /*
105
- * First build only to discover the dependency graph.
106
- */
107
- const discoveryBundle = await rolldown({
108
- input: appEntry,
109
- plugins: [plugin],
110
- });
111
- await discoveryBundle.generate({
112
- format: "esm",
113
- });
114
- /*
115
- * Add the application entry.
116
- */
117
- const inputs = {
118
- app: appEntry,
119
- };
120
- /*
121
- * Add each discovered npm package as an independent entry.
122
- */
123
- for (const [packageName, id] of discovered) {
124
- const entryName = getSafeEntryName(packageName);
125
- inputs[`dep_${entryName}`] = id;
126
- }
127
- return inputs;
128
- }
129
- /**
130
- * Cache plugin.
131
- *
132
- * This does NOT rebuild the dependencies separately.
133
- *
134
- * They are entries in the SAME Rolldown watch.
135
- */
136
- function xanixCachePlugin() {
137
- return {
138
- name: "xanix-cache",
139
- outputOptions(options) {
140
- return {
141
- ...options,
142
- entryFileNames(chunk) {
143
- if (chunk.name.startsWith("dep_")) {
144
- const name = chunk.name.slice("dep_".length);
145
- return `cache/${name}.js`;
146
- }
147
- return "[name].js";
148
- },
149
- };
150
- },
151
- };
152
- }
153
- export async function Caching() {
154
- fs.mkdirSync(cacheDir, {
155
- recursive: true,
156
- });
157
- /*
158
- * Discover dependencies once when creating the watch graph.
159
- */
160
- const inputs = await createInputs();
161
- console.log("Rolldown watch entries:");
162
- for (const [name, value] of Object.entries(inputs)) {
163
- console.log(` ${name} → ${value}`);
164
- }
165
- /*
166
- * ONE Rolldown watch.
167
- *
168
- * No buildDependencyCache().
169
- * No external dependency build.
170
- */
171
- const watcher = await watch({
172
- input: inputs,
173
- plugins: [xanixCachePlugin()],
174
- output: {
175
- dir: outDir,
176
- format: "esm",
177
- entryFileNames: (chunk) => {
178
- if (chunk.name.startsWith("dep_")) {
179
- const name = chunk.name.slice("dep_".length);
180
- return `cache/${name}.js`;
181
- }
182
- return "[name].js";
183
- },
184
- chunkFileNames: "chunks/[name]-[hash].js",
185
- assetFileNames: "assets/[name]-[hash][extname]",
186
- },
187
- watch: {
188
- include: ["src/**", "node_modules/**"],
189
- },
190
- });
191
- watcher.on("event", (event) => {
192
- switch (event.code) {
193
- case "START":
194
- console.log("watch started");
195
- break;
196
- case "BUNDLE_START":
197
- console.log("building...");
198
- break;
199
- case "BUNDLE_END":
200
- console.log(`built in ${event.duration}ms`);
201
- break;
202
- case "END":
203
- console.log("waiting for changes...");
204
- break;
205
- case "ERROR":
206
- console.error(event.error);
207
- break;
208
- }
209
- });
210
- }
@@ -1,3 +0,0 @@
1
- import { Plugin } from "rollup";
2
- declare const external: () => Plugin;
3
- export default external;
@@ -1,6 +0,0 @@
1
- const external = () => {
2
- return {
3
- name: "external",
4
- };
5
- };
6
- export default external;
@@ -1,3 +0,0 @@
1
- import { XanixClientEntry } from "../types";
2
- declare const buildClient: (entries: XanixClientEntry[]) => Promise<void>;
3
- export default buildClient;
@@ -1,42 +0,0 @@
1
- import { rolldown } from "rolldown";
2
- import fs from "node:fs";
3
- import bundlerOutput from "./config/output.js";
4
- import { getClientRuntimeFile, getClientRuntimeFileName, } from "../include/utils.js";
5
- import { xanixDefaultPlugins } from "./plugins/plugins.js";
6
- import outdirs from "../../outdirs.js";
7
- const buildClient = async (entries) => {
8
- const input = {};
9
- for (const entry of entries) {
10
- input[entry.name] = entry.file;
11
- }
12
- const runtimeFileName = getClientRuntimeFileName("production");
13
- input[runtimeFileName] = getClientRuntimeFile();
14
- fs.rmSync(outdirs.client, {
15
- recursive: true,
16
- force: true,
17
- });
18
- fs.mkdirSync(outdirs.client, {
19
- recursive: true,
20
- });
21
- const build = await rolldown({
22
- input,
23
- treeshake: true,
24
- onwarn(warning, warn) {
25
- if (warning.code === "MODULE_LEVEL_DIRECTIVE" &&
26
- warning.message.includes('"use client"')) {
27
- return;
28
- }
29
- warn(warning);
30
- },
31
- plugins: [
32
- ...xanixDefaultPlugins({
33
- target: "client",
34
- development: false,
35
- assetExternal: true,
36
- }),
37
- ],
38
- });
39
- await build.write(bundlerOutput.client(entries, { isDev: false }));
40
- await build.close();
41
- };
42
- export default buildClient;
@@ -1,7 +0,0 @@
1
- import { XanixClientEntry } from "../types.js";
2
- export type WatcherOptions = {
3
- rootEntry: string;
4
- onBuildEnd: (entries: XanixClientEntry[]) => Promise<void>;
5
- };
6
- declare const BuildServer: ({ rootEntry, onBuildEnd }: WatcherOptions) => Promise<void>;
7
- export default BuildServer;