@nuxt/kit 3.12.1 → 3.12.3
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 -10
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.mjs +91 -45
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
[](https://nuxt.com)
|
|
2
2
|
|
|
3
3
|
# Nuxt
|
|
4
4
|
|
|
5
5
|
<p>
|
|
6
6
|
<a href="https://www.npmjs.com/package/nuxt"><img src="https://img.shields.io/npm/v/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="Version"></a>
|
|
7
7
|
<a href="https://www.npmjs.com/package/nuxt"><img src="https://img.shields.io/npm/dm/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="Downloads"></a>
|
|
8
|
-
<a href="
|
|
8
|
+
<a href="https://github.com/nuxt/nuxt/tree/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"><img src="https://img.shields.io/badge/Nuxt%20Docs-18181B?logo=nuxt.js" alt="Website"></a>
|
|
10
10
|
<a href="https://chat.nuxt.dev"><img src="https://img.shields.io/badge/Nuxt%20Discord-18181B?logo=discord" alt="Discord"></a>
|
|
11
11
|
</p>
|
|
@@ -101,12 +101,6 @@ Here are a few ways you can get involved:
|
|
|
101
101
|
|
|
102
102
|
Follow the docs to [Set Up Your Local Development Environment](https://nuxt.com/docs/community/framework-contribution#setup) to contribute to the framework and documentation.
|
|
103
103
|
|
|
104
|
-
## <a name="nuxt-2">⛰️ Nuxt 2</a>
|
|
105
|
-
|
|
106
|
-
You can find the code for Nuxt 2 on the [`2.x` branch](https://github.com/nuxt/nuxt/tree/2.x) and the documentation at [v2.nuxt.com](https://v2.nuxt.com).
|
|
107
|
-
|
|
108
|
-
If you expect to be using Nuxt 2 beyond the EOL (End of Life) date (June 30, 2024), and still need a maintained version that can satisfy security and browser compatibility requirements, make sure to check out [HeroDevs’ NES (Never-Ending Support) Nuxt 2](https://www.herodevs.com/support/nuxt-nes?utm_source=nuxt-github&utm_medium=nuxt-readme).
|
|
109
|
-
|
|
110
104
|
## <a name="professional-support">🛟 Professional Support</a>
|
|
111
105
|
|
|
112
106
|
- Technical audit & consulting: [Nuxt Experts](https://nuxt.com/enterprise/support)
|
|
@@ -115,9 +109,9 @@ If you expect to be using Nuxt 2 beyond the EOL (End of Life) date (June 30, 202
|
|
|
115
109
|
## <a name="follow-us">🔗 Follow us</a>
|
|
116
110
|
|
|
117
111
|
<p valign="center">
|
|
118
|
-
<a href="https://chat.nuxt.dev"><img width="20px" src="
|
|
112
|
+
<a href="https://chat.nuxt.dev"><img width="20px" src="https://github.com/nuxt/nuxt/tree/main/.github/assets/discord.svg" alt="Discord"></a> <a href="https://twitter.nuxt.dev"><img width="20px" src="https://github.com/nuxt/nuxt/tree/main/.github/assets/twitter.svg" alt="Twitter"></a> <a href="https://github.nuxt.dev"><img width="20px" src="https://github.com/nuxt/nuxt/tree/main/.github/assets/github.svg" alt="GitHub"></a>
|
|
119
113
|
</p>
|
|
120
114
|
|
|
121
115
|
## <a name="license">⚖️ License</a>
|
|
122
116
|
|
|
123
|
-
[MIT](
|
|
117
|
+
[MIT](https://github.com/nuxt/nuxt/tree/main/LICENSE)
|
package/dist/index.d.mts
CHANGED
|
@@ -42,7 +42,8 @@ declare function hasNuxtModuleCompatibility(module: string | NuxtModule, semverV
|
|
|
42
42
|
*/
|
|
43
43
|
declare function getNuxtModuleVersion(module: string | NuxtModule, nuxt?: Nuxt | any): Promise<string | false>;
|
|
44
44
|
|
|
45
|
-
interface LoadNuxtConfigOptions extends LoadConfigOptions<NuxtConfig> {
|
|
45
|
+
interface LoadNuxtConfigOptions extends Omit<LoadConfigOptions<NuxtConfig>, 'overrides'> {
|
|
46
|
+
overrides?: Exclude<LoadConfigOptions<NuxtConfig>['overrides'], Promise<any> | Function>;
|
|
46
47
|
}
|
|
47
48
|
declare function loadNuxtConfig(opts: LoadNuxtConfigOptions): Promise<NuxtOptions>;
|
|
48
49
|
|
|
@@ -243,8 +244,11 @@ declare function normalizePlugin(plugin: NuxtPlugin | string): NuxtPlugin;
|
|
|
243
244
|
* Note: By default plugin is prepended to the plugins array. You can use second argument to append (push) instead.
|
|
244
245
|
* @example
|
|
245
246
|
* ```js
|
|
247
|
+
* import { createResolver } from '@nuxt/kit'
|
|
248
|
+
* const resolver = createResolver(import.meta.url)
|
|
249
|
+
*
|
|
246
250
|
* addPlugin({
|
|
247
|
-
* src:
|
|
251
|
+
* src: resolver.resolve('templates/foo.js'),
|
|
248
252
|
* filename: 'foo.server.js' // [optional] only include in server bundle
|
|
249
253
|
* })
|
|
250
254
|
* ```
|
package/dist/index.d.ts
CHANGED
|
@@ -42,7 +42,8 @@ declare function hasNuxtModuleCompatibility(module: string | NuxtModule, semverV
|
|
|
42
42
|
*/
|
|
43
43
|
declare function getNuxtModuleVersion(module: string | NuxtModule, nuxt?: Nuxt | any): Promise<string | false>;
|
|
44
44
|
|
|
45
|
-
interface LoadNuxtConfigOptions extends LoadConfigOptions<NuxtConfig> {
|
|
45
|
+
interface LoadNuxtConfigOptions extends Omit<LoadConfigOptions<NuxtConfig>, 'overrides'> {
|
|
46
|
+
overrides?: Exclude<LoadConfigOptions<NuxtConfig>['overrides'], Promise<any> | Function>;
|
|
46
47
|
}
|
|
47
48
|
declare function loadNuxtConfig(opts: LoadNuxtConfigOptions): Promise<NuxtOptions>;
|
|
48
49
|
|
|
@@ -243,8 +244,11 @@ declare function normalizePlugin(plugin: NuxtPlugin | string): NuxtPlugin;
|
|
|
243
244
|
* Note: By default plugin is prepended to the plugins array. You can use second argument to append (push) instead.
|
|
244
245
|
* @example
|
|
245
246
|
* ```js
|
|
247
|
+
* import { createResolver } from '@nuxt/kit'
|
|
248
|
+
* const resolver = createResolver(import.meta.url)
|
|
249
|
+
*
|
|
246
250
|
* addPlugin({
|
|
247
|
-
* src:
|
|
251
|
+
* src: resolver.resolve('templates/foo.js'),
|
|
248
252
|
* filename: 'foo.server.js' // [optional] only include in server bundle
|
|
249
253
|
* })
|
|
250
254
|
* ```
|
package/dist/index.mjs
CHANGED
|
@@ -2070,10 +2070,11 @@ async function compileTemplate(template$1, ctx) {
|
|
|
2070
2070
|
const serialize = (data) => JSON.stringify(data, null, 2).replace(/"\{(.+)\}"(?=,?$)/gm, (r) => JSON.parse(r).replace(/^\{(.*)\}$/, "$1"));
|
|
2071
2071
|
const importSources = (sources, { lazy = false } = {}) => {
|
|
2072
2072
|
return toArray(sources).map((src) => {
|
|
2073
|
+
const safeVariableName = genSafeVariableName(src);
|
|
2073
2074
|
if (lazy) {
|
|
2074
|
-
return `const ${
|
|
2075
|
+
return `const ${safeVariableName} = ${genDynamicImport(src, { comment: `webpackChunkName: ${JSON.stringify(src)}` })}`;
|
|
2075
2076
|
}
|
|
2076
|
-
return genImport(src,
|
|
2077
|
+
return genImport(src, safeVariableName);
|
|
2077
2078
|
}).join("\n");
|
|
2078
2079
|
};
|
|
2079
2080
|
const importName = genSafeVariableName;
|
|
@@ -2121,11 +2122,10 @@ ${issues.toString()}`);
|
|
|
2121
2122
|
if (module.hooks) {
|
|
2122
2123
|
nuxt.hooks.addHooks(module.hooks);
|
|
2123
2124
|
}
|
|
2124
|
-
const
|
|
2125
|
-
const mark = performance.mark(key);
|
|
2125
|
+
const start = performance.now();
|
|
2126
2126
|
const res = await module.setup?.call(null, _options, nuxt) ?? {};
|
|
2127
|
-
const perf = performance.
|
|
2128
|
-
const setupTime = Math.round(perf
|
|
2127
|
+
const perf = performance.now() - start;
|
|
2128
|
+
const setupTime = Math.round(perf * 100) / 100;
|
|
2129
2129
|
if (setupTime > 5e3 && uniqueKey !== "@nuxt/telemetry") {
|
|
2130
2130
|
logger.warn(`Slow module \`${uniqueKey || "<no name>"}\` took \`${setupTime}ms\` to setup.`);
|
|
2131
2131
|
} else if (nuxt.options.debug) {
|
|
@@ -2212,7 +2212,7 @@ function getRequireCacheItem(id) {
|
|
|
2212
2212
|
} catch (e) {
|
|
2213
2213
|
}
|
|
2214
2214
|
}
|
|
2215
|
-
function
|
|
2215
|
+
function getNodeModulesPaths(paths) {
|
|
2216
2216
|
return [].concat(
|
|
2217
2217
|
global.__NUXT_PREPATHS__,
|
|
2218
2218
|
paths || [],
|
|
@@ -2222,7 +2222,7 @@ function getModulePaths(paths) {
|
|
|
2222
2222
|
}
|
|
2223
2223
|
function resolveModule(id, opts = {}) {
|
|
2224
2224
|
return normalize(_require.resolve(id, {
|
|
2225
|
-
paths:
|
|
2225
|
+
paths: getNodeModulesPaths(opts.paths)
|
|
2226
2226
|
}));
|
|
2227
2227
|
}
|
|
2228
2228
|
function requireModule(id, opts = {}) {
|
|
@@ -2302,7 +2302,7 @@ function resolveIgnorePatterns(relativePath) {
|
|
|
2302
2302
|
if (relativePath) {
|
|
2303
2303
|
return ignorePatterns.map((p) => {
|
|
2304
2304
|
const [_, negation = "", pattern] = p.match(NEGATION_RE) || [];
|
|
2305
|
-
if (pattern[0] === "*") {
|
|
2305
|
+
if (pattern && pattern[0] === "*") {
|
|
2306
2306
|
return p;
|
|
2307
2307
|
}
|
|
2308
2308
|
return negation + relative(relativePath, resolve(nuxt.options.rootDir, pattern || p));
|
|
@@ -2316,7 +2316,7 @@ function resolveGroupSyntax(group) {
|
|
|
2316
2316
|
groups = groups.flatMap((group2) => {
|
|
2317
2317
|
const [head, ...tail] = group2.split("{");
|
|
2318
2318
|
if (tail.length) {
|
|
2319
|
-
const [body, ...rest] = tail.join("{").split("}");
|
|
2319
|
+
const [body = "", ...rest] = tail.join("{").split("}");
|
|
2320
2320
|
return body.split(",").map((part) => `${head}${part}${rest.join("")}`);
|
|
2321
2321
|
}
|
|
2322
2322
|
return group2;
|
|
@@ -2445,8 +2445,14 @@ function existsInVFS(path, nuxt = tryUseNuxt()) {
|
|
|
2445
2445
|
return templates.some((template) => template.dst === path);
|
|
2446
2446
|
}
|
|
2447
2447
|
async function resolveFiles(path, pattern, opts = {}) {
|
|
2448
|
-
const files =
|
|
2449
|
-
|
|
2448
|
+
const files = [];
|
|
2449
|
+
for (const file of await globby(pattern, { cwd: path, followSymbolicLinks: opts.followSymbolicLinks ?? true })) {
|
|
2450
|
+
const p = resolve(path, file);
|
|
2451
|
+
if (!isIgnored(p)) {
|
|
2452
|
+
files.push(p);
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
return files.sort();
|
|
2450
2456
|
}
|
|
2451
2457
|
|
|
2452
2458
|
const NODE_MODULES_RE = /[/\\]node_modules[/\\]/;
|
|
@@ -2551,9 +2557,10 @@ async function getNuxtModuleVersion(module, nuxt = useNuxt()) {
|
|
|
2551
2557
|
if (!moduleMeta.name) {
|
|
2552
2558
|
return false;
|
|
2553
2559
|
}
|
|
2554
|
-
const
|
|
2555
|
-
|
|
2556
|
-
|
|
2560
|
+
for (const m of nuxt.options._installedModules) {
|
|
2561
|
+
if (m.meta.name === moduleMeta.name && m.meta.version) {
|
|
2562
|
+
return m.meta.version;
|
|
2563
|
+
}
|
|
2557
2564
|
}
|
|
2558
2565
|
if (hasNuxtModule(moduleMeta.name)) {
|
|
2559
2566
|
const { buildTimeModuleMeta } = await loadNuxtModuleInstance(moduleMeta.name, nuxt);
|
|
@@ -2563,7 +2570,12 @@ async function getNuxtModuleVersion(module, nuxt = useNuxt()) {
|
|
|
2563
2570
|
}
|
|
2564
2571
|
|
|
2565
2572
|
const layerSchemaKeys = ["future", "srcDir", "rootDir", "dir"];
|
|
2566
|
-
const layerSchema =
|
|
2573
|
+
const layerSchema = /* @__PURE__ */ Object.create(null);
|
|
2574
|
+
for (const key of layerSchemaKeys) {
|
|
2575
|
+
if (key in NuxtConfigSchema) {
|
|
2576
|
+
layerSchema[key] = NuxtConfigSchema[key];
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2567
2579
|
async function loadNuxtConfig(opts) {
|
|
2568
2580
|
opts.overrides = defu$1(opts.overrides, {
|
|
2569
2581
|
_extends: await globby("layers/*", {
|
|
@@ -2588,9 +2600,14 @@ async function loadNuxtConfig(opts) {
|
|
|
2588
2600
|
nuxtConfig._nuxtConfigFile = configFile;
|
|
2589
2601
|
nuxtConfig._nuxtConfigFiles = [configFile];
|
|
2590
2602
|
const _layers = [];
|
|
2603
|
+
const processedLayers = /* @__PURE__ */ new Set();
|
|
2591
2604
|
for (const layer of layers) {
|
|
2592
2605
|
layer.config = layer.config || {};
|
|
2593
2606
|
layer.config.rootDir = layer.config.rootDir ?? layer.cwd;
|
|
2607
|
+
if (processedLayers.has(layer.config.rootDir)) {
|
|
2608
|
+
continue;
|
|
2609
|
+
}
|
|
2610
|
+
processedLayers.add(layer.config.rootDir);
|
|
2594
2611
|
layer.config = await applyDefaults(layerSchema, layer.config);
|
|
2595
2612
|
if (!layer.configFile || layer.configFile.endsWith(".nuxtrc")) {
|
|
2596
2613
|
continue;
|
|
@@ -2628,7 +2645,7 @@ async function loadNuxt(opts) {
|
|
|
2628
2645
|
const pkg = await readPackageJSON(nearestNuxtPkg);
|
|
2629
2646
|
const majorVersion = pkg.version ? Number.parseInt(pkg.version.split(".")[0]) : "";
|
|
2630
2647
|
const rootDir = pathToFileURL(opts.cwd || process.cwd()).href;
|
|
2631
|
-
if (majorVersion
|
|
2648
|
+
if (majorVersion && majorVersion >= 3) {
|
|
2632
2649
|
const { loadNuxt: loadNuxt3 } = await importModule(pkg._name || pkg.name, rootDir);
|
|
2633
2650
|
const nuxt2 = await loadNuxt3(opts);
|
|
2634
2651
|
return nuxt2;
|
|
@@ -2980,12 +2997,44 @@ async function updateTemplates(options) {
|
|
|
2980
2997
|
return await tryUseNuxt()?.hooks.callHook("builder:generateApp", options);
|
|
2981
2998
|
}
|
|
2982
2999
|
async function _generateTypes(nuxt) {
|
|
2983
|
-
const nodeModulePaths = getModulePaths(nuxt.options.modulesDir);
|
|
2984
3000
|
const rootDirWithSlash = withTrailingSlash(nuxt.options.rootDir);
|
|
2985
|
-
const
|
|
2986
|
-
|
|
2987
|
-
nuxt.
|
|
2988
|
-
|
|
3001
|
+
const relativeRootDir = relativeWithDot(nuxt.options.buildDir, nuxt.options.rootDir);
|
|
3002
|
+
const include = /* @__PURE__ */ new Set([
|
|
3003
|
+
"./nuxt.d.ts",
|
|
3004
|
+
join(relativeRootDir, ".config/nuxt.*"),
|
|
3005
|
+
join(relativeRootDir, "**/*")
|
|
3006
|
+
]);
|
|
3007
|
+
if (nuxt.options.srcDir !== nuxt.options.rootDir) {
|
|
3008
|
+
include.add(join(relative(nuxt.options.buildDir, nuxt.options.srcDir), "**/*"));
|
|
3009
|
+
}
|
|
3010
|
+
if (nuxt.options.typescript.includeWorkspace && nuxt.options.workspaceDir !== nuxt.options.rootDir) {
|
|
3011
|
+
include.add(join(relative(nuxt.options.buildDir, nuxt.options.workspaceDir), "**/*"));
|
|
3012
|
+
}
|
|
3013
|
+
for (const layer of nuxt.options._layers) {
|
|
3014
|
+
const srcOrCwd = layer.config.srcDir ?? layer.cwd;
|
|
3015
|
+
if (!srcOrCwd.startsWith(rootDirWithSlash) || srcOrCwd.includes("node_modules")) {
|
|
3016
|
+
include.add(join(relative(nuxt.options.buildDir, srcOrCwd), "**/*"));
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
const exclude = /* @__PURE__ */ new Set([
|
|
3020
|
+
// nitro generate output: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/core/nitro.ts#L186
|
|
3021
|
+
relativeWithDot(nuxt.options.buildDir, resolve(nuxt.options.rootDir, "dist"))
|
|
3022
|
+
]);
|
|
3023
|
+
for (const dir of nuxt.options.modulesDir) {
|
|
3024
|
+
exclude.add(relativeWithDot(nuxt.options.buildDir, dir));
|
|
3025
|
+
}
|
|
3026
|
+
const moduleEntryPaths = [];
|
|
3027
|
+
for (const m of nuxt.options._installedModules) {
|
|
3028
|
+
if (m.entryPath) {
|
|
3029
|
+
moduleEntryPaths.push(getDirectory(m.entryPath));
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
3032
|
+
const modulePaths = await resolveNuxtModule(rootDirWithSlash, moduleEntryPaths);
|
|
3033
|
+
for (const path of modulePaths) {
|
|
3034
|
+
const relative2 = relativeWithDot(nuxt.options.buildDir, path);
|
|
3035
|
+
include.add(join(relative2, "runtime"));
|
|
3036
|
+
exclude.add(join(relative2, "runtime/server"));
|
|
3037
|
+
}
|
|
2989
3038
|
const isV4 = nuxt.options.future?.compatibilityVersion === 4;
|
|
2990
3039
|
const hasTypescriptVersionWithModulePreserve = await readPackageJSON("typescript", { url: nuxt.options.modulesDir }).then((r) => r?.version && gte(r.version, "5.4.0")).catch(() => isV4);
|
|
2991
3040
|
const tsConfig = defu(nuxt.options.typescript?.tsConfig, {
|
|
@@ -3011,7 +3060,8 @@ async function _generateTypes(nuxt) {
|
|
|
3011
3060
|
lib: [
|
|
3012
3061
|
"ESNext",
|
|
3013
3062
|
"dom",
|
|
3014
|
-
"dom.iterable"
|
|
3063
|
+
"dom.iterable",
|
|
3064
|
+
"webworker"
|
|
3015
3065
|
],
|
|
3016
3066
|
/* JSX support for Vue */
|
|
3017
3067
|
jsx: "preserve",
|
|
@@ -3029,21 +3079,8 @@ async function _generateTypes(nuxt) {
|
|
|
3029
3079
|
/* enabled with `strict` */
|
|
3030
3080
|
allowSyntheticDefaultImports: true
|
|
3031
3081
|
},
|
|
3032
|
-
include: [
|
|
3033
|
-
|
|
3034
|
-
join(relativeWithDot(nuxt.options.buildDir, nuxt.options.rootDir), ".config/nuxt.*"),
|
|
3035
|
-
join(relativeWithDot(nuxt.options.buildDir, nuxt.options.rootDir), "**/*"),
|
|
3036
|
-
...nuxt.options.srcDir !== nuxt.options.rootDir ? [join(relative(nuxt.options.buildDir, nuxt.options.srcDir), "**/*")] : [],
|
|
3037
|
-
...nuxt.options._layers.map((layer) => layer.config.srcDir ?? layer.cwd).filter((srcOrCwd) => !srcOrCwd.startsWith(rootDirWithSlash) || srcOrCwd.includes("node_modules")).map((srcOrCwd) => join(relative(nuxt.options.buildDir, srcOrCwd), "**/*")),
|
|
3038
|
-
...nuxt.options.typescript.includeWorkspace && nuxt.options.workspaceDir !== nuxt.options.rootDir ? [join(relative(nuxt.options.buildDir, nuxt.options.workspaceDir), "**/*")] : [],
|
|
3039
|
-
...modulePaths.map((m) => join(relativeWithDot(nuxt.options.buildDir, m), "runtime"))
|
|
3040
|
-
],
|
|
3041
|
-
exclude: [
|
|
3042
|
-
...nuxt.options.modulesDir.map((m) => relativeWithDot(nuxt.options.buildDir, m)),
|
|
3043
|
-
...modulePaths.map((m) => join(relativeWithDot(nuxt.options.buildDir, m), "runtime/server")),
|
|
3044
|
-
// nitro generate output: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/core/nitro.ts#L186
|
|
3045
|
-
relativeWithDot(nuxt.options.buildDir, resolve(nuxt.options.rootDir, "dist"))
|
|
3046
|
-
]
|
|
3082
|
+
include: [...include],
|
|
3083
|
+
exclude: [...exclude]
|
|
3047
3084
|
});
|
|
3048
3085
|
const aliases = {
|
|
3049
3086
|
...nuxt.options.alias,
|
|
@@ -3084,10 +3121,14 @@ async function _generateTypes(nuxt) {
|
|
|
3084
3121
|
}
|
|
3085
3122
|
}
|
|
3086
3123
|
}
|
|
3087
|
-
const references =
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3124
|
+
const references = [];
|
|
3125
|
+
await Promise.all([...nuxt.options.modules, ...nuxt.options._modules].map(async (id) => {
|
|
3126
|
+
if (typeof id !== "string") {
|
|
3127
|
+
return;
|
|
3128
|
+
}
|
|
3129
|
+
const pkg = await readPackageJSON(id, { url: getNodeModulesPaths(nuxt.options.modulesDir) }).catch(() => null);
|
|
3130
|
+
references.push({ types: pkg?.name || id });
|
|
3131
|
+
}));
|
|
3091
3132
|
const declarations = [];
|
|
3092
3133
|
await nuxt.callHook("prepare:types", { references, declarations, tsConfig });
|
|
3093
3134
|
for (const alias in tsConfig.compilerOptions.paths) {
|
|
@@ -3136,7 +3177,11 @@ async function writeTypes(nuxt) {
|
|
|
3136
3177
|
await writeFile();
|
|
3137
3178
|
}
|
|
3138
3179
|
function renderAttrs(obj) {
|
|
3139
|
-
|
|
3180
|
+
const attrs = [];
|
|
3181
|
+
for (const key in obj) {
|
|
3182
|
+
attrs.push(renderAttr(key, obj[key]));
|
|
3183
|
+
}
|
|
3184
|
+
return attrs.join(" ");
|
|
3140
3185
|
}
|
|
3141
3186
|
function renderAttr(key, value) {
|
|
3142
3187
|
return value ? `${key}="${value}"` : "";
|
|
@@ -3200,13 +3245,14 @@ function addRouteMiddleware(input, options = {}) {
|
|
|
3200
3245
|
for (const middleware of middlewares) {
|
|
3201
3246
|
const find = app.middleware.findIndex((item) => item.name === middleware.name);
|
|
3202
3247
|
if (find >= 0) {
|
|
3203
|
-
|
|
3248
|
+
const foundPath = app.middleware[find].path;
|
|
3249
|
+
if (foundPath === middleware.path) {
|
|
3204
3250
|
continue;
|
|
3205
3251
|
}
|
|
3206
3252
|
if (options.override === true) {
|
|
3207
3253
|
app.middleware[find] = { ...middleware };
|
|
3208
3254
|
} else {
|
|
3209
|
-
logger.warn(`'${middleware.name}' middleware already exists at '${
|
|
3255
|
+
logger.warn(`'${middleware.name}' middleware already exists at '${foundPath}'. You can set \`override: true\` to replace it.`);
|
|
3210
3256
|
}
|
|
3211
3257
|
} else {
|
|
3212
3258
|
app.middleware.push({ ...middleware });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/kit",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"c12": "^1.
|
|
26
|
+
"c12": "^1.11.1",
|
|
27
27
|
"consola": "^3.2.3",
|
|
28
28
|
"defu": "^6.1.4",
|
|
29
29
|
"destr": "^2.0.3",
|
|
30
|
-
"globby": "^14.0.
|
|
30
|
+
"globby": "^14.0.2",
|
|
31
31
|
"hash-sum": "^2.0.0",
|
|
32
32
|
"ignore": "^5.3.1",
|
|
33
33
|
"jiti": "^1.21.6",
|
|
@@ -35,25 +35,25 @@
|
|
|
35
35
|
"knitwork": "^1.1.0",
|
|
36
36
|
"mlly": "^1.7.1",
|
|
37
37
|
"pathe": "^1.1.2",
|
|
38
|
-
"pkg-types": "^1.1.
|
|
38
|
+
"pkg-types": "^1.1.2",
|
|
39
39
|
"scule": "^1.3.0",
|
|
40
40
|
"semver": "^7.6.2",
|
|
41
41
|
"ufo": "^1.5.3",
|
|
42
42
|
"unctx": "^2.3.1",
|
|
43
43
|
"unimport": "^3.7.2",
|
|
44
44
|
"untyped": "^1.4.2",
|
|
45
|
-
"@nuxt/schema": "3.12.
|
|
45
|
+
"@nuxt/schema": "3.12.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/hash-sum": "1.0.2",
|
|
49
49
|
"@types/lodash-es": "4.17.12",
|
|
50
50
|
"@types/semver": "7.5.8",
|
|
51
51
|
"lodash-es": "4.17.21",
|
|
52
|
-
"nitropack": "2.9.
|
|
52
|
+
"nitropack": "2.9.7",
|
|
53
53
|
"unbuild": "latest",
|
|
54
|
-
"vite": "5.2
|
|
54
|
+
"vite": "5.3.2",
|
|
55
55
|
"vitest": "1.6.0",
|
|
56
|
-
"webpack": "5.
|
|
56
|
+
"webpack": "5.92.1"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": "^14.18.0 || >=16.10.0"
|