@demiurgejs/core 0.2.0-beta.3 → 0.2.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/README.md +36 -11
  2. package/bin/demiurge.mjs +47 -13
  3. package/dist/adapter/index.d.ts +1 -1
  4. package/dist/adapter/index.d.ts.map +1 -1
  5. package/dist/browser/file-router.d.ts +388 -5
  6. package/dist/browser/file-router.d.ts.map +1 -1
  7. package/dist/browser/focus.d.ts +20 -0
  8. package/dist/browser/focus.d.ts.map +1 -0
  9. package/dist/browser/index.d.ts +7 -1
  10. package/dist/browser/index.d.ts.map +1 -1
  11. package/dist/browser/mutation-action.d.ts +81 -0
  12. package/dist/browser/mutation-action.d.ts.map +1 -0
  13. package/dist/chunks/document-shell-9GPwtcTt.js +36 -0
  14. package/dist/chunks/document-shell-9GPwtcTt.js.map +1 -0
  15. package/dist/chunks/{image-codec-Di53WpcH.js → image-codec-Dh1POFhE.js} +2 -2
  16. package/dist/chunks/{image-codec-Di53WpcH.js.map → image-codec-Dh1POFhE.js.map} +1 -1
  17. package/dist/chunks/{images-Edar3eU1.js → images-CG7ZzayG.js} +99 -91
  18. package/dist/chunks/images-CG7ZzayG.js.map +1 -0
  19. package/dist/chunks/index-0MNiR_wo.js +833 -0
  20. package/dist/chunks/index-0MNiR_wo.js.map +1 -0
  21. package/dist/chunks/manifest-vO6c0G0W.js +19 -0
  22. package/dist/chunks/manifest-vO6c0G0W.js.map +1 -0
  23. package/dist/chunks/plugin-BZauDxRY.js +2310 -0
  24. package/dist/chunks/plugin-BZauDxRY.js.map +1 -0
  25. package/dist/chunks/session-store-ChModVcq.js +92 -0
  26. package/dist/chunks/session-store-ChModVcq.js.map +1 -0
  27. package/dist/chunks/static-files-ehaD1kE7.js +51 -0
  28. package/dist/chunks/static-files-ehaD1kE7.js.map +1 -0
  29. package/dist/chunks/streaming-GYIsVTQH.js +560 -0
  30. package/dist/chunks/streaming-GYIsVTQH.js.map +1 -0
  31. package/dist/chunks/testing-CUwGj2ie.js +4751 -0
  32. package/dist/chunks/testing-CUwGj2ie.js.map +1 -0
  33. package/dist/chunks/vite-QoqrGl6f.js +259 -0
  34. package/dist/chunks/vite-QoqrGl6f.js.map +1 -0
  35. package/dist/cli.d.ts +19 -25
  36. package/dist/cli.d.ts.map +1 -1
  37. package/dist/cli.js +289 -128
  38. package/dist/cli.js.map +1 -1
  39. package/dist/config/define.d.ts +3 -0
  40. package/dist/config/define.d.ts.map +1 -0
  41. package/dist/config/index.d.ts +7 -0
  42. package/dist/config/index.d.ts.map +1 -0
  43. package/dist/config/index.js +78 -0
  44. package/dist/config/index.js.map +1 -0
  45. package/dist/config/load.d.ts +12 -0
  46. package/dist/config/load.d.ts.map +1 -0
  47. package/dist/config/types.d.ts +74 -0
  48. package/dist/config/types.d.ts.map +1 -0
  49. package/dist/config/validate.d.ts +9 -0
  50. package/dist/config/validate.d.ts.map +1 -0
  51. package/dist/config/vite.d.ts +12 -0
  52. package/dist/config/vite.d.ts.map +1 -0
  53. package/dist/data/cache.d.ts +2 -0
  54. package/dist/data/cache.d.ts.map +1 -1
  55. package/dist/data/idempotency.d.ts.map +1 -1
  56. package/dist/deployment/testing.d.ts +25 -0
  57. package/dist/deployment/testing.d.ts.map +1 -0
  58. package/dist/deployment/testing.js +171 -0
  59. package/dist/deployment/testing.js.map +1 -0
  60. package/dist/document/hydration.d.ts +9 -0
  61. package/dist/document/hydration.d.ts.map +1 -1
  62. package/dist/document/index.d.ts +4 -2
  63. package/dist/document/index.d.ts.map +1 -1
  64. package/dist/document/metadata.d.ts +8 -0
  65. package/dist/document/metadata.d.ts.map +1 -1
  66. package/dist/document/navigation.d.ts +28 -0
  67. package/dist/document/navigation.d.ts.map +1 -0
  68. package/dist/document/render.d.ts +3 -1
  69. package/dist/document/render.d.ts.map +1 -1
  70. package/dist/document/seo.d.ts.map +1 -1
  71. package/dist/edge/assets.d.ts.map +1 -1
  72. package/dist/edge/index.js +55 -73
  73. package/dist/edge/index.js.map +1 -1
  74. package/dist/index.d.ts +12 -10
  75. package/dist/index.d.ts.map +1 -1
  76. package/dist/index.js +1883 -692
  77. package/dist/index.js.map +1 -1
  78. package/dist/inspect/command.d.ts +28 -0
  79. package/dist/inspect/command.d.ts.map +1 -0
  80. package/dist/inspect/index.d.ts +9 -0
  81. package/dist/inspect/index.d.ts.map +1 -0
  82. package/dist/inspect/redact.d.ts +35 -0
  83. package/dist/inspect/redact.d.ts.map +1 -0
  84. package/dist/inspect/report.d.ts +24 -0
  85. package/dist/inspect/report.d.ts.map +1 -0
  86. package/dist/inspect/types.d.ts +102 -0
  87. package/dist/inspect/types.d.ts.map +1 -0
  88. package/dist/internal/testing.js +5 -5
  89. package/dist/kv/index.d.ts +2 -0
  90. package/dist/kv/index.d.ts.map +1 -1
  91. package/dist/kv/index.js +170 -73
  92. package/dist/kv/index.js.map +1 -1
  93. package/dist/kv/session-store.d.ts +20 -0
  94. package/dist/kv/session-store.d.ts.map +1 -0
  95. package/dist/manifest.d.ts +10 -0
  96. package/dist/manifest.d.ts.map +1 -0
  97. package/dist/node/http.d.ts +5 -0
  98. package/dist/node/http.d.ts.map +1 -1
  99. package/dist/node/image.d.ts.map +1 -1
  100. package/dist/node/index.d.ts +4 -1
  101. package/dist/node/index.d.ts.map +1 -1
  102. package/dist/node/index.js +257 -182
  103. package/dist/node/index.js.map +1 -1
  104. package/dist/node/serve.d.ts +47 -0
  105. package/dist/node/serve.d.ts.map +1 -0
  106. package/dist/node/static.d.ts.map +1 -1
  107. package/dist/platform/fonts.d.ts.map +1 -1
  108. package/dist/platform/image-url.d.ts.map +1 -1
  109. package/dist/platform/url.d.ts +19 -0
  110. package/dist/platform/url.d.ts.map +1 -0
  111. package/dist/platform/web-vitals.d.ts.map +1 -1
  112. package/dist/redis/index.d.ts +2 -0
  113. package/dist/redis/index.d.ts.map +1 -1
  114. package/dist/redis/index.js +186 -69
  115. package/dist/redis/index.js.map +1 -1
  116. package/dist/redis/session-store.d.ts +9 -0
  117. package/dist/redis/session-store.d.ts.map +1 -0
  118. package/dist/route/index.d.ts +3 -2
  119. package/dist/route/index.d.ts.map +1 -1
  120. package/dist/route/mutation.d.ts +97 -0
  121. package/dist/route/mutation.d.ts.map +1 -0
  122. package/dist/route/serialization.d.ts +24 -0
  123. package/dist/route/serialization.d.ts.map +1 -0
  124. package/dist/route/types.d.ts +6 -1
  125. package/dist/route/types.d.ts.map +1 -1
  126. package/dist/route/webhook.d.ts +6 -1
  127. package/dist/route/webhook.d.ts.map +1 -1
  128. package/dist/router/manifest.d.ts +8 -0
  129. package/dist/router/manifest.d.ts.map +1 -1
  130. package/dist/router/navigation-data.d.ts +9 -1
  131. package/dist/router/navigation-data.d.ts.map +1 -1
  132. package/dist/routing/generate.d.ts +3 -0
  133. package/dist/routing/generate.d.ts.map +1 -1
  134. package/dist/routing/index.d.ts +3 -1
  135. package/dist/routing/index.d.ts.map +1 -1
  136. package/dist/routing/locale.d.ts +43 -0
  137. package/dist/routing/locale.d.ts.map +1 -0
  138. package/dist/routing/types.d.ts +12 -0
  139. package/dist/routing/types.d.ts.map +1 -1
  140. package/dist/security/audit.d.ts +2 -1
  141. package/dist/security/audit.d.ts.map +1 -1
  142. package/dist/security/authorization.d.ts +36 -0
  143. package/dist/security/authorization.d.ts.map +1 -0
  144. package/dist/security/cookie-session.d.ts +43 -0
  145. package/dist/security/cookie-session.d.ts.map +1 -0
  146. package/dist/security/csrf.d.ts +1 -1
  147. package/dist/security/csrf.d.ts.map +1 -1
  148. package/dist/security/env-startup.d.ts +13 -0
  149. package/dist/security/env-startup.d.ts.map +1 -0
  150. package/dist/security/env.d.ts +49 -11
  151. package/dist/security/env.d.ts.map +1 -1
  152. package/dist/security/exceptions.d.ts +29 -0
  153. package/dist/security/exceptions.d.ts.map +1 -0
  154. package/dist/security/finding-codes.d.ts +56 -0
  155. package/dist/security/finding-codes.d.ts.map +1 -0
  156. package/dist/security/index.d.ts +14 -3
  157. package/dist/security/index.d.ts.map +1 -1
  158. package/dist/security/policy.d.ts +2 -5
  159. package/dist/security/policy.d.ts.map +1 -1
  160. package/dist/security/report.d.ts +2 -1
  161. package/dist/security/report.d.ts.map +1 -1
  162. package/dist/security/request.d.ts +1 -0
  163. package/dist/security/request.d.ts.map +1 -1
  164. package/dist/security/session-manager.d.ts +32 -0
  165. package/dist/security/session-manager.d.ts.map +1 -0
  166. package/dist/security/session-store.d.ts +51 -0
  167. package/dist/security/session-store.d.ts.map +1 -0
  168. package/dist/security/testing.d.ts +10 -0
  169. package/dist/security/testing.d.ts.map +1 -0
  170. package/dist/security/testing.js +145 -0
  171. package/dist/security/testing.js.map +1 -0
  172. package/dist/security/types.d.ts +139 -5
  173. package/dist/security/types.d.ts.map +1 -1
  174. package/dist/security/upload.d.ts +3 -3
  175. package/dist/security/upload.d.ts.map +1 -1
  176. package/dist/security/verification.d.ts.map +1 -1
  177. package/dist/server/document-shell.d.ts.map +1 -1
  178. package/dist/server/errors.d.ts +1 -0
  179. package/dist/server/errors.d.ts.map +1 -1
  180. package/dist/server/index.d.ts +1 -0
  181. package/dist/server/index.d.ts.map +1 -1
  182. package/dist/server/not-found.d.ts +1 -0
  183. package/dist/server/not-found.d.ts.map +1 -1
  184. package/dist/server/render-tree.d.ts.map +1 -1
  185. package/dist/server/request-handler.d.ts +7 -2
  186. package/dist/server/request-handler.d.ts.map +1 -1
  187. package/dist/server/request-metadata.d.ts +1 -0
  188. package/dist/server/request-metadata.d.ts.map +1 -1
  189. package/dist/server/ssr.d.ts +2 -0
  190. package/dist/server/ssr.d.ts.map +1 -1
  191. package/dist/server-only/browser.d.ts +2 -0
  192. package/dist/server-only/browser.d.ts.map +1 -0
  193. package/dist/server-only/browser.js +4 -0
  194. package/dist/server-only/browser.js.map +1 -0
  195. package/dist/server-only/index.d.ts +2 -0
  196. package/dist/server-only/index.d.ts.map +1 -0
  197. package/dist/server-only/index.js +2 -0
  198. package/dist/server-only/index.js.map +1 -0
  199. package/dist/static/index.d.ts +2 -0
  200. package/dist/static/index.d.ts.map +1 -1
  201. package/dist/static/index.js +380 -363
  202. package/dist/static/index.js.map +1 -1
  203. package/dist/static/preview.d.ts.map +1 -1
  204. package/dist/static/vercel.d.ts +11 -2
  205. package/dist/static/vercel.d.ts.map +1 -1
  206. package/dist/static-files.d.ts +12 -0
  207. package/dist/static-files.d.ts.map +1 -1
  208. package/dist/type-guards.d.ts +19 -0
  209. package/dist/type-guards.d.ts.map +1 -0
  210. package/dist/vite/env-boundary.d.ts +14 -0
  211. package/dist/vite/env-boundary.d.ts.map +1 -0
  212. package/dist/vite/index.d.ts +13 -6
  213. package/dist/vite/index.d.ts.map +1 -1
  214. package/dist/vite/index.js +29 -1560
  215. package/dist/vite/index.js.map +1 -1
  216. package/dist/vite/plugin.d.ts +24 -3
  217. package/dist/vite/plugin.d.ts.map +1 -1
  218. package/dist/vite/policy-verification.d.ts +33 -2
  219. package/dist/vite/policy-verification.d.ts.map +1 -1
  220. package/dist/vite/route-audit.d.ts +14 -2
  221. package/dist/vite/route-audit.d.ts.map +1 -1
  222. package/dist/vite/server-only-boundary.d.ts +8 -0
  223. package/dist/vite/server-only-boundary.d.ts.map +1 -0
  224. package/package.json +24 -6
  225. package/dist/chunks/document-shell-WoM8yZlR.js +0 -35
  226. package/dist/chunks/document-shell-WoM8yZlR.js.map +0 -1
  227. package/dist/chunks/images-Edar3eU1.js.map +0 -1
  228. package/dist/chunks/request-metadata-DaIYq4Ea.js +0 -677
  229. package/dist/chunks/request-metadata-DaIYq4Ea.js.map +0 -1
  230. package/dist/chunks/static-files-DUjHw-4H.js +0 -11
  231. package/dist/chunks/static-files-DUjHw-4H.js.map +0 -1
  232. package/dist/chunks/streaming-D0fGAuiO.js +0 -469
  233. package/dist/chunks/streaming-D0fGAuiO.js.map +0 -1
  234. package/dist/chunks/testing-CRflAw4X.js +0 -3475
  235. package/dist/chunks/testing-CRflAw4X.js.map +0 -1
  236. package/dist/route/action.d.ts +0 -33
  237. package/dist/route/action.d.ts.map +0 -1
