@nuxt/kit 3.21.1 → 3.21.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.
- package/README.md +4 -4
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +17 -17
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
<a href="https://nuxt.com"><img width="830" height="213" src="https://github.com/nuxt/nuxt/blob/main/.github/assets/banner.svg" alt="Nuxt banner"></a>
|
|
2
2
|
|
|
3
3
|
# Nuxt
|
|
4
4
|
|
|
5
5
|
<p>
|
|
6
|
-
<a href="https://
|
|
7
|
-
<a href="https://
|
|
6
|
+
<a href="https://npmx.dev/package/nuxt"><img src="https://npmx.dev/api/registry/badge/version/nuxt" alt="Version"></a>
|
|
7
|
+
<a href="https://npmx.dev/package/nuxt"><img src="https://npmx.dev/api/registry/badge/downloads/nuxt" alt="Downloads"></a>
|
|
8
8
|
<a href="https://github.com/nuxt/nuxt/blob/main/LICENSE"><img src="https://img.shields.io/github/license/nuxt/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="License"></a>
|
|
9
9
|
<a href="https://nuxt.com/modules"><img src="https://img.shields.io/badge/dynamic/json?url=https://nuxt.com/api/v1/modules&query=$.stats.modules&label=Modules&style=flat&colorA=18181B&colorB=28CF8D" alt="Modules"></a>
|
|
10
10
|
<a href="https://nuxt.com"><img src="https://img.shields.io/badge/Nuxt%20Docs-18181B?logo=nuxt" alt="Website"></a>
|
|
11
11
|
<a href="https://chat.nuxt.dev"><img src="https://img.shields.io/badge/Nuxt%20Discord-18181B?logo=discord" alt="Discord"></a>
|
|
12
|
-
<a href="https://securityscorecards.dev/"><img src="https://api.securityscorecards.dev/projects/github.com/nuxt/nuxt/badge" alt="Nuxt openssf scorecard score"></a>
|
|
12
|
+
<a href="https://securityscorecards.dev/viewer/?uri=github.com/nuxt/nuxt"><img src="https://api.securityscorecards.dev/projects/github.com/nuxt/nuxt/badge" alt="Nuxt openssf scorecard score"></a>
|
|
13
13
|
<a href="https://deepwiki.com/nuxt/nuxt"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
|
|
14
14
|
</p>
|
|
15
15
|
|
package/dist/index.d.mts
CHANGED
|
@@ -489,7 +489,7 @@ declare function addServerImportsDir(dirs: string | string[], opts?: {
|
|
|
489
489
|
}): void;
|
|
490
490
|
/**
|
|
491
491
|
* Add directories to be scanned by Nitro. It will check for subdirectories,
|
|
492
|
-
* which will be registered just like the
|
|
492
|
+
* which will be registered just like the `~~/server` folder is.
|
|
493
493
|
*/
|
|
494
494
|
declare function addServerScanDir(dirs: string | string[], opts?: {
|
|
495
495
|
prepend?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -489,7 +489,7 @@ declare function addServerImportsDir(dirs: string | string[], opts?: {
|
|
|
489
489
|
}): void;
|
|
490
490
|
/**
|
|
491
491
|
* Add directories to be scanned by Nitro. It will check for subdirectories,
|
|
492
|
-
* which will be registered just like the
|
|
492
|
+
* which will be registered just like the `~~/server` folder is.
|
|
493
493
|
*/
|
|
494
494
|
declare function addServerScanDir(dirs: string | string[], opts?: {
|
|
495
495
|
prepend?: boolean;
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { applyDefaults } from 'untyped';
|
|
|
5
5
|
import { dirname, resolve, relative, join, normalize, isAbsolute, basename, parse } from 'pathe';
|
|
6
6
|
import { consola } from 'consola';
|
|
7
7
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
8
|
-
import { getContext
|
|
8
|
+
import { getContext } from 'unctx';
|
|
9
9
|
import satisfies from 'semver/functions/satisfies.js';
|
|
10
10
|
import { readPackageJSON, resolvePackageJSON } from 'pkg-types';
|
|
11
11
|
import { genSafeVariableName, genDynamicImport, genImport } from 'knitwork';
|
|
@@ -34,7 +34,7 @@ function useLogger(tag, options = {}) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
const nuxtCtx = getContext("nuxt");
|
|
37
|
-
const asyncNuxtStorage =
|
|
37
|
+
const asyncNuxtStorage = getContext("asyncNuxtStorage", {
|
|
38
38
|
asyncContext: true,
|
|
39
39
|
AsyncLocalStorage
|
|
40
40
|
});
|
|
@@ -2658,15 +2658,15 @@ async function installModules(modulesToInstall, resolvedModulePaths, nuxt = useN
|
|
|
2658
2658
|
if (error) {
|
|
2659
2659
|
throw error;
|
|
2660
2660
|
}
|
|
2661
|
-
for (const { nuxtModule, meta = {}, moduleToInstall, buildTimeModuleMeta, resolvedModulePath, inlineOptions
|
|
2661
|
+
for (const { nuxtModule, meta = {}, moduleToInstall, buildTimeModuleMeta, resolvedModulePath, inlineOptions } of resolvedModules) {
|
|
2662
2662
|
const configKey = meta.configKey;
|
|
2663
|
-
const optionsFns = [
|
|
2663
|
+
const optionsFns = /* @__PURE__ */ new Set([
|
|
2664
2664
|
...nuxt._moduleOptionsFunctions.get(moduleToInstall) || [],
|
|
2665
2665
|
...meta?.name ? nuxt._moduleOptionsFunctions.get(meta.name) || [] : [],
|
|
2666
2666
|
// TODO: consider dropping options functions keyed by config key
|
|
2667
2667
|
...configKey ? nuxt._moduleOptionsFunctions.get(configKey) || [] : []
|
|
2668
|
-
];
|
|
2669
|
-
if (optionsFns.
|
|
2668
|
+
]);
|
|
2669
|
+
if (optionsFns.size > 0) {
|
|
2670
2670
|
const overrides = [];
|
|
2671
2671
|
const defaults = [];
|
|
2672
2672
|
for (const fn of optionsFns) {
|
|
@@ -2680,10 +2680,10 @@ async function installModules(modulesToInstall, resolvedModulePaths, nuxt = useN
|
|
|
2680
2680
|
}
|
|
2681
2681
|
const isDisabled = configKey && !ignoredConfigKeys.has(configKey) && nuxt.options[configKey] === false;
|
|
2682
2682
|
if (!isDisabled) {
|
|
2683
|
-
await callLifecycleHooks(nuxtModule, meta,
|
|
2683
|
+
await callLifecycleHooks(nuxtModule, meta, inlineOptions, nuxt);
|
|
2684
2684
|
}
|
|
2685
2685
|
const path = typeof moduleToInstall === "string" ? moduleToInstall : void 0;
|
|
2686
|
-
await callModule(nuxt, nuxtModule,
|
|
2686
|
+
await callModule(nuxt, nuxtModule, inlineOptions, {
|
|
2687
2687
|
meta: defu({ disabled: isDisabled }, meta, buildTimeModuleMeta),
|
|
2688
2688
|
nameOrPath: path,
|
|
2689
2689
|
modulePath: resolvedModulePath || path,
|
|
@@ -2692,7 +2692,7 @@ async function installModules(modulesToInstall, resolvedModulePaths, nuxt = useN
|
|
|
2692
2692
|
}
|
|
2693
2693
|
delete nuxt._moduleOptionsFunctions;
|
|
2694
2694
|
}
|
|
2695
|
-
async function installModule(moduleToInstall,
|
|
2695
|
+
async function installModule(moduleToInstall, inlineOptions, nuxt = useNuxt()) {
|
|
2696
2696
|
const { nuxtModule, buildTimeModuleMeta, resolvedModulePath } = await loadNuxtModuleInstance(moduleToInstall, nuxt);
|
|
2697
2697
|
const localLayerModuleDirs = [];
|
|
2698
2698
|
for (const dirs of getLayerDirectories(nuxt)) {
|
|
@@ -2701,7 +2701,7 @@ async function installModule(moduleToInstall, inlineOptions2, nuxt = useNuxt())
|
|
|
2701
2701
|
}
|
|
2702
2702
|
}
|
|
2703
2703
|
const meta = await nuxtModule.getMeta?.();
|
|
2704
|
-
let mergedOptions =
|
|
2704
|
+
let mergedOptions = inlineOptions;
|
|
2705
2705
|
const configKey = meta?.configKey;
|
|
2706
2706
|
if (configKey && nuxt._moduleOptionsFunctions) {
|
|
2707
2707
|
const optionsFns = [
|
|
@@ -2716,7 +2716,7 @@ async function installModule(moduleToInstall, inlineOptions2, nuxt = useNuxt())
|
|
|
2716
2716
|
overrides.push(options.overrides);
|
|
2717
2717
|
defaults.push(options.defaults);
|
|
2718
2718
|
}
|
|
2719
|
-
mergedOptions = defu(
|
|
2719
|
+
mergedOptions = defu(inlineOptions, ...overrides, nuxt.options[configKey], ...defaults);
|
|
2720
2720
|
nuxt.options[configKey] = mergedOptions;
|
|
2721
2721
|
}
|
|
2722
2722
|
}
|
|
@@ -2813,7 +2813,7 @@ const normalizeModuleTranspilePath = (p) => {
|
|
|
2813
2813
|
return getDirectory(p).split("node_modules/").pop();
|
|
2814
2814
|
};
|
|
2815
2815
|
const MissingModuleMatcher = /Cannot find module\s+['"]?([^'")\s]+)['"]?/i;
|
|
2816
|
-
async function callLifecycleHooks(nuxtModule, meta = {},
|
|
2816
|
+
async function callLifecycleHooks(nuxtModule, meta = {}, inlineOptions, nuxt = useNuxt()) {
|
|
2817
2817
|
if (!meta.name || !meta.version) {
|
|
2818
2818
|
return;
|
|
2819
2819
|
}
|
|
@@ -2826,7 +2826,7 @@ async function callLifecycleHooks(nuxtModule, meta = {}, inlineOptions2, nuxt =
|
|
|
2826
2826
|
if (!previousVersion) {
|
|
2827
2827
|
await nuxtModule.onInstall?.(nuxt);
|
|
2828
2828
|
} else if (semver.gt(meta.version, previousVersion)) {
|
|
2829
|
-
await nuxtModule.onUpgrade?.(nuxt,
|
|
2829
|
+
await nuxtModule.onUpgrade?.(nuxt, inlineOptions, previousVersion);
|
|
2830
2830
|
}
|
|
2831
2831
|
if (previousVersion !== meta.version) {
|
|
2832
2832
|
update(
|
|
@@ -2844,7 +2844,7 @@ async function callModule(nuxt, nuxtModule, moduleOptions = {}, options) {
|
|
|
2844
2844
|
const modulePath = options.modulePath;
|
|
2845
2845
|
const nameOrPath = options.nameOrPath;
|
|
2846
2846
|
const localLayerModuleDirs = options.localLayerModuleDirs;
|
|
2847
|
-
const fn = () => isNuxtMajorVersion(2, nuxt) ? nuxtModule.call(nuxt.moduleContainer,
|
|
2847
|
+
const fn = () => isNuxtMajorVersion(2, nuxt) ? nuxtModule.call(nuxt.moduleContainer, moduleOptions, nuxt) : nuxt.options.experimental?.debugModuleMutation && nuxt._asyncLocalStorageModule ? nuxt._asyncLocalStorageModule.run(nuxtModule, () => nuxtModule(moduleOptions, nuxt)) : nuxtModule(moduleOptions, nuxt);
|
|
2848
2848
|
const res = options.meta.disabled ? false : await fn();
|
|
2849
2849
|
let entryPath;
|
|
2850
2850
|
if (typeof modulePath === "string") {
|
|
@@ -2996,7 +2996,7 @@ async function loadNuxtConfig(opts) {
|
|
|
2996
2996
|
}
|
|
2997
2997
|
return await applyDefaults(NuxtConfigSchema, nuxtConfig);
|
|
2998
2998
|
}
|
|
2999
|
-
|
|
2999
|
+
function loadNuxtSchema(cwd) {
|
|
3000
3000
|
const url = directoryToURL(cwd);
|
|
3001
3001
|
const urls = [url];
|
|
3002
3002
|
const nuxtPath = resolveModuleURL("nuxt", { try: true, from: url }) ?? resolveModuleURL("nuxt-nightly", { try: true, from: url });
|
|
@@ -3004,7 +3004,7 @@ async function loadNuxtSchema(cwd) {
|
|
|
3004
3004
|
urls.unshift(nuxtPath);
|
|
3005
3005
|
}
|
|
3006
3006
|
const schemaPath = resolveModuleURL("@nuxt/schema", { try: true, from: urls }) ?? "@nuxt/schema";
|
|
3007
|
-
return
|
|
3007
|
+
return import(schemaPath).then((r) => r.NuxtConfigSchema);
|
|
3008
3008
|
}
|
|
3009
3009
|
async function withDefineNuxtConfig(fn) {
|
|
3010
3010
|
const key = "defineNuxtConfig";
|
|
@@ -3501,7 +3501,7 @@ function normalizeTemplate(template, buildDir) {
|
|
|
3501
3501
|
return template;
|
|
3502
3502
|
}
|
|
3503
3503
|
async function updateTemplates(options) {
|
|
3504
|
-
|
|
3504
|
+
await tryUseNuxt()?.hooks.callHook("builder:generateApp", options);
|
|
3505
3505
|
}
|
|
3506
3506
|
const EXTENSION_RE = /\b(?:\.d\.[cm]?ts|\.\w+)$/g;
|
|
3507
3507
|
const excludedAlias = [/^@vue\/.*$/, /^#internal\/nuxt/];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/kit",
|
|
3
|
-
"version": "3.21.
|
|
3
|
+
"version": "3.21.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"jiti": "^2.6.1",
|
|
34
34
|
"klona": "^2.0.6",
|
|
35
35
|
"knitwork": "^1.3.0",
|
|
36
|
-
"mlly": "^1.8.
|
|
36
|
+
"mlly": "^1.8.1",
|
|
37
37
|
"ohash": "^2.0.11",
|
|
38
38
|
"pathe": "^2.0.3",
|
|
39
39
|
"pkg-types": "^2.3.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"untyped": "^2.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@rspack/core": "1.7.
|
|
49
|
+
"@rspack/core": "1.7.8",
|
|
50
50
|
"@types/lodash-es": "4.17.12",
|
|
51
51
|
"@types/semver": "7.7.1",
|
|
52
52
|
"hookable": "5.5.3",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"nitro": "3.0.1-alpha.2",
|
|
55
55
|
"nitropack": "2.13.1",
|
|
56
56
|
"unbuild": "3.6.1",
|
|
57
|
-
"unimport": "
|
|
57
|
+
"unimport": "6.0.1",
|
|
58
58
|
"vite": "7.3.1",
|
|
59
59
|
"vitest": "4.0.18",
|
|
60
|
-
"webpack": "5.105.
|
|
61
|
-
"@nuxt/schema": "3.21.
|
|
60
|
+
"webpack": "5.105.4",
|
|
61
|
+
"@nuxt/schema": "3.21.2"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=18.12.0"
|