@demiurgejs/core 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +75 -2
- package/dist/adapter/index.d.ts +20 -0
- package/dist/adapter/index.d.ts.map +1 -0
- package/dist/browser/file-router.d.ts +30 -0
- package/dist/browser/file-router.d.ts.map +1 -0
- package/dist/browser/index.d.ts +3 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/chunks/index-BnX9Qxbm.js +44 -0
- package/dist/chunks/index-BnX9Qxbm.js.map +1 -0
- package/dist/chunks/ssr-O3d7Q73U.js +273 -0
- package/dist/chunks/ssr-O3d7Q73U.js.map +1 -0
- package/dist/chunks/streaming-27pwhjGC.js +343 -0
- package/dist/chunks/streaming-27pwhjGC.js.map +1 -0
- package/dist/chunks/testing-BBnJ5WUR.js +2871 -0
- package/dist/chunks/testing-BBnJ5WUR.js.map +1 -0
- package/dist/data/cache.d.ts +95 -0
- package/dist/data/cache.d.ts.map +1 -0
- package/dist/data/idempotency.d.ts +24 -0
- package/dist/data/idempotency.d.ts.map +1 -0
- package/dist/data/index.d.ts +5 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/testing.d.ts +7 -0
- package/dist/data/testing.d.ts.map +1 -0
- package/dist/data/testing.js +134 -0
- package/dist/data/testing.js.map +1 -0
- package/dist/document/hydration.d.ts +13 -0
- package/dist/document/hydration.d.ts.map +1 -0
- package/dist/document/index.d.ts +13 -0
- package/dist/document/index.d.ts.map +1 -0
- package/dist/document/links.d.ts +17 -0
- package/dist/document/links.d.ts.map +1 -0
- package/dist/document/metadata.d.ts +62 -0
- package/dist/document/metadata.d.ts.map +1 -0
- package/dist/document/render.d.ts +28 -0
- package/dist/document/render.d.ts.map +1 -0
- package/dist/document/scripts.d.ts +24 -0
- package/dist/document/scripts.d.ts.map +1 -0
- package/dist/document/seo.d.ts +42 -0
- package/dist/document/seo.d.ts.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1318 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/testing.d.ts +3 -0
- package/dist/internal/testing.d.ts.map +1 -0
- package/dist/internal/testing.js +22 -0
- package/dist/internal/testing.js.map +1 -0
- package/dist/node/http.d.ts +28 -0
- package/dist/node/http.d.ts.map +1 -0
- package/dist/node/index.d.ts +45 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +385 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/static.d.ts +9 -0
- package/dist/node/static.d.ts.map +1 -0
- package/dist/node/streaming.d.ts +5 -0
- package/dist/node/streaming.d.ts.map +1 -0
- package/dist/package-name.d.ts +2 -0
- package/dist/package-name.d.ts.map +1 -0
- package/dist/platform/analytics.d.ts +20 -0
- package/dist/platform/analytics.d.ts.map +1 -0
- package/dist/platform/fonts.d.ts +35 -0
- package/dist/platform/fonts.d.ts.map +1 -0
- package/dist/platform/images.d.ts +49 -0
- package/dist/platform/images.d.ts.map +1 -0
- package/dist/platform/index.d.ts +9 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/observability.d.ts +60 -0
- package/dist/platform/observability.d.ts.map +1 -0
- package/dist/route/action.d.ts +33 -0
- package/dist/route/action.d.ts.map +1 -0
- package/dist/route/http-error.d.ts +24 -0
- package/dist/route/http-error.d.ts.map +1 -0
- package/dist/route/index.d.ts +10 -0
- package/dist/route/index.d.ts.map +1 -0
- package/dist/route/page.d.ts +5 -0
- package/dist/route/page.d.ts.map +1 -0
- package/dist/route/response.d.ts +100 -0
- package/dist/route/response.d.ts.map +1 -0
- package/dist/route/types.d.ts +186 -0
- package/dist/route/types.d.ts.map +1 -0
- package/dist/route/webhook.d.ts +25 -0
- package/dist/route/webhook.d.ts.map +1 -0
- package/dist/router/index.d.ts +5 -0
- package/dist/router/index.d.ts.map +1 -0
- package/dist/router/manifest.d.ts +117 -0
- package/dist/router/manifest.d.ts.map +1 -0
- package/dist/router/navigation-data.d.ts +9 -0
- package/dist/router/navigation-data.d.ts.map +1 -0
- package/dist/routing/generate.d.ts +14 -0
- package/dist/routing/generate.d.ts.map +1 -0
- package/dist/routing/index.d.ts +3 -0
- package/dist/routing/index.d.ts.map +1 -0
- package/dist/routing/types.d.ts +38 -0
- package/dist/routing/types.d.ts.map +1 -0
- package/dist/security/audit.d.ts +16 -0
- package/dist/security/audit.d.ts.map +1 -0
- package/dist/security/cors.d.ts +7 -0
- package/dist/security/cors.d.ts.map +1 -0
- package/dist/security/csrf.d.ts +15 -0
- package/dist/security/csrf.d.ts.map +1 -0
- package/dist/security/env.d.ts +69 -0
- package/dist/security/env.d.ts.map +1 -0
- package/dist/security/index.d.ts +17 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/policy.d.ts +18 -0
- package/dist/security/policy.d.ts.map +1 -0
- package/dist/security/rate-limit.d.ts +6 -0
- package/dist/security/rate-limit.d.ts.map +1 -0
- package/dist/security/report.d.ts +13 -0
- package/dist/security/report.d.ts.map +1 -0
- package/dist/security/request.d.ts +11 -0
- package/dist/security/request.d.ts.map +1 -0
- package/dist/security/types.d.ts +137 -0
- package/dist/security/types.d.ts.map +1 -0
- package/dist/security/upload.d.ts +23 -0
- package/dist/security/upload.d.ts.map +1 -0
- package/dist/security/websocket.d.ts +13 -0
- package/dist/security/websocket.d.ts.map +1 -0
- package/dist/server/errors.d.ts +13 -0
- package/dist/server/errors.d.ts.map +1 -0
- package/dist/server/failure-site.d.ts +2 -0
- package/dist/server/failure-site.d.ts.map +1 -0
- package/dist/server/fallbacks.d.ts +10 -0
- package/dist/server/fallbacks.d.ts.map +1 -0
- package/dist/server/index.d.ts +14 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/negotiate.d.ts +3 -0
- package/dist/server/negotiate.d.ts.map +1 -0
- package/dist/server/not-found.d.ts +11 -0
- package/dist/server/not-found.d.ts.map +1 -0
- package/dist/server/problem.d.ts +18 -0
- package/dist/server/problem.d.ts.map +1 -0
- package/dist/server/render-tree.d.ts +4 -0
- package/dist/server/render-tree.d.ts.map +1 -0
- package/dist/server/request-handler.d.ts +40 -0
- package/dist/server/request-handler.d.ts.map +1 -0
- package/dist/server/request-metadata.d.ts +7 -0
- package/dist/server/request-metadata.d.ts.map +1 -0
- package/dist/server/ssr.d.ts +17 -0
- package/dist/server/ssr.d.ts.map +1 -0
- package/dist/static/index.d.ts +23 -0
- package/dist/static/index.d.ts.map +1 -0
- package/dist/static/index.js +256 -0
- package/dist/static/index.js.map +1 -0
- package/dist/vite/index.d.ts +4 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +580 -0
- package/dist/vite/index.js.map +1 -0
- package/dist/vite/plugin.d.ts +37 -0
- package/dist/vite/plugin.d.ts.map +1 -0
- package/package.json +90 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 North Shore Software Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,76 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Demiurge
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Demiurge is a React framework for secure routing, server rendering, and
|
|
4
|
+
framework-managed HTML documents. An application can run in one production
|
|
5
|
+
Node process. Adapter boundaries support other deployment configurations.
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- Node.js 22.13 or newer
|
|
10
|
+
- React and React DOM 19
|
|
11
|
+
- Vite 6 when using the `@demiurgejs/core/vite` build integration
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
pnpm add @demiurgejs/core react react-dom
|
|
17
|
+
pnpm add -D vite @vitejs/plugin-react typescript @types/node @types/react @types/react-dom
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Define a route under `src/routes`:
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { page } from "@demiurgejs/core";
|
|
24
|
+
|
|
25
|
+
export const GET = page({
|
|
26
|
+
view: () => <main>Hello from Demiurge</main>,
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Page applications also own their root `src/routes/@not-found.tsx` so a missing
|
|
31
|
+
URL never falls back to framework-branded markup:
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
export default function NotFound({ pathname }: { pathname: string }) {
|
|
35
|
+
return <main>Nothing at {pathname}</main>;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Add the framework to Vite:
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
import react from "@vitejs/plugin-react";
|
|
43
|
+
import { defineConfig } from "vite";
|
|
44
|
+
import { demiurge } from "@demiurgejs/core/vite";
|
|
45
|
+
|
|
46
|
+
export default defineConfig({
|
|
47
|
+
plugins: [demiurge({ typedRoutes: true }), react()],
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Run `vite` for development or `vite build` for a browser build. There is no
|
|
52
|
+
`index.html` to write: the framework renders the document and attaches CSP
|
|
53
|
+
nonces to what it emits.
|
|
54
|
+
|
|
55
|
+
Production SSR uses a separate server build and a runtime adapter. The minimum
|
|
56
|
+
working setup is in the
|
|
57
|
+
[README quickstart](https://github.com/NorthShoreSoftwareLabs/demiurge#deploy),
|
|
58
|
+
and [Node deployment](https://github.com/NorthShoreSoftwareLabs/demiurge/blob/main/docs/guides/node-deployment.md)
|
|
59
|
+
covers host allowlists, proxy trust, timeouts, and graceful shutdown.
|
|
60
|
+
|
|
61
|
+
## Package entry points
|
|
62
|
+
|
|
63
|
+
- `@demiurgejs/core` — routes, document APIs, security, caching, and browser runtime
|
|
64
|
+
- `@demiurgejs/core/node` — production Node HTTP, SSR, and static-file adapter
|
|
65
|
+
- `@demiurgejs/core/static` — static-output adapter
|
|
66
|
+
- `@demiurgejs/core/vite` — Vite framework plugin
|
|
67
|
+
- `@demiurgejs/core/data/testing` — cache-store conformance contract
|
|
68
|
+
- `@demiurgejs/core/internal/testing` — explicitly unstable test helpers
|
|
69
|
+
|
|
70
|
+
The Vite entry point is optional. Core, Node, and static consumers do not need
|
|
71
|
+
to install Vite unless their own build imports `@demiurgejs/core/vite`.
|
|
72
|
+
|
|
73
|
+
## Support and license
|
|
74
|
+
|
|
75
|
+
Report defects through [GitHub Issues](https://github.com/NorthShoreSoftwareLabs/demiurge/issues).
|
|
76
|
+
Demiurge is available under the [MIT License](./LICENSE).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type AdapterCapability = "backgroundLifetime" | "crossOriginIsolationHeaders" | "nonceInjection" | "sharedCache" | "staticOutput" | "streaming" | "webSocket" | "webTransport";
|
|
2
|
+
export type AdapterCapabilityMap = Record<AdapterCapability, boolean>;
|
|
3
|
+
export type Adapter = {
|
|
4
|
+
capabilities: AdapterCapabilityMap;
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
export type AdapterDefinition = {
|
|
8
|
+
capabilities?: Partial<AdapterCapabilityMap>;
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
export type AdapterCapabilityCheck = {
|
|
12
|
+
adapter: string;
|
|
13
|
+
missing: AdapterCapability[];
|
|
14
|
+
ok: boolean;
|
|
15
|
+
required: AdapterCapability[];
|
|
16
|
+
};
|
|
17
|
+
export declare function defineAdapter(definition: AdapterDefinition): Adapter;
|
|
18
|
+
export declare function checkAdapterCapabilities(adapter: Adapter, required: readonly AdapterCapability[]): AdapterCapabilityCheck;
|
|
19
|
+
export declare function assertAdapterCapabilities(adapter: Adapter, required: readonly AdapterCapability[]): AdapterCapabilityCheck;
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapter/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GACzB,oBAAoB,GACpB,6BAA6B,GAC7B,gBAAgB,GAChB,aAAa,GACb,cAAc,GACd,WAAW,GACX,WAAW,GACX,cAAc,CAAC;AAEnB,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAEtE,MAAM,MAAM,OAAO,GAAG;IACpB,YAAY,EAAE,oBAAoB,CAAC;IACnC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC7C,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B,CAAC;AAaF,wBAAgB,aAAa,CAAC,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAQpE;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,SAAS,iBAAiB,EAAE,GACrC,sBAAsB,CAYxB;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,SAAS,iBAAiB,EAAE,0BAWvC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from "react";
|
|
2
|
+
import { type InitialRouteData } from "../document";
|
|
3
|
+
import { type NotFoundProps, type RouteImporter } from "../route";
|
|
4
|
+
import { type PendingRouteMatch } from "../router";
|
|
5
|
+
import { type AppHref, type LinkTo } from "../routing";
|
|
6
|
+
export type NavigationDataLoader = (request: Request) => Promise<InitialRouteData>;
|
|
7
|
+
export type FileRouterOptions = {
|
|
8
|
+
initialMatch?: PendingRouteMatch;
|
|
9
|
+
loadNavigationData?: NavigationDataLoader;
|
|
10
|
+
navigation?: "document" | "server";
|
|
11
|
+
routes: Record<string, RouteImporter>;
|
|
12
|
+
loading?: ComponentType;
|
|
13
|
+
notFound?: ComponentType<NotFoundProps>;
|
|
14
|
+
};
|
|
15
|
+
export declare function createFileRouter(options: FileRouterOptions): () => import("react").FunctionComponentElement<import("react").ProviderProps<RouterApi>>;
|
|
16
|
+
export type HydrateFileRouterOptions = Omit<FileRouterOptions, "initialMatch"> & {
|
|
17
|
+
initialData?: InitialRouteData;
|
|
18
|
+
root?: Element;
|
|
19
|
+
};
|
|
20
|
+
export declare function hydrateFileRouter(options: HydrateFileRouterOptions): Promise<void>;
|
|
21
|
+
export declare function Link<const TTo extends AppHref>(props: LinkTo<TTo> & {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
className?: string;
|
|
24
|
+
}): import("react").JSX.Element;
|
|
25
|
+
type RouterApi = {
|
|
26
|
+
navigation: "document" | "server";
|
|
27
|
+
push(to: string): void;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=file-router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-router.d.ts","sourceRoot":"","sources":["../../src/browser/file-router.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EAEb,SAAS,EAQV,MAAM,OAAO,CAAC;AACf,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAIL,KAAK,aAAa,EAElB,KAAK,aAAa,EACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAUL,KAAK,iBAAiB,EACvB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAQ,KAAK,OAAO,EAAmB,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AAE9E,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAE/B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,kBAAkB,CAAC,EAAE,oBAAoB,CAAC;IAC1C,UAAU,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,QAAQ,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;CACzC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,4FA8H1D;AA0BD,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,iBAAiB,EACjB,cAAc,CACf,GAAG;IACF,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,iBAgDxE;AAED,wBAAgB,IAAI,CAAC,KAAK,CAAC,GAAG,SAAS,OAAO,EAC5C,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAsBF;AA4LD,KAAK,SAAS,GAAG;IACf,UAAU,EAAE,UAAU,GAAG,QAAQ,CAAC;IAClC,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1E,YAAY,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const n = {
|
|
2
|
+
backgroundLifetime: !1,
|
|
3
|
+
crossOriginIsolationHeaders: !1,
|
|
4
|
+
nonceInjection: !1,
|
|
5
|
+
sharedCache: !1,
|
|
6
|
+
staticOutput: !1,
|
|
7
|
+
streaming: !1,
|
|
8
|
+
webSocket: !1,
|
|
9
|
+
webTransport: !1
|
|
10
|
+
};
|
|
11
|
+
function c(e) {
|
|
12
|
+
return {
|
|
13
|
+
capabilities: {
|
|
14
|
+
...n,
|
|
15
|
+
...e.capabilities
|
|
16
|
+
},
|
|
17
|
+
name: e.name
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function r(e, i) {
|
|
21
|
+
const a = [...new Set(i)], s = a.filter(
|
|
22
|
+
(t) => !e.capabilities[t]
|
|
23
|
+
);
|
|
24
|
+
return {
|
|
25
|
+
adapter: e.name,
|
|
26
|
+
missing: s,
|
|
27
|
+
ok: s.length === 0,
|
|
28
|
+
required: a
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function o(e, i) {
|
|
32
|
+
const a = r(e, i);
|
|
33
|
+
if (!a.ok)
|
|
34
|
+
throw new Error(
|
|
35
|
+
`Adapter "${e.name}" does not support required capabilities: ${a.missing.join(", ")}.`
|
|
36
|
+
);
|
|
37
|
+
return a;
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
o as a,
|
|
41
|
+
r as c,
|
|
42
|
+
c as d
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=index-BnX9Qxbm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BnX9Qxbm.js","sources":["../../src/adapter/index.ts"],"sourcesContent":["export type AdapterCapability =\n | \"backgroundLifetime\"\n | \"crossOriginIsolationHeaders\"\n | \"nonceInjection\"\n | \"sharedCache\"\n | \"staticOutput\"\n | \"streaming\"\n | \"webSocket\"\n | \"webTransport\";\n\nexport type AdapterCapabilityMap = Record<AdapterCapability, boolean>;\n\nexport type Adapter = {\n capabilities: AdapterCapabilityMap;\n name: string;\n};\n\nexport type AdapterDefinition = {\n capabilities?: Partial<AdapterCapabilityMap>;\n name: string;\n};\n\nexport type AdapterCapabilityCheck = {\n adapter: string;\n missing: AdapterCapability[];\n ok: boolean;\n required: AdapterCapability[];\n};\n\nconst defaultCapabilities = {\n backgroundLifetime: false,\n crossOriginIsolationHeaders: false,\n nonceInjection: false,\n sharedCache: false,\n staticOutput: false,\n streaming: false,\n webSocket: false,\n webTransport: false,\n} satisfies AdapterCapabilityMap;\n\nexport function defineAdapter(definition: AdapterDefinition): Adapter {\n return {\n capabilities: {\n ...defaultCapabilities,\n ...definition.capabilities,\n },\n name: definition.name,\n };\n}\n\nexport function checkAdapterCapabilities(\n adapter: Adapter,\n required: readonly AdapterCapability[],\n): AdapterCapabilityCheck {\n const uniqueRequired = [...new Set(required)];\n const missing = uniqueRequired.filter(\n (capability) => !adapter.capabilities[capability],\n );\n\n return {\n adapter: adapter.name,\n missing,\n ok: missing.length === 0,\n required: uniqueRequired,\n };\n}\n\nexport function assertAdapterCapabilities(\n adapter: Adapter,\n required: readonly AdapterCapability[],\n) {\n const check = checkAdapterCapabilities(adapter, required);\n\n if (!check.ok) {\n throw new Error(\n `Adapter \"${adapter.name}\" does not support required capabilities: ${check.missing.join(\", \")}.`,\n );\n }\n\n return check;\n}\n"],"names":["defaultCapabilities","defineAdapter","definition","checkAdapterCapabilities","adapter","required","uniqueRequired","missing","capability","assertAdapterCapabilities","check"],"mappings":"AA6BA,MAAMA,IAAsB;AAAA,EAC1B,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,EAC7B,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,cAAc;AAAA,EACd,WAAW;AAAA,EACX,WAAW;AAAA,EACX,cAAc;AAChB;AAEO,SAASC,EAAcC,GAAwC;AACpE,SAAO;AAAA,IACL,cAAc;AAAA,MACZ,GAAGF;AAAA,MACH,GAAGE,EAAW;AAAA,IAAA;AAAA,IAEhB,MAAMA,EAAW;AAAA,EAAA;AAErB;AAEO,SAASC,EACdC,GACAC,GACwB;AACxB,QAAMC,IAAiB,CAAC,GAAG,IAAI,IAAID,CAAQ,CAAC,GACtCE,IAAUD,EAAe;AAAA,IAC7B,CAACE,MAAe,CAACJ,EAAQ,aAAaI,CAAU;AAAA,EAAA;AAGlD,SAAO;AAAA,IACL,SAASJ,EAAQ;AAAA,IACjB,SAAAG;AAAA,IACA,IAAIA,EAAQ,WAAW;AAAA,IACvB,UAAUD;AAAA,EAAA;AAEd;AAEO,SAASG,EACdL,GACAC,GACA;AACA,QAAMK,IAAQP,EAAyBC,GAASC,CAAQ;AAExD,MAAI,CAACK,EAAM;AACT,UAAM,IAAI;AAAA,MACR,YAAYN,EAAQ,IAAI,6CAA6CM,EAAM,QAAQ,KAAK,IAAI,CAAC;AAAA,IAAA;AAIjG,SAAOA;AACT;"}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { renderToString as T } from "react-dom/server";
|
|
2
|
+
import { createElement as h } from "react";
|
|
3
|
+
const g = "__demiurge_data", v = "data-demiurge-hydrate", E = "data-demiurge-fallback";
|
|
4
|
+
function k(e, n = {}) {
|
|
5
|
+
return w(
|
|
6
|
+
JSON.stringify({ data: e, hasData: !0, ...n })
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
function F(e) {
|
|
10
|
+
const n = e.getElementById(g), t = n?.tagName === "TEMPLATE" ? n.content.textContent : n?.textContent;
|
|
11
|
+
if (t)
|
|
12
|
+
try {
|
|
13
|
+
return JSON.parse(t);
|
|
14
|
+
} catch (o) {
|
|
15
|
+
throw new Error(
|
|
16
|
+
"Demiurge could not parse the initial route data payload.",
|
|
17
|
+
{ cause: o }
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function w(e) {
|
|
22
|
+
return e.replace(/&/g, "\\u0026").replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
23
|
+
}
|
|
24
|
+
function x(e) {
|
|
25
|
+
if (e.body) {
|
|
26
|
+
const { html: n, ...t } = e.body, { prefix: o, suffix: a } = S({ ...e, body: t });
|
|
27
|
+
return `${o}${n}${a}`;
|
|
28
|
+
}
|
|
29
|
+
return O(e);
|
|
30
|
+
}
|
|
31
|
+
function S({
|
|
32
|
+
body: e,
|
|
33
|
+
entrySrc: n,
|
|
34
|
+
lang: t = "en",
|
|
35
|
+
links: o = [],
|
|
36
|
+
metadata: a,
|
|
37
|
+
nonce: c,
|
|
38
|
+
scripts: p = [],
|
|
39
|
+
styles: s = [],
|
|
40
|
+
title: d = "Demiurge App"
|
|
41
|
+
}) {
|
|
42
|
+
const f = a?.title ?? d, $ = [
|
|
43
|
+
...p.map((R) => ` ${b(R, c)}`),
|
|
44
|
+
I(e.data, e.navigation),
|
|
45
|
+
...n ? [A(n, c)] : []
|
|
46
|
+
].join(`
|
|
47
|
+
`);
|
|
48
|
+
return {
|
|
49
|
+
prefix: `<!doctype html>
|
|
50
|
+
<html lang="${i(t)}">
|
|
51
|
+
<head>
|
|
52
|
+
${D({ links: o, metadata: a, nonce: c, styles: s, title: f })}
|
|
53
|
+
</head>
|
|
54
|
+
<body>
|
|
55
|
+
${B(e)}`,
|
|
56
|
+
suffix: `</div>
|
|
57
|
+
${$}
|
|
58
|
+
</body>
|
|
59
|
+
</html>
|
|
60
|
+
`
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function O({
|
|
64
|
+
entrySrc: e,
|
|
65
|
+
lang: n = "en",
|
|
66
|
+
links: t = [],
|
|
67
|
+
metadata: o,
|
|
68
|
+
nonce: a,
|
|
69
|
+
scripts: c = [],
|
|
70
|
+
styles: p = [],
|
|
71
|
+
title: s = "Demiurge App"
|
|
72
|
+
}) {
|
|
73
|
+
const d = o?.title ?? s, f = [
|
|
74
|
+
_(),
|
|
75
|
+
...c.map(($) => ` ${b($, a)}`),
|
|
76
|
+
...e ? [A(e, a)] : []
|
|
77
|
+
].join(`
|
|
78
|
+
`);
|
|
79
|
+
return `<!doctype html>
|
|
80
|
+
<html lang="${i(n)}">
|
|
81
|
+
<head>
|
|
82
|
+
${D({ links: t, metadata: o, nonce: a, styles: p, title: d })}
|
|
83
|
+
</head>
|
|
84
|
+
<body>
|
|
85
|
+
${f}
|
|
86
|
+
</body>
|
|
87
|
+
</html>
|
|
88
|
+
`;
|
|
89
|
+
}
|
|
90
|
+
function _(e) {
|
|
91
|
+
return ' <div id="root"></div>';
|
|
92
|
+
}
|
|
93
|
+
function B(e) {
|
|
94
|
+
const n = e.fallback ? ` ${E}="${i(e.fallback)}"` : "";
|
|
95
|
+
return ` <div id="root" ${v}=""${n}>`;
|
|
96
|
+
}
|
|
97
|
+
function I(e, n) {
|
|
98
|
+
return ` <template id="${g}">${k(e, { navigation: n })}</template>`;
|
|
99
|
+
}
|
|
100
|
+
function A(e, n) {
|
|
101
|
+
return ` <script type="module" src="${i(e)}"${r("nonce", n)}><\/script>`;
|
|
102
|
+
}
|
|
103
|
+
function D({
|
|
104
|
+
links: e,
|
|
105
|
+
metadata: n,
|
|
106
|
+
nonce: t,
|
|
107
|
+
styles: o,
|
|
108
|
+
title: a
|
|
109
|
+
}) {
|
|
110
|
+
return [
|
|
111
|
+
l({
|
|
112
|
+
content: n?.charset ?? "UTF-8",
|
|
113
|
+
name: "charset"
|
|
114
|
+
}),
|
|
115
|
+
l({
|
|
116
|
+
content: n?.viewport ?? "width=device-width, initial-scale=1.0",
|
|
117
|
+
name: "viewport"
|
|
118
|
+
}),
|
|
119
|
+
` <title>${i(a)}</title>`,
|
|
120
|
+
...n?.description ? [
|
|
121
|
+
l({
|
|
122
|
+
content: n.description,
|
|
123
|
+
name: "description"
|
|
124
|
+
})
|
|
125
|
+
] : [],
|
|
126
|
+
...n?.canonical ? [
|
|
127
|
+
y({
|
|
128
|
+
href: n.canonical,
|
|
129
|
+
rel: "canonical"
|
|
130
|
+
})
|
|
131
|
+
] : [],
|
|
132
|
+
...M(n),
|
|
133
|
+
...C(n),
|
|
134
|
+
...(n?.custom ?? []).map(G),
|
|
135
|
+
...(n?.structuredData ?? []).map(
|
|
136
|
+
(c) => N(c, t)
|
|
137
|
+
),
|
|
138
|
+
...o.map(
|
|
139
|
+
(c) => ` <link rel="stylesheet" href="${i(c)}" />`
|
|
140
|
+
),
|
|
141
|
+
...e.map(y)
|
|
142
|
+
].join(`
|
|
143
|
+
`);
|
|
144
|
+
}
|
|
145
|
+
function M(e) {
|
|
146
|
+
if (!e?.robots)
|
|
147
|
+
return [];
|
|
148
|
+
const n = [
|
|
149
|
+
e.robots.index === !1 ? "noindex" : "index",
|
|
150
|
+
e.robots.follow === !1 ? "nofollow" : "follow"
|
|
151
|
+
];
|
|
152
|
+
return [
|
|
153
|
+
l({
|
|
154
|
+
content: n.join(", "),
|
|
155
|
+
name: "robots"
|
|
156
|
+
})
|
|
157
|
+
];
|
|
158
|
+
}
|
|
159
|
+
function C(e) {
|
|
160
|
+
return e?.openGraph ? [
|
|
161
|
+
e.openGraph.title ? l({
|
|
162
|
+
content: e.openGraph.title,
|
|
163
|
+
property: "og:title"
|
|
164
|
+
}) : null,
|
|
165
|
+
e.openGraph.description ? l({
|
|
166
|
+
content: e.openGraph.description,
|
|
167
|
+
property: "og:description"
|
|
168
|
+
}) : null,
|
|
169
|
+
e.openGraph.image ? l({
|
|
170
|
+
content: e.openGraph.image,
|
|
171
|
+
property: "og:image"
|
|
172
|
+
}) : null
|
|
173
|
+
].filter((n) => !!n) : [];
|
|
174
|
+
}
|
|
175
|
+
function G(e) {
|
|
176
|
+
return e.kind === "link" ? y(e) : l(e);
|
|
177
|
+
}
|
|
178
|
+
function N(e, n) {
|
|
179
|
+
return ` <script type="application/ld+json"${r("nonce", n)}>${L(JSON.stringify(e.value))}<\/script>`;
|
|
180
|
+
}
|
|
181
|
+
function l(e) {
|
|
182
|
+
if (e.name === "charset")
|
|
183
|
+
return ` <meta charset="${i(e.content)}" />`;
|
|
184
|
+
const n = e.name ? ` name="${i(e.name)}"` : "", t = e.property ? ` property="${i(e.property)}"` : "";
|
|
185
|
+
return ` <meta${n}${t} content="${i(e.content)}" />`;
|
|
186
|
+
}
|
|
187
|
+
function y(e) {
|
|
188
|
+
return ` <link${r("rel", e.rel)}${r("href", e.href)}${r("as", e.as)}${r("type", e.type)}${r("crossorigin", e.crossOrigin)}${r("hreflang", e.hrefLang)} />`;
|
|
189
|
+
}
|
|
190
|
+
function b(e, n) {
|
|
191
|
+
return `<script${r("id", e.id)}${r("src", e.src)}${r("type", e.type ?? H(e.strategy))}${r("nonce", e.nonce ?? n)}${r("integrity", e.integrity)}${r("referrerpolicy", e.referrerPolicy)}${r("data-api", e.dataApi)}${r("data-domain", e.dataDomain)}${m("async", e.async)}${m("defer", e.defer)}><\/script>`;
|
|
192
|
+
}
|
|
193
|
+
function H(e) {
|
|
194
|
+
return e === "module" ? "module" : void 0;
|
|
195
|
+
}
|
|
196
|
+
function r(e, n) {
|
|
197
|
+
return n ? ` ${e}="${i(n)}"` : "";
|
|
198
|
+
}
|
|
199
|
+
function m(e, n) {
|
|
200
|
+
return n ? ` ${e}` : "";
|
|
201
|
+
}
|
|
202
|
+
function i(e) {
|
|
203
|
+
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """);
|
|
204
|
+
}
|
|
205
|
+
function L(e) {
|
|
206
|
+
return e.replaceAll("<", "\\u003c").replaceAll(">", "\\u003e").replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029");
|
|
207
|
+
}
|
|
208
|
+
const u = /* @__PURE__ */ new WeakMap();
|
|
209
|
+
function U(e) {
|
|
210
|
+
return u.get(e);
|
|
211
|
+
}
|
|
212
|
+
function Y(e, n) {
|
|
213
|
+
u.set(e, n);
|
|
214
|
+
}
|
|
215
|
+
function z(e, n) {
|
|
216
|
+
const t = u.get(e);
|
|
217
|
+
t && u.set(n, t);
|
|
218
|
+
}
|
|
219
|
+
function j(e) {
|
|
220
|
+
const n = h(e.page, {
|
|
221
|
+
data: e.data,
|
|
222
|
+
path: e.path,
|
|
223
|
+
pathname: e.pathname
|
|
224
|
+
});
|
|
225
|
+
return e.layouts.reduceRight(
|
|
226
|
+
(t, o) => h(o, {
|
|
227
|
+
children: t,
|
|
228
|
+
path: e.path,
|
|
229
|
+
pathname: e.pathname
|
|
230
|
+
}),
|
|
231
|
+
n
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
function J(e, n = {}) {
|
|
235
|
+
const t = T(j(e));
|
|
236
|
+
return x({
|
|
237
|
+
body: {
|
|
238
|
+
data: e.data,
|
|
239
|
+
html: t,
|
|
240
|
+
navigation: e.render.mode === "static" ? "document" : n.navigation
|
|
241
|
+
},
|
|
242
|
+
entrySrc: n.clientEntry,
|
|
243
|
+
lang: n.lang,
|
|
244
|
+
links: e.links,
|
|
245
|
+
metadata: e.metadata,
|
|
246
|
+
nonce: n.nonce,
|
|
247
|
+
scripts: e.scripts,
|
|
248
|
+
styles: n.styles,
|
|
249
|
+
title: n.title
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
function W(e, n = {}) {
|
|
253
|
+
const t = J(e, n);
|
|
254
|
+
return new Response(t, {
|
|
255
|
+
headers: {
|
|
256
|
+
"content-type": "text/html; charset=utf-8"
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
export {
|
|
261
|
+
v as H,
|
|
262
|
+
S as a,
|
|
263
|
+
x as b,
|
|
264
|
+
j as c,
|
|
265
|
+
J as d,
|
|
266
|
+
F as e,
|
|
267
|
+
E as f,
|
|
268
|
+
U as g,
|
|
269
|
+
z as h,
|
|
270
|
+
W as r,
|
|
271
|
+
Y as s
|
|
272
|
+
};
|
|
273
|
+
//# sourceMappingURL=ssr-O3d7Q73U.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssr-O3d7Q73U.js","sources":["../../src/document/hydration.ts","../../src/document/render.ts","../../src/server/request-metadata.ts","../../src/server/render-tree.ts","../../src/server/ssr.ts"],"sourcesContent":["export type InitialRouteData = {\n data?: unknown;\n hasData: boolean;\n navigation?: \"document\";\n};\n\nexport const HYDRATION_DATA_ELEMENT_ID = \"__demiurge_data\";\nexport const HYDRATION_ROOT_ATTRIBUTE = \"data-demiurge-hydrate\";\n// Marks a server document as a fallback, not a page. The client hydrates markup\n// that it can reproduce. It replaces other markup. This attribute distinguishes\n// a server 404 from a page that does not match the client manifest.\nexport const HYDRATION_FALLBACK_ATTRIBUTE = \"data-demiurge-fallback\";\n\nexport function serializeInitialRouteData(\n data: unknown,\n options: { navigation?: \"document\" } = {},\n) {\n return escapeJsonScript(\n JSON.stringify({ data, hasData: true, ...options }),\n );\n}\n\nexport function readInitialRouteData(source: Document) {\n const element = source.getElementById(HYDRATION_DATA_ELEMENT_ID);\n const serialized = element?.tagName === \"TEMPLATE\"\n ? (element as HTMLTemplateElement).content.textContent\n : element?.textContent;\n\n if (!serialized) {\n return undefined;\n }\n\n try {\n return JSON.parse(serialized) as InitialRouteData;\n } catch (error) {\n throw new Error(\n \"Demiurge could not parse the initial route data payload.\",\n { cause: error },\n );\n }\n}\n\nfunction escapeJsonScript(value: string) {\n return value\n .replace(/&/g, \"\\\\u0026\")\n .replace(/</g, \"\\\\u003c\")\n .replace(/>/g, \"\\\\u003e\")\n .replace(/\\u2028/g, \"\\\\u2028\")\n .replace(/\\u2029/g, \"\\\\u2029\");\n}\n","import {\n HYDRATION_DATA_ELEMENT_ID,\n HYDRATION_FALLBACK_ATTRIBUTE,\n HYDRATION_ROOT_ATTRIBUTE,\n serializeInitialRouteData,\n} from \"./hydration\";\nimport type {\n DocumentMetadataTag,\n LinkTag,\n ResolvedMetadata,\n StructuredDataTag,\n} from \"./metadata\";\nimport type { ScriptTag } from \"./scripts\";\n\nexport type DocumentBody = {\n data: unknown;\n fallback?: \"not-found\";\n html: string;\n navigation?: \"document\";\n};\n\nexport type RenderDocumentOptions = {\n body?: DocumentBody;\n entrySrc?: string;\n lang?: string;\n links?: LinkTag[];\n metadata?: ResolvedMetadata;\n nonce?: string;\n scripts?: ScriptTag[];\n styles?: string[];\n title?: string;\n};\n\nexport type RenderDocumentShellOptions = Omit<RenderDocumentOptions, \"body\"> & {\n body: Omit<DocumentBody, \"html\">;\n};\n\nexport function renderDocument(options: RenderDocumentOptions) {\n if (options.body) {\n const { html, ...body } = options.body;\n const { prefix, suffix } = renderDocumentShell({ ...options, body });\n\n return `${prefix}${html}${suffix}`;\n }\n\n return renderDocumentWithoutBody(options);\n}\n\nexport function renderDocumentShell({\n body,\n entrySrc,\n lang = \"en\",\n links = [],\n metadata,\n nonce,\n scripts = [],\n styles = [],\n title = \"Demiurge App\",\n}: RenderDocumentShellOptions) {\n const documentTitle = metadata?.title ?? title;\n const trailingBodyContent = [\n ...scripts.map((scriptTag) => ` ${renderScriptTag(scriptTag, nonce)}`),\n renderBootstrapData(body.data, body.navigation),\n ...(entrySrc ? [renderEntryScript(entrySrc, nonce)] : []),\n ].join(\"\\n\");\n\n return {\n prefix: `<!doctype html>\n<html lang=\"${escapeHtml(lang)}\">\n <head>\n${renderHeadTags({ links, metadata, nonce, styles, title: documentTitle })}\n </head>\n <body>\n${renderRootStart(body)}`,\n suffix: `</div>\n${trailingBodyContent}\n </body>\n</html>\n`,\n };\n}\n\nfunction renderDocumentWithoutBody({\n entrySrc,\n lang = \"en\",\n links = [],\n metadata,\n nonce,\n scripts = [],\n styles = [],\n title = \"Demiurge App\",\n}: RenderDocumentOptions) {\n const documentTitle = metadata?.title ?? title;\n const bodyContent = [\n renderRootElement(),\n ...scripts.map((scriptTag) => ` ${renderScriptTag(scriptTag, nonce)}`),\n ...(entrySrc ? [renderEntryScript(entrySrc, nonce)] : []),\n ].join(\"\\n\");\n\n return `<!doctype html>\n<html lang=\"${escapeHtml(lang)}\">\n <head>\n${renderHeadTags({ links, metadata, nonce, styles, title: documentTitle })}\n </head>\n <body>\n${bodyContent}\n </body>\n</html>\n`;\n}\n\nfunction renderRootElement(body?: DocumentBody) {\n if (!body) {\n return ` <div id=\"root\"></div>`;\n }\n\n return `${renderRootStart(body)}${body.html}</div>`;\n}\n\nfunction renderRootStart(body: Omit<DocumentBody, \"html\">) {\n const fallback = body.fallback\n ? ` ${HYDRATION_FALLBACK_ATTRIBUTE}=\"${escapeHtml(body.fallback)}\"`\n : \"\";\n\n return ` <div id=\"root\" ${HYDRATION_ROOT_ATTRIBUTE}=\"\"${fallback}>`;\n}\n\nfunction renderBootstrapData(data: unknown, navigation?: \"document\") {\n return ` <template id=\"${HYDRATION_DATA_ELEMENT_ID}\">${serializeInitialRouteData(data, { navigation })}</template>`;\n}\n\nfunction renderEntryScript(entrySrc: string, nonce: string | undefined) {\n return ` <script type=\"module\" src=\"${escapeHtml(entrySrc)}\"${renderAttribute(\"nonce\", nonce)}></script>`;\n}\n\nfunction renderHeadTags({\n links,\n metadata,\n nonce,\n styles,\n title,\n}: {\n links: LinkTag[];\n metadata: ResolvedMetadata | undefined;\n nonce: string | undefined;\n styles: string[];\n title: string;\n}) {\n return [\n renderMetaTag({\n content: metadata?.charset ?? \"UTF-8\",\n kind: \"meta\",\n name: \"charset\",\n }),\n renderMetaTag({\n content: metadata?.viewport ?? \"width=device-width, initial-scale=1.0\",\n kind: \"meta\",\n name: \"viewport\",\n }),\n ` <title>${escapeHtml(title)}</title>`,\n ...(metadata?.description\n ? [\n renderMetaTag({\n content: metadata.description,\n kind: \"meta\",\n name: \"description\",\n }),\n ]\n : []),\n ...(metadata?.canonical\n ? [\n renderLinkTag({\n href: metadata.canonical,\n kind: \"link\",\n rel: \"canonical\",\n }),\n ]\n : []),\n ...renderRobotsTags(metadata),\n ...renderOpenGraphTags(metadata),\n ...(metadata?.custom ?? []).map(renderDocumentMetadataTag),\n ...(metadata?.structuredData ?? []).map((tag) =>\n renderStructuredDataTag(tag, nonce),\n ),\n ...styles.map(\n (href) => ` <link rel=\"stylesheet\" href=\"${escapeHtml(href)}\" />`,\n ),\n ...links.map(renderLinkTag),\n ].join(\"\\n\");\n}\n\nfunction renderRobotsTags(metadata: ResolvedMetadata | undefined) {\n if (!metadata?.robots) {\n return [];\n }\n\n const directives = [\n metadata.robots.index === false ? \"noindex\" : \"index\",\n metadata.robots.follow === false ? \"nofollow\" : \"follow\",\n ];\n\n return [\n renderMetaTag({\n content: directives.join(\", \"),\n kind: \"meta\",\n name: \"robots\",\n }),\n ];\n}\n\nfunction renderOpenGraphTags(metadata: ResolvedMetadata | undefined) {\n if (!metadata?.openGraph) {\n return [];\n }\n\n return [\n metadata.openGraph.title\n ? renderMetaTag({\n content: metadata.openGraph.title,\n kind: \"meta\",\n property: \"og:title\",\n })\n : null,\n metadata.openGraph.description\n ? renderMetaTag({\n content: metadata.openGraph.description,\n kind: \"meta\",\n property: \"og:description\",\n })\n : null,\n metadata.openGraph.image\n ? renderMetaTag({\n content: metadata.openGraph.image,\n kind: \"meta\",\n property: \"og:image\",\n })\n : null,\n ].filter((tag): tag is string => Boolean(tag));\n}\n\nfunction renderDocumentMetadataTag(tag: DocumentMetadataTag) {\n if (tag.kind === \"link\") {\n return renderLinkTag(tag);\n }\n\n return renderMetaTag(tag);\n}\n\nfunction renderStructuredDataTag(\n tag: StructuredDataTag,\n nonce: string | undefined,\n) {\n return ` <script type=\"application/ld+json\"${renderAttribute(\"nonce\", nonce)}>${escapeJsonScript(JSON.stringify(tag.value))}</script>`;\n}\n\nfunction renderMetaTag(tag: DocumentMetadataTag & { kind: \"meta\" }) {\n if (tag.name === \"charset\") {\n return ` <meta charset=\"${escapeHtml(tag.content)}\" />`;\n }\n\n const name = tag.name ? ` name=\"${escapeHtml(tag.name)}\"` : \"\";\n const property = tag.property ? ` property=\"${escapeHtml(tag.property)}\"` : \"\";\n\n return ` <meta${name}${property} content=\"${escapeHtml(tag.content)}\" />`;\n}\n\nfunction renderLinkTag(tag: LinkTag) {\n return ` <link${renderAttribute(\"rel\", tag.rel)}${renderAttribute(\"href\", tag.href)}${renderAttribute(\"as\", tag.as)}${renderAttribute(\"type\", tag.type)}${renderAttribute(\"crossorigin\", tag.crossOrigin)}${renderAttribute(\"hreflang\", tag.hrefLang)} />`;\n}\n\nfunction renderScriptTag(scriptTag: ScriptTag, nonce: string | undefined) {\n return `<script${renderAttribute(\"id\", scriptTag.id)}${renderAttribute(\"src\", scriptTag.src)}${renderAttribute(\"type\", scriptTag.type ?? scriptTypeForStrategy(scriptTag.strategy))}${renderAttribute(\"nonce\", scriptTag.nonce ?? nonce)}${renderAttribute(\"integrity\", scriptTag.integrity)}${renderAttribute(\"referrerpolicy\", scriptTag.referrerPolicy)}${renderAttribute(\"data-api\", scriptTag.dataApi)}${renderAttribute(\"data-domain\", scriptTag.dataDomain)}${renderBooleanAttribute(\"async\", scriptTag.async)}${renderBooleanAttribute(\"defer\", scriptTag.defer)}></script>`;\n}\n\nfunction scriptTypeForStrategy(strategy: ScriptTag[\"strategy\"]) {\n return strategy === \"module\" ? \"module\" : undefined;\n}\n\nfunction renderAttribute(name: string, value: string | undefined) {\n return value ? ` ${name}=\"${escapeHtml(value)}\"` : \"\";\n}\n\nfunction renderBooleanAttribute(name: string, value: boolean | undefined) {\n return value ? ` ${name}` : \"\";\n}\n\nfunction escapeHtml(value: string) {\n return value\n .replaceAll(\"&\", \"&\")\n .replaceAll(\"<\", \"<\")\n .replaceAll(\">\", \">\")\n .replaceAll('\"', \""\");\n}\n\nfunction escapeJsonScript(value: string) {\n return value\n .replaceAll(\"<\", \"\\\\u003c\")\n .replaceAll(\">\", \"\\\\u003e\")\n .replaceAll(\"
\", \"\\\\u2028\")\n .replaceAll(\"
\", \"\\\\u2029\");\n}\n","export type RequestConnectionMetadata = {\n clientIp: string;\n};\n\nconst connectionMetadata = new WeakMap<Request, RequestConnectionMetadata>();\n\nexport function getRequestConnectionMetadata(request: Request) {\n return connectionMetadata.get(request);\n}\n\nexport function setRequestConnectionMetadata(\n request: Request,\n metadata: RequestConnectionMetadata,\n) {\n connectionMetadata.set(request, metadata);\n}\n\nexport function copyRequestConnectionMetadata(from: Request, to: Request) {\n const metadata = connectionMetadata.get(from);\n\n if (metadata) {\n connectionMetadata.set(to, metadata);\n }\n}\n","import { createElement, type ReactNode } from \"react\";\nimport type { LoadedRouteMatch } from \"../router\";\n\nexport function createPageRenderTree(match: LoadedRouteMatch) {\n const page = createElement(match.page, {\n data: match.data,\n path: match.path,\n pathname: match.pathname,\n });\n\n return match.layouts.reduceRight<ReactNode>(\n (children, Layout) =>\n createElement(Layout, {\n children,\n path: match.path,\n pathname: match.pathname,\n }),\n page,\n );\n}\n","import { renderToString } from \"react-dom/server\";\nimport { renderDocument } from \"../document\";\nimport type { LoadedRouteMatch } from \"../router\";\nimport { createPageRenderTree } from \"./render-tree\";\n\nexport type SsrOptions = {\n clientEntry?: string;\n lang?: string;\n navigation?: \"document\";\n styles?: string[];\n title?: string;\n};\n\nexport type SsrRenderOptions = SsrOptions & {\n nonce?: string;\n onStreamError?: (error: unknown) => void;\n signal?: AbortSignal;\n transformDocument?: (html: string) => string | Promise<string>;\n};\n\nexport function renderPageDocument(\n match: LoadedRouteMatch,\n options: SsrRenderOptions = {},\n) {\n const html = renderToString(createPageRenderTree(match));\n\n return renderDocument({\n body: {\n data: match.data,\n html,\n navigation: match.render.mode === \"static\"\n ? \"document\"\n : options.navigation,\n },\n entrySrc: options.clientEntry,\n lang: options.lang,\n links: match.links,\n metadata: match.metadata,\n nonce: options.nonce,\n scripts: match.scripts,\n styles: options.styles,\n title: options.title,\n });\n}\n\nexport function renderPageResponse(\n match: LoadedRouteMatch,\n options: SsrRenderOptions = {},\n) {\n const html = renderPageDocument(match, options);\n\n return new Response(html, {\n headers: {\n \"content-type\": \"text/html; charset=utf-8\",\n },\n });\n}\n"],"names":["HYDRATION_DATA_ELEMENT_ID","HYDRATION_ROOT_ATTRIBUTE","HYDRATION_FALLBACK_ATTRIBUTE","serializeInitialRouteData","data","options","escapeJsonScript","readInitialRouteData","source","element","serialized","error","value","renderDocument","html","body","prefix","suffix","renderDocumentShell","renderDocumentWithoutBody","entrySrc","lang","links","metadata","nonce","scripts","styles","title","documentTitle","trailingBodyContent","scriptTag","renderScriptTag","renderBootstrapData","renderEntryScript","escapeHtml","renderHeadTags","renderRootStart","bodyContent","renderRootElement","fallback","navigation","renderAttribute","renderMetaTag","renderLinkTag","renderRobotsTags","renderOpenGraphTags","renderDocumentMetadataTag","tag","renderStructuredDataTag","href","directives","name","property","scriptTypeForStrategy","renderBooleanAttribute","strategy","connectionMetadata","getRequestConnectionMetadata","request","setRequestConnectionMetadata","copyRequestConnectionMetadata","from","to","createPageRenderTree","match","page","createElement","children","Layout","renderPageDocument","renderToString","renderPageResponse"],"mappings":";;AAMO,MAAMA,IAA4B,mBAC5BC,IAA2B,yBAI3BC,IAA+B;AAErC,SAASC,EACdC,GACAC,IAAuC,IACvC;AACA,SAAOC;AAAAA,IACL,KAAK,UAAU,EAAE,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