@nuxt/kit 3.14.0 → 3.14.159

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 +10 -9
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -8,10 +8,10 @@ import { getContext } from 'unctx';
8
8
  import satisfies from 'semver/functions/satisfies.js';
9
9
  import { readPackageJSON, resolvePackageJSON } from 'pkg-types';
10
10
  import { genSafeVariableName, genDynamicImport, genImport } from 'knitwork';
11
- import { createJiti } from 'jiti';
12
11
  import { fileURLToPath, pathToFileURL } from 'node:url';
12
+ import { createJiti } from 'jiti';
13
+ import { resolvePath as resolvePath$1, resolve as resolve$1, resolvePathSync, interopDefault } from 'mlly';
13
14
  import { globby } from 'globby';
14
- import { resolvePath as resolvePath$1, resolvePathSync, interopDefault } from 'mlly';
15
15
  import { resolveAlias as resolveAlias$1 } from 'pathe/utils';
16
16
  import ignore from 'ignore';
17
17
  import { loadConfig } from 'c12';
@@ -2431,19 +2431,20 @@ async function loadNuxtModuleInstance(nuxtModule, nuxt = useNuxt()) {
2431
2431
  const jiti = createJiti(nuxt.options.rootDir, { alias: nuxt.options.alias });
2432
2432
  if (typeof nuxtModule === "string") {
2433
2433
  const paths = [join(nuxtModule, "nuxt"), join(nuxtModule, "module"), nuxtModule, join(nuxt.options.rootDir, nuxtModule)];
2434
- for (const parentURL of nuxt.options.modulesDir) {
2435
- for (const path of paths) {
2434
+ for (const path of paths) {
2435
+ for (const parentURL of nuxt.options.modulesDir) {
2436
2436
  try {
2437
- const src = jiti.esmResolve(path, { parentURL: parentURL.replace(/\/node_modules\/?$/, "") });
2437
+ const resolved = resolveAlias(path, nuxt.options.alias);
2438
+ const src = isAbsolute(resolved) ? pathToFileURL(await resolvePath(resolved, { cwd: parentURL, fallbackToOriginal: false, extensions: nuxt.options.extensions })).href : await resolve$1(resolved, { url: pathToFileURL(parentURL.replace(/\/node_modules\/?$/, "")), extensions: nuxt.options.extensions });
2438
2439
  nuxtModule = await jiti.import(src, { default: true });
2439
- const moduleMetadataPath = join(dirname(src), "module.json");
2440
+ const moduleMetadataPath = new URL("module.json", src);
2440
2441
  if (existsSync(moduleMetadataPath)) {
2441
2442
  buildTimeModuleMeta = JSON.parse(await promises.readFile(moduleMetadataPath, "utf-8"));
2442
2443
  }
2443
2444
  break;
2444
2445
  } catch (error) {
2445
2446
  const code = error.code;
2446
- if (code === "MODULE_NOT_FOUND" || code === "ERR_PACKAGE_PATH_NOT_EXPORTED" || code === "ERR_MODULE_NOT_FOUND" || code === "ERR_UNSUPPORTED_DIR_IMPORT") {
2447
+ if (code === "MODULE_NOT_FOUND" || code === "ERR_PACKAGE_PATH_NOT_EXPORTED" || code === "ERR_MODULE_NOT_FOUND" || code === "ERR_UNSUPPORTED_DIR_IMPORT" || code === "ENOTDIR") {
2447
2448
  continue;
2448
2449
  }
2449
2450
  logger.error(`Error while importing module \`${nuxtModule}\`: ${error}`);
@@ -2497,8 +2498,8 @@ async function getNuxtModuleVersion(module, nuxt = useNuxt()) {
2497
2498
  }
2498
2499
  }
2499
2500
  if (hasNuxtModule(moduleMeta.name)) {
2500
- const { buildTimeModuleMeta } = await loadNuxtModuleInstance(moduleMeta.name, nuxt);
2501
- return buildTimeModuleMeta.version || false;
2501
+ const { nuxtModule, buildTimeModuleMeta } = await loadNuxtModuleInstance(moduleMeta.name, nuxt);
2502
+ return buildTimeModuleMeta.version || await nuxtModule.getMeta?.().then((r) => r.version) || false;
2502
2503
  }
2503
2504
  return false;
2504
2505
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/kit",
3
- "version": "3.14.0",
3
+ "version": "3.14.159",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -42,7 +42,7 @@
42
42
  "unctx": "^2.3.1",
43
43
  "unimport": "^3.13.1",
44
44
  "untyped": "^1.5.1",
45
- "@nuxt/schema": "3.14.0"
45
+ "@nuxt/schema": "3.14.159"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@rspack/core": "1.0.14",
@@ -50,7 +50,7 @@
50
50
  "@types/lodash-es": "4.17.12",
51
51
  "@types/semver": "7.5.8",
52
52
  "lodash-es": "4.17.21",
53
- "nitropack": "2.10.2",
53
+ "nitropack": "2.10.3",
54
54
  "unbuild": "latest",
55
55
  "vite": "5.4.10",
56
56
  "vitest": "2.1.4",