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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/README.md +2 -0
  2. package/dist/adapter/testing.d.ts +33 -0
  3. package/dist/adapter/testing.d.ts.map +1 -0
  4. package/dist/adapter/testing.js +251 -0
  5. package/dist/adapter/testing.js.map +1 -0
  6. package/dist/browser/file-router.d.ts.map +1 -1
  7. package/dist/chunks/document-shell-WoM8yZlR.js +35 -0
  8. package/dist/chunks/document-shell-WoM8yZlR.js.map +1 -0
  9. package/dist/chunks/image-codec-Di53WpcH.js +141 -0
  10. package/dist/chunks/image-codec-Di53WpcH.js.map +1 -0
  11. package/dist/chunks/images-Edar3eU1.js +339 -0
  12. package/dist/chunks/images-Edar3eU1.js.map +1 -0
  13. package/dist/chunks/request-metadata-DaIYq4Ea.js +677 -0
  14. package/dist/chunks/request-metadata-DaIYq4Ea.js.map +1 -0
  15. package/dist/chunks/streaming-D0fGAuiO.js +469 -0
  16. package/dist/chunks/streaming-D0fGAuiO.js.map +1 -0
  17. package/dist/chunks/{testing-DBjVCN5v.js → testing-CRflAw4X.js} +1300 -1139
  18. package/dist/chunks/testing-CRflAw4X.js.map +1 -0
  19. package/dist/cli.d.ts.map +1 -1
  20. package/dist/cli.js +63 -54
  21. package/dist/cli.js.map +1 -1
  22. package/dist/data/cache.d.ts +8 -0
  23. package/dist/data/cache.d.ts.map +1 -1
  24. package/dist/data/idempotency.d.ts.map +1 -1
  25. package/dist/data/index.d.ts +3 -1
  26. package/dist/data/index.d.ts.map +1 -1
  27. package/dist/data/testing.d.ts.map +1 -1
  28. package/dist/data/testing.js +94 -72
  29. package/dist/data/testing.js.map +1 -1
  30. package/dist/data/tiered.d.ts +7 -0
  31. package/dist/data/tiered.d.ts.map +1 -0
  32. package/dist/document/deferred-scripts.d.ts +11 -0
  33. package/dist/document/deferred-scripts.d.ts.map +1 -0
  34. package/dist/document/hydration.d.ts.map +1 -1
  35. package/dist/document/index.d.ts +4 -1
  36. package/dist/document/index.d.ts.map +1 -1
  37. package/dist/document/render.d.ts.map +1 -1
  38. package/dist/document/scripts.d.ts +12 -1
  39. package/dist/document/scripts.d.ts.map +1 -1
  40. package/dist/document/trusted-types.d.ts +10 -0
  41. package/dist/document/trusted-types.d.ts.map +1 -0
  42. package/dist/edge/assets.d.ts +14 -0
  43. package/dist/edge/assets.d.ts.map +1 -0
  44. package/dist/edge/index.d.ts +19 -0
  45. package/dist/edge/index.d.ts.map +1 -0
  46. package/dist/edge/index.js +286 -0
  47. package/dist/edge/index.js.map +1 -0
  48. package/dist/edge/stores.d.ts +8 -0
  49. package/dist/edge/stores.d.ts.map +1 -0
  50. package/dist/edge/streaming.d.ts +7 -0
  51. package/dist/edge/streaming.d.ts.map +1 -0
  52. package/dist/index.d.ts +7 -7
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +895 -556
  55. package/dist/index.js.map +1 -1
  56. package/dist/internal/testing.js +6 -6
  57. package/dist/kv/index.d.ts +5 -0
  58. package/dist/kv/index.d.ts.map +1 -0
  59. package/dist/kv/index.js +126 -0
  60. package/dist/kv/index.js.map +1 -0
  61. package/dist/kv/rate-limit-store.d.ts +8 -0
  62. package/dist/kv/rate-limit-store.d.ts.map +1 -0
  63. package/dist/kv/store.d.ts +28 -0
  64. package/dist/kv/store.d.ts.map +1 -0
  65. package/dist/node/font.d.ts +5 -0
  66. package/dist/node/font.d.ts.map +1 -0
  67. package/dist/node/http.d.ts.map +1 -1
  68. package/dist/node/image.d.ts +15 -0
  69. package/dist/node/image.d.ts.map +1 -0
  70. package/dist/node/index.d.ts +4 -0
  71. package/dist/node/index.d.ts.map +1 -1
  72. package/dist/node/index.js +25 -23
  73. package/dist/node/index.js.map +1 -1
  74. package/dist/node/static.d.ts.map +1 -1
  75. package/dist/node/streaming.d.ts.map +1 -1
  76. package/dist/platform/analytics.d.ts +58 -5
  77. package/dist/platform/analytics.d.ts.map +1 -1
  78. package/dist/platform/font-assets.d.ts +19 -0
  79. package/dist/platform/font-assets.d.ts.map +1 -0
  80. package/dist/platform/fonts.d.ts +14 -4
  81. package/dist/platform/fonts.d.ts.map +1 -1
  82. package/dist/platform/image-codec.d.ts +15 -0
  83. package/dist/platform/image-codec.d.ts.map +1 -0
  84. package/dist/platform/image-url.d.ts +17 -0
  85. package/dist/platform/image-url.d.ts.map +1 -0
  86. package/dist/platform/image.d.ts +8 -0
  87. package/dist/platform/image.d.ts.map +1 -0
  88. package/dist/platform/images.d.ts +15 -0
  89. package/dist/platform/images.d.ts.map +1 -1
  90. package/dist/platform/index.d.ts +13 -6
  91. package/dist/platform/index.d.ts.map +1 -1
  92. package/dist/platform/observability.d.ts +2 -1
  93. package/dist/platform/observability.d.ts.map +1 -1
  94. package/dist/platform/web-vitals-client.d.ts +32 -0
  95. package/dist/platform/web-vitals-client.d.ts.map +1 -0
  96. package/dist/platform/web-vitals.d.ts +78 -0
  97. package/dist/platform/web-vitals.d.ts.map +1 -0
  98. package/dist/redis/index.d.ts +5 -0
  99. package/dist/redis/index.d.ts.map +1 -0
  100. package/dist/redis/index.js +209 -0
  101. package/dist/redis/index.js.map +1 -0
  102. package/dist/redis/rate-limit-store.d.ts +8 -0
  103. package/dist/redis/rate-limit-store.d.ts.map +1 -0
  104. package/dist/redis/store.d.ts +8 -0
  105. package/dist/redis/store.d.ts.map +1 -0
  106. package/dist/route/action.d.ts.map +1 -1
  107. package/dist/route/middleware.d.ts.map +1 -1
  108. package/dist/route/response.d.ts.map +1 -1
  109. package/dist/router/index.d.ts +1 -1
  110. package/dist/router/index.d.ts.map +1 -1
  111. package/dist/router/manifest.d.ts +1 -0
  112. package/dist/router/manifest.d.ts.map +1 -1
  113. package/dist/security/cookies.d.ts +26 -0
  114. package/dist/security/cookies.d.ts.map +1 -0
  115. package/dist/security/env.d.ts.map +1 -1
  116. package/dist/security/fetch-metadata.d.ts +29 -0
  117. package/dist/security/fetch-metadata.d.ts.map +1 -0
  118. package/dist/security/index.d.ts +5 -1
  119. package/dist/security/index.d.ts.map +1 -1
  120. package/dist/security/policy.d.ts +2 -27
  121. package/dist/security/policy.d.ts.map +1 -1
  122. package/dist/security/rate-limit.d.ts +6 -3
  123. package/dist/security/rate-limit.d.ts.map +1 -1
  124. package/dist/security/request.d.ts.map +1 -1
  125. package/dist/security/types.d.ts +82 -6
  126. package/dist/security/types.d.ts.map +1 -1
  127. package/dist/security/verification.d.ts.map +1 -1
  128. package/dist/server/document-shell.d.ts +12 -0
  129. package/dist/server/document-shell.d.ts.map +1 -0
  130. package/dist/server/index.d.ts +1 -1
  131. package/dist/server/index.d.ts.map +1 -1
  132. package/dist/server/request-handler.d.ts +6 -2
  133. package/dist/server/request-handler.d.ts.map +1 -1
  134. package/dist/static/images.d.ts +13 -0
  135. package/dist/static/images.d.ts.map +1 -0
  136. package/dist/static/index.d.ts +8 -0
  137. package/dist/static/index.d.ts.map +1 -1
  138. package/dist/static/index.js +421 -313
  139. package/dist/static/index.js.map +1 -1
  140. package/dist/static/vercel.d.ts +3 -0
  141. package/dist/static/vercel.d.ts.map +1 -1
  142. package/dist/vite/index.d.ts +3 -0
  143. package/dist/vite/index.d.ts.map +1 -1
  144. package/dist/vite/index.js +1041 -652
  145. package/dist/vite/index.js.map +1 -1
  146. package/dist/vite/plugin.d.ts +9 -0
  147. package/dist/vite/plugin.d.ts.map +1 -1
  148. package/dist/vite/policy-verification.d.ts.map +1 -1
  149. package/dist/vite/route-audit.d.ts +50 -0
  150. package/dist/vite/route-audit.d.ts.map +1 -0
  151. package/package.json +34 -3
  152. package/dist/chunks/request-metadata-DwEO1EAS.js +0 -477
  153. package/dist/chunks/request-metadata-DwEO1EAS.js.map +0 -1
  154. package/dist/chunks/streaming-Ci6vf3BB.js +0 -353
  155. package/dist/chunks/streaming-Ci6vf3BB.js.map +0 -1
  156. package/dist/chunks/testing-DBjVCN5v.js.map +0 -1
