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

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 (94) hide show
  1. package/README.md +14 -0
  2. package/bin/demiurge.mjs +6 -0
  3. package/dist/browser/file-router.d.ts +1 -0
  4. package/dist/browser/file-router.d.ts.map +1 -1
  5. package/dist/chunks/{document-shell-9GPwtcTt.js → document-shell-C0aPrkhd.js} +2 -2
  6. package/dist/chunks/{document-shell-9GPwtcTt.js.map → document-shell-C0aPrkhd.js.map} +1 -1
  7. package/dist/chunks/image-CRerJ5BY.js +145 -0
  8. package/dist/chunks/image-CRerJ5BY.js.map +1 -0
  9. package/dist/chunks/{image-codec-Dh1POFhE.js → image-codec-CQ8Cwxwb.js} +2 -2
  10. package/dist/chunks/{image-codec-Dh1POFhE.js.map → image-codec-CQ8Cwxwb.js.map} +1 -1
  11. package/dist/chunks/{images-CG7ZzayG.js → images-QgdmLyQ3.js} +11 -11
  12. package/dist/chunks/{images-CG7ZzayG.js.map → images-QgdmLyQ3.js.map} +1 -1
  13. package/dist/chunks/{index-0MNiR_wo.js → index-LYve1rQp.js} +286 -351
  14. package/dist/chunks/index-LYve1rQp.js.map +1 -0
  15. package/dist/chunks/links-iU22QkCE.js +68 -0
  16. package/dist/chunks/links-iU22QkCE.js.map +1 -0
  17. package/dist/chunks/{plugin-BZauDxRY.js → plugin-bkP6WwrS.js} +13 -12
  18. package/dist/chunks/{plugin-BZauDxRY.js.map → plugin-bkP6WwrS.js.map} +1 -1
  19. package/dist/chunks/runtime-BH519j2t.js +294 -0
  20. package/dist/chunks/runtime-BH519j2t.js.map +1 -0
  21. package/dist/chunks/streaming-BlKlC3nw.js +427 -0
  22. package/dist/chunks/streaming-BlKlC3nw.js.map +1 -0
  23. package/dist/chunks/{testing-CUwGj2ie.js → testing-BEW1nchS.js} +645 -630
  24. package/dist/chunks/testing-BEW1nchS.js.map +1 -0
  25. package/dist/chunks/{vite-QoqrGl6f.js → vite-BADZA8Fl.js} +73 -70
  26. package/dist/chunks/vite-BADZA8Fl.js.map +1 -0
  27. package/dist/cli.d.ts +8 -2
  28. package/dist/cli.d.ts.map +1 -1
  29. package/dist/cli.js +186 -122
  30. package/dist/cli.js.map +1 -1
  31. package/dist/config/index.js +2 -2
  32. package/dist/config/types.d.ts +3 -1
  33. package/dist/config/types.d.ts.map +1 -1
  34. package/dist/config/validate.d.ts.map +1 -1
  35. package/dist/data/cache.d.ts +5 -0
  36. package/dist/data/cache.d.ts.map +1 -1
  37. package/dist/data/index.d.ts +1 -1
  38. package/dist/data/index.d.ts.map +1 -1
  39. package/dist/data/testing.d.ts.map +1 -1
  40. package/dist/data/testing.js +101 -67
  41. package/dist/data/testing.js.map +1 -1
  42. package/dist/data/tiered.d.ts.map +1 -1
  43. package/dist/edge/index.js +27 -26
  44. package/dist/edge/index.js.map +1 -1
  45. package/dist/edge/stores.d.ts.map +1 -1
  46. package/dist/index.d.ts +1 -1
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +910 -891
  49. package/dist/index.js.map +1 -1
  50. package/dist/internal/testing.js +2 -2
  51. package/dist/kv/index.js +7 -6
  52. package/dist/kv/index.js.map +1 -1
  53. package/dist/kv/store.d.ts.map +1 -1
  54. package/dist/node/http.d.ts +2 -0
  55. package/dist/node/http.d.ts.map +1 -1
  56. package/dist/node/index.d.ts +1 -1
  57. package/dist/node/index.d.ts.map +1 -1
  58. package/dist/node/index.js +12 -11
  59. package/dist/node/index.js.map +1 -1
  60. package/dist/node/serve.d.ts +4 -0
  61. package/dist/node/serve.d.ts.map +1 -1
  62. package/dist/redis/index.js +29 -28
  63. package/dist/redis/index.js.map +1 -1
  64. package/dist/redis/store.d.ts.map +1 -1
  65. package/dist/route/serialization.d.ts +4 -4
  66. package/dist/route/serialization.d.ts.map +1 -1
  67. package/dist/static/index.d.ts.map +1 -1
  68. package/dist/static/index.js +255 -255
  69. package/dist/static/index.js.map +1 -1
  70. package/dist/static/testing.d.ts +26 -0
  71. package/dist/static/testing.d.ts.map +1 -0
  72. package/dist/static/testing.js +76 -0
  73. package/dist/static/testing.js.map +1 -0
  74. package/dist/testing/index.d.ts +47 -0
  75. package/dist/testing/index.d.ts.map +1 -0
  76. package/dist/testing/index.js +99 -0
  77. package/dist/testing/index.js.map +1 -0
  78. package/dist/vercel/build.d.ts +31 -0
  79. package/dist/vercel/build.d.ts.map +1 -0
  80. package/dist/vercel/config.d.ts +15 -0
  81. package/dist/vercel/config.d.ts.map +1 -0
  82. package/dist/vercel/index.d.ts +7 -0
  83. package/dist/vercel/index.d.ts.map +1 -0
  84. package/dist/vercel/index.js +11 -0
  85. package/dist/vercel/index.js.map +1 -0
  86. package/dist/vercel/runtime.d.ts +29 -0
  87. package/dist/vercel/runtime.d.ts.map +1 -0
  88. package/dist/vite/index.js +1 -1
  89. package/package.json +13 -1
  90. package/dist/chunks/index-0MNiR_wo.js.map +0 -1
  91. package/dist/chunks/streaming-GYIsVTQH.js +0 -560
  92. package/dist/chunks/streaming-GYIsVTQH.js.map +0 -1
  93. package/dist/chunks/testing-CUwGj2ie.js.map +0 -1
  94. package/dist/chunks/vite-QoqrGl6f.js.map +0 -1
