xplorajs 0.3.3 → 0.3.6
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.
- package/dist/cli.d.ts +1 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/client/hmr.js +15 -0
- package/dist/client/hmr.js.map +1 -0
- package/dist/client/refresh.js +9 -0
- package/dist/client/refresh.js.map +1 -0
- package/dist/commands/build.d.ts +1 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +3 -0
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/css.d.ts +6 -0
- package/dist/commands/css.d.ts.map +1 -0
- package/dist/commands/css.js +24 -0
- package/dist/commands/css.js.map +1 -0
- package/dist/commands/dev.d.ts +1 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +63 -44
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/start.d.ts +1 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +12 -3
- package/dist/commands/start.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -6
- package/dist/index.js.map +1 -1
- package/package.json +18 -9
package/dist/cli.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const ws = new WebSocket("ws://localhost:3001");
|
|
2
|
+
ws.onmessage = async (e)=>{
|
|
3
|
+
const data = JSON.parse(e.data);
|
|
4
|
+
if (data.type === "css") {
|
|
5
|
+
document.querySelectorAll('link[rel="stylesheet"]').forEach((l)=>{
|
|
6
|
+
l.href = "/assets/style.css?v=" + Date.now();
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
if (data.type === "reload") {
|
|
10
|
+
console.log("Reloading...");
|
|
11
|
+
location.reload();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=hmr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/client/hmr.js"],"sourcesContent":["const ws = new WebSocket(\"ws://localhost:3001\");\n\nws.onmessage = async (e) => {\n const data = JSON.parse(e.data);\n\n if (data.type === \"css\") {\n document.querySelectorAll('link[rel=\"stylesheet\"]').forEach((l) => {\n l.href = \"/assets/style.css?v=\" + Date.now();\n });\n }\n\n if (data.type === \"reload\") {\n console.log(\"Reloading...\");\n location.reload();\n }\n};\n"],"names":["ws","WebSocket","onmessage","e","data","JSON","parse","type","document","querySelectorAll","forEach","l","href","Date","now","console","log","location","reload"],"mappings":"AAAA,MAAMA,KAAK,IAAIC,UAAU;AAEzBD,GAAGE,SAAS,GAAG,OAAOC;IACpB,MAAMC,OAAOC,KAAKC,KAAK,CAACH,EAAEC,IAAI;IAE9B,IAAIA,KAAKG,IAAI,KAAK,OAAO;QACvBC,SAASC,gBAAgB,CAAC,0BAA0BC,OAAO,CAAC,CAACC;YAC3DA,EAAEC,IAAI,GAAG,yBAAyBC,KAAKC,GAAG;QAC5C;IACF;IAEA,IAAIV,KAAKG,IAAI,KAAK,UAAU;QAC1BQ,QAAQC,GAAG,CAAC;QACZC,SAASC,MAAM;IACjB;AACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as RefreshRuntime from "https://esm.sh/react-refresh@0.17.0/runtime";
|
|
2
|
+
if (window.process?.env?.NODE_ENV === "development") {
|
|
3
|
+
console.log("Fast refresh runtime loaded in development mode");
|
|
4
|
+
}
|
|
5
|
+
RefreshRuntime.injectIntoGlobalHook(window);
|
|
6
|
+
window.$RefreshReg$ = ()=>{};
|
|
7
|
+
window.$RefreshSig$ = ()=>(t)=>t;
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=refresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/client/refresh.js"],"sourcesContent":["import * as RefreshRuntime from \"https://esm.sh/react-refresh@0.17.0/runtime\";\n\nif (window.process?.env?.NODE_ENV === \"development\") {\n console.log(\"Fast refresh runtime loaded in development mode\");\n}\n\nRefreshRuntime.injectIntoGlobalHook(window);\nwindow.$RefreshReg$ = () => {};\nwindow.$RefreshSig$ = () => (t) => t;\n"],"names":["RefreshRuntime","window","process","env","NODE_ENV","console","log","injectIntoGlobalHook","$RefreshReg$","$RefreshSig$","t"],"mappings":"AAAA,YAAYA,oBAAoB,8CAA8C;AAE9E,IAAIC,OAAOC,OAAO,EAAEC,KAAKC,aAAa,eAAe;IACnDC,QAAQC,GAAG,CAAC;AACd;AAEAN,eAAeO,oBAAoB,CAACN;AACpCA,OAAOO,YAAY,GAAG,KAAO;AAC7BP,OAAOQ,YAAY,GAAG,IAAM,CAACC,IAAMA"}
|
package/dist/commands/build.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AA0DA,wBAAsB,KAAK,kBA8B1B"}
|
package/dist/commands/build.js
CHANGED
|
@@ -40,6 +40,9 @@ export async function build() {
|
|
|
40
40
|
await mkdir(join(process.cwd(), "dist"), {
|
|
41
41
|
recursive: true
|
|
42
42
|
});
|
|
43
|
+
await mkdir(join(process.cwd(), ".xplora"), {
|
|
44
|
+
recursive: true
|
|
45
|
+
});
|
|
43
46
|
const pages = await glob("src/app/**/*.tsx", {
|
|
44
47
|
ignore: [
|
|
45
48
|
"**/node_modules/**"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/build.ts"],"sourcesContent":["import { mkdir, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { glob } from \"fast-glob\";\nimport React from \"react\";\nimport { generateStaticPage } from \"xplorajs-react\";\n\ninterface Route {\n
|
|
1
|
+
{"version":3,"sources":["../../src/commands/build.ts"],"sourcesContent":["import { mkdir, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { glob } from \"fast-glob\";\nimport React from \"react\";\nimport { generateStaticPage } from \"xplorajs-react\";\n\ninterface Route {\n\tpath: string;\n\tfile: string;\n\tisDynamic: boolean;\n\tparams: string[];\n}\n\nfunction convertToRoute(filePath: string): Route {\n\tconst relativePath = filePath.replace(\"src/app/\", \"\");\n\tconst path = relativePath\n\t\t.replace(/\\.tsx$/, \"\")\n\t\t.replace(/\\/page$/, \"\")\n\t\t.replace(/\\[([^\\]]+)\\]/g, \":$1\");\n\n\tconst params = (relativePath.match(/\\[([^\\]]+)\\]/g) || []).map((param) =>\n\t\tparam.slice(1, -1),\n\t);\n\n\treturn {\n\t\tpath: path === \"page\" ? \"/\" : `/${path}`,\n\t\tfile: filePath,\n\t\tisDynamic: params.length > 0,\n\t\tparams,\n\t};\n}\n\nasync function processPage(page: string, route: Route) {\n\ttry {\n\t\tconst module = await import(join(process.cwd(), page));\n\t\tconst PageComponent = module.default;\n\n\t\tconst getStaticProps = module.getStaticProps;\n\t\tlet props = {};\n\n\t\tif (getStaticProps) {\n\t\t\tconst result = await getStaticProps();\n\t\t\tprops = result.props;\n\t\t}\n\n\t\tconst outputPath = join(process.cwd(), \"dist\", route.path, \"index.html\");\n\t\tawait generateStaticPage({\n\t\t\tcomponent: React.createElement(PageComponent, props),\n\t\t\toutputPath,\n\t\t\tprops,\n\t\t});\n\n\t\tconsole.log(`Generated ${outputPath}`);\n\t} catch (error) {\n\t\tconsole.error(`Error processing ${page}:`, error);\n\t}\n}\n\nexport async function build() {\n\tconsole.log(\"Building application...\");\n\n\tawait mkdir(join(process.cwd(), \"dist\"), { recursive: true });\n\tawait mkdir(join(process.cwd(), \".xplora\"), { recursive: true });\n\n\tconst pages = await glob(\"src/app/**/*.tsx\", {\n\t\tignore: [\"**/node_modules/**\"],\n\t});\n\n\tconst routes: Route[] = [];\n\n\tfor (const page of pages) {\n\t\tconst route = convertToRoute(page);\n\t\troutes.push(route);\n\t\tawait processPage(page, route);\n\t}\n\n\tconst routesConfig = {\n\t\troutes,\n\t\tgeneratedAt: new Date().toISOString(),\n\t};\n\n\tawait writeFile(\n\t\tjoin(process.cwd(), \".xplora\", \"routes.json\"),\n\t\tJSON.stringify(routesConfig, null, 2),\n\t);\n\n\tconsole.log(\"Build completed!\");\n\tconsole.log(\"Routes:\", routes.map((r) => r.path).join(\"\\n\"));\n}\n"],"names":["mkdir","writeFile","join","glob","React","generateStaticPage","convertToRoute","filePath","relativePath","replace","path","params","match","map","param","slice","file","isDynamic","length","processPage","page","route","module","process","cwd","PageComponent","default","getStaticProps","props","result","outputPath","component","createElement","console","log","error","build","recursive","pages","ignore","routes","push","routesConfig","generatedAt","Date","toISOString","JSON","stringify","r"],"mappings":"AAAA,SAASA,KAAK,EAAEC,SAAS,QAAQ,mBAAmB;AACpD,SAASC,IAAI,QAAQ,YAAY;AACjC,SAASC,IAAI,QAAQ,YAAY;AACjC,OAAOC,WAAW,QAAQ;AAC1B,SAASC,kBAAkB,QAAQ,iBAAiB;AASpD,SAASC,eAAeC,QAAgB;IACvC,MAAMC,eAAeD,SAASE,OAAO,CAAC,YAAY;IAClD,MAAMC,OAAOF,aACXC,OAAO,CAAC,UAAU,IAClBA,OAAO,CAAC,WAAW,IACnBA,OAAO,CAAC,iBAAiB;IAE3B,MAAME,SAAS,AAACH,CAAAA,aAAaI,KAAK,CAAC,oBAAoB,EAAE,AAAD,EAAGC,GAAG,CAAC,CAACC,QAC/DA,MAAMC,KAAK,CAAC,GAAG,CAAC;IAGjB,OAAO;QACNL,MAAMA,SAAS,SAAS,MAAM,CAAC,CAAC,EAAEA,MAAM;QACxCM,MAAMT;QACNU,WAAWN,OAAOO,MAAM,GAAG;QAC3BP;IACD;AACD;AAEA,eAAeQ,YAAYC,IAAY,EAAEC,KAAY;IACpD,IAAI;QACH,MAAMC,SAAS,MAAM,MAAM,CAACpB,KAAKqB,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,IAAI,CAAC;AACvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../src/commands/css.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAsB,QAAQ,kBAmB7B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { mkdir } from "node:fs/promises";
|
|
3
|
+
import { $, file } from "bun";
|
|
4
|
+
export async function buildCSS() {
|
|
5
|
+
const inputPath = join(process.cwd(), "src/app/styles.css");
|
|
6
|
+
const outputPath = join(process.cwd(), "dist/assets/style.css");
|
|
7
|
+
const inputFile = file(inputPath);
|
|
8
|
+
if (!await inputFile.exists()) {
|
|
9
|
+
console.log("No styles.css found, skipping CSS build");
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
await mkdir(join(process.cwd(), "dist/assets"), {
|
|
13
|
+
recursive: true
|
|
14
|
+
});
|
|
15
|
+
try {
|
|
16
|
+
await $`bunx tailwindcss -i ${inputPath} -o ${outputPath} --minify`.quiet();
|
|
17
|
+
console.log("CSS built successfully");
|
|
18
|
+
} catch (error) {
|
|
19
|
+
console.error("CSS build failed:", error);
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/css.ts"],"sourcesContent":["import { join } from \"node:path\";\nimport { mkdir } from \"node:fs/promises\";\nimport { $, file } from \"bun\";\n\n/**\n * Build CSS with Tailwind CSS v4.\n * Reads src/app/styles.css and outputs to dist/assets/style.css\n */\nexport async function buildCSS() {\n const inputPath = join(process.cwd(), \"src/app/styles.css\");\n const outputPath = join(process.cwd(), \"dist/assets/style.css\");\n\n const inputFile = file(inputPath);\n if (!(await inputFile.exists())) {\n console.log(\"No styles.css found, skipping CSS build\");\n return;\n }\n\n await mkdir(join(process.cwd(), \"dist/assets\"), { recursive: true });\n\n try {\n await $`bunx tailwindcss -i ${inputPath} -o ${outputPath} --minify`.quiet();\n console.log(\"CSS built successfully\");\n } catch (error) {\n console.error(\"CSS build failed:\", error);\n throw error;\n }\n}\n"],"names":["join","mkdir","$","file","buildCSS","inputPath","process","cwd","outputPath","inputFile","exists","console","log","recursive","quiet","error"],"mappings":"AAAA,SAASA,IAAI,QAAQ,YAAY;AACjC,SAASC,KAAK,QAAQ,mBAAmB;AACzC,SAASC,CAAC,EAAEC,IAAI,QAAQ,MAAM;AAM9B,OAAO,eAAeC;IACpB,MAAMC,YAAYL,KAAKM,QAAQC,GAAG,IAAI;IACtC,MAAMC,aAAaR,KAAKM,QAAQC,GAAG,IAAI;IAEvC,MAAME,YAAYN,KAAKE;IACvB,IAAI,CAAE,MAAMI,UAAUC,MAAM,IAAK;QAC/BC,QAAQC,GAAG,CAAC;QACZ;IACF;IAEA,MAAMX,MAAMD,KAAKM,QAAQC,GAAG,IAAI,gBAAgB;QAAEM,WAAW;IAAK;IAElE,IAAI;QACF,MAAMX,CAAC,CAAC,oBAAoB,EAAEG,UAAU,IAAI,EAAEG,WAAW,SAAS,CAAC,CAACM,KAAK;QACzEH,QAAQC,GAAG,CAAC;IACd,EAAE,OAAOG,OAAO;QACdJ,QAAQI,KAAK,CAAC,qBAAqBA;QACnC,MAAMA;IACR;AACF"}
|
package/dist/commands/dev.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AA8EA,wBAAsB,GAAG,kBAyGxB"}
|
package/dist/commands/dev.js
CHANGED
|
@@ -1,30 +1,50 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
1
|
import { join } from "node:path";
|
|
2
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
3
3
|
import { serve } from "bun";
|
|
4
4
|
import { watch } from "chokidar";
|
|
5
|
+
import { glob } from "fast-glob";
|
|
5
6
|
import React from "react";
|
|
6
7
|
import { WebSocketServer } from "ws";
|
|
7
8
|
import { renderToStream } from "xplorajs-react";
|
|
8
|
-
import {
|
|
9
|
+
import { buildCSS } from "./css";
|
|
9
10
|
const pages = new Map();
|
|
11
|
+
function convertToRoute(filePath) {
|
|
12
|
+
const relativePath = filePath.replace("src/app/", "");
|
|
13
|
+
const path = relativePath.replace(/\.tsx$/, "").replace(/\/page$/, "").replace(/\[([^\]]+)\]/g, ":$1");
|
|
14
|
+
const params = (relativePath.match(/\[([^\]]+)\]/g) || []).map((param)=>param.slice(1, -1));
|
|
15
|
+
return {
|
|
16
|
+
path: path === "page" ? "/" : `/${path}`,
|
|
17
|
+
file: filePath,
|
|
18
|
+
isDynamic: params.length > 0,
|
|
19
|
+
params
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
async function generateRoutes() {
|
|
23
|
+
await mkdir(join(process.cwd(), ".xplora"), {
|
|
24
|
+
recursive: true
|
|
25
|
+
});
|
|
26
|
+
const pageFiles = await glob("src/app/**/*.tsx", {
|
|
27
|
+
ignore: [
|
|
28
|
+
"**/node_modules/**"
|
|
29
|
+
]
|
|
30
|
+
});
|
|
31
|
+
const routes = pageFiles.map(convertToRoute);
|
|
32
|
+
const routesConfig = {
|
|
33
|
+
routes,
|
|
34
|
+
generatedAt: new Date().toISOString()
|
|
35
|
+
};
|
|
36
|
+
await writeFile(join(process.cwd(), ".xplora", "routes.json"), JSON.stringify(routesConfig, null, 2));
|
|
37
|
+
return routes;
|
|
38
|
+
}
|
|
10
39
|
async function loadPages() {
|
|
11
40
|
pages.clear();
|
|
12
|
-
const routes = await
|
|
41
|
+
const routes = await generateRoutes();
|
|
13
42
|
for (const route of routes){
|
|
14
43
|
const abs = join(process.cwd(), route.file);
|
|
15
44
|
delete import.meta.require?.cache?.[abs];
|
|
16
45
|
pages.set(route.path, (await import(abs)).default);
|
|
17
46
|
}
|
|
18
47
|
}
|
|
19
|
-
async function loadRoutes() {
|
|
20
|
-
try {
|
|
21
|
-
const routesPath = join(process.cwd(), ".xplora", "routes.json");
|
|
22
|
-
const routesContent = readFileSync(routesPath, "utf-8");
|
|
23
|
-
return JSON.parse(routesContent).routes;
|
|
24
|
-
} catch {
|
|
25
|
-
return [];
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
48
|
export async function dev() {
|
|
29
49
|
console.log("Starting development server...");
|
|
30
50
|
const wss = new WebSocketServer({
|
|
@@ -38,17 +58,27 @@ export async function dev() {
|
|
|
38
58
|
});
|
|
39
59
|
watcher.on("change", async (path)=>{
|
|
40
60
|
console.log(`File ${path} has been changed`);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
61
|
+
if (path.endsWith(".css")) {
|
|
62
|
+
await buildCSS();
|
|
63
|
+
for (const client of wss.clients){
|
|
64
|
+
if (client.readyState === WebSocket.OPEN) {
|
|
65
|
+
client.send(JSON.stringify({
|
|
66
|
+
type: "css"
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
await loadPages();
|
|
72
|
+
for (const client of wss.clients){
|
|
73
|
+
if (client.readyState === WebSocket.OPEN) {
|
|
74
|
+
client.send(JSON.stringify({
|
|
75
|
+
type: "reload"
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
48
78
|
}
|
|
49
79
|
}
|
|
50
80
|
});
|
|
51
|
-
await
|
|
81
|
+
await buildCSS();
|
|
52
82
|
await loadPages();
|
|
53
83
|
serve({
|
|
54
84
|
port: 3000,
|
|
@@ -56,13 +86,21 @@ export async function dev() {
|
|
|
56
86
|
async fetch (req) {
|
|
57
87
|
const url = new URL(req.url);
|
|
58
88
|
const path = url.pathname;
|
|
59
|
-
if (path === "/") {
|
|
60
|
-
return new Response("Hello from XploraJS!");
|
|
61
|
-
}
|
|
62
89
|
if (path.startsWith("/assets/")) {
|
|
63
90
|
const f = Bun.file(join(process.cwd(), "dist", path));
|
|
64
91
|
if (await f.exists()) return new Response(f);
|
|
65
92
|
}
|
|
93
|
+
if (path.startsWith("/client/")) {
|
|
94
|
+
const clientPath = join(import.meta.dir, "..", "client", path.replace("/client/", ""));
|
|
95
|
+
const f = Bun.file(clientPath);
|
|
96
|
+
if (await f.exists()) {
|
|
97
|
+
return new Response(f, {
|
|
98
|
+
headers: {
|
|
99
|
+
"Content-Type": "application/javascript"
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
66
104
|
const Page = pages.get(path);
|
|
67
105
|
if (!Page) return new Response("Not Found", {
|
|
68
106
|
status: 404
|
|
@@ -74,27 +112,8 @@ export async function dev() {
|
|
|
74
112
|
<script>window.process={env:{NODE_ENV:"development"}};</script>
|
|
75
113
|
</head><body><div id="root">`;
|
|
76
114
|
const foot = `</div>
|
|
77
|
-
<script type="module">
|
|
78
|
-
|
|
79
|
-
if (window.process?.env?.NODE_ENV === "development") {
|
|
80
|
-
console.log("Fast refresh runtime loaded in development mode");
|
|
81
|
-
}
|
|
82
|
-
RefreshRuntime.injectIntoGlobalHook(window);
|
|
83
|
-
window.$RefreshReg$=()=>{};
|
|
84
|
-
window.$RefreshSig$=()=>t=>t;
|
|
85
|
-
</script>
|
|
86
|
-
<script>
|
|
87
|
-
const ws=new WebSocket("ws://localhost:3001");
|
|
88
|
-
ws.onmessage=async e=>{
|
|
89
|
-
if(e.data==="css"){
|
|
90
|
-
document.querySelectorAll('link[rel="stylesheet"]').forEach(l=>l.href="/assets/style.css?v="+Date.now());
|
|
91
|
-
}
|
|
92
|
-
if(e.data==="reload"){
|
|
93
|
-
console.log("Reloading...");
|
|
94
|
-
location.reload();
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
</script>
|
|
115
|
+
<script type="module" src="/client/refresh.js"></script>
|
|
116
|
+
<script type="module" src="/client/hmr.js"></script>
|
|
98
117
|
</body></html>`;
|
|
99
118
|
return new Response(new ReadableStream({
|
|
100
119
|
start (ctrl) {
|
package/dist/commands/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/dev.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { serve } from \"bun\";\nimport { watch } from \"chokidar\";\nimport React from \"react\";\nimport type { ComponentType } from \"react\";\nimport { WebSocketServer } from \"ws\";\nimport { renderToStream } from \"xplorajs-react\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/commands/dev.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport { serve } from \"bun\";\nimport { watch } from \"chokidar\";\nimport { glob } from \"fast-glob\";\nimport React from \"react\";\nimport type { ComponentType } from \"react\";\nimport { WebSocketServer } from \"ws\";\nimport { renderToStream } from \"xplorajs-react\";\nimport { buildCSS } from \"./css\";\n\n// biome-ignore lint/suspicious/noExplicitAny: <intended>\nconst pages = new Map<string, ComponentType<Record<string, any>>>();\n\ninterface Route {\n path: string;\n file: string;\n isDynamic: boolean;\n params: string[];\n}\n\nfunction convertToRoute(filePath: string): Route {\n const relativePath = filePath.replace(\"src/app/\", \"\");\n const path = relativePath\n .replace(/\\.tsx$/, \"\")\n .replace(/\\/page$/, \"\")\n .replace(/\\[([^\\]]+)\\]/g, \":$1\");\n\n const params = (relativePath.match(/\\[([^\\]]+)\\]/g) || []).map((param) =>\n param.slice(1, -1),\n );\n\n return {\n path: path === \"page\" ? \"/\" : `/${path}`,\n file: filePath,\n isDynamic: params.length > 0,\n params,\n };\n}\n\nasync function generateRoutes() {\n await mkdir(join(process.cwd(), \".xplora\"), { recursive: true });\n\n const pageFiles = await glob(\"src/app/**/*.tsx\", {\n ignore: [\"**/node_modules/**\"],\n });\n\n const routes: Route[] = pageFiles.map(convertToRoute);\n\n const routesConfig = {\n routes,\n generatedAt: new Date().toISOString(),\n };\n\n await writeFile(\n join(process.cwd(), \".xplora\", \"routes.json\"),\n JSON.stringify(routesConfig, null, 2),\n );\n\n return routes;\n}\n\nasync function loadPages() {\n pages.clear();\n const routes = await generateRoutes();\n\n for (const route of routes) {\n const abs = join(process.cwd(), route.file);\n delete import.meta.require?.cache?.[abs];\n pages.set(\n route.path,\n // biome-ignore lint/suspicious/noExplicitAny: <intended>\n (await import(abs)).default as ComponentType<Record<string, any>>,\n );\n }\n}\n\nexport async function dev() {\n console.log(\"Starting development server...\");\n\n const wss = new WebSocketServer({ port: 3001 });\n\n const watcher = watch([\"src/**/*\"], {\n ignored: /(^|[\\/\\\\])\\../,\n persistent: true,\n });\n\n watcher.on(\"change\", async (path: string) => {\n console.log(`File ${path} has been changed`);\n\n if (path.endsWith(\".css\")) {\n // CSS changed - rebuild CSS and notify clients for CSS-only reload\n await buildCSS();\n for (const client of wss.clients) {\n if (client.readyState === WebSocket.OPEN) {\n client.send(JSON.stringify({ type: \"css\" }));\n }\n }\n } else {\n // TSX/other files changed - reload pages and trigger full reload\n await loadPages();\n for (const client of wss.clients) {\n if (client.readyState === WebSocket.OPEN) {\n client.send(JSON.stringify({ type: \"reload\" }));\n }\n }\n }\n });\n\n await buildCSS();\n await loadPages();\n\n serve({\n port: 3000,\n development: true,\n async fetch(req: Request) {\n const url = new URL(req.url);\n const path = url.pathname;\n\n if (path.startsWith(\"/assets/\")) {\n const f = Bun.file(join(process.cwd(), \"dist\", path));\n if (await f.exists()) return new Response(f);\n }\n\n if (path.startsWith(\"/client/\")) {\n const clientPath = join(\n import.meta.dir,\n \"..\",\n \"client\",\n path.replace(\"/client/\", \"\"),\n );\n const f = Bun.file(clientPath);\n if (await f.exists()) {\n return new Response(f, {\n headers: { \"Content-Type\": \"application/javascript\" },\n });\n }\n }\n\n const Page = pages.get(path);\n if (!Page) return new Response(\"Not Found\", { status: 404 });\n\n const stream = await renderToStream(React.createElement(Page));\n\n const head = `<!DOCTYPE html><html><head>\n\t\t\t\t<meta charset=\"utf-8\"/>\n\t\t\t\t<link rel=\"stylesheet\" href=\"/assets/style.css\"/>\n\t\t\t\t<script>window.process={env:{NODE_ENV:\"development\"}};</script>\n\t\t\t\t</head><body><div id=\"root\">`;\n\n const foot = `</div>\n\t\t\t\t<script type=\"module\" src=\"/client/refresh.js\"></script>\n\t\t\t\t<script type=\"module\" src=\"/client/hmr.js\"></script>\n\t\t\t</body></html>`;\n\n return new Response(\n new ReadableStream({\n start(ctrl) {\n ctrl.enqueue(new TextEncoder().encode(head));\n if (typeof stream === \"string\") {\n ctrl.enqueue(new TextEncoder().encode(stream));\n } else {\n stream.pipeTo(\n new WritableStream({\n write(c) {\n ctrl.enqueue(c);\n },\n close() {\n ctrl.enqueue(new TextEncoder().encode(foot));\n ctrl.close();\n },\n }),\n );\n }\n },\n }),\n { headers: { \"Content-Type\": \"text/html; charset=utf-8\" } },\n );\n },\n });\n\n console.log(\"Development server running at http://localhost:3000\");\n}\n"],"names":["join","mkdir","writeFile","serve","watch","glob","React","WebSocketServer","renderToStream","buildCSS","pages","Map","convertToRoute","filePath","relativePath","replace","path","params","match","map","param","slice","file","isDynamic","length","generateRoutes","process","cwd","recursive","pageFiles","ignore","routes","routesConfig","generatedAt","Date","toISOString","JSON","stringify","loadPages","clear","route","abs","require","cache","set","default","dev","console","log","wss","port","watcher","ignored","persistent","on","endsWith","client","clients","readyState","WebSocket","OPEN","send","type","development","fetch","req","url","URL","pathname","startsWith","f","Bun","exists","Response","clientPath","dir","headers","Page","get","status","stream","createElement","head","foot","ReadableStream","start","ctrl","enqueue","TextEncoder","encode","pipeTo","WritableStream","write","c","close"],"mappings":"AACA,SAASA,IAAI,QAAQ,YAAY;AACjC,SAASC,KAAK,EAAEC,SAAS,QAAQ,mBAAmB;AACpD,SAASC,KAAK,QAAQ,MAAM;AAC5B,SAASC,KAAK,QAAQ,WAAW;AACjC,SAASC,IAAI,QAAQ,YAAY;AACjC,OAAOC,WAAW,QAAQ;AAE1B,SAASC,eAAe,QAAQ,KAAK;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MACA,UACA3D,KAAKD,OAAO,CAAC,YAAY;gBAE3B,MAAMuD,IAAIC,IAAIjD,IAAI,CAACoD;gBACnB,IAAI,MAAMJ,EAAEE,MAAM,IAAI;oBACpB,OAAO,IAAIC,SAASH,GAAG;wBACrBM,SAAS;4BAAE,gBAAgB;wBAAyB;oBACtD;gBACF;YACF;YAEA,MAAMC,OAAOnE,MAAMoE,GAAG,CAAC9D;YACvB,IAAI,CAAC6D,MAAM,OAAO,IAAIJ,SAAS,aAAa;gBAAEM,QAAQ;YAAI;YAE1D,MAAMC,SAAS,MAAMxE,eAAeF,MAAM2E,aAAa,CAACJ;YAExD,MAAMK,OAAO,CAAC;;;;gCAIY,CAAC;YAE3B,MAAMC,OAAO,CAAC;;;iBAGH,CAAC;YAEZ,OAAO,IAAIV,SACT,IAAIW,eAAe;gBACjBC,OAAMC,IAAI;oBACRA,KAAKC,OAAO,CAAC,IAAIC,cAAcC,MAAM,CAACP;oBACtC,IAAI,OAAOF,WAAW,UAAU;wBAC9BM,KAAKC,OAAO,CAAC,IAAIC,cAAcC,MAAM,CAACT;oBACxC,OAAO;wBACLA,OAAOU,MAAM,CACX,IAAIC,eAAe;4BACjBC,OAAMC,CAAC;gCACLP,KAAKC,OAAO,CAACM;4BACf;4BACAC;gCACER,KAAKC,OAAO,CAAC,IAAIC,cAAcC,MAAM,CAACN;gCACtCG,KAAKQ,KAAK;4BACZ;wBACF;oBAEJ;gBACF;YACF,IACA;gBAAElB,SAAS;oBAAE,gBAAgB;gBAA2B;YAAE;QAE9D;IACF;IAEA7B,QAAQC,GAAG,CAAC;AACd"}
|
package/dist/commands/start.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAGA,wBAAsB,KAAK,kBAkC1B"}
|
package/dist/commands/start.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
1
2
|
import { serve } from "bun";
|
|
2
3
|
export async function start() {
|
|
3
4
|
console.log("Starting production server...");
|
|
@@ -8,9 +9,17 @@ export async function start() {
|
|
|
8
9
|
port: config.port,
|
|
9
10
|
async fetch (req) {
|
|
10
11
|
const url = new URL(req.url);
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const pathname = url.pathname;
|
|
13
|
+
const distDir = join(process.cwd(), "dist");
|
|
14
|
+
let filePath;
|
|
15
|
+
if (pathname.includes(".")) {
|
|
16
|
+
filePath = join(distDir, pathname);
|
|
17
|
+
} else {
|
|
18
|
+
filePath = join(distDir, pathname, "index.html");
|
|
19
|
+
}
|
|
20
|
+
const file = Bun.file(filePath);
|
|
21
|
+
if (await file.exists()) {
|
|
22
|
+
return new Response(file);
|
|
14
23
|
}
|
|
15
24
|
return new Response("Not found", {
|
|
16
25
|
status: 404
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/start.ts"],"sourcesContent":["import { serve } from \"bun\";\n\nexport async function start() {\n console.log(\"Starting production server...\");\n\n const config = {\n port: 3000,\n };\n\n serve({\n port: config.port,\n async fetch(req: Request) {\n const url = new URL(req.url);\n const
|
|
1
|
+
{"version":3,"sources":["../../src/commands/start.ts"],"sourcesContent":["import { join } from \"node:path\";\nimport { serve } from \"bun\";\n\nexport async function start() {\n console.log(\"Starting production server...\");\n\n const config = {\n port: 3000,\n };\n\n serve({\n port: config.port,\n async fetch(req: Request) {\n const url = new URL(req.url);\n const pathname = url.pathname;\n\n const distDir = join(process.cwd(), \"dist\");\n\n let filePath: string;\n\n if (pathname.includes(\".\")) {\n filePath = join(distDir, pathname);\n } else {\n filePath = join(distDir, pathname, \"index.html\");\n }\n\n const file = Bun.file(filePath);\n\n if (await file.exists()) {\n return new Response(file);\n }\n\n return new Response(\"Not found\", { status: 404 });\n },\n });\n\n console.log(\"Production server running at http://localhost:3000\");\n}\n"],"names":["join","serve","start","console","log","config","port","fetch","req","url","URL","pathname","distDir","process","cwd","filePath","includes","file","Bun","exists","Response","status"],"mappings":"AAAA,SAASA,IAAI,QAAQ,YAAY;AACjC,SAASC,KAAK,QAAQ,MAAM;AAE5B,OAAO,eAAeC;IACpBC,QAAQC,GAAG,CAAC;IAEZ,MAAMC,SAAS;QACbC,MAAM;IACR;IAEAL,MAAM;QACJK,MAAMD,OAAOC,IAAI;QACjB,MAAMC,OAAMC,GAAY;YACtB,MAAMC,MAAM,IAAIC,IAAIF,IAAIC,GAAG;YAC3B,MAAME,WAAWF,IAAIE,QAAQ;YAE7B,MAAMC,UAAUZ,KAAKa,QAAQC,GAAG,IAAI;YAEpC,IAAIC;YAEJ,IAAIJ,SAASK,QAAQ,CAAC,MAAM;gBAC1BD,WAAWf,KAAKY,SAASD;YAC3B,OAAO;gBACLI,WAAWf,KAAKY,SAASD,UAAU;YACrC;YAEA,MAAMM,OAAOC,IAAID,IAAI,CAACF;YAEtB,IAAI,MAAME,KAAKE,MAAM,IAAI;gBACvB,OAAO,IAAIC,SAASH;YACtB;YAEA,OAAO,IAAIG,SAAS,aAAa;gBAAEC,QAAQ;YAAI;QACjD;IACF;IAEAlB,QAAQC,GAAG,CAAC;AACd"}
|
package/dist/config.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,UAAU,YAAY;IACpB,GAAG,CAAC,EAAE;QACJ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,CAAC,EAAE,OAAO,CAAC;KACf,CAAC;IACF,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;IACF,KAAK,CAAC,EAAE;QACN,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC;CACH;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAmBxD;AAED,YAAY,EAAE,YAAY,EAAE,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export { defineConfig };
|
|
1
|
+
export type { XploraConfig } from "./config";
|
|
2
|
+
export { defineConfig } from "./config";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export type { XploraConfig } from \"./config\";\nexport { defineConfig } from \"./config\";\n"],"names":["defineConfig"],"mappings":"AACA,SAASA,YAAY,QAAQ,WAAW"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xplorajs",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/XplorationTechnologies/xplora.js.git"
|
|
8
|
+
},
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
6
15
|
"types": "dist/index.d.ts",
|
|
7
16
|
"bin": {
|
|
8
17
|
"xplorajs": "./dist/cli.js"
|
|
@@ -11,6 +20,7 @@
|
|
|
11
20
|
"dist",
|
|
12
21
|
"README.md"
|
|
13
22
|
],
|
|
23
|
+
"sideEffects": false,
|
|
14
24
|
"scripts": {
|
|
15
25
|
"dev": "bun run build --watch",
|
|
16
26
|
"build": "swc src -d dist --config-file .swcrc && tsc --emitDeclarationOnly",
|
|
@@ -18,24 +28,23 @@
|
|
|
18
28
|
"prepublishOnly": "bun run build"
|
|
19
29
|
},
|
|
20
30
|
"dependencies": {
|
|
21
|
-
"@swc/cli": "^0.1.65",
|
|
22
|
-
"@swc/core": "^1.11.24",
|
|
23
31
|
"chokidar": "^3.6.0",
|
|
24
32
|
"commander": "^11.1.0",
|
|
25
33
|
"fast-glob": "^3.3.3",
|
|
26
34
|
"ws": "^8.18.2",
|
|
27
|
-
"xplorajs-react": "
|
|
35
|
+
"xplorajs-react": "workspace:^0.3.0"
|
|
28
36
|
},
|
|
29
37
|
"devDependencies": {
|
|
38
|
+
"@swc/cli": "^0.1.65",
|
|
39
|
+
"@swc/core": "^1.11.24",
|
|
30
40
|
"@types/bun": "^1.2.13",
|
|
31
41
|
"@types/ws": "^8.18.1",
|
|
32
42
|
"react-refresh": "^0.17.0"
|
|
33
43
|
},
|
|
34
44
|
"peerDependencies": {
|
|
35
|
-
"react": "
|
|
36
|
-
"react-dom": "
|
|
37
|
-
"
|
|
38
|
-
"@types/react-dom": "^19.1.5"
|
|
45
|
+
"react": ">=18 || >=19",
|
|
46
|
+
"react-dom": ">=18 || >=19",
|
|
47
|
+
"tailwindcss": ">=4.0.0"
|
|
39
48
|
},
|
|
40
49
|
"publishConfig": {
|
|
41
50
|
"access": "public"
|