xanix 0.0.0 → 1.0.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 (230) hide show
  1. package/dist/BaseDocument.d.ts +3 -0
  2. package/dist/BaseDocument.js +8 -0
  3. package/dist/Document.d.ts +7 -0
  4. package/dist/Document.js +7 -0
  5. package/dist/bin/bundler/buildCache.d.ts +11 -0
  6. package/dist/bin/bundler/buildCache.js +129 -0
  7. package/dist/bin/bundler/buildClient.d.ts +3 -0
  8. package/dist/bin/bundler/buildClient.js +41 -0
  9. package/dist/bin/bundler/buildServer.d.ts +7 -0
  10. package/dist/bin/bundler/buildServer.js +55 -0
  11. package/dist/bin/bundler/cacheNpmModules.d.ts +11 -0
  12. package/dist/bin/bundler/cacheNpmModules.js +157 -0
  13. package/dist/bin/bundler/config/output.d.ts +14 -0
  14. package/dist/bin/bundler/config/output.js +48 -0
  15. package/dist/bin/bundler/generateClientEntries.d.ts +3 -0
  16. package/dist/bin/bundler/generateClientEntries.js +59 -0
  17. package/dist/bin/bundler/plugins/XanixAssets/index.d.ts +4 -0
  18. package/dist/bin/bundler/plugins/XanixAssets/index.js +22 -0
  19. package/dist/bin/bundler/plugins/XanixBrowserCodeRemover.d.ts +6 -0
  20. package/dist/bin/bundler/plugins/XanixBrowserCodeRemover.js +350 -0
  21. package/dist/bin/bundler/plugins/XanixEntryFinder/finder.d.ts +11 -0
  22. package/dist/bin/bundler/plugins/XanixEntryFinder/finder.js +156 -0
  23. package/dist/bin/bundler/plugins/XanixEntryFinder/index.d.ts +6 -0
  24. package/dist/bin/bundler/plugins/XanixEntryFinder/index.js +36 -0
  25. package/dist/bin/bundler/plugins/XanixEnv.d.ts +15 -0
  26. package/dist/bin/bundler/plugins/XanixEnv.js +46 -0
  27. package/dist/bin/bundler/plugins/XanixHydrate.d.ts +3 -0
  28. package/dist/bin/bundler/plugins/XanixHydrate.js +34 -0
  29. package/dist/bin/bundler/plugins/XanixReactRefresh.d.ts +2 -0
  30. package/dist/bin/bundler/plugins/XanixReactRefresh.js +126 -0
  31. package/dist/bin/bundler/plugins/XanixResolveCacheDeps/index.d.ts +5 -0
  32. package/dist/bin/bundler/plugins/XanixResolveCacheDeps/index.js +22 -0
  33. package/dist/bin/bundler/plugins/XanixTransform/index.d.ts +5 -0
  34. package/dist/bin/bundler/plugins/XanixTransform/index.js +19 -0
  35. package/dist/bin/bundler/plugins/XanixTransform/transformer.d.ts +16 -0
  36. package/dist/bin/bundler/plugins/XanixTransform/transformer.js +631 -0
  37. package/dist/bin/bundler/plugins/XanixWatchChange copy.d.ts +10 -0
  38. package/dist/bin/bundler/plugins/XanixWatchChange copy.js +30 -0
  39. package/dist/bin/bundler/plugins/XanixWatchChange.d.ts +9 -0
  40. package/dist/bin/bundler/plugins/XanixWatchChange.js +27 -0
  41. package/dist/bin/bundler/plugins/XanixWatchChangeClient.d.ts +7 -0
  42. package/dist/bin/bundler/plugins/XanixWatchChangeClient.js +15 -0
  43. package/dist/bin/bundler/plugins/commonjs.d.ts +3 -0
  44. package/dist/bin/bundler/plugins/commonjs.js +10 -0
  45. package/dist/bin/bundler/plugins/dep-XanixWatchChange.d.ts +9 -0
  46. package/dist/bin/bundler/plugins/dep-XanixWatchChange.js +27 -0
  47. package/dist/bin/bundler/plugins/nodeResolve.d.ts +3 -0
  48. package/dist/bin/bundler/plugins/nodeResolve.js +10 -0
  49. package/dist/bin/bundler/plugins/pathResolver.d.ts +5 -0
  50. package/dist/bin/bundler/plugins/pathResolver.js +57 -0
  51. package/dist/bin/bundler/plugins/plugins.d.ts +8 -0
  52. package/dist/bin/bundler/plugins/plugins.js +75 -0
  53. package/dist/bin/bundler/plugins/rollupEsbuild.d.ts +3 -0
  54. package/dist/bin/bundler/plugins/rollupEsbuild.js +14 -0
  55. package/dist/bin/bundler/plugins/xanixServerData.d.ts +6 -0
  56. package/dist/bin/bundler/plugins/xanixServerData.js +224 -0
  57. package/dist/bin/bundler/plugins/xanixTsconfigAlias.d.ts +6 -0
  58. package/dist/bin/bundler/plugins/xanixTsconfigAlias.js +51 -0
  59. package/dist/bin/bundler/plugins/xanixUseDataId.d.ts +4 -0
  60. package/dist/bin/bundler/plugins/xanixUseDataId.js +93 -0
  61. package/dist/bin/bundler/watchClient.d.ts +8 -0
  62. package/dist/bin/bundler/watchClient.js +54 -0
  63. package/dist/bin/bundler/watchServer.d.ts +10 -0
  64. package/dist/bin/bundler/watchServer.js +84 -0
  65. package/dist/bin/cli/build.d.ts +2 -0
  66. package/dist/bin/cli/build.js +18 -0
  67. package/dist/bin/cli/dev.d.ts +2 -0
  68. package/dist/bin/cli/dev.js +103 -0
  69. package/dist/bin/cli/start.d.ts +2 -0
  70. package/dist/bin/cli/start.js +19 -0
  71. package/dist/bin/include/entry.d.ts +3 -0
  72. package/dist/bin/include/entry.js +28 -0
  73. package/dist/bin/include/logger.d.ts +10 -0
  74. package/dist/bin/include/logger.js +11 -0
  75. package/dist/bin/include/manifest.d.ts +3 -0
  76. package/dist/bin/include/manifest.js +13 -0
  77. package/dist/bin/include/utils.d.ts +2 -0
  78. package/dist/bin/include/utils.js +14 -0
  79. package/dist/bin/index.d.ts +2 -0
  80. package/dist/bin/index.js +26 -0
  81. package/dist/bin/types.d.ts +12 -0
  82. package/dist/bin/types.js +1 -0
  83. package/dist/client/components/Body.d.ts +5 -0
  84. package/dist/client/components/Body.js +10 -0
  85. package/dist/client/components/Document/context.d.ts +3 -0
  86. package/dist/client/components/Document/context.js +14 -0
  87. package/dist/client/components/Document/index.d.ts +8 -0
  88. package/dist/client/components/Document/index.js +6 -0
  89. package/dist/client/components/Head copy.d.ts +5 -0
  90. package/dist/client/components/Head copy.js +8 -0
  91. package/dist/client/components/Head.d.ts +5 -0
  92. package/dist/client/components/Head.js +10 -0
  93. package/dist/client/components/Link.d.ts +6 -0
  94. package/dist/client/components/Link.js +10 -0
  95. package/dist/client/context/RouteContext.d.ts +8 -0
  96. package/dist/client/context/RouteContext.js +16 -0
  97. package/dist/client/hooks/usePageProps.d.ts +1 -0
  98. package/dist/client/hooks/usePageProps.js +2 -0
  99. package/dist/client/hooks/useRoute.d.ts +1 -0
  100. package/dist/client/hooks/useRoute.js +2 -0
  101. package/dist/client/hooks/useSearchParams.d.ts +1 -0
  102. package/dist/client/hooks/useSearchParams.js +2 -0
  103. package/dist/client/index.d.ts +2 -0
  104. package/dist/client/index.js +2 -0
  105. package/dist/client/navigation.d.ts +4 -0
  106. package/dist/client/navigation.js +14 -0
  107. package/dist/client/refresh.d.ts +7 -0
  108. package/dist/client/refresh.js +15 -0
  109. package/dist/client/runtime.d.ts +10 -0
  110. package/dist/client/runtime.js +98 -0
  111. package/dist/client-runtime.d.ts +10 -0
  112. package/dist/client-runtime.js +113 -0
  113. package/dist/components/BaseDocument.d.ts +3 -0
  114. package/dist/components/BaseDocument.js +8 -0
  115. package/dist/components/Body.d.ts +5 -0
  116. package/dist/components/Body.js +8 -0
  117. package/dist/components/Document/Document.d.ts +16 -0
  118. package/dist/components/Document/Document.js +15 -0
  119. package/dist/components/Document/context.d.ts +17 -0
  120. package/dist/components/Document/context.js +13 -0
  121. package/dist/components/Document/index.d.ts +7 -0
  122. package/dist/components/Document/index.js +10 -0
  123. package/dist/components/Document.d.ts +7 -0
  124. package/dist/components/Document.js +9 -0
  125. package/dist/components/DocumentContext/DocumentContext.d.ts +15 -0
  126. package/dist/components/DocumentContext/DocumentContext.js +18 -0
  127. package/dist/components/DocumentContext/context.d.ts +11 -0
  128. package/dist/components/DocumentContext/context.js +14 -0
  129. package/dist/components/DocumentContext/index.d.ts +15 -0
  130. package/dist/components/DocumentContext/index.js +18 -0
  131. package/dist/components/DocumentContext.d.ts +19 -0
  132. package/dist/components/DocumentContext.js +6 -0
  133. package/dist/components/DocumentProvider.d.ts +13 -0
  134. package/dist/components/DocumentProvider.js +7 -0
  135. package/dist/components/Head.d.ts +5 -0
  136. package/dist/components/Head.js +42 -0
  137. package/dist/components/Link.d.ts +7 -0
  138. package/dist/components/Link.js +28 -0
  139. package/dist/components/Script.d.ts +3 -0
  140. package/dist/components/Script.js +5 -0
  141. package/dist/dataLoader.d.ts +11 -0
  142. package/dist/dataLoader.js +46 -0
  143. package/dist/document/BaseDocument.d.ts +3 -0
  144. package/dist/document/BaseDocument.js +8 -0
  145. package/dist/document/Body.d.ts +5 -0
  146. package/dist/document/Body.js +9 -0
  147. package/dist/document/Document/Document.d.ts +7 -0
  148. package/dist/document/Document/Document.js +10 -0
  149. package/dist/document/Document/context.d.ts +17 -0
  150. package/dist/document/Document/context.js +13 -0
  151. package/dist/document/Document/index.d.ts +7 -0
  152. package/dist/document/Document/index.js +10 -0
  153. package/dist/document/Document.d.ts +7 -0
  154. package/dist/document/Document.js +10 -0
  155. package/dist/document/DocumentContext.d.ts +17 -0
  156. package/dist/document/DocumentContext.js +6 -0
  157. package/dist/document/Head.d.ts +5 -0
  158. package/dist/document/Head.js +40 -0
  159. package/dist/document/Link.d.ts +7 -0
  160. package/dist/document/Link.js +28 -0
  161. package/dist/document/Script.d.ts +3 -0
  162. package/dist/document/Script.js +5 -0
  163. package/dist/document/context.d.ts +17 -0
  164. package/dist/document/context.js +13 -0
  165. package/dist/document/index.d.ts +8 -0
  166. package/dist/document/index.js +7 -0
  167. package/dist/document/useDocument.d.ts +2 -0
  168. package/dist/document/useDocument.js +10 -0
  169. package/dist/hooks/useCookies.d.ts +2 -0
  170. package/dist/hooks/useCookies.js +11 -0
  171. package/dist/hooks/useData.d.ts +18 -0
  172. package/dist/hooks/useData.js +69 -0
  173. package/dist/hooks/useDocument.d.ts +2 -0
  174. package/dist/hooks/useDocument.js +10 -0
  175. package/dist/hooks/useHeaders.d.ts +2 -0
  176. package/dist/hooks/useHeaders.js +9 -0
  177. package/dist/hooks/useLocation.d.ts +2 -0
  178. package/dist/hooks/useLocation.js +25 -0
  179. package/dist/hooks/usePage.d.ts +5 -0
  180. package/dist/hooks/usePage.js +9 -0
  181. package/dist/hooks/useParams.d.ts +2 -0
  182. package/dist/hooks/useParams.js +6 -0
  183. package/dist/hooks/usePathname.d.ts +2 -0
  184. package/dist/hooks/usePathname.js +9 -0
  185. package/dist/hooks/useRequest.d.ts +2 -0
  186. package/dist/hooks/useRequest.js +8 -0
  187. package/dist/hooks/useSearchParams.d.ts +12 -0
  188. package/dist/hooks/useSearchParams.js +66 -0
  189. package/dist/index.d.ts +23 -0
  190. package/dist/index.js +27 -0
  191. package/dist/loader.d.ts +11 -0
  192. package/dist/loader.js +16 -0
  193. package/dist/navigate.d.ts +7 -0
  194. package/dist/navigate.js +31 -0
  195. package/dist/navigation/index.d.ts +2 -0
  196. package/dist/navigation/index.js +2 -0
  197. package/dist/navigation/navigate.d.ts +7 -0
  198. package/dist/navigation/navigate.js +31 -0
  199. package/dist/navigation/useLocation.d.ts +1 -0
  200. package/dist/navigation/useLocation.js +22 -0
  201. package/dist/router/index.d.ts +1 -0
  202. package/dist/router/index.js +1 -0
  203. package/dist/router/useParams.d.ts +9 -0
  204. package/dist/router/useParams.js +50 -0
  205. package/dist/router/useSearchParams .d.ts +9 -0
  206. package/dist/router/useSearchParams .js +50 -0
  207. package/dist/router/useSearchParams.d.ts +11 -0
  208. package/dist/router/useSearchParams.js +80 -0
  209. package/dist/server/index.d.ts +0 -0
  210. package/dist/server/index.js +1 -0
  211. package/dist/server/page.d.ts +9 -0
  212. package/dist/server/page.js +60 -0
  213. package/dist/server/readManifest.d.ts +14 -0
  214. package/dist/server/readManifest.js +8 -0
  215. package/dist/server/runtime/createServer.d.ts +12 -0
  216. package/dist/server/runtime/createServer.js +48 -0
  217. package/dist/server/runtime/index.d.ts +3 -0
  218. package/dist/server/runtime/index.js +3 -0
  219. package/dist/server/runtime/readManifest.d.ts +14 -0
  220. package/dist/server/runtime/readManifest.js +8 -0
  221. package/dist/server/runtime/xanixPage.d.ts +9 -0
  222. package/dist/server/runtime/xanixPage.js +87 -0
  223. package/dist/types.d.ts +12 -0
  224. package/dist/types.js +7 -0
  225. package/dist/utils/index.d.ts +9 -0
  226. package/dist/utils/index.js +27 -0
  227. package/dist/xanix.d.ts +3 -0
  228. package/dist/xanix.js +40 -0
  229. package/package.json +73 -13
  230. package/src/xanix-env.d.ts +79 -0
