@nuxt/nitro-server-nightly 4.4.3-29561554.e9b2fa64 → 4.4.3-29571486.e4b31efa

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/index.mjs CHANGED
@@ -8,9 +8,9 @@ import { randomUUID } from "node:crypto";
8
8
  import { addRoute, createRouter, findAllRoutes } from "rou3";
9
9
  import { compileRouterToString } from "rou3/compiler";
10
10
  import { dirname, isAbsolute, join, relative, resolve } from "pathe";
11
- import { readPackageJSON } from "pkg-types";
12
11
  import { joinURL, withTrailingSlash } from "ufo";
13
12
  import { hash } from "ohash";
13
+ import nuxtPkg from "nuxt/package.json" with { type: "json" };
14
14
  import { build, copyPublicAssets, createDevServer, createNitro, prepare, prerender, scanHandlers, writeTypes } from "nitropack";
15
15
  import { addPlugin, addTemplate, addVitePlugin, createIsIgnored, findPath, getDirectory, getLayerDirectories, logger, resolveAlias, resolveIgnorePatterns, resolveNuxtModule } from "@nuxt/kit";
16
16
  import escapeRE from "escape-string-regexp";
@@ -22,7 +22,7 @@ import { ImpoundPlugin } from "impound";
22
22
  import { resolveModulePath } from "exsolve";
23
23
  import { runtimeDependencies } from "nitropack/runtime/meta";
24
24
  //#region package.json
25
- var version = "4.4.3-29561554.e9b2fa64";
25
+ var version = "4.4.3-29571486.e4b31efa";
26
26
  //#endregion
27
27
  //#region src/utils.ts