@@ -1,1563 +1,32 @@
1
- import { existsSync as re } from "node:fs";
2
- import { mkdir as Ve, writeFile as We, readdir as De, readFile as Pe } from "node:fs/promises";
3
- import { dirname as ne, resolve as b, relative as N, sep as O, join as He } from "node:path";
4
- import Ue from "magic-string";
5
- import { transformWithEsbuild as Je, parseAst as oe } from "vite";
6
- import { e as qe, f as ze } from "../chunks/request-metadata-DaIYq4Ea.js";
7
- import { v as Ge, f as Be, g as Ke, s as U, l as se, i as Ye, j as Q, t as Qe, k as Xe, n as Oe, M as Ze, o as et, p as z, q as ae, u as tt, w as rt, x as nt, r as ot, h as it, y as st } from "../chunks/testing-CRflAw4X.js";
8
- import "react";
9
- import "react-dom/server";
10
- import "react/jsx-runtime";
11
- import { c as at, t as ce, U as ue, w as le, b as k, d as ct, e as ut } from "../chunks/streaming-D0fGAuiO.js";
12
- import { p as lt } from "../chunks/images-Edar3eU1.js";
13
- const P = "@demiurgejs/core";
14
- async function dt(e) {
15
- const t = await ft(e.routesDir), r = t.map((i) => mt(e, i)).filter((i) => !!i), o = t.map((i) => pt(e.routesDir, i, r)).filter((i) => !!i).sort((i, s) => i.pattern.localeCompare(s.pattern)), n = ht(o, r);
16
- return await Ve(ne(e.outputFile), { recursive: !0 }), await We(e.outputFile, n), {
17
- routes: o,
18
- source: n
19
- };
20
- }
21
- async function ft(e) {
22
- return (await De(e, {
23
- recursive: !0,
24
- withFileTypes: !0
25
- })).filter((r) => r.isFile() && /\.tsx?$/.test(r.name)).map((r) => b(r.parentPath, r.name));
26
- }
27
- function pt(e, t, r) {
28
- const n = N(e, t).split(O).join("/").replace(/\.tsx?$/, "").split("/");
29
- if (n.at(-1)?.startsWith("@"))
30
- return null;
31
- const s = n.flatMap((c) => de(c) ? [] : c === "index" ? [] : c.startsWith("[...") && c.endsWith("]") ? [c] : c.startsWith("[") && c.endsWith("]") ? [c] : [c]), a = n.flatMap((c) => de(c) ? [] : c.startsWith("[...") && c.endsWith("]") ? [c.slice(4, -1)] : c.startsWith("[") && c.endsWith("]") ? [c.slice(1, -1)] : []);
32
- return {
33
- contextMiddleware: r.filter((c) => yt(c.fileSegments, n)).map((c) => r.indexOf(c)),
34
- fileSegments: n,
35
- pathVars: a,
36
- pattern: `/${s.join("/")}`.replace(/\/$/, "") || "/"
37
- };
38
- }
39
- function mt(e, t) {
40
- const o = N(e.routesDir, t).split(O).join("/").replace(/\.tsx?$/, "").split("/");
41
- if (o.at(-1) !== "@middleware")
42
- return null;
43
- let n = N(ne(e.outputFile), t).split(O).join("/").replace(/\.tsx?$/, "");
44
- return n.startsWith(".") || (n = `./${n}`), { file: t, fileSegments: o.slice(0, -1), importPath: n };
45
- }
46
- function yt(e, t) {
47
- return e.every(
48
- (r, o) => t[o] === r
49
- );
50
- }
51
- function de(e) {
52
- return e.startsWith("(") && e.endsWith(")");
53
- }
54
- function ht(e, t) {
55
- return `// Generated by Demiurge. Do not edit by hand.
56
- import "${P}";
57
- import type { MiddlewareContextOf, PathValue } from "${P}";
58
- ${t.map(gt).join(`
59
- `)}
60
-
61
- ${t.map((r, o) => wt(o)).join(`
62
- `)}
63
-
64
- declare module "${P}" {
65
- interface RoutePathVars {
66
- ${e.map(Rt).join(`
67
- `)}
68
- }
69
-
70
- interface RouteConcretePaths {
71
- ${e.map(vt).join(`
72
- `)}
73
- }
74
-
75
- interface RouteRequestContexts {
76
- ${e.map(bt).join(`
77
- `)}
78
- }
79
- }
80
-
81
- export {};
82
- `;
83
- }
84
- function gt(e, t) {
85
- return `type __DemiurgeMiddleware${t} = typeof import(${JSON.stringify(e.importPath)}) extends { middleware?: infer T } ? T : never;`;
86
- }
87
- function wt(e) {
88
- return `type __DemiurgeMiddlewareContext${e} = MiddlewareContextOf<__DemiurgeMiddleware${e}>;`;
89
- }
90
- function Rt(e) {
91
- if (e.pathVars.length === 0)
92
- return ` ${JSON.stringify(e.pattern)}: {};`;
93
- const t = e.pathVars.map((r) => `${r}: PathValue`).join("; ");
94
- return ` ${JSON.stringify(e.pattern)}: { ${t} };`;
95
- }
96
- function vt(e) {
97
- return ` ${JSON.stringify(e.pattern)}: ${$t(e.pattern)};`;
98
- }
99
- function bt(e) {
100
- const t = e.contextMiddleware.map((o) => `__DemiurgeMiddlewareContext${o}`), r = t.length > 0 ? t.join(" & ") : "Record<never, never>";
101
- return ` ${JSON.stringify(e.pattern)}: ${r};`;
102
- }
103
- function $t(e) {
104
- return e.includes("[") ? `\`${e.split(/(\[\.\.\.[^\]]+\]|\[[^\]]+\])/g).filter(Boolean).map((r) => r.startsWith("[") ? "${PathValue}" : St(r)).join("")}\`` : JSON.stringify(e);
105
- }
106
- function St(e) {
107
- return e.replace(/[`$\\]/g, "\\$&");
108
- }
109
- const xt = [
110
- "GET",
111
- "POST",
112
- "PUT",
113
- "PATCH",
114
- "DELETE",
115
- "OPTIONS",
116
- "HEAD"
117
- ], Et = /* @__PURE__ */ new Set([
118
- "action",
119
- "html",
120
- "json",
121
- "jsonl",
122
- "notFound",
123
- "redirect",
124
- "response",
125
- "sse",
126
- "stream",
127
- "text"
128
- ]);
129
- async function Nt(e) {
130
- const t = await Pe(e, "utf8");
131
- return await Dt(t, e);
132
- }
133
- async function Dt(e, t) {
134
- const r = t.endsWith(".tsx") ? "tsx" : "ts", o = await Je(e, t, {
135
- format: "esm",
136
- loader: r,
137
- target: "esnext"
138
- }), n = Pt(o.code);
139
- return Ct(n, t);
140
- }
141
- function Pt(e) {
142
- const t = oe(e), r = jt(t), o = _t(t), n = Ot(t), i = Mt(t), s = {}, a = /* @__PURE__ */ new Set();
143
- let c;
144
- for (const [u, d] of i) {
145
- const h = n.get(d);
146
- if (u === "policy") {
147
- h && (c = Me(h, r, o));
148
- continue;
149
- }
150
- if (!Ft(u) || (a.add(u), !h)) continue;
151
- const D = Tt(h, r, o);
152
- D && (s[u] = D);
153
- }
154
- return { capabilities: s, declaredMethods: a, policy: c };
155
- }
156
- function Ot(e) {
157
- const t = /* @__PURE__ */ new Map();
158
- for (const r of y(e.body)) {
159
- const o = r.type === "ExportNamedDeclaration" ? R(r.declaration) : r;
160
- if (o?.type === "VariableDeclaration")
161
- for (const n of y(o.declarations)) {
162
- const i = T(n.id), s = R(n.init);
163
- i && s && t.set(i, s);
164
- }
165
- }
166
- return t;
167
- }
168
- function Mt(e) {
169
- const t = /* @__PURE__ */ new Map();
170
- for (const r of y(e.body)) {
171
- if (r.type !== "ExportNamedDeclaration") continue;
172
- const o = R(r.declaration);
173
- if (o?.type === "VariableDeclaration")
174
- for (const n of y(o.declarations)) {
175
- const i = T(n.id);
176
- i && t.set(i, i);
177
- }
178
- for (const n of y(r.specifiers)) {
179
- const i = M(n.exported), s = M(n.local);
180
- i && s && t.set(i, s);
181
- }
182
- }
183
- return t;
184
- }
185
- function Tt(e, t, r) {
186
- if (e.type !== "CallExpression") return;
187
- const o = T(e.callee), n = o ? t.get(o) : void 0;
188
- if (!n || !Et.has(n)) return;
189
- const i = y(e.arguments), s = n === "action" ? i[0] : i[1];
190
- if (!s) return {};
191
- const a = fe(s, "cors", r), c = fe(
192
- s,
193
- "security",
194
- r
195
- );
196
- return {
197
- cors: I(a) ? a : void 0,
198
- security: I(c) ? c : void 0
199
- };
200
- }
201
- function fe(e, t, r) {
202
- if (e.type === "Identifier") {
203
- const n = r.get(String(e.name));
204
- return I(n) ? n[t] : g;
205
- }
206
- if (e.type !== "ObjectExpression") return g;
207
- let o;
208
- for (const n of y(e.properties)) {
209
- if (n.type !== "Property" || n.computed) return g;
210
- M(n.key) === t && (o = x(R(n.value), r));
211
- }
212
- return o;
213
- }
214
- function Me(e, t, r) {
215
- if (e.type === "CallExpression") {
216
- const n = T(e.callee);
217
- if (n && t.get(n) === "defineRoutePolicy") {
218
- const i = y(e.arguments)[0];
219
- return i ? Me(i, t, r) : void 0;
220
- }
221
- }
222
- if (e.type !== "ObjectExpression") {
223
- const n = x(e, r);
224
- return I(n) ? n : void 0;
225
- }
226
- const o = {};
227
- for (const n of y(e.properties)) {
228
- if (n.type !== "Property" || n.computed) return;
229
- const i = M(n.key), s = R(n.value);
230
- if (!i || !s) return;
231
- if (i === "document") {
232
- const c = At(s, t, r);
233
- if (!c) return;
234
- o.document = c;
235
- continue;
236
- }
237
- const a = x(s, r);
238
- if (a === g) return;
239
- o[i] = a;
240
- }
241
- return o;
242
- }
243
- function At(e, t, r) {
244
- if (e.type !== "CallExpression") {
245
- const a = x(e, r);
246
- return I(a) ? a : void 0;
247
- }
248
- const o = R(e.callee);
249
- if (o?.type !== "MemberExpression") return;
250
- const n = T(o.object), i = M(o.property);
251
- if (!n || t.get(n) !== "security" || !i)
252
- return;
253
- const s = x(y(e.arguments)[0], r);
254
- if (!(s !== g && s !== void 0 && !I(s))) {
255
- if (i === "api")
256
- return U.api(s);
257
- if (i === "crossOriginIsolated")
258
- return U.crossOriginIsolated(s);
259
- if (i === "static")
260
- return U.static(s);
261
- if (i === "strict")
262
- return U.strict(s);
263
- }
264
- }
265
- function Ct(e, t) {
266
- const r = [], o = new Set(e.declaredMethods);
267
- o.has("GET") && o.add("HEAD"), o.add("OPTIONS");
268
- for (const [n, i] of Object.entries(
269
- e.capabilities
270
- )) {
271
- if (i.cors) {
272
- try {
273
- Ge(i.cors);
274
- } catch (s) {
275
- r.push(q(
276
- "cors-invalid",
277
- t,
278
- ee(s, "The CORS policy is invalid."),
279
- n
280
- ));
281
- }
282
- for (const s of i.cors.methods ?? [])
283
- o.has(s) || r.push(q(
284
- "cors-method-unavailable",
285
- t,
286
- `CORS method ${s} is not available from this route.`,
287
- n
288
- ));
289
- }
290
- pe(i.security, t, n, r);
291
- }
292
- if (pe(e.policy?.security, t, void 0, r), e.policy?.document)
293
- try {
294
- Be(It(e.policy.document), {
295
- nonce: "build-verification-nonce"
296
- });
297
- } catch (n) {
298
- r.push(q(
299
- "security-header-render-failed",
300
- t,
301
- ee(n, "The security headers are invalid.")
302
- ));
303
- }
304
- return r;
305
- }
306
- function It(e) {
307
- const t = e.headers?.reportingEndpoints, r = !!(t && Object.keys(t).length), o = e.csp === !1 ? void 0 : e.csp?.reportTo;
308
- return r || !o ? e : {
309
- ...e,
310
- csp: { ...e.csp, reportTo: void 0 },
311
- headers: t ? { ...e.headers, reportingEndpoints: void 0 } : e.headers
312
- };
313
- }
314
- function pe(e, t, r, o) {
315
- if (e?.rateLimit)
316
- try {
317
- Ke(e.rateLimit);
318
- } catch (n) {
319
- o.push(q(
320
- "rate-limit-invalid",
321
- t,
322
- ee(n, "The rate limit policy is invalid."),
323
- r
324
- ));
325
- }
326
- }
327
- function q(e, t, r, o) {
328
- return { code: e, exportName: o, file: t, message: r, severity: "error" };
329
- }
330
- function jt(e) {
331
- const t = /* @__PURE__ */ new Map();
332
- for (const r of y(e.body))
333
- if (!(r.type !== "ImportDeclaration" || R(r.source)?.value !== "@demiurgejs/core"))
334
- for (const o of y(r.specifiers)) {
335
- if (o.type !== "ImportSpecifier") continue;
336
- const n = T(o.local), i = M(o.imported);
337
- n && i && t.set(n, i);
338
- }
339
- return t;
340
- }
341
- function _t(e) {
342
- const t = /* @__PURE__ */ new Map();
343
- for (const r of y(e.body)) {
344
- const o = r.type === "ExportNamedDeclaration" ? R(r.declaration) : r;
345
- if (o?.type === "VariableDeclaration")
346
- for (const n of y(o.declarations)) {
347
- const i = T(n.id), s = R(n.init);
348
- if (!i || !s) continue;
349
- const a = x(s, t);
350
- a !== g && t.set(i, a);
351
- }
352
- }
353
- return t;
354
- }
355
- const g = Symbol("unresolved");
356
- function x(e, t) {
357
- if (e) {
358
- if (e.type === "Literal") return e.value;
359
- if (e.type === "Identifier")
360
- return e.name === "undefined" ? void 0 : t.has(String(e.name)) ? t.get(String(e.name)) : g;
361
- if (e.type === "TemplateLiteral")
362
- return y(e.expressions).length ? g : y(e.quasis).map((r) => R(r.value)?.cooked ?? "").join("");
363
- if (e.type === "UnaryExpression") {
364
- const r = x(R(e.argument), t);
365
- return typeof r != "number" ? g : e.operator === "-" ? -r : e.operator === "+" ? r : g;
366
- }
367
- if (e.type === "ArrayExpression") {
368
- const r = [];
369
- for (const o of y(e.elements)) {
370
- const n = x(o, t);
371
- if (n === g) return g;
372
- r.push(n);
373
- }
374
- return r;
375
- }
376
- if (e.type === "ObjectExpression") {
377
- const r = {};
378
- for (const o of y(e.properties)) {
379
- if (o.type !== "Property" || o.computed) return g;
380
- const n = M(o.key), i = x(R(o.value), t);
381
- if (!n || i === g) return g;
382
- r[n] = i;
383
- }
384
- return r;
385
- }
386
- return g;
387
- }
388
- }
389
- function Ft(e) {
390
- return xt.includes(e);
391
- }
392
- function ee(e, t) {
393
- return e instanceof Error ? e.message : t;
394
- }
395
- function I(e) {
396
- return !!e && typeof e == "object" && !Array.isArray(e);
397
- }
398
- function R(e) {
399
- return e && typeof e == "object" && "type" in e ? e : void 0;
400
- }
401
- function y(e) {
402
- return Array.isArray(e) ? e.map(R).filter((t) => !!t) : [];
403
- }
404
- function T(e) {
405
- const t = R(e);
406
- return t?.type === "Identifier" ? String(t.name) : void 0;
407
- }
408
- function M(e) {
409
- const t = R(e);
410
- return t?.type === "Identifier" || t?.type === "Literal" ? String(t.name ?? t.value) : void 0;
411
- }
412
- const Te = "/_demiurge/audit", Ae = [
413
- "GET",
414
- "POST",
415
- "PUT",
416
- "PATCH",
417
- "DELETE",
418
- "OPTIONS",
419
- "HEAD"
420
- ];
421
- function kt(e) {
422
- return new URL(e.url).pathname === Te;
423
- }
424
- async function Lt(e, t) {
425
- const r = new URL(t.url), o = await Vt(
426
- e,
427
- r.searchParams.get("path") || "/",
428
- t
429
- ), n = r.searchParams.get("format") === "json";
430
- return new Response(
431
- n ? JSON.stringify(o, null, 2) : Jt(o),
432
- {
433
- headers: {
434
- "cache-control": "no-store",
435
- // The panel is a side channel. It declares its own policy, so the
436
- // policy of the application stays unchanged. The panel runs no script.
437
- "content-security-policy": "default-src 'none'; base-uri 'none'; form-action 'self'; style-src 'unsafe-inline'",
438
- "content-type": n ? "application/json; charset=utf-8" : "text/html; charset=utf-8",
439
- "x-robots-tag": "noindex"
440
- }
441
- }
442
- );
443
- }
444
- async function Vt(e, t, r) {
445
- const o = new URL(r.url).origin, n = new URL(t, o), i = n.pathname, s = new Request(n, { headers: r.headers }), a = Wt(e, i);
446
- if (!a) {
447
- const p = await se(
448
- e,
449
- { fileSegments: [] },
450
- {},
451
- void 0
452
- );
453
- return me({
454
- cacheReads: [],
455
- kind: "unmatched",
456
- method: "GET",
457
- pathname: i,
458
- policy: p,
459
- request: s,
460
- scripts: []
461
- });
462
- }
463
- const c = await a.route.load(), u = Ht(c), d = c[u], h = await se(
464
- e,
465
- a.route,
466
- c,
467
- d
468
- ), D = [], m = d?.kind === "page" ? await Ye(
469
- e,
470
- i,
471
- s,
472
- void 0,
473
- Ut(D)
474
- ) : void 0, f = m?.status === "ready" ? m.match : void 0;
475
- return me({
476
- cacheReads: D,
477
- cors: d && d.kind !== "page" ? d.cors : void 0,
478
- kind: d?.kind === "page" ? "page" : "resource",
479
- metadata: f?.metadata,
480
- method: u,
481
- pathname: i,
482
- policy: h,
483
- request: s,
484
- route: {
485
- file: a.route.file,
486
- groups: a.route.fileSegments.filter(Xe),
487
- layouts: e.layouts.filter((p) => Q(p.fileSegments, a.route.fileSegments)).map((p) => p.file),
488
- methods: Ae.filter((p) => c[p]),
489
- middlewares: e.middlewares.filter((p) => Q(p.fileSegments, a.route.fileSegments)).map((p) => p.file),
490
- params: a.path,
491
- pattern: Qe(a.route.segments),
492
- policies: e.policies.filter((p) => Q(p.fileSegments, a.route.fileSegments)).map((p) => p.file),
493
- render: f?.render.mode
494
- },
495
- scripts: f?.scripts ?? []
496
- });
497
- }
498
- function me(e) {
499
- const t = e.kind === "page", r = t && et(e.policy.document) ? z() : void 0, o = e.scripts.map((s) => ({
500
- ...s,
501
- nonce: s.nonce ?? r
502
- })), n = {
503
- headers: { nonce: r, request: e.request },
504
- policy: e.policy.document ?? {},
505
- scriptDependencies: !0
506
- };
507
- return {
508
- audit: ae({
509
- document: t ? { ...n, scripts: o } : void 0,
510
- route: {
511
- cors: e.cors,
512
- method: e.method,
513
- security: e.policy.security
514
- }
515
- }),
516
- // A nonce makes a document unique for each response. The request handler
517
- // therefore replaces the cache directives of the application.
518
- cacheControl: r ? "private, no-store" : void 0,
519
- cacheReads: e.cacheReads,
520
- kind: e.kind,
521
- metadata: e.metadata,
522
- method: e.method,
523
- nonce: r,
524
- pathname: e.pathname,
525
- policy: e.policy,
526
- route: e.route,
527
- scripts: o.map((s) => ({
528
- // One audit for each script gives the status of that script alone. The
529
- // panel reads the same code path that the complete audit reads.
530
- findings: ae({
531
- document: { ...n, scripts: [s] }
532
- }).findings,
533
- integrity: s.integrity,
534
- nonce: s.nonce,
535
- purpose: s.purpose,
536
- src: s.src,
537
- strategy: s.strategy
538
- }))
539
- };
540
- }
541
- function Wt(e, t) {
542
- try {
543
- return Oe(e.routes, t);
544
- } catch (r) {
545
- if (r instanceof Ze)
546
- return null;
547
- throw r;
548
- }
549
- }
550
- function Ht(e) {
551
- return Ae.find((t) => e[t]) ?? "GET";
552
- }
553
- function Ut(e) {
554
- const t = tt();
555
- return {
556
- get: async (r) => (e.push({
557
- key: nt(r.key),
558
- scope: r.scope ?? "request",
559
- staleWhileRevalidate: ye(r.staleWhileRevalidate),
560
- tags: (r.tags ?? []).map(rt),
561
- ttl: ye(r.ttl)
562
- }), await t.get(r)),
563
- invalidateKey: t.invalidateKey,
564
- invalidateTags: t.invalidateTags
565
- };
566
- }
567
- function ye(e) {
568
- return e === void 0 ? void 0 : String(e);
569
- }
570
- function Jt(e) {
571
- return `<!doctype html>
572
- <html lang="en">
573
- <head>
574
- <meta charset="utf-8" />
575
- <meta name="viewport" content="width=device-width, initial-scale=1" />
576
- <title>Demiurge route audit</title>
577
- <style>${qt}</style>
578
- </head>
579
- <body>
580
- <h1>Demiurge route audit</h1>
581
- <form method="get" action="${Te}">
582
- <label for="path">Path</label>
583
- <input id="path" name="path" value="${l(e.pathname)}" />
584
- <button type="submit">Audit</button>
585
- </form>
586
- ${zt(e)}
587
- ${Gt(e.audit.findings)}
588
- ${Bt(e.audit.headers)}
589
- ${Kt(e)}
590
- ${Yt(e.metadata)}
591
- ${Qt(e.scripts)}
592
- ${Xt(e)}
593
- <p class="footer">
594
- The development server serves this panel. A production build and a static
595
- export do not contain it.
596
- </p>
597
- </body>
598
- </html>
599
- `;
600
- }
601
- const qt = `
602
- :root { color-scheme: light dark; }
603
- body {
604
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
605
- line-height: 1.5;
606
- margin: 0 auto;
607
- max-width: 60rem;
608
- padding: 2rem 1rem;
609
- }
610
- h1 { font-size: 1.25rem; }
611
- h2 { font-size: 1rem; margin-bottom: 0.25rem; }
612
- form { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
613
- input { flex: 1; padding: 0.25rem 0.5rem; }
614
- section { border-top: 1px solid currentColor; padding: 0.75rem 0; }
615
- table { border-collapse: collapse; width: 100%; }
616
- td, th { padding: 0.25rem 0.5rem 0.25rem 0; text-align: left; vertical-align: top; }
617
- th { white-space: nowrap; width: 12rem; }
618
- ul { margin: 0; padding-left: 1.25rem; }
619
- .empty { opacity: 0.7; }
620
- .error { font-weight: 700; }
621
- .footer { opacity: 0.7; }
622
- `;
623
- function zt(e) {
624
- if (!e.route)
625
- return $(
626
- "Route",
627
- `<p class="empty">No route matches ${l(e.pathname)}.</p>`
628
- );
629
- const t = e.route;
630
- return $(
631
- "Route",
632
- C([
633
- ["Pathname", l(e.pathname)],
634
- ["Pattern", l(t.pattern)],
635
- ["File", l(t.file)],
636
- ["Kind", l(e.kind)],
637
- ["Method", l(e.method)],
638
- ["Methods", l(t.methods.join(", "))],
639
- ["Render mode", t.render ? l(t.render) : S()],
640
- ["Path values", Zt(t.params)],
641
- ["Route groups", A(t.groups)],
642
- ["Layouts", A(t.layouts)],
643
- ["Policies", A(t.policies)],
644
- ["Middleware", A(t.middlewares)]
645
- ])
646
- );
647
- }
648
- function Gt(e) {
649
- return e.length === 0 ? $("Findings", '<p class="empty">No findings.</p>') : $(
650
- "Findings",
651
- `<ul>${e.map(Ce).join("")}</ul>`
652
- );
653
- }
654
- function Ce(e) {
655
- return `<li${e.severity === "error" ? ' class="error"' : ""}>${l(e.severity)}: ${l(e.message)} <code>${l(e.code)}</code></li>`;
656
- }
657
- function Bt(e) {
658
- const t = Object.keys(e).sort();
659
- return t.length === 0 ? $(
660
- "Response headers",
661
- '<p class="empty">The response carries no document header.</p>'
662
- ) : $(
663
- "Response headers",
664
- C(t.map((r) => [r, l(e[r])]))
665
- );
666
- }
667
- function Kt(e) {
668
- const t = {
669
- cors: e.audit.route?.cors,
670
- document: e.policy.document,
671
- security: e.policy.security
672
- };
673
- return $(
674
- "Effective policy",
675
- `<pre>${l(JSON.stringify(t, null, 2))}</pre>`
676
- );
677
- }
678
- function Yt(e) {
679
- return e ? $(
680
- "Metadata",
681
- `<pre>${l(JSON.stringify(e, null, 2))}</pre>`
682
- ) : $("Metadata", '<p class="empty">No document metadata.</p>');
683
- }
684
- function Qt(e) {
685
- return e.length === 0 ? $("Scripts", '<p class="empty">No contributed scripts.</p>') : $(
686
- "Scripts",
687
- e.map(
688
- (t) => C([
689
- ["Source", l(t.src)],
690
- ["Strategy", l(t.strategy)],
691
- ["Purpose", t.purpose ? l(t.purpose) : S()],
692
- ["Integrity", t.integrity ? l(t.integrity) : S()],
693
- ["Nonce", t.nonce ? "applied" : S()],
694
- [
695
- "Policy status",
696
- t.findings.length === 0 ? "allowed" : `<ul>${t.findings.map(Ce).join("")}</ul>`
697
- ]
698
- ])
699
- ).join("")
700
- );
701
- }
702
- function Xt(e) {
703
- const t = [
704
- [
705
- "Response cache-control",
706
- e.cacheControl ? l(e.cacheControl) : S()
707
- ],
708
- ["Nonce", e.nonce ? "required" : S()]
709
- ];
710
- return e.cacheReads.length === 0 ? $(
711
- "Cache behavior",
712
- `${C(t)}<p class="empty">The request read no cache entry.</p>`
713
- ) : $(
714
- "Cache behavior",
715
- `${C(t)}${e.cacheReads.map(
716
- (r) => C([
717
- ["Key", l(r.key)],
718
- ["Scope", l(r.scope)],
719
- ["Time to live", r.ttl ? l(r.ttl) : S()],
720
- [
721
- "Stale while revalidate",
722
- r.staleWhileRevalidate ? l(r.staleWhileRevalidate) : S()
723
- ],
724
- ["Tags", A(r.tags)]
725
- ])
726
- ).join("")}`
727
- );
728
- }
729
- function $(e, t) {
730
- return ` <section>
731
- <h2>${l(e)}</h2>
732
- ${t}
733
- </section>`;
734
- }
735
- function C(e) {
736
- return `<table><tbody>${e.map(
737
- ([t, r]) => `<tr><th scope="row">${l(t)}</th><td>${r}</td></tr>`
738
- ).join("")}</tbody></table>`;
739
- }
740
- function A(e) {
741
- return e.length === 0 ? S() : `<ul>${e.map((t) => `<li>${l(t)}</li>`).join("")}</ul>`;
742
- }
743
- function Zt(e) {
744
- return A(
745
- Object.entries(e).map(([t, r]) => `${t} = ${String(r)}`)
746
- );
747
- }
748
- function S() {
749
- return '<span class="empty">none</span>';
750
- }
751
- function l(e) {
752
- return e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&#39;");
753
- }
754
- const K = "virtual:demiurge/client-entry", te = `/@id/${K}`, X = `\0${K}`, Ie = "virtual:demiurge/server-entry", he = `\0${Ie}`, ge = ".demiurge/route-manifest.d.ts";
755
- function Yr(e = {}) {
756
- let t = process.cwd(), r = !1;
757
- const o = `demiurge-${z()}`;
758
- return {
759
- api: {
760
- demiurge: !0,
761
- fonts: e.fonts,
762
- images: e.images,
763
- staticDeployment: e.static?.deployment,
764
- staticFileHeaders: e.static?.headers
765
- },
766
- enforce: "post",
767
- name: "demiurge",
768
- config(n, i) {
769
- return cr(n, i, o);
770
- },
771
- configResolved(n) {
772
- t = n.root, r = n.command === "build";
773
- },
774
- resolveId(n) {
775
- return n === K ? X : n === Ie ? he : null;
776
- },
777
- load(n) {
778
- return n === X ? ur(t, e) : n === he ? lr(t, e) : null;
779
- },
780
- transform: {
781
- order: "post",
782
- handler(n, i, s) {
783
- if (!nr(t, e, i))
784
- return null;
785
- if (s?.ssr)
786
- return r ? null : er(n, i);
787
- const a = tr(n);
788
- return a === n ? null : { code: a, map: null };
789
- }
790
- },
791
- generateBundle(n, i) {
792
- const s = Object.values(i).find(
793
- (u) => u.type === "chunk" && u.isEntry && u.facadeModuleId === X
794
- );
795
- if (!s)
796
- return;
797
- const a = Object.values(i).filter(
798
- (u) => u.type === "asset" && u.fileName.endsWith(".css")
799
- ).map((u) => `/${u.fileName}`), c = `/${s.fileName}`;
800
- this.emitFile({
801
- fileName: "index.html",
802
- source: Mr({
803
- entrySrc: c,
804
- lang: e.document?.lang,
805
- styles: a,
806
- title: e.document?.title
807
- }),
808
- type: "asset"
809
- }), this.emitFile({
810
- fileName: "demiurge-manifest.json",
811
- source: JSON.stringify({ clientEntry: c, styles: a }, null, 2),
812
- type: "asset"
813
- });
814
- },
815
- async buildStart() {
816
- if (r) {
817
- await xr(t, e);
818
- const n = await Ne(t, e);
819
- if (n.length)
820
- throw new Error(_r(n));
821
- }
822
- e.typedRoutes && await L(t, e);
823
- },
824
- configureServer(n) {
825
- const i = async () => {
826
- const m = await Ne(n.config.root, e);
827
- for (const f of m)
828
- n.config.logger.warn(Le(f));
829
- };
830
- let s, a = Promise.resolve();
831
- const c = () => {
832
- a = a.then(i).catch(() => {
833
- });
834
- }, u = () => {
835
- s && clearTimeout(s), s = setTimeout(() => {
836
- s = void 0, c();
837
- }, Ir), s.unref?.();
838
- };
839
- if (n.httpServer?.once("close", () => {
840
- s && (clearTimeout(s), s = void 0);
841
- }), c(), e.typedRoutes) {
842
- const m = b(
843
- n.config.root,
844
- e.routesDir ?? "src/routes"
845
- );
846
- L(n.config.root, e), n.watcher.add(m), n.watcher.on("add", (f) => {
847
- J(m, f) && (L(n.config.root, e), u());
848
- }), n.watcher.on("change", (f) => {
849
- J(m, f) && (L(n.config.root, e), u());
850
- }), n.watcher.on("unlink", (f) => {
851
- J(m, f) && (L(n.config.root, e), u());
852
- });
853
- } else {
854
- const m = b(
855
- n.config.root,
856
- e.routesDir ?? "src/routes"
857
- );
858
- n.watcher.add(m);
859
- for (const f of ["add", "change", "unlink"])
860
- n.watcher.on(f, (p) => {
861
- J(m, p) && u();
862
- });
863
- }
864
- const d = yr(e), h = hr(n, e), D = at({
865
- fonts: e.fonts,
866
- root: n.config.root
867
- });
868
- return n.middlewares.use(async (m, f, p) => {
869
- try {
870
- let v;
871
- try {
872
- v = ce(m, {
873
- // Vite performs its own configured host allowlist check before
874
- // Demiurge's middleware runs. Production Node listeners require
875
- // an explicit application allowlist instead.
876
- allowedHosts: [m.headers.host ?? "localhost"]
877
- });
878
- } catch (H) {
879
- if (H instanceof ue) {
880
- le(f);
881
- return;
882
- }
883
- throw H;
884
- }
885
- if (d && kt(v)) {
886
- const H = await Z(
887
- n,
888
- m,
889
- b(n.config.root, e.routesDir ?? "src/routes")
890
- );
891
- await k(
892
- f,
893
- await Lt(H, v)
894
- );
895
- return;
896
- }
897
- const j = await D(v);
898
- if (j) {
899
- await k(f, j);
900
- return;
901
- }
902
- const _ = await h(v);
903
- if (_) {
904
- await k(f, _);
905
- return;
906
- }
907
- const V = b(
908
- n.config.root,
909
- e.routesDir ?? "src/routes"
910
- ), W = await Z(n, m, V), F = Re(
911
- n,
912
- o
913
- ), Y = await Ar(
914
- W,
915
- v,
916
- gr(e, F.transform)
917
- );
918
- if (Y === "next") {
919
- p();
920
- return;
921
- }
922
- be(Y, F.nonce), await k(f, Y);
923
- } catch (v) {
924
- p(v);
925
- }
926
- }), () => {
927
- n.middlewares.use(async (m, f, p) => {
928
- try {
929
- let v;
930
- try {
931
- v = ce(m, {
932
- allowedHosts: [m.headers.host ?? "localhost"]
933
- });
934
- } catch (F) {
935
- if (F instanceof ue) {
936
- le(f);
937
- return;
938
- }
939
- throw F;
940
- }
941
- const j = b(
942
- n.config.root,
943
- e.routesDir ?? "src/routes"
944
- ), _ = await Z(n, m, j);
945
- Sr(_, j);
946
- const V = Re(
947
- n,
948
- o
949
- ), W = await ot(
950
- _,
951
- v,
952
- $r(e, V.transform)
953
- );
954
- be(
955
- W,
956
- V.nonce
957
- ), await k(f, W);
958
- } catch (v) {
959
- p(v);
960
- }
961
- });
962
- };
963
- }
964
- };
965
- }
966
- function er(e, t) {
967
- if (!e.includes("import.meta"))
968
- return null;
969
- const r = oe(e), o = E(r.body).find(
970
- (u) => u.type === "ImportDeclaration" && E(u.specifiers).some(
971
- (d) => w(d.local)?.type === "Identifier" && w(d.local)?.name === "meta"
972
- )
973
- ), n = o && E(o.specifiers).find(
974
- (u) => w(u.local)?.type === "Identifier" && w(u.local)?.name === "meta"
975
- ), i = n && w(n.local);
976
- if (!o || !n || !i)
977
- return null;
978
- let s = "__demiurge_imported_meta__";
979
- for (; new RegExp(`\\b${s}\\b`).test(e); )
980
- s += "_";
981
- const a = new Ue(e), c = w(n.imported);
982
- return a.overwrite(
983
- i.start,
984
- i.end,
985
- c?.start === i.start ? `meta as ${s}` : s
986
- ), a.appendLeft(o.end, `
987
- const meta = ${s};`), {
988
- code: a.toString(),
989
- map: a.generateMap({
990
- hires: "boundary",
991
- includeContent: !0,
992
- source: t
993
- })
994
- };
995
- }
996
- function tr(e) {
997
- const t = oe(e), r = [], o = rr(t), n = [];
998
- G(t, (a) => {
999
- if (a.type === "ImportDeclaration" && ir(a)) {
1000
- n.push(a);
1001
- return;
1002
- }
1003
- if (a.type !== "CallExpression" || !or(a.callee))
1004
- return;
1005
- const c = E(a.arguments)[0];
1006
- if (c?.type === "ObjectExpression")
1007
- for (const u of E(c.properties))
1008
- u.type === "Property" && B(u.key) === "data" && r.push({ end: u.end, start: u.start });
1009
- });
1010
- const i = [...r, ...o];
1011
- if (i.length === 0)
1012
- return e;
1013
- const s = [...i];
1014
- for (const a of n) {
1015
- const c = E(a.specifiers).map((h) => w(h.local)).filter((h) => h?.type === "Identifier").map((h) => String(h.name)), u = sr(e, [
1016
- ...i,
1017
- { end: a.end, start: a.start }
1018
- ]), d = c.find(
1019
- (h) => new RegExp(`\\b${je(h)}\\b`).test(u)
1020
- );
1021
- if (d)
1022
- throw new Error(
1023
- `Server-only import ${JSON.stringify(d)} is used by client route code. Move that use into page data, a document contribution, or a client-safe module.`
1024
- );
1025
- s.push({ end: a.end, start: a.start });
1026
- }
1027
- return ar(
1028
- e,
1029
- s,
1030
- (a) => r.includes(a) ? "data: undefined" : o.includes(a) ? "undefined" : ""
1031
- );
1032
- }
1033
- const we = /* @__PURE__ */ new Set(["links", "metadata", "scripts"]);
1034
- function rr(e) {
1035
- const t = /* @__PURE__ */ new Set();
1036
- for (const o of E(e.body)) {
1037
- if (o.type !== "ExportNamedDeclaration") continue;
1038
- const n = w(o.declaration);
1039
- if (n?.type === "VariableDeclaration")
1040
- for (const i of E(n.declarations)) {
1041
- const s = w(i.id);
1042
- s?.type === "Identifier" && we.has(String(s.name)) && t.add(String(s.name));
1043
- }
1044
- for (const i of E(o.specifiers)) {
1045
- const s = B(i.exported), a = B(i.local);
1046
- s && a && we.has(s) && t.add(a);
1047
- }
1048
- }
1049
- const r = [];
1050
- return G(e, (o) => {
1051
- if (o.type !== "VariableDeclarator") return;
1052
- const n = w(o.id), i = w(o.init);
1053
- n?.type === "Identifier" && t.has(String(n.name)) && i && r.push({ end: i.end, start: i.start });
1054
- }), r;
1055
- }
1056
- function nr(e, t, r) {
1057
- const o = r.split("?", 1)[0] ?? r, n = b(e, t.routesDir ?? "src/routes"), i = N(n, o);
1058
- return i !== "" && i !== ".." && !i.startsWith(`..${O}`);
1059
- }
1060
- function G(e, t) {
1061
- if (!e || typeof e != "object") return;
1062
- if (Array.isArray(e)) {
1063
- for (const o of e) G(o, t);
1064
- return;
1065
- }
1066
- const r = e;
1067
- if (typeof r.type == "string") {
1068
- t(r);
1069
- for (const [o, n] of Object.entries(r))
1070
- (/* @__PURE__ */ new Set(["end", "loc", "start", "type"])).has(o) || G(n, t);
1071
- }
1072
- }
1073
- function w(e) {
1074
- return e && typeof e == "object" && "type" in e ? e : void 0;
1075
- }
1076
- function E(e) {
1077
- return Array.isArray(e) ? e.map(w).filter((t) => !!t) : [];
1078
- }
1079
- function or(e) {
1080
- const t = w(e);
1081
- return t?.type === "Identifier" ? t.name === "page" : t?.type === "MemberExpression" && B(t.property) === "page";
1082
- }
1083
- function B(e) {
1084
- const t = w(e);
1085
- return t?.type === "Identifier" || t?.type === "Literal" ? String(t.name ?? t.value) : void 0;
1086
- }
1087
- function ir(e) {
1088
- const t = w(e.source)?.value;
1089
- return typeof t == "string" && /(?:^|[/.-])server(?:[/.-]|$)/.test(t);
1090
- }
1091
- function sr(e, t) {
1092
- const r = [...e];
1093
- for (const { end: o, start: n } of t)
1094
- r.fill(" ", n, o);
1095
- return r.join("");
1096
- }
1097
- function ar(e, t, r) {
1098
- return [...t].sort((o, n) => n.start - o.start).reduce(
1099
- (o, n) => `${o.slice(0, n.start)}${r(n)}${o.slice(n.end)}`,
1100
- e
1101
- );
1102
- }
1103
- function je(e) {
1104
- return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1105
- }
1106
- function cr(e, t, r) {
1107
- return {
1108
- appType: "custom",
1109
- build: {
1110
- assetsInlineLimit: e.build?.assetsInlineLimit ?? 0,
1111
- ...t.isSsrBuild && e.build?.target === void 0 && e.ssr?.target !== "webworker" ? { target: "node22.13" } : {},
1112
- rollupOptions: {
1113
- input: e.build?.rollupOptions?.input ?? K
1114
- }
1115
- },
1116
- ...t.command === "serve" ? {
1117
- html: { cspNonce: r },
1118
- ssr: { external: [P] }
1119
- } : {}
1120
- };
1121
- }
1122
- function ur(e, t = {}) {
1123
- const r = t.routesDir ?? "src/routes", o = mr(e, t);
1124
- return `import { hydrateFileRouter } from "${P}";
1125
- ${o}
1126
-
1127
- ${_e(r, {
1128
- exportRoutes: !1,
1129
- includeServerOnly: !1
1130
- })}
1131
-
1132
- void hydrateFileRouter({ routes });
1133
- `;
1134
- }
1135
- function lr(e, t = {}) {
1136
- const r = t.routesDir ?? "src/routes";
1137
- return `import { createRequestHandler } from "${P}";
1138
-
1139
- ${_e(r, {
1140
- exportRoutes: !0,
1141
- includeServerOnly: !0,
1142
- eagerModules: !0
1143
- })}
1144
-
1145
- export function createHandler(options = {}) {
1146
- const { clientEntry, lang, styles, title, ...handlerOptions } = options;
1147
-
1148
- return createRequestHandler({
1149
- ...handlerOptions,
1150
- routes,
1151
- routeModules,
1152
- ssr: {
1153
- clientEntry,
1154
- lang: lang ?? ${JSON.stringify(t.document?.lang)},
1155
- styles,
1156
- title: title ?? ${JSON.stringify(t.document?.title)},
1157
- },
1158
- });
1159
- }
1160
- `;
1161
- }
1162
- function _e(e, {
1163
- exportRoutes: t,
1164
- eagerModules: r = !1,
1165
- includeServerOnly: o
1166
- }) {
1167
- const n = fr(e, o), i = pr(e);
1168
- return r ? `const eagerRouteModules = import.meta.glob(${JSON.stringify(n)}, { eager: true });
1169
- const routePrefix = ${JSON.stringify(i)};
1170
- export const routeModules = Object.fromEntries(
1171
- Object.entries(eagerRouteModules).map(([file, module]) => [
1172
- \`./routes/\${file.slice(routePrefix.length)}\`,
1173
- module,
1174
- ]),
1175
- );
1176
- ${t ? "export " : ""}const routes = Object.fromEntries(
1177
- Object.entries(routeModules).map(([file, module]) => [
1178
- file,
1179
- async () => module,
1180
- ]),
1181
- );` : `const routeModules = import.meta.glob(${JSON.stringify(n)});
1182
- const routePrefix = ${JSON.stringify(i)};
1183
- ${t ? "export " : ""}const routes = Object.fromEntries(
1184
- Object.entries(routeModules).map(([file, load]) => [
1185
- \`./routes/\${file.slice(routePrefix.length)}\`,
1186
- load,
1187
- ]),
1188
- );`;
1189
- }
1190
- const dr = ["@middleware.ts", "@policy.ts"];
1191
- function fr(e, t) {
1192
- const r = `/${e.replace(/^\/|\/$/g, "")}`, o = [`${r}/**/*.{ts,tsx}`];
1193
- return t || o.push(
1194
- ...dr.flatMap((n) => [
1195
- `!${r}/${n}`,
1196
- `!${r}/**/${n}`
1197
- ])
1198
- ), o;
1199
- }
1200
- function pr(e) {
1201
- return `/${e.replace(/^\/|\/$/g, "")}/`;
1202
- }
1203
- function mr(e, t) {
1204
- if (t.styles === !1)
1205
- return "";
1206
- const r = t.styles ?? "src/styles.css", o = b(e, r);
1207
- return re(o) ? `import ${JSON.stringify(`/${r.replace(/^\/+/, "")}`)};` : "";
1208
- }
1209
- function yr(e) {
1210
- return e.devtools !== !1 && process.env.NODE_ENV !== "production";
1211
- }
1212
- function hr(e, t) {
1213
- const r = e.config.publicDir, o = t.images?.optimizerPath ?? "/_demiurge/image";
1214
- return r ? ct({
1215
- policy: t.images,
1216
- resolveVariant: (n) => lt(n, o),
1217
- root: r
1218
- }) : async () => null;
1219
- }
1220
- function gr(e, t) {
1221
- return {
1222
- dev: !0,
1223
- ssr: ke(e),
1224
- transformDocument: t,
1225
- renderPage: async (r, o) => {
1226
- if (r.render.mode === "streaming")
1227
- return await ut(r, {
1228
- ...o,
1229
- clientEntry: te,
1230
- transformDocument: t
1231
- });
1232
- const n = await t(
1233
- ze(r, {
1234
- ...o,
1235
- clientEntry: te
1236
- })
1237
- );
1238
- return new Response(n, {
1239
- headers: { "content-type": "text/html; charset=utf-8" }
1240
- });
1241
- }
1242
- };
1243
- }
1244
- function Re(e, t) {
1245
- const r = z(), o = z();
1246
- return {
1247
- nonce: r,
1248
- transform: async (n) => {
1249
- const i = wr(n, o), s = await e.transformIndexHtml("/", i);
1250
- return ve(
1251
- ve(s, o),
1252
- t,
1253
- r
1254
- );
1255
- }
1256
- };
1257
- }
1258
- function wr(e, t) {
1259
- const r = e.toLowerCase();
1260
- let o = 0, n = "";
1261
- for (; o < e.length; ) {
1262
- const i = e.indexOf("<", o);
1263
- if (i === -1)
1264
- return n + e.slice(o);
1265
- if (n += e.slice(o, i), r.startsWith("<!--", i)) {
1266
- const u = r.indexOf("-->", i + 4), d = u === -1 ? e.length : u + 3;
1267
- n += e.slice(i, d), o = d;
1268
- continue;
1269
- }
1270
- const s = r.slice(i).match(/^<\s*(script|style|link)\b/)?.[1];
1271
- if (!s) {
1272
- n += "<", o = i + 1;
1273
- continue;
1274
- }
1275
- const a = Rr(e, i);
1276
- if (a === -1)
1277
- return n + e.slice(i);
1278
- const c = e.slice(i, a + 1);
1279
- if (n += /(?:^|\s)nonce(?:\s|=|>)/i.test(c) ? c : vr(c, t), o = a + 1, s === "script" || s === "style") {
1280
- const u = r.indexOf(`</${s}`, o);
1281
- if (u === -1)
1282
- return n + e.slice(o);
1283
- n += e.slice(o, u), o = u;
1284
- }
1285
- }
1286
- return n;
1287
- }
1288
- function Rr(e, t) {
1289
- let r;
1290
- for (let o = t + 1; o < e.length; o++) {
1291
- const n = e[o];
1292
- if (r) {
1293
- n === r && (r = void 0);
1294
- continue;
1295
- }
1296
- if (n === '"' || n === "'")
1297
- r = n;
1298
- else if (n === ">")
1299
- return o;
1300
- }
1301
- return -1;
1302
- }
1303
- function vr(e, t) {
1304
- const r = /\/\s*>$/.test(e) ? e.lastIndexOf("/") : e.length - 1;
1305
- return `${e.slice(0, r)} nonce="${t}"${e.slice(r)}`;
1306
- }
1307
- function ve(e, t, r) {
1308
- const o = new RegExp(
1309
- `(\\snonce\\s*=\\s*)(["'])${je(t)}\\2`,
1310
- "g"
1311
- );
1312
- return e.replace(
1313
- o,
1314
- r ? `$1"${r}"` : ""
1315
- );
1316
- }
1317
- function be(e, t) {
1318
- const r = e.headers.get("content-type"), o = e.headers.get("content-security-policy");
1319
- if (!r?.toLowerCase().startsWith("text/html") || !o)
1320
- return;
1321
- const n = `'nonce-${t}'`, i = $e(
1322
- o,
1323
- ["script-src-elem", "script-src"],
1324
- "script-src",
1325
- n
1326
- ), s = br(
1327
- i,
1328
- ["style-src-elem", "style-src"]
1329
- ) ? i : $e(
1330
- i,
1331
- ["style-src-elem", "style-src"],
1332
- "style-src",
1333
- n
1334
- );
1335
- e.headers.set("content-security-policy", s), e.headers.set("cache-control", "private, no-store");
1336
- }
1337
- function $e(e, t, r, o) {
1338
- const n = e.split(";").map((d) => d.trim()), i = Fe(n, t), s = n.find(
1339
- (d) => d.split(/\s+/, 1)[0]?.toLowerCase() === "default-src"
1340
- );
1341
- if (i === -1 && !s) return e;
1342
- const [a, ...c] = (i === -1 ? s : n[i]).split(/\s+/), u = [
1343
- i === -1 ? r : a,
1344
- .../* @__PURE__ */ new Set([
1345
- ...c.filter((d) => d !== "'none'"),
1346
- o
1347
- ])
1348
- ].join(" ");
1349
- return i === -1 ? n.push(u) : n[i] = u, n.join("; ");
1350
- }
1351
- function br(e, t) {
1352
- const r = e.split(";").map((s) => s.trim()), o = Fe(r, t), i = (o === -1 ? r.find(
1353
- (s) => s.split(/\s+/, 1)[0]?.toLowerCase() === "default-src"
1354
- ) : r[o])?.split(/\s+/).slice(1) ?? [];
1355
- return i.includes("'unsafe-inline'") && !i.some((s) => /^'(?:nonce-|sha(?:256|384|512)-)/i.test(s));
1356
- }
1357
- function Fe(e, t) {
1358
- for (const r of t) {
1359
- const o = e.findIndex(
1360
- (n) => n.split(/\s+/, 1)[0]?.toLowerCase() === r
1361
- );
1362
- if (o !== -1) return o;
1363
- }
1364
- return -1;
1365
- }
1366
- const Se = Symbol.for("demiurge.devManifest");
1367
- async function Z(e, t, r) {
1368
- const o = t, n = o[Se];
1369
- if (n)
1370
- return n;
1371
- const i = st(
1372
- await Tr(e, r)
1373
- );
1374
- return o[Se] = i, i;
1375
- }
1376
- function ke(e) {
1377
- return {
1378
- clientEntry: te,
1379
- lang: e.document?.lang,
1380
- title: e.document?.title
1381
- };
1382
- }
1383
- function $r(e, t) {
1384
- return {
1385
- ...ke(e),
1386
- dev: !0,
1387
- transformDocument: t
1388
- };
1389
- }
1390
- const xe = /* @__PURE__ */ new Set();
1391
- function Sr(e, t) {
1392
- xe.has(t) || e.fallbacks.notFound.some(
1393
- (r) => r.fileSegments.length === 0
1394
- ) || (xe.add(t), console.warn(Or(He(t, "@not-found.tsx"))));
1395
- }
1396
- async function xr(e, t = {}) {
1397
- const r = t.routesDir ?? "src/routes", o = b(e, r);
1398
- if (!re(o))
1399
- return;
1400
- const n = await ie(o);
1401
- if (n.map(
1402
- (a) => N(o, a).split(O).join("/")
1403
- ).some((a) => /^@not-found\.tsx?$/.test(a)))
1404
- return;
1405
- const s = await Er(n);
1406
- if (s)
1407
- throw new Error(
1408
- Pr(
1409
- r,
1410
- N(o, s).split(O).join("/")
1411
- )
1412
- );
1413
- }
1414
- async function Er(e) {
1415
- for (const t of e)
1416
- if (!N(ne(t), t).startsWith("@") && Dr(await Pe(t, "utf8")))
1417
- return t;
1418
- }
1419
- const Nr = P.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), Ee = new RegExp(
1420
- `import\\s*\\{([^}]*)\\}\\s*from\\s*["']${Nr}["']`,
1421
- "g"
1422
- );
1423
- function Dr(e) {
1424
- const t = [...e.matchAll(Ee)].flatMap(
1425
- (o) => o[1].split(",").flatMap((n) => {
1426
- const [i, s] = n.trim().split(/\s+as\s+/);
1427
- return i.replace(/^type\s+/, "") === "page" ? [s ?? i] : [];
1428
- })
1429
- );
1430
- if (t.length === 0)
1431
- return !1;
1432
- const r = e.replace(Ee, "");
1433
- return t.some((o) => new RegExp(`\\b${o}\\s*\\(`).test(r));
1434
- }
1435
- function Pr(e, t) {
1436
- return `Demiurge will not build an app with page routes and no ${e}/@not-found.tsx.
1437
-
1438
- "${t}" 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.
1439
-
1440
- Create ${e}/@not-found.tsx:
1441
-
1442
- export default function NotFound({ pathname }: { pathname: string }) {
1443
- return <h1>Nothing at {pathname}</h1>;
1444
- }
1445
-
1446
- It renders inside the layouts above the requested path. Opt out with "export const layout = false".`;
1447
- }
1448
- function Or(e) {
1449
- return `Demiurge is serving its built-in 404 because ${e} does not exist.
1450
-
1451
- Create it before building for production:
1452
-
1453
- export default function NotFound({ pathname }: { pathname: string }) {
1454
- return <h1>Nothing at {pathname}</h1>;
1455
- }
1456
- `;
1457
- }
1458
- function Mr({
1459
- entrySrc: e,
1460
- lang: t,
1461
- links: r,
1462
- metadata: o,
1463
- nonce: n,
1464
- scripts: i,
1465
- styles: s,
1466
- title: a
1467
- }) {
1468
- return qe({
1469
- entrySrc: e,
1470
- lang: t,
1471
- links: r,
1472
- metadata: o,
1473
- nonce: n,
1474
- scripts: i,
1475
- styles: s,
1476
- title: a
1477
- });
1478
- }
1479
- async function L(e, t) {
1480
- const r = b(e, t.routesDir ?? "src/routes"), o = b(
1481
- e,
1482
- typeof t.typedRoutes == "object" ? t.typedRoutes.outputFile ?? ge : ge
1483
- );
1484
- await dt({ outputFile: o, routesDir: r });
1485
- }
1486
- function J(e, t) {
1487
- return t.startsWith(e) && /\.tsx?$/.test(t);
1488
- }
1489
- async function Tr(e, t) {
1490
- const r = await ie(t), o = {};
1491
- for (const n of r) {
1492
- const i = Fr(t, n);
1493
- o[i] = async () => await e.ssrLoadModule(n);
1494
- }
1495
- return o;
1496
- }
1497
- async function Ar(e, t, r = {}) {
1498
- const o = new URL(t.url);
1499
- return Oe(e.routes, o.pathname) ? await it(e, t, r) : "next";
1500
- }
1501
- async function ie(e) {
1502
- return (await De(e, {
1503
- recursive: !0,
1504
- withFileTypes: !0
1505
- })).filter((r) => r.isFile() && /\.tsx?$/.test(r.name)).map((r) => b(r.parentPath, r.name));
1506
- }
1507
- const Cr = 8, Ir = 50;
1508
- async function jr(e, t, r) {
1509
- const o = new Array(e.length);
1510
- let n = 0;
1511
- const i = Array.from(
1512
- { length: Math.min(t, e.length) },
1513
- async () => {
1514
- for (; n < e.length; ) {
1515
- const s = n++;
1516
- o[s] = await r(e[s]);
1517
- }
1518
- }
1519
- );
1520
- return await Promise.all(i), o;
1521
- }
1522
- async function Ne(e, t = {}) {
1523
- const r = b(e, t.routesDir ?? "src/routes");
1524
- return re(r) ? (await jr(
1525
- await ie(r),
1526
- Cr,
1527
- Nt
1528
- )).flat().sort(
1529
- (n, i) => n.file.localeCompare(i.file) || (n.exportName ?? "").localeCompare(i.exportName ?? "") || n.code.localeCompare(i.code)
1530
- ) : [];
1531
- }
1532
- function _r(e) {
1533
- return [
1534
- "Demiurge found invalid static route policy:",
1535
- ...e.map(Le)
1536
- ].join(`
1537
- `);
1538
- }
1539
- function Le(e) {
1540
- return `${e.exportName ? `${e.file} export ${e.exportName}` : e.file}: [${e.code}] ${e.message}`;
1541
- }
1542
- function Fr(e, t) {
1543
- return `./routes/${N(e, t).split(O).join("/")}`;
1544
- }
1
+ import { R as t, a as s, b as n, c as u, d as r, e as l, f as o, g as i, h as _, i as b, j as c, k as d, l as R, m as v, n as y, o as m, p as f, q as E, r as S, s as g, t as p, u as A, v as D, w as P, x as O, y as F, z as I, A as T } from "../chunks/plugin-BZauDxRY.js";
1545
2
  export {
1546
- Yr as demiurge,
1547
- Te as unstable_ROUTE_AUDIT_PATH,
1548
- xr as unstable_assertRootNotFoundRoute,
1549
- ur as unstable_createClientEntrySource,
1550
- Tr as unstable_createDevRouteImporters,
1551
- Mr as unstable_createDocumentHtml,
1552
- Vt as unstable_createRouteAudit,
1553
- lr as unstable_createServerEntrySource,
1554
- Dr as unstable_declaresPageRoute,
1555
- _r as unstable_formatStaticPolicyFindings,
1556
- Ar as unstable_handleDevRequest,
1557
- yr as unstable_isRouteAuditEnabled,
1558
- Jt as unstable_renderRouteAuditDocument,
1559
- tr as unstable_stripClientPageData,
1560
- Ne as unstable_verifyRoutePolicies,
1561
- Dt as unstable_verifyRoutePolicySource
3
+ t as unstable_ROUTE_AUDIT_PATH,
4
+ s as unstable_ROUTE_AUDIT_VERSION,
5
+ n as unstable_assertRootNotFoundRoute,
6
+ u as unstable_auditRouteAccessCoverage,
7
+ r as unstable_createClientEntrySource,
8
+ l as unstable_createClientEnvSource,
9
+ o as unstable_createDevRouteImporters,
10
+ i as unstable_createDocumentHtml,
11
+ _ as unstable_createRouteAudit,
12
+ b as unstable_createServerEntrySource,
13
+ c as unstable_declaresPageRoute,
14
+ d as unstable_demiurge,
15
+ R as unstable_findEnvImportPath,
16
+ v as unstable_findEnvKeyReferences,
17
+ y as unstable_findServerEnvKeys,
18
+ m as unstable_formatEnvBoundaryFindings,
19
+ f as unstable_formatServerOnlyBoundaryFindings,
20
+ E as unstable_formatServerOnlyDevError,
21
+ S as unstable_formatStaticPolicyFindings,
22
+ g as unstable_handleDevRequest,
23
+ p as unstable_importsServerOnlyMarker,
24
+ A as unstable_inspectRouteFile,
25
+ D as unstable_inspectRoutePolicies,
26
+ P as unstable_isRouteAuditEnabled,
27
+ O as unstable_renderRouteAuditDocument,
28
+ F as unstable_stripClientPageData,
29
+ I as unstable_verifyRoutePolicies,
30
+ T as unstable_verifyRoutePolicySource
1562
31
  };
1563
32
  //# sourceMappingURL=index.js.map