@nuxt/kit-nightly 4.6.0-29833429.e2a0e5da → 4.6.0-29836601.d5e5f1bd

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
@@ -1,9 +1,9 @@
1
- import { $ as resolveFiles, B as isNuxt3, C as getMissingCjsGlobal, D as ensureDependencyInstalled, E as shouldReportJitiFallbackOnce, Et as DEFAULT_JS_FILE_EXTENSIONS$1, F as checkNuxtCompatibility, G as requireModule, H as normalizeSemanticVersion, I as getNitroVersion, J as tryRequireModule, K as resolveModule, L as getNuxtVersion, M as logger, N as useLogger, O as getAddDependencyCommand, P as assertNuxtCompatibility, Q as resolveAlias, R as hasNuxtCompatibility, S as resolveModuleWithOptions, St as kitDiagnostics, T as loadJiti, Tt as DEFAULT_JSX_FILE_EXTENSIONS$1, U as directoryToURL, V as isNuxtMajorVersion, W as importModule, X as createResolver, Y as tryResolveModule, Z as findPath, _ as getDirectory, _t as getNuxtCtx, a as addDevServerHandler, at as toArray, b as loadNuxtModuleInstance, bt as tryUseNuxt, c as addServerHandler, ct as resolveIgnorePatterns, d as addServerPlugin, dt as getUserCaller, et as resolveNuxtModule, f as addServerScanDir, ft as warn, g as useNitro, gt as resolvePackageDir, h as tryUseNitro, ht as readPackageJSON, i as componentDiagnostics, it as filterInPlace, j as useTerminal, k as configDiagnostics, l as addServerImports, lt as getLayerDirectories, n as pageDiagnostics, nt as MODE_RE, o as addNitroPlugin, ot as createIsIgnored, pt as interopDefault, q as tryImportModule, r as resolveModuleExportNames, rt as distDirURL, s as addPrerenderRoutes, st as isIgnored, t as pluginDiagnostics, tt as resolvePath, u as addServerImportsDir, v as installModule, vt as nuxtCtx, w as isLoaderError, x as normalizeModuleTranspilePath, xt as useNuxt, yt as runWithNuxtContext, z as isNuxt2 } from "./plugins-CAFsgktK.mjs";
1
+ import { $ as resolveFiles, B as isNuxt3, C as getMissingCjsGlobal, D as ensureDependencyInstalled, E as shouldReportJitiFallbackOnce, Et as DEFAULT_JS_FILE_EXTENSIONS$1, F as checkNuxtCompatibility, G as requireModule, H as normalizeSemanticVersion, I as getNitroVersion, J as tryRequireModule, K as resolveModule, L as getNuxtVersion, M as logger, N as useLogger, O as getAddDependencyCommand, P as assertNuxtCompatibility, Q as resolveAlias, R as hasNuxtCompatibility, S as resolveModuleWithOptions, St as kitDiagnostics, T as loadJiti, Tt as DEFAULT_JSX_FILE_EXTENSIONS$1, U as directoryToURL, V as isNuxtMajorVersion, W as importModule, X as createResolver, Y as tryResolveModule, Z as findPath, _ as getDirectory, _t as getNuxtCtx, a as addDevServerHandler, at as toArray, b as loadNuxtModuleInstance, bt as tryUseNuxt, c as addServerHandler, ct as resolveIgnorePatterns, d as addServerPlugin, dt as getUserCaller, et as resolveNuxtModule, f as addServerScanDir, ft as warn, g as useNitro, gt as resolvePackageDir, h as tryUseNitro, ht as readPackageJSON, i as componentDiagnostics, it as filterInPlace, j as useTerminal, k as configDiagnostics, l as addServerImports, lt as getLayerDirectories, n as pageDiagnostics, nt as MODE_RE, o as addNitroPlugin, ot as createIsIgnored, pt as interopDefault, q as tryImportModule, r as resolveModuleExportNames, rt as distDirURL, s as addPrerenderRoutes, st as isIgnored, t as pluginDiagnostics, tt as resolvePath, u as addServerImportsDir, v as installModule, vt as nuxtCtx, w as isLoaderError, x as normalizeModuleTranspilePath, xt as useNuxt, yt as runWithNuxtContext, z as isNuxt2 } from "./plugins-BJQYECjw.mjs";
2
2
  import { createDefu, defu } from "defu";
