@nuxt/nitro-server 4.2.0 → 4.2.1

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
@@ -1,11 +1,11 @@
1
- [![Nuxt banner](https://github.com/nuxt/nuxt/tree/main/.github/assets/banner.svg)](https://nuxt.com)
1
+ [![Nuxt banner](https://github.com/nuxt/nuxt/blob/main/.github/assets/banner.svg)](https://nuxt.com)
2
2
 
3
3
  # Nuxt
4
4
 
5
5
  <p>
6
6
  <a href="https://www.npmjs.com/package/nuxt"><img src="https://img.shields.io/npm/v/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="Version"></a>
7
7
  <a href="https://www.npmjs.com/package/nuxt"><img src="https://img.shields.io/npm/dm/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="Downloads"></a>
8
- <a href="https://github.com/nuxt/nuxt/tree/main/LICENSE"><img src="https://img.shields.io/github/license/nuxt/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="License"></a>
8
+ <a href="https://github.com/nuxt/nuxt/blob/main/LICENSE"><img src="https://img.shields.io/github/license/nuxt/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="License"></a>
9
9
  <a href="https://nuxt.com"><img src="https://img.shields.io/badge/Nuxt%20Docs-18181B?logo=nuxt" alt="Website"></a>
10
10
  <a href="https://chat.nuxt.dev"><img src="https://img.shields.io/badge/Nuxt%20Discord-18181B?logo=discord" alt="Discord"></a>
11
11
  <a href="https://securityscorecards.dev/"><img src="https://api.securityscorecards.dev/projects/github.com/nuxt/nuxt/badge" alt="Nuxt openssf scorecard score"></a>
@@ -109,9 +109,9 @@ Follow the docs to [Set Up Your Local Development Environment](https://nuxt.com/
109
109
  ## <a name="follow-us">🔗 Follow Us</a>
110
110
 
111
111
  <p valign="center">
112
- <a href="https://go.nuxt.com/discord"><img width="20px" src="https://github.com/nuxt/nuxt/tree/main/.github/assets/discord.svg" alt="Discord"></a>&nbsp;&nbsp;<a href="https://go.nuxt.com/x"><img width="20px" src="https://github.com/nuxt/nuxt/tree/main/.github/assets/twitter.svg" alt="Twitter"></a>&nbsp;&nbsp;<a href="https://go.nuxt.com/github"><img width="20px" src="https://github.com/nuxt/nuxt/tree/main/.github/assets/github.svg" alt="GitHub"></a>&nbsp;&nbsp;<a href="https://go.nuxt.com/bluesky"><img width="20px" src="https://github.com/nuxt/nuxt/tree/main/.github/assets/bluesky.svg" alt="Bluesky"></a>
112
+ <a href="https://go.nuxt.com/discord"><img width="20px" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/discord.svg" alt="Discord"></a>&nbsp;&nbsp;<a href="https://go.nuxt.com/x"><img width="20px" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/twitter.svg" alt="Twitter"></a>&nbsp;&nbsp;<a href="https://go.nuxt.com/github"><img width="20px" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/github.svg" alt="GitHub"></a>&nbsp;&nbsp;<a href="https://go.nuxt.com/bluesky"><img width="20px" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/bluesky.svg" alt="Bluesky"></a>
113
113
  </p>
114
114
 
115
115
  ## <a name="license">⚖️ License</a>
116
116
 
117
- [MIT](https://github.com/nuxt/nuxt/tree/main/LICENSE)
117
+ [MIT](https://github.com/nuxt/nuxt/blob/main/LICENSE)
package/dist/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { fileURLToPath, pathToFileURL } from 'node:url';
2
2
  import { existsSync, promises, readFileSync } from 'node:fs';
3
3
  import { cpus } from 'node:os';
4
+ import process from 'node:process';
4
5
  import { readFile, mkdir, writeFile } from 'node:fs/promises';
5
6
  import { randomUUID } from 'node:crypto';
6
7
  import { dirname, relative, resolve, join, isAbsolute } from 'pathe';
@@ -8,7 +9,7 @@ import { readPackageJSON } from 'pkg-types';
8
9
  import { toRouteMatcher, createRouter, exportMatcher } from 'radix3';
9
10
  import { withTrailingSlash, joinURL } from 'ufo';
10
11
  import { createNitro, scanHandlers, writeTypes, copyPublicAssets, prepare, build, prerender, createDevServer } from 'nitropack';
11
- import { getLayerDirectories, resolveNuxtModule, addTemplate, resolveAlias, addPlugin, resolveIgnorePatterns, createIsIgnored, addVitePlugin, logger, findPath } from '@nuxt/kit';
12
+ import { getLayerDirectories, getDirectory, resolveNuxtModule, addTemplate, resolveAlias, addPlugin, resolveIgnorePatterns, createIsIgnored, addVitePlugin, logger, findPath } from '@nuxt/kit';
12
13
  import escapeRE from 'escape-string-regexp';
13
14
  import { defu } from 'defu';
14
15
  import { dynamicEventHandler, defineEventHandler } from 'h3';
@@ -16,7 +17,7 @@ import { isWindows } from 'std-env';
16
17
  import { ImpoundPlugin } from 'impound';
17
18
  import { resolveModulePath } from 'exsolve';
18
19
 
19
- const version = "4.2.0";
20
+ const version = "4.2.1";
20
21
 
21
22
  function toArray(value) {
22
23
  return Array.isArray(value) ? value : [value];
@@ -195,7 +196,7 @@ async function bundle(nuxt) {
195
196
  for (const m of nuxt.options._installedModules) {
196
197
  const path = m.meta?.rawPath || m.entryPath;
197
198
  if (path) {
198
- moduleEntryPaths.push(path);
199
+ moduleEntryPaths.push(getDirectory(path));
199
200
  }
200
201
  }
201
202
  const modules = await resolveNuxtModule(rootDirWithSlash, moduleEntryPaths);
@@ -57,7 +57,7 @@ export default (async function errorhandler(error, event, { defaultHandler }) {
57
57
  setResponseStatus(event, res.status && res.status !== 200 ? res.status : defaultRes.status, res.statusText || defaultRes.statusText);
58
58
  if (import.meta.dev) {
59
59
  const prettyResponse = await defaultHandler(error, event, { json: false });
60
- return send(event, html.replace("</body>", `${generateErrorOverlayHTML(prettyResponse.body)}</body>`));
60
+ return send(event, html.replace("</body>", `${generateErrorOverlayHTML(prettyResponse.body, { startMinimized: 300 <= statusCode && statusCode < 500 })}</body>`));
61
61
  }
62
62
  return send(event, html);
63
63
  });
@@ -1,4 +1,5 @@
1
1
  import { AsyncLocalStorage } from "node:async_hooks";
2
+ import process from "node:process";
2
3
  import {
3
4
  getPrefetchLinks,
4
5
  getPreloadLinks,
@@ -1,4 +1,5 @@
1
1
  import { useStorage } from "nitropack/runtime";
2
+ import process from "node:process";
2
3
  export const payloadCache = import.meta.prerender ? useStorage("internal:nuxt:prerender:payload") : null;
3
4
  export const islandCache = import.meta.prerender ? useStorage("internal:nuxt:prerender:island") : null;
4
5
  export const islandPropCache = import.meta.prerender ? useStorage("internal:nuxt:prerender:island-props") : null;
@@ -1 +1,3 @@
1
- export declare function generateErrorOverlayHTML(html: string): string;
1
+ export declare function generateErrorOverlayHTML(html: string, options?: {
2
+ startMinimized?: boolean;
3
+ }): string;
@@ -151,6 +151,7 @@ const errorCSS = (
151
151
  top: 0;
152
152
  width: 100vw;
153
153
  height: 100vh;
154
+ border: none;
154
155
  z-index: var(--z-base);
155
156
  }
156
157
  #frame[inert] {
@@ -212,7 +213,7 @@ const errorCSS = (
212
213
  }
213
214
  `
214
215
  );
215
- function webComponentScript(base64HTML) {
216
+ function webComponentScript(base64HTML, startMinimized) {
216
217
  return (
217
218
  /* js */
218
219
  `
@@ -306,6 +307,11 @@ function webComponentScript(base64HTML) {
306
307
  shadow.appendChild(preview);
307
308
  shadow.appendChild(button);
308
309
 
310
+ if (${startMinimized}) {
311
+ iframe.setAttribute('inert', '');
312
+ button.setAttribute('aria-expanded', 'false');
313
+ }
314
+
309
315
  // Initialize preview
310
316
  setTimeout(updatePreview, 100);
311
317
 
@@ -316,13 +322,13 @@ function webComponentScript(base64HTML) {
316
322
  `
317
323
  );
318
324
  }
319
- export function generateErrorOverlayHTML(html) {
325
+ export function generateErrorOverlayHTML(html, options) {
320
326
  const nonce = Array.from(crypto.getRandomValues(new Uint8Array(16)), (b) => b.toString(16).padStart(2, "0")).join("");
321
327
  const errorPage = html.replace("<head>", `<head><script>${iframeStorageBridge(nonce)}<\/script>`);
322
328
  const base64HTML = Buffer.from(errorPage, "utf8").toString("base64");
323
329
  return `
324
330
  <script>${parentStorageBridge(nonce)}<\/script>
325
331
  <nuxt-error-overlay></nuxt-error-overlay>
326
- <script>${webComponentScript(base64HTML)}<\/script>
332
+ <script>${webComponentScript(base64HTML, options?.startMinimized ?? false)}<\/script>
327
333
  `;
328
334
  }
@@ -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,3 +1,4 @@
1
+ import process from "node:process";
1
2
  import { useRuntimeConfig } from "nitropack/runtime";
2
3
  import { createHead } from "@unhead/vue/server";
3
4
  import { sharedPrerenderCache } from "../cache.js";
@@ -1,3 +1,4 @@
1
+ import process from "node:process";
1
2
  import { createRenderer } from "vue-bundle-renderer/runtime";
2
3
  import { renderToString as _renderToString } from "vue/server-renderer";
3
4
  import { propsToString } from "@unhead/vue/server";
@@ -1,3 +1,4 @@
1
+ import process from "node:process";
1
2
  import { getResponseStatus, getResponseStatusText } from "h3";
2
3
  import devalue from "@nuxt/devalue";
3
4
  import { stringify, uneval } from "devalue";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/nitro-server",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@nuxt/devalue": "^2.0.2",
22
22
  "@unhead/vue": "^2.0.19",
23
- "@vue/shared": "^3.5.22",
23
+ "@vue/shared": "^3.5.23",
24
24
  "consola": "^3.4.2",
25
25
  "defu": "^6.1.4",
26
26
  "destr": "^2.0.5",
@@ -32,27 +32,27 @@
32
32
  "impound": "^1.0.0",
33
33
  "klona": "^2.0.6",
34
34
  "mocked-exports": "^0.1.1",
35
- "nitropack": "^2.12.8",
35
+ "nitropack": "^2.12.9",
36
36
  "pathe": "^2.0.3",
37
37
  "pkg-types": "^2.3.0",
38
38
  "radix3": "^1.1.2",
39
39
  "std-env": "^3.10.0",
40
40
  "ufo": "^1.6.1",
41
41
  "unctx": "^2.4.1",
42
- "unstorage": "^1.17.1",
43
- "vue": "^3.5.22",
42
+ "unstorage": "^1.17.2",
43
+ "vue": "^3.5.23",
44
44
  "vue-bundle-renderer": "^2.2.0",
45
45
  "vue-devtools-stub": "^0.1.0",
46
- "@nuxt/kit": "4.2.0"
46
+ "@nuxt/kit": "4.2.1"
47
47
  },
48
48
  "peerDependencies": {
49
- "nuxt": "^4.2.0"
49
+ "nuxt": "^4.2.1"
50
50
  },
51
51
  "devDependencies": {
52
52
  "unbuild": "3.6.1",
53
53
  "vitest": "3.2.4",
54
- "@nuxt/schema": "4.2.0",
55
- "nuxt": "4.2.0"
54
+ "nuxt": "4.2.1",
55
+ "@nuxt/schema": "4.2.1"
56
56
  },
57
57
  "engines": {
58
58
  "node": "^20.19.0 || >=22.12.0"