28
28
  function toArray(value) {
@@ -216,10 +216,13 @@ async function bundle(nuxt) {
216
216
  nuxt.options.nitro.virtual = defu(nuxt.options.nitro.virtual, { "#internal/dev-server-logs-options": () => `export const rootDir = ${JSON.stringify(nuxt.options.rootDir)};` });
217
217
  }
218
218
  if (nuxt.options.experimental.componentIslands) {
219
+ const islandHandlerPath = JSON.stringify(resolve(distDir, "runtime/handlers/island"));
220
+ const h3Path = JSON.stringify(resolve(distDir, "runtime/h3-compat"));
221
+ const ISLAND_RENDERER_KEY = "#internal/nuxt/island-renderer.mjs";
219
222
  nuxt.options.nitro.virtual ||= {};
220
- nuxt.options.nitro.virtual["#internal/nuxt/island-renderer.mjs"] = () => {
221
- if (nuxt.options.dev || nuxt.options.experimental.componentIslands !== "auto" || nuxt.apps.default?.pages?.some((p) => p.mode === "server") || nuxt.apps.default?.components?.some((c) => c.mode === "server" && !nuxt.apps.default?.components.some((other) => other.pascalName === c.pascalName && other.mode === "client"))) return `export { default } from '${resolve(distDir, "runtime/handlers/island")}'`;
222
- return `import { defineEventHandler } from 'h3'; export default defineEventHandler(() => {});`;
223
+ nuxt.options.nitro.virtual[ISLAND_RENDERER_KEY] = () => {
224
+ if (nuxt.options.dev || nuxt.options.experimental.componentIslands !== "auto" || nuxt.apps.default?.pages?.some((p) => p.mode === "server") || nuxt.apps.default?.components?.some((c) => c.mode === "server" && !nuxt.apps.default?.components.some((other) => other.pascalName === c.pascalName && other.mode === "client"))) return `export { default } from ${islandHandlerPath}`;
225
+ return `import { defineEventHandler } from ${h3Path}; export default defineEventHandler(() => {});`;
223
226
  };
224
227
  nuxt.options.nitro.handlers ||= [];
225
228
  nuxt.options.nitro.handlers.push({
@@ -233,7 +236,6 @@ async function bundle(nuxt) {
233
236
  }
234
237
  }
235
238
  const mockProxy = resolveModulePath("mocked-exports/proxy", { from: import.meta.url });
236
- const { version: nuxtVersion } = await readPackageJSON("nuxt", { from: import.meta.url });
237
239
  const nitroConfig = defu(nuxt.options.nitro, {
238
240
  debug: nuxt.options.debug ? nuxt.options.debug.nitro : false,
239
241
  rootDir: nuxt.options.rootDir,
@@ -247,7 +249,7 @@ async function bundle(nuxt) {
247
249
  },
248
250
  framework: {
249
251
  name: "nuxt",
250
- version: nuxtVersion || version
252
+ version: nuxtPkg.version || version
251
253
  },
252
254
  imports: nuxt.options.experimental.nitroAutoImports === false ? false : {
253
255
  autoImport: nuxt.options.imports.autoImport,
@@ -642,6 +644,15 @@ async function bundle(nuxt) {
642
644
  base: nitroConfig.srcDir,
643
645
  watchOptions: { ignored: [isIgnored] }
644
646
  };
647
+ const cacheDriverPath = join(distDir, "runtime/utils/cache-driver.js");
648
+ const cacheDriverOption = isWindows ? pathToFileURL(cacheDriverPath).href : cacheDriverPath;
649
+ if (nuxt.options.dev) {
650
+ const payloadCacheDir = resolve(nuxt.options.buildDir, "cache/nuxt/payload");
651
+ nitroConfig.devStorage["cache:nuxt:payload"] ||= {
652
+ driver: cacheDriverOption,
653
+ base: payloadCacheDir
654
+ };
655
+ }
645
656
  nuxt.options.typescript.hoist.push("nitro/types", "nitro/runtime", "nitropack/types", "nitropack/runtime", "nitropack", "defu", "h3", "consola", "ofetch", "crossws");
646
657
  await nuxt.callHook("nitro:config", nitroConfig);
647
658
  if (nitroConfig.static && nuxt.options.dev) {
@@ -694,13 +705,12 @@ async function bundle(nuxt) {
694
705
  if (resolve(nuxt.options.srcDir, relativePath) === spaLoadingTemplateFilePath) await nitro.hooks.callHook("rollup:reload");
695
706
  });
696
707
  const cacheDir = resolve(nuxt.options.buildDir, "cache/nitro/prerender");
697
- const cacheDriverPath = join(distDir, "runtime/utils/cache-driver.js");
698
708
  await promises.rm(cacheDir, {
699
709
  recursive: true,
700
710
  force: true
701
711
  }).catch(() => {});
702
712
  nitro.options._config.storage = defu(nitro.options._config.storage, { "internal:nuxt:prerender": {
703
- driver: isWindows ? pathToFileURL(cacheDriverPath).href : cacheDriverPath,
713
+ driver: cacheDriverOption,
704
714
  base: cacheDir
705
715
  } });
706
716
  nuxt._nitro = nitro;
@@ -7,7 +7,11 @@ import { NUXT_NO_SSR } from "#internal/nuxt/nitro-config.mjs";
7
7
  // @ts-expect-error virtual file
8
8
  import { appRootAttrs, appRootTag, appSpaLoaderAttrs, appSpaLoaderTag, spaLoadingTemplateOutside } from "#internal/nuxt.config.mjs";
9
9
  // @ts-expect-error virtual file
10
- import { buildAssetsURL } from "#internal/nuxt/paths";
10
+ import { buildAssetsURL, publicAssetsURL } from "#internal/nuxt/paths";
11
+ // @ts-expect-error private property consumed by vite-generated url helpers
12
+ globalThis.__buildAssetsURL = buildAssetsURL;
13
+ // @ts-expect-error private property consumed by vite-generated url helpers
14
+ globalThis.__publicAssetsURL = publicAssetsURL;
11
15
  const APP_ROOT_OPEN_TAG = `<${appRootTag}${propsToString(appRootAttrs)}>`;
12
16
  const APP_ROOT_CLOSE_TAG = `</${appRootTag}>`;
13
17
  // @ts-expect-error file will be produced after app build
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/nitro-server-nightly",
3
- "version": "4.4.3-29561554.e9b2fa64",
3
+ "version": "4.4.3-29571486.e4b31efa",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -28,7 +28,7 @@
28
28
  "dependencies": {
29
29
  "@babel/plugin-syntax-typescript": "^7.28.6",
30
30
  "@nuxt/devalue": "^2.0.2",
31
- "@nuxt/kit": "npm:@nuxt/kit-nightly@4.4.3-29561554.e9b2fa64",
31
+ "@nuxt/kit": "npm:@nuxt/kit-nightly@4.4.3-29571486.e4b31efa",
32
32
  "@unhead/vue": "^2.1.12",
33
33
  "@vue/shared": "^3.5.30",
34
34
  "consola": "^3.4.2",
@@ -46,7 +46,6 @@
46
46
  "nypm": "^0.6.5",
47
47
  "ohash": "^2.0.11",
48
48
  "pathe": "^2.0.3",
49
- "pkg-types": "^2.3.0",
50
49
  "rou3": "^0.8.1",
51
50
  "std-env": "^4.0.0",
52
51
  "ufo": "^1.6.3",
@@ -59,7 +58,7 @@
59
58
  "peerDependencies": {
60
59
  "@babel/plugin-proposal-decorators": "^7.25.0",
61
60
  "@rollup/plugin-babel": "^6.0.0 || ^7.0.0",
62
- "nuxt": "npm:nuxt-nightly@4.4.3-29561554.e9b2fa64"
61
+ "nuxt": "npm:nuxt-nightly@4.4.3-29571486.e4b31efa"
63
62
  },
64
63
  "peerDependenciesMeta": {
65
64
  "@babel/plugin-proposal-decorators": {
@@ -71,9 +70,9 @@
71
70
  },
72
71
  "devDependencies": {
73
72
  "@babel/plugin-proposal-decorators": "7.29.0",
74
- "@nuxt/schema": "npm:@nuxt/schema-nightly@4.4.3-29561554.e9b2fa64",
73
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@4.4.3-29571486.e4b31efa",
75
74
  "@rollup/plugin-babel": "7.0.0",
76
- "nuxt": "npm:nuxt-nightly@4.4.3-29561554.e9b2fa64",
75
+ "nuxt": "npm:nuxt-nightly@4.4.3-29571486.e4b31efa",
77
76
  "obuild": "0.4.32",
78
77
  "vitest": "4.0.18"
79
78
  },