@nuxt/kit 3.21.0 → 3.21.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
@@ -111,7 +111,7 @@ Follow the docs to [Set Up Your Local Development Environment](https://nuxt.com/
111
111
  ## <a name="follow-us">🔗 Follow Us</a>
112
112
 
113
113
  <p valign="center">
114
- <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>
114
+ <a href="https://go.nuxt.com/discord"><img width="20" 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="20" 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="20" 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="20" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/bluesky.svg" alt="Bluesky"></a>
115
115
  </p>
116
116
 
117
117
  ## <a name="license">⚖️ License</a>
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { ModuleOptions, ModuleDefinition, NuxtModule, NuxtConfig, Nuxt, ModuleMeta, NuxtOptions, SchemaDefinition, NuxtAppConfig, NuxtCompatibility, NuxtCompatibilityIssues, Component, ComponentsDir, NuxtTemplate, NuxtMiddleware, NuxtHooks, NuxtPlugin, NuxtPluginTemplate, ResolvedNuxtTemplate, NuxtServerTemplate, NuxtTypeTemplate } from '@nuxt/schema';
1
+ import { ModuleOptions, ModuleDefinition, NuxtModule, NuxtConfig, Nuxt, ModuleMeta, NuxtOptions, SchemaDefinition, NuxtAppConfig, NuxtCompatibility, NuxtCompatibilityIssues, Component, ComponentsDir, NuxtTemplate, NuxtMiddleware, NuxtHooks, NuxtPlugin, NuxtPluginTemplate, NuxtServerTemplate, ResolvedNuxtTemplate, NuxtTypeTemplate } from '@nuxt/schema';
2
2
  import { LoadConfigOptions } from 'c12';
3
3
  import { Import, InlinePreset } from 'unimport';
4
4
  import { WebpackPluginInstance, Configuration } from 'webpack';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ModuleOptions, ModuleDefinition, NuxtModule, NuxtConfig, Nuxt, ModuleMeta, NuxtOptions, SchemaDefinition, NuxtAppConfig, NuxtCompatibility, NuxtCompatibilityIssues, Component, ComponentsDir, NuxtTemplate, NuxtMiddleware, NuxtHooks, NuxtPlugin, NuxtPluginTemplate, ResolvedNuxtTemplate, NuxtServerTemplate, NuxtTypeTemplate } from '@nuxt/schema';
1
+ import { ModuleOptions, ModuleDefinition, NuxtModule, NuxtConfig, Nuxt, ModuleMeta, NuxtOptions, SchemaDefinition, NuxtAppConfig, NuxtCompatibility, NuxtCompatibilityIssues, Component, ComponentsDir, NuxtTemplate, NuxtMiddleware, NuxtHooks, NuxtPlugin, NuxtPluginTemplate, NuxtServerTemplate, ResolvedNuxtTemplate, NuxtTypeTemplate } from '@nuxt/schema';
2
2
  import { LoadConfigOptions } from 'c12';
3
3
  import { Import, InlinePreset } from 'unimport';
4
4
  import { WebpackPluginInstance, Configuration } from 'webpack';
package/dist/index.mjs CHANGED
@@ -2576,8 +2576,23 @@ async function installModules(modulesToInstall, resolvedModulePaths, nuxt = useN
2576
2576
  }
2577
2577
  nuxt._moduleOptionsFunctions ||= /* @__PURE__ */ new Map();
2578
2578
  const resolvedModules = [];
2579
+ const modulesByMetaName = /* @__PURE__ */ new Map();
2579
2580
  const inlineConfigKeys = new Set(
2580
- await Promise.all([...modulesToInstall].map(([mod]) => typeof mod !== "string" && Promise.resolve(mod.getMeta?.())?.then((r) => r?.configKey)))
2581
+ await Promise.all([...modulesToInstall].map(async ([mod]) => {
2582
+ if (typeof mod === "string") {
2583
+ return;
2584
+ }
2585
+ const meta = await Promise.resolve(mod.getMeta?.());
2586
+ if (meta?.name) {
2587
+ modulesByMetaName.set(meta.name, mod);
2588
+ }
2589
+ if (meta?.configKey) {
2590
+ if (meta.configKey !== meta.name) {
2591
+ modulesByMetaName.set(meta.configKey, mod);
2592
+ }
2593
+ return meta.configKey;
2594
+ }
2595
+ }))
2581
2596
  );
2582
2597
  let error;
2583
2598
  const dependencyMap = /* @__PURE__ */ new Map();
@@ -2593,7 +2608,7 @@ async function installModules(modulesToInstall, resolvedModulePaths, nuxt = useN
2593
2608
  if (!value.overrides && !value.defaults && !value.version && value.optional) {
2594
2609
  continue;
2595
2610
  }
2596
- const resolvedModule = resolveModuleWithOptions(name, nuxt);
2611
+ const resolvedModule = modulesByMetaName.has(name) ? resolveModuleWithOptions(modulesByMetaName.get(name), nuxt) : resolveModuleWithOptions(name, nuxt);
2597
2612
  const moduleToAttribute = typeof key === "string" ? `\`${key}\`` : "a module in `nuxt.options`";
2598
2613
  if (!resolvedModule?.module) {
2599
2614
  const message = `Could not resolve \`${name}\` (specified as a dependency of ${moduleToAttribute}).`;
@@ -2603,7 +2618,7 @@ async function installModules(modulesToInstall, resolvedModulePaths, nuxt = useN
2603
2618
  if (value.version) {
2604
2619
  const resolvePaths = [res.resolvedModulePath, ...nuxt.options.modulesDir].filter(Boolean);
2605
2620
  const pkg = await readPackageJSON(name, { from: resolvePaths }).catch(() => null);
2606
- if (pkg?.version && !semver.satisfies(pkg.version, value.version)) {
2621
+ if (pkg?.version && !semver.satisfies(pkg.version, value.version, { includePrerelease: true })) {
2607
2622
  const message = `Module \`${name}\` version (\`${pkg.version}\`) does not satisfy \`${value.version}\` (requested by ${moduleToAttribute}).`;
2608
2623
  error = new TypeError(message);
2609
2624
  }
@@ -3676,12 +3691,7 @@ async function _generateTypes(nuxt) {
3676
3691
  tsConfig.include = [...new Set(tsConfig.include.map((p) => isAbsolute(p) ? relativeWithDot(nuxt.options.buildDir, p) : p))];
3677
3692
  tsConfig.exclude = [...new Set(tsConfig.exclude.map((p) => isAbsolute(p) ? relativeWithDot(nuxt.options.buildDir, p) : p))];
3678
3693
  const declaration = [
3679
- ...references.map((ref) => {
3680
- if ("path" in ref && isAbsolute(ref.path)) {
3681
- ref.path = relative(nuxt.options.buildDir, ref.path);
3682
- }
3683
- return `/// <reference ${renderAttrs(ref)} />`;
3684
- }),
3694
+ ...references.map((ref) => renderReference(ref, nuxt.options.buildDir)),
3685
3695
  ...declarations,
3686
3696
  "",
3687
3697
  "export {}",
@@ -3713,15 +3723,9 @@ function sortTsPaths(paths) {
3713
3723
  }
3714
3724
  }
3715
3725
  }
3716
- function renderAttrs(obj) {
3717
- const attrs = [];
3718
- for (const key in obj) {
3719
- attrs.push(renderAttr(key, obj[key]));
3720
- }
3721
- return attrs.join(" ");
3722
- }
3723
- function renderAttr(key, value) {
3724
- return value ? `${key}="${value}"` : "";
3726
+ function renderReference(ref, baseDir) {
3727
+ const stuff = "path" in ref ? `path="${isAbsolute(ref.path) ? relative(baseDir, ref.path) : ref.path}"` : `types="${ref.types}"`;
3728
+ return `/// <reference ${stuff} />`;
3725
3729
  }
3726
3730
  const RELATIVE_WITH_DOT_RE = /^([^.])/;
3727
3731
  function relativeWithDot(from, to) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/kit",
3
- "version": "3.21.0",
3
+ "version": "3.21.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -37,28 +37,28 @@
37
37
  "ohash": "^2.0.11",
38
38
  "pathe": "^2.0.3",
39
39
  "pkg-types": "^2.3.0",
40
- "rc9": "^2.1.2",
40
+ "rc9": "^3.0.0",
41
41
  "scule": "^1.3.0",
42
- "semver": "^7.7.3",
42
+ "semver": "^7.7.4",
43
43
  "tinyglobby": "^0.2.15",
44
44
  "ufo": "^1.6.3",
45
45
  "unctx": "^2.5.0",
46
46
  "untyped": "^2.0.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@rspack/core": "1.7.2",
49
+ "@rspack/core": "1.7.5",
50
50
  "@types/lodash-es": "4.17.12",
51
51
  "@types/semver": "7.7.1",
52
52
  "hookable": "5.5.3",
53
- "lodash-es": "4.17.22",
54
- "nitro": "3.0.1-alpha.1",
53
+ "lodash-es": "4.17.23",
54
+ "nitro": "3.0.1-alpha.2",
55
55
  "nitropack": "2.13.1",
56
56
  "unbuild": "3.6.1",
57
57
  "unimport": "5.6.0",
58
58
  "vite": "7.3.1",
59
- "vitest": "3.2.4",
60
- "webpack": "5.104.1",
61
- "@nuxt/schema": "3.21.0"
59
+ "vitest": "4.0.18",
60
+ "webpack": "5.105.0",
61
+ "@nuxt/schema": "3.21.1"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=18.12.0"