@@ -0,0 +1,14 @@
1
+ interface XanixManifestEntry {
2
+ id: string;
3
+ name: string;
4
+ file: string;
5
+ path: string;
6
+ build: string;
7
+ export: string;
8
+ }
9
+ interface XanixManifest {
10
+ version: number;
11
+ entries: XanixManifestEntry[];
12
+ }
13
+ declare function readManifest(): Promise<XanixManifest>;
14
+ export default readManifest;
@@ -0,0 +1,8 @@
1
+ import fs from "node:fs/promises";
2
+ import path from "node:path";
3
+ async function readManifest() {
4
+ const manifestPath = path.resolve(process.cwd(), ".xanix", "client-manifest.json");
5
+ const source = await fs.readFile(manifestPath, "utf8");
6
+ return JSON.parse(source);
7
+ }
8
+ export default readManifest;
@@ -0,0 +1,9 @@
1
+ interface XanixPageProps {
2
+ pageId: string;
3
+ req: any;
4
+ res: any;
5
+ Component: (props: Record<string, any>) => React.ReactElement;
6
+ props: Record<string, any>;
7
+ }
8
+ export default function xanixPage({ pageId, req, res, Component, props, }: XanixPageProps): Promise<string | undefined>;
9
+ export {};
@@ -0,0 +1,87 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { renderToPipeableStream, renderToString } from "react-dom/server";
3
+ import readManifest from "./readManifest.js";
4
+ import { PassThrough } from "node:stream";
5
+ import path from "node:path";
6
+ import { pathToFileURL } from "node:url";
7
+ import dataLoader from "../../dataLoader.js";
8
+ function renderPage(element) {
9
+ return new Promise((resolve, reject) => {
10
+ let html = "";
11
+ const stream = new PassThrough();
12
+ stream.on("data", (chunk) => {
13
+ html += chunk.toString();
14
+ });
15
+ stream.on("end", () => {
16
+ resolve(html);
17
+ });
18
+ stream.on("error", reject);
19
+ let didError = false;
20
+ const { pipe, abort } = renderToPipeableStream(element, {
21
+ onAllReady() {
22
+ pipe(stream);
23
+ },
24
+ onError(error) {
25
+ didError = true;
26
+ console.error("SSR error:", error);
27
+ },
28
+ onShellError(error) {
29
+ reject(error);
30
+ },
31
+ });
32
+ // Optional timeout protection
33
+ setTimeout(() => {
34
+ abort();
35
+ }, 10_000);
36
+ });
37
+ }
38
+ export default async function xanixPage({ pageId, req, res, Component, props, }) {
39
+ const manifest = await readManifest();
40
+ const { title, meta } = req.XanixPageData;
41
+ const entry = manifest.entries.find((item) => item.id === pageId);
42
+ const method = req.method.toUpperCase();
43
+ if (method !== "GET") {
44
+ res.status(405).send("Method Not Allowed");
45
+ return;
46
+ }
47
+ if (!entry) {
48
+ res.status(404).send("Page Not Found");
49
+ return;
50
+ }
51
+ const Document = (await import(pathToFileURL(path.join(process.cwd(), ".xanix", "xanix-document.js"))
52
+ .href)).default;
53
+ if (!dataLoader.isInit(pageId)) {
54
+ renderToString(_jsx(Document, { document: {
55
+ pageId,
56
+ props,
57
+ title: title ?? entry.name.replaceAll("-", " "),
58
+ meta,
59
+ params: req.params,
60
+ request: req,
61
+ pageData: {},
62
+ }, children: _jsx(Component, { ...props }) }));
63
+ }
64
+ const pageData = await dataLoader.results(pageId);
65
+ if ("x-navigation" in req.headers) {
66
+ res.setHeader("Content-Type", "application/json");
67
+ return JSON.stringify({
68
+ pageId,
69
+ props,
70
+ title: title ?? entry.name.replaceAll("-", " "),
71
+ meta,
72
+ params: req.params,
73
+ request: null,
74
+ pageData,
75
+ });
76
+ }
77
+ const html = await renderPage(_jsx(Document, { document: {
78
+ pageId,
79
+ props,
80
+ title: title ?? entry.name.replaceAll("-", " "),
81
+ meta,
82
+ params: req.params,
83
+ request: req,
84
+ pageData,
85
+ }, children: _jsx(Component, { ...props }) }));
86
+ return `<!DOCTYPE html>${html}`;
87
+ }
@@ -0,0 +1,12 @@
1
+ import "express";
2
+ declare global {
3
+ namespace Express {
4
+ interface Request {
5
+ document: {
6
+ setTitle(title: string): void;
7
+ setMeta(name: string, content: string): void;
8
+ };
9
+ }
10
+ }
11
+ }
12
+ export {};
package/dist/types.js ADDED
@@ -0,0 +1,7 @@
1
+ import "express";
2
+ // export type XanixDocumentData = {
3
+ // pageId: string;
4
+ // props: Record<string, any>;
5
+ // title: string;
6
+ // meta: Array<{ name: string; content: string }>;
7
+ // };
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from "react";
2
+ export declare const getGlobal: () => any;
3
+ export declare const getGlobalXanix: () => Record<string, any>;
4
+ export type DocumentData = {
5
+ head: ReactNode;
6
+ body: ReactNode;
7
+ };
8
+ export declare const getDocumentData: () => DocumentData;
9
+ export declare const getDocumentFile: () => Promise<string>;
@@ -0,0 +1,27 @@
1
+ export const getGlobal = () => {
2
+ if (typeof window === "undefined") {
3
+ return globalThis;
4
+ }
5
+ else {
6
+ return window;
7
+ }
8
+ };
9
+ export const getGlobalXanix = () => {
10
+ const global = getGlobal();
11
+ global.Xanix = global.Xanix || {};
12
+ return global.Xanix;
13
+ };
14
+ export const getDocumentData = () => {
15
+ const global = getGlobal();
16
+ global.DocumentData = global.DocumentData || {};
17
+ return global.DocumentData;
18
+ };
19
+ import fs from "node:fs";
20
+ import path from "node:path";
21
+ export const getDocumentFile = async () => {
22
+ const documentEntry = path.join(process.cwd(), ".xanix", "xanix-document.js");
23
+ if (fs.existsSync(documentEntry)) {
24
+ return documentEntry;
25
+ }
26
+ throw new Error(`Document file not found at ${documentEntry}`);
27
+ };
@@ -0,0 +1,3 @@
1
+ import type { Request, Response } from "express";
2
+ declare const xanix: () => (_req: Request, res: Response, next: any) => Promise<void>;
3
+ export default xanix;
package/dist/xanix.js ADDED
@@ -0,0 +1,40 @@
1
+ import { renderToString } from "react-dom/server";
2
+ import { isValidElement } from "react";
3
+ const xanix = () => {
4
+ return async (_req, res, next) => {
5
+ const originalSend = res.send.bind(res);
6
+ res.send = async (component) => {
7
+ if (typeof component !== "object" || !isValidElement(component)) {
8
+ originalSend(component);
9
+ return;
10
+ }
11
+ // const { title, description } = component.type.metadata || {};
12
+ if (_req.query.static) {
13
+ res.setHeader("Content-Type", "application/json");
14
+ originalSend(JSON.stringify({
15
+ source: "script.js",
16
+ props: component.props,
17
+ }));
18
+ }
19
+ else {
20
+ const html = renderToString(component);
21
+ res.setHeader("Content-Type", "text/html");
22
+ originalSend(`
23
+ <!doctype html>
24
+ <html>
25
+ <head>
26
+ </head>
27
+ <body>
28
+ <div>${html}</div>
29
+ <script>
30
+ window.__INITIAL_PROPS__ = ${JSON.stringify(component.props)};
31
+ </script>
32
+ </body>
33
+ </html>
34
+ `);
35
+ }
36
+ };
37
+ next();
38
+ };
39
+ };
40
+ export default xanix;
package/package.json CHANGED
@@ -1,13 +1,73 @@
1
- {
2
- "name": "xanix",
3
- "version": "0.0.0",
4
- "description": "",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "keywords": [],
10
- "author": "Naxrul Ahmed",
11
- "license": "ISC",
12
- "type": "commonjs"
13
- }
1
+ {
2
+ "name": "xanix",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "bin": "./dist/bin/index.js",
9
+ "type": "module",
10
+ "files": [
11
+ "dist",
12
+ "src/xanix-env.d.ts"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "import": "./dist/index.js",
17
+ "require": "./dist/index.js"
18
+ },
19
+ "./page": {
20
+ "import": "./dist/server/page.js",
21
+ "require": "./dist/server/page.js"
22
+ },
23
+ "./runtime": {
24
+ "import": "./dist/server/runtime/index.js",
25
+ "require": "./dist/server/runtime/index.js"
26
+ }
27
+ },
28
+ "scripts": {
29
+ "dev": "tsc --watch --preserveWatchOutput",
30
+ "build": "tsc",
31
+ "start": "node dist/index.js"
32
+ },
33
+ "keywords": [],
34
+ "author": "Naxrul Ahmed",
35
+ "license": "ISC",
36
+ "dependencies": {
37
+ "@babel/generator": "^8.0.0",
38
+ "@babel/parser": "^8.0.4",
39
+ "@babel/traverse": "^8.0.4",
40
+ "@rollup/plugin-alias": "^6.0.0",
41
+ "@rollup/plugin-commonjs": "^29.0.3",
42
+ "@rollup/plugin-json": "^6.1.0",
43
+ "@rollup/plugin-node-resolve": "^16.0.3",
44
+ "@rollup/plugin-replace": "^6.0.3",
45
+ "@rollup/plugin-url": "^8.0.2",
46
+ "commander": "^15.0.0",
47
+ "dotenv": "^17.4.2",
48
+ "esbuild": "^0.28.2",
49
+ "express": "^5.2.1",
50
+ "picocolors": "^1.1.1",
51
+ "react-refresh": "^0.18.0",
52
+ "rollup": "^4.62.5",
53
+ "rollup-plugin-esbuild": "^6.2.1",
54
+ "tslib": "^2.8.1",
55
+ "ws": "^8.21.3"
56
+ },
57
+ "devDependencies": {
58
+ "@types/babel__core": "^7.20.5",
59
+ "@types/express": "^5.0.6",
60
+ "@types/node": "^26.2.0",
61
+ "@types/prompts": "^2.4.9",
62
+ "@types/react": "^19.2.17",
63
+ "@types/react-dom": "^19.2.3",
64
+ "@types/react-refresh": "^0.14.7",
65
+ "@types/ws": "^8.18.1",
66
+ "@xanui/core": "^1.3.38",
67
+ "@xanui/icons": "^1.1.14",
68
+ "@xanui/ui": "^1.2.24",
69
+ "react": "^19.2.8",
70
+ "react-dom": "^19.2.8",
71
+ "typescript": "^5.9.3"
72
+ }
73
+ }
@@ -0,0 +1,79 @@
1
+ import "express";
2
+
3
+ declare global {
4
+ const __XANIX_CLIENT__: boolean;
5
+ const __XANIX_SERVER__: boolean;
6
+ const __XANIX_DEV__: boolean;
7
+ const __XANIX_PROD__: boolean;
8
+ }
9
+
10
+ declare module "express-serve-static-core" {
11
+ interface Request {
12
+ page: {
13
+ setTitle(title: string): void;
14
+ setMeta(name: string, content: string): void;
15
+ };
16
+ }
17
+ }
18
+
19
+ declare module "*.png" {
20
+ const src: string;
21
+ export default src;
22
+ }
23
+
24
+ declare module "*.jpg" {
25
+ const src: string;
26
+ export default src;
27
+ }
28
+
29
+ declare module "*.jpeg" {
30
+ const src: string;
31
+ export default src;
32
+ }
33
+
34
+ declare module "*.gif" {
35
+ const src: string;
36
+ export default src;
37
+ }
38
+
39
+ declare module "*.webp" {
40
+ const src: string;
41
+ export default src;
42
+ }
43
+
44
+ declare module "*.svg" {
45
+ const src: string;
46
+ export default src;
47
+ }
48
+
49
+ declare module "*.ico" {
50
+ const src: string;
51
+ export default src;
52
+ }
53
+
54
+ declare module "*.woff" {
55
+ const src: string;
56
+ export default src;
57
+ }
58
+
59
+ declare module "*.woff2" {
60
+ const src: string;
61
+ export default src;
62
+ }
63
+
64
+ declare module "*.ttf" {
65
+ const src: string;
66
+ export default src;
67
+ }
68
+
69
+ declare module "*.eot" {
70
+ const src: string;
71
+ export default src;
72
+ }
73
+
74
+ declare module "*.css" {
75
+ const src: string;
76
+ export default src;
77
+ }
78
+
79
+ export {};