@nuxt/kit 3.4.1 → 3.4.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/dist/index.d.ts +5 -4
- package/dist/index.mjs +10 -5
- package/package.json +13 -8
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Configuration, WebpackPluginInstance } from 'webpack';
|
|
|
5
5
|
import { UserConfig, Plugin } from 'vite';
|
|
6
6
|
import * as unctx_index from 'unctx/index';
|
|
7
7
|
import { NitroRouteConfig, NitroEventHandler, NitroDevEventHandler, Nitro } from 'nitropack';
|
|
8
|
-
import * as
|
|
8
|
+
import * as consola_dist_consola_3fef035a from 'consola/dist/consola-3fef035a';
|
|
9
9
|
import { genSafeVariableName } from 'knitwork';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -16,6 +16,7 @@ declare function defineNuxtModule<OptionsT extends ModuleOptions>(definition: Mo
|
|
|
16
16
|
|
|
17
17
|
/** Installs a module on a Nuxt instance. */
|
|
18
18
|
declare function installModule(moduleToInstall: string | NuxtModule, _inlineOptions?: any, _nuxt?: Nuxt): Promise<void>;
|
|
19
|
+
declare const normalizeModuleTranspilePath: (p: string) => string;
|
|
19
20
|
|
|
20
21
|
interface LoadNuxtConfigOptions extends LoadConfigOptions<NuxtConfig> {
|
|
21
22
|
}
|
|
@@ -302,8 +303,8 @@ declare function updateTemplates(options?: {
|
|
|
302
303
|
filter?: (template: ResolvedNuxtTemplate<any>) => boolean;
|
|
303
304
|
}): Promise<any>;
|
|
304
305
|
|
|
305
|
-
declare const logger:
|
|
306
|
-
declare function useLogger(tag?: string):
|
|
306
|
+
declare const logger: consola_dist_consola_3fef035a.a;
|
|
307
|
+
declare function useLogger(tag?: string): consola_dist_consola_3fef035a.a;
|
|
307
308
|
|
|
308
309
|
/** @deprecated Do not use CJS utils */
|
|
309
310
|
interface ResolveModuleOptions {
|
|
@@ -346,4 +347,4 @@ declare const templateUtils: {
|
|
|
346
347
|
}) => string;
|
|
347
348
|
};
|
|
348
349
|
|
|
349
|
-
export { AddComponentOptions, AddPluginOptions, AddRouteMiddlewareOptions, ExtendConfigOptions, ExtendRouteRulesOptions, ExtendViteConfigOptions, ExtendWebpackConfigOptions, LoadNuxtConfigOptions, LoadNuxtOptions, RequireModuleOptions, ResolveModuleOptions, ResolvePathOptions, Resolver, addComponent, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addServerHandler, addServerPlugin, addTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, compileTemplate, createResolver, defineNuxtModule, extendNuxtSchema, extendPages, extendRouteRules, extendViteConfig, extendWebpackConfig, findPath, getNuxtVersion, hasNuxtCompatibility, importModule, installModule, isIgnored, isNuxt2, isNuxt3, loadNuxt, loadNuxtConfig, logger, normalizePlugin, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveModule, resolvePath, templateUtils, tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateTemplates, useLogger, useNitro, useNuxt };
|
|
350
|
+
export { AddComponentOptions, AddPluginOptions, AddRouteMiddlewareOptions, ExtendConfigOptions, ExtendRouteRulesOptions, ExtendViteConfigOptions, ExtendWebpackConfigOptions, LoadNuxtConfigOptions, LoadNuxtOptions, RequireModuleOptions, ResolveModuleOptions, ResolvePathOptions, Resolver, addComponent, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addServerHandler, addServerPlugin, addTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, compileTemplate, createResolver, defineNuxtModule, extendNuxtSchema, extendPages, extendRouteRules, extendViteConfig, extendWebpackConfig, findPath, getNuxtVersion, hasNuxtCompatibility, importModule, installModule, isIgnored, isNuxt2, isNuxt3, loadNuxt, loadNuxtConfig, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveModule, resolvePath, templateUtils, tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateTemplates, useLogger, useNitro, useNuxt };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { promises, existsSync, readFileSync } from 'node:fs';
|
|
1
|
+
import { promises, existsSync, readFileSync, lstatSync } from 'node:fs';
|
|
2
2
|
import { performance } from 'node:perf_hooks';
|
|
3
3
|
import { defu } from 'defu';
|
|
4
4
|
import { applyDefaults } from 'untyped';
|
|
@@ -259,11 +259,9 @@ function getRequireCacheItem(id) {
|
|
|
259
259
|
function resolveModule(id, opts = {}) {
|
|
260
260
|
return normalize(_require.resolve(id, {
|
|
261
261
|
paths: [].concat(
|
|
262
|
-
// @ts-ignore
|
|
263
262
|
global.__NUXT_PREPATHS__,
|
|
264
263
|
opts.paths || [],
|
|
265
264
|
process.cwd(),
|
|
266
|
-
// @ts-ignore
|
|
267
265
|
global.__NUXT_PATHS__
|
|
268
266
|
).filter(Boolean)
|
|
269
267
|
}));
|
|
@@ -454,7 +452,7 @@ async function installModule(moduleToInstall, _inlineOptions, _nuxt) {
|
|
|
454
452
|
return;
|
|
455
453
|
}
|
|
456
454
|
if (typeof moduleToInstall === "string") {
|
|
457
|
-
nuxt.options.build.transpile.push(moduleToInstall);
|
|
455
|
+
nuxt.options.build.transpile.push(normalizeModuleTranspilePath(moduleToInstall));
|
|
458
456
|
}
|
|
459
457
|
nuxt.options._installedModules = nuxt.options._installedModules || [];
|
|
460
458
|
nuxt.options._installedModules.push({
|
|
@@ -463,6 +461,13 @@ async function installModule(moduleToInstall, _inlineOptions, _nuxt) {
|
|
|
463
461
|
entryPath: typeof moduleToInstall === "string" ? resolveAlias(moduleToInstall) : void 0
|
|
464
462
|
});
|
|
465
463
|
}
|
|
464
|
+
const normalizeModuleTranspilePath = (p) => {
|
|
465
|
+
try {
|
|
466
|
+
p = isAbsolute(p) && lstatSync(p).isFile() ? dirname(p) : p;
|
|
467
|
+
} catch (e) {
|
|
468
|
+
}
|
|
469
|
+
return p.split("node_modules/").pop();
|
|
470
|
+
};
|
|
466
471
|
async function normalizeModule(nuxtModule, inlineOptions) {
|
|
467
472
|
const nuxt = useNuxt();
|
|
468
473
|
if (typeof nuxtModule === "string") {
|
|
@@ -880,4 +885,4 @@ function useNitro() {
|
|
|
880
885
|
return nuxt._nitro;
|
|
881
886
|
}
|
|
882
887
|
|
|
883
|
-
export { addComponent, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addServerHandler, addServerPlugin, addTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, compileTemplate, createResolver, defineNuxtModule, extendNuxtSchema, extendPages, extendRouteRules, extendViteConfig, extendWebpackConfig, findPath, getNuxtVersion, hasNuxtCompatibility, importModule$1 as importModule, installModule, isIgnored, isNuxt2, isNuxt3, loadNuxt, loadNuxtConfig, logger, normalizePlugin, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveModule, resolvePath, templateUtils, tryImportModule$1 as tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateTemplates, useLogger, useNitro, useNuxt };
|
|
888
|
+
export { addComponent, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addServerHandler, addServerPlugin, addTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, compileTemplate, createResolver, defineNuxtModule, extendNuxtSchema, extendPages, extendRouteRules, extendViteConfig, extendWebpackConfig, findPath, getNuxtVersion, hasNuxtCompatibility, importModule$1 as importModule, installModule, isIgnored, isNuxt2, isNuxt3, loadNuxt, loadNuxtConfig, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveModule, resolvePath, templateUtils, tryImportModule$1 as tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateTemplates, useLogger, useNitro, useNuxt };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/kit",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.3",
|
|
4
4
|
"repository": "nuxt/nuxt",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"c12": "^1.
|
|
21
|
-
"consola": "^3.0
|
|
20
|
+
"c12": "^1.4.1",
|
|
21
|
+
"consola": "^3.1.0",
|
|
22
22
|
"defu": "^6.1.2",
|
|
23
23
|
"globby": "^13.1.4",
|
|
24
24
|
"hash-sum": "^2.0.0",
|
|
@@ -30,19 +30,24 @@
|
|
|
30
30
|
"pathe": "^1.1.0",
|
|
31
31
|
"pkg-types": "^1.0.2",
|
|
32
32
|
"scule": "^1.0.0",
|
|
33
|
-
"semver": "^7.
|
|
34
|
-
"unctx": "^2.
|
|
33
|
+
"semver": "^7.5.0",
|
|
34
|
+
"unctx": "^2.3.0",
|
|
35
35
|
"unimport": "^3.0.6",
|
|
36
36
|
"untyped": "^1.3.2",
|
|
37
|
-
"@nuxt/schema": "3.4.
|
|
37
|
+
"@nuxt/schema": "3.4.3"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
+
"@types/hash-sum": "^1.0.0",
|
|
40
41
|
"@types/lodash.template": "^4.5.1",
|
|
41
42
|
"@types/semver": "^7.3.13",
|
|
42
|
-
"
|
|
43
|
+
"nitropack": "^2.3.3",
|
|
44
|
+
"unbuild": "latest",
|
|
45
|
+
"vite": "^4.3.3",
|
|
46
|
+
"vitest": "^0.30.1",
|
|
47
|
+
"webpack": "^5.81.0"
|
|
43
48
|
},
|
|
44
49
|
"engines": {
|
|
45
|
-
"node": "^14.18.0 ||
|
|
50
|
+
"node": "^14.18.0 || >=16.10.0"
|
|
46
51
|
},
|
|
47
52
|
"scripts": {}
|
|
48
53
|
}
|