3
3
  import { kebabCase, pascalCase, snakeCase } from "scule";
4
4
  import process$1 from "node:process";
5
5
  import { existsSync, promises, readFileSync, realpathSync, statSync } from "node:fs";
6
- import { isGreaterOrEqual, satisfies } from "verkit";
6
+ import { isGreaterThanOrEqual, satisfies } from "verkit";
7
7
  import { readFile, rm, stat } from "node:fs/promises";
8
8
  import { fileURLToPath, pathToFileURL } from "node:url";
9
9
  import { basename, dirname, extname, isAbsolute, join, normalize, parse, relative, resolve } from "pathe";
@@ -393,7 +393,7 @@ async function loadConfig(options) {
393
393
  dir: options.cwd
394
394
  }));
395
395
  if (options.globalRc) {
396
- const { findWorkspaceDir } = await import("./plugins-CAFsgktK.mjs").then((n) => n.mt);
396
+ const { findWorkspaceDir } = await import("./plugins-BJQYECjw.mjs").then((n) => n.mt);
397
397
  const workspaceDir = await findWorkspaceDir(options.cwd).catch(() => {});
398
398
  if (workspaceDir) rcSources.push(rc9.read({
399
399
  name: options.rcFile,
@@ -409,7 +409,7 @@ async function loadConfig(options) {
409
409
  }
410
410
  if (options.packageJson) {
411
411
  const keys = (Array.isArray(options.packageJson) ? options.packageJson : [typeof options.packageJson === "string" ? options.packageJson : options.name]).filter((t) => t && typeof t === "string");
412
- const { readPackageJSON } = await import("./plugins-CAFsgktK.mjs").then((n) => n.mt);
412
+ const { readPackageJSON } = await import("./plugins-BJQYECjw.mjs").then((n) => n.mt);
413
413
  const pkgJsonFile = await readPackageJSON(options.cwd).catch(() => {});
414
414
  rawConfigs.packageJson = _merger({}, ...keys.map((key) => pkgJsonFile?.[key]));
415
415
  }
@@ -1726,7 +1726,7 @@ async function _generateTypes(nuxt) {
1726
1726
  if (nestedModulesDirs.every((d) => !d.startsWith(withSlash))) nestedModulesDirs.push(withSlash);
1727
1727
  }
1728
1728
  let hasTypescriptVersionWithModulePreserve;
1729
- for (const parent of nestedModulesDirs) hasTypescriptVersionWithModulePreserve ??= await readPackageJSON("typescript", { parent }).then((r) => r?.version && isGreaterOrEqual(r.version, "5.4.0")).catch(() => void 0);
1729
+ for (const parent of nestedModulesDirs) hasTypescriptVersionWithModulePreserve ??= await readPackageJSON("typescript", { parent }).then((r) => r?.version && isGreaterThanOrEqual(r.version, "5.4.0")).catch(() => void 0);
1730
1730
  hasTypescriptVersionWithModulePreserve ??= true;
1731
1731
  const useDecorators = Boolean(nuxt.options.experimental?.decorators);
1732
1732
  const isV5OrHigher = (nuxt.options.future?.compatibilityVersion ?? 4) >= 5;
@@ -714,6 +714,11 @@ export declare const configDiagnostics: import("nostics").Diagnostics<{
714
714
  readonly fix: "Ensure the file exists, or remove the entry from `css` in your `nuxt.config`.";
715
715
  readonly docs: false;
716
716
  };
717
+ readonly NUXT_B5028: {
718
+ readonly why: "A generated development secret is being used because `runtimeConfig.appSecret` is unset.";
719
+ readonly fix: "Set `NUXT_APP_SECRET` in your `.env` to the output of `openssl rand -base64 32`. Builds do not generate a secret.";
720
+ readonly docs: false;
721
+ };
717
722
  }, readonly [import("nostics").DiagnosticReporter<{
718
723
  method?: import("nostics").ConsoleMethod;
719
724
  }>]>;
@@ -1076,7 +1081,7 @@ export declare function createServerBuild(options: NuxtOptions): NuxtServerBuild
1076
1081
  //#endregion
1077
1082
  //#region src/internal/renderer.d.ts
1078
1083
  /** Names of the constants `nuxt/internal/renderer-config` inlines, which documents what each one means. */
1079
- type RendererConfigName = 'NUXT_NO_SSR' | 'NUXT_PRERENDER_ERROR_PAGES' | 'NUXT_PRERENDER_NO_SSR_ROUTES' | 'NUXT_EARLY_HINTS' | 'NUXT_NO_SCRIPTS' | 'NUXT_NO_SCRIPTS_PROD' | 'NUXT_INLINE_STYLES' | 'NUXT_VIEW_TRANSITIONS' | 'NUXT_NO_SCRIPTS_PATTERNS' | 'NUXT_PAGE_PATTERNS' | 'NUXT_EARLY_404' | 'NUXT_PAGE_MATCHER' | 'PARSE_ERROR_DATA' | 'NUXT_JSON_PAYLOADS' | 'NUXT_PAYLOAD_EXTRACTION' | 'NUXT_PAYLOAD_INLINE' | 'NUXT_RUNTIME_PAYLOAD_EXTRACTION' | 'NUXT_SSR_STREAMING' | 'NUXT_SSR_STREAMING_BOT_RE' | 'appHead' | 'appRootTag' | 'appRootAttrs' | 'appTeleportTag' | 'appTeleportAttrs' | 'appSpaLoaderTag' | 'appSpaLoaderAttrs' | 'spaLoadingTemplateOutside' | 'spaTemplate' | 'appId' | 'multiApp' | 'componentIslands' | 'componentIslandsActive' | 'tracingChannelNuxt';
1084
+ type RendererConfigName = 'NUXT_NO_SSR' | 'NUXT_PRERENDER_ERROR_PAGES' | 'NUXT_PRERENDER_NO_SSR_ROUTES' | 'NUXT_EARLY_HINTS' | 'NUXT_NO_SCRIPTS' | 'NUXT_HAS_NO_SCRIPTS_ROUTES' | 'NUXT_NO_SCRIPTS_PROD' | 'NUXT_INLINE_STYLES' | 'NUXT_VIEW_TRANSITIONS' | 'NUXT_NO_SCRIPTS_PATTERNS' | 'NUXT_PAGE_PATTERNS' | 'NUXT_EARLY_404' | 'NUXT_PAGE_MATCHER' | 'PARSE_ERROR_DATA' | 'NUXT_JSON_PAYLOADS' | 'NUXT_PAYLOAD_EXTRACTION' | 'NUXT_PAYLOAD_INLINE' | 'NUXT_RUNTIME_PAYLOAD_EXTRACTION' | 'NUXT_SSR_STREAMING' | 'NUXT_SSR_STREAMING_BOT_RE' | 'appHead' | 'appRootTag' | 'appRootAttrs' | 'appTeleportTag' | 'appTeleportAttrs' | 'appSpaLoaderTag' | 'appSpaLoaderAttrs' | 'spaLoadingTemplateOutside' | 'spaTemplate' | 'appId' | 'multiApp' | 'componentIslands' | 'componentIslandsActive' | 'tracingChannelNuxt';
1080
1085
  interface RendererConfigOptions {
1081
1086
  /** JS expressions replacing individual constants, for values a builder resolves itself. */
1082
1087
  overrides?: Partial<Record<RendererConfigName, string>>;
@@ -1,4 +1,4 @@
1
- import { A as buildDiagnostics, Ct as docsBase, Et as DEFAULT_JS_FILE_EXTENSIONS, T as loadJiti, Tt as DEFAULT_JSX_FILE_EXTENSIONS, U as directoryToURL, i as componentDiagnostics, k as configDiagnostics, m as kUnusedVariants, n as pageDiagnostics, p as kServerApi, r as resolveModuleExportNames, t as pluginDiagnostics, ut as parseNodeModulePath, wt as reporters, xt as useNuxt, y as installModules } from "../plugins-CAFsgktK.mjs";
1
+ import { A as buildDiagnostics, Ct as docsBase, Et as DEFAULT_JS_FILE_EXTENSIONS, T as loadJiti, Tt as DEFAULT_JSX_FILE_EXTENSIONS, U as directoryToURL, i as componentDiagnostics, k as configDiagnostics, m as kUnusedVariants, n as pageDiagnostics, p as kServerApi, r as resolveModuleExportNames, t as pluginDiagnostics, ut as parseNodeModulePath, wt as reporters, xt as useNuxt, y as installModules } from "../plugins-BJQYECjw.mjs";
2
2
  import { defineDiagnostics } from "nostics";
3
3
  import process from "node:process";
4
4
  import { join, resolve } from "pathe";
@@ -315,6 +315,7 @@ function getRendererConfig(options = {}, nuxt = useNuxt()) {
315
315
  NUXT_PRERENDER_NO_SSR_ROUTES: "[]",
316
316
  NUXT_EARLY_HINTS: String(nuxt.options.experimental.writeEarlyHints !== false),
317
317
  NUXT_NO_SCRIPTS: String(noScripts === "all" || !!noScripts && !nuxt.options.dev),
318
+ NUXT_HAS_NO_SCRIPTS_ROUTES: "false",
318
319
  NUXT_NO_SCRIPTS_PROD: String(noScripts === "production"),
319
320
  NUXT_INLINE_STYLES: String(!!nuxt.options.features.inlineStyles),
320
321
  NUXT_VIEW_TRANSITIONS: String(!!(app.viewTransition && typeof app.viewTransition === "object" && app.viewTransition.enabled)),
@@ -7,7 +7,7 @@ import process from "node:process";
7
7
  import { ansiFormatter } from "nostics/formatters/ansi";
8
8
  import { colors } from "consola/utils";
9
9
  import { existsSync, lstatSync, promises, readFileSync, realpathSync, statSync } from "node:fs";
10
- import { isGreater, satisfies } from "verkit";
10
+ import { isGreaterThan, satisfies } from "verkit";
11
11
  import { readFile } from "node:fs/promises";
12
12
  import { fileURLToPath, pathToFileURL } from "node:url";
13
13
  import { basename, dirname, isAbsolute, join, normalize, relative, resolve } from "pathe";
@@ -1229,6 +1229,11 @@ const configDiagnostics = /* #__PURE__ */ defineDiagnostics({
1229
1229
  why: (p) => `\`css\` entry \`${p.entry}\` could not be found${p.resolved ? ` (resolved to \`${p.resolved}\`)` : ""}.`,
1230
1230
  fix: "Ensure the file exists, or remove the entry from `css` in your `nuxt.config`.",
1231
1231
  docs: false
1232
+ },
1233
+ NUXT_B5028: {
1234
+ why: "A generated development secret is being used because `runtimeConfig.appSecret` is unset.",
1235
+ fix: "Set `NUXT_APP_SECRET` in your `.env` to the output of `openssl rand -base64 32`. Builds do not generate a secret.",
1236
+ docs: false
1232
1237
  }
1233
1238
  }
1234
1239
  });
@@ -1806,7 +1811,7 @@ async function callLifecycleHooks(nuxtModule, meta = {}, inlineOptions, nuxt = u
1806
1811
  })?.setups?.[meta.name];
1807
1812
  try {
1808
1813
  if (!previousVersion) await nuxtModule.onInstall?.(nuxt);
1809
- else if (isGreater(meta.version, previousVersion)) await nuxtModule.onUpgrade?.(nuxt, inlineOptions, previousVersion);
1814
+ else if (isGreaterThan(meta.version, previousVersion)) await nuxtModule.onUpgrade?.(nuxt, inlineOptions, previousVersion);
1810
1815
  if (previousVersion !== meta.version) update({ setups: { [meta.name]: meta?.version } }, {
1811
1816
  dir: nuxt.options.rootDir,
1812
1817
  name: ".nuxtrc"
@@ -1982,6 +1987,30 @@ function withVariantMeta(entry, resolved) {
1982
1987
  return entry;
1983
1988
  }
1984
1989
  const HANDLER_METHOD_RE = /\.(get|head|patch|post|put|delete|connect|options|trace|query)(\.\w+)*$/;
1990
+ const WILDCARD_SUFFIX_RE = /\/\*\*(?::\w+)?$/;
1991
+ /**
1992
+ * h3 v1 routes with radix3, where `/fonts/**` matches every path below `/fonts` but not
1993
+ * `/fonts` itself; h3 v2 routes with rou3, where it matches both. A second registration on
1994
+ * the base path gives one wildcard route the same reach on either, and rou3 prefers the
1995
+ * static route, so the pair is unambiguous where both are registered.
1996
+ *
1997
+ * A handler already registered on the base path for the same method keeps it: a
1998
+ * method-specific handler there does not answer the other methods the wildcard covers.
1999
+ *
2000
+ * Not applied to middleware, which nitro v2 mounts with `app.use()` and so already runs on
2001
+ * the base path, nor to `/**`, whose base would shadow the renderer on `/`.
2002
+ */
2003
+ function addLegacyBaseRoute(nuxt, entry, resolved) {
2004
+ const route = entry.route;
2005
+ if (!route || entry.middleware || getNitroVersion(nuxt) !== 2) return;
2006
+ const base = route.replace(WILDCARD_SUFFIX_RE, "");
2007
+ if (base === route || !base || base === "/") return;
2008
+ const method = entry.method?.toUpperCase();
2009
+ if (!nuxt.options.serverHandlers.some((handler) => handler.route === base && (!handler.method || handler.method.toUpperCase() === method))) nuxt.options.serverHandlers.push(withVariantMeta({
2010
+ ...entry,
2011
+ route: base
2012
+ }, resolved));
2013
+ }
1985
2014
  /**
1986
2015
  * Adds a server handler.
1987
2016
  *
@@ -2005,11 +2034,13 @@ function addServerHandler(handler) {
2005
2034
  const resolved = resolveVariant("addServerHandler", handler.handler, normalize, SERVER_APIS);
2006
2035
  if (!resolved) return;
2007
2036
  const [, method = void 0] = resolved.value.match(HANDLER_METHOD_RE) || [];
2008
- nuxt.options.serverHandlers.push(withVariantMeta({
2037
+ const entry = {
2009
2038
  method: method?.toUpperCase(),
2010
2039
  ...handler,
2011
2040
  handler: resolved.value
2012
- }, resolved));
2041
+ };
2042
+ nuxt.options.serverHandlers.push(withVariantMeta(entry, resolved));
2043
+ addLegacyBaseRoute(nuxt, entry, resolved);
2013
2044
  }
2014
2045
  /**
2015
2046
  * Adds a server handler for development only.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/kit-nightly",
3
- "version": "4.6.0-29833429.e2a0e5da",
3
+ "version": "4.6.0-29836601.d5e5f1bd",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -30,7 +30,7 @@
30
30
  "consola": "^3.4.2",
31
31
  "defu": "^6.1.7",
32
32
  "destr": "^2.0.5",
33
- "errx": "^0.2.0",
33
+ "errx": "^0.2.2",
34
34
  "exsolve": "^1.1.1",
35
35
  "ignore": "^7.0.9",
36
36
  "klona": "^2.0.6",
@@ -43,10 +43,10 @@
43
43
  "std-env": "^4.2.0",
44
44
  "tinyglobby": "^0.2.17",
45
45
  "unctx": "^3.0.1",
46
- "verkit": "^0.4.0"
46
+ "verkit": "^0.5.0"
47
47
  },
48
48
  "peerDependencies": {
49
- "@nuxt/schema": "npm:@nuxt/schema-nightly@4.6.0-29833429.e2a0e5da",
49
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@4.6.0-29836601.d5e5f1bd",
50
50
  "confbox": "^0.3.1",
51
51
  "dotenv": "^18.0.1",
52
52
  "giget": "^3.3.1",
@@ -82,13 +82,13 @@
82
82
  }
83
83
  },
84
84
  "devDependencies": {
85
- "@nuxt/schema": "npm:@nuxt/schema-nightly@4.6.0-29833429.e2a0e5da",
85
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@4.6.0-29836601.d5e5f1bd",
86
86
  "c12": "4.0.0-rc.1",
87
87
  "chokidar": "^5.0.0",
88
88
  "confbox": "^0.3.1",
89
89
  "dotenv": "^18.0.1",
90
90
  "giget": "^3.3.1",
91
- "hookable": "^6.1.1",
91
+ "hookable": "^6.1.2",
92
92
  "jiti": "^2.7.0",
93
93
  "mlly": "^1.8.2",
94
94
  "oxc-parser": "^0.150.0",