@@ -3,13 +3,18 @@ import type { LinkTag, ResolvedMetadata, ScriptTag } from "../document";
3
3
  import { type RouteManifest } from "../router";
4
4
  import { handleRequestWithManifest } from "../server";
5
5
  import { type RouteImporter } from "../route";
6
+ import type { FontContribution } from "../platform/fonts";
7
+ import type { ImagePolicy } from "../platform/images";
6
8
  import { type StaticPolicyFinding } from "./policy-verification";
7
9
  import type { StaticFileHeaderPatternRule, VercelStaticDeployment } from "../static";
8
10
  export type DemiurgeVitePluginOptions = {
11
+ devtools?: boolean;
9
12
  document?: {
10
13
  lang?: string;
11
14
  title?: string;
12
15
  };
16
+ fonts?: FontContribution;
17
+ images?: ImagePolicy;
13
18
  routesDir?: string;
14
19
  static?: {
15
20
  deployment?: VercelStaticDeployment;
@@ -22,6 +27,8 @@ export type DemiurgeVitePluginOptions = {
22
27
  };
23
28
  export type DemiurgeVitePluginApi = {
24
29
  demiurge: true;
30
+ fonts?: FontContribution;
31
+ images?: ImagePolicy;
25
32
  staticDeployment?: VercelStaticDeployment;
26
33
  staticFileHeaders?: readonly StaticFileHeaderPatternRule[];
27
34
  };
@@ -29,6 +36,8 @@ export declare function demiurge(options?: DemiurgeVitePluginOptions): Plugin;
29
36
  export declare function stripClientPageData(code: string): string;
30
37
  export declare function createClientEntrySource(root: string, options?: DemiurgeVitePluginOptions): string;
31
38
  export declare function createServerEntrySource(root: string, options?: DemiurgeVitePluginOptions): string;
39
+ export declare function isRouteAuditEnabled(options: DemiurgeVitePluginOptions): boolean;
40
+ export declare function createDevImageOptimizer(server: ViteDevServer, options: DemiurgeVitePluginOptions): import("../node").StaticFileHandler;
32
41
  export declare function assertRootNotFoundRoute(root: string, options?: DemiurgeVitePluginOptions): Promise<void>;
33
42
  export declare function declaresPageRoute(source: string): boolean;
34
43
  export declare function missingRootNotFoundBuildMessage(routesDir: string, pageRoute: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/vite/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,MAAM,E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;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,UAWA;AAwBD,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,MAAM,0CAalB;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAM,8BAU9D;AA0CD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,yBAA8B,kCAgBxC;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,mBAAmB,EAAE,UAKzE"}
@@ -1 +1 @@
1
- {"version":3,"file":"policy-verification.d.ts","sourceRoot":"","sources":["../../src/vite/policy-verification.ts"],"names":[],"mappings":"AAsBA,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,cAAc,GAAG,yBAAyB,GAAG,oBAAoB,GACrE,+BAA+B,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAmCF,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,kCAGvD;AAED,wBAAsB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kCAUzE"}
1
+ {"version":3,"file":"policy-verification.d.ts","sourceRoot":"","sources":["../../src/vite/policy-verification.ts"],"names":[],"mappings":"AA4BA,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,cAAc,GAAG,yBAAyB,GAAG,oBAAoB,GACrE,+BAA+B,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAmCF,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,kCAGvD;AAED,wBAAsB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kCAUzE"}
@@ -0,0 +1,50 @@
1
+ import { type CacheScope } from "../data";
2
+ import type { ResolvedMetadata } from "../document";
3
+ import { type RouteManifest } from "../router";
4
+ import type { HttpMethod, PageRenderMode, PathVars } from "../route";
5
+ import { type RoutePolicy, type SecurityAudit, type SecurityAuditFinding } from "../security";
6
+ export declare const ROUTE_AUDIT_PATH = "/_demiurge/audit";
7
+ export type RouteAuditCacheRead = {
8
+ key: string;
9
+ scope: CacheScope;
10
+ staleWhileRevalidate?: string;
11
+ tags: string[];
12
+ ttl?: string;
13
+ };
14
+ export type RouteAuditScript = {
15
+ findings: SecurityAuditFinding[];
16
+ integrity?: string;
17
+ nonce?: string;
18
+ purpose?: string;
19
+ src: string;
20
+ strategy: string;
21
+ };
22
+ export type RouteAuditRoute = {
23
+ file: string;
24
+ groups: string[];
25
+ layouts: string[];
26
+ methods: HttpMethod[];
27
+ middlewares: string[];
28
+ params: PathVars;
29
+ pattern: string;
30
+ policies: string[];
31
+ render?: PageRenderMode;
32
+ };
33
+ export type RouteAudit = {
34
+ audit: SecurityAudit;
35
+ cacheControl?: string;
36
+ cacheReads: RouteAuditCacheRead[];
37
+ kind: "page" | "resource" | "unmatched";
38
+ metadata?: ResolvedMetadata;
39
+ method: HttpMethod;
40
+ nonce?: string;
41
+ pathname: string;
42
+ policy: RoutePolicy;
43
+ route?: RouteAuditRoute;
44
+ scripts: RouteAuditScript[];
45
+ };
46
+ export declare function isRouteAuditRequest(request: Request): boolean;
47
+ export declare function createRouteAuditResponse(manifest: RouteManifest, request: Request): Promise<Response>;
48
+ export declare function createRouteAudit(manifest: RouteManifest, target: string, request: Request): Promise<RouteAudit>;
49
+ export declare function renderRouteAuditDocument(report: RouteAudit): string;
50
+ //# sourceMappingURL=route-audit.d.ts.map
@@ -0,0 +1 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nB,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,aAAa,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC;IACxC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,WAEnD;AAED,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,OAAO,qBA4BjB;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,UAAU,CAAC,CA6ErB;AA6GD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,UAAU,UA8B1D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@demiurgejs/core",
3
- "version": "0.2.0-beta.1",
3
+ "version": "0.2.0-beta.3",
4
4
  "description": "A React framework for secure routing, server rendering, and framework-managed HTML documents.",
5
5
  "license": "MIT",
6
6
  "author": "North Shore Software Labs",
@@ -19,7 +19,8 @@
19
19
  "router",
20
20
  "ssr",
21
21
  "vite",
22
- "node"
22
+ "node",
23
+ "edge"
23
24
  ],
24
25
  "type": "module",
25
26
  "bin": {
@@ -36,6 +37,10 @@
36
37
  "types": "./dist/index.d.ts",
37
38
  "default": "./dist/index.js"
38
39
  },
40
+ "./adapter/testing": {
41
+ "types": "./dist/adapter/testing.d.ts",
42
+ "default": "./dist/adapter/testing.js"
43
+ },
39
44
  "./internal/testing": {
40
45
  "types": "./dist/internal/testing.d.ts",
41
46
  "default": "./dist/internal/testing.js"
@@ -52,6 +57,18 @@
52
57
  "types": "./dist/node/index.d.ts",
53
58
  "default": "./dist/node/index.js"
54
59
  },
60
+ "./edge": {
61
+ "types": "./dist/edge/index.d.ts",
62
+ "default": "./dist/edge/index.js"
63
+ },
64
+ "./kv": {
65
+ "types": "./dist/kv/index.d.ts",
66
+ "default": "./dist/kv/index.js"
67
+ },
68
+ "./redis": {
69
+ "types": "./dist/redis/index.d.ts",
70
+ "default": "./dist/redis/index.js"
71
+ },
55
72
  "./static": {
56
73
  "types": "./dist/static/index.d.ts",
57
74
  "default": "./dist/static/index.js"
@@ -73,11 +90,23 @@
73
90
  "provenance": true
74
91
  },
75
92
  "peerDependencies": {
93
+ "@vercel/routing-utils": "6.5.0",
94
+ "ioredis": "^5.0.0",
76
95
  "react": "^19.0.0",
77
96
  "react-dom": "^19.0.0",
97
+ "sharp": "^0.35.0",
78
98
  "vite": "^6.0.7"
79
99
  },
80
100
  "peerDependenciesMeta": {
101
+ "@vercel/routing-utils": {
102
+ "optional": true
103
+ },
104
+ "ioredis": {
105
+ "optional": true
106
+ },
107
+ "sharp": {
108
+ "optional": true
109
+ },
81
110
  "vite": {
82
111
  "optional": true
83
112
  }
@@ -87,17 +116,19 @@
87
116
  "@types/node": "^22.13.0",
88
117
  "@types/react": "^19.0.2",
89
118
  "@types/react-dom": "^19.0.2",
119
+ "@vercel/routing-utils": "6.5.0",
90
120
  "@vitejs/plugin-react": "^4.3.4",
91
121
  "@vitest/coverage-v8": "^4.1.10",
122
+ "ioredis": "^5.4.1",
92
123
  "jsdom": "^30.0.1",
93
124
  "react": "^19.0.0",
94
125
  "react-dom": "^19.0.0",
126
+ "sharp": "^0.35.3",
95
127
  "typescript": "^5.7.2",
96
128
  "vite": "^6.0.7",
97
129
  "vitest": "^4.1.10"
98
130
  },
99
131
  "dependencies": {
100
- "@vercel/routing-utils": "6.5.0",
101
132
  "magic-string": "^0.30.21"
102
133
  }
103
134
  }
@@ -1,477 +0,0 @@
1
- import { renderToString as k } from "react-dom/server";
2
- import { createContext as C, useContext as O, createElement as p } from "react";
3
- const P = {
4
- backgroundLifetime: !1,
5
- crossOriginIsolationHeaders: !1,
6
- nonceInjection: !1,
7
- sharedCache: !1,
8
- staticOutput: !1,
9
- streaming: !1,
10
- webSocket: !1,
11
- webTransport: !1
12
- };
13
- function le(e) {
14
- return {
15
- capabilities: {
16
- ...P,
17
- ...e.capabilities
18
- },
19
- name: e.name
20
- };
21
- }
22
- function _(e, t) {
23
- const n = [...new Set(t)], r = n.filter(
24
- (o) => !e.capabilities[o]
25
- );
26
- return {
27
- adapter: e.name,
28
- missing: r,
29
- ok: r.length === 0,
30
- required: n
31
- };
32
- }
33
- function pe(e, t) {
34
- const n = _(e, t);
35
- if (!n.ok)
36
- throw new Error(
37
- `Adapter "${e.name}" does not support required capabilities: ${n.missing.join(", ")}.`
38
- );
39
- return n;
40
- }
41
- const R = "__demiurge_data", N = "data-demiurge-hydrate", T = "data-demiurge-fallback";
42
- function M(e, t = {}) {
43
- return j(
44
- JSON.stringify({ data: e, hasData: !0, ...t })
45
- );
46
- }
47
- function fe(e) {
48
- const t = e.getElementById(R), n = t?.tagName === "TEMPLATE" ? t.content.textContent : t?.textContent;
49
- if (n)
50
- try {
51
- return JSON.parse(n);
52
- } catch (r) {
53
- throw new Error(
54
- "Demiurge could not parse the initial route data payload.",
55
- { cause: r }
56
- );
57
- }
58
- }
59
- function j(e) {
60
- return e.replace(/&/g, "\\u0026").replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
61
- }
62
- const q = /* @__PURE__ */ new Set([
63
- "afterInteractive",
64
- "beforeInteractive",
65
- "module"
66
- ]), d = Symbol("demiurge.scriptPlacement"), D = C(
67
- void 0
68
- );
69
- function B(e = {}) {
70
- let t = !1;
71
- const n = [...e.scripts ?? []], r = new Set(n.map((i) => i.src)), o = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map();
72
- return {
73
- get dev() {
74
- return e.dev ?? !1;
75
- },
76
- get headFlushed() {
77
- return t;
78
- },
79
- flushHead() {
80
- t = !0;
81
- },
82
- nonce: e.nonce,
83
- register(i) {
84
- if (r.has(i.src) || o.has(i.src))
85
- return "skip";
86
- if (o.add(i.src), !t)
87
- return a.set(i.src, {
88
- ...i,
89
- [d]: "hoisted"
90
- }), "hoist";
91
- if (i.strategy === "beforeInteractive" && (e.dev ?? !1))
92
- throw new Error(
93
- `A render-discovered beforeInteractive script ${JSON.stringify(i.src)} was found after the document head flushed. Declare it in export const scripts.`
94
- );
95
- return "render";
96
- },
97
- scripts() {
98
- return x([...n, ...a.values()]);
99
- }
100
- };
101
- }
102
- function me(e) {
103
- const t = O(D), n = H(e);
104
- if (!t) {
105
- if (typeof document > "u")
106
- throw new Error(
107
- `The script ${JSON.stringify(n.src)} rendered outside a Demiurge document render context. A server render must wrap its component tree with the script render context.`
108
- );
109
- return G(n.src) ? null : b({
110
- ...n,
111
- [d]: "in-place"
112
- }, U());
113
- }
114
- return t.register(n) !== "render" ? null : b({
115
- ...n,
116
- [d]: "in-place"
117
- }, t.nonce);
118
- }
119
- function b(e, t) {
120
- return p("script", {
121
- async: e.async,
122
- "data-api": e.dataApi,
123
- "data-domain": e.dataDomain,
124
- "data-demiurge-script-placement": e[d],
125
- defer: e.defer,
126
- id: e.id,
127
- integrity: e.integrity,
128
- nonce: e.nonce ?? t,
129
- referrerPolicy: e.referrerPolicy,
130
- src: e.src,
131
- type: e.type ?? Y(e.strategy)
132
- });
133
- }
134
- function G(e) {
135
- if (typeof document > "u")
136
- return !1;
137
- const t = new URL(e, document.baseURI).href;
138
- return [...document.scripts].some(
139
- (n) => n.src === t && n.dataset.demiurgeScriptPlacement !== "in-place"
140
- );
141
- }
142
- function U() {
143
- if (!(typeof document > "u"))
144
- return [...document.scripts].reverse().find((e) => e.nonce)?.nonce;
145
- }
146
- function ye(e) {
147
- return e;
148
- }
149
- function H(e) {
150
- const t = e.strategy ?? "afterInteractive";
151
- if (!q.has(t))
152
- throw new Error(
153
- `Unsupported script strategy ${JSON.stringify(t)}. Demiurge 0.1 supports "beforeInteractive", "module", and "afterInteractive"; deferred, visibility-triggered, and worker loading require a future client script runtime.`
154
- );
155
- if (t === "module" && e.type && e.type !== "module")
156
- throw new Error(
157
- 'The "module" script strategy cannot be combined with type="text/javascript".'
158
- );
159
- return {
160
- ...e,
161
- kind: "script",
162
- strategy: t
163
- };
164
- }
165
- function J(e, t) {
166
- return p(D.Provider, { value: e, children: t });
167
- }
168
- async function he(e, t) {
169
- const n = [];
170
- for (const r of e) {
171
- if (!r)
172
- continue;
173
- const o = typeof r == "function" ? await r(t) : r;
174
- n.push(...o);
175
- }
176
- return x(L(n));
177
- }
178
- function L(e) {
179
- const t = /* @__PURE__ */ new Map();
180
- for (const n of e)
181
- t.set(v(n), {
182
- ...t.get(v(n)),
183
- ...n
184
- });
185
- return [...t.values()];
186
- }
187
- function v(e) {
188
- return [
189
- e.src,
190
- e.type ?? "",
191
- e.integrity ?? "",
192
- e.strategy
193
- ].join("\0");
194
- }
195
- function F(e, t) {
196
- return w(e.strategy) - w(t.strategy) || e.src.localeCompare(t.src);
197
- }
198
- function x(e) {
199
- return e.sort(F);
200
- }
201
- function Y(e) {
202
- return e === "module" ? "module" : void 0;
203
- }
204
- function w(e) {
205
- return e === "beforeInteractive" ? 0 : e === "module" ? 1 : 2;
206
- }
207
- const z = "data-demiurge-structured-data";
208
- function K(e) {
209
- if (e.body) {
210
- const { html: t, ...n } = e.body, { prefix: r, suffix: o } = W({ ...e, body: n });
211
- return `${r}${t}${o}`;
212
- }
213
- return Q(e);
214
- }
215
- function W({
216
- body: e,
217
- entrySrc: t,
218
- lang: n = "en",
219
- links: r = [],
220
- metadata: o,
221
- nonce: a,
222
- scripts: i = [],
223
- styles: m = [],
224
- title: y = "Demiurge App"
225
- }) {
226
- const h = o?.title ?? y, l = [
227
- ...i.filter(($) => $[d] !== "hoisted").map(($) => ` ${S($, a)}`),
228
- Z(e.data, e.navigation),
229
- ...t ? [E(t, a)] : []
230
- ].join(`
231
- `);
232
- return {
233
- prefix: `<!doctype html>
234
- <html lang="${s(n)}">
235
- <head>
236
- ${I({ links: r, metadata: o, nonce: a, scripts: i, styles: m, title: h })}
237
- </head>
238
- <body>
239
- ${X(e)}`,
240
- suffix: `</div>
241
- ${l}
242
- </body>
243
- </html>
244
- `
245
- };
246
- }
247
- function Q({
248
- entrySrc: e,
249
- lang: t = "en",
250
- links: n = [],
251
- metadata: r,
252
- nonce: o,
253
- scripts: a = [],
254
- styles: i = [],
255
- title: m = "Demiurge App"
256
- }) {
257
- const y = r?.title ?? m, h = [
258
- V(),
259
- ...a.filter((l) => l[d] !== "hoisted").map((l) => ` ${S(l, o)}`),
260
- ...e ? [E(e, o)] : []
261
- ].join(`
262
- `);
263
- return `<!doctype html>
264
- <html lang="${s(t)}">
265
- <head>
266
- ${I({ links: n, metadata: r, nonce: o, scripts: a, styles: i, title: y })}
267
- </head>
268
- <body>
269
- ${h}
270
- </body>
271
- </html>
272
- `;
273
- }
274
- function V(e) {
275
- return ' <div id="root"></div>';
276
- }
277
- function X(e) {
278
- const t = e.fallback ? ` ${T}="${s(e.fallback)}"` : "";
279
- return ` <div id="root" ${N}=""${t}>`;
280
- }
281
- function Z(e, t) {
282
- return ` <template id="${R}">${M(e, { navigation: t })}</template>`;
283
- }
284
- function E(e, t) {
285
- return ` <script type="module" src="${s(e)}"${c("nonce", t)}><\/script>`;
286
- }
287
- function I({
288
- links: e,
289
- metadata: t,
290
- nonce: n,
291
- scripts: r,
292
- styles: o,
293
- title: a
294
- }) {
295
- return [
296
- u({
297
- content: t?.charset ?? "UTF-8",
298
- name: "charset"
299
- }),
300
- u({
301
- content: t?.viewport ?? "width=device-width, initial-scale=1.0",
302
- name: "viewport"
303
- }),
304
- ` <title>${s(a)}</title>`,
305
- ...t?.description ? [
306
- u({
307
- content: t.description,
308
- name: "description"
309
- })
310
- ] : [],
311
- ...t?.canonical ? [
312
- g({
313
- href: t.canonical,
314
- rel: "canonical"
315
- })
316
- ] : [],
317
- ...ee(t),
318
- ...te(t),
319
- ...(t?.custom ?? []).map(ne),
320
- ...(t?.structuredData ?? []).map(
321
- (i) => re(i, n)
322
- ),
323
- ...o.map(
324
- (i) => ` <link rel="stylesheet" href="${s(i)}" />`
325
- ),
326
- ...e.map(g),
327
- ...r.filter((i) => i[d] === "hoisted").map((i) => ` ${S(i, n)}`)
328
- ].join(`
329
- `);
330
- }
331
- function ee(e) {
332
- if (!e?.robots)
333
- return [];
334
- const t = [
335
- e.robots.index === !1 ? "noindex" : "index",
336
- e.robots.follow === !1 ? "nofollow" : "follow"
337
- ];
338
- return [
339
- u({
340
- content: t.join(", "),
341
- name: "robots"
342
- })
343
- ];
344
- }
345
- function te(e) {
346
- return e?.openGraph ? [
347
- e.openGraph.title ? u({
348
- content: e.openGraph.title,
349
- property: "og:title"
350
- }) : null,
351
- e.openGraph.description ? u({
352
- content: e.openGraph.description,
353
- property: "og:description"
354
- }) : null,
355
- e.openGraph.image ? u({
356
- content: e.openGraph.image,
357
- property: "og:image"
358
- }) : null
359
- ].filter((t) => !!t) : [];
360
- }
361
- function ne(e) {
362
- return e.kind === "link" ? g(e) : u(e);
363
- }
364
- function re(e, t) {
365
- return ` <script type="application/ld+json"${t ? "" : ` ${z}`}${c("nonce", t)}>${oe(JSON.stringify(e.value))}<\/script>`;
366
- }
367
- function u(e) {
368
- if (e.name === "charset")
369
- return ` <meta charset="${s(e.content)}" />`;
370
- const t = e.name ? ` name="${s(e.name)}"` : "", n = e.property ? ` property="${s(e.property)}"` : "";
371
- return ` <meta${t}${n} content="${s(e.content)}" />`;
372
- }
373
- function g(e) {
374
- return ` <link${c("rel", e.rel)}${c("href", e.href)}${c("as", e.as)}${c("type", e.type)}${c("crossorigin", e.crossOrigin)}${c("hreflang", e.hrefLang)} />`;
375
- }
376
- function S(e, t) {
377
- return `<script${c("id", e.id)}${c("src", e.src)}${c("type", e.type ?? ie(e.strategy))}${c("nonce", e.nonce ?? t)}${c("integrity", e.integrity)}${c("referrerpolicy", e.referrerPolicy)}${c("data-api", e.dataApi)}${c("data-domain", e.dataDomain)}${c("data-demiurge-script-placement", e[d])}${A("async", e.async)}${A("defer", e.defer)}><\/script>`;
378
- }
379
- function ie(e) {
380
- return e === "module" ? "module" : void 0;
381
- }
382
- function c(e, t) {
383
- return t ? ` ${e}="${s(t)}"` : "";
384
- }
385
- function A(e, t) {
386
- return t ? ` ${e}` : "";
387
- }
388
- function s(e) {
389
- return e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;");
390
- }
391
- function oe(e) {
392
- return e.replaceAll("<", "\\u003c").replaceAll(">", "\\u003e").replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029");
393
- }
394
- function ce(e, t) {
395
- const n = p(e.page, {
396
- data: e.data,
397
- path: e.path,
398
- pathname: e.pathname
399
- }), r = e.layouts.reduceRight(
400
- (o, a) => p(a, {
401
- children: o,
402
- path: e.path,
403
- pathname: e.pathname
404
- }),
405
- n
406
- );
407
- return t ? J(t, r) : r;
408
- }
409
- function ae(e, t = {}) {
410
- return B({
411
- dev: t.dev,
412
- nonce: t.nonce,
413
- scripts: e.scripts
414
- });
415
- }
416
- function se(e, t = {}) {
417
- const n = ae(e, t), r = k(ce(e, n));
418
- return K({
419
- body: {
420
- data: e.data,
421
- html: r,
422
- navigation: e.render.mode === "static" ? "document" : t.navigation
423
- },
424
- entrySrc: t.clientEntry,
425
- lang: t.lang,
426
- links: e.links,
427
- metadata: e.metadata,
428
- nonce: t.nonce,
429
- scripts: n.scripts(),
430
- styles: t.styles,
431
- title: t.title
432
- });
433
- }
434
- function $e(e, t = {}) {
435
- const n = se(e, t);
436
- return new Response(n, {
437
- headers: {
438
- "content-type": "text/html; charset=utf-8"
439
- }
440
- });
441
- }
442
- const f = /* @__PURE__ */ new WeakMap();
443
- function ge(e) {
444
- return f.get(e);
445
- }
446
- function Se(e, t) {
447
- f.set(e, t);
448
- }
449
- function be(e, t) {
450
- const n = f.get(e);
451
- n && f.set(t, n);
452
- }
453
- export {
454
- N as H,
455
- z as S,
456
- ce as a,
457
- W as b,
458
- ae as c,
459
- le as d,
460
- K as e,
461
- se as f,
462
- fe as g,
463
- T as h,
464
- H as i,
465
- me as j,
466
- pe as k,
467
- _ as l,
468
- ye as m,
469
- he as n,
470
- B as o,
471
- ge as p,
472
- be as q,
473
- $e as r,
474
- Se as s,
475
- J as w
476
- };
477
- //# sourceMappingURL=request-metadata-DwEO1EAS.js.map