@nuxt/nitro-server-nightly 0.0.0 → 3.20.1-29360835.617b266c
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 +117 -0
- package/dist/index.d.mts +47 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.mjs +797 -0
- package/dist/runtime/handlers/error.d.ts +3 -0
- package/dist/runtime/handlers/error.js +64 -0
- package/dist/runtime/handlers/island.d.ts +4 -0
- package/dist/runtime/handlers/island.js +102 -0
- package/dist/runtime/handlers/renderer.d.ts +8 -0
- package/dist/runtime/handlers/renderer.js +237 -0
- package/dist/runtime/middleware/no-ssr.d.ts +2 -0
- package/dist/runtime/middleware/no-ssr.js +7 -0
- package/dist/runtime/plugins/dev-server-logs.d.ts +3 -0
- package/dist/runtime/plugins/dev-server-logs.js +82 -0
- package/dist/runtime/templates/error-500.d.ts +2 -0
- package/dist/runtime/templates/error-500.js +6 -0
- package/dist/runtime/utils/cache-driver.d.ts +6 -0
- package/dist/runtime/utils/cache-driver.js +42 -0
- package/dist/runtime/utils/cache.d.ts +8 -0
- package/dist/runtime/utils/cache.js +18 -0
- package/dist/runtime/utils/config.d.ts +1 -0
- package/dist/runtime/utils/config.js +1 -0
- package/dist/runtime/utils/dev.d.ts +1 -0
- package/dist/runtime/utils/dev.js +328 -0
- package/dist/runtime/utils/error.d.ts +6 -0
- package/dist/runtime/utils/error.js +11 -0
- package/dist/runtime/utils/paths.d.ts +4 -0
- package/dist/runtime/utils/paths.js +16 -0
- package/dist/runtime/utils/renderer/app.d.ts +6 -0
- package/dist/runtime/utils/renderer/app.js +32 -0
- package/dist/runtime/utils/renderer/build-files.d.ts +22 -0
- package/dist/runtime/utils/renderer/build-files.js +84 -0
- package/dist/runtime/utils/renderer/inline-styles.d.ts +2 -0
- package/dist/runtime/utils/renderer/inline-styles.js +13 -0
- package/dist/runtime/utils/renderer/islands.d.ts +9 -0
- package/dist/runtime/utils/renderer/islands.js +82 -0
- package/dist/runtime/utils/renderer/payload.d.ts +37 -0
- package/dist/runtime/utils/renderer/payload.js +66 -0
- package/package.json +58 -2
- package/dist/.gitkeep +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { getResponseStatus, getResponseStatusText } from "h3";
|
|
2
|
+
import devalue from "@nuxt/devalue";
|
|
3
|
+
import { stringify, uneval } from "devalue";
|
|
4
|
+
import { appId, multiApp } from "#internal/nuxt.config.mjs";
|
|
5
|
+
export function renderPayloadResponse(ssrContext) {
|
|
6
|
+
return {
|
|
7
|
+
body: process.env.NUXT_JSON_PAYLOADS ? stringify(splitPayload(ssrContext).payload, ssrContext._payloadReducers) : `export default ${devalue(splitPayload(ssrContext).payload)}`,
|
|
8
|
+
statusCode: getResponseStatus(ssrContext.event),
|
|
9
|
+
statusMessage: getResponseStatusText(ssrContext.event),
|
|
10
|
+
headers: {
|
|
11
|
+
"content-type": process.env.NUXT_JSON_PAYLOADS ? "application/json;charset=utf-8" : "text/javascript;charset=utf-8",
|
|
12
|
+
"x-powered-by": "Nuxt"
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function renderPayloadJsonScript(opts) {
|
|
17
|
+
const contents = opts.data ? stringify(opts.data, opts.ssrContext._payloadReducers) : "";
|
|
18
|
+
const payload = {
|
|
19
|
+
"type": "application/json",
|
|
20
|
+
"innerHTML": contents,
|
|
21
|
+
"data-nuxt-data": appId,
|
|
22
|
+
"data-ssr": !(process.env.NUXT_NO_SSR || opts.ssrContext.noSSR)
|
|
23
|
+
};
|
|
24
|
+
if (!multiApp) {
|
|
25
|
+
payload.id = "__NUXT_DATA__";
|
|
26
|
+
}
|
|
27
|
+
if (opts.src) {
|
|
28
|
+
payload["data-src"] = opts.src;
|
|
29
|
+
}
|
|
30
|
+
const config = uneval(opts.ssrContext.config);
|
|
31
|
+
return [
|
|
32
|
+
payload,
|
|
33
|
+
{
|
|
34
|
+
innerHTML: multiApp ? `window.__NUXT__=window.__NUXT__||{};window.__NUXT__[${JSON.stringify(appId)}]={config:${config}}` : `window.__NUXT__={};window.__NUXT__.config=${config}`
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
export function renderPayloadScript(opts) {
|
|
39
|
+
opts.data.config = opts.ssrContext.config;
|
|
40
|
+
const _PAYLOAD_EXTRACTION = import.meta.prerender && process.env.NUXT_PAYLOAD_EXTRACTION && !opts.ssrContext.noSSR;
|
|
41
|
+
const nuxtData = devalue(opts.data);
|
|
42
|
+
if (_PAYLOAD_EXTRACTION) {
|
|
43
|
+
const singleAppPayload2 = `import p from "${opts.src}";window.__NUXT__={...p,...(${nuxtData})}`;
|
|
44
|
+
const multiAppPayload2 = `import p from "${opts.src}";window.__NUXT__=window.__NUXT__||{};window.__NUXT__[${JSON.stringify(appId)}]={...p,...(${nuxtData})}`;
|
|
45
|
+
return [
|
|
46
|
+
{
|
|
47
|
+
type: "module",
|
|
48
|
+
innerHTML: multiApp ? multiAppPayload2 : singleAppPayload2
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
const singleAppPayload = `window.__NUXT__=${nuxtData}`;
|
|
53
|
+
const multiAppPayload = `window.__NUXT__=window.__NUXT__||{};window.__NUXT__[${JSON.stringify(appId)}]=${nuxtData}`;
|
|
54
|
+
return [
|
|
55
|
+
{
|
|
56
|
+
innerHTML: multiApp ? multiAppPayload : singleAppPayload
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
export function splitPayload(ssrContext) {
|
|
61
|
+
const { data, prerenderedAt, ...initial } = ssrContext.payload;
|
|
62
|
+
return {
|
|
63
|
+
initial: { ...initial, prerenderedAt },
|
|
64
|
+
payload: { data, prerenderedAt }
|
|
65
|
+
};
|
|
66
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/nitro-server-nightly",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.20.1-29360835.617b266c",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
7
|
+
"directory": "packages/nitro-server"
|
|
8
|
+
},
|
|
9
|
+
"description": "Nitro server integration for Nuxt",
|
|
10
|
+
"homepage": "https://nuxt.com",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": "./dist/index.mjs"
|
|
16
|
+
},
|
|
4
17
|
"files": [
|
|
5
18
|
"dist"
|
|
6
19
|
],
|
|
7
|
-
"
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@nuxt/devalue": "^2.0.2",
|
|
22
|
+
"@nuxt/kit": "npm:@nuxt/kit-nightly@3.20.1-29360835.617b266c",
|
|
23
|
+
"@unhead/vue": "^2.0.14",
|
|
24
|
+
"@vue/shared": "^3.5.22",
|
|
25
|
+
"consola": "^3.4.2",
|
|
26
|
+
"defu": "^6.1.4",
|
|
27
|
+
"destr": "^2.0.5",
|
|
28
|
+
"devalue": "^5.3.2",
|
|
29
|
+
"errx": "^0.1.0",
|
|
30
|
+
"escape-string-regexp": "^5.0.0",
|
|
31
|
+
"exsolve": "^1.0.7",
|
|
32
|
+
"h3": "^1.15.4",
|
|
33
|
+
"impound": "^1.0.0",
|
|
34
|
+
"klona": "^2.0.6",
|
|
35
|
+
"mocked-exports": "^0.1.1",
|
|
36
|
+
"nitropack": "^2.12.8",
|
|
37
|
+
"pathe": "^2.0.3",
|
|
38
|
+
"pkg-types": "^2.3.0",
|
|
39
|
+
"radix3": "^1.1.2",
|
|
40
|
+
"std-env": "^3.9.0",
|
|
41
|
+
"ufo": "^1.6.1",
|
|
42
|
+
"unctx": "^2.4.1",
|
|
43
|
+
"unstorage": "^1.17.1",
|
|
44
|
+
"vue": "^3.5.22",
|
|
45
|
+
"vue-bundle-renderer": "^2.2.0",
|
|
46
|
+
"vue-devtools-stub": "^0.1.0"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"nuxt": "npm:nuxt-nightly@3.20.1-29360835.617b266c"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@nuxt/schema": "npm:@nuxt/schema-nightly@3.20.1-29360835.617b266c",
|
|
53
|
+
"nuxt": "npm:nuxt-nightly@3.20.1-29360835.617b266c",
|
|
54
|
+
"unbuild": "3.6.1",
|
|
55
|
+
"vitest": "3.2.4"
|
|
56
|
+
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
59
|
+
},
|
|
60
|
+
"_name": "@nuxt/nitro-server",
|
|
61
|
+
"scripts": {
|
|
62
|
+
"test:attw": "attw --pack"
|
|
63
|
+
}
|
|
8
64
|
}
|
package/dist/.gitkeep
DELETED
|
File without changes
|