package/dist/cli.js CHANGED
@@ -1,12 +1,13 @@
1
- import { readdir as D, readFile as N } from "node:fs/promises";
2
- import { relative as l, sep as f, resolve as d, join as I, isAbsolute as E } from "node:path";
3
- import { pathToFileURL as b } from "node:url";
4
- import { t as _, c as O } from "./chunks/vite-QoqrGl6f.js";
5
- import { p as P } from "./chunks/manifest-vO6c0G0W.js";
6
- import { generateStaticOutput as C, generateVercelStaticOutput as $ } from "./static/index.js";
7
- import { t as V, a as j } from "./chunks/testing-CUwGj2ie.js";
8
- import { v as F, B as S } from "./chunks/plugin-BZauDxRY.js";
9
- import "./chunks/index-0MNiR_wo.js";
1
+ import { readdir as _, readFile as P } from "node:fs/promises";
2
+ import { relative as m, sep as v, resolve as d, join as O, isAbsolute as D } from "node:path";
3
+ import { pathToFileURL as h } from "node:url";
4
+ import { t as C, c as T } from "./chunks/vite-BADZA8Fl.js";
5
+ import { p as $ } from "./chunks/manifest-vO6c0G0W.js";
6
+ import { generateStaticOutput as j, generateVercelStaticOutput as V } from "./static/index.js";
7
+ import { g as F } from "./chunks/runtime-BH519j2t.js";
8
+ import { t as x, a as L } from "./chunks/testing-BEW1nchS.js";
9
+ import { v as A, B as R } from "./chunks/plugin-bkP6WwrS.js";
10
+ import "./chunks/index-LYve1rQp.js";
10
11
  import "node:fs";
11
12
  import "magic-string";
12
13
  import "vite";
@@ -17,7 +18,7 @@ import "node:stream";
17
18
  import "node:stream/promises";
18
19
  import "node:net";
19
20
  import "node:crypto";
