one 2.6.1 → 2.6.3
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/cjs/cli/build.cjs +2 -2
- package/dist/cjs/cli/build.native.cjs +2 -2
- package/dist/cjs/cli/build.native.js +2 -2
- package/dist/cjs/cli/build.native.js.map +1 -1
- package/dist/cjs/serve-worker.cjs +3 -1
- package/dist/cjs/serve-worker.native.cjs +3 -1
- package/dist/cjs/serve-worker.native.js +3 -1
- package/dist/cjs/serve-worker.native.js.map +1 -1
- package/dist/cjs/server/assetRange.cjs +57 -0
- package/dist/cjs/server/assetRange.native.cjs +59 -0
- package/dist/cjs/server/assetRange.native.js +61 -0
- package/dist/cjs/server/assetRange.native.js.map +1 -0
- package/dist/esm/cli/build.mjs +2 -2
- package/dist/esm/cli/build.mjs.map +1 -1
- package/dist/esm/cli/build.native.js +2 -2
- package/dist/esm/cli/build.native.js.map +1 -1
- package/dist/esm/serve-worker.mjs +2 -1
- package/dist/esm/serve-worker.mjs.map +1 -1
- package/dist/esm/serve-worker.native.js +2 -1
- package/dist/esm/serve-worker.native.js.map +1 -1
- package/dist/esm/server/assetRange.mjs +37 -0
- package/dist/esm/server/assetRange.mjs.map +1 -0
- package/dist/esm/server/assetRange.native.js +37 -0
- package/dist/esm/server/assetRange.native.js.map +1 -0
- package/package.json +15 -15
- package/src/cli/build.ts +2 -2
- package/src/serve-worker.ts +1 -0
- package/src/server/assetRange.test.ts +75 -0
- package/src/server/assetRange.ts +45 -0
- package/types/serve-worker.d.ts +1 -0
- package/types/serve-worker.d.ts.map +1 -1
- package/types/server/assetRange.d.ts +2 -0
- package/types/server/assetRange.d.ts.map +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve-worker.native.js","names":[],"sources":["cjs/serve-worker.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar serve_worker_exports = {};\n__export(serve_worker_exports, {\n getFetchStaticHtml: () => import_staticHtmlFetcher.getFetchStaticHtml,\n serve: () => serve,\n setFetchStaticHtml: () => import_staticHtmlFetcher.setFetchStaticHtml\n});\nmodule.exports = __toCommonJS(serve_worker_exports);\nvar import_setServerGlobals = require(\"./server/setServerGlobals\");\nvar import_setupBuildOptions = require(\"./server/setupBuildOptions\");\nvar import_workerHandler = require(\"./server/workerHandler\");\nvar import_ensureExists = require(\"./utils/ensureExists\");\nvar import_staticHtmlFetcher = require(\"./server/staticHtmlFetcher\");\nasync function serve(buildInfo, lazyRoutes, serveOptions) {\n (0, import_setupBuildOptions.setupBuildInfo)(buildInfo);\n (0, import_ensureExists.ensureExists)(buildInfo.oneOptions);\n (0, import_setServerGlobals.setServerGlobals)();\n var handler = (0, import_workerHandler.createWorkerHandler)({\n oneOptions: buildInfo.oneOptions,\n buildInfo,\n lazyRoutes,\n disableModuleCache: serveOptions === null || serveOptions === void 0 ? void 0 : serveOptions.disableModuleCache\n });\n return {\n fetch: handler.handleRequest,\n updateRoutes(newBuildInfo, newLazyRoutes) {\n (0, import_setupBuildOptions.setupBuildInfo)(newBuildInfo);\n handler.updateRoutes(newBuildInfo, newLazyRoutes);\n }\n };\n}\n//# sourceMappingURL=serve-worker.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,uBAAuB,CAAC;AAC5B,SAAS,sBAAsB;CAC7B,0BAA0B,yBAAyB;CACnD,aAAa;CACb,0BAA0B,yBAAyB;
|
|
1
|
+
{"version":3,"file":"serve-worker.native.js","names":[],"sources":["cjs/serve-worker.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar serve_worker_exports = {};\n__export(serve_worker_exports, {\n getFetchStaticHtml: () => import_staticHtmlFetcher.getFetchStaticHtml,\n serve: () => serve,\n setFetchStaticHtml: () => import_staticHtmlFetcher.setFetchStaticHtml,\n withRange: () => import_assetRange.withRange\n});\nmodule.exports = __toCommonJS(serve_worker_exports);\nvar import_setServerGlobals = require(\"./server/setServerGlobals\");\nvar import_setupBuildOptions = require(\"./server/setupBuildOptions\");\nvar import_workerHandler = require(\"./server/workerHandler\");\nvar import_ensureExists = require(\"./utils/ensureExists\");\nvar import_staticHtmlFetcher = require(\"./server/staticHtmlFetcher\");\nvar import_assetRange = require(\"./server/assetRange\");\nasync function serve(buildInfo, lazyRoutes, serveOptions) {\n (0, import_setupBuildOptions.setupBuildInfo)(buildInfo);\n (0, import_ensureExists.ensureExists)(buildInfo.oneOptions);\n (0, import_setServerGlobals.setServerGlobals)();\n var handler = (0, import_workerHandler.createWorkerHandler)({\n oneOptions: buildInfo.oneOptions,\n buildInfo,\n lazyRoutes,\n disableModuleCache: serveOptions === null || serveOptions === void 0 ? void 0 : serveOptions.disableModuleCache\n });\n return {\n fetch: handler.handleRequest,\n updateRoutes(newBuildInfo, newLazyRoutes) {\n (0, import_setupBuildOptions.setupBuildInfo)(newBuildInfo);\n handler.updateRoutes(newBuildInfo, newLazyRoutes);\n }\n };\n}\n//# sourceMappingURL=serve-worker.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KA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ty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var assetRange_exports = {};
|
|
22
|
+
__export(assetRange_exports, { withRange: () => withRange });
|
|
23
|
+
module.exports = __toCommonJS(assetRange_exports);
|
|
24
|
+
async function withRange(request, response) {
|
|
25
|
+
const range = request.headers.get("range");
|
|
26
|
+
if (!range || request.method !== "GET" || response.status !== 200 || response.headers.has("content-range") || response.headers.has("content-encoding")) {
|
|
27
|
+
return response;
|
|
28
|
+
}
|
|
29
|
+
const match = /^bytes=(\d*)-(\d*)$/.exec(range.trim());
|
|
30
|
+
if (!match || !match[1] && !match[2]) return response;
|
|
31
|
+
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
32
|
+
const size = bytes.byteLength;
|
|
33
|
+
let start;
|
|
34
|
+
let end;
|
|
35
|
+
if (!match[1]) {
|
|
36
|
+
start = Math.max(0, size - Number(match[2]));
|
|
37
|
+
end = size - 1;
|
|
38
|
+
} else {
|
|
39
|
+
start = Number(match[1]);
|
|
40
|
+
end = match[2] ? Math.min(Number(match[2]), size - 1) : size - 1;
|
|
41
|
+
}
|
|
42
|
+
const headers = new Headers(response.headers);
|
|
43
|
+
headers.set("accept-ranges", "bytes");
|
|
44
|
+
if (start >= size || start > end) {
|
|
45
|
+
headers.set("content-range", `bytes */${size}`);
|
|
46
|
+
return new Response(null, {
|
|
47
|
+
status: 416,
|
|
48
|
+
headers
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
headers.set("content-range", `bytes ${start}-${end}/${size}`);
|
|
52
|
+
headers.set("content-length", String(end - start + 1));
|
|
53
|
+
return new Response(bytes.subarray(start, end + 1), {
|
|
54
|
+
status: 206,
|
|
55
|
+
headers
|
|
56
|
+
});
|
|
57
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
+
var assetRange_exports = {};
|
|
24
|
+
__export(assetRange_exports, { withRange: () => withRange });
|
|
25
|
+
module.exports = __toCommonJS(assetRange_exports);
|
|
26
|
+
async function withRange(request, response) {
|
|
27
|
+
var range = request.headers.get("range");
|
|
28
|
+
if (!range || request.method !== "GET" || response.status !== 200 || response.headers.has("content-range") || response.headers.has("content-encoding")) {
|
|
29
|
+
return response;
|
|
30
|
+
}
|
|
31
|
+
var match = /^bytes=(\d*)-(\d*)$/.exec(range.trim());
|
|
32
|
+
if (!match || !match[1] && !match[2]) return response;
|
|
33
|
+
var bytes = new Uint8Array(await response.arrayBuffer());
|
|
34
|
+
var size = bytes.byteLength;
|
|
35
|
+
var start;
|
|
36
|
+
var end;
|
|
37
|
+
if (!match[1]) {
|
|
38
|
+
start = Math.max(0, size - Number(match[2]));
|
|
39
|
+
end = size - 1;
|
|
40
|
+
} else {
|
|
41
|
+
start = Number(match[1]);
|
|
42
|
+
end = match[2] ? Math.min(Number(match[2]), size - 1) : size - 1;
|
|
43
|
+
}
|
|
44
|
+
var headers = new Headers(response.headers);
|
|
45
|
+
headers.set("accept-ranges", "bytes");
|
|
46
|
+
if (start >= size || start > end) {
|
|
47
|
+
headers.set("content-range", `bytes */${size}`);
|
|
48
|
+
return new Response(null, {
|
|
49
|
+
status: 416,
|
|
50
|
+
headers
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
headers.set("content-range", `bytes ${start}-${end}/${size}`);
|
|
54
|
+
headers.set("content-length", String(end - start + 1));
|
|
55
|
+
return new Response(bytes.subarray(start, end + 1), {
|
|
56
|
+
status: 206,
|
|
57
|
+
headers
|
|
58
|
+
});
|
|
59
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
+
var assetRange_exports = {};
|
|
24
|
+
__export(assetRange_exports, { withRange: () => withRange });
|
|
25
|
+
module.exports = __toCommonJS(assetRange_exports);
|
|
26
|
+
async function withRange(request, response) {
|
|
27
|
+
var range = request.headers.get("range");
|
|
28
|
+
if (!range || request.method !== "GET" || response.status !== 200 || response.headers.has("content-range") || response.headers.has("content-encoding")) {
|
|
29
|
+
return response;
|
|
30
|
+
}
|
|
31
|
+
var match = /^bytes=(\d*)-(\d*)$/.exec(range.trim());
|
|
32
|
+
if (!match || !match[1] && !match[2]) return response;
|
|
33
|
+
var bytes = new Uint8Array(await response.arrayBuffer());
|
|
34
|
+
var size = bytes.byteLength;
|
|
35
|
+
var start;
|
|
36
|
+
var end;
|
|
37
|
+
if (!match[1]) {
|
|
38
|
+
start = Math.max(0, size - Number(match[2]));
|
|
39
|
+
end = size - 1;
|
|
40
|
+
} else {
|
|
41
|
+
start = Number(match[1]);
|
|
42
|
+
end = match[2] ? Math.min(Number(match[2]), size - 1) : size - 1;
|
|
43
|
+
}
|
|
44
|
+
var headers = new Headers(response.headers);
|
|
45
|
+
headers.set("accept-ranges", "bytes");
|
|
46
|
+
if (start >= size || start > end) {
|
|
47
|
+
headers.set("content-range", `bytes */${size}`);
|
|
48
|
+
return new Response(null, {
|
|
49
|
+
status: 416,
|
|
50
|
+
headers
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
headers.set("content-range", `bytes ${start}-${end}/${size}`);
|
|
54
|
+
headers.set("content-length", String(end - start + 1));
|
|
55
|
+
return new Response(bytes.subarray(start, end + 1), {
|
|
56
|
+
status: 206,
|
|
57
|
+
headers
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=assetRange.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assetRange.native.js","names":[],"sources":["cjs/server/assetRange.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar assetRange_exports = {};\n__export(assetRange_exports, {\n withRange: () => withRange\n});\nmodule.exports = __toCommonJS(assetRange_exports);\nasync function withRange(request, response) {\n var range = request.headers.get(\"range\");\n if (!range || request.method !== \"GET\" || response.status !== 200 || response.headers.has(\"content-range\") || response.headers.has(\"content-encoding\")) {\n return response;\n }\n var match = /^bytes=(\\d*)-(\\d*)$/.exec(range.trim());\n if (!match || !match[1] && !match[2]) return response;\n var bytes = new Uint8Array(await response.arrayBuffer());\n var size = bytes.byteLength;\n var start;\n var end;\n if (!match[1]) {\n start = Math.max(0, size - Number(match[2]));\n end = size - 1;\n } else {\n start = Number(match[1]);\n end = match[2] ? Math.min(Number(match[2]), size - 1) : size - 1;\n }\n var headers = new Headers(response.headers);\n headers.set(\"accept-ranges\", \"bytes\");\n if (start >= size || start > end) {\n headers.set(\"content-range\", `bytes */${size}`);\n return new Response(null, {\n status: 416,\n headers\n });\n }\n headers.set(\"content-range\", `bytes ${start}-${end}/${size}`);\n headers.set(\"content-length\", String(end - start + 1));\n return new Response(bytes.subarray(start, end + 1), {\n status: 206,\n headers\n });\n}\n//# sourceMappingURL=assetRange.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,qBAAqB,CAAC;AAC1B,SAAS,oBAAoB,EAC3B,iBAAiB,UACnB,CAAC;AACD,OAAO,UAAU,aAAa,kBAAkB;AAChD,eAAe,UAAU,SAAS,UAAU;CAC1C,IAAI,QAAQ,QAAQ,QAAQ,IAAI,OAAO;CACvC,IAAI,CAAC,SAAS,QAAQ,WAAW,SAAS,SAAS,WAAW,OAAO,SAAS,QAAQ,IAAI,eAAe,KAAK,SAAS,QAAQ,IAAI,kBAAkB,GAAG;EACtJ,OAAO;CACT;CACA,IAAI,QAAQ,sBAAsB,KAAK,MAAM,KAAK,CAAC;CACnD,IAAI,CAAC,SAAS,CAAC,MAAM,MAAM,CAAC,MAAM,IAAI,OAAO;CAC7C,IAAI,QAAQ,IAAI,WAAW,MAAM,SAAS,YAAY,CAAC;CACvD,IAAI,OAAO,MAAM;CACjB,IAAI;CACJ,IAAI;CACJ,IAAI,CAAC,MAAM,IAAI;EACb,QAAQ,KAAK,IAAI,GAAG,OAAO,OAAO,MAAM,EAAE,CAAC;EAC3C,MAAM,OAAO;CACf,OAAO;EACL,QAAQ,OAAO,MAAM,EAAE;EACvB,MAAM,MAAM,KAAK,KAAK,IAAI,OAAO,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,OAAO;CACjE;CACA,IAAI,UAAU,IAAI,QAAQ,SAAS,OAAO;CAC1C,QAAQ,IAAI,iBAAiB,OAAO;CACpC,IAAI,SAAS,QAAQ,QAAQ,KAAK;EAChC,QAAQ,IAAI,iBAAiB,WAAW,MAAM;EAC9C,OAAO,IAAI,SAAS,MAAM;GACxB,QAAQ;GACR;EACF,CAAC;CACH;CACA,QAAQ,IAAI,iBAAiB,SAAS,MAAM,GAAG,IAAI,GAAG,MAAM;CAC5D,QAAQ,IAAI,kBAAkB,OAAO,MAAM,QAAQ,CAAC,CAAC;CACrD,OAAO,IAAI,SAAS,MAAM,SAAS,OAAO,MAAM,CAAC,GAAG;EAClD,QAAQ;EACR;CACF,CAAC;AACH"}
|
package/dist/esm/cli/build.mjs
CHANGED
|
@@ -768,7 +768,7 @@ if (typeof MessageChannel === 'undefined') {
|
|
|
768
768
|
}
|
|
769
769
|
}
|
|
770
770
|
|
|
771
|
-
import { serve, setFetchStaticHtml } from 'one/serve-worker'
|
|
771
|
+
import { serve, setFetchStaticHtml, withRange } from 'one/serve-worker'
|
|
772
772
|
|
|
773
773
|
// Lazy import map - modules load on-demand when route is matched
|
|
774
774
|
const lazyRoutes = {
|
|
@@ -817,7 +817,7 @@ export default {
|
|
|
817
817
|
try {
|
|
818
818
|
const assetResponse = await env.ASSETS.fetch(request)
|
|
819
819
|
if (assetResponse && assetResponse.status !== 404) {
|
|
820
|
-
return assetResponse
|
|
820
|
+
return await withRange(request, assetResponse)
|
|
821
821
|
}
|
|
822
822
|
} catch (e) {
|
|
823
823
|
// asset not found, continue with original response
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","names":["vxrnBuild","viteBuild"],"sources":["esm/cli/build.js"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport { cpus } from \"node:os\";\nimport Path, { join, posix, relative, resolve } from \"node:path\";\nimport { resolvePath } from \"@vxrn/resolve\";\nimport FSExtra from \"fs-extra\";\nimport MicroMatch from \"micromatch\";\nimport {\n createBuilder,\n mergeConfig,\n normalizePath,\n build as viteBuild\n} from \"vite\";\nimport {\n getOptimizeDeps,\n rollupRemoveUnusedImportsPlugin,\n build as vxrnBuild\n} from \"vxrn\";\nimport * as constants from \"../constants\";\nimport { setServerGlobals } from \"../server/setServerGlobals\";\nimport { environmentGuardPlugin } from \"../vite/plugins/environmentGuardPlugin\";\nimport { writeBuildOutputPointer } from \"../utils/buildOutputPointer\";\nimport { getPathnameFromFilePath } from \"../utils/getPathnameFromFilePath\";\nimport { getRouterRootFromOneOptions } from \"../utils/getRouterRootFromOneOptions\";\nimport { isRolldown } from \"../utils/isRolldown\";\nimport { toAbsolute } from \"../utils/toAbsolute\";\nimport { buildVercelOutputDirectory } from \"../vercel/build/buildVercelOutputDirectory\";\nimport {\n createCloudflareWranglerConfig,\n getCloudflareProjectName,\n isPlainObject,\n loadUserWranglerConfig\n} from \"../vite/cloudflareWranglerConfig\";\nimport { getManifest } from \"../vite/getManifest\";\nimport { loadUserOneOptions } from \"../vite/loadConfig\";\nimport { runWithAsyncLocalContext } from \"../vite/one-server-only\";\nimport { buildPage, printBuildTimings } from \"./buildPage\";\nimport { checkNodeVersion } from \"./checkNodeVersion\";\nimport { getWorkerPool, terminateWorkerPool } from \"./workerPool\";\nimport { generateSitemap } from \"./generateSitemap\";\nimport { labelProcess } from \"./label-process\";\nimport { getRouteExports } from \"./serverRouteModules\";\nimport { pLimit } from \"../utils/pLimit\";\nimport { getCriticalCSSOutputPaths } from \"../vite/plugins/criticalCSSPlugin\";\nimport { absorbedPackageAliases } from \"../utils/absorbedPackages\";\nimport {\n formatErrorSafely,\n installPrepareStackTraceGuard\n} from \"./install-error-handlers\";\nconst { ensureDir, writeJSON } = FSExtra;\nfunction normalizeDeploy(deploy) {\n if (!deploy) return void 0;\n if (typeof deploy === \"string\") return { target: deploy };\n return deploy;\n}\nconst CLOUDFLARE_DEPLOY_WRANGLER_RULES = [\n { type: \"ESModule\", globs: [\"assets/**/*.js\", \"assets/**/*.mjs\"] }\n];\nfunction omitEmptyJsonValues(value) {\n if (Array.isArray(value)) {\n const items = value.map((item) => omitEmptyJsonValues(item)).filter((item) => item !== void 0);\n return items.length > 0 ? items : void 0;\n }\n if (isPlainObject(value)) {\n const entries = Object.entries(value).map(([key, item]) => [key, omitEmptyJsonValues(item)]).filter((entry) => entry[1] !== void 0);\n return entries.length > 0 ? Object.fromEntries(entries) : void 0;\n }\n return value;\n}\nasync function finalizeCloudflareWranglerDeployConfig(configPath) {\n const parsed = JSON.parse(await FSExtra.readFile(configPath, \"utf-8\"));\n if (!isPlainObject(parsed)) {\n throw new Error(\n `Expected ${relative(process.cwd(), configPath)} to contain a JSON object`\n );\n }\n parsed.rules = CLOUDFLARE_DEPLOY_WRANGLER_RULES;\n const config = omitEmptyJsonValues(parsed);\n if (!isPlainObject(config)) {\n throw new Error(\n `Expected ${relative(process.cwd(), configPath)} to contain deploy config`\n );\n }\n await FSExtra.writeFile(configPath, `${JSON.stringify(config, null, 2)}\n`);\n}\nprocess.env.ONE_CACHE_KEY = constants.CACHE_KEY;\nfunction shouldUseWorkers(oneOptions) {\n if (process.env.ONE_BUILD_WORKERS === \"0\") return false;\n if (process.env.ONE_BUILD_WORKERS === \"1\") return true;\n return oneOptions?.build?.workers !== false;\n}\ninstallPrepareStackTraceGuard();\nlet buildErrorHandlersInstalled = false;\nfunction installBuildErrorHandlers() {\n if (buildErrorHandlersInstalled) return;\n buildErrorHandlersInstalled = true;\n process.on(\"uncaughtException\", (err) => {\n try {\n process.stderr.write(`[one build] uncaught exception\n${formatErrorSafely(err)}\n`);\n } catch {\n }\n process.exit(1);\n });\n process.on(\"unhandledRejection\", (reason) => {\n try {\n process.stderr.write(\n `[one build] unhandled rejection\n${formatErrorSafely(reason)}\n`\n );\n } catch {\n }\n process.exit(1);\n });\n}\nconst HOOK_KEYS = [\n \"resolveId\",\n \"load\",\n \"transform\",\n \"renderChunk\",\n \"generateBundle\",\n \"writeBundle\",\n \"buildStart\",\n \"buildEnd\",\n \"moduleParsed\"\n];\nfunction clonePluginHooks(config) {\n if (!config.plugins) return config;\n return {\n ...config,\n plugins: config.plugins.map((p) => {\n if (!p || typeof p !== \"object\") return p;\n const cloned = { ...p };\n for (const key of HOOK_KEYS) {\n if (cloned[key] && typeof cloned[key] === \"object\" && \"handler\" in cloned[key]) {\n cloned[key] = { ...cloned[key] };\n }\n }\n return cloned;\n })\n };\n}\nasync function build(args) {\n installBuildErrorHandlers();\n process.env.IS_VXRN_CLI = \"true\";\n if (!process.env.NODE_ENV) {\n process.env.NODE_ENV = \"production\";\n } else if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `\n \\u26A0\\uFE0F Warning: NODE_ENV is set to \"${process.env.NODE_ENV}\" (builds default to \"production\")\n`\n );\n }\n labelProcess(\"build\");\n checkNodeVersion();\n setServerGlobals();\n const { oneOptions, config: viteLoadedConfig } = await loadUserOneOptions(\"build\");\n const routerRoot = getRouterRootFromOneOptions(oneOptions);\n const configuredBuildConcurrency = process.env.ONE_BUILD_CONCURRENCY ?? oneOptions.build?.concurrency;\n const buildConcurrency = configuredBuildConcurrency === void 0 ? Math.max(1, Math.min(cpus().length, 8)) : Number(configuredBuildConcurrency);\n if (!Number.isInteger(buildConcurrency) || buildConcurrency < 1) {\n throw new Error(\n `build.concurrency must be a positive integer, received ${JSON.stringify(\n configuredBuildConcurrency\n )}`\n );\n }\n if (oneOptions.web?.defaultRenderMode) {\n process.env.ONE_DEFAULT_RENDER_MODE = oneOptions.web.defaultRenderMode;\n }\n const deployConfig = normalizeDeploy(oneOptions.web?.deploy);\n if (!process.env.ONE_SERVER_URL && deployConfig) {\n const url = deployConfig.url ?? (deployConfig.target === \"cloudflare\" ? `https://${await getCloudflareProjectName(process.cwd())}.workers.dev` : void 0);\n if (url) {\n process.env.ONE_SERVER_URL = url;\n console.info(`\n \\u2601\\uFE0F ONE_SERVER_URL: ${url}\n`);\n }\n }\n const outDir = viteLoadedConfig?.config?.build?.outDir ?? \"dist\";\n const manifest = getManifest({\n routerRoot,\n ignoredRouteFiles: oneOptions.router?.ignoredRouteFiles\n });\n const serverOutputFormat = oneOptions.build?.server === false ? \"esm\" : oneOptions.build?.server?.outputFormat ?? \"esm\";\n const buildStartTime = performance.now();\n const vxrnOutput = await vxrnBuild(\n {\n skipEnv: args.skipEnv ?? oneOptions.skipEnv,\n server: oneOptions.server,\n build: {\n analyze: true,\n server: oneOptions.build?.server === false ? false : {\n outputFormat: serverOutputFormat\n }\n }\n },\n args\n );\n const bundleTime = performance.now() - buildStartTime;\n console.info(`\n \\u23F1\\uFE0F vite bundle: ${(bundleTime / 1e3).toFixed(2)}s\n`);\n if (!vxrnOutput || args.platform !== \"web\") {\n return;\n }\n const { options } = vxrnOutput;\n const { optimizeDeps } = getOptimizeDeps(\"build\");\n const { rolldownOptions: _rolldownOptions, ...optimizeDepsNoRolldown } = optimizeDeps;\n const serverOpts = oneOptions.build?.server;\n const isUnified = typeof serverOpts === \"object\" && serverOpts !== null && serverOpts.unified === true;\n let baseForApi = isUnified ? clonePluginHooks(vxrnOutput.serverBuildConfig ?? vxrnOutput.webBuildConfig) : clonePluginHooks(vxrnOutput.webBuildConfig);\n if (isUnified) {\n const clone = {\n ...baseForApi,\n build: baseForApi.build ? { ...baseForApi.build } : void 0,\n plugins: baseForApi.plugins ? baseForApi.plugins.filter(\n (p) => p && typeof p === \"object\" && p.name !== \"omit-api-routes\"\n ) : void 0\n };\n if (clone.build && clone.build.rolldownOptions) {\n const ro = { ...clone.build.rolldownOptions };\n delete ro.input;\n clone.build.rolldownOptions = ro;\n }\n if (clone.build) {\n delete clone.build.outDir;\n }\n baseForApi = clone;\n }\n const apiBuildConfig = mergeConfig(baseForApi, {\n configFile: false,\n appType: \"custom\",\n optimizeDeps: optimizeDepsNoRolldown,\n environments: {\n client: {\n optimizeDeps: { rolldownOptions: _rolldownOptions }\n }\n }\n });\n async function buildCustomRoutes(subFolder, routes) {\n const input = routes.reduce((entries, { page, file }) => {\n entries[page.slice(1) + \".js\"] = join(routerRoot, file);\n return entries;\n }, {});\n const outputFormat = oneOptions?.build?.api?.outputFormat ?? serverOutputFormat;\n const treeshake = oneOptions?.build?.api?.treeshake;\n const mergedConfig = mergeConfig(apiBuildConfig, {\n appType: \"custom\",\n configFile: false,\n define: vxrnOutput.processEnvDefines,\n ssr: isUnified ? {\n // in unified mode let the base (serverBuildConfig) set ssr.noExternal\n // — default is now ['react', 'react-dom'] instead of `true`, so\n // rolldown can externalize the rest.\n optimizeDeps: optimizeDepsNoRolldown\n } : {\n noExternal: true,\n external: [\"react\", \"react-dom\"],\n optimizeDeps: optimizeDepsNoRolldown\n },\n environments: {\n ssr: {\n optimizeDeps: { rolldownOptions: _rolldownOptions }\n }\n },\n build: {\n ssr: true,\n emptyOutDir: false,\n outDir: `${outDir}/${subFolder}`,\n copyPublicDir: false,\n minify: false,\n rolldownOptions: {\n treeshake: treeshake ?? {\n moduleSideEffects: false\n },\n plugins: [\n // otherwise rollup is leaving commonjs-only top level imports...\n outputFormat === \"esm\" ? rollupRemoveUnusedImportsPlugin : null\n ].filter(Boolean),\n // too many issues\n // treeshake: {\n // moduleSideEffects: false,\n // },\n // prevents it from shaking out the exports\n preserveEntrySignatures: \"strict\",\n input,\n // in unified mode, inherit externals from serverBuildConfig (user\n // ssr.external / rolldownOptions.external). the legacy path resets\n // them to [] so per-route files bundle everything.\n ...isUnified ? {} : { external: [] },\n output: {\n entryFileNames: \"[name]\",\n exports: \"auto\",\n ...outputFormat === \"esm\" ? {\n format: \"esm\",\n esModule: true\n } : {\n format: \"cjs\",\n // Preserve folder structure and use .cjs extension\n entryFileNames: (chunkInfo) => {\n const name = chunkInfo.name.replace(/\\.js$/, \".cjs\");\n return name;\n },\n chunkFileNames: (chunkInfo) => {\n const chunkName = normalizePath(chunkInfo.name);\n const dir = posix.dirname(chunkName);\n const name = posix.basename(chunkName, posix.extname(chunkName));\n return posix.join(dir, `${name}-[hash].cjs`);\n },\n assetFileNames: (assetInfo) => {\n const assetName = normalizePath(assetInfo.name ?? \"\");\n const dir = posix.dirname(assetName);\n const baseName = posix.basename(assetName, posix.extname(assetName));\n const ext = posix.extname(assetName);\n return posix.join(dir, `${baseName}-[hash]${ext}`);\n }\n }\n }\n }\n }\n });\n const userApiBuildConf = oneOptions.build?.api?.config;\n const finalApiBuildConf = userApiBuildConf ? mergeConfig(mergedConfig, userApiBuildConf) : mergedConfig;\n const output = await viteBuild(\n // allow user merging api build config\n finalApiBuildConf\n );\n return output;\n }\n const builtMiddlewares = {};\n const apiPromise = manifest.apiRoutes.length ? (console.info(`\n \\u{1F528} build api routes\n`), buildCustomRoutes(\"api\", manifest.apiRoutes)) : Promise.resolve(null);\n const middlewarePromise = manifest.middlewareRoutes.length ? (console.info(`\n \\u{1F528} build middlewares\n`), buildCustomRoutes(\"middlewares\", manifest.middlewareRoutes)) : Promise.resolve(null);\n const [apiOutput, middlewareBuildInfo] = await Promise.all([\n apiPromise,\n middlewarePromise\n ]);\n if (middlewareBuildInfo) {\n for (const middleware of manifest.middlewareRoutes) {\n const absoluteRoot = resolve(process.cwd(), options.root);\n const fullPath = normalizePath(join(absoluteRoot, routerRoot, middleware.file));\n const outChunks = middlewareBuildInfo.output.filter((x) => x.type === \"chunk\");\n const chunk = outChunks.find((x) => x.facadeModuleId === fullPath);\n if (!chunk) throw new Error(`internal err finding middleware`);\n builtMiddlewares[middleware.file] = posix.join(\n outDir,\n \"middlewares\",\n chunk.fileName\n );\n }\n }\n globalThis[\"require\"] = createRequire(import.meta.dirname + \"/\");\n const assets = [];\n const builtRoutes = [];\n const sitemapData = [];\n const collectImportsCache = /* @__PURE__ */ new Map();\n const collectImportsInFlight = /* @__PURE__ */ new Set();\n const cssFileContentsCache = /* @__PURE__ */ new Map();\n const criticalCSSOutputPaths = getCriticalCSSOutputPaths(vxrnOutput.clientManifest);\n const limit = pLimit(buildConcurrency);\n const useWorkers = shouldUseWorkers(oneOptions);\n const workerPool = useWorkers ? getWorkerPool(buildConcurrency) : null;\n if (workerPool) {\n const serializableOptions = JSON.parse(\n JSON.stringify(\n oneOptions,\n (_key, value) => typeof value === \"function\" ? void 0 : value\n )\n );\n await workerPool.initialize(serializableOptions);\n }\n const staticStartTime = performance.now();\n const modeLabel = useWorkers ? `workers: ${workerPool?.size}` : `concurrency: ${buildConcurrency}`;\n console.info(`\n \\u{1F528} build static routes (${modeLabel})\n`);\n const staticDir = join(`${outDir}/static`);\n const clientDir = join(`${outDir}/client`);\n await ensureDir(staticDir);\n if (!vxrnOutput.serverOutput) {\n throw new Error(`No server output`);\n }\n const clientChunksBySource = /* @__PURE__ */ new Map();\n if (vxrnOutput.clientOutput) {\n for (const chunk of vxrnOutput.clientOutput) {\n if (chunk.type !== \"chunk\") continue;\n const info = { fileName: chunk.fileName, imports: chunk.imports || [] };\n for (const moduleId of chunk.moduleIds ?? []) {\n clientChunksBySource.set(moduleId, info);\n }\n }\n for (const chunk of vxrnOutput.clientOutput) {\n if (chunk.type !== \"chunk\" || !chunk.facadeModuleId) continue;\n clientChunksBySource.set(chunk.facadeModuleId, {\n fileName: chunk.fileName,\n imports: chunk.imports || []\n });\n }\n }\n const clientManifestByFile = /* @__PURE__ */ new Map();\n for (const entry of Object.values(vxrnOutput.clientManifest)) {\n if (entry.file) {\n clientManifestByFile.set(entry.file, entry);\n }\n }\n const outputEntries = [...vxrnOutput.serverOutput.entries()];\n const layoutServerPaths = /* @__PURE__ */ new Map();\n for (const [, output] of outputEntries) {\n if (output.type === \"asset\") continue;\n const id = output.facadeModuleId || \"\";\n const file = Path.basename(id);\n if (file.startsWith(\"_layout\") && id.includes(`/${routerRoot}/`)) {\n const relativePath = normalizePath(relative(process.cwd(), id)).replace(\n `${routerRoot}/`,\n \"\"\n );\n const contextKey = `./${relativePath}`;\n layoutServerPaths.set(contextKey, output.fileName);\n }\n }\n const routeByPath = /* @__PURE__ */ new Map();\n for (const route of manifest.pageRoutes) {\n if (route.file) {\n const routePath = `${routerRoot}${route.file.slice(1)}`;\n routeByPath.set(routePath, route);\n }\n }\n for (const [, output] of outputEntries) {\n if (output.type === \"asset\") {\n assets.push(output);\n }\n }\n const moduleIdToServerChunk = /* @__PURE__ */ new Map();\n for (const [, output] of outputEntries) {\n if (output.type === \"asset\") continue;\n const moduleIds = output.moduleIds || (output.facadeModuleId ? [output.facadeModuleId] : []);\n for (const moduleId of moduleIds) {\n moduleIdToServerChunk.set(moduleId, output.fileName);\n if (moduleId.includes(\"?one-spa-build\")) {\n moduleIdToServerChunk.set(\n moduleId.slice(0, moduleId.indexOf(\"?\")),\n output.fileName\n );\n }\n }\n }\n for (const foundRoute of manifest.pageRoutes) {\n let collectImports = function(entry, { type = \"js\" } = {}) {\n const { imports = [], css } = entry;\n const cacheKey = `${entry.file || imports.join(\",\")}:${type}`;\n const cached = collectImportsCache.get(cacheKey);\n if (cached) return cached;\n if (collectImportsInFlight.has(cacheKey)) return [];\n collectImportsInFlight.add(cacheKey);\n const result = [\n ...new Set(\n [\n ...type === \"js\" ? imports : css || [],\n ...imports.flatMap((name) => {\n const found = vxrnOutput.clientManifest[name];\n if (!found) {\n console.warn(`No found imports`, name, vxrnOutput.clientManifest);\n }\n return collectImports(found, { type });\n })\n ].flat().filter((x) => x && (type === \"css\" || x.endsWith(\".js\"))).map(\n (x) => type === \"css\" ? x : x.startsWith(\"assets/\") ? x : `assets/${x.slice(1)}`\n )\n )\n ];\n collectImportsInFlight.delete(cacheKey);\n collectImportsCache.set(cacheKey, result);\n return result;\n };\n if (!foundRoute.file) {\n continue;\n }\n const routeModulePath = normalizePath(\n join(resolve(process.cwd(), options.root), routerRoot, foundRoute.file.slice(2))\n );\n const serverFileName = moduleIdToServerChunk.get(routeModulePath);\n if (!serverFileName) {\n if (foundRoute.type === \"spa\") {\n throw new Error(\n `[one] No build-only server chunk for SPA route: ${foundRoute.file}`\n );\n }\n console.warn(`[one] No server chunk found for route: ${foundRoute.file}`);\n continue;\n }\n const onlyBuild = vxrnOutput.buildArgs?.only;\n if (onlyBuild) {\n const relativeId2 = foundRoute.file.slice(1);\n if (!MicroMatch.contains(relativeId2, onlyBuild)) {\n continue;\n }\n }\n const clientChunk = clientChunksBySource.get(routeModulePath);\n const manifestKey = `${routerRoot}${foundRoute.file.slice(1)}`;\n const clientManifestEntry = vxrnOutput.clientManifest[manifestKey] ?? (clientChunk ? clientManifestByFile.get(clientChunk.fileName) : void 0);\n if (!clientChunk && foundRoute.type !== \"spa\" && foundRoute.type !== \"ssg\") {\n console.warn(`No client chunk found for route: ${routeModulePath}`);\n continue;\n }\n foundRoute.loaderServerPath = serverFileName;\n const relativeId = foundRoute.file.replace(/^\\.\\//, \"/\");\n if (foundRoute.layouts) {\n for (const layout of foundRoute.layouts) {\n const serverPath = layoutServerPaths.get(layout.contextKey);\n if (serverPath) {\n layout.loaderServerPath = serverPath;\n }\n }\n }\n const entryImports = collectImports(clientManifestEntry || {});\n const layoutEntries = foundRoute.layouts?.flatMap((layout) => {\n const clientKey = `${routerRoot}${layout.contextKey.slice(1)}`;\n const found = vxrnOutput.clientManifest[clientKey];\n return found ? found : [];\n }) ?? [];\n const layoutImports = layoutEntries.flatMap((entry) => {\n return [entry.file, ...collectImports(entry)];\n });\n const routePreloads = {};\n const rootLayoutKey = `${routerRoot}/_layout.tsx`;\n const rootLayoutEntry = vxrnOutput.clientManifest[rootLayoutKey];\n if (rootLayoutEntry) {\n routePreloads[`/${rootLayoutKey}`] = `/${rootLayoutEntry.file}`;\n }\n if (foundRoute.layouts) {\n for (const layout of foundRoute.layouts) {\n const clientKey = `${routerRoot}${layout.contextKey.slice(1)}`;\n const entry = vxrnOutput.clientManifest[clientKey];\n if (entry) {\n routePreloads[`/${clientKey}`] = `/${entry.file}`;\n }\n }\n }\n const routeChunkFile = clientChunk?.fileName ?? clientManifestEntry?.file;\n if (routeChunkFile) {\n routePreloads[`/${routerRoot}${foundRoute.file.slice(1)}`] = `/${routeChunkFile}`;\n }\n const preloadSetupFilePreloads = (() => {\n if (!oneOptions.setupFile) return [];\n const clientSetupFile = typeof oneOptions.setupFile === \"string\" ? oneOptions.setupFile : oneOptions.setupFile.client;\n if (!clientSetupFile) return [];\n const needle = clientSetupFile.replace(/^\\.\\//, \"\");\n for (const file in vxrnOutput.clientManifest) {\n if (file === needle) {\n const entry = vxrnOutput.clientManifest[file];\n return [\n entry.file\n // getting 404s for preloading the imports as well?\n // ...(entry.imports as string[])\n ];\n }\n }\n return [];\n })();\n const allPreloads = [\n .../* @__PURE__ */ new Set([\n ...preloadSetupFilePreloads,\n // add the route entry js (like ./app/index.ts) - prefer direct chunk lookup\n ...clientChunk ? [clientChunk.fileName] : clientManifestEntry ? [clientManifestEntry.file] : [],\n // add the virtual entry\n vxrnOutput.clientManifest[\"virtual:one-entry\"].file,\n ...entryImports,\n ...layoutImports\n ])\n ].map((path) => `/${path}`);\n const scriptLoadingMode = oneOptions.web?.experimental_scriptLoading;\n const useDeferredLoading = scriptLoadingMode === \"defer-non-critical\";\n const useAggressiveLCP = scriptLoadingMode === \"after-lcp-aggressive\";\n const needsSeparatedPreloads = useDeferredLoading || useAggressiveLCP;\n const criticalPreloads = needsSeparatedPreloads ? [\n .../* @__PURE__ */ new Set([\n ...preloadSetupFilePreloads,\n // add the virtual entry (framework bootstrap)\n vxrnOutput.clientManifest[\"virtual:one-entry\"].file,\n // add the route entry js (like ./app/index.ts) - prefer direct chunk lookup\n ...clientChunk ? [clientChunk.fileName] : clientManifestEntry ? [clientManifestEntry.file] : [],\n // add layout files (but not their deep imports)\n ...layoutEntries.map((entry) => entry.file)\n ])\n ].map((path) => `/${path}`) : void 0;\n const deferredPreloads = needsSeparatedPreloads ? [\n .../* @__PURE__ */ new Set([\n ...entryImports,\n ...layoutEntries.flatMap((entry) => collectImports(entry))\n ])\n ].filter((path) => !criticalPreloads.includes(`/${path}`)).map((path) => `/${path}`) : void 0;\n const preloads2 = needsSeparatedPreloads ? [...criticalPreloads, ...deferredPreloads] : allPreloads;\n const allEntries = [clientManifestEntry, ...layoutEntries].filter(Boolean);\n const layoutCSS = [\n ...new Set(\n layoutEntries.flatMap((entry) => collectImports(entry, { type: \"css\" })).map((path) => `/${path}`)\n )\n ];\n const allCSS = [\n .../* @__PURE__ */ new Set([\n ...layoutCSS,\n // css from page entry\n ...clientManifestEntry ? collectImports(clientManifestEntry, { type: \"css\" }).map((path) => `/${path}`) : [],\n // root-level css for cssCodeSplit: false (vite emits a single\n // top-level `style.css` entry whose `src` equals `style.css`). when\n // cssCodeSplit is true (default), the manifest also contains a\n // per-component css entry for every chunk that ships any css — those\n // are owned by their JS chunk and must NOT be injected globally, or\n // every SSG page ends up preloading every css chunk in the project\n // (the prod /download was loading 23 stylesheets with editor/IDE\n // chunks despite being a marketing route).\n ...Object.entries(vxrnOutput.clientManifest).filter(([key, entry]) => {\n if (!key.endsWith(\".css\")) return false;\n const src = entry.src;\n return src === \"style.css\";\n }).map(([, entry]) => `/${entry.file}`)\n ])\n ];\n const hasCriticalCSS = allCSS.some((p) => criticalCSSOutputPaths.has(p));\n const needsCSSContents = oneOptions.web?.inlineLayoutCSS || hasCriticalCSS;\n let allCSSContents;\n if (needsCSSContents) {\n allCSSContents = await Promise.all(\n allCSS.map(async (cssPath) => {\n if (!oneOptions.web?.inlineLayoutCSS && !criticalCSSOutputPaths.has(cssPath)) {\n return \"\";\n }\n const cached = cssFileContentsCache.get(cssPath);\n if (cached !== void 0) return cached;\n const filePath = join(clientDir, cssPath);\n try {\n const content = await FSExtra.readFile(filePath, \"utf-8\");\n cssFileContentsCache.set(cssPath, content);\n return content;\n } catch (err) {\n console.warn(`[one] Warning: Could not read CSS file ${filePath}`);\n cssFileContentsCache.set(cssPath, \"\");\n return \"\";\n }\n })\n );\n }\n if (process.env.DEBUG) {\n console.info(\"[one] building routes\", {\n foundRoute,\n layoutEntries,\n allEntries,\n allCSS\n });\n }\n const serverJsPath = posix.join(outDir, \"server\", serverFileName);\n let exported;\n try {\n exported = await getRouteExports(\n vxrnOutput.serverEntry,\n routerRoot,\n foundRoute.file\n );\n } catch (err) {\n console.error(`Error importing page (original error)`, err);\n throw new Error(`Error importing page: ${foundRoute.file}`, {\n cause: err\n });\n }\n foundRoute.hasLoader = typeof exported.loader === \"function\";\n const isDynamic = !!Object.keys(foundRoute.routeKeys).length;\n if (foundRoute.type === \"ssg\" && isDynamic && !foundRoute.page.includes(\"+not-found\") && !foundRoute.page.includes(\"_sitemap\") && !exported.generateStaticParams) {\n throw new Error(`[one] Error: Missing generateStaticParams\n\n Route ${foundRoute.page} of type ${foundRoute.type} must export generateStaticParams so build can complete.\n\n See docs on generateStaticParams:\n https://onestack.dev/docs/routing-exports#generatestaticparams\n\n`);\n }\n const paramsList = await exported.generateStaticParams?.() ?? [{}];\n console.info(`\n [build] page ${relativeId} (with ${paramsList.length} routes)\n`);\n if (process.env.DEBUG) {\n console.info(`paramsList`, JSON.stringify(paramsList, null, 2));\n }\n const routeSitemapExport = exported.sitemap;\n const isAfterLCPMode = scriptLoadingMode === \"after-lcp\" || scriptLoadingMode === \"after-lcp-aggressive\";\n const useAfterLCP = foundRoute.type === \"ssg\" && isAfterLCPMode;\n const useAfterLCPAggressive = foundRoute.type === \"ssg\" && scriptLoadingMode === \"after-lcp-aggressive\";\n const shouldCollectSitemap = foundRoute.type !== \"api\" && foundRoute.type !== \"layout\" && !foundRoute.isNotFound && !foundRoute.page.includes(\"+not-found\") && !foundRoute.page.includes(\"_sitemap\");\n const pageBuilds = paramsList.map((params) => {\n const path = getPathnameFromFilePath(relativeId, params, foundRoute.type === \"ssg\");\n if (workerPool) {\n console.info(` \\u21A6 route ${path}`);\n return workerPool.buildPage({\n serverEntry: vxrnOutput.serverEntry,\n routerRoot,\n path,\n relativeId,\n params,\n foundRoute,\n clientManifestEntry,\n staticDir,\n clientDir,\n builtMiddlewares,\n serverJsPath,\n preloads: preloads2,\n allCSS,\n layoutCSS,\n routePreloads,\n allCSSContents,\n criticalPreloads,\n deferredPreloads,\n useAfterLCP,\n useAfterLCPAggressive\n }).then((built) => ({ built, path }));\n }\n return limit(async () => {\n console.info(` \\u21A6 route ${path}`);\n const built = await runWithAsyncLocalContext(async () => {\n return await buildPage(\n vxrnOutput.serverEntry,\n routerRoot,\n path,\n relativeId,\n params,\n foundRoute,\n clientManifestEntry,\n staticDir,\n clientDir,\n builtMiddlewares,\n serverJsPath,\n preloads2,\n allCSS,\n layoutCSS,\n routePreloads,\n allCSSContents,\n criticalPreloads,\n deferredPreloads,\n useAfterLCP,\n useAfterLCPAggressive\n );\n });\n return { built, path };\n });\n });\n const results = await Promise.all(pageBuilds);\n for (const { built, path } of results) {\n builtRoutes.push(built);\n if (shouldCollectSitemap) {\n sitemapData.push({\n path,\n routeExport: routeSitemapExport\n });\n }\n }\n }\n if (workerPool) {\n await terminateWorkerPool();\n }\n const staticTime = performance.now() - staticStartTime;\n console.info(\n `\n \\u23F1\\uFE0F static routes: ${(staticTime / 1e3).toFixed(2)}s (${builtRoutes.length} pages)\n`\n );\n printBuildTimings();\n await moveAllFiles(staticDir, clientDir);\n await FSExtra.remove(staticDir);\n const routeMap = {};\n const routeToBuildInfo = {};\n const pathToRoute = {};\n const preloads = {};\n const cssPreloads = {};\n const loaders = {};\n let cssContentsByPath;\n for (const route of builtRoutes) {\n if (!route.cleanPath.includes(\"*\")) {\n routeMap[route.cleanPath] = route.htmlPath;\n }\n const {\n // dont include loaderData it can be huge\n loaderData: _loaderData,\n cssContents,\n ...rest\n } = route;\n if (cssContents) {\n const contentsByPath = cssContentsByPath ||= {};\n route.css.forEach((cssPath, index) => {\n const content = cssContents[index];\n if (content) contentsByPath[cssPath] = content;\n });\n }\n routeToBuildInfo[route.routeFile] = rest;\n for (const p of getCleanPaths([route.path, route.cleanPath])) {\n pathToRoute[p] = route.routeFile;\n }\n preloads[route.preloadPath] = true;\n cssPreloads[route.cssPreloadPath] = true;\n loaders[route.loaderPath] = true;\n }\n function createBuildManifestRoute(route) {\n const { layouts, ...built } = route;\n if (layouts?.length) {\n ;\n built.layouts = layouts.map((layout) => ({\n contextKey: layout.contextKey,\n loaderServerPath: layout.loaderServerPath\n }));\n }\n const buildInfo = builtRoutes.find((x) => x.routeFile === route.file);\n if (built.middlewares) {\n for (const [index, mw] of built.middlewares.entries()) {\n const viaBuildInfo = buildInfo?.middlewares?.[index];\n if (viaBuildInfo) {\n mw.contextKey = viaBuildInfo;\n continue;\n }\n const viaMiddlewareMap = builtMiddlewares[mw.contextKey];\n if (viaMiddlewareMap) {\n mw.contextKey = viaMiddlewareMap;\n }\n }\n }\n if (buildInfo) {\n built.loaderPath = buildInfo.loaderPath;\n }\n return built;\n }\n const buildInfoForWriting = {\n outDir,\n oneOptions,\n routeToBuildInfo,\n cssContentsByPath,\n pathToRoute,\n manifest: {\n pageRoutes: manifest.pageRoutes.map(createBuildManifestRoute),\n apiRoutes: manifest.apiRoutes.map(createBuildManifestRoute),\n allRoutes: manifest.allRoutes.map(createBuildManifestRoute)\n },\n routeMap,\n constants: JSON.parse(JSON.stringify({ ...constants })),\n preloads,\n cssPreloads,\n loaders,\n useRolldown: await isRolldown()\n };\n await writeJSON(toAbsolute(`${outDir}/buildInfo.json`), buildInfoForWriting);\n await writeBuildOutputPointer(outDir);\n await FSExtra.writeFile(\n join(clientDir, \"version.json\"),\n JSON.stringify({ version: constants.CACHE_KEY })\n );\n console.info(`\n \\u{1F6E1} skew protection: emitted version.json\n`);\n const sitemapConfig = oneOptions.web?.sitemap;\n if (sitemapConfig) {\n const sitemapOptions = typeof sitemapConfig === \"boolean\" ? {} : sitemapConfig;\n const sitemapXml = generateSitemap(sitemapData, sitemapOptions);\n const sitemapPath = join(clientDir, \"sitemap.xml\");\n await FSExtra.writeFile(sitemapPath, sitemapXml);\n console.info(`\n \\u{1F4C4} generated sitemap.xml (${sitemapData.length} URLs)\n`);\n }\n const postBuildLogs = [];\n const platform = deployConfig?.target;\n if (platform) {\n postBuildLogs.push(`[one.build] platform ${platform}`);\n }\n switch (platform) {\n case \"vercel\": {\n const vercelJsonPath = join(options.root, \"vercel.json\");\n if (FSExtra.existsSync(vercelJsonPath)) {\n try {\n const vercelConfig = JSON.parse(FSExtra.readFileSync(vercelJsonPath, \"utf-8\"));\n if (!vercelConfig.cleanUrls) {\n console.warn(`\n \\u26A0\\uFE0F Warning: Your vercel.json is missing \"cleanUrls\": true`);\n console.warn(` Without this, direct navigation to SSG pages will 404.`);\n console.warn(` Add \"cleanUrls\": true to your vercel.json to fix this.\n`);\n }\n } catch {\n }\n }\n await buildVercelOutputDirectory({\n apiOutput,\n buildInfoForWriting,\n clientDir,\n oneOptionsRoot: options.root,\n postBuildLogs\n });\n break;\n }\n case \"cloudflare\": {\n const workerSrcDir = join(options.root, outDir);\n const getWorkerSourceImportPath = (routeFile) => {\n const importPath = normalizePath(\n relative(workerSrcDir, join(options.root, routerRoot, routeFile))\n );\n return importPath.startsWith(\".\") ? importPath : `./${importPath}`;\n };\n const apiRouteMap = [];\n const middlewareRouteMap = [];\n for (const route of buildInfoForWriting.manifest.apiRoutes) {\n if (route.file) {\n const importPath = getWorkerSourceImportPath(route.file);\n apiRouteMap.push(` '${route.page}': () => import('${importPath}')`);\n }\n }\n for (const [sourceFile, builtPath] of Object.entries(builtMiddlewares)) {\n const importPath = getWorkerSourceImportPath(sourceFile);\n middlewareRouteMap.push(` '${builtPath}': () => import('${importPath}')`);\n }\n const workerSrcPath = join(options.root, outDir, \"_worker-src.js\");\n const workerCode = `// Polyfill MessageChannel for React SSR (not available in Cloudflare Workers by default)\nif (typeof MessageChannel === 'undefined') {\n globalThis.MessageChannel = class MessageChannel {\n constructor() {\n this.port1 = { postMessage: () => {}, onmessage: null, close: () => {} }\n this.port2 = { postMessage: () => {}, onmessage: null, close: () => {} }\n }\n }\n}\n\nimport { serve, setFetchStaticHtml } from 'one/serve-worker'\n\n// Lazy import map - modules load on-demand when route is matched\nconst lazyRoutes = {\n serverEntry: () => import('./server/_virtual_one-entry.js'),\n api: {\n${apiRouteMap.join(\",\\n\")}\n },\n middlewares: {\n${middlewareRouteMap.join(\",\\n\")}\n }\n}\n\nconst buildInfo = ${JSON.stringify(buildInfoForWriting)}\n\nlet server\n\nexport default {\n async fetch(request, env, ctx) {\n if (!server) {\n server = await serve(buildInfo, lazyRoutes)\n }\n\n // set up static HTML fetcher for this request (uses ASSETS binding)\n if (env.ASSETS) {\n setFetchStaticHtml(async (path) => {\n try {\n const url = new URL(request.url)\n url.pathname = path\n const assetResponse = await env.ASSETS.fetch(new Request(url))\n if (assetResponse && assetResponse.ok) {\n return await assetResponse.text()\n }\n } catch (e) {\n // asset not found\n }\n return null\n })\n }\n\n try {\n const response = await server.fetch(request, env, ctx)\n\n // no route matched or 404 \\u2192 try static assets\n if (!response || response.status === 404) {\n if (env.ASSETS) {\n try {\n const assetResponse = await env.ASSETS.fetch(request)\n if (assetResponse && assetResponse.status !== 404) {\n return assetResponse\n }\n } catch (e) {\n // asset not found, continue with original response\n }\n }\n }\n\n return response\n } finally {\n setFetchStaticHtml(null)\n }\n }\n}\n`;\n await FSExtra.writeFile(workerSrcPath, workerCode);\n const projectName = await getCloudflareProjectName(options.root);\n const userWranglerConfig = await loadUserWranglerConfig(options.root);\n const wranglerInputConfig = createCloudflareWranglerConfig(\n projectName,\n userWranglerConfig?.config\n );\n wranglerInputConfig.main = normalizePath(\n relative(join(options.root, outDir), workerSrcPath)\n );\n const wranglerInputPath = join(options.root, outDir, \"_wrangler.input.jsonc\");\n await FSExtra.writeFile(\n wranglerInputPath,\n `${JSON.stringify(wranglerInputConfig, null, 2)}\n`\n );\n const ssrExternal = viteLoadedConfig?.config?.ssr?.external;\n const workerExternals = Array.isArray(ssrExternal) ? ssrExternal : [];\n console.info(\"\\n [cloudflare] Bundling worker...\");\n const { cloudflare } = await import(\"@cloudflare/vite-plugin\");\n const builder = await createBuilder({\n root: options.root,\n mode: \"production\",\n logLevel: \"warn\",\n configFile: false,\n define: {\n \"process.env.NODE_ENV\": JSON.stringify(\"production\"),\n \"process.env.VITE_ENVIRONMENT\": JSON.stringify(\"ssr\"),\n \"process.env.ONE_CACHE_KEY\": JSON.stringify(constants.CACHE_KEY)\n },\n plugins: [\n // the cloudflare worker IS a server, but this build runs with\n // configFile:false so the user vite.config (where the user-level\n // `one()` plugin registers environmentGuardPlugin via vite.config)\n // doesn't apply. register the guard plugin directly here so\n // `import 'server-only'` resolves to an empty module in the\n // worker bundle instead of inlining the package's throwing\n // index.js — which would crash the deployed worker on the first\n // /api request that loads any server-only-importing module.\n environmentGuardPlugin(oneOptions.environmentGuards),\n cloudflare({\n configPath: wranglerInputPath,\n viteEnvironment: { name: \"worker\" }\n })\n ],\n resolve: {\n alias: [\n // rolldown can't parse react-native's Flow syntax; alias to react-native-web for ssr\n {\n find: /^react-native\\/Libraries\\/.*/,\n replacement: resolvePath(\"@vxrn/vite-plugin-metro/empty\", options.root)\n },\n {\n // react native 0.87 removed @react-native/assets-registry, but libraries\n // like react-native-svg still import its registry\n find: /^(react-native\\/asset-registry|@react-native\\/assets-registry\\/registry)$/,\n replacement: \"react-native-web/dist/modules/AssetRegistry\"\n },\n {\n find: \"react-native/package.json\",\n replacement: \"react-native-web/package.json\"\n },\n {\n find: \"react-native\",\n replacement: \"react-native-web\"\n },\n ...Object.entries(absorbedPackageAliases(options.root, \"web\")).map(\n ([find, replacement]) => ({ find, replacement })\n )\n ],\n // the aliases name react-native-web by package, so it resolves from\n // the app root only once something imports react-native: an app\n // with no react-native imports needs no react-native-web.\n dedupe: [\"react-native-web\"]\n },\n build: {\n outDir,\n emptyOutDir: false,\n rolldownOptions: {\n // packages the app keeps out of its ssr bundle (native bindings\n // used only by build-time loaders) stay out of the worker too\n external: workerExternals,\n // Match the main web build behavior so RN packages that import\n // native-only symbols from react-native can still bundle against\n // the react-native-web alias in the worker graph.\n shimMissingExports: true,\n // cloudflare's module worker can contain circular shared chunks\n // when one package is used by both browser-facing SSR code and API\n // routes. preserve source import order so a dependent chunk cannot\n // evaluate against partially initialized exports.\n output: {\n strictExecutionOrder: true\n }\n }\n }\n });\n const workerEnv = builder.environments.worker;\n if (!workerEnv) {\n throw new Error('[one] plugin did not register \"worker\" environment');\n }\n await builder.build(workerEnv);\n await FSExtra.remove(workerSrcPath);\n await FSExtra.remove(wranglerInputPath);\n await finalizeCloudflareWranglerDeployConfig(\n join(options.root, outDir, \"worker\", \"wrangler.json\")\n );\n if (userWranglerConfig) {\n console.info(\n ` [cloudflare] Merging ${relative(options.root, userWranglerConfig.path)} into ${outDir}/worker/wrangler.json`\n );\n }\n postBuildLogs.push(`Cloudflare worker bundled at ${outDir}/worker/index.js`);\n postBuildLogs.push(`To deploy: wrangler deploy`);\n break;\n }\n }\n const securityScanOption = oneOptions.build?.securityScan;\n const securityScanLevel = securityScanOption === false ? null : securityScanOption === true || securityScanOption === void 0 ? \"warn\" : typeof securityScanOption === \"string\" ? securityScanOption : securityScanOption.level ?? \"warn\";\n const securitySafePatterns = typeof securityScanOption === \"object\" && securityScanOption !== null ? securityScanOption.safePatterns : void 0;\n if (securityScanLevel) {\n const { runSecurityScan } = await import(\"./securityScan\");\n const passed = await runSecurityScan(\n clientDir,\n securityScanLevel,\n securitySafePatterns\n );\n if (!passed) {\n process.exit(1);\n }\n }\n if (postBuildLogs.length) {\n console.info(`\n\n`);\n postBuildLogs.forEach((log) => {\n console.info(` \\xB7 ${log}`);\n });\n }\n console.info(`\n \\u{1F49B} build complete\n`);\n}\nconst TRAILING_INDEX_REGEX = /\\/index(\\.(web))?/;\nfunction getCleanPaths(possiblePaths) {\n return Array.from(\n new Set(\n Array.from(new Set(possiblePaths)).flatMap((p) => {\n const paths = [p];\n if (p.match(TRAILING_INDEX_REGEX)) {\n const pathWithTrailingIndexRemoved = p.replace(TRAILING_INDEX_REGEX, \"\");\n paths.push(pathWithTrailingIndexRemoved);\n paths.push(pathWithTrailingIndexRemoved + \"/\");\n }\n return paths;\n })\n )\n );\n}\nasync function moveAllFiles(src, dest) {\n try {\n await FSExtra.copy(src, dest, { overwrite: true, errorOnExist: false });\n } catch (err) {\n console.error(\"Error moving files:\", err);\n }\n}\nexport {\n build\n};\n//# sourceMappingURL=build.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAM,EAAE,WAAW,cAAc;AACjC,SAAS,gBAAgB,QAAQ;CAC/B,IAAI,CAAC,QAAQ,OAAO,KAAK;CACzB,IAAI,OAAO,WAAW,UAAU,OAAO,EAAE,QAAQ,OAAO;CACxD,OAAO;AACT;AACA,MAAM,mCAAmC,CACvC;CAAE,MAAM;CAAY,OAAO,CAAC,kBAAkB,iBAAiB;AAAE,CACnE;AACA,SAAS,oBAAoB,OAAO;CAClC,IAAI,MAAM,QAAQ,KAAK,GAAG;EACxB,MAAM,QAAQ,MAAM,KAAK,SAAS,oBAAoB,IAAI,CAAC,CAAC,CAAC,QAAQ,SAAS,SAAS,KAAK,CAAC;EAC7F,OAAO,MAAM,SAAS,IAAI,QAAQ,KAAK;CACzC;CACA,IAAI,cAAc,KAAK,GAAG;EACxB,MAAM,UAAU,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC,KAAK,oBAAoB,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,UAAU,MAAM,OAAO,KAA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EAAE,oBAAoB,MAAM,OAAO;EACzC,MAAM,SAAS,MAAM,gBACnB,WACA,mBACA,oBACF;EACA,IAAI,CAAC,QAAQ;GACX,QAAQ,KAAK,CAAC;EAChB;CACF;CACA,IAAI,cAAc,QAAQ;EACxB,QAAQ,KAAK;;CAEhB;EACG,cAAc,SAAS,QAAQ;GAC7B,QAAQ,KAAK,UAAU,KAAK;EAC9B,CAAC;CACH;CACA,QAAQ,KAAK;;CAEd;AACD;AACA,MAAM,uBAAuB;AAC7B,SAAS,cAAc,eAAe;CACpC,OAAO,MAAM,KACX,IAAI,IACF,MAAM,KAAK,IAAI,IAAI,aAAa,CAAC,CAAC,CAAC,SAAS,MAAM;EAChD,MAAM,QAAQ,CAAC,CAAC;EAChB,IAAI,EAAE,MAAM,oBAAoB,GAAG;GACjC,MAAM,+BAA+B,EAAE,QAAQ,sBAAsB,EAAE;GACvE,MAAM,KAAK,4BAA4B;GACvC,MAAM,KAAK,+BAA+B,GAAG;EAC/C;EACA,OAAO;CACT,CAAC,CACH,CACF;AACF;AACA,eAAe,aAAa,KAAK,MAAM;CACrC,IAAI;EACF,MAAM,QAAQ,KAAK,KAAK,MAAM;GAAE,WAAW;GAAM,cAAc;EAAM,CAAC;CACxE,SAAS,KAAK;EACZ,QAAQ,MAAM,uBAAuB,GAAG;CAC1C;AACF"}
|
|
1
|
+
{"version":3,"file":"build.js","names":["vxrnBuild","viteBuild"],"sources":["esm/cli/build.js"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport { cpus } from \"node:os\";\nimport Path, { join, posix, relative, resolve } from \"node:path\";\nimport { resolvePath } from \"@vxrn/resolve\";\nimport FSExtra from \"fs-extra\";\nimport MicroMatch from \"micromatch\";\nimport {\n createBuilder,\n mergeConfig,\n normalizePath,\n build as viteBuild\n} from \"vite\";\nimport {\n getOptimizeDeps,\n rollupRemoveUnusedImportsPlugin,\n build as vxrnBuild\n} from \"vxrn\";\nimport * as constants from \"../constants\";\nimport { setServerGlobals } from \"../server/setServerGlobals\";\nimport { environmentGuardPlugin } from \"../vite/plugins/environmentGuardPlugin\";\nimport { writeBuildOutputPointer } from \"../utils/buildOutputPointer\";\nimport { getPathnameFromFilePath } from \"../utils/getPathnameFromFilePath\";\nimport { getRouterRootFromOneOptions } from \"../utils/getRouterRootFromOneOptions\";\nimport { isRolldown } from \"../utils/isRolldown\";\nimport { toAbsolute } from \"../utils/toAbsolute\";\nimport { buildVercelOutputDirectory } from \"../vercel/build/buildVercelOutputDirectory\";\nimport {\n createCloudflareWranglerConfig,\n getCloudflareProjectName,\n isPlainObject,\n loadUserWranglerConfig\n} from \"../vite/cloudflareWranglerConfig\";\nimport { getManifest } from \"../vite/getManifest\";\nimport { loadUserOneOptions } from \"../vite/loadConfig\";\nimport { runWithAsyncLocalContext } from \"../vite/one-server-only\";\nimport { buildPage, printBuildTimings } from \"./buildPage\";\nimport { checkNodeVersion } from \"./checkNodeVersion\";\nimport { getWorkerPool, terminateWorkerPool } from \"./workerPool\";\nimport { generateSitemap } from \"./generateSitemap\";\nimport { labelProcess } from \"./label-process\";\nimport { getRouteExports } from \"./serverRouteModules\";\nimport { pLimit } from \"../utils/pLimit\";\nimport { getCriticalCSSOutputPaths } from \"../vite/plugins/criticalCSSPlugin\";\nimport { absorbedPackageAliases } from \"../utils/absorbedPackages\";\nimport {\n formatErrorSafely,\n installPrepareStackTraceGuard\n} from \"./install-error-handlers\";\nconst { ensureDir, writeJSON } = FSExtra;\nfunction normalizeDeploy(deploy) {\n if (!deploy) return void 0;\n if (typeof deploy === \"string\") return { target: deploy };\n return deploy;\n}\nconst CLOUDFLARE_DEPLOY_WRANGLER_RULES = [\n { type: \"ESModule\", globs: [\"assets/**/*.js\", \"assets/**/*.mjs\"] }\n];\nfunction omitEmptyJsonValues(value) {\n if (Array.isArray(value)) {\n const items = value.map((item) => omitEmptyJsonValues(item)).filter((item) => item !== void 0);\n return items.length > 0 ? items : void 0;\n }\n if (isPlainObject(value)) {\n const entries = Object.entries(value).map(([key, item]) => [key, omitEmptyJsonValues(item)]).filter((entry) => entry[1] !== void 0);\n return entries.length > 0 ? Object.fromEntries(entries) : void 0;\n }\n return value;\n}\nasync function finalizeCloudflareWranglerDeployConfig(configPath) {\n const parsed = JSON.parse(await FSExtra.readFile(configPath, \"utf-8\"));\n if (!isPlainObject(parsed)) {\n throw new Error(\n `Expected ${relative(process.cwd(), configPath)} to contain a JSON object`\n );\n }\n parsed.rules = CLOUDFLARE_DEPLOY_WRANGLER_RULES;\n const config = omitEmptyJsonValues(parsed);\n if (!isPlainObject(config)) {\n throw new Error(\n `Expected ${relative(process.cwd(), configPath)} to contain deploy config`\n );\n }\n await FSExtra.writeFile(configPath, `${JSON.stringify(config, null, 2)}\n`);\n}\nprocess.env.ONE_CACHE_KEY = constants.CACHE_KEY;\nfunction shouldUseWorkers(oneOptions) {\n if (process.env.ONE_BUILD_WORKERS === \"0\") return false;\n if (process.env.ONE_BUILD_WORKERS === \"1\") return true;\n return oneOptions?.build?.workers !== false;\n}\ninstallPrepareStackTraceGuard();\nlet buildErrorHandlersInstalled = false;\nfunction installBuildErrorHandlers() {\n if (buildErrorHandlersInstalled) return;\n buildErrorHandlersInstalled = true;\n process.on(\"uncaughtException\", (err) => {\n try {\n process.stderr.write(`[one build] uncaught exception\n${formatErrorSafely(err)}\n`);\n } catch {\n }\n process.exit(1);\n });\n process.on(\"unhandledRejection\", (reason) => {\n try {\n process.stderr.write(\n `[one build] unhandled rejection\n${formatErrorSafely(reason)}\n`\n );\n } catch {\n }\n process.exit(1);\n });\n}\nconst HOOK_KEYS = [\n \"resolveId\",\n \"load\",\n \"transform\",\n \"renderChunk\",\n \"generateBundle\",\n \"writeBundle\",\n \"buildStart\",\n \"buildEnd\",\n \"moduleParsed\"\n];\nfunction clonePluginHooks(config) {\n if (!config.plugins) return config;\n return {\n ...config,\n plugins: config.plugins.map((p) => {\n if (!p || typeof p !== \"object\") return p;\n const cloned = { ...p };\n for (const key of HOOK_KEYS) {\n if (cloned[key] && typeof cloned[key] === \"object\" && \"handler\" in cloned[key]) {\n cloned[key] = { ...cloned[key] };\n }\n }\n return cloned;\n })\n };\n}\nasync function build(args) {\n installBuildErrorHandlers();\n process.env.IS_VXRN_CLI = \"true\";\n if (!process.env.NODE_ENV) {\n process.env.NODE_ENV = \"production\";\n } else if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `\n \\u26A0\\uFE0F Warning: NODE_ENV is set to \"${process.env.NODE_ENV}\" (builds default to \"production\")\n`\n );\n }\n labelProcess(\"build\");\n checkNodeVersion();\n setServerGlobals();\n const { oneOptions, config: viteLoadedConfig } = await loadUserOneOptions(\"build\");\n const routerRoot = getRouterRootFromOneOptions(oneOptions);\n const configuredBuildConcurrency = process.env.ONE_BUILD_CONCURRENCY ?? oneOptions.build?.concurrency;\n const buildConcurrency = configuredBuildConcurrency === void 0 ? Math.max(1, Math.min(cpus().length, 8)) : Number(configuredBuildConcurrency);\n if (!Number.isInteger(buildConcurrency) || buildConcurrency < 1) {\n throw new Error(\n `build.concurrency must be a positive integer, received ${JSON.stringify(\n configuredBuildConcurrency\n )}`\n );\n }\n if (oneOptions.web?.defaultRenderMode) {\n process.env.ONE_DEFAULT_RENDER_MODE = oneOptions.web.defaultRenderMode;\n }\n const deployConfig = normalizeDeploy(oneOptions.web?.deploy);\n if (!process.env.ONE_SERVER_URL && deployConfig) {\n const url = deployConfig.url ?? (deployConfig.target === \"cloudflare\" ? `https://${await getCloudflareProjectName(process.cwd())}.workers.dev` : void 0);\n if (url) {\n process.env.ONE_SERVER_URL = url;\n console.info(`\n \\u2601\\uFE0F ONE_SERVER_URL: ${url}\n`);\n }\n }\n const outDir = viteLoadedConfig?.config?.build?.outDir ?? \"dist\";\n const manifest = getManifest({\n routerRoot,\n ignoredRouteFiles: oneOptions.router?.ignoredRouteFiles\n });\n const serverOutputFormat = oneOptions.build?.server === false ? \"esm\" : oneOptions.build?.server?.outputFormat ?? \"esm\";\n const buildStartTime = performance.now();\n const vxrnOutput = await vxrnBuild(\n {\n skipEnv: args.skipEnv ?? oneOptions.skipEnv,\n server: oneOptions.server,\n build: {\n analyze: true,\n server: oneOptions.build?.server === false ? false : {\n outputFormat: serverOutputFormat\n }\n }\n },\n args\n );\n const bundleTime = performance.now() - buildStartTime;\n console.info(`\n \\u23F1\\uFE0F vite bundle: ${(bundleTime / 1e3).toFixed(2)}s\n`);\n if (!vxrnOutput || args.platform !== \"web\") {\n return;\n }\n const { options } = vxrnOutput;\n const { optimizeDeps } = getOptimizeDeps(\"build\");\n const { rolldownOptions: _rolldownOptions, ...optimizeDepsNoRolldown } = optimizeDeps;\n const serverOpts = oneOptions.build?.server;\n const isUnified = typeof serverOpts === \"object\" && serverOpts !== null && serverOpts.unified === true;\n let baseForApi = isUnified ? clonePluginHooks(vxrnOutput.serverBuildConfig ?? vxrnOutput.webBuildConfig) : clonePluginHooks(vxrnOutput.webBuildConfig);\n if (isUnified) {\n const clone = {\n ...baseForApi,\n build: baseForApi.build ? { ...baseForApi.build } : void 0,\n plugins: baseForApi.plugins ? baseForApi.plugins.filter(\n (p) => p && typeof p === \"object\" && p.name !== \"omit-api-routes\"\n ) : void 0\n };\n if (clone.build && clone.build.rolldownOptions) {\n const ro = { ...clone.build.rolldownOptions };\n delete ro.input;\n clone.build.rolldownOptions = ro;\n }\n if (clone.build) {\n delete clone.build.outDir;\n }\n baseForApi = clone;\n }\n const apiBuildConfig = mergeConfig(baseForApi, {\n configFile: false,\n appType: \"custom\",\n optimizeDeps: optimizeDepsNoRolldown,\n environments: {\n client: {\n optimizeDeps: { rolldownOptions: _rolldownOptions }\n }\n }\n });\n async function buildCustomRoutes(subFolder, routes) {\n const input = routes.reduce((entries, { page, file }) => {\n entries[page.slice(1) + \".js\"] = join(routerRoot, file);\n return entries;\n }, {});\n const outputFormat = oneOptions?.build?.api?.outputFormat ?? serverOutputFormat;\n const treeshake = oneOptions?.build?.api?.treeshake;\n const mergedConfig = mergeConfig(apiBuildConfig, {\n appType: \"custom\",\n configFile: false,\n define: vxrnOutput.processEnvDefines,\n ssr: isUnified ? {\n // in unified mode let the base (serverBuildConfig) set ssr.noExternal\n // — default is now ['react', 'react-dom'] instead of `true`, so\n // rolldown can externalize the rest.\n optimizeDeps: optimizeDepsNoRolldown\n } : {\n noExternal: true,\n external: [\"react\", \"react-dom\"],\n optimizeDeps: optimizeDepsNoRolldown\n },\n environments: {\n ssr: {\n optimizeDeps: { rolldownOptions: _rolldownOptions }\n }\n },\n build: {\n ssr: true,\n emptyOutDir: false,\n outDir: `${outDir}/${subFolder}`,\n copyPublicDir: false,\n minify: false,\n rolldownOptions: {\n treeshake: treeshake ?? {\n moduleSideEffects: false\n },\n plugins: [\n // otherwise rollup is leaving commonjs-only top level imports...\n outputFormat === \"esm\" ? rollupRemoveUnusedImportsPlugin : null\n ].filter(Boolean),\n // too many issues\n // treeshake: {\n // moduleSideEffects: false,\n // },\n // prevents it from shaking out the exports\n preserveEntrySignatures: \"strict\",\n input,\n // in unified mode, inherit externals from serverBuildConfig (user\n // ssr.external / rolldownOptions.external). the legacy path resets\n // them to [] so per-route files bundle everything.\n ...isUnified ? {} : { external: [] },\n output: {\n entryFileNames: \"[name]\",\n exports: \"auto\",\n ...outputFormat === \"esm\" ? {\n format: \"esm\",\n esModule: true\n } : {\n format: \"cjs\",\n // Preserve folder structure and use .cjs extension\n entryFileNames: (chunkInfo) => {\n const name = chunkInfo.name.replace(/\\.js$/, \".cjs\");\n return name;\n },\n chunkFileNames: (chunkInfo) => {\n const chunkName = normalizePath(chunkInfo.name);\n const dir = posix.dirname(chunkName);\n const name = posix.basename(chunkName, posix.extname(chunkName));\n return posix.join(dir, `${name}-[hash].cjs`);\n },\n assetFileNames: (assetInfo) => {\n const assetName = normalizePath(assetInfo.name ?? \"\");\n const dir = posix.dirname(assetName);\n const baseName = posix.basename(assetName, posix.extname(assetName));\n const ext = posix.extname(assetName);\n return posix.join(dir, `${baseName}-[hash]${ext}`);\n }\n }\n }\n }\n }\n });\n const userApiBuildConf = oneOptions.build?.api?.config;\n const finalApiBuildConf = userApiBuildConf ? mergeConfig(mergedConfig, userApiBuildConf) : mergedConfig;\n const output = await viteBuild(\n // allow user merging api build config\n finalApiBuildConf\n );\n return output;\n }\n const builtMiddlewares = {};\n const apiPromise = manifest.apiRoutes.length ? (console.info(`\n \\u{1F528} build api routes\n`), buildCustomRoutes(\"api\", manifest.apiRoutes)) : Promise.resolve(null);\n const middlewarePromise = manifest.middlewareRoutes.length ? (console.info(`\n \\u{1F528} build middlewares\n`), buildCustomRoutes(\"middlewares\", manifest.middlewareRoutes)) : Promise.resolve(null);\n const [apiOutput, middlewareBuildInfo] = await Promise.all([\n apiPromise,\n middlewarePromise\n ]);\n if (middlewareBuildInfo) {\n for (const middleware of manifest.middlewareRoutes) {\n const absoluteRoot = resolve(process.cwd(), options.root);\n const fullPath = normalizePath(join(absoluteRoot, routerRoot, middleware.file));\n const outChunks = middlewareBuildInfo.output.filter((x) => x.type === \"chunk\");\n const chunk = outChunks.find((x) => x.facadeModuleId === fullPath);\n if (!chunk) throw new Error(`internal err finding middleware`);\n builtMiddlewares[middleware.file] = posix.join(\n outDir,\n \"middlewares\",\n chunk.fileName\n );\n }\n }\n globalThis[\"require\"] = createRequire(import.meta.dirname + \"/\");\n const assets = [];\n const builtRoutes = [];\n const sitemapData = [];\n const collectImportsCache = /* @__PURE__ */ new Map();\n const collectImportsInFlight = /* @__PURE__ */ new Set();\n const cssFileContentsCache = /* @__PURE__ */ new Map();\n const criticalCSSOutputPaths = getCriticalCSSOutputPaths(vxrnOutput.clientManifest);\n const limit = pLimit(buildConcurrency);\n const useWorkers = shouldUseWorkers(oneOptions);\n const workerPool = useWorkers ? getWorkerPool(buildConcurrency) : null;\n if (workerPool) {\n const serializableOptions = JSON.parse(\n JSON.stringify(\n oneOptions,\n (_key, value) => typeof value === \"function\" ? void 0 : value\n )\n );\n await workerPool.initialize(serializableOptions);\n }\n const staticStartTime = performance.now();\n const modeLabel = useWorkers ? `workers: ${workerPool?.size}` : `concurrency: ${buildConcurrency}`;\n console.info(`\n \\u{1F528} build static routes (${modeLabel})\n`);\n const staticDir = join(`${outDir}/static`);\n const clientDir = join(`${outDir}/client`);\n await ensureDir(staticDir);\n if (!vxrnOutput.serverOutput) {\n throw new Error(`No server output`);\n }\n const clientChunksBySource = /* @__PURE__ */ new Map();\n if (vxrnOutput.clientOutput) {\n for (const chunk of vxrnOutput.clientOutput) {\n if (chunk.type !== \"chunk\") continue;\n const info = { fileName: chunk.fileName, imports: chunk.imports || [] };\n for (const moduleId of chunk.moduleIds ?? []) {\n clientChunksBySource.set(moduleId, info);\n }\n }\n for (const chunk of vxrnOutput.clientOutput) {\n if (chunk.type !== \"chunk\" || !chunk.facadeModuleId) continue;\n clientChunksBySource.set(chunk.facadeModuleId, {\n fileName: chunk.fileName,\n imports: chunk.imports || []\n });\n }\n }\n const clientManifestByFile = /* @__PURE__ */ new Map();\n for (const entry of Object.values(vxrnOutput.clientManifest)) {\n if (entry.file) {\n clientManifestByFile.set(entry.file, entry);\n }\n }\n const outputEntries = [...vxrnOutput.serverOutput.entries()];\n const layoutServerPaths = /* @__PURE__ */ new Map();\n for (const [, output] of outputEntries) {\n if (output.type === \"asset\") continue;\n const id = output.facadeModuleId || \"\";\n const file = Path.basename(id);\n if (file.startsWith(\"_layout\") && id.includes(`/${routerRoot}/`)) {\n const relativePath = normalizePath(relative(process.cwd(), id)).replace(\n `${routerRoot}/`,\n \"\"\n );\n const contextKey = `./${relativePath}`;\n layoutServerPaths.set(contextKey, output.fileName);\n }\n }\n const routeByPath = /* @__PURE__ */ new Map();\n for (const route of manifest.pageRoutes) {\n if (route.file) {\n const routePath = `${routerRoot}${route.file.slice(1)}`;\n routeByPath.set(routePath, route);\n }\n }\n for (const [, output] of outputEntries) {\n if (output.type === \"asset\") {\n assets.push(output);\n }\n }\n const moduleIdToServerChunk = /* @__PURE__ */ new Map();\n for (const [, output] of outputEntries) {\n if (output.type === \"asset\") continue;\n const moduleIds = output.moduleIds || (output.facadeModuleId ? [output.facadeModuleId] : []);\n for (const moduleId of moduleIds) {\n moduleIdToServerChunk.set(moduleId, output.fileName);\n if (moduleId.includes(\"?one-spa-build\")) {\n moduleIdToServerChunk.set(\n moduleId.slice(0, moduleId.indexOf(\"?\")),\n output.fileName\n );\n }\n }\n }\n for (const foundRoute of manifest.pageRoutes) {\n let collectImports = function(entry, { type = \"js\" } = {}) {\n const { imports = [], css } = entry;\n const cacheKey = `${entry.file || imports.join(\",\")}:${type}`;\n const cached = collectImportsCache.get(cacheKey);\n if (cached) return cached;\n if (collectImportsInFlight.has(cacheKey)) return [];\n collectImportsInFlight.add(cacheKey);\n const result = [\n ...new Set(\n [\n ...type === \"js\" ? imports : css || [],\n ...imports.flatMap((name) => {\n const found = vxrnOutput.clientManifest[name];\n if (!found) {\n console.warn(`No found imports`, name, vxrnOutput.clientManifest);\n }\n return collectImports(found, { type });\n })\n ].flat().filter((x) => x && (type === \"css\" || x.endsWith(\".js\"))).map(\n (x) => type === \"css\" ? x : x.startsWith(\"assets/\") ? x : `assets/${x.slice(1)}`\n )\n )\n ];\n collectImportsInFlight.delete(cacheKey);\n collectImportsCache.set(cacheKey, result);\n return result;\n };\n if (!foundRoute.file) {\n continue;\n }\n const routeModulePath = normalizePath(\n join(resolve(process.cwd(), options.root), routerRoot, foundRoute.file.slice(2))\n );\n const serverFileName = moduleIdToServerChunk.get(routeModulePath);\n if (!serverFileName) {\n if (foundRoute.type === \"spa\") {\n throw new Error(\n `[one] No build-only server chunk for SPA route: ${foundRoute.file}`\n );\n }\n console.warn(`[one] No server chunk found for route: ${foundRoute.file}`);\n continue;\n }\n const onlyBuild = vxrnOutput.buildArgs?.only;\n if (onlyBuild) {\n const relativeId2 = foundRoute.file.slice(1);\n if (!MicroMatch.contains(relativeId2, onlyBuild)) {\n continue;\n }\n }\n const clientChunk = clientChunksBySource.get(routeModulePath);\n const manifestKey = `${routerRoot}${foundRoute.file.slice(1)}`;\n const clientManifestEntry = vxrnOutput.clientManifest[manifestKey] ?? (clientChunk ? clientManifestByFile.get(clientChunk.fileName) : void 0);\n if (!clientChunk && foundRoute.type !== \"spa\" && foundRoute.type !== \"ssg\") {\n console.warn(`No client chunk found for route: ${routeModulePath}`);\n continue;\n }\n foundRoute.loaderServerPath = serverFileName;\n const relativeId = foundRoute.file.replace(/^\\.\\//, \"/\");\n if (foundRoute.layouts) {\n for (const layout of foundRoute.layouts) {\n const serverPath = layoutServerPaths.get(layout.contextKey);\n if (serverPath) {\n layout.loaderServerPath = serverPath;\n }\n }\n }\n const entryImports = collectImports(clientManifestEntry || {});\n const layoutEntries = foundRoute.layouts?.flatMap((layout) => {\n const clientKey = `${routerRoot}${layout.contextKey.slice(1)}`;\n const found = vxrnOutput.clientManifest[clientKey];\n return found ? found : [];\n }) ?? [];\n const layoutImports = layoutEntries.flatMap((entry) => {\n return [entry.file, ...collectImports(entry)];\n });\n const routePreloads = {};\n const rootLayoutKey = `${routerRoot}/_layout.tsx`;\n const rootLayoutEntry = vxrnOutput.clientManifest[rootLayoutKey];\n if (rootLayoutEntry) {\n routePreloads[`/${rootLayoutKey}`] = `/${rootLayoutEntry.file}`;\n }\n if (foundRoute.layouts) {\n for (const layout of foundRoute.layouts) {\n const clientKey = `${routerRoot}${layout.contextKey.slice(1)}`;\n const entry = vxrnOutput.clientManifest[clientKey];\n if (entry) {\n routePreloads[`/${clientKey}`] = `/${entry.file}`;\n }\n }\n }\n const routeChunkFile = clientChunk?.fileName ?? clientManifestEntry?.file;\n if (routeChunkFile) {\n routePreloads[`/${routerRoot}${foundRoute.file.slice(1)}`] = `/${routeChunkFile}`;\n }\n const preloadSetupFilePreloads = (() => {\n if (!oneOptions.setupFile) return [];\n const clientSetupFile = typeof oneOptions.setupFile === \"string\" ? oneOptions.setupFile : oneOptions.setupFile.client;\n if (!clientSetupFile) return [];\n const needle = clientSetupFile.replace(/^\\.\\//, \"\");\n for (const file in vxrnOutput.clientManifest) {\n if (file === needle) {\n const entry = vxrnOutput.clientManifest[file];\n return [\n entry.file\n // getting 404s for preloading the imports as well?\n // ...(entry.imports as string[])\n ];\n }\n }\n return [];\n })();\n const allPreloads = [\n .../* @__PURE__ */ new Set([\n ...preloadSetupFilePreloads,\n // add the route entry js (like ./app/index.ts) - prefer direct chunk lookup\n ...clientChunk ? [clientChunk.fileName] : clientManifestEntry ? [clientManifestEntry.file] : [],\n // add the virtual entry\n vxrnOutput.clientManifest[\"virtual:one-entry\"].file,\n ...entryImports,\n ...layoutImports\n ])\n ].map((path) => `/${path}`);\n const scriptLoadingMode = oneOptions.web?.experimental_scriptLoading;\n const useDeferredLoading = scriptLoadingMode === \"defer-non-critical\";\n const useAggressiveLCP = scriptLoadingMode === \"after-lcp-aggressive\";\n const needsSeparatedPreloads = useDeferredLoading || useAggressiveLCP;\n const criticalPreloads = needsSeparatedPreloads ? [\n .../* @__PURE__ */ new Set([\n ...preloadSetupFilePreloads,\n // add the virtual entry (framework bootstrap)\n vxrnOutput.clientManifest[\"virtual:one-entry\"].file,\n // add the route entry js (like ./app/index.ts) - prefer direct chunk lookup\n ...clientChunk ? [clientChunk.fileName] : clientManifestEntry ? [clientManifestEntry.file] : [],\n // add layout files (but not their deep imports)\n ...layoutEntries.map((entry) => entry.file)\n ])\n ].map((path) => `/${path}`) : void 0;\n const deferredPreloads = needsSeparatedPreloads ? [\n .../* @__PURE__ */ new Set([\n ...entryImports,\n ...layoutEntries.flatMap((entry) => collectImports(entry))\n ])\n ].filter((path) => !criticalPreloads.includes(`/${path}`)).map((path) => `/${path}`) : void 0;\n const preloads2 = needsSeparatedPreloads ? [...criticalPreloads, ...deferredPreloads] : allPreloads;\n const allEntries = [clientManifestEntry, ...layoutEntries].filter(Boolean);\n const layoutCSS = [\n ...new Set(\n layoutEntries.flatMap((entry) => collectImports(entry, { type: \"css\" })).map((path) => `/${path}`)\n )\n ];\n const allCSS = [\n .../* @__PURE__ */ new Set([\n ...layoutCSS,\n // css from page entry\n ...clientManifestEntry ? collectImports(clientManifestEntry, { type: \"css\" }).map((path) => `/${path}`) : [],\n // root-level css for cssCodeSplit: false (vite emits a single\n // top-level `style.css` entry whose `src` equals `style.css`). when\n // cssCodeSplit is true (default), the manifest also contains a\n // per-component css entry for every chunk that ships any css — those\n // are owned by their JS chunk and must NOT be injected globally, or\n // every SSG page ends up preloading every css chunk in the project\n // (the prod /download was loading 23 stylesheets with editor/IDE\n // chunks despite being a marketing route).\n ...Object.entries(vxrnOutput.clientManifest).filter(([key, entry]) => {\n if (!key.endsWith(\".css\")) return false;\n const src = entry.src;\n return src === \"style.css\";\n }).map(([, entry]) => `/${entry.file}`)\n ])\n ];\n const hasCriticalCSS = allCSS.some((p) => criticalCSSOutputPaths.has(p));\n const needsCSSContents = oneOptions.web?.inlineLayoutCSS || hasCriticalCSS;\n let allCSSContents;\n if (needsCSSContents) {\n allCSSContents = await Promise.all(\n allCSS.map(async (cssPath) => {\n if (!oneOptions.web?.inlineLayoutCSS && !criticalCSSOutputPaths.has(cssPath)) {\n return \"\";\n }\n const cached = cssFileContentsCache.get(cssPath);\n if (cached !== void 0) return cached;\n const filePath = join(clientDir, cssPath);\n try {\n const content = await FSExtra.readFile(filePath, \"utf-8\");\n cssFileContentsCache.set(cssPath, content);\n return content;\n } catch (err) {\n console.warn(`[one] Warning: Could not read CSS file ${filePath}`);\n cssFileContentsCache.set(cssPath, \"\");\n return \"\";\n }\n })\n );\n }\n if (process.env.DEBUG) {\n console.info(\"[one] building routes\", {\n foundRoute,\n layoutEntries,\n allEntries,\n allCSS\n });\n }\n const serverJsPath = posix.join(outDir, \"server\", serverFileName);\n let exported;\n try {\n exported = await getRouteExports(\n vxrnOutput.serverEntry,\n routerRoot,\n foundRoute.file\n );\n } catch (err) {\n console.error(`Error importing page (original error)`, err);\n throw new Error(`Error importing page: ${foundRoute.file}`, {\n cause: err\n });\n }\n foundRoute.hasLoader = typeof exported.loader === \"function\";\n const isDynamic = !!Object.keys(foundRoute.routeKeys).length;\n if (foundRoute.type === \"ssg\" && isDynamic && !foundRoute.page.includes(\"+not-found\") && !foundRoute.page.includes(\"_sitemap\") && !exported.generateStaticParams) {\n throw new Error(`[one] Error: Missing generateStaticParams\n\n Route ${foundRoute.page} of type ${foundRoute.type} must export generateStaticParams so build can complete.\n\n See docs on generateStaticParams:\n https://onestack.dev/docs/routing-exports#generatestaticparams\n\n`);\n }\n const paramsList = await exported.generateStaticParams?.() ?? [{}];\n console.info(`\n [build] page ${relativeId} (with ${paramsList.length} routes)\n`);\n if (process.env.DEBUG) {\n console.info(`paramsList`, JSON.stringify(paramsList, null, 2));\n }\n const routeSitemapExport = exported.sitemap;\n const isAfterLCPMode = scriptLoadingMode === \"after-lcp\" || scriptLoadingMode === \"after-lcp-aggressive\";\n const useAfterLCP = foundRoute.type === \"ssg\" && isAfterLCPMode;\n const useAfterLCPAggressive = foundRoute.type === \"ssg\" && scriptLoadingMode === \"after-lcp-aggressive\";\n const shouldCollectSitemap = foundRoute.type !== \"api\" && foundRoute.type !== \"layout\" && !foundRoute.isNotFound && !foundRoute.page.includes(\"+not-found\") && !foundRoute.page.includes(\"_sitemap\");\n const pageBuilds = paramsList.map((params) => {\n const path = getPathnameFromFilePath(relativeId, params, foundRoute.type === \"ssg\");\n if (workerPool) {\n console.info(` \\u21A6 route ${path}`);\n return workerPool.buildPage({\n serverEntry: vxrnOutput.serverEntry,\n routerRoot,\n path,\n relativeId,\n params,\n foundRoute,\n clientManifestEntry,\n staticDir,\n clientDir,\n builtMiddlewares,\n serverJsPath,\n preloads: preloads2,\n allCSS,\n layoutCSS,\n routePreloads,\n allCSSContents,\n criticalPreloads,\n deferredPreloads,\n useAfterLCP,\n useAfterLCPAggressive\n }).then((built) => ({ built, path }));\n }\n return limit(async () => {\n console.info(` \\u21A6 route ${path}`);\n const built = await runWithAsyncLocalContext(async () => {\n return await buildPage(\n vxrnOutput.serverEntry,\n routerRoot,\n path,\n relativeId,\n params,\n foundRoute,\n clientManifestEntry,\n staticDir,\n clientDir,\n builtMiddlewares,\n serverJsPath,\n preloads2,\n allCSS,\n layoutCSS,\n routePreloads,\n allCSSContents,\n criticalPreloads,\n deferredPreloads,\n useAfterLCP,\n useAfterLCPAggressive\n );\n });\n return { built, path };\n });\n });\n const results = await Promise.all(pageBuilds);\n for (const { built, path } of results) {\n builtRoutes.push(built);\n if (shouldCollectSitemap) {\n sitemapData.push({\n path,\n routeExport: routeSitemapExport\n });\n }\n }\n }\n if (workerPool) {\n await terminateWorkerPool();\n }\n const staticTime = performance.now() - staticStartTime;\n console.info(\n `\n \\u23F1\\uFE0F static routes: ${(staticTime / 1e3).toFixed(2)}s (${builtRoutes.length} pages)\n`\n );\n printBuildTimings();\n await moveAllFiles(staticDir, clientDir);\n await FSExtra.remove(staticDir);\n const routeMap = {};\n const routeToBuildInfo = {};\n const pathToRoute = {};\n const preloads = {};\n const cssPreloads = {};\n const loaders = {};\n let cssContentsByPath;\n for (const route of builtRoutes) {\n if (!route.cleanPath.includes(\"*\")) {\n routeMap[route.cleanPath] = route.htmlPath;\n }\n const {\n // dont include loaderData it can be huge\n loaderData: _loaderData,\n cssContents,\n ...rest\n } = route;\n if (cssContents) {\n const contentsByPath = cssContentsByPath ||= {};\n route.css.forEach((cssPath, index) => {\n const content = cssContents[index];\n if (content) contentsByPath[cssPath] = content;\n });\n }\n routeToBuildInfo[route.routeFile] = rest;\n for (const p of getCleanPaths([route.path, route.cleanPath])) {\n pathToRoute[p] = route.routeFile;\n }\n preloads[route.preloadPath] = true;\n cssPreloads[route.cssPreloadPath] = true;\n loaders[route.loaderPath] = true;\n }\n function createBuildManifestRoute(route) {\n const { layouts, ...built } = route;\n if (layouts?.length) {\n ;\n built.layouts = layouts.map((layout) => ({\n contextKey: layout.contextKey,\n loaderServerPath: layout.loaderServerPath\n }));\n }\n const buildInfo = builtRoutes.find((x) => x.routeFile === route.file);\n if (built.middlewares) {\n for (const [index, mw] of built.middlewares.entries()) {\n const viaBuildInfo = buildInfo?.middlewares?.[index];\n if (viaBuildInfo) {\n mw.contextKey = viaBuildInfo;\n continue;\n }\n const viaMiddlewareMap = builtMiddlewares[mw.contextKey];\n if (viaMiddlewareMap) {\n mw.contextKey = viaMiddlewareMap;\n }\n }\n }\n if (buildInfo) {\n built.loaderPath = buildInfo.loaderPath;\n }\n return built;\n }\n const buildInfoForWriting = {\n outDir,\n oneOptions,\n routeToBuildInfo,\n cssContentsByPath,\n pathToRoute,\n manifest: {\n pageRoutes: manifest.pageRoutes.map(createBuildManifestRoute),\n apiRoutes: manifest.apiRoutes.map(createBuildManifestRoute),\n allRoutes: manifest.allRoutes.map(createBuildManifestRoute)\n },\n routeMap,\n constants: JSON.parse(JSON.stringify({ ...constants })),\n preloads,\n cssPreloads,\n loaders,\n useRolldown: await isRolldown()\n };\n await writeJSON(toAbsolute(`${outDir}/buildInfo.json`), buildInfoForWriting);\n await writeBuildOutputPointer(outDir);\n await FSExtra.writeFile(\n join(clientDir, \"version.json\"),\n JSON.stringify({ version: constants.CACHE_KEY })\n );\n console.info(`\n \\u{1F6E1} skew protection: emitted version.json\n`);\n const sitemapConfig = oneOptions.web?.sitemap;\n if (sitemapConfig) {\n const sitemapOptions = typeof sitemapConfig === \"boolean\" ? {} : sitemapConfig;\n const sitemapXml = generateSitemap(sitemapData, sitemapOptions);\n const sitemapPath = join(clientDir, \"sitemap.xml\");\n await FSExtra.writeFile(sitemapPath, sitemapXml);\n console.info(`\n \\u{1F4C4} generated sitemap.xml (${sitemapData.length} URLs)\n`);\n }\n const postBuildLogs = [];\n const platform = deployConfig?.target;\n if (platform) {\n postBuildLogs.push(`[one.build] platform ${platform}`);\n }\n switch (platform) {\n case \"vercel\": {\n const vercelJsonPath = join(options.root, \"vercel.json\");\n if (FSExtra.existsSync(vercelJsonPath)) {\n try {\n const vercelConfig = JSON.parse(FSExtra.readFileSync(vercelJsonPath, \"utf-8\"));\n if (!vercelConfig.cleanUrls) {\n console.warn(`\n \\u26A0\\uFE0F Warning: Your vercel.json is missing \"cleanUrls\": true`);\n console.warn(` Without this, direct navigation to SSG pages will 404.`);\n console.warn(` Add \"cleanUrls\": true to your vercel.json to fix this.\n`);\n }\n } catch {\n }\n }\n await buildVercelOutputDirectory({\n apiOutput,\n buildInfoForWriting,\n clientDir,\n oneOptionsRoot: options.root,\n postBuildLogs\n });\n break;\n }\n case \"cloudflare\": {\n const workerSrcDir = join(options.root, outDir);\n const getWorkerSourceImportPath = (routeFile) => {\n const importPath = normalizePath(\n relative(workerSrcDir, join(options.root, routerRoot, routeFile))\n );\n return importPath.startsWith(\".\") ? importPath : `./${importPath}`;\n };\n const apiRouteMap = [];\n const middlewareRouteMap = [];\n for (const route of buildInfoForWriting.manifest.apiRoutes) {\n if (route.file) {\n const importPath = getWorkerSourceImportPath(route.file);\n apiRouteMap.push(` '${route.page}': () => import('${importPath}')`);\n }\n }\n for (const [sourceFile, builtPath] of Object.entries(builtMiddlewares)) {\n const importPath = getWorkerSourceImportPath(sourceFile);\n middlewareRouteMap.push(` '${builtPath}': () => import('${importPath}')`);\n }\n const workerSrcPath = join(options.root, outDir, \"_worker-src.js\");\n const workerCode = `// Polyfill MessageChannel for React SSR (not available in Cloudflare Workers by default)\nif (typeof MessageChannel === 'undefined') {\n globalThis.MessageChannel = class MessageChannel {\n constructor() {\n this.port1 = { postMessage: () => {}, onmessage: null, close: () => {} }\n this.port2 = { postMessage: () => {}, onmessage: null, close: () => {} }\n }\n }\n}\n\nimport { serve, setFetchStaticHtml, withRange } from 'one/serve-worker'\n\n// Lazy import map - modules load on-demand when route is matched\nconst lazyRoutes = {\n serverEntry: () => import('./server/_virtual_one-entry.js'),\n api: {\n${apiRouteMap.join(\",\\n\")}\n },\n middlewares: {\n${middlewareRouteMap.join(\",\\n\")}\n }\n}\n\nconst buildInfo = ${JSON.stringify(buildInfoForWriting)}\n\nlet server\n\nexport default {\n async fetch(request, env, ctx) {\n if (!server) {\n server = await serve(buildInfo, lazyRoutes)\n }\n\n // set up static HTML fetcher for this request (uses ASSETS binding)\n if (env.ASSETS) {\n setFetchStaticHtml(async (path) => {\n try {\n const url = new URL(request.url)\n url.pathname = path\n const assetResponse = await env.ASSETS.fetch(new Request(url))\n if (assetResponse && assetResponse.ok) {\n return await assetResponse.text()\n }\n } catch (e) {\n // asset not found\n }\n return null\n })\n }\n\n try {\n const response = await server.fetch(request, env, ctx)\n\n // no route matched or 404 \\u2192 try static assets\n if (!response || response.status === 404) {\n if (env.ASSETS) {\n try {\n const assetResponse = await env.ASSETS.fetch(request)\n if (assetResponse && assetResponse.status !== 404) {\n return await withRange(request, assetResponse)\n }\n } catch (e) {\n // asset not found, continue with original response\n }\n }\n }\n\n return response\n } finally {\n setFetchStaticHtml(null)\n }\n }\n}\n`;\n await FSExtra.writeFile(workerSrcPath, workerCode);\n const projectName = await getCloudflareProjectName(options.root);\n const userWranglerConfig = await loadUserWranglerConfig(options.root);\n const wranglerInputConfig = createCloudflareWranglerConfig(\n projectName,\n userWranglerConfig?.config\n );\n wranglerInputConfig.main = normalizePath(\n relative(join(options.root, outDir), workerSrcPath)\n );\n const wranglerInputPath = join(options.root, outDir, \"_wrangler.input.jsonc\");\n await FSExtra.writeFile(\n wranglerInputPath,\n `${JSON.stringify(wranglerInputConfig, null, 2)}\n`\n );\n const ssrExternal = viteLoadedConfig?.config?.ssr?.external;\n const workerExternals = Array.isArray(ssrExternal) ? ssrExternal : [];\n console.info(\"\\n [cloudflare] Bundling worker...\");\n const { cloudflare } = await import(\"@cloudflare/vite-plugin\");\n const builder = await createBuilder({\n root: options.root,\n mode: \"production\",\n logLevel: \"warn\",\n configFile: false,\n define: {\n \"process.env.NODE_ENV\": JSON.stringify(\"production\"),\n \"process.env.VITE_ENVIRONMENT\": JSON.stringify(\"ssr\"),\n \"process.env.ONE_CACHE_KEY\": JSON.stringify(constants.CACHE_KEY)\n },\n plugins: [\n // the cloudflare worker IS a server, but this build runs with\n // configFile:false so the user vite.config (where the user-level\n // `one()` plugin registers environmentGuardPlugin via vite.config)\n // doesn't apply. register the guard plugin directly here so\n // `import 'server-only'` resolves to an empty module in the\n // worker bundle instead of inlining the package's throwing\n // index.js — which would crash the deployed worker on the first\n // /api request that loads any server-only-importing module.\n environmentGuardPlugin(oneOptions.environmentGuards),\n cloudflare({\n configPath: wranglerInputPath,\n viteEnvironment: { name: \"worker\" }\n })\n ],\n resolve: {\n alias: [\n // rolldown can't parse react-native's Flow syntax; alias to react-native-web for ssr\n {\n find: /^react-native\\/Libraries\\/.*/,\n replacement: resolvePath(\"@vxrn/vite-plugin-metro/empty\", options.root)\n },\n {\n // react native 0.87 removed @react-native/assets-registry, but libraries\n // like react-native-svg still import its registry\n find: /^(react-native\\/asset-registry|@react-native\\/assets-registry\\/registry)$/,\n replacement: \"react-native-web/dist/modules/AssetRegistry\"\n },\n {\n find: \"react-native/package.json\",\n replacement: \"react-native-web/package.json\"\n },\n {\n find: \"react-native\",\n replacement: \"react-native-web\"\n },\n ...Object.entries(absorbedPackageAliases(options.root, \"web\")).map(\n ([find, replacement]) => ({ find, replacement })\n )\n ],\n // the aliases name react-native-web by package, so it resolves from\n // the app root only once something imports react-native: an app\n // with no react-native imports needs no react-native-web.\n dedupe: [\"react-native-web\"]\n },\n build: {\n outDir,\n emptyOutDir: false,\n rolldownOptions: {\n // packages the app keeps out of its ssr bundle (native bindings\n // used only by build-time loaders) stay out of the worker too\n external: workerExternals,\n // Match the main web build behavior so RN packages that import\n // native-only symbols from react-native can still bundle against\n // the react-native-web alias in the worker graph.\n shimMissingExports: true,\n // cloudflare's module worker can contain circular shared chunks\n // when one package is used by both browser-facing SSR code and API\n // routes. preserve source import order so a dependent chunk cannot\n // evaluate against partially initialized exports.\n output: {\n strictExecutionOrder: true\n }\n }\n }\n });\n const workerEnv = builder.environments.worker;\n if (!workerEnv) {\n throw new Error('[one] plugin did not register \"worker\" environment');\n }\n await builder.build(workerEnv);\n await FSExtra.remove(workerSrcPath);\n await FSExtra.remove(wranglerInputPath);\n await finalizeCloudflareWranglerDeployConfig(\n join(options.root, outDir, \"worker\", \"wrangler.json\")\n );\n if (userWranglerConfig) {\n console.info(\n ` [cloudflare] Merging ${relative(options.root, userWranglerConfig.path)} into ${outDir}/worker/wrangler.json`\n );\n }\n postBuildLogs.push(`Cloudflare worker bundled at ${outDir}/worker/index.js`);\n postBuildLogs.push(`To deploy: wrangler deploy`);\n break;\n }\n }\n const securityScanOption = oneOptions.build?.securityScan;\n const securityScanLevel = securityScanOption === false ? null : securityScanOption === true || securityScanOption === void 0 ? \"warn\" : typeof securityScanOption === \"string\" ? securityScanOption : securityScanOption.level ?? \"warn\";\n const securitySafePatterns = typeof securityScanOption === \"object\" && securityScanOption !== null ? securityScanOption.safePatterns : void 0;\n if (securityScanLevel) {\n const { runSecurityScan } = await import(\"./securityScan\");\n const passed = await runSecurityScan(\n clientDir,\n securityScanLevel,\n securitySafePatterns\n );\n if (!passed) {\n process.exit(1);\n }\n }\n if (postBuildLogs.length) {\n console.info(`\n\n`);\n postBuildLogs.forEach((log) => {\n console.info(` \\xB7 ${log}`);\n });\n }\n console.info(`\n \\u{1F49B} build complete\n`);\n}\nconst TRAILING_INDEX_REGEX = /\\/index(\\.(web))?/;\nfunction getCleanPaths(possiblePaths) {\n return Array.from(\n new Set(\n Array.from(new Set(possiblePaths)).flatMap((p) => {\n const paths = [p];\n if (p.match(TRAILING_INDEX_REGEX)) {\n const pathWithTrailingIndexRemoved = p.replace(TRAILING_INDEX_REGEX, \"\");\n paths.push(pathWithTrailingIndexRemoved);\n paths.push(pathWithTrailingIndexRemoved + \"/\");\n }\n return paths;\n })\n )\n );\n}\nasync function moveAllFiles(src, dest) {\n try {\n await FSExtra.copy(src, dest, { overwrite: true, errorOnExist: false });\n } catch (err) {\n console.error(\"Error moving files:\", err);\n }\n}\nexport {\n build\n};\n//# sourceMappingURL=build.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAM,EAAE,WAAW,cAAc;AACjC,SAAS,gBAAgB,QAAQ;CAC/B,IAAI,CAAC,QAAQ,OAAO,KAAK;CACzB,IAAI,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F,MAAM,QAAQ,KAAK,KAAK,MAAM;GAAE,WAAW;GAAM,cAAc;EAAM,CAAC;CACxE,SAAS,KAAK;EACZ,QAAQ,MAAM,uBAAuB,GAAG;CAC1C;AACF"}
|
|
@@ -1177,7 +1177,7 @@ if (typeof MessageChannel === 'undefined') {
|
|
|
1177
1177
|
}
|
|
1178
1178
|
}
|
|
1179
1179
|
|
|
1180
|
-
import { serve, setFetchStaticHtml } from 'one/serve-worker'
|
|
1180
|
+
import { serve, setFetchStaticHtml, withRange } from 'one/serve-worker'
|
|
1181
1181
|
|
|
1182
1182
|
// Lazy import map - modules load on-demand when route is matched
|
|
1183
1183
|
const lazyRoutes = {
|
|
@@ -1226,7 +1226,7 @@ export default {
|
|
|
1226
1226
|
try {
|
|
1227
1227
|
const assetResponse = await env.ASSETS.fetch(request)
|
|
1228
1228
|
if (assetResponse && assetResponse.status !== 404) {
|
|
1229
|
-
return assetResponse
|
|
1229
|
+
return await withRange(request, assetResponse)
|
|
1230
1230
|
}
|
|
1231
1231
|
} catch (e) {
|
|
1232
1232
|
// asset not found, continue with original response
|