@demiurgejs/core 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/file-router.d.ts +5 -0
- package/dist/browser/file-router.d.ts.map +1 -1
- package/dist/chunks/{ssr-O3d7Q73U.js → ssr-BJejKlkZ.js} +57 -55
- package/dist/chunks/ssr-BJejKlkZ.js.map +1 -0
- package/dist/chunks/static-files-DUjHw-4H.js +11 -0
- package/dist/chunks/static-files-DUjHw-4H.js.map +1 -0
- package/dist/chunks/{streaming-27pwhjGC.js → streaming-DN1DnbRE.js} +2 -2
- package/dist/chunks/{streaming-27pwhjGC.js.map → streaming-DN1DnbRE.js.map} +1 -1
- package/dist/chunks/{testing-BBnJ5WUR.js → testing-DR3eQAvY.js} +127 -126
- package/dist/chunks/testing-DR3eQAvY.js.map +1 -0
- package/dist/document/render.d.ts +1 -0
- package/dist/document/render.d.ts.map +1 -1
- package/dist/index.js +284 -274
- package/dist/index.js.map +1 -1
- package/dist/internal/testing.js +1 -1
- package/dist/node/index.js +86 -85
- package/dist/node/index.js.map +1 -1
- package/dist/node/static.d.ts.map +1 -1
- package/dist/router/manifest.d.ts +3 -1
- package/dist/router/manifest.d.ts.map +1 -1
- package/dist/static/index.d.ts +5 -0
- package/dist/static/index.d.ts.map +1 -1
- package/dist/static/index.js +245 -124
- package/dist/static/index.js.map +1 -1
- package/dist/static-files.d.ts +5 -0
- package/dist/static-files.d.ts.map +1 -0
- package/dist/vite/index.js +445 -279
- package/dist/vite/index.js.map +1 -1
- package/dist/vite/plugin.d.ts.map +1 -1
- package/package.json +4 -1
- package/dist/chunks/ssr-O3d7Q73U.js.map +0 -1
- package/dist/chunks/testing-BBnJ5WUR.js.map +0 -1
package/dist/vite/index.js
CHANGED
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
import { existsSync as
|
|
2
|
-
import { mkdir as
|
|
3
|
-
import { dirname as
|
|
1
|
+
import { existsSync as U } from "node:fs";
|
|
2
|
+
import { mkdir as tt, writeFile as et, readdir as B, readFile as rt } from "node:fs/promises";
|
|
3
|
+
import { dirname as G, resolve as p, relative as g, sep as $, join as nt } from "node:path";
|
|
4
|
+
import ot from "magic-string";
|
|
4
5
|
import { parseAst as Y } from "vite";
|
|
5
|
-
import { b as
|
|
6
|
-
import { r as
|
|
6
|
+
import { b as st, d as it } from "../chunks/ssr-BJejKlkZ.js";
|
|
7
|
+
import { e as x, r as at, f as ct, h as ut, c as lt } from "../chunks/testing-DR3eQAvY.js";
|
|
7
8
|
import "react";
|
|
8
9
|
import "react-dom/server";
|
|
9
10
|
import "react/jsx-runtime";
|
|
10
|
-
import { t as
|
|
11
|
-
const
|
|
12
|
-
async function
|
|
13
|
-
const n = (await
|
|
14
|
-
return await
|
|
11
|
+
import { t as I, U as O, w as _, b as F, c as ft } from "../chunks/streaming-DN1DnbRE.js";
|
|
12
|
+
const h = "@demiurgejs/core";
|
|
13
|
+
async function dt(t) {
|
|
14
|
+
const n = (await pt(t.routesDir)).map((r) => mt(t.routesDir, r)).filter((r) => !!r).sort((r, s) => r.pattern.localeCompare(s.pattern)), o = yt(n);
|
|
15
|
+
return await tt(G(t.outputFile), { recursive: !0 }), await et(t.outputFile, o), {
|
|
15
16
|
routes: n,
|
|
16
|
-
source:
|
|
17
|
+
source: o
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
|
-
async function
|
|
20
|
-
return (await
|
|
20
|
+
async function pt(t) {
|
|
21
|
+
return (await B(t, {
|
|
21
22
|
recursive: !0,
|
|
22
23
|
withFileTypes: !0
|
|
23
|
-
})).filter((n) => n.isFile() && /\.tsx?$/.test(n.name)).map((n) =>
|
|
24
|
+
})).filter((n) => n.isFile() && /\.tsx?$/.test(n.name)).map((n) => p(n.parentPath, n.name));
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
26
|
+
function mt(t, e) {
|
|
27
|
+
const o = g(t, e).split($).join("/").replace(/\.tsx?$/, "").split("/");
|
|
28
|
+
if (o.at(-1)?.startsWith("@"))
|
|
28
29
|
return null;
|
|
29
|
-
const
|
|
30
|
+
const s = o.flatMap((i) => P(i) ? [] : i === "index" ? [] : i.startsWith("[...") && i.endsWith("]") ? [i] : i.startsWith("[") && i.endsWith("]") ? [i] : [i]);
|
|
30
31
|
return {
|
|
31
|
-
pathVars:
|
|
32
|
-
pattern: `/${
|
|
32
|
+
pathVars: o.flatMap((i) => P(i) ? [] : i.startsWith("[...") && i.endsWith("]") ? [i.slice(4, -1)] : i.startsWith("[") && i.endsWith("]") ? [i.slice(1, -1)] : []),
|
|
33
|
+
pattern: `/${s.join("/")}`.replace(/\/$/, "") || "/"
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
+
function P(t) {
|
|
36
37
|
return t.startsWith("(") && t.endsWith(")");
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function yt(t) {
|
|
39
40
|
return `// Generated by Demiurge. Do not edit by hand.
|
|
40
|
-
import "${
|
|
41
|
-
import type { PathValue } from "${
|
|
41
|
+
import "${h}";
|
|
42
|
+
import type { PathValue } from "${h}";
|
|
42
43
|
|
|
43
|
-
declare module "${
|
|
44
|
+
declare module "${h}" {
|
|
44
45
|
interface RoutePathVars {
|
|
45
|
-
${t.map(
|
|
46
|
+
${t.map(ht).join(`
|
|
46
47
|
`)}
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
interface RouteConcretePaths {
|
|
50
|
-
${t.map(
|
|
51
|
+
${t.map(gt).join(`
|
|
51
52
|
`)}
|
|
52
53
|
}
|
|
53
54
|
}
|
|
@@ -55,61 +56,64 @@ ${t.map(at).join(`
|
|
|
55
56
|
export {};
|
|
56
57
|
`;
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
+
function ht(t) {
|
|
59
60
|
if (t.pathVars.length === 0)
|
|
60
61
|
return ` ${JSON.stringify(t.pattern)}: {};`;
|
|
61
62
|
const e = t.pathVars.map((n) => `${n}: PathValue`).join("; ");
|
|
62
63
|
return ` ${JSON.stringify(t.pattern)}: { ${e} };`;
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
-
return ` ${JSON.stringify(t.pattern)}: ${
|
|
65
|
+
function gt(t) {
|
|
66
|
+
return ` ${JSON.stringify(t.pattern)}: ${Rt(t.pattern)};`;
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
-
return t.includes("[") ? `\`${t.split(/(\[\.\.\.[^\]]+\]|\[[^\]]+\])/g).filter(Boolean).map((n) => n.startsWith("[") ? "${PathValue}" :
|
|
68
|
+
function Rt(t) {
|
|
69
|
+
return t.includes("[") ? `\`${t.split(/(\[\.\.\.[^\]]+\]|\[[^\]]+\])/g).filter(Boolean).map((n) => n.startsWith("[") ? "${PathValue}" : wt(n)).join("")}\`` : JSON.stringify(t);
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
+
function wt(t) {
|
|
71
72
|
return t.replace(/[`$\\]/g, "\\$&");
|
|
72
73
|
}
|
|
73
|
-
const
|
|
74
|
-
function
|
|
74
|
+
const E = "virtual:demiurge/client-entry", v = `/@id/${E}`, D = `\0${E}`, q = "virtual:demiurge/server-entry", M = `\0${q}`, C = ".demiurge/route-manifest.d.ts";
|
|
75
|
+
function ue(t = {}) {
|
|
75
76
|
let e = process.cwd(), n = !1;
|
|
77
|
+
const o = `demiurge-${x()}`;
|
|
76
78
|
return {
|
|
77
79
|
enforce: "post",
|
|
78
80
|
name: "demiurge",
|
|
79
|
-
config(r) {
|
|
80
|
-
return
|
|
81
|
+
config(r, s) {
|
|
82
|
+
return It(r, s, o);
|
|
81
83
|
},
|
|
82
84
|
configResolved(r) {
|
|
83
85
|
e = r.root, n = r.command === "build";
|
|
84
86
|
},
|
|
85
87
|
resolveId(r) {
|
|
86
|
-
return r ===
|
|
88
|
+
return r === E ? D : r === q ? M : null;
|
|
87
89
|
},
|
|
88
90
|
load(r) {
|
|
89
|
-
return r ===
|
|
91
|
+
return r === D ? Ot(e, t) : r === M ? _t(e, t) : null;
|
|
90
92
|
},
|
|
91
93
|
transform: {
|
|
92
94
|
order: "post",
|
|
93
|
-
handler(r,
|
|
94
|
-
if (
|
|
95
|
+
handler(r, s, a) {
|
|
96
|
+
if (!Et(e, t, s))
|
|
95
97
|
return null;
|
|
96
|
-
|
|
98
|
+
if (a?.ssr)
|
|
99
|
+
return n ? null : $t(r, s);
|
|
100
|
+
const i = bt(r);
|
|
97
101
|
return i === r ? null : { code: i, map: null };
|
|
98
102
|
}
|
|
99
103
|
},
|
|
100
|
-
generateBundle(r,
|
|
101
|
-
const a = Object.values(
|
|
102
|
-
(
|
|
104
|
+
generateBundle(r, s) {
|
|
105
|
+
const a = Object.values(s).find(
|
|
106
|
+
(c) => c.type === "chunk" && c.isEntry && c.facadeModuleId === D
|
|
103
107
|
);
|
|
104
108
|
if (!a)
|
|
105
109
|
return;
|
|
106
|
-
const i = Object.values(
|
|
107
|
-
(
|
|
108
|
-
).map((
|
|
110
|
+
const i = Object.values(s).filter(
|
|
111
|
+
(c) => c.type === "asset" && c.fileName.endsWith(".css")
|
|
112
|
+
).map((c) => `/${c.fileName}`), u = `/${a.fileName}`;
|
|
109
113
|
this.emitFile({
|
|
110
114
|
fileName: "index.html",
|
|
111
|
-
source:
|
|
112
|
-
entrySrc:
|
|
115
|
+
source: qt({
|
|
116
|
+
entrySrc: u,
|
|
113
117
|
lang: t.document?.lang,
|
|
114
118
|
styles: i,
|
|
115
119
|
title: t.document?.title
|
|
@@ -117,221 +121,262 @@ function Yt(t = {}) {
|
|
|
117
121
|
type: "asset"
|
|
118
122
|
}), this.emitFile({
|
|
119
123
|
fileName: "demiurge-manifest.json",
|
|
120
|
-
source: JSON.stringify({ clientEntry:
|
|
124
|
+
source: JSON.stringify({ clientEntry: u, styles: i }, null, 2),
|
|
121
125
|
type: "asset"
|
|
122
126
|
});
|
|
123
127
|
},
|
|
124
128
|
async buildStart() {
|
|
125
|
-
n && await
|
|
129
|
+
n && await Ht(e, t), t.typedRoutes && await w(e, t);
|
|
126
130
|
},
|
|
127
131
|
configureServer(r) {
|
|
128
132
|
if (t.typedRoutes) {
|
|
129
|
-
const
|
|
133
|
+
const s = p(
|
|
130
134
|
r.config.root,
|
|
131
135
|
t.routesDir ?? "src/routes"
|
|
132
136
|
);
|
|
133
|
-
|
|
134
|
-
|
|
137
|
+
w(r.config.root, t), r.watcher.add(s), r.watcher.on("add", (a) => {
|
|
138
|
+
N(s, a) && w(r.config.root, t);
|
|
135
139
|
}), r.watcher.on("change", (a) => {
|
|
136
|
-
|
|
140
|
+
N(s, a) && w(r.config.root, t);
|
|
137
141
|
}), r.watcher.on("unlink", (a) => {
|
|
138
|
-
|
|
142
|
+
N(s, a) && w(r.config.root, t);
|
|
139
143
|
});
|
|
140
144
|
}
|
|
141
|
-
return r.middlewares.use(async (
|
|
145
|
+
return r.middlewares.use(async (s, a, i) => {
|
|
142
146
|
try {
|
|
143
|
-
let
|
|
147
|
+
let u;
|
|
144
148
|
try {
|
|
145
|
-
|
|
149
|
+
u = I(s, {
|
|
146
150
|
// Vite performs its own configured host allowlist check before
|
|
147
151
|
// Demiurge's middleware runs. Production Node listeners require
|
|
148
152
|
// an explicit application allowlist instead.
|
|
149
|
-
allowedHosts: [
|
|
153
|
+
allowedHosts: [s.headers.host ?? "localhost"]
|
|
150
154
|
});
|
|
151
|
-
} catch (
|
|
152
|
-
if (
|
|
153
|
-
|
|
155
|
+
} catch (R) {
|
|
156
|
+
if (R instanceof O) {
|
|
157
|
+
_(a);
|
|
154
158
|
return;
|
|
155
159
|
}
|
|
156
|
-
throw
|
|
160
|
+
throw R;
|
|
157
161
|
}
|
|
158
|
-
const
|
|
162
|
+
const c = p(
|
|
159
163
|
r.config.root,
|
|
160
164
|
t.routesDir ?? "src/routes"
|
|
161
|
-
),
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
+
), l = await k(r, s, c), d = j(
|
|
166
|
+
r,
|
|
167
|
+
o
|
|
168
|
+
), y = await zt(
|
|
169
|
+
l,
|
|
170
|
+
u,
|
|
171
|
+
Tt(t, d.transform)
|
|
165
172
|
);
|
|
166
|
-
if (
|
|
173
|
+
if (y === "next") {
|
|
167
174
|
i();
|
|
168
175
|
return;
|
|
169
176
|
}
|
|
170
|
-
await F(a,
|
|
171
|
-
} catch (
|
|
172
|
-
i(
|
|
177
|
+
W(y, d.nonce), await F(a, y);
|
|
178
|
+
} catch (u) {
|
|
179
|
+
i(u);
|
|
173
180
|
}
|
|
174
181
|
}), () => {
|
|
175
|
-
r.middlewares.use(async (
|
|
182
|
+
r.middlewares.use(async (s, a, i) => {
|
|
176
183
|
try {
|
|
177
|
-
let
|
|
184
|
+
let u;
|
|
178
185
|
try {
|
|
179
|
-
|
|
180
|
-
allowedHosts: [
|
|
186
|
+
u = I(s, {
|
|
187
|
+
allowedHosts: [s.headers.host ?? "localhost"]
|
|
181
188
|
});
|
|
182
|
-
} catch (
|
|
183
|
-
if (
|
|
184
|
-
|
|
189
|
+
} catch (R) {
|
|
190
|
+
if (R instanceof O) {
|
|
191
|
+
_(a);
|
|
185
192
|
return;
|
|
186
193
|
}
|
|
187
|
-
throw
|
|
194
|
+
throw R;
|
|
188
195
|
}
|
|
189
|
-
const
|
|
196
|
+
const c = p(
|
|
190
197
|
r.config.root,
|
|
191
198
|
t.routesDir ?? "src/routes"
|
|
192
|
-
),
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
), l = await k(r, s, c);
|
|
200
|
+
kt(l, c);
|
|
201
|
+
const d = j(
|
|
202
|
+
r,
|
|
203
|
+
o
|
|
204
|
+
), y = await at(
|
|
205
|
+
l,
|
|
206
|
+
u,
|
|
207
|
+
Lt(t, d.transform)
|
|
200
208
|
);
|
|
201
|
-
|
|
202
|
-
|
|
209
|
+
W(
|
|
210
|
+
y,
|
|
211
|
+
d.nonce
|
|
212
|
+
), await F(a, y);
|
|
213
|
+
} catch (u) {
|
|
214
|
+
i(u);
|
|
203
215
|
}
|
|
204
216
|
});
|
|
205
217
|
};
|
|
206
218
|
}
|
|
207
219
|
};
|
|
208
220
|
}
|
|
209
|
-
function
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
221
|
+
function $t(t, e) {
|
|
222
|
+
if (!t.includes("import.meta"))
|
|
223
|
+
return null;
|
|
224
|
+
const n = Y(t), o = m(n.body).find(
|
|
225
|
+
(c) => c.type === "ImportDeclaration" && m(c.specifiers).some(
|
|
226
|
+
(l) => f(l.local)?.type === "Identifier" && f(l.local)?.name === "meta"
|
|
227
|
+
)
|
|
228
|
+
), r = o && m(o.specifiers).find(
|
|
229
|
+
(c) => f(c.local)?.type === "Identifier" && f(c.local)?.name === "meta"
|
|
230
|
+
), s = r && f(r.local);
|
|
231
|
+
if (!o || !r || !s)
|
|
232
|
+
return null;
|
|
233
|
+
let a = "__demiurge_imported_meta__";
|
|
234
|
+
for (; new RegExp(`\\b${a}\\b`).test(t); )
|
|
235
|
+
a += "_";
|
|
236
|
+
const i = new ot(t), u = f(r.imported);
|
|
237
|
+
return i.overwrite(
|
|
238
|
+
s.start,
|
|
239
|
+
s.end,
|
|
240
|
+
u?.start === s.start ? `meta as ${a}` : a
|
|
241
|
+
), i.appendLeft(o.end, `
|
|
242
|
+
const meta = ${a};`), {
|
|
243
|
+
code: i.toString(),
|
|
244
|
+
map: i.generateMap({
|
|
245
|
+
hires: "boundary",
|
|
246
|
+
includeContent: !0,
|
|
247
|
+
source: e
|
|
248
|
+
})
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
function bt(t) {
|
|
252
|
+
const e = Y(t), n = [], o = St(e), r = [];
|
|
253
|
+
b(e, (i) => {
|
|
254
|
+
if (i.type === "ImportDeclaration" && Nt(i)) {
|
|
255
|
+
r.push(i);
|
|
214
256
|
return;
|
|
215
257
|
}
|
|
216
|
-
if (
|
|
258
|
+
if (i.type !== "CallExpression" || !Dt(i.callee))
|
|
217
259
|
return;
|
|
218
|
-
const u =
|
|
260
|
+
const u = m(i.arguments)[0];
|
|
219
261
|
if (u?.type === "ObjectExpression")
|
|
220
|
-
for (const c of
|
|
221
|
-
c.type === "Property" &&
|
|
262
|
+
for (const c of m(u.properties))
|
|
263
|
+
c.type === "Property" && S(c.key) === "data" && n.push({ end: c.end, start: c.start });
|
|
222
264
|
});
|
|
223
|
-
const
|
|
224
|
-
if (
|
|
265
|
+
const s = [...n, ...o];
|
|
266
|
+
if (s.length === 0)
|
|
225
267
|
return t;
|
|
226
|
-
const
|
|
227
|
-
for (const
|
|
228
|
-
const u =
|
|
229
|
-
...
|
|
230
|
-
{ end:
|
|
231
|
-
]),
|
|
232
|
-
(
|
|
268
|
+
const a = [...s];
|
|
269
|
+
for (const i of r) {
|
|
270
|
+
const u = m(i.specifiers).map((d) => f(d.local)).filter((d) => d?.type === "Identifier").map((d) => String(d.name)), c = xt(t, [
|
|
271
|
+
...s,
|
|
272
|
+
{ end: i.end, start: i.start }
|
|
273
|
+
]), l = u.find(
|
|
274
|
+
(d) => new RegExp(`\\b${K(d)}\\b`).test(c)
|
|
233
275
|
);
|
|
234
|
-
if (
|
|
276
|
+
if (l)
|
|
235
277
|
throw new Error(
|
|
236
|
-
`Server-only import ${JSON.stringify(
|
|
278
|
+
`Server-only import ${JSON.stringify(l)} is used by client route code. Move that use into page data, a document contribution, or a client-safe module.`
|
|
237
279
|
);
|
|
238
|
-
|
|
280
|
+
a.push({ end: i.end, start: i.start });
|
|
239
281
|
}
|
|
240
|
-
return
|
|
282
|
+
return vt(
|
|
241
283
|
t,
|
|
242
|
-
|
|
243
|
-
(
|
|
284
|
+
a,
|
|
285
|
+
(i) => n.includes(i) ? "data: undefined" : o.includes(i) ? "undefined" : ""
|
|
244
286
|
);
|
|
245
287
|
}
|
|
246
|
-
const
|
|
247
|
-
function
|
|
288
|
+
const T = /* @__PURE__ */ new Set(["links", "metadata", "scripts"]);
|
|
289
|
+
function St(t) {
|
|
248
290
|
const e = /* @__PURE__ */ new Set();
|
|
249
|
-
for (const
|
|
250
|
-
if (
|
|
251
|
-
const
|
|
252
|
-
if (
|
|
253
|
-
for (const
|
|
254
|
-
const
|
|
255
|
-
|
|
291
|
+
for (const o of m(t.body)) {
|
|
292
|
+
if (o.type !== "ExportNamedDeclaration") continue;
|
|
293
|
+
const r = f(o.declaration);
|
|
294
|
+
if (r?.type === "VariableDeclaration")
|
|
295
|
+
for (const s of m(r.declarations)) {
|
|
296
|
+
const a = f(s.id);
|
|
297
|
+
a?.type === "Identifier" && T.has(String(a.name)) && e.add(String(a.name));
|
|
256
298
|
}
|
|
257
|
-
for (const
|
|
258
|
-
const
|
|
259
|
-
|
|
299
|
+
for (const s of m(o.specifiers)) {
|
|
300
|
+
const a = S(s.exported), i = S(s.local);
|
|
301
|
+
a && i && T.has(a) && e.add(i);
|
|
260
302
|
}
|
|
261
303
|
}
|
|
262
304
|
const n = [];
|
|
263
|
-
return
|
|
264
|
-
if (
|
|
265
|
-
const
|
|
266
|
-
|
|
305
|
+
return b(t, (o) => {
|
|
306
|
+
if (o.type !== "VariableDeclarator") return;
|
|
307
|
+
const r = f(o.id), s = f(o.init);
|
|
308
|
+
r?.type === "Identifier" && e.has(String(r.name)) && s && n.push({ end: s.end, start: s.start });
|
|
267
309
|
}), n;
|
|
268
310
|
}
|
|
269
|
-
function
|
|
270
|
-
const
|
|
271
|
-
return
|
|
311
|
+
function Et(t, e, n) {
|
|
312
|
+
const o = n.split("?", 1)[0] ?? n, r = p(t, e.routesDir ?? "src/routes"), s = g(r, o);
|
|
313
|
+
return s !== "" && s !== ".." && !s.startsWith(`..${$}`);
|
|
272
314
|
}
|
|
273
|
-
function
|
|
315
|
+
function b(t, e) {
|
|
274
316
|
if (!t || typeof t != "object") return;
|
|
275
317
|
if (Array.isArray(t)) {
|
|
276
|
-
for (const
|
|
318
|
+
for (const o of t) b(o, e);
|
|
277
319
|
return;
|
|
278
320
|
}
|
|
279
321
|
const n = t;
|
|
280
322
|
if (typeof n.type == "string") {
|
|
281
323
|
e(n);
|
|
282
|
-
for (const [
|
|
283
|
-
(/* @__PURE__ */ new Set(["end", "loc", "start", "type"])).has(
|
|
324
|
+
for (const [o, r] of Object.entries(n))
|
|
325
|
+
(/* @__PURE__ */ new Set(["end", "loc", "start", "type"])).has(o) || b(r, e);
|
|
284
326
|
}
|
|
285
327
|
}
|
|
286
|
-
function
|
|
328
|
+
function f(t) {
|
|
287
329
|
return t && typeof t == "object" && "type" in t ? t : void 0;
|
|
288
330
|
}
|
|
289
|
-
function
|
|
290
|
-
return Array.isArray(t) ? t.map(
|
|
331
|
+
function m(t) {
|
|
332
|
+
return Array.isArray(t) ? t.map(f).filter((e) => !!e) : [];
|
|
291
333
|
}
|
|
292
|
-
function
|
|
293
|
-
const e =
|
|
294
|
-
return e?.type === "Identifier" ? e.name === "page" : e?.type === "MemberExpression" &&
|
|
334
|
+
function Dt(t) {
|
|
335
|
+
const e = f(t);
|
|
336
|
+
return e?.type === "Identifier" ? e.name === "page" : e?.type === "MemberExpression" && S(e.property) === "page";
|
|
295
337
|
}
|
|
296
|
-
function
|
|
297
|
-
const e =
|
|
338
|
+
function S(t) {
|
|
339
|
+
const e = f(t);
|
|
298
340
|
return e?.type === "Identifier" || e?.type === "Literal" ? String(e.name ?? e.value) : void 0;
|
|
299
341
|
}
|
|
300
|
-
function
|
|
301
|
-
const e =
|
|
342
|
+
function Nt(t) {
|
|
343
|
+
const e = f(t.source)?.value;
|
|
302
344
|
return typeof e == "string" && /(?:^|[/.-])server(?:[/.-]|$)/.test(e);
|
|
303
345
|
}
|
|
304
|
-
function
|
|
346
|
+
function xt(t, e) {
|
|
305
347
|
const n = [...t];
|
|
306
|
-
for (const { end:
|
|
307
|
-
n.fill(" ",
|
|
348
|
+
for (const { end: o, start: r } of e)
|
|
349
|
+
n.fill(" ", r, o);
|
|
308
350
|
return n.join("");
|
|
309
351
|
}
|
|
310
|
-
function
|
|
311
|
-
return [...e].sort((
|
|
312
|
-
(
|
|
352
|
+
function vt(t, e, n) {
|
|
353
|
+
return [...e].sort((o, r) => r.start - o.start).reduce(
|
|
354
|
+
(o, r) => `${o.slice(0, r.start)}${n(r)}${o.slice(r.end)}`,
|
|
313
355
|
t
|
|
314
356
|
);
|
|
315
357
|
}
|
|
316
|
-
function
|
|
358
|
+
function K(t) {
|
|
317
359
|
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
318
360
|
}
|
|
319
|
-
function
|
|
361
|
+
function It(t, e, n) {
|
|
320
362
|
return {
|
|
321
363
|
appType: "custom",
|
|
322
364
|
build: {
|
|
365
|
+
assetsInlineLimit: t.build?.assetsInlineLimit ?? 0,
|
|
366
|
+
...e.isSsrBuild && t.build?.target === void 0 && t.ssr?.target !== "webworker" ? { target: "node22.13" } : {},
|
|
323
367
|
rollupOptions: {
|
|
324
|
-
input: t.build?.rollupOptions?.input ??
|
|
368
|
+
input: t.build?.rollupOptions?.input ?? E
|
|
325
369
|
}
|
|
326
|
-
}
|
|
370
|
+
},
|
|
371
|
+
...e.command === "serve" ? { html: { cspNonce: n } } : {}
|
|
327
372
|
};
|
|
328
373
|
}
|
|
329
|
-
function
|
|
330
|
-
const n = e.routesDir ?? "src/routes",
|
|
331
|
-
return `import { hydrateFileRouter } from "${
|
|
332
|
-
${
|
|
374
|
+
function Ot(t, e = {}) {
|
|
375
|
+
const n = e.routesDir ?? "src/routes", o = Ct(t, e);
|
|
376
|
+
return `import { hydrateFileRouter } from "${h}";
|
|
377
|
+
${o}
|
|
333
378
|
|
|
334
|
-
${
|
|
379
|
+
${z(n, {
|
|
335
380
|
exportRoutes: !1,
|
|
336
381
|
includeServerOnly: !1
|
|
337
382
|
})}
|
|
@@ -339,11 +384,11 @@ ${k(n, {
|
|
|
339
384
|
void hydrateFileRouter({ routes });
|
|
340
385
|
`;
|
|
341
386
|
}
|
|
342
|
-
function
|
|
387
|
+
function _t(t, e = {}) {
|
|
343
388
|
const n = e.routesDir ?? "src/routes";
|
|
344
|
-
return `import { createRequestHandler } from "${
|
|
389
|
+
return `import { createRequestHandler } from "${h}";
|
|
345
390
|
|
|
346
|
-
${
|
|
391
|
+
${z(n, {
|
|
347
392
|
exportRoutes: !0,
|
|
348
393
|
includeServerOnly: !0
|
|
349
394
|
})}
|
|
@@ -364,13 +409,13 @@ export function createHandler(options = {}) {
|
|
|
364
409
|
}
|
|
365
410
|
`;
|
|
366
411
|
}
|
|
367
|
-
function
|
|
412
|
+
function z(t, {
|
|
368
413
|
exportRoutes: e,
|
|
369
414
|
includeServerOnly: n
|
|
370
415
|
}) {
|
|
371
|
-
const
|
|
372
|
-
return `const routeModules = import.meta.glob(${JSON.stringify(
|
|
373
|
-
const routePrefix = ${JSON.stringify(
|
|
416
|
+
const o = Pt(t, n), r = Mt(t);
|
|
417
|
+
return `const routeModules = import.meta.glob(${JSON.stringify(o)});
|
|
418
|
+
const routePrefix = ${JSON.stringify(r)};
|
|
374
419
|
${e ? "export " : ""}const routes = Object.fromEntries(
|
|
375
420
|
Object.entries(routeModules).map(([file, load]) => [
|
|
376
421
|
\`./routes/\${file.slice(routePrefix.length)}\`,
|
|
@@ -378,120 +423,241 @@ ${e ? "export " : ""}const routes = Object.fromEntries(
|
|
|
378
423
|
]),
|
|
379
424
|
);`;
|
|
380
425
|
}
|
|
381
|
-
const
|
|
382
|
-
function
|
|
383
|
-
const n = `/${t.replace(/^\/|\/$/g, "")}`,
|
|
384
|
-
return e ||
|
|
385
|
-
...
|
|
386
|
-
`!${n}/${
|
|
387
|
-
`!${n}/**/${
|
|
426
|
+
const Ft = ["@middleware.ts", "@policy.ts"];
|
|
427
|
+
function Pt(t, e) {
|
|
428
|
+
const n = `/${t.replace(/^\/|\/$/g, "")}`, o = [`${n}/**/*.{ts,tsx}`];
|
|
429
|
+
return e || o.push(
|
|
430
|
+
...Ft.flatMap((r) => [
|
|
431
|
+
`!${n}/${r}`,
|
|
432
|
+
`!${n}/**/${r}`
|
|
388
433
|
])
|
|
389
|
-
),
|
|
434
|
+
), o;
|
|
390
435
|
}
|
|
391
|
-
function
|
|
436
|
+
function Mt(t) {
|
|
392
437
|
return `/${t.replace(/^\/|\/$/g, "")}/`;
|
|
393
438
|
}
|
|
394
|
-
function
|
|
439
|
+
function Ct(t, e) {
|
|
395
440
|
if (e.styles === !1)
|
|
396
441
|
return "";
|
|
397
|
-
const n = e.styles ?? "src/styles.css",
|
|
398
|
-
return
|
|
442
|
+
const n = e.styles ?? "src/styles.css", o = p(t, n);
|
|
443
|
+
return U(o) ? `import ${JSON.stringify(`/${n.replace(/^\/+/, "")}`)};` : "";
|
|
399
444
|
}
|
|
400
|
-
function
|
|
445
|
+
function Tt(t, e) {
|
|
401
446
|
return {
|
|
402
447
|
dev: !0,
|
|
403
|
-
ssr:
|
|
404
|
-
transformDocument:
|
|
405
|
-
renderPage: async (n,
|
|
448
|
+
ssr: X(t),
|
|
449
|
+
transformDocument: e,
|
|
450
|
+
renderPage: async (n, o) => {
|
|
406
451
|
if (n.render.mode === "streaming")
|
|
407
|
-
return await
|
|
408
|
-
...
|
|
409
|
-
clientEntry:
|
|
410
|
-
transformDocument:
|
|
452
|
+
return await ft(n, {
|
|
453
|
+
...o,
|
|
454
|
+
clientEntry: v,
|
|
455
|
+
transformDocument: e
|
|
411
456
|
});
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
clientEntry: `/${g}`
|
|
457
|
+
const r = await e(
|
|
458
|
+
it(n, {
|
|
459
|
+
...o,
|
|
460
|
+
clientEntry: v
|
|
417
461
|
})
|
|
418
462
|
);
|
|
419
|
-
return new Response(
|
|
463
|
+
return new Response(r, {
|
|
420
464
|
headers: { "content-type": "text/html; charset=utf-8" }
|
|
421
465
|
});
|
|
422
466
|
}
|
|
423
467
|
};
|
|
424
468
|
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
469
|
+
function j(t, e) {
|
|
470
|
+
const n = x(), o = x();
|
|
471
|
+
return {
|
|
472
|
+
nonce: n,
|
|
473
|
+
transform: async (r) => {
|
|
474
|
+
const s = jt(r, o), a = await t.transformIndexHtml("/", s);
|
|
475
|
+
return A(
|
|
476
|
+
A(a, o),
|
|
477
|
+
e,
|
|
478
|
+
n
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
function jt(t, e) {
|
|
484
|
+
const n = t.toLowerCase();
|
|
485
|
+
let o = 0, r = "";
|
|
486
|
+
for (; o < t.length; ) {
|
|
487
|
+
const s = t.indexOf("<", o);
|
|
488
|
+
if (s === -1)
|
|
489
|
+
return r + t.slice(o);
|
|
490
|
+
if (r += t.slice(o, s), n.startsWith("<!--", s)) {
|
|
491
|
+
const c = n.indexOf("-->", s + 4), l = c === -1 ? t.length : c + 3;
|
|
492
|
+
r += t.slice(s, l), o = l;
|
|
493
|
+
continue;
|
|
494
|
+
}
|
|
495
|
+
const a = n.slice(s).match(/^<\s*(script|style|link)\b/)?.[1];
|
|
496
|
+
if (!a) {
|
|
497
|
+
r += "<", o = s + 1;
|
|
498
|
+
continue;
|
|
499
|
+
}
|
|
500
|
+
const i = At(t, s);
|
|
501
|
+
if (i === -1)
|
|
502
|
+
return r + t.slice(s);
|
|
503
|
+
const u = t.slice(s, i + 1);
|
|
504
|
+
if (r += /(?:^|\s)nonce(?:\s|=|>)/i.test(u) ? u : Wt(u, e), o = i + 1, a === "script" || a === "style") {
|
|
505
|
+
const c = n.indexOf(`</${a}`, o);
|
|
506
|
+
if (c === -1)
|
|
507
|
+
return r + t.slice(o);
|
|
508
|
+
r += t.slice(o, c), o = c;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
return r;
|
|
512
|
+
}
|
|
513
|
+
function At(t, e) {
|
|
514
|
+
let n;
|
|
515
|
+
for (let o = e + 1; o < t.length; o++) {
|
|
516
|
+
const r = t[o];
|
|
517
|
+
if (n) {
|
|
518
|
+
r === n && (n = void 0);
|
|
519
|
+
continue;
|
|
520
|
+
}
|
|
521
|
+
if (r === '"' || r === "'")
|
|
522
|
+
n = r;
|
|
523
|
+
else if (r === ">")
|
|
524
|
+
return o;
|
|
525
|
+
}
|
|
526
|
+
return -1;
|
|
527
|
+
}
|
|
528
|
+
function Wt(t, e) {
|
|
529
|
+
const n = /\/\s*>$/.test(t) ? t.lastIndexOf("/") : t.length - 1;
|
|
530
|
+
return `${t.slice(0, n)} nonce="${e}"${t.slice(n)}`;
|
|
531
|
+
}
|
|
532
|
+
function A(t, e, n) {
|
|
533
|
+
const o = new RegExp(
|
|
534
|
+
`(\\snonce\\s*=\\s*)(["'])${K(e)}\\2`,
|
|
535
|
+
"g"
|
|
536
|
+
);
|
|
537
|
+
return t.replace(
|
|
538
|
+
o,
|
|
539
|
+
n ? `$1"${n}"` : ""
|
|
432
540
|
);
|
|
433
|
-
return r[_] = a, a;
|
|
434
541
|
}
|
|
435
|
-
function
|
|
542
|
+
function W(t, e) {
|
|
543
|
+
const n = t.headers.get("content-type"), o = t.headers.get("content-security-policy");
|
|
544
|
+
if (!n?.toLowerCase().startsWith("text/html") || !o)
|
|
545
|
+
return;
|
|
546
|
+
const r = `'nonce-${e}'`, s = V(
|
|
547
|
+
o,
|
|
548
|
+
["script-src-elem", "script-src"],
|
|
549
|
+
"script-src",
|
|
550
|
+
r
|
|
551
|
+
), a = Vt(
|
|
552
|
+
s,
|
|
553
|
+
["style-src-elem", "style-src"]
|
|
554
|
+
) ? s : V(
|
|
555
|
+
s,
|
|
556
|
+
["style-src-elem", "style-src"],
|
|
557
|
+
"style-src",
|
|
558
|
+
r
|
|
559
|
+
);
|
|
560
|
+
t.headers.set("content-security-policy", a), t.headers.set("cache-control", "private, no-store");
|
|
561
|
+
}
|
|
562
|
+
function V(t, e, n, o) {
|
|
563
|
+
const r = t.split(";").map((l) => l.trim()), s = Q(r, e), a = r.find(
|
|
564
|
+
(l) => l.split(/\s+/, 1)[0]?.toLowerCase() === "default-src"
|
|
565
|
+
);
|
|
566
|
+
if (s === -1 && !a) return t;
|
|
567
|
+
const [i, ...u] = (s === -1 ? a : r[s]).split(/\s+/), c = [
|
|
568
|
+
s === -1 ? n : i,
|
|
569
|
+
.../* @__PURE__ */ new Set([
|
|
570
|
+
...u.filter((l) => l !== "'none'"),
|
|
571
|
+
o
|
|
572
|
+
])
|
|
573
|
+
].join(" ");
|
|
574
|
+
return s === -1 ? r.push(c) : r[s] = c, r.join("; ");
|
|
575
|
+
}
|
|
576
|
+
function Vt(t, e) {
|
|
577
|
+
const n = t.split(";").map((a) => a.trim()), o = Q(n, e), s = (o === -1 ? n.find(
|
|
578
|
+
(a) => a.split(/\s+/, 1)[0]?.toLowerCase() === "default-src"
|
|
579
|
+
) : n[o])?.split(/\s+/).slice(1) ?? [];
|
|
580
|
+
return s.includes("'unsafe-inline'") && !s.some((a) => /^'(?:nonce-|sha(?:256|384|512)-)/i.test(a));
|
|
581
|
+
}
|
|
582
|
+
function Q(t, e) {
|
|
583
|
+
for (const n of e) {
|
|
584
|
+
const o = t.findIndex(
|
|
585
|
+
(r) => r.split(/\s+/, 1)[0]?.toLowerCase() === n
|
|
586
|
+
);
|
|
587
|
+
if (o !== -1) return o;
|
|
588
|
+
}
|
|
589
|
+
return -1;
|
|
590
|
+
}
|
|
591
|
+
const L = Symbol.for("demiurge.devManifest");
|
|
592
|
+
async function k(t, e, n) {
|
|
593
|
+
const o = e, r = o[L];
|
|
594
|
+
if (r)
|
|
595
|
+
return r;
|
|
596
|
+
const s = lt(
|
|
597
|
+
await Kt(t, n)
|
|
598
|
+
);
|
|
599
|
+
return o[L] = s, s;
|
|
600
|
+
}
|
|
601
|
+
function X(t) {
|
|
436
602
|
return {
|
|
437
|
-
clientEntry:
|
|
603
|
+
clientEntry: v,
|
|
438
604
|
lang: t.document?.lang,
|
|
439
605
|
title: t.document?.title
|
|
440
606
|
};
|
|
441
607
|
}
|
|
442
|
-
function
|
|
608
|
+
function Lt(t, e) {
|
|
443
609
|
return {
|
|
444
|
-
...
|
|
610
|
+
...X(t),
|
|
445
611
|
dev: !0,
|
|
446
|
-
transformDocument:
|
|
612
|
+
transformDocument: e
|
|
447
613
|
};
|
|
448
614
|
}
|
|
449
|
-
const
|
|
450
|
-
function
|
|
451
|
-
|
|
615
|
+
const H = /* @__PURE__ */ new Set();
|
|
616
|
+
function kt(t, e) {
|
|
617
|
+
H.has(e) || t.fallbacks.notFound.some(
|
|
452
618
|
(n) => n.fileSegments.length === 0
|
|
453
|
-
) || (
|
|
619
|
+
) || (H.add(e), console.warn(Yt(nt(e, "@not-found.tsx"))));
|
|
454
620
|
}
|
|
455
|
-
async function
|
|
456
|
-
const n = e.routesDir ?? "src/routes",
|
|
457
|
-
if (!
|
|
621
|
+
async function Ht(t, e = {}) {
|
|
622
|
+
const n = e.routesDir ?? "src/routes", o = p(t, n);
|
|
623
|
+
if (!U(o))
|
|
458
624
|
return;
|
|
459
|
-
const
|
|
460
|
-
if (
|
|
461
|
-
(
|
|
462
|
-
).some((
|
|
625
|
+
const r = await Z(o);
|
|
626
|
+
if (r.map(
|
|
627
|
+
(i) => g(o, i).split($).join("/")
|
|
628
|
+
).some((i) => /^@not-found\.tsx?$/.test(i)))
|
|
463
629
|
return;
|
|
464
|
-
const
|
|
465
|
-
if (
|
|
630
|
+
const a = await Jt(r);
|
|
631
|
+
if (a)
|
|
466
632
|
throw new Error(
|
|
467
|
-
|
|
633
|
+
Gt(
|
|
468
634
|
n,
|
|
469
|
-
|
|
635
|
+
g(o, a).split($).join("/")
|
|
470
636
|
)
|
|
471
637
|
);
|
|
472
638
|
}
|
|
473
|
-
async function
|
|
639
|
+
async function Jt(t) {
|
|
474
640
|
for (const e of t)
|
|
475
|
-
if (!
|
|
641
|
+
if (!g(G(e), e).startsWith("@") && Bt(await rt(e, "utf8")))
|
|
476
642
|
return e;
|
|
477
643
|
}
|
|
478
|
-
const
|
|
479
|
-
`import\\s*\\{([^}]*)\\}\\s*from\\s*["']${
|
|
644
|
+
const Ut = h.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), J = new RegExp(
|
|
645
|
+
`import\\s*\\{([^}]*)\\}\\s*from\\s*["']${Ut}["']`,
|
|
480
646
|
"g"
|
|
481
647
|
);
|
|
482
|
-
function
|
|
483
|
-
const e = [...t.matchAll(
|
|
484
|
-
(
|
|
485
|
-
const [
|
|
486
|
-
return
|
|
648
|
+
function Bt(t) {
|
|
649
|
+
const e = [...t.matchAll(J)].flatMap(
|
|
650
|
+
(o) => o[1].split(",").flatMap((r) => {
|
|
651
|
+
const [s, a] = r.trim().split(/\s+as\s+/);
|
|
652
|
+
return s.replace(/^type\s+/, "") === "page" ? [a ?? s] : [];
|
|
487
653
|
})
|
|
488
654
|
);
|
|
489
655
|
if (e.length === 0)
|
|
490
656
|
return !1;
|
|
491
|
-
const n = t.replace(
|
|
492
|
-
return e.some((
|
|
657
|
+
const n = t.replace(J, "");
|
|
658
|
+
return e.some((o) => new RegExp(`\\b${o}\\s*\\(`).test(n));
|
|
493
659
|
}
|
|
494
|
-
function
|
|
660
|
+
function Gt(t, e) {
|
|
495
661
|
return `Demiurge will not build an app with page routes and no ${t}/@not-found.tsx.
|
|
496
662
|
|
|
497
663
|
"${e}" declares a page, so a browser can reach a path this app does not serve. Decide what that looks like rather than shipping the framework built-in.
|
|
@@ -504,7 +670,7 @@ Create ${t}/@not-found.tsx:
|
|
|
504
670
|
|
|
505
671
|
It renders inside the layouts above the requested path. Opt out with "export const layout = false".`;
|
|
506
672
|
}
|
|
507
|
-
function
|
|
673
|
+
function Yt(t) {
|
|
508
674
|
return `Demiurge is serving its built-in 404 because ${t} does not exist.
|
|
509
675
|
|
|
510
676
|
Create it before building for production:
|
|
@@ -514,67 +680,67 @@ Create it before building for production:
|
|
|
514
680
|
}
|
|
515
681
|
`;
|
|
516
682
|
}
|
|
517
|
-
function
|
|
683
|
+
function qt({
|
|
518
684
|
entrySrc: t,
|
|
519
685
|
lang: e,
|
|
520
686
|
links: n,
|
|
521
|
-
metadata:
|
|
522
|
-
nonce:
|
|
523
|
-
scripts:
|
|
524
|
-
styles:
|
|
525
|
-
title:
|
|
687
|
+
metadata: o,
|
|
688
|
+
nonce: r,
|
|
689
|
+
scripts: s,
|
|
690
|
+
styles: a,
|
|
691
|
+
title: i
|
|
526
692
|
}) {
|
|
527
|
-
return
|
|
693
|
+
return st({
|
|
528
694
|
entrySrc: t,
|
|
529
695
|
lang: e,
|
|
530
696
|
links: n,
|
|
531
|
-
metadata:
|
|
532
|
-
nonce:
|
|
533
|
-
scripts:
|
|
534
|
-
styles:
|
|
535
|
-
title:
|
|
697
|
+
metadata: o,
|
|
698
|
+
nonce: r,
|
|
699
|
+
scripts: s,
|
|
700
|
+
styles: a,
|
|
701
|
+
title: i
|
|
536
702
|
});
|
|
537
703
|
}
|
|
538
|
-
async function
|
|
539
|
-
const n =
|
|
704
|
+
async function w(t, e) {
|
|
705
|
+
const n = p(t, e.routesDir ?? "src/routes"), o = p(
|
|
540
706
|
t,
|
|
541
|
-
typeof e.typedRoutes == "object" ? e.typedRoutes.outputFile ??
|
|
707
|
+
typeof e.typedRoutes == "object" ? e.typedRoutes.outputFile ?? C : C
|
|
542
708
|
);
|
|
543
|
-
await
|
|
709
|
+
await dt({ outputFile: o, routesDir: n });
|
|
544
710
|
}
|
|
545
|
-
function
|
|
711
|
+
function N(t, e) {
|
|
546
712
|
return e.startsWith(t) && /\.tsx?$/.test(e);
|
|
547
713
|
}
|
|
548
|
-
async function
|
|
549
|
-
const n = await
|
|
550
|
-
for (const
|
|
551
|
-
const
|
|
552
|
-
|
|
714
|
+
async function Kt(t, e) {
|
|
715
|
+
const n = await Z(e), o = {};
|
|
716
|
+
for (const r of n) {
|
|
717
|
+
const s = Qt(e, r);
|
|
718
|
+
o[s] = async () => await t.ssrLoadModule(r);
|
|
553
719
|
}
|
|
554
|
-
return
|
|
720
|
+
return o;
|
|
555
721
|
}
|
|
556
|
-
async function
|
|
557
|
-
const
|
|
558
|
-
return
|
|
722
|
+
async function zt(t, e, n = {}) {
|
|
723
|
+
const o = new URL(e.url);
|
|
724
|
+
return ct(t.routes, o.pathname) ? await ut(t, e, n) : "next";
|
|
559
725
|
}
|
|
560
|
-
async function
|
|
561
|
-
return (await
|
|
726
|
+
async function Z(t) {
|
|
727
|
+
return (await B(t, {
|
|
562
728
|
recursive: !0,
|
|
563
729
|
withFileTypes: !0
|
|
564
|
-
})).filter((n) => n.isFile() && /\.tsx?$/.test(n.name)).map((n) =>
|
|
730
|
+
})).filter((n) => n.isFile() && /\.tsx?$/.test(n.name)).map((n) => p(n.parentPath, n.name));
|
|
565
731
|
}
|
|
566
|
-
function
|
|
567
|
-
return `./routes/${
|
|
732
|
+
function Qt(t, e) {
|
|
733
|
+
return `./routes/${g(t, e).split($).join("/")}`;
|
|
568
734
|
}
|
|
569
735
|
export {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
736
|
+
ue as demiurge,
|
|
737
|
+
Ht as unstable_assertRootNotFoundRoute,
|
|
738
|
+
Ot as unstable_createClientEntrySource,
|
|
739
|
+
Kt as unstable_createDevRouteImporters,
|
|
740
|
+
qt as unstable_createDocumentHtml,
|
|
741
|
+
_t as unstable_createServerEntrySource,
|
|
742
|
+
Bt as unstable_declaresPageRoute,
|
|
743
|
+
zt as unstable_handleDevRequest,
|
|
744
|
+
bt as unstable_stripClientPageData
|
|
579
745
|
};
|
|
580
746
|
//# sourceMappingURL=index.js.map
|