20
- const x = 1, A = 1, U = [
21
+ const H = 1, U = 1, q = [
21
22
  "authorization-result",
22
23
  "cookie-values",
23
24
  "csrf-token",
@@ -27,12 +28,12 @@ const x = 1, A = 1, U = [
27
28
  "response-headers",
28
29
  "session-record"
29
30
  ];
30
- async function L(t) {
31
- const e = t.options ?? {}, r = await F(t.root, e), o = r.inspections.map((i) => M(r.routesDir, i)).sort((i, s) => i.file.localeCompare(s.file));
31
+ async function k(t) {
32
+ const e = t.options ?? {}, r = await A(t.root, e), o = r.inspections.map((i) => W(r.routesDir, i)).sort((i, n) => i.file.localeCompare(n.file));
32
33
  return {
33
34
  findings: r.findings,
34
35
  redactions: [],
35
- request: U,
36
+ request: q,
36
37
  resolutions: {
37
38
  findings: "static",
38
39
  redactions: "static",
@@ -40,30 +41,30 @@ async function L(t) {
40
41
  routes: "static"
41
42
  },
42
43
  routes: o,
43
- routesDir: h(l(t.root, r.routesDir)),
44
- version: x
44
+ routesDir: y(m(t.root, r.routesDir)),
45
+ version: H
45
46
  };
46
47
  }
47
- function q(t) {
48
+ function B(t) {
48
49
  return Object.entries(t ?? {}).filter(([, e]) => e.sensitive).map(([e]) => e).sort();
49
50
  }
50
- function R(t) {
51
+ function N(t) {
51
52
  return t.findings.filter((e) => e.severity === "error").length;
52
53
  }
53
- function k(t) {
54
- const e = R(t), r = t.findings.length - e;
54
+ function M(t) {
55
+ const e = N(t), r = t.findings.length - e;
55
56
  return [
56
57
  `Demiurge inspected ${t.routes.length} route files in ${t.routesDir}.`,
57
58
  `Findings: ${e} error, ${r} warning.`,
58
59
  `The report states ${t.request.length} facts that only a request supplies.`,
59
60
  ...t.findings.map(
60
- (o) => ` ${o.severity}: ${h(o.file)} [${o.code}] ${o.message}`
61
+ (o) => ` ${o.severity}: ${y(o.file)} [${o.code}] ${o.message}`
61
62
  )
62
63
  ].join(`
63
64
  `);
64
65
  }
65
- function M(t, e) {
66
- const r = h(l(t, e.file)), o = r.replace(/\.tsx?$/, "").split("/"), i = o.at(-1)?.startsWith("@") ?? !1;
66
+ function W(t, e) {
67
+ const r = y(m(t, e.file)), o = r.replace(/\.tsx?$/, "").split("/"), i = o.at(-1)?.startsWith("@") ?? !1;
67
68
  return {
68
69
  declaredAccess: e.accessState,
69
70
  declaredDocumentCsp: e.documentCspState,
@@ -71,16 +72,16 @@ function M(t, e) {
71
72
  file: r,
72
73
  kind: i ? "attached" : e.declaresPageRoute ? "page" : "resource",
73
74
  methods: e.methods,
74
- ...i ? {} : { pattern: V(j(o)) }
75
+ ...i ? {} : { pattern: x(L(o)) }
75
76
  };
76
77
  }
77
- function h(t) {
78
- return t.split(f).join("/");
78
+ function y(t) {
79
+ return t.split(v).join("/");
79
80
  }
80
- const W = 0, B = 1, J = 2;
81
- async function Ot(t) {
81
+ const G = 0, J = 1, K = 2;
82
+ async function Tt(t) {
82
83
  if (t.arguments.length > 0)
83
- return v(
84
+ return g(
84
85
  "invalid-argument",
85
86
  "The inspect command accepts no argument.",
86
87
  `The command received ${t.arguments.join(" ")}.`
@@ -89,40 +90,40 @@ async function Ot(t) {
89
90
  try {
90
91
  e = await t.loadConfig();
91
92
  } catch (o) {
92
- return v(
93
+ return g(
93
94
  "configuration-unreadable",
94
95
  "Demiurge could not read the configuration.",
95
96
  o instanceof Error ? o.message : String(o)
96
97
  );
97
98
  }
98
- const r = await L({
99
- options: _(e),
99
+ const r = await k({
100
+ options: C(e),
100
101
  root: e.root
101
102
  });
102
103
  return {
103
- exitCode: R(r) > 0 ? B : W,
104
- stderr: k(r),
105
- stdout: S(r, {
106
- secretEnvKeys: q(e.env)
104
+ exitCode: N(r) > 0 ? J : G,
105
+ stderr: M(r),
106
+ stdout: R(r, {
107
+ secretEnvKeys: B(e.env)
107
108
  })
108
109
  };
109
110
  }
110
- function v(t, e, r) {
111
+ function g(t, e, r) {
111
112
  const o = {
112
113
  code: t,
113
114
  detail: r,
114
115
  title: e,
115
- version: A
116
+ version: U
116
117
  };
117
118
  return {
118
- exitCode: J,
119
+ exitCode: K,
119
120
  stderr: `${e}
120
121
  ${r}`,
121
- stdout: S(o)
122
+ stdout: R(o)
122
123
  };
123
124
  }
124
- const K = /* @__PURE__ */ new Set(["--host", "--origin", "--out-dir", "--port"]), G = "virtual:demiurge/client-entry", X = "virtual:demiurge/server-entry", T = "dist", Y = "dist/server", z = ".demiurge/server";
125
- function St(t, e = {}) {
125
+ const X = /* @__PURE__ */ new Set(["--host", "--origin", "--out-dir", "--port"]), Y = "virtual:demiurge/client-entry", I = "virtual:demiurge/server-entry", w = "dist", b = "dist/server", z = ".demiurge/server";
126
+ function Rt(t, e = {}) {
126
127
  const r = t[0];
127
128
  if (!r || r === "--help" || r === "-h" || r === "help")
128
129
  return {
@@ -130,25 +131,25 @@ function St(t, e = {}) {
130
131
  host: "localhost",
131
132
  port: 4173
132
133
  };
133
- if (r !== "build" && r !== "dev" && r !== "inspect" && r !== "preview")
134
+ if (r !== "build" && r !== "dev" && r !== "inspect" && r !== "preview" && r !== "start")
134
135
  throw new Error(`Unknown command: ${r}`);
135
136
  const o = {
136
137
  command: r,
137
- host: "localhost",
138
+ host: r === "start" ? e.HOST ?? "127.0.0.1" : "localhost",
138
139
  origin: e.SITE_ORIGIN,
139
140
  port: r === "dev" ? 5173 : 4173
140
141
  };
141
142
  for (let i = 1; i < t.length; i += 1) {
142
- const s = t[i];
143
- if (s === "--help" || s === "-h")
143
+ const n = t[i];
144
+ if (n === "--help" || n === "-h")
144
145
  return { command: "help", host: "localhost", port: 4173 };
145
- const [n, u] = s.split("=", 2);
146
- if (!K.has(n))
147
- throw new Error(`Unknown option: ${s}`);
146
+ const [s, u] = n.split("=", 2);
147
+ if (!X.has(s))
148
+ throw new Error(`Unknown option: ${n}`);
148
149
  const a = u ?? t[++i];
149
150
  if (!a || a.startsWith("--"))
150
- throw new Error(`Option ${n} requires a value.`);
151
- if (n === "--host" && (o.host = a), n === "--origin" && (o.origin = a), n === "--out-dir" && (o.outDir = a), n === "--port") {
151
+ throw new Error(`Option ${s} requires a value.`);
152
+ if (s === "--host" && (o.host = a), s === "--origin" && (o.origin = a), s === "--out-dir" && (o.outDir = a), s === "--port") {
152
153
  const c = Number(a);
153
154
  if (!Number.isSafeInteger(c) || c < 0 || c > 65535)
154
155
  throw new Error("The server port must be an integer from 0 through 65535.");
@@ -157,16 +158,17 @@ function St(t, e = {}) {
157
158
  }
158
159
  return o;
159
160
  }
160
- const Rt = `Usage: demiurge <command> [options]
161
+ const Nt = `Usage: demiurge <command> [options]
161
162
 
162
163
  Commands:
163
164
  dev Start the development server
164
165
  build Build production output
166
+ start Run built Node production output
165
167
  inspect Write the static inspection report as JSON
166
168
  preview Serve static output with its declared headers
167
169
 
168
170
  Options:
169
- --host <host> Set the server host (default: localhost)
171
+ --host <host> Set the server host (start: HOST or 127.0.0.1; otherwise: localhost)
170
172
  --origin <origin> Set the build origin (default: SITE_ORIGIN)
171
173
  --out-dir <directory> Set the client output directory (default: dist)
172
174
  --port <port> Set the server port (dev: 5173, preview: 4173)
@@ -177,9 +179,9 @@ error. It exits with 0 for no error finding, 1 for at least one error finding,
177
179
  and 2 for an invalid argument or an unreadable configuration.
178
180
 
179
181
  Demiurge reads demiurge.config.ts from the project root.`;
180
- async function Tt(t, e) {
182
+ async function It(t, e) {
181
183
  const { createServer: r } = await import("vite"), o = await r(
182
- await O({
184
+ await T({
183
185
  config: e,
184
186
  overrides: {
185
187
  mode: "development",
@@ -189,59 +191,120 @@ async function Tt(t, e) {
189
191
  );
190
192
  return await o.listen(), o;
191
193
  }
192
- async function Dt(t, e, r) {
193
- const o = e.root, i = r?.build ?? (await import("vite")).build, s = r?.createViteConfig ?? ((p) => O({ config: e, overrides: p })), n = d(
194
+ async function bt(t, e, r) {
195
+ const o = e.root, i = r?.build ?? (await import("vite")).build, n = r?.createViteConfig ?? ((p) => T({ config: e, overrides: p })), s = d(
194
196
  o,
195
- t.outDir ?? e.deployment?.outDir ?? T
197
+ t.outDir ?? e.deployment?.outDir ?? w
196
198
  ), u = d(o, z);
197
- await Q(
199
+ await tt(
198
200
  o,
199
- n,
200
- I(o, "public"),
201
+ s,
202
+ O(o, "public"),
201
203
  u
202
204
  ), await i(
203
- await s({
205
+ await n({
204
206
  define: { "process.env.NODE_ENV": JSON.stringify("production") },
205
207
  mode: "production",
206
208
  build: {
207
209
  emptyOutDir: !0,
208
- outDir: n,
209
- rollupOptions: { input: G }
210
+ outDir: s,
211
+ rollupOptions: { input: Y }
210
212
  }
211
213
  })
212
214
  );
213
- const a = e.deployment?.server, c = a ? d(o, a.outDir ?? Y) : void 0;
214
- return a && c && await i(
215
- await s({
215
+ const a = e.deployment?.server, c = a ? d(o, a.outDir ?? b) : void 0;
216
+ a && c && await i(
217
+ await n({
216
218
  define: { "process.env.NODE_ENV": JSON.stringify("production") },
217
219
  mode: "production",
218
220
  build: {
219
221
  copyPublicDir: !1,
220
222
  emptyOutDir: !0,
221
223
  outDir: c,
222
- rollupOptions: { input: d(o, a.entry) },
224
+ rollupOptions: {
225
+ input: a.entry ? d(o, a.entry) : I,
226
+ output: { entryFileNames: "server-entry.js" }
227
+ },
223
228
  ssr: !0
224
- }
229
+ },
230
+ ...a.provider ? {
231
+ ssr: {
232
+ external: ["@demiurgejs/core", "react", "react-dom"],
233
+ noExternal: !0
234
+ }
235
+ } : {}
225
236
  })
226
- ), e.deployment?.static ? { ...await H({
237
+ );
238
+ const l = a?.provider;
239
+ if (l && a && c) {
240
+ if (e.security?.staticFileHeaders?.length)
241
+ throw new Error(
242
+ "Vercel Node deployment does not support security.staticFileHeaders. Remove the rules or use a deployment that serves the browser output directly."
243
+ );
244
+ return { deploymentOutDir: await F({
245
+ clientDir: s,
246
+ deployment: l,
247
+ projectRoot: o,
248
+ serverDir: c
249
+ }), outDir: s, serverOutDir: c };
250
+ }
251
+ return e.deployment?.static ? { ...await Z({
227
252
  build: i,
228
253
  config: e,
229
- createViteConfig: s,
254
+ createViteConfig: n,
230
255
  frameworkServerOutDir: u,
231
256
  options: t,
232
- outDir: n,
257
+ outDir: s,
233
258
  root: o,
234
259
  runtime: r
235
- }), outDir: n, serverOutDir: c } : { outDir: n, serverOutDir: c };
260
+ }), outDir: s, serverOutDir: c } : { outDir: s, serverOutDir: c };
236
261
  }
237
- async function H({
262
+ async function _t(t, e, r = process.env, o) {
263
+ const i = e.deployment?.server;
264
+ if (!i)
265
+ throw new Error(
266
+ "The start command requires deployment.server in demiurge.config.ts."
267
+ );
268
+ const n = r.ALLOWED_HOSTS?.split(",").map((p) => p.trim()).filter(Boolean);
269
+ if (!n?.length)
270
+ throw new Error(
271
+ "The start command requires ALLOWED_HOSTS as a comma-separated host allowlist."
272
+ );
273
+ const s = e.root, u = d(
274
+ s,
275
+ t.outDir ?? e.deployment?.outDir ?? w
276
+ ), a = d(
277
+ s,
278
+ i.outDir ?? b
279
+ ), c = h(O(a, "server-entry.js")).href, l = o ? await o.importModule(c) : await import(c);
280
+ if (!Q(l))
281
+ throw new Error(
282
+ "The application server bundle does not export a Node build runtime."
283
+ );
284
+ return (o?.serve ?? (await import("./node/index.js")).serveNodeBuild)({
285
+ allowedHosts: n,
286
+ base: h(`${s}/`).href,
287
+ clientDir: m(s, u),
288
+ createHandler: l.createHandler,
289
+ env: r,
290
+ host: t.host,
291
+ port: t.port,
292
+ readyPath: "/.well-known/ready",
293
+ shutdown: { signals: ["SIGINT", "SIGTERM"] },
294
+ static: l.createStatic
295
+ });
296
+ }
297
+ function Q(t) {
298
+ return typeof t.createHandler == "function" && (t.createStatic === void 0 || typeof t.createStatic == "function");
299
+ }
300
+ async function Z({
238
301
  build: t,
239
302
  config: e,
240
303
  createViteConfig: r,
241
304
  frameworkServerOutDir: o,
242
305
  options: i,
243
- outDir: s,
244
- root: n,
306
+ outDir: n,
307
+ root: s,
245
308
  runtime: u
246
309
  }) {
247
310
  await t(
@@ -253,82 +316,83 @@ async function H({
253
316
  emptyOutDir: !0,
254
317
  outDir: o,
255
318
  rollupOptions: {
256
- input: X,
319
+ input: I,
257
320
  output: { entryFileNames: "server-entry.js" }
258
321
  },
259
322
  ssr: !0
260
323
  }
261
324
  })
262
325
  );
263
- const a = P(
264
- u ? await u.readText(d(s, "demiurge-manifest.json")) : await N(d(s, "demiurge-manifest.json"), "utf8")
265
- ), c = `${b(d(o, "server-entry.js")).href}?build=${u?.now() ?? Date.now()}`, m = u ? await u.importModule(c) : await import(c);
266
- if (!Z(m.routes))
326
+ const a = $(
327
+ u ? await u.readText(d(n, "demiurge-manifest.json")) : await P(d(n, "demiurge-manifest.json"), "utf8")
328
+ ), c = `${h(d(o, "server-entry.js")).href}?build=${u?.now() ?? Date.now()}`, l = u ? await u.importModule(c) : await import(c);
329
+ if (!et(l.routes))
267
330
  throw new Error("The framework server bundle does not export routes.");
268
- const p = await (u?.generate ?? C)({
331
+ const f = await (u?.generate ?? j)({
269
332
  fonts: e.assets?.fonts,
270
333
  images: e.assets?.images,
271
334
  origin: i.origin ?? e.deployment?.static?.origin,
272
- outDir: s,
273
- root: n,
274
- routes: m.routes,
335
+ outDir: n,
336
+ root: s,
337
+ routes: l.routes,
275
338
  ssr: a,
276
339
  staticFileHeaders: e.security?.staticFileHeaders ?? []
277
- }), g = e.deployment?.static?.provider;
278
- return { deploymentOutDir: g ? await $({
279
- deployment: g,
280
- manifest: p,
281
- outDir: s,
282
- projectRoot: n
283
- }) : void 0, manifest: p };
340
+ }), p = e.deployment?.static?.provider;
341
+ return { deploymentOutDir: p ? await V({
342
+ deployment: p,
343
+ manifest: f,
344
+ outDir: n,
345
+ projectRoot: s
346
+ }) : void 0, manifest: f };
284
347
  }
285
- function Nt(t, e, r) {
286
- return d(t, e ?? r ?? T);
348
+ function Pt(t, e, r) {
349
+ return d(t, e ?? r ?? w);
287
350
  }
288
- async function Q(t, e, r, o) {
289
- const i = l(t, e);
290
- if (!i || i === ".." || i.startsWith(`..${f}`) || E(i))
351
+ async function tt(t, e, r, o) {
352
+ const i = m(t, e);
353
+ if (!i || i === ".." || i.startsWith(`..${v}`) || D(i))
291
354
  throw new Error("The static output directory must be inside the Vite root.");
292
- if (r && w(e, r))
355
+ if (r && E(e, r))
293
356
  throw new Error("The static output directory must not overlap the Vite public directory.");
294
- if (w(e, o))
357
+ if (E(e, o))
295
358
  throw new Error("The static output directory must not overlap the framework server directory.");
296
- let s;
359
+ let n;
297
360
  try {
298
- s = await D(e);
299
- } catch (n) {
300
- if (tt(n)) return;
301
- throw n;
361
+ n = await _(e);
362
+ } catch (s) {
363
+ if (rt(s)) return;
364
+ throw s;
302
365
  }
303
- if (s.length && !s.includes("demiurge-manifest.json") && !s.includes("demiurge-static-manifest.json"))
366
+ if (n.length && !n.includes("demiurge-manifest.json") && !n.includes("demiurge-static-manifest.json"))
304
367
  throw new Error(
305
368
  "The static output directory contains files that a Demiurge build did not create."
306
369
  );
307
370
  }
308
- function Z(t) {
371
+ function et(t) {
309
372
  return !t || typeof t != "object" || Array.isArray(t) ? !1 : Object.values(t).every((e) => typeof e == "function");
310
373
  }
311
- function w(t, e) {
312
- const r = l(t, e), o = l(e, t);
313
- return y(r) || y(o);
374
+ function E(t, e) {
375
+ const r = m(t, e), o = m(e, t);
376
+ return S(r) || S(o);
314
377
  }
315
- function y(t) {
316
- return !t || t !== ".." && !t.startsWith(`..${f}`) && !E(t);
378
+ function S(t) {
379
+ return !t || t !== ".." && !t.startsWith(`..${v}`) && !D(t);
317
380
  }
318
- function tt(t) {
381
+ function rt(t) {
319
382
  return t instanceof Error && "code" in t && t.code === "ENOENT";
320
383
  }
321
384
  export {
322
- B as INSPECT_EXIT_FINDINGS,
323
- J as INSPECT_EXIT_INVALID,
324
- W as INSPECT_EXIT_OK,
325
- Rt as helpText,
326
- St as parseCliArguments,
327
- P as parseClientManifest,
328
- Nt as resolvePreviewOutputDirectory,
329
- Dt as runBuild,
330
- Tt as runDev,
331
- Ot as runInspectCommand,
332
- Q as validateBuildOutputDirectory
385
+ J as INSPECT_EXIT_FINDINGS,
386
+ K as INSPECT_EXIT_INVALID,
387
+ G as INSPECT_EXIT_OK,
388
+ Nt as helpText,
389
+ Rt as parseCliArguments,
390
+ $ as parseClientManifest,
391
+ Pt as resolvePreviewOutputDirectory,
392
+ bt as runBuild,
393
+ It as runDev,
394
+ Tt as runInspectCommand,
395
+ _t as runStart,
396
+ tt as validateBuildOutputDirectory
333
397
  };
334
398
  //# sourceMappingURL=cli.js.map