@nuxt/kit 3.8.0 → 3.8.1
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 +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +11 -11
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -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 function getDirectory(p: string): string;
|
|
19
20
|
declare const normalizeModuleTranspilePath: (p: string) => string;
|
|
20
21
|
declare function loadNuxtModuleInstance(nuxtModule: string | NuxtModule, nuxt?: Nuxt): Promise<{
|
|
21
22
|
nuxtModule: NuxtModule<any>;
|
|
@@ -316,7 +317,7 @@ declare function useNitro(): Nitro;
|
|
|
316
317
|
*/
|
|
317
318
|
declare function addServerImports(imports: Import[]): void;
|
|
318
319
|
/**
|
|
319
|
-
* Add directories to be scanned by Nitro
|
|
320
|
+
* Add directories to be scanned for auto-imports by Nitro
|
|
320
321
|
*/
|
|
321
322
|
declare function addServerImportsDir(dirs: string | string[], opts?: {
|
|
322
323
|
prepend?: boolean;
|
|
@@ -389,4 +390,4 @@ declare const templateUtils: {
|
|
|
389
390
|
}) => string;
|
|
390
391
|
};
|
|
391
392
|
|
|
392
|
-
export { type AddComponentOptions, type AddPluginOptions, type AddRouteMiddlewareOptions, type ExtendConfigOptions, type ExtendRouteRulesOptions, type ExtendViteConfigOptions, type ExtendWebpackConfigOptions, type LoadNuxtConfigOptions, type LoadNuxtOptions, type RequireModuleOptions, type ResolveModuleOptions, type ResolvePathOptions, type Resolver, addBuildPlugin, addComponent, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addServerHandler, addServerImports, addServerImportsDir, addServerPlugin, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, compileTemplate, createResolver, defineNuxtModule, extendNuxtSchema, extendPages, extendRouteRules, extendViteConfig, extendWebpackConfig, findPath, getNuxtModuleVersion, getNuxtVersion, hasNuxtCompatibility, hasNuxtModule, hasNuxtModuleCompatibility, importModule, installModule, isIgnored, isNuxt2, isNuxt3, loadNuxt, loadNuxtConfig, loadNuxtModuleInstance, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeSemanticVersion, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveIgnorePatterns, resolveModule, resolveNuxtModule, resolvePath, templateUtils, tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateTemplates, useLogger, useNitro, useNuxt, writeTypes };
|
|
393
|
+
export { type AddComponentOptions, type AddPluginOptions, type AddRouteMiddlewareOptions, type ExtendConfigOptions, type ExtendRouteRulesOptions, type ExtendViteConfigOptions, type ExtendWebpackConfigOptions, type LoadNuxtConfigOptions, type LoadNuxtOptions, type RequireModuleOptions, type ResolveModuleOptions, type ResolvePathOptions, type Resolver, addBuildPlugin, addComponent, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addServerHandler, addServerImports, addServerImportsDir, addServerPlugin, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, compileTemplate, createResolver, defineNuxtModule, extendNuxtSchema, extendPages, extendRouteRules, extendViteConfig, extendWebpackConfig, findPath, getDirectory, getNuxtModuleVersion, getNuxtVersion, hasNuxtCompatibility, hasNuxtModule, hasNuxtModuleCompatibility, importModule, installModule, isIgnored, isNuxt2, isNuxt3, loadNuxt, loadNuxtConfig, loadNuxtModuleInstance, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeSemanticVersion, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveIgnorePatterns, resolveModule, resolveNuxtModule, resolvePath, templateUtils, tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateTemplates, useLogger, useNitro, useNuxt, writeTypes };
|
package/dist/index.d.ts
CHANGED
|
@@ -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 function getDirectory(p: string): string;
|
|
19
20
|
declare const normalizeModuleTranspilePath: (p: string) => string;
|
|
20
21
|
declare function loadNuxtModuleInstance(nuxtModule: string | NuxtModule, nuxt?: Nuxt): Promise<{
|
|
21
22
|
nuxtModule: NuxtModule<any>;
|
|
@@ -316,7 +317,7 @@ declare function useNitro(): Nitro;
|
|
|
316
317
|
*/
|
|
317
318
|
declare function addServerImports(imports: Import[]): void;
|
|
318
319
|
/**
|
|
319
|
-
* Add directories to be scanned by Nitro
|
|
320
|
+
* Add directories to be scanned for auto-imports by Nitro
|
|
320
321
|
*/
|
|
321
322
|
declare function addServerImportsDir(dirs: string | string[], opts?: {
|
|
322
323
|
prepend?: boolean;
|
|
@@ -389,4 +390,4 @@ declare const templateUtils: {
|
|
|
389
390
|
}) => string;
|
|
390
391
|
};
|
|
391
392
|
|
|
392
|
-
export { type AddComponentOptions, type AddPluginOptions, type AddRouteMiddlewareOptions, type ExtendConfigOptions, type ExtendRouteRulesOptions, type ExtendViteConfigOptions, type ExtendWebpackConfigOptions, type LoadNuxtConfigOptions, type LoadNuxtOptions, type RequireModuleOptions, type ResolveModuleOptions, type ResolvePathOptions, type Resolver, addBuildPlugin, addComponent, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addServerHandler, addServerImports, addServerImportsDir, addServerPlugin, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, compileTemplate, createResolver, defineNuxtModule, extendNuxtSchema, extendPages, extendRouteRules, extendViteConfig, extendWebpackConfig, findPath, getNuxtModuleVersion, getNuxtVersion, hasNuxtCompatibility, hasNuxtModule, hasNuxtModuleCompatibility, importModule, installModule, isIgnored, isNuxt2, isNuxt3, loadNuxt, loadNuxtConfig, loadNuxtModuleInstance, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeSemanticVersion, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveIgnorePatterns, resolveModule, resolveNuxtModule, resolvePath, templateUtils, tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateTemplates, useLogger, useNitro, useNuxt, writeTypes };
|
|
393
|
+
export { type AddComponentOptions, type AddPluginOptions, type AddRouteMiddlewareOptions, type ExtendConfigOptions, type ExtendRouteRulesOptions, type ExtendViteConfigOptions, type ExtendWebpackConfigOptions, type LoadNuxtConfigOptions, type LoadNuxtOptions, type RequireModuleOptions, type ResolveModuleOptions, type ResolvePathOptions, type Resolver, addBuildPlugin, addComponent, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addServerHandler, addServerImports, addServerImportsDir, addServerPlugin, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, compileTemplate, createResolver, defineNuxtModule, extendNuxtSchema, extendPages, extendRouteRules, extendViteConfig, extendWebpackConfig, findPath, getDirectory, getNuxtModuleVersion, getNuxtVersion, hasNuxtCompatibility, hasNuxtModule, hasNuxtModuleCompatibility, importModule, installModule, isIgnored, isNuxt2, isNuxt3, loadNuxt, loadNuxtConfig, loadNuxtModuleInstance, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeSemanticVersion, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveIgnorePatterns, resolveModule, resolveNuxtModule, resolvePath, templateUtils, tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateTemplates, useLogger, useNitro, useNuxt, writeTypes };
|
package/dist/index.mjs
CHANGED
|
@@ -2814,11 +2814,11 @@ async function updateTemplates(options) {
|
|
|
2814
2814
|
return await tryUseNuxt()?.hooks.callHook("builder:generateApp", options);
|
|
2815
2815
|
}
|
|
2816
2816
|
async function writeTypes(nuxt) {
|
|
2817
|
-
const
|
|
2817
|
+
const nodeModulePaths = getModulePaths(nuxt.options.modulesDir);
|
|
2818
2818
|
const rootDirWithSlash = withTrailingSlash(nuxt.options.rootDir);
|
|
2819
|
-
const
|
|
2819
|
+
const modulePaths = await resolveNuxtModule(
|
|
2820
2820
|
rootDirWithSlash,
|
|
2821
|
-
nuxt.options._installedModules.filter((m) => m.entryPath).map((m) => m.entryPath)
|
|
2821
|
+
nuxt.options._installedModules.filter((m) => m.entryPath).map((m) => getDirectory(m.entryPath))
|
|
2822
2822
|
);
|
|
2823
2823
|
const tsConfig = defu(nuxt.options.typescript?.tsConfig, {
|
|
2824
2824
|
compilerOptions: {
|
|
@@ -2848,11 +2848,11 @@ async function writeTypes(nuxt) {
|
|
|
2848
2848
|
...nuxt.options.srcDir !== nuxt.options.rootDir ? [join(relative(nuxt.options.buildDir, nuxt.options.srcDir), "**/*")] : [],
|
|
2849
2849
|
...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), "**/*")),
|
|
2850
2850
|
...nuxt.options.typescript.includeWorkspace && nuxt.options.workspaceDir !== nuxt.options.rootDir ? [join(relative(nuxt.options.buildDir, nuxt.options.workspaceDir), "**/*")] : [],
|
|
2851
|
-
...
|
|
2851
|
+
...modulePaths.map((m) => join(relativeWithDot(nuxt.options.buildDir, m), "runtime"))
|
|
2852
2852
|
],
|
|
2853
2853
|
exclude: [
|
|
2854
2854
|
...nuxt.options.modulesDir.map((m) => relativeWithDot(nuxt.options.buildDir, m)),
|
|
2855
|
-
...
|
|
2855
|
+
...modulePaths.map((m) => join(relativeWithDot(nuxt.options.buildDir, m), "runtime/server")),
|
|
2856
2856
|
// nitro generate output: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/core/nitro.ts#L186
|
|
2857
2857
|
relativeWithDot(nuxt.options.buildDir, resolve(nuxt.options.rootDir, "dist"))
|
|
2858
2858
|
]
|
|
@@ -2899,7 +2899,7 @@ async function writeTypes(nuxt) {
|
|
|
2899
2899
|
const references = await Promise.all([
|
|
2900
2900
|
...nuxt.options.modules,
|
|
2901
2901
|
...nuxt.options._modules
|
|
2902
|
-
].filter((f) => typeof f === "string").map(async (id) => ({ types: (await readPackageJSON(id, { url:
|
|
2902
|
+
].filter((f) => typeof f === "string").map(async (id) => ({ types: (await readPackageJSON(id, { url: nodeModulePaths }).catch(() => null))?.name || id })));
|
|
2903
2903
|
if (nuxt.options.experimental?.reactivityTransform) {
|
|
2904
2904
|
references.push({ types: "vue/macros-global" });
|
|
2905
2905
|
}
|
|
@@ -3109,12 +3109,12 @@ function addServerImports(imports) {
|
|
|
3109
3109
|
}
|
|
3110
3110
|
function addServerImportsDir(dirs, opts = {}) {
|
|
3111
3111
|
const nuxt = useNuxt();
|
|
3112
|
+
const _dirs = Array.isArray(dirs) ? dirs : [dirs];
|
|
3112
3113
|
nuxt.hook("nitro:config", (config) => {
|
|
3113
|
-
config.
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
}
|
|
3114
|
+
config.imports = config.imports || {};
|
|
3115
|
+
config.imports.dirs = config.imports.dirs || [];
|
|
3116
|
+
config.imports.dirs[opts.prepend ? "unshift" : "push"](..._dirs);
|
|
3117
3117
|
});
|
|
3118
3118
|
}
|
|
3119
3119
|
|
|
3120
|
-
export { addBuildPlugin, addComponent, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addServerHandler, addServerImports, addServerImportsDir, addServerPlugin, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, compileTemplate, createResolver, defineNuxtModule, extendNuxtSchema, extendPages, extendRouteRules, extendViteConfig, extendWebpackConfig, findPath, getNuxtModuleVersion, getNuxtVersion, hasNuxtCompatibility, hasNuxtModule, hasNuxtModuleCompatibility, importModule$1 as importModule, installModule, isIgnored, isNuxt2, isNuxt3, loadNuxt, loadNuxtConfig, loadNuxtModuleInstance, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeSemanticVersion, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveIgnorePatterns, resolveModule, resolveNuxtModule, resolvePath, templateUtils, tryImportModule$1 as tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateTemplates, useLogger, useNitro, useNuxt, writeTypes };
|
|
3120
|
+
export { addBuildPlugin, addComponent, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addServerHandler, addServerImports, addServerImportsDir, addServerPlugin, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, compileTemplate, createResolver, defineNuxtModule, extendNuxtSchema, extendPages, extendRouteRules, extendViteConfig, extendWebpackConfig, findPath, getDirectory, getNuxtModuleVersion, getNuxtVersion, hasNuxtCompatibility, hasNuxtModule, hasNuxtModuleCompatibility, importModule$1 as importModule, installModule, isIgnored, isNuxt2, isNuxt3, loadNuxt, loadNuxtConfig, loadNuxtModuleInstance, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeSemanticVersion, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveIgnorePatterns, resolveModule, resolveNuxtModule, resolvePath, templateUtils, tryImportModule$1 as tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateTemplates, useLogger, useNitro, useNuxt, writeTypes };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/kit",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.1",
|
|
4
4
|
"repository": "nuxt/nuxt",
|
|
5
5
|
"description": "Toolkit for authoring modules and interacting with Nuxt",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"c12": "^1.5.1",
|
|
22
22
|
"consola": "^3.2.3",
|
|
23
|
-
"defu": "^6.1.
|
|
23
|
+
"defu": "^6.1.3",
|
|
24
24
|
"globby": "^13.2.2",
|
|
25
25
|
"hash-sum": "^2.0.0",
|
|
26
26
|
"ignore": "^5.2.4",
|
|
27
|
-
"jiti": "^1.
|
|
27
|
+
"jiti": "^1.21.0",
|
|
28
28
|
"knitwork": "^1.0.0",
|
|
29
29
|
"mlly": "^1.4.2",
|
|
30
30
|
"pathe": "^1.1.1",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"unctx": "^2.3.1",
|
|
36
36
|
"unimport": "^3.4.0",
|
|
37
37
|
"untyped": "^1.4.0",
|
|
38
|
-
"@nuxt/schema": "3.8.
|
|
38
|
+
"@nuxt/schema": "3.8.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/hash-sum": "1.0.1",
|
|
42
42
|
"@types/lodash-es": "4.17.10",
|
|
43
43
|
"@types/semver": "7.5.4",
|
|
44
44
|
"lodash-es": "4.17.21",
|
|
45
|
-
"nitropack": "2.7.
|
|
45
|
+
"nitropack": "2.7.2",
|
|
46
46
|
"unbuild": "latest",
|
|
47
47
|
"vite": "4.5.0",
|
|
48
48
|
"vitest": "0.33.0",
|