@nuxt/nitro-server-nightly 4.2.0-29355133.7db30a63 → 4.2.0-29356294.cb1dadee

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/README.md CHANGED
@@ -93,13 +93,13 @@ Discover our [list of modules](https://nuxt.com/modules) to supercharge your Nux
93
93
  We invite you to contribute and help improve Nuxt 💚
94
94
 
95
95
  Here are a few ways you can get involved:
96
- - **Reporting Bugs:** If you come across any bugs or issues, please check out the [reporting bugs guide](https://nuxt.com/docs/4.x/community/reporting-bugs) to learn how to submit a bug report.
97
- - **Suggestions:** Have ideas to enhance Nuxt? We'd love to hear them! Check out the [contribution guide](https://nuxt.com/docs/4.x/community/contribution) to share your suggestions.
98
- - **Questions:** If you have questions or need assistance, the [getting help guide](https://nuxt.com/docs/4.x/community/getting-help) provides resources to help you out.
96
+ - **Reporting Bugs:** If you come across any bugs or issues, please check out the [reporting bugs guide](https://nuxt.com/docs/community/reporting-bugs) to learn how to submit a bug report.
97
+ - **Suggestions:** Have ideas to enhance Nuxt? We'd love to hear them! Check out the [contribution guide](https://nuxt.com/docs/community/contribution) to share your suggestions.
98
+ - **Questions:** If you have questions or need assistance, the [getting help guide](https://nuxt.com/docs/community/getting-help) provides resources to help you out.
99
99
 
100
100
  ## <a name="local-development">🏠 Local Development</a>
101
101
 
102
- Follow the docs to [Set Up Your Local Development Environment](https://nuxt.com/docs/4.x/community/framework-contribution#setup) to contribute to the framework and documentation.
102
+ Follow the docs to [Set Up Your Local Development Environment](https://nuxt.com/docs/community/framework-contribution#setup) to contribute to the framework and documentation.
103
103
 
104
104
  ## <a name="professional-support">🛟 Professional Support</a>
105
105
 
package/dist/index.d.mts CHANGED
@@ -10,15 +10,6 @@ declare module 'nitropack' {
10
10
  buildAssetsDir: string;
11
11
  cdnURL: string;
12
12
  }
13
- interface NitroRouteRules {
14
- ssr?: boolean;
15
- noScripts?: boolean;
16
- /** @deprecated Use `noScripts` instead */
17
- experimentalNoScripts?: boolean;
18
- appMiddleware?: Record<string, boolean>;
19
- }
20
- }
21
- declare module 'nitropack' {
22
13
  interface NitroRuntimeConfig extends RuntimeConfig {
23
14
  }
24
15
  interface NitroRouteConfig {
@@ -27,25 +18,6 @@ declare module 'nitropack' {
27
18
  /** @deprecated Use `noScripts` instead */
28
19
  experimentalNoScripts?: boolean;
29
20
  }
30
- interface NitroRuntimeHooks {
31
- 'dev:ssr-logs': (ctx: {
32
- logs: LogObject[];
33
- path: string;
34
- }) => void | Promise<void>;
35
- 'render:html': (htmlContext: NuxtRenderHTMLContext, context: {
36
- event: H3Event;
37
- }) => void | Promise<void>;
38
- 'render:island': (islandResponse: NuxtIslandResponse, context: {
39
- event: H3Event;
40
- islandContext: NuxtIslandContext;
41
- }) => void | Promise<void>;
42
- }
43
- }
44
- declare module 'nitropack/types' {
45
- interface NitroRuntimeConfigApp {
46
- buildAssetsDir: string;
47
- cdnURL: string;
48
- }
49
21
  interface NitroRouteRules {
50
22
  ssr?: boolean;
51
23
  noScripts?: boolean;
@@ -53,16 +25,6 @@ declare module 'nitropack/types' {
53
25
  experimentalNoScripts?: boolean;
54
26
  appMiddleware?: Record<string, boolean>;
55
27
  }
56
- }
57
- declare module 'nitropack/types' {
58
- interface NitroRuntimeConfig extends RuntimeConfig {
59
- }
60
- interface NitroRouteConfig {
61
- ssr?: boolean;
62
- noScripts?: boolean;
63
- /** @deprecated Use `noScripts` instead */
64
- experimentalNoScripts?: boolean;
65
- }
66
28
  interface NitroRuntimeHooks {
67
29
  'dev:ssr-logs': (ctx: {
68
30
  logs: LogObject[];
package/dist/index.d.ts CHANGED
@@ -10,15 +10,6 @@ declare module 'nitropack' {
10
10
  buildAssetsDir: string;
11
11
  cdnURL: string;
12
12
  }
13
- interface NitroRouteRules {
14
- ssr?: boolean;
15
- noScripts?: boolean;
16
- /** @deprecated Use `noScripts` instead */
17
- experimentalNoScripts?: boolean;
18
- appMiddleware?: Record<string, boolean>;
19
- }
20
- }
21
- declare module 'nitropack' {
22
13
  interface NitroRuntimeConfig extends RuntimeConfig {
23
14
  }
24
15
  interface NitroRouteConfig {
@@ -27,25 +18,6 @@ declare module 'nitropack' {
27
18
  /** @deprecated Use `noScripts` instead */
28
19
  experimentalNoScripts?: boolean;
29
20
  }
30
- interface NitroRuntimeHooks {
31
- 'dev:ssr-logs': (ctx: {
32
- logs: LogObject[];
33
- path: string;
34
- }) => void | Promise<void>;
35
- 'render:html': (htmlContext: NuxtRenderHTMLContext, context: {
36
- event: H3Event;
37
- }) => void | Promise<void>;
38
- 'render:island': (islandResponse: NuxtIslandResponse, context: {
39
- event: H3Event;
40
- islandContext: NuxtIslandContext;
41
- }) => void | Promise<void>;
42
- }
43
- }
44
- declare module 'nitropack/types' {
45
- interface NitroRuntimeConfigApp {
46
- buildAssetsDir: string;
47
- cdnURL: string;
48
- }
49
21
  interface NitroRouteRules {
50
22
  ssr?: boolean;
51
23
  noScripts?: boolean;
@@ -53,16 +25,6 @@ declare module 'nitropack/types' {
53
25
  experimentalNoScripts?: boolean;
54
26
  appMiddleware?: Record<string, boolean>;
55
27
  }
56
- }
57
- declare module 'nitropack/types' {
58
- interface NitroRuntimeConfig extends RuntimeConfig {
59
- }
60
- interface NitroRouteConfig {
61
- ssr?: boolean;
62
- noScripts?: boolean;
63
- /** @deprecated Use `noScripts` instead */
64
- experimentalNoScripts?: boolean;
65
- }
66
28
  interface NitroRuntimeHooks {
67
29
  'dev:ssr-logs': (ctx: {
68
30
  logs: LogObject[];
package/dist/index.mjs CHANGED
@@ -16,7 +16,7 @@ import { isWindows } from 'std-env';
16
16
  import { ImpoundPlugin } from 'impound';
17
17
  import { resolveModulePath } from 'exsolve';
18
18
 
19
- const version = "4.2.0-29355133.7db30a63";
19
+ const version = "4.2.0-29356294.cb1dadee";
20
20
 
21
21
  function toArray(value) {
22
22
  return Array.isArray(value) ? value : [value];
@@ -28,7 +28,7 @@ if (/(?:chunks|shared)$/.test(_distDir)) {
28
28
  const distDir = _distDir;
29
29
 
30
30
  const template = () => {
31
- return '<svg xmlns="http://www.w3.org/2000/svg" width="80" fill="none" class="nuxt-spa-loading" viewBox="0 0 37 25"><path d="M24.236 22.006h10.742L25.563 5.822l-8.979 14.31a4 4 0 0 1-3.388 1.874H2.978l11.631-20 5.897 10.567"/></svg><style>.nuxt-spa-loading{left:50%;position:fixed;top:50%;transform:translate(-50%,-50%)}.nuxt-spa-loading>path{animation:nuxt-spa-loading-move 3s linear infinite;fill:none;stroke:#00dc82;stroke-dasharray:128;stroke-dashoffset:128;stroke-linecap:round;stroke-linejoin:round;stroke-width:4px}@keyframes nuxt-spa-loading-move{to{stroke-dashoffset:-128}}</style>';
31
+ return '<svg xmlns="http://www.w3.org/2000/svg" width="80" fill="none" class="nuxt-spa-loading" viewBox="0 0 37 25"><path d="M24.236 22.006h10.742L25.563 5.822l-8.979 14.31a4 4 0 0 1-3.388 1.874H2.978l11.631-20 5.897 10.567"/></svg><style>.nuxt-spa-loading{left:50%;position:fixed;top:50%;transform:translate(-50%,-50%)}.nuxt-spa-loading>path{fill:none;stroke:#00dc82;stroke-width:4px;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:128;stroke-dashoffset:128;animation:nuxt-spa-loading-move 3s linear infinite}@keyframes nuxt-spa-loading-move{to{stroke-dashoffset:-128}}</style>';
32
32
  };
33
33
 
34
34
  function createImportProtectionPatterns(nuxt, options) {
@@ -91,6 +91,7 @@ const nitroSchemaTemplate = {
91
91
  /* typescript */
92
92
  `
93
93
  ${lines.join("\n")}
94
+ /// <reference path="./schema.d.ts" />
94
95
 
95
96
  import type { RuntimeConfig } from 'nuxt/schema'
96
97
  import type { H3Event } from 'h3'
@@ -122,31 +123,6 @@ declare module 'nitropack' {
122
123
  'render:island': (islandResponse: NuxtIslandResponse, context: { event: H3Event, islandContext: NuxtIslandContext }) => void | Promise<void>
123
124
  }
124
125
  }
125
- declare module 'nitropack/types' {
126
- interface NitroRuntimeConfigApp {
127
- buildAssetsDir: string
128
- cdnURL: string
129
- }
130
- interface NitroRuntimeConfig extends RuntimeConfig {}
131
- interface NitroRouteConfig {
132
- ssr?: boolean
133
- noScripts?: boolean
134
- /** @deprecated Use \`noScripts\` instead */
135
- experimentalNoScripts?: boolean
136
- }
137
- interface NitroRouteRules {
138
- ssr?: boolean
139
- noScripts?: boolean
140
- /** @deprecated Use \`noScripts\` instead */
141
- experimentalNoScripts?: boolean
142
- appMiddleware?: Record<string, boolean>
143
- }
144
- interface NitroRuntimeHooks {
145
- 'dev:ssr-logs': (ctx: { logs: LogObject[], path: string }) => void | Promise<void>
146
- 'render:html': (htmlContext: NuxtRenderHTMLContext, context: { event: H3Event }) => void | Promise<void>
147
- 'render:island': (islandResponse: NuxtIslandResponse, context: { event: H3Event, islandContext: NuxtIslandContext }) => void | Promise<void>
148
- }
149
- }
150
126
  `
151
127
  );
152
128
  }
@@ -201,7 +177,8 @@ async function bundle(nuxt) {
201
177
  const modules = await resolveNuxtModule(rootDirWithSlash, moduleEntryPaths);
202
178
  addTemplate(nitroSchemaTemplate);
203
179
  const sharedDirs = /* @__PURE__ */ new Set();
204
- if (nuxt.options.nitro.imports !== false && nuxt.options.imports.scan !== false) {
180
+ const isNuxtV4 = nuxt.options.future?.compatibilityVersion === 4;
181
+ if (isNuxtV4 && (nuxt.options.nitro.imports !== false && nuxt.options.imports.scan !== false)) {
205
182
  for (const layer of nuxt.options._layers) {
206
183
  if (layer.config?.imports?.scan === false) {
207
184
  continue;
@@ -292,13 +269,13 @@ async function bundle(nuxt) {
292
269
  } : false,
293
270
  scanDirs: layerDirs.map((dirs) => dirs.server),
294
271
  renderer: resolve(distDir, "runtime/handlers/renderer"),
272
+ errorHandler: resolve(distDir, "runtime/handlers/error"),
295
273
  nodeModulesDirs: nuxt.options.modulesDir,
296
274
  handlers: nuxt.options.serverHandlers,
297
275
  devHandlers: [],
298
276
  baseURL: nuxt.options.app.baseURL,
299
277
  virtual: {
300
- "#internal/nuxt.config.mjs": () => nuxt.vfs["#build/nuxt.config.mjs"] || "",
301
- "#internal/nuxt/app-config": () => nuxt.vfs["#build/app.config.mjs"]?.replace(/\/\*\* client \*\*\/[\s\S]*\/\*\* client-end \*\*\//, "") || "",
278
+ "#internal/nuxt.config.mjs": () => nuxt.vfs["#build/nuxt.config.mjs"],
302
279
  "#spa-template": async () => `export const template = ${JSON.stringify(await spaLoadingTemplate(nuxt))}`,
303
280
  // this will be overridden in vite plugin
304
281
  "#internal/entry-chunk.mjs": () => `export const entryFileName = undefined`,
@@ -315,8 +292,7 @@ async function bundle(nuxt) {
315
292
  tsconfigPath: "tsconfig.server.json",
316
293
  tsConfig: {
317
294
  compilerOptions: {
318
- lib: ["esnext", "webworker", "dom.iterable"],
319
- skipLibCheck: true
295
+ lib: ["esnext", "webworker", "dom.iterable"]
320
296
  },
321
297
  include: [
322
298
  join(nuxt.options.buildDir, "types/nitro-nuxt.d.ts"),
@@ -331,6 +307,7 @@ async function bundle(nuxt) {
331
307
  ],
332
308
  exclude: [
333
309
  ...nuxt.options.modulesDir.map((m) => relativeWithDot(nuxt.options.buildDir, m)),
310
+ // nitro generate output: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/core/nitro.ts#L186
334
311
  relativeWithDot(nuxt.options.buildDir, resolve(nuxt.options.rootDir, "dist"))
335
312
  ]
336
313
  }
@@ -394,16 +371,16 @@ async function bundle(nuxt) {
394
371
  "#internal/nuxt/paths": resolve(distDir, "runtime/utils/paths")
395
372
  },
396
373
  replace: {
397
- "process.env.NUXT_NO_SSR": String(nuxt.options.ssr === false),
398
- "process.env.NUXT_EARLY_HINTS": String(nuxt.options.experimental.writeEarlyHints !== false),
374
+ "process.env.NUXT_NO_SSR": nuxt.options.ssr === false,
375
+ "process.env.NUXT_EARLY_HINTS": nuxt.options.experimental.writeEarlyHints !== false,
399
376
  "process.env.NUXT_NO_SCRIPTS": String(nuxt.options.features.noScripts === "all" || !!nuxt.options.features.noScripts && !nuxt.options.dev),
400
- "process.env.NUXT_INLINE_STYLES": String(!!nuxt.options.features.inlineStyles),
377
+ "process.env.NUXT_INLINE_STYLES": !!nuxt.options.features.inlineStyles,
401
378
  "process.env.PARSE_ERROR_DATA": String(!!nuxt.options.experimental.parseErrorData),
402
- "process.env.NUXT_JSON_PAYLOADS": String(!!nuxt.options.experimental.renderJsonPayloads),
403
- "process.env.NUXT_ASYNC_CONTEXT": String(!!nuxt.options.experimental.asyncContext),
404
- "process.env.NUXT_SHARED_DATA": String(!!nuxt.options.experimental.sharedPrerenderData),
405
- "process.dev": String(nuxt.options.dev),
406
- "__VUE_PROD_DEVTOOLS__": String(false)
379
+ "process.env.NUXT_JSON_PAYLOADS": !!nuxt.options.experimental.renderJsonPayloads,
380
+ "process.env.NUXT_ASYNC_CONTEXT": !!nuxt.options.experimental.asyncContext,
381
+ "process.env.NUXT_SHARED_DATA": !!nuxt.options.experimental.sharedPrerenderData,
382
+ "process.dev": nuxt.options.dev,
383
+ "__VUE_PROD_DEVTOOLS__": false
407
384
  },
408
385
  rollupConfig: {
409
386
  output: {
@@ -416,17 +393,6 @@ async function bundle(nuxt) {
416
393
  },
417
394
  logLevel: logLevelMapReverse[nuxt.options.logLevel]
418
395
  });
419
- if (nuxt.options.experimental.serverAppConfig && nitroConfig.imports) {
420
- nitroConfig.imports.imports ||= [];
421
- nitroConfig.imports.imports.push({
422
- name: "useAppConfig",
423
- from: resolve(distDir, "runtime/utils/app-config"),
424
- priority: -1
425
- });
426
- }
427
- if (!nitroConfig.errorHandler && (nuxt.options.dev || !nuxt.options.experimental.noVueServer)) {
428
- nitroConfig.errorHandler = resolve(distDir, "runtime/handlers/error");
429
- }
430
396
  nitroConfig.srcDir = resolve(nuxt.options.rootDir, nuxt.options.srcDir, nitroConfig.srcDir);
431
397
  nitroConfig.ignore ||= [];
432
398
  nitroConfig.ignore.push(
@@ -462,6 +428,16 @@ async function bundle(nuxt) {
462
428
  await promises.writeFile(join(tempDir, `meta/${buildId}.json`), JSON.stringify({}));
463
429
  });
464
430
  }
431
+ if (nuxt.options.future.compatibilityVersion !== 4) {
432
+ nuxt.hook("nitro:config", (config) => {
433
+ for (const value of Object.values(config.routeRules || {})) {
434
+ if ("experimentalNoScripts" in value) {
435
+ value.noScripts = value.experimentalNoScripts;
436
+ delete value.experimentalNoScripts;
437
+ }
438
+ }
439
+ });
440
+ }
465
441
  nuxt.hook("nitro:config", (config) => {
466
442
  config.alias ||= {};
467
443
  config.alias["#app-manifest"] = join(tempDir, `meta/${buildId}.json`);
@@ -555,6 +531,13 @@ async function bundle(nuxt) {
555
531
  nitroConfig.virtual["#build/dist/server/styles.mjs".replace(FORWARD_SLASH_RE, "\\")] = "export default {}";
556
532
  }
557
533
  }
534
+ if (nuxt.options.experimental.respectNoSSRHeader) {
535
+ nitroConfig.handlers ||= [];
536
+ nitroConfig.handlers.push({
537
+ handler: resolve(distDir, "runtime/middleware/no-ssr"),
538
+ middleware: true
539
+ });
540
+ }
558
541
  nitroConfig.rollupConfig.plugins = await nitroConfig.rollupConfig.plugins || [];
559
542
  nitroConfig.rollupConfig.plugins = toArray(nitroConfig.rollupConfig.plugins);
560
543
  const sharedDir = withTrailingSlash(resolve(nuxt.options.rootDir, nuxt.options.dir.shared));
@@ -701,7 +684,6 @@ async function bundle(nuxt) {
701
684
  if (!nuxt.options.dev && nuxt.options.experimental.noVueServer) {
702
685
  nitro.hooks.hook("rollup:before", (nitro2) => {
703
686
  if (nitro2.options.preset === "nitro-prerender") {
704
- nitro2.options.errorHandler = resolve(distDir, "runtime/handlers/error");
705
687
  return;
706
688
  }
707
689
  const nuxtErrorHandler = nitro2.options.handlers.findIndex((h) => h.route === "/__nuxt_error");
@@ -709,13 +691,9 @@ async function bundle(nuxt) {
709
691
  nitro2.options.handlers.splice(nuxtErrorHandler, 1);
710
692
  }
711
693
  nitro2.options.renderer = void 0;
694
+ nitro2.options.errorHandler = "#internal/nitro/error";
712
695
  });
713
696
  }
714
- nitro.hooks.hook("types:extend", (types) => {
715
- types.tsConfig ||= {};
716
- const rootDirGlob = relativeWithDot(nuxt.options.buildDir, join(nuxt.options.rootDir, "**/*"));
717
- types.tsConfig.include = types.tsConfig.include?.filter((i) => i !== rootDirGlob);
718
- });
719
697
  nuxt.hook("prepare:types", async (opts) => {
720
698
  if (!nuxt.options.dev) {
721
699
  await scanHandlers(nitro);
@@ -723,21 +701,7 @@ async function bundle(nuxt) {
723
701
  }
724
702
  opts.tsConfig.exclude ||= [];
725
703
  opts.tsConfig.exclude.push(relative(nuxt.options.buildDir, resolve(nuxt.options.rootDir, nitro.options.output.dir)));
726
- opts.tsConfig.exclude.push(relative(nuxt.options.buildDir, resolve(nuxt.options.rootDir, nuxt.options.serverDir)));
727
704
  opts.references.push({ path: resolve(nuxt.options.buildDir, "types/nitro.d.ts") });
728
- opts.sharedTsConfig.compilerOptions ||= {};
729
- opts.sharedTsConfig.compilerOptions.paths ||= {};
730
- for (const key in nuxt.options.alias) {
731
- if (nitro.options.alias[key] && nitro.options.alias[key] === nuxt.options.alias[key]) {
732
- const dirKey = join(key, "*");
733
- if (opts.tsConfig.compilerOptions?.paths[key]) {
734
- opts.sharedTsConfig.compilerOptions.paths[key] = opts.tsConfig.compilerOptions.paths[key];
735
- }
736
- if (opts.tsConfig.compilerOptions?.paths[dirKey]) {
737
- opts.sharedTsConfig.compilerOptions.paths[dirKey] = opts.tsConfig.compilerOptions.paths[dirKey];
738
- }
739
- }
740
- }
741
705
  });
742
706
  if (nitro.options.static) {
743
707
  nitro.hooks.hook("prerender:routes", (routes) => {
@@ -1,3 +1,3 @@
1
- import type { NitroErrorHandler } from 'nitropack/types';
1
+ import type { NitroErrorHandler } from 'nitropack';
2
2
  declare const _default: NitroErrorHandler;
3
3
  export default _default;
@@ -1,7 +1,8 @@
1
1
  import { joinURL, withQuery, withoutBase } from "ufo";
2
2
  import { appendResponseHeader, getRequestHeaders, send, setResponseHeader, setResponseHeaders, setResponseStatus } from "h3";
3
- import { useNitroApp, useRuntimeConfig } from "nitropack/runtime";
4
3
  import { isJsonRequest } from "../utils/error.js";
4
+ import { useRuntimeConfig } from "#internal/nitro";
5
+ import { useNitroApp } from "#internal/nitro/app";
5
6
  import { generateErrorOverlayHTML } from "../utils/dev.js";
6
7
  export default (async function errorhandler(error, event, { defaultHandler }) {
7
8
  if (event.handled || isJsonRequest(event)) {
@@ -1,4 +1,4 @@
1
- import type { RenderResponse } from 'nitropack/types';
1
+ import type { RenderResponse } from 'nitropack';
2
2
  import type { NuxtIslandResponse } from 'nuxt/app';
3
3
  declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<NuxtIslandResponse | Partial<RenderResponse>>>;
4
4
  export default _default;
@@ -1,4 +1,3 @@
1
- import { useNitroApp } from "nitropack/runtime";
2
1
  import { destr } from "destr";
3
2
  import { defineEventHandler, getQuery, readBody, setResponseHeaders } from "h3";
4
3
  import { resolveUnrefHeadInput } from "@unhead/vue";
@@ -9,6 +8,7 @@ import { createSSRContext } from "../utils/renderer/app.js";
9
8
  import { getSSRRenderer } from "../utils/renderer/build-files.js";
10
9
  import { renderInlineStyles } from "../utils/renderer/inline-styles.js";
11
10
  import { getClientIslandResponse, getServerComponentHTML, getSlotIslandResponse } from "../utils/renderer/islands.js";
11
+ import { useNitroApp } from "#internal/nitro";
12
12
  const ISLAND_SUFFIX_RE = /\.json(?:\?.*)?$/;
13
13
  export default defineEventHandler(async (event) => {
14
14
  const nitroApp = useNitroApp();
@@ -64,6 +64,8 @@ export default defineEventHandler(async (event) => {
64
64
  islandHead[key] = value;
65
65
  }
66
66
  }
67
+ islandHead.link ||= [];
68
+ islandHead.style ||= [];
67
69
  const islandResponse = {
68
70
  id: islandContext.id,
69
71
  head: islandHead,
@@ -4,5 +4,5 @@ export interface NuxtRenderResponse {
4
4
  statusMessage?: string;
5
5
  headers: Record<string, string>;
6
6
  }
7
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
7
+ declare const _default: any;
8
8
  export default _default;
@@ -9,13 +9,13 @@ import { appendResponseHeader, createError, getQuery, getResponseStatus, getResp
9
9
  import { getQuery as getURLQuery, joinURL } from "ufo";
10
10
  import { propsToString, renderSSRHead } from "@unhead/vue/server";
11
11
  import destr from "destr";
12
- import { defineRenderHandler, getRouteRules, useNitroApp } from "nitropack/runtime";
13
12
  import { getRenderer } from "../utils/renderer/build-files.js";
14
13
  import { payloadCache } from "../utils/cache.js";
15
14
  import { renderPayloadJsonScript, renderPayloadResponse, renderPayloadScript, splitPayload } from "../utils/renderer/payload.js";
16
15
  import { createSSRContext, setSSRError } from "../utils/renderer/app.js";
17
16
  import { renderInlineStyles } from "../utils/renderer/inline-styles.js";
18
17
  import { replaceIslandTeleports } from "../utils/renderer/islands.js";
18
+ import { defineRenderHandler, getRouteRules, useNitroApp } from "#internal/nitro";
19
19
  import { renderSSRHeadOptions } from "#internal/unhead.config.mjs";
20
20
  import { appHead, appTeleportAttrs, appTeleportTag, componentIslands, appManifest as isAppManifestEnabled } from "#internal/nuxt.config.mjs";
21
21
  import entryIds from "#internal/nuxt/entry-ids.mjs";
@@ -1,3 +1,3 @@
1
- import type { NitroApp } from 'nitropack/types';
1
+ import type { NitroApp } from '#internal/nitro/app';
2
2
  declare const _default: (nitroApp: NitroApp) => void;
3
3
  export default _default;
@@ -67,7 +67,7 @@ export default (nitroApp) => {
67
67
  htmlContext.bodyAppend.unshift(`<script type="application/json" data-nuxt-logs="${appId}">${stringify(ctx.logs, reducers)}<\/script>`);
68
68
  } catch (e) {
69
69
  const shortError = e instanceof Error && "toString" in e ? ` Received \`${e.toString()}\`.` : "";
70
- console.warn(`[nuxt] Failed to stringify dev server logs.${shortError} You can define your own reducer/reviver for rich types following the instructions in https://nuxt.com/docs/4.x/api/composables/use-nuxt-app#payload.`);
70
+ console.warn(`[nuxt] Failed to stringify dev server logs.${shortError} You can define your own reducer/reviver for rich types following the instructions in https://nuxt.com/docs/api/composables/use-nuxt-app#payload.`);
71
71
  }
72
72
  });
73
73
  };
@@ -1,2 +1,2 @@
1
- export type DefaultMessages = Record<"appName" | "statusCode" | "statusMessage" | "description" | "refresh", string | boolean | number>;
1
+ export type DefaultMessages = Record<"appName" | "version" | "statusCode" | "statusMessage" | "description", string | boolean | number>;
2
2
  export declare const template: (messages: Partial<DefaultMessages>) => string;
@@ -1,6 +1,6 @@
1
1
  import { escapeHtml } from "@vue/shared";
2
- const _messages = { "appName": "Nuxt", "statusCode": 500, "statusMessage": "Internal server error", "description": "This page is temporarily unavailable.", "refresh": "Refresh this page" };
2
+ const _messages = { "appName": "Nuxt", "version": "", "statusCode": 500, "statusMessage": "Server error", "description": "This page is temporarily unavailable." };
3
3
  export const template = (messages) => {
4
4
  messages = { ..._messages, ...messages };
5
- return '<!DOCTYPE html><html lang="en"><head><title>' + escapeHtml(messages.statusCode) + " - " + escapeHtml(messages.statusMessage) + " | " + escapeHtml(messages.appName) + `</title><meta charset="utf-8"><meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0" name="viewport"><script>!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();<\/script><style>*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.grid{display:grid}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.max-w-520px{max-width:520px}.min-h-screen{min-height:100vh}.place-content-center{place-content:center}.overflow-hidden{overflow:hidden}.bg-white{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-2{padding-left:.5rem;padding-right:.5rem}.text-center{text-align:center}.text-\\[80px\\]{font-size:80px}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\\[\\#020420\\]{--un-text-opacity:1;color:rgb(2 4 32/var(--un-text-opacity))}.text-\\[\\#64748B\\]{--un-text-opacity:1;color:rgb(100 116 139/var(--un-text-opacity))}.font-semibold{font-weight:600}.leading-none{line-height:1}.tracking-wide{letter-spacing:.025em}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.tabular-nums{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(prefers-color-scheme:dark){.dark\\:bg-\\[\\#020420\\]{--un-bg-opacity:1;background-color:rgb(2 4 32/var(--un-bg-opacity))}.dark\\:text-white{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media(min-width:640px){.sm\\:text-\\[110px\\]{font-size:110px}.sm\\:text-3xl{font-size:1.875rem;line-height:2.25rem}}</style></head><body class="antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide"><div class="max-w-520px text-center"><h1 class="font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]">` + escapeHtml(messages.statusCode) + '</h1><h2 class="font-semibold mb-2 sm:text-3xl text-2xl">' + escapeHtml(messages.statusMessage) + '</h2><p class="mb-4 px-2 text-[#64748B] text-md">' + escapeHtml(messages.description) + "</p></div></body></html>";
5
+ return '<!DOCTYPE html><html lang="en"><head><title>' + escapeHtml(messages.statusCode) + " - " + escapeHtml(messages.statusMessage) + " | " + escapeHtml(messages.appName) + `</title><meta charset="utf-8"><meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0" name="viewport"><style>.spotlight{background:linear-gradient(45deg,#00dc82,#36e4da 50%,#0047e1);filter:blur(20vh)}*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1{font-size:inherit;font-weight:inherit}h1,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.fixed{position:fixed}.-bottom-1\\/2{bottom:-50%}.left-0{left:0}.right-0{right:0}.grid{display:grid}.mb-16{margin-bottom:4rem}.mb-8{margin-bottom:2rem}.h-1\\/2{height:50%}.max-w-520px{max-width:520px}.min-h-screen{min-height:100vh}.place-content-center{place-content:center}.overflow-hidden{overflow:hidden}.bg-white{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-8{padding-left:2rem;padding-right:2rem}.text-center{text-align:center}.text-8xl{font-size:6rem;line-height:1}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-black{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.font-light{font-weight:300}.font-medium{font-weight:500}.leading-tight{line-height:1.25}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (prefers-color-scheme:dark){.dark\\:bg-black{--un-bg-opacity:1;background-color:rgb(0 0 0/var(--un-bg-opacity))}.dark\\:text-white{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media (min-width:640px){.sm\\:px-0{padding-left:0;padding-right:0}.sm\\:text-4xl{font-size:2.25rem;line-height:2.5rem}}</style><script>!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver((e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)})).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();<\/script></head><body class="antialiased bg-white dark:bg-black dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-black"><div class="-bottom-1/2 fixed h-1/2 left-0 right-0 spotlight"></div><div class="max-w-520px text-center"><h1 class="font-medium mb-8 sm:text-10xl text-8xl">` + escapeHtml(messages.statusCode) + '</h1><p class="font-light leading-tight mb-16 px-8 sm:px-0 sm:text-4xl text-xl">' + escapeHtml(messages.description) + "</p></div></body></html>";
6
6
  };
@@ -1,6 +1,6 @@
1
- export declare const payloadCache: import("unstorage").Storage<import("unstorage").StorageValue> | null;
2
- export declare const islandCache: import("unstorage").Storage<import("unstorage").StorageValue> | null;
3
- export declare const islandPropCache: import("unstorage").Storage<import("unstorage").StorageValue> | null;
1
+ export declare const payloadCache: any;
2
+ export declare const islandCache: any;
3
+ export declare const islandPropCache: any;
4
4
  export declare const sharedPrerenderPromises: Map<string, Promise<any>> | null;
5
5
  export declare const sharedPrerenderCache: {
6
6
  get<T = unknown>(key: string): Promise<T> | undefined;
@@ -1,4 +1,4 @@
1
- import { useStorage } from "nitropack/runtime";
1
+ import { useStorage } from "#internal/nitro";
2
2
  export const payloadCache = import.meta.prerender ? useStorage("internal:nuxt:prerender:payload") : null;
3
3
  export const islandCache = import.meta.prerender ? useStorage("internal:nuxt:prerender:island") : null;
4
4
  export const islandPropCache = import.meta.prerender ? useStorage("internal:nuxt:prerender:island-props") : null;
@@ -1,6 +1,6 @@
1
1
  import type { H3Event } from 'h3';
2
2
  /**
3
- * Nitro internal functions extracted from https://github.com/nitrojs/nitro/blob/main/src/runtime/internal/utils.ts
3
+ * Nitro internal functions extracted from https://github.com/nitrojs/nitro/blob/v2/src/runtime/internal/utils.ts
4
4
  */
5
5
  export declare function isJsonRequest(event: H3Event): boolean;
6
6
  export declare function hasReqHeader(event: H3Event, name: string, includes: string): boolean | "" | undefined;
@@ -1,5 +1,5 @@
1
1
  import { joinRelativeURL } from "ufo";
2
- import { useRuntimeConfig } from "nitropack/runtime";
2
+ import { useRuntimeConfig } from "#internal/nitro";
3
3
  export function baseURL() {
4
4
  return useRuntimeConfig().app.baseURL;
5
5
  }
@@ -1,6 +1,6 @@
1
- import { useRuntimeConfig } from "nitropack/runtime";
2
1
  import { createHead } from "@unhead/vue/server";
3
2
  import { sharedPrerenderCache } from "../cache.js";
3
+ import { useRuntimeConfig } from "#internal/nitro";
4
4
  import unheadOptions from "#internal/unhead-options.mjs";
5
5
  const PRERENDER_NO_SSR_ROUTES = /* @__PURE__ */ new Set(["/index.html", "/200.html", "/404.html"]);
6
6
  export function createSSRContext(event) {
@@ -1,7 +1,7 @@
1
1
  import { createRenderer } from "vue-bundle-renderer/runtime";
2
2
  import { renderToString as _renderToString } from "vue/server-renderer";
3
3
  import { propsToString } from "@unhead/vue/server";
4
- import { useRuntimeConfig } from "nitropack/runtime";
4
+ import { useRuntimeConfig } from "#internal/nitro";
5
5
  import { appRootAttrs, appRootTag, appSpaLoaderAttrs, appSpaLoaderTag, spaLoadingTemplateOutside } from "#internal/nuxt.config.mjs";
6
6
  import { buildAssetsURL } from "#internal/nuxt/paths";
7
7
  const APP_ROOT_OPEN_TAG = `<${appRootTag}${propsToString(appRootAttrs)}>`;
@@ -27,8 +27,8 @@ export declare function splitPayload(ssrContext: NuxtSSRContext): {
27
27
  state?: Record<string, any> | undefined;
28
28
  once?: Set<string> | undefined;
29
29
  config?: Pick<import("nuxt/schema").RuntimeConfig, "public" | "app"> | undefined;
30
- error?: import("nuxt/app").NuxtError<unknown> | undefined;
31
- _errors?: Record<string, import("nuxt/app").NuxtError<unknown> | undefined> | undefined;
30
+ error?: (import("nuxt/app").NuxtError | import("nuxt/app/defaults").DefaultErrorValue) | undefined;
31
+ _errors?: Record<string, import("nuxt/app").NuxtError<unknown> | null> | undefined;
32
32
  };
33
33
  payload: {
34
34
  data: Record<string, any> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/nitro-server-nightly",
3
- "version": "4.2.0-29355133.7db30a63",
3
+ "version": "4.2.0-29356294.cb1dadee",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -19,13 +19,13 @@
19
19
  ],
20
20
  "dependencies": {
21
21
  "@nuxt/devalue": "^2.0.2",
22
- "@nuxt/kit": "npm:@nuxt/kit-nightly@4.2.0-29355133.7db30a63",
23
- "@unhead/vue": "^2.0.19",
22
+ "@nuxt/kit": "npm:@nuxt/kit-nightly@3.20.0-29356294.cb1dadee",
23
+ "@unhead/vue": "^2.0.14",
24
24
  "@vue/shared": "^3.5.22",
25
25
  "consola": "^3.4.2",
26
26
  "defu": "^6.1.4",
27
27
  "destr": "^2.0.5",
28
- "devalue": "^5.4.2",
28
+ "devalue": "^5.3.2",
29
29
  "errx": "^0.1.0",
30
30
  "escape-string-regexp": "^5.0.0",
31
31
  "exsolve": "^1.0.7",
@@ -37,7 +37,7 @@
37
37
  "pathe": "^2.0.3",
38
38
  "pkg-types": "^2.3.0",
39
39
  "radix3": "^1.1.2",
40
- "std-env": "^3.10.0",
40
+ "std-env": "^3.9.0",
41
41
  "ufo": "^1.6.1",
42
42
  "unctx": "^2.4.1",
43
43
  "unstorage": "^1.17.1",
@@ -46,11 +46,11 @@
46
46
  "vue-devtools-stub": "^0.1.0"
47
47
  },
48
48
  "peerDependencies": {
49
- "nuxt": "npm:nuxt-nightly@4.2.0-29355133.7db30a63"
49
+ "nuxt": "npm:nuxt-nightly@3.20.0-29356294.cb1dadee"
50
50
  },
51
51
  "devDependencies": {
52
- "@nuxt/schema": "npm:@nuxt/schema-nightly@4.2.0-29355133.7db30a63",
53
- "nuxt": "npm:nuxt-nightly@4.2.0-29355133.7db30a63",
52
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@3.20.0-29356294.cb1dadee",
53
+ "nuxt": "npm:nuxt-nightly@3.20.0-29356294.cb1dadee",
54
54
  "unbuild": "3.6.1",
55
55
  "vitest": "3.2.4"
56
56
  },
@@ -1,2 +0,0 @@
1
- import type { H3Event } from 'h3';
2
- export declare function useAppConfig(event?: H3Event): any;
@@ -1,25 +0,0 @@
1
- import { klona } from "klona";
2
- import _inlineAppConfig from "#internal/nuxt/app-config";
3
- const _sharedAppConfig = _deepFreeze(klona(_inlineAppConfig));
4
- export function useAppConfig(event) {
5
- if (!event) {
6
- return _sharedAppConfig;
7
- }
8
- event.context.nuxt ||= {};
9
- if (event.context.nuxt.appConfig) {
10
- return event.context.nuxt.appConfig;
11
- }
12
- const appConfig = klona(_inlineAppConfig);
13
- event.context.nuxt.appConfig = appConfig;
14
- return appConfig;
15
- }
16
- function _deepFreeze(object) {
17
- const propNames = Object.getOwnPropertyNames(object);
18
- for (const name of propNames) {
19
- const value = object[name];
20
- if (value && typeof value === "object") {
21
- _deepFreeze(value);
22
- }
23
- }
24
- return Object.freeze(object);
25
- }