@nuxt/kit 3.9.0 → 3.9.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/dist/index.d.mts CHANGED
@@ -138,11 +138,11 @@ declare function hasNuxtCompatibility(constraints: NuxtCompatibility, nuxt?: Nux
138
138
  /**
139
139
  * Check if current nuxt instance is version 2 legacy
140
140
  */
141
- declare function isNuxt2(nuxt?: Nuxt): any;
141
+ declare function isNuxt2(nuxt?: Nuxt): boolean;
142
142
  /**
143
143
  * Check if current nuxt instance is version 3
144
144
  */
145
- declare function isNuxt3(nuxt?: Nuxt): any;
145
+ declare function isNuxt3(nuxt?: Nuxt): boolean;
146
146
  /**
147
147
  * Get nuxt version
148
148
  */
@@ -336,16 +336,16 @@ declare function addServerScanDir(dirs: string | string[], opts?: {
336
336
  /**
337
337
  * Renders given template using lodash template during build into the project buildDir
338
338
  */
339
- declare function addTemplate(_template: NuxtTemplate<any> | string): ResolvedNuxtTemplate<any>;
339
+ declare function addTemplate<T>(_template: NuxtTemplate<T> | string): ResolvedNuxtTemplate<T>;
340
340
  /**
341
341
  * Renders given types using lodash template during build into the project buildDir
342
342
  * and register them as types.
343
343
  */
344
- declare function addTypeTemplate(_template: NuxtTypeTemplate<any>): ResolvedNuxtTemplate<any>;
344
+ declare function addTypeTemplate<T>(_template: NuxtTypeTemplate<T>): ResolvedNuxtTemplate<T>;
345
345
  /**
346
346
  * Normalize a nuxt template object
347
347
  */
348
- declare function normalizeTemplate(template: NuxtTemplate<any> | string): ResolvedNuxtTemplate<any>;
348
+ declare function normalizeTemplate<T>(template: NuxtTemplate<T> | string): ResolvedNuxtTemplate<T>;
349
349
  /**
350
350
  * Trigger rebuilding Nuxt templates
351
351
  *
@@ -390,7 +390,7 @@ declare function tryRequireModule(id: string, opts?: RequireModuleOptions): any;
390
390
  declare function tryResolveModule(id: string, url?: string | string[]): Promise<string | undefined>;
391
391
 
392
392
  /** @deprecated */
393
- declare function compileTemplate(template: NuxtTemplate, ctx: any): Promise<string>;
393
+ declare function compileTemplate<T>(template: NuxtTemplate<T>, ctx: any): Promise<string>;
394
394
  /** @deprecated */
395
395
  declare const templateUtils: {
396
396
  serialize: (data: any) => string;
package/dist/index.d.ts CHANGED
@@ -138,11 +138,11 @@ declare function hasNuxtCompatibility(constraints: NuxtCompatibility, nuxt?: Nux
138
138
  /**
139
139
  * Check if current nuxt instance is version 2 legacy
140
140
  */
141
- declare function isNuxt2(nuxt?: Nuxt): any;
141
+ declare function isNuxt2(nuxt?: Nuxt): boolean;
142
142
  /**
143
143
  * Check if current nuxt instance is version 3
144
144
  */
145
- declare function isNuxt3(nuxt?: Nuxt): any;
145
+ declare function isNuxt3(nuxt?: Nuxt): boolean;
146
146
  /**
147
147
  * Get nuxt version
148
148
  */
@@ -336,16 +336,16 @@ declare function addServerScanDir(dirs: string | string[], opts?: {
336
336
  /**
337
337
  * Renders given template using lodash template during build into the project buildDir
338
338
  */
339
- declare function addTemplate(_template: NuxtTemplate<any> | string): ResolvedNuxtTemplate<any>;
339
+ declare function addTemplate<T>(_template: NuxtTemplate<T> | string): ResolvedNuxtTemplate<T>;
340
340
  /**
341
341
  * Renders given types using lodash template during build into the project buildDir
342
342
  * and register them as types.
343
343
  */
344
- declare function addTypeTemplate(_template: NuxtTypeTemplate<any>): ResolvedNuxtTemplate<any>;
344
+ declare function addTypeTemplate<T>(_template: NuxtTypeTemplate<T>): ResolvedNuxtTemplate<T>;
345
345
  /**
346
346
  * Normalize a nuxt template object
347
347
  */
348
- declare function normalizeTemplate(template: NuxtTemplate<any> | string): ResolvedNuxtTemplate<any>;
348
+ declare function normalizeTemplate<T>(template: NuxtTemplate<T> | string): ResolvedNuxtTemplate<T>;
349
349
  /**
350
350
  * Trigger rebuilding Nuxt templates
351
351
  *
@@ -390,7 +390,7 @@ declare function tryRequireModule(id: string, opts?: RequireModuleOptions): any;
390
390
  declare function tryResolveModule(id: string, url?: string | string[]): Promise<string | undefined>;
391
391
 
392
392
  /** @deprecated */
393
- declare function compileTemplate(template: NuxtTemplate, ctx: any): Promise<string>;
393
+ declare function compileTemplate<T>(template: NuxtTemplate<T>, ctx: any): Promise<string>;
394
394
  /** @deprecated */
395
395
  declare const templateUtils: {
396
396
  serialize: (data: any) => string;
package/dist/index.mjs CHANGED
@@ -82,10 +82,12 @@ async function hasNuxtCompatibility(constraints, nuxt = useNuxt()) {
82
82
  return !issues.length;
83
83
  }
84
84
  function isNuxt2(nuxt = useNuxt()) {
85
- return getNuxtVersion(nuxt).startsWith("2.");
85
+ const version = getNuxtVersion(nuxt);
86
+ return version[0] === "2" && version[1] === ".";
86
87
  }
87
88
  function isNuxt3(nuxt = useNuxt()) {
88
- return getNuxtVersion(nuxt).startsWith("3.");
89
+ const version = getNuxtVersion(nuxt);
90
+ return version[0] === "3" && version[1] === ".";
89
91
  }
90
92
  function getNuxtVersion(nuxt = useNuxt()) {
91
93
  const version = (nuxt?._version || nuxt?.version || nuxt?.constructor?.version || "").replace(/^v/g, "");
@@ -98,20 +100,14 @@ function getNuxtVersion(nuxt = useNuxt()) {
98
100
  /** Detect free variable `global` from Node.js. */
99
101
  var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
100
102
 
101
- const freeGlobal$1 = freeGlobal;
102
-
103
103
  /** Detect free variable `self`. */
104
104
  var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
105
105
 
106
106
  /** Used as a reference to the global object. */
107
- var root = freeGlobal$1 || freeSelf || Function('return this')();
108
-
109
- const root$1 = root;
107
+ var root = freeGlobal || freeSelf || Function('return this')();
110
108
 
111
109
  /** Built-in value references. */
112
- var Symbol = root$1.Symbol;
113
-
114
- const Symbol$1 = Symbol;
110
+ var Symbol = root.Symbol;
115
111
 
116
112
  /** Used for built-in method references. */
117
113
  var objectProto$b = Object.prototype;
@@ -127,7 +123,7 @@ var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
127
123
  var nativeObjectToString$1 = objectProto$b.toString;
128
124
 
129
125
  /** Built-in value references. */
130
- var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
126
+ var symToStringTag$1 = Symbol ? Symbol.toStringTag : undefined;
131
127
 
132
128
  /**
133
129
  * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
@@ -182,7 +178,7 @@ var nullTag = '[object Null]',
182
178
  undefinedTag = '[object Undefined]';
183
179
 
184
180
  /** Built-in value references. */
185
- var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
181
+ var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
186
182
 
187
183
  /**
188
184
  * The base implementation of `getTag` without fallbacks for buggy environments.
@@ -298,13 +294,11 @@ function arrayMap(array, iteratee) {
298
294
  */
299
295
  var isArray = Array.isArray;
300
296
 
301
- const isArray$1 = isArray;
302
-
303
297
  /** Used as references for various `Number` constants. */
304
298
  var INFINITY = 1 / 0;
305
299
 
306
300
  /** Used to convert symbols to primitives and strings. */
307
- var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined,
301
+ var symbolProto = Symbol ? Symbol.prototype : undefined,
308
302
  symbolToString = symbolProto ? symbolProto.toString : undefined;
309
303
 
310
304
  /**
@@ -320,7 +314,7 @@ function baseToString(value) {
320
314
  if (typeof value == 'string') {
321
315
  return value;
322
316
  }
323
- if (isArray$1(value)) {
317
+ if (isArray(value)) {
324
318
  // Recursively convert values (susceptible to call stack limits).
325
319
  return arrayMap(value, baseToString) + '';
326
320
  }
@@ -415,13 +409,11 @@ function isFunction(value) {
415
409
  }
416
410
 
417
411
  /** Used to detect overreaching core-js shims. */
418
- var coreJsData = root$1['__core-js_shared__'];
419
-
420
- const coreJsData$1 = coreJsData;
412
+ var coreJsData = root['__core-js_shared__'];
421
413
 
422
414
  /** Used to detect methods masquerading as native. */
423
415
  var maskSrcKey = (function() {
424
- var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || '');
416
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
425
417
  return uid ? ('Symbol(src)_1.' + uid) : '';
426
418
  }());
427
419
 
@@ -616,8 +608,6 @@ var defineProperty = (function() {
616
608
  } catch (e) {}
617
609
  }());
618
610
 
619
- const defineProperty$1 = defineProperty;
620
-
621
611
  /**
622
612
  * The base implementation of `setToString` without support for hot loop shorting.
623
613
  *
@@ -626,8 +616,8 @@ const defineProperty$1 = defineProperty;
626
616
  * @param {Function} string The `toString` result.
627
617
  * @returns {Function} Returns `func`.
628
618
  */
629
- var baseSetToString = !defineProperty$1 ? identity : function(func, string) {
630
- return defineProperty$1(func, 'toString', {
619
+ var baseSetToString = !defineProperty ? identity : function(func, string) {
620
+ return defineProperty(func, 'toString', {
631
621
  'configurable': true,
632
622
  'enumerable': false,
633
623
  'value': constant(string),
@@ -647,8 +637,6 @@ const baseSetToString$1 = baseSetToString;
647
637
  */
648
638
  var setToString = shortOut(baseSetToString$1);
649
639
 
650
- const setToString$1 = setToString;
651
-
652
640
  /** Used as references for various `Number` constants. */
653
641
  var MAX_SAFE_INTEGER$1 = 9007199254740991;
654
642
 
@@ -683,8 +671,8 @@ function isIndex(value, length) {
683
671
  * @param {*} value The value to assign.
684
672
  */
685
673
  function baseAssignValue(object, key, value) {
686
- if (key == '__proto__' && defineProperty$1) {
687
- defineProperty$1(object, key, {
674
+ if (key == '__proto__' && defineProperty) {
675
+ defineProperty(object, key, {
688
676
  'configurable': true,
689
677
  'enumerable': true,
690
678
  'value': value,
@@ -833,7 +821,7 @@ function overRest(func, start, transform) {
833
821
  * @returns {Function} Returns the new function.
834
822
  */
835
823
  function baseRest(func, start) {
836
- return setToString$1(overRest(func, start, identity), func + '');
824
+ return setToString(overRest(func, start, identity), func + '');
837
825
  }
838
826
 
839
827
  /** Used as references for various `Number` constants. */
@@ -1038,8 +1026,6 @@ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsAr
1038
1026
  !propertyIsEnumerable.call(value, 'callee');
1039
1027
  };
1040
1028
 
1041
- const isArguments$1 = isArguments;
1042
-
1043
1029
  /**
1044
1030
  * This method returns `false`.
1045
1031
  *
@@ -1067,7 +1053,7 @@ var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !modu
1067
1053
  var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
1068
1054
 
1069
1055
  /** Built-in value references. */
1070
- var Buffer = moduleExports$1 ? root$1.Buffer : undefined;
1056
+ var Buffer = moduleExports$1 ? root.Buffer : undefined;
1071
1057
 
1072
1058
  /* Built-in method references for those with the same name as other `lodash` methods. */
1073
1059
  var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
@@ -1091,8 +1077,6 @@ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
1091
1077
  */
1092
1078
  var isBuffer = nativeIsBuffer || stubFalse;
1093
1079
 
1094
- const isBuffer$1 = isBuffer;
1095
-
1096
1080
  /** `Object#toString` result references. */
1097
1081
  var argsTag = '[object Arguments]',
1098
1082
  arrayTag = '[object Array]',
@@ -1171,7 +1155,7 @@ var freeModule = freeExports && typeof module == 'object' && module && !module.n
1171
1155
  var moduleExports = freeModule && freeModule.exports === freeExports;
1172
1156
 
1173
1157
  /** Detect free variable `process` from Node.js. */
1174
- var freeProcess = moduleExports && freeGlobal$1.process;
1158
+ var freeProcess = moduleExports && freeGlobal.process;
1175
1159
 
1176
1160
  /** Used to access faster Node.js helpers. */
1177
1161
  var nodeUtil = (function() {
@@ -1188,10 +1172,8 @@ var nodeUtil = (function() {
1188
1172
  } catch (e) {}
1189
1173
  }());
1190
1174
 
1191
- const nodeUtil$1 = nodeUtil;
1192
-
1193
1175
  /* Node.js helper references. */
1194
- var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
1176
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
1195
1177
 
1196
1178
  /**
1197
1179
  * Checks if `value` is classified as a typed array.
@@ -1212,8 +1194,6 @@ var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
1212
1194
  */
1213
1195
  var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1214
1196
 
1215
- const isTypedArray$1 = isTypedArray;
1216
-
1217
1197
  /** Used for built-in method references. */
1218
1198
  var objectProto$5 = Object.prototype;
1219
1199
 
@@ -1229,10 +1209,10 @@ var hasOwnProperty$5 = objectProto$5.hasOwnProperty;
1229
1209
  * @returns {Array} Returns the array of property names.
1230
1210
  */
1231
1211
  function arrayLikeKeys(value, inherited) {
1232
- var isArr = isArray$1(value),
1233
- isArg = !isArr && isArguments$1(value),
1234
- isBuff = !isArr && !isArg && isBuffer$1(value),
1235
- isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
1212
+ var isArr = isArray(value),
1213
+ isArg = !isArr && isArguments(value),
1214
+ isBuff = !isArr && !isArg && isBuffer(value),
1215
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
1236
1216
  skipIndexes = isArr || isArg || isBuff || isType,
1237
1217
  result = skipIndexes ? baseTimes(value.length, String) : [],
1238
1218
  length = result.length;
@@ -1272,8 +1252,6 @@ function overArg(func, transform) {
1272
1252
  /* Built-in method references for those with the same name as other `lodash` methods. */
1273
1253
  var nativeKeys = overArg(Object.keys, Object);
1274
1254
 
1275
- const nativeKeys$1 = nativeKeys;
1276
-
1277
1255
  /** Used for built-in method references. */
1278
1256
  var objectProto$4 = Object.prototype;
1279
1257
 
@@ -1289,7 +1267,7 @@ var hasOwnProperty$4 = objectProto$4.hasOwnProperty;
1289
1267
  */
1290
1268
  function baseKeys(object) {
1291
1269
  if (!isPrototype(object)) {
1292
- return nativeKeys$1(object);
1270
+ return nativeKeys(object);
1293
1271
  }
1294
1272
  var result = [];
1295
1273
  for (var key in Object(object)) {
@@ -1439,8 +1417,6 @@ var assignInWith = createAssigner(function(object, source, srcIndex, customizer)
1439
1417
  copyObject(source, keysIn(source), object, customizer);
1440
1418
  });
1441
1419
 
1442
- const extendWith = assignInWith;
1443
-
1444
1420
  /**
1445
1421
  * Converts `value` to a string. An empty string is returned for `null`
1446
1422
  * and `undefined` values. The sign of `-0` is preserved.
@@ -1469,8 +1445,6 @@ function toString(value) {
1469
1445
  /** Built-in value references. */
1470
1446
  var getPrototype = overArg(Object.getPrototypeOf, Object);
1471
1447
 
1472
- const getPrototype$1 = getPrototype;
1473
-
1474
1448
  /** `Object#toString` result references. */
1475
1449
  var objectTag = '[object Object]';
1476
1450
 
@@ -1519,7 +1493,7 @@ function isPlainObject(value) {
1519
1493
  if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
1520
1494
  return false;
1521
1495
  }
1522
- var proto = getPrototype$1(value);
1496
+ var proto = getPrototype(value);
1523
1497
  if (proto === null) {
1524
1498
  return true;
1525
1499
  }
@@ -1589,8 +1563,6 @@ var attempt = baseRest(function(func, args) {
1589
1563
  }
1590
1564
  });
1591
1565
 
1592
- const attempt$1 = attempt;
1593
-
1594
1566
  /**
1595
1567
  * The base implementation of `_.propertyOf` without support for deep paths.
1596
1568
  *
@@ -1802,8 +1774,6 @@ var templateSettings = {
1802
1774
  }
1803
1775
  };
1804
1776
 
1805
- const templateSettings$1 = templateSettings;
1806
-
1807
1777
  /** Error message constants. */
1808
1778
  var INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
1809
1779
 
@@ -1950,15 +1920,15 @@ function template(string, options, guard) {
1950
1920
  // Based on John Resig's `tmpl` implementation
1951
1921
  // (http://ejohn.org/blog/javascript-micro-templating/)
1952
1922
  // and Laura Doktorova's doT.js (https://github.com/olado/doT).
1953
- var settings = templateSettings$1.imports._.templateSettings || templateSettings$1;
1923
+ var settings = templateSettings.imports._.templateSettings || templateSettings;
1954
1924
 
1955
1925
  if (guard && isIterateeCall(string, options, guard)) {
1956
1926
  options = undefined;
1957
1927
  }
1958
1928
  string = toString(string);
1959
- options = extendWith({}, options, settings, customDefaultsAssignIn);
1929
+ options = assignInWith({}, options, settings, customDefaultsAssignIn);
1960
1930
 
1961
- var imports = extendWith({}, options.imports, settings.imports, customDefaultsAssignIn),
1931
+ var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
1962
1932
  importsKeys = keys(imports),
1963
1933
  importsValues = baseValues(imports, importsKeys);
1964
1934
 
@@ -2049,7 +2019,7 @@ function template(string, options, guard) {
2049
2019
  source +
2050
2020
  'return __p\n}';
2051
2021
 
2052
- var result = attempt$1(function() {
2022
+ var result = attempt(function() {
2053
2023
  return Function(importsKeys, sourceURL + 'return ' + source)
2054
2024
  .apply(undefined, importsValues);
2055
2025
  });
@@ -2298,7 +2268,7 @@ function isIgnored(pathname) {
2298
2268
  const cwds = nuxt.options._layers?.map((layer2) => layer2.cwd).sort((a, b) => b.length - a.length);
2299
2269
  const layer = cwds?.find((cwd) => pathname.startsWith(cwd));
2300
2270
  const relativePath = relative(layer ?? nuxt.options.rootDir, pathname);
2301
- if (relativePath.startsWith("..")) {
2271
+ if (relativePath[0] === "." && relativePath[1] === ".") {
2302
2272
  return false;
2303
2273
  }
2304
2274
  return !!(relativePath && nuxt._ignore.ignores(relativePath));
@@ -2317,7 +2287,7 @@ function resolveIgnorePatterns(relativePath) {
2317
2287
  }
2318
2288
  }
2319
2289
  if (relativePath) {
2320
- return nuxt._ignorePatterns.map((p) => p.startsWith("*") || p.startsWith("!*") ? p : relative(relativePath, resolve(nuxt.options.rootDir, p)));
2290
+ return nuxt._ignorePatterns.map((p) => p[0] === "*" || p[0] === "!" && p[1] === "*" ? p : relative(relativePath, resolve(nuxt.options.rootDir, p)));
2321
2291
  }
2322
2292
  return nuxt._ignorePatterns;
2323
2293
  }
@@ -2489,7 +2459,7 @@ async function loadNuxtModuleInstance(nuxtModule, nuxt = useNuxt()) {
2489
2459
  continue;
2490
2460
  }
2491
2461
  }
2492
- if (!nuxtModule && error) {
2462
+ if (typeof nuxtModule !== "function" && error) {
2493
2463
  logger.error(`Error while requiring module \`${nuxtModule}\`: ${error}`);
2494
2464
  throw error;
2495
2465
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/kit",
3
- "version": "3.9.0",
3
+ "version": "3.9.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -23,24 +23,24 @@
23
23
  "dist"
24
24
  ],
25
25
  "dependencies": {
26
- "c12": "^1.5.1",
26
+ "c12": "^1.6.1",
27
27
  "consola": "^3.2.3",
28
- "defu": "^6.1.3",
28
+ "defu": "^6.1.4",
29
29
  "globby": "^14.0.0",
30
30
  "hash-sum": "^2.0.0",
31
31
  "ignore": "^5.3.0",
32
32
  "jiti": "^1.21.0",
33
33
  "knitwork": "^1.0.0",
34
- "mlly": "^1.4.2",
35
- "pathe": "^1.1.1",
34
+ "mlly": "^1.5.0",
35
+ "pathe": "^1.1.2",
36
36
  "pkg-types": "^1.0.3",
37
- "scule": "^1.1.1",
37
+ "scule": "^1.2.0",
38
38
  "semver": "^7.5.4",
39
39
  "ufo": "^1.3.2",
40
40
  "unctx": "^2.3.1",
41
- "unimport": "^3.7.0",
41
+ "unimport": "^3.7.1",
42
42
  "untyped": "^1.4.0",
43
- "@nuxt/schema": "3.9.0"
43
+ "@nuxt/schema": "3.9.2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/hash-sum": "1.0.2",
@@ -49,8 +49,8 @@
49
49
  "lodash-es": "4.17.21",
50
50
  "nitropack": "2.8.1",
51
51
  "unbuild": "latest",
52
- "vite": "5.0.10",
53
- "vitest": "1.1.0",
52
+ "vite": "5.0.11",
53
+ "vitest": "1.1.1",
54
54
  "webpack": "5.89.0"
55
55
  },
56
56
  "engines": {