nitro-nightly 4.0.0-20251030-135442-97badaa1 → 4.0.0-20251030-144744-c8bf5222
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/dist/_build/vite.build.mjs +1 -1
- package/dist/_build/vite.plugin.mjs +1 -1
- package/dist/_chunks/{B-7HiF0V.mjs → DKi6z_Js.mjs} +0 -4
- package/dist/builder.mjs +1 -1
- package/dist/runtime/index.d.mts +0 -2
- package/dist/runtime/index.mjs +0 -2
- package/dist/types/index.d.mts +0 -2
- package/dist/vite.mjs +1 -1
- package/package.json +1 -1
- package/dist/runtime/internal/renderer.d.mts +0 -3
- package/dist/runtime/internal/renderer.mjs +0 -44
|
@@ -13,7 +13,7 @@ import "../_libs/tinyglobby.mjs";
|
|
|
13
13
|
import "../_libs/compatx.mjs";
|
|
14
14
|
import "../_libs/klona.mjs";
|
|
15
15
|
import { n as a } from "../_libs/std-env.mjs";
|
|
16
|
-
import "../_chunks/
|
|
16
|
+
import "../_chunks/DKi6z_Js.mjs";
|
|
17
17
|
import "../_libs/escape-string-regexp.mjs";
|
|
18
18
|
import "../_libs/dot-prop.mjs";
|
|
19
19
|
import "../_chunks/B5ooyfLk.mjs";
|
|
@@ -2,7 +2,7 @@ import { T as resolve$1, _ as dirname$1, b as join$1, f as resolveModulePath, g
|
|
|
2
2
|
import { f as sanitizeFilePath } from "../_libs/local-pkg.mjs";
|
|
3
3
|
import { t as formatCompatibilityDate } from "../_libs/compatx.mjs";
|
|
4
4
|
import { n as a, t as T } from "../_libs/std-env.mjs";
|
|
5
|
-
import { a as createNitro, n as prepare, r as copyPublicAssets } from "../_chunks/
|
|
5
|
+
import { a as createNitro, n as prepare, r as copyPublicAssets } from "../_chunks/DKi6z_Js.mjs";
|
|
6
6
|
import { c as prettyPath, o as scanHandlers } from "../_chunks/B5ooyfLk.mjs";
|
|
7
7
|
import { t as createProxyServer } from "../_libs/httpxy.mjs";
|
|
8
8
|
import { i as NodeDevWorker, r as NitroDevApp } from "../_dev.mjs";
|
|
@@ -229,10 +229,6 @@ function getNitroImportsPreset() {
|
|
|
229
229
|
from: "nitro/runtime/internal/storage",
|
|
230
230
|
imports: ["useStorage"]
|
|
231
231
|
},
|
|
232
|
-
{
|
|
233
|
-
from: "nitro/runtime/internal/renderer",
|
|
234
|
-
imports: ["defineRenderHandler"]
|
|
235
|
-
},
|
|
236
232
|
{
|
|
237
233
|
from: "nitro/runtime/internal/meta",
|
|
238
234
|
imports: ["defineRouteMeta"]
|
package/dist/builder.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import "./_libs/tinyglobby.mjs";
|
|
|
13
13
|
import "./_libs/compatx.mjs";
|
|
14
14
|
import "./_libs/klona.mjs";
|
|
15
15
|
import "./_libs/std-env.mjs";
|
|
16
|
-
import { a as createNitro, c as loadOptions, i as build, n as prepare, o as listTasks, r as copyPublicAssets, s as runTask, t as prerender } from "./_chunks/
|
|
16
|
+
import { a as createNitro, c as loadOptions, i as build, n as prepare, o as listTasks, r as copyPublicAssets, s as runTask, t as prerender } from "./_chunks/DKi6z_Js.mjs";
|
|
17
17
|
import "./_libs/escape-string-regexp.mjs";
|
|
18
18
|
import "./_libs/dot-prop.mjs";
|
|
19
19
|
import { n as writeTypes } from "./_chunks/B5ooyfLk.mjs";
|
package/dist/runtime/index.d.mts
CHANGED
|
@@ -7,8 +7,6 @@ export { defineNitroErrorHandler } from "./internal/error/utils.mjs";
|
|
|
7
7
|
export { useRuntimeConfig } from "./internal/runtime-config.mjs";
|
|
8
8
|
// Context
|
|
9
9
|
export { useRequest } from "./internal/context.mjs";
|
|
10
|
-
// Renderer
|
|
11
|
-
export { defineRenderHandler } from "./internal/renderer.mjs";
|
|
12
10
|
// Cache
|
|
13
11
|
export { defineCachedFunction, defineCachedEventHandler, defineCachedHandler, cachedFunction, cachedEventHandler } from "./internal/cache.mjs";
|
|
14
12
|
// ---- Internals that depends on virtual imports should come last ---- //
|
package/dist/runtime/index.mjs
CHANGED
|
@@ -7,8 +7,6 @@ export { defineNitroErrorHandler } from "./internal/error/utils.mjs";
|
|
|
7
7
|
export { useRuntimeConfig } from "./internal/runtime-config.mjs";
|
|
8
8
|
// Context
|
|
9
9
|
export { useRequest } from "./internal/context.mjs";
|
|
10
|
-
// Renderer
|
|
11
|
-
export { defineRenderHandler } from "./internal/renderer.mjs";
|
|
12
10
|
// Cache
|
|
13
11
|
export { defineCachedFunction, defineCachedEventHandler, defineCachedHandler, cachedFunction, cachedEventHandler } from "./internal/cache.mjs";
|
|
14
12
|
// ---- Internals that depends on virtual imports should come last ---- //
|
package/dist/types/index.d.mts
CHANGED
|
@@ -180,8 +180,6 @@ interface NitroRuntimeHooks {
|
|
|
180
180
|
error: CaptureError;
|
|
181
181
|
request: (event: HTTPEvent) => void | Promise<void>;
|
|
182
182
|
response: (res: Response, event: HTTPEvent) => void | Promise<void>;
|
|
183
|
-
"render:before": (context: RenderContext) => void;
|
|
184
|
-
"render:response": (response: Partial<RenderResponse>, context: RenderContext) => void;
|
|
185
183
|
}
|
|
186
184
|
//#endregion
|
|
187
185
|
//#region src/types/runtime/task.d.ts
|
package/dist/vite.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import "./_libs/tinyglobby.mjs";
|
|
|
13
13
|
import "./_libs/compatx.mjs";
|
|
14
14
|
import "./_libs/klona.mjs";
|
|
15
15
|
import "./_libs/std-env.mjs";
|
|
16
|
-
import "./_chunks/
|
|
16
|
+
import "./_chunks/DKi6z_Js.mjs";
|
|
17
17
|
import "./_libs/escape-string-regexp.mjs";
|
|
18
18
|
import "./_libs/dot-prop.mjs";
|
|
19
19
|
import "./_chunks/B5ooyfLk.mjs";
|
package/package.json
CHANGED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { defineHandler } from "h3";
|
|
2
|
-
import { useNitroHooks } from "./app.mjs";
|
|
3
|
-
import { useRuntimeConfig } from "./runtime-config.mjs";
|
|
4
|
-
export function defineRenderHandler(render) {
|
|
5
|
-
const runtimeConfig = useRuntimeConfig();
|
|
6
|
-
return defineHandler(async (event) => {
|
|
7
|
-
const nitroHooks = useNitroHooks();
|
|
8
|
-
// Create shared context for hooks
|
|
9
|
-
const ctx = {
|
|
10
|
-
event,
|
|
11
|
-
render,
|
|
12
|
-
response: undefined
|
|
13
|
-
};
|
|
14
|
-
// Call initial hook to prepare and optionally custom render
|
|
15
|
-
await nitroHooks.callHook("render:before", ctx);
|
|
16
|
-
if (!ctx.response) {
|
|
17
|
-
// TODO: Use serve-placeholder
|
|
18
|
-
if (event.url.pathname === `${runtimeConfig.app.baseURL}favicon.ico`) {
|
|
19
|
-
event.res.headers.set("Content-Type", "image/x-icon");
|
|
20
|
-
return "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
21
|
-
}
|
|
22
|
-
ctx.response = await ctx.render(event);
|
|
23
|
-
if (!ctx.response) {
|
|
24
|
-
const _currentStatus = event.res.status;
|
|
25
|
-
event.res.statusText = String(_currentStatus === 200 ? 500 : _currentStatus);
|
|
26
|
-
return "No response returned from render handler: " + event.url.pathname;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
// Allow modifying response
|
|
30
|
-
await nitroHooks.callHook("render:response", ctx.response, ctx);
|
|
31
|
-
// Send headers
|
|
32
|
-
if (ctx.response.headers) {
|
|
33
|
-
for (const [key, value] of Object.entries(ctx.response.headers)) {
|
|
34
|
-
event.res.headers.set(key, value);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (ctx.response.status || ctx.response.statusText) {
|
|
38
|
-
event.res.status = ctx.response.status;
|
|
39
|
-
event.res.statusText = ctx.response.statusText;
|
|
40
|
-
}
|
|
41
|
-
// Send response body
|
|
42
|
-
return ctx.response.body;
|
|
43
|
-
});
|
|
44
|
-
}
|