@nuxt/kit 4.1.0 → 4.1.2

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.
Files changed (2) hide show
  1. package/dist/index.mjs +7 -3
  2. package/package.json +7 -7
package/dist/index.mjs CHANGED
@@ -167,7 +167,7 @@ function _defineNuxtModule(definition) {
167
167
  }
168
168
  async function normalizedModule(inlineOptions, nuxt = tryUseNuxt()) {
169
169
  if (!nuxt) {
170
- throw new TypeError("Cannot use module outside of Nuxt context");
170
+ throw new TypeError(`Cannot use ${module.meta.name || "module"} outside of Nuxt context`);
171
171
  }
172
172
  const uniqueKey = module.meta.name || module.meta.configKey;
173
173
  if (uniqueKey) {
@@ -594,6 +594,7 @@ async function installModules(modulesToInstall, resolvedModulePaths, nuxt = useN
594
594
  if (value.optional === true) {
595
595
  continue;
596
596
  }
597
+ nuxt.options.typescript.hoist.push(name);
597
598
  if (resolvedModule && !modulesToInstall.has(resolvedModule.module) && (!resolvedModule.resolvedPath || !resolvedModulePaths.has(resolvedModule.resolvedPath))) {
598
599
  if (typeof resolvedModule.module === "string" && inlineConfigKeys.has(resolvedModule.module)) {
599
600
  continue;
@@ -935,7 +936,10 @@ async function loadNuxt(opts) {
935
936
  opts.cwd = resolve(opts.cwd || opts.rootDir || ".");
936
937
  opts.overrides ||= opts.config || {};
937
938
  opts.overrides.dev = !!opts.dev;
938
- const resolvedPath = ["nuxt-nightly", "nuxt"].map((pkg) => resolveModulePath(pkg, { try: true, from: [directoryToURL(opts.cwd)] })).filter((p) => !!p).sort((a, b) => b.length - a.length)[0];
939
+ const resolvedPath = ["nuxt-nightly", "nuxt"].reduce((resolvedPath2, pkg) => {
940
+ const path = resolveModulePath(pkg, { try: true, from: [directoryToURL(opts.cwd)] });
941
+ return path && path.length > resolvedPath2.length ? path : resolvedPath2;
942
+ }, "");
939
943
  if (!resolvedPath) {
940
944
  throw new Error(`Cannot find any nuxt version from ${opts.cwd}`);
941
945
  }
@@ -1245,7 +1249,7 @@ function normalizeComponent(opts) {
1245
1249
  function addTemplate(_template) {
1246
1250
  const nuxt = useNuxt();
1247
1251
  const template = normalizeTemplate(_template);
1248
- filterInPlace(nuxt.options.build.templates, (p) => normalizeTemplate(p).dst !== template.dst);
1252
+ filterInPlace(nuxt.options.build.templates, (p) => (p.dst || normalizeTemplate(p).dst) !== template.dst);
1249
1253
  try {
1250
1254
  const distDir = distDirURL.toString();
1251
1255
  const { source } = captureStackTrace().find((e) => e.source && !e.source.startsWith(distDir)) ?? {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/kit",
3
- "version": "4.1.0",
3
+ "version": "4.1.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -40,22 +40,22 @@
40
40
  "scule": "^1.3.0",
41
41
  "semver": "^7.7.2",
42
42
  "std-env": "^3.9.0",
43
- "tinyglobby": "^0.2.14",
43
+ "tinyglobby": "^0.2.15",
44
44
  "ufo": "^1.6.1",
45
45
  "unctx": "^2.4.1",
46
46
  "unimport": "^5.2.0",
47
47
  "untyped": "^2.0.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@rspack/core": "1.5.2",
51
- "@types/semver": "7.7.0",
50
+ "@rspack/core": "1.5.3",
51
+ "@types/semver": "7.7.1",
52
52
  "hookable": "5.5.3",
53
- "nitropack": "2.12.4",
53
+ "nitropack": "2.12.5",
54
54
  "unbuild": "3.6.1",
55
- "vite": "7.1.4",
55
+ "vite": "7.1.5",
56
56
  "vitest": "3.2.4",
57
57
  "webpack": "5.101.3",
58
- "@nuxt/schema": "4.1.0"
58
+ "@nuxt/schema": "4.1.2"
59
59
  },
60
60
  "engines": {
61
61
  "node": ">=18.12.0"