@nuxt/kit
Advanced tools
+78
-10
@@ -10,2 +10,3 @@ import * as _nuxt_schema from '@nuxt/schema'; | ||
| import { NitroRouteConfig, NitroEventHandler, NitroDevEventHandler, Nitro } from 'nitropack'; | ||
| import { GlobOptions } from 'tinyglobby'; | ||
| import * as consola from 'consola'; | ||
@@ -24,6 +25,18 @@ import { ConsolaOptions } from 'consola'; | ||
| /** Installs a module on a Nuxt instance. */ | ||
| type ModuleToInstall = string | NuxtModule<ModuleOptions, Partial<ModuleOptions>, false>; | ||
| /** | ||
| * Installs a set of modules on a Nuxt instance. | ||
| * @internal | ||
| */ | ||
| declare function installModules(modulesToInstall: Map<ModuleToInstall, Record<string, any>>, resolvedModulePaths: Set<string>, nuxt?: Nuxt): Promise<void>; | ||
| /** | ||
| * Installs a module on a Nuxt instance. | ||
| * @deprecated Use module dependencies. | ||
| */ | ||
| declare function installModule<T extends string | NuxtModule, Config extends Extract<NonNullable<NuxtConfig['modules']>[number], [T, any]>>(moduleToInstall: T, inlineOptions?: [Config] extends [never] ? any : Config[1], nuxt?: Nuxt): Promise<void>; | ||
| declare function getDirectory(p: string): string; | ||
| declare const normalizeModuleTranspilePath: (p: string) => string; | ||
| declare function resolveModuleWithOptions(definition: NuxtModule<any> | string | false | undefined | null | [(NuxtModule | string)?, Record<string, any>?], nuxt: Nuxt): { | ||
| resolvedPath?: string; | ||
| module: string | NuxtModule<any>; | ||
| options: Record<string, any>; | ||
| } | undefined; | ||
| declare function loadNuxtModuleInstance(nuxtModule: string | NuxtModule, nuxt?: Nuxt): Promise<{ | ||
@@ -34,2 +47,4 @@ nuxtModule: NuxtModule<any>; | ||
| }>; | ||
| declare function getDirectory(p: string): string; | ||
| declare const normalizeModuleTranspilePath: (p: string) => string; | ||
@@ -74,2 +89,37 @@ /** | ||
| interface LayerDirectories { | ||
| /** Nuxt rootDir (`/` by default) */ | ||
| readonly root: string; | ||
| /** Nitro source directory (`/server` by default) */ | ||
| readonly server: string; | ||
| /** Local modules directory (`/modules` by default) */ | ||
| readonly modules: string; | ||
| /** Shared directory (`/shared` by default) */ | ||
| readonly shared: string; | ||
| /** Public directory (`/public` by default) */ | ||
| readonly public: string; | ||
| /** Nuxt srcDir (`/app/` by default) */ | ||
| readonly app: string; | ||
| /** Layouts directory (`/app/layouts` by default) */ | ||
| readonly appLayouts: string; | ||
| /** Middleware directory (`/app/middleware` by default) */ | ||
| readonly appMiddleware: string; | ||
| /** Pages directory (`/app/pages` by default) */ | ||
| readonly appPages: string; | ||
| /** Plugins directory (`/app/plugins` by default) */ | ||
| readonly appPlugins: string; | ||
| } | ||
| /** | ||
| * Get the resolved directory paths for all layers in a Nuxt application. | ||
| * | ||
| * Returns an array of LayerDirectories objects, ordered by layer priority: | ||
| * - The first layer is the user/project layer (highest priority) | ||
| * - Earlier layers override later layers in the array | ||
| * - Base layers appear last in the array (lowest priority) | ||
| * | ||
| * @param nuxt - The Nuxt instance to get layers from. Defaults to the current Nuxt context. | ||
| * @returns Array of LayerDirectories objects, ordered by priority (user layer first) | ||
| */ | ||
| declare function getLayerDirectories(nuxt?: _nuxt_schema.Nuxt): LayerDirectories[]; | ||
| declare function addImports(imports: Import | Import[]): void; | ||
@@ -311,3 +361,8 @@ declare function addImportsDir(dirs: string | string[], opts?: { | ||
| alias?: Record<string, string>; | ||
| /** The file extensions to try. Default is Nuxt configured extensions. */ | ||
| /** | ||
| * The file extensions to try. | ||
| * Default is Nuxt configured extensions. | ||
| * | ||
| * Isn't considered when `type` is set to `'dir'`. | ||
| */ | ||
| extensions?: string[]; | ||
@@ -321,11 +376,16 @@ /** | ||
| * Whether to fallback to the original path if the resolved path does not exist instead of returning the normalized input path. | ||
| * | ||
| * @default false | ||
| */ | ||
| fallbackToOriginal?: boolean; | ||
| /** | ||
| * The type of the path to be resolved. | ||
| * @default 'file' | ||
| */ | ||
| type?: PathType; | ||
| } | ||
| /** | ||
| * Resolve full path to a file or directory respecting Nuxt alias and extensions options | ||
| * Resolve the full path to a file or a directory (based on the provided type), respecting Nuxt alias and extensions options. | ||
| * | ||
| * If path could not be resolved, normalized input path will be returned | ||
| * If a path cannot be resolved, normalized input will be returned unless the `fallbackToOriginal` option is set to `true`, | ||
| * in which case the original input path will be returned. | ||
| */ | ||
@@ -336,3 +396,3 @@ declare function resolvePath(path: string, opts?: ResolvePathOptions): Promise<string>; | ||
| */ | ||
| declare function findPath(paths: string | string[], opts?: ResolvePathOptions, pathType?: 'file' | 'dir'): Promise<string | null>; | ||
| declare function findPath(paths: string | string[], opts?: ResolvePathOptions, pathType?: PathType): Promise<string | null>; | ||
| /** | ||
@@ -351,4 +411,12 @@ * Resolve path aliases respecting Nuxt alias options | ||
| declare function resolveNuxtModule(base: string, paths: string[]): Promise<string[]>; | ||
| type PathType = 'file' | 'dir'; | ||
| /** | ||
| * Resolve absolute file paths in the provided directory with respect to `.nuxtignore` and return them sorted. | ||
| * @param path path to the directory to resolve files in | ||
| * @param pattern glob pattern or an array of glob patterns to match files | ||
| * @param opts options for globbing | ||
| */ | ||
| declare function resolveFiles(path: string, pattern: string | string[], opts?: { | ||
| followSymbolicLinks?: boolean; | ||
| ignore?: GlobOptions['ignore']; | ||
| }): Promise<string[]>; | ||
@@ -486,3 +554,3 @@ | ||
| export { addBuildPlugin, addComponent, addComponentExports, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addRspackPlugin, addServerHandler, addServerImports, addServerImportsDir, addServerPlugin, addServerScanDir, addServerTemplate, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, compileTemplate, createIsIgnored, createResolver, defineNuxtModule, directoryToURL, extendNuxtSchema, extendPages, extendRouteRules, extendRspackConfig, extendViteConfig, extendWebpackConfig, findPath, getDirectory, getNuxtCtx, getNuxtModuleVersion, getNuxtVersion, hasNuxtCompatibility, hasNuxtModule, hasNuxtModuleCompatibility, importModule, installModule, isIgnored, isNuxt2, isNuxt3, isNuxtMajorVersion, loadNuxt, loadNuxtConfig, loadNuxtModuleInstance, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeSemanticVersion, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveIgnorePatterns, resolveModule, resolveNuxtModule, resolvePath, runWithNuxtContext, templateUtils, tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateRuntimeConfig, updateTemplates, useLogger, useNitro, useNuxt, useRuntimeConfig, writeTypes }; | ||
| export type { AddComponentOptions, AddPluginOptions, AddRouteMiddlewareOptions, ExtendConfigOptions, ExtendRouteRulesOptions, ExtendViteConfigOptions, ExtendWebpackConfigOptions, ImportModuleOptions, LoadNuxtConfigOptions, LoadNuxtOptions, ResolveModuleOptions, ResolvePathOptions, Resolver }; | ||
| export { addBuildPlugin, addComponent, addComponentExports, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addRspackPlugin, addServerHandler, addServerImports, addServerImportsDir, addServerPlugin, addServerScanDir, addServerTemplate, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, compileTemplate, createIsIgnored, createResolver, defineNuxtModule, directoryToURL, extendNuxtSchema, extendPages, extendRouteRules, extendRspackConfig, extendViteConfig, extendWebpackConfig, findPath, getDirectory, getLayerDirectories, getNuxtCtx, getNuxtModuleVersion, getNuxtVersion, hasNuxtCompatibility, hasNuxtModule, hasNuxtModuleCompatibility, importModule, installModule, installModules, isIgnored, isNuxt2, isNuxt3, isNuxtMajorVersion, loadNuxt, loadNuxtConfig, loadNuxtModuleInstance, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeSemanticVersion, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveIgnorePatterns, resolveModule, resolveModuleWithOptions, resolveNuxtModule, resolvePath, runWithNuxtContext, templateUtils, tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateRuntimeConfig, updateTemplates, useLogger, useNitro, useNuxt, useRuntimeConfig, writeTypes }; | ||
| export type { AddComponentOptions, AddPluginOptions, AddRouteMiddlewareOptions, ExtendConfigOptions, ExtendRouteRulesOptions, ExtendViteConfigOptions, ExtendWebpackConfigOptions, ImportModuleOptions, LayerDirectories, LoadNuxtConfigOptions, LoadNuxtOptions, ResolveModuleOptions, ResolvePathOptions, Resolver }; |
+78
-10
@@ -10,2 +10,3 @@ import * as _nuxt_schema from '@nuxt/schema'; | ||
| import { NitroRouteConfig, NitroEventHandler, NitroDevEventHandler, Nitro } from 'nitropack'; | ||
| import { GlobOptions } from 'tinyglobby'; | ||
| import * as consola from 'consola'; | ||
@@ -24,6 +25,18 @@ import { ConsolaOptions } from 'consola'; | ||
| /** Installs a module on a Nuxt instance. */ | ||
| type ModuleToInstall = string | NuxtModule<ModuleOptions, Partial<ModuleOptions>, false>; | ||
| /** | ||
| * Installs a set of modules on a Nuxt instance. | ||
| * @internal | ||
| */ | ||
| declare function installModules(modulesToInstall: Map<ModuleToInstall, Record<string, any>>, resolvedModulePaths: Set<string>, nuxt?: Nuxt): Promise<void>; | ||
| /** | ||
| * Installs a module on a Nuxt instance. | ||
| * @deprecated Use module dependencies. | ||
| */ | ||
| declare function installModule<T extends string | NuxtModule, Config extends Extract<NonNullable<NuxtConfig['modules']>[number], [T, any]>>(moduleToInstall: T, inlineOptions?: [Config] extends [never] ? any : Config[1], nuxt?: Nuxt): Promise<void>; | ||
| declare function getDirectory(p: string): string; | ||
| declare const normalizeModuleTranspilePath: (p: string) => string; | ||
| declare function resolveModuleWithOptions(definition: NuxtModule<any> | string | false | undefined | null | [(NuxtModule | string)?, Record<string, any>?], nuxt: Nuxt): { | ||
| resolvedPath?: string; | ||
| module: string | NuxtModule<any>; | ||
| options: Record<string, any>; | ||
| } | undefined; | ||
| declare function loadNuxtModuleInstance(nuxtModule: string | NuxtModule, nuxt?: Nuxt): Promise<{ | ||
@@ -34,2 +47,4 @@ nuxtModule: NuxtModule<any>; | ||
| }>; | ||
| declare function getDirectory(p: string): string; | ||
| declare const normalizeModuleTranspilePath: (p: string) => string; | ||
@@ -74,2 +89,37 @@ /** | ||
| interface LayerDirectories { | ||
| /** Nuxt rootDir (`/` by default) */ | ||
| readonly root: string; | ||
| /** Nitro source directory (`/server` by default) */ | ||
| readonly server: string; | ||
| /** Local modules directory (`/modules` by default) */ | ||
| readonly modules: string; | ||
| /** Shared directory (`/shared` by default) */ | ||
| readonly shared: string; | ||
| /** Public directory (`/public` by default) */ | ||
| readonly public: string; | ||
| /** Nuxt srcDir (`/app/` by default) */ | ||
| readonly app: string; | ||
| /** Layouts directory (`/app/layouts` by default) */ | ||
| readonly appLayouts: string; | ||
| /** Middleware directory (`/app/middleware` by default) */ | ||
| readonly appMiddleware: string; | ||
| /** Pages directory (`/app/pages` by default) */ | ||
| readonly appPages: string; | ||
| /** Plugins directory (`/app/plugins` by default) */ | ||
| readonly appPlugins: string; | ||
| } | ||
| /** | ||
| * Get the resolved directory paths for all layers in a Nuxt application. | ||
| * | ||
| * Returns an array of LayerDirectories objects, ordered by layer priority: | ||
| * - The first layer is the user/project layer (highest priority) | ||
| * - Earlier layers override later layers in the array | ||
| * - Base layers appear last in the array (lowest priority) | ||
| * | ||
| * @param nuxt - The Nuxt instance to get layers from. Defaults to the current Nuxt context. | ||
| * @returns Array of LayerDirectories objects, ordered by priority (user layer first) | ||
| */ | ||
| declare function getLayerDirectories(nuxt?: _nuxt_schema.Nuxt): LayerDirectories[]; | ||
| declare function addImports(imports: Import | Import[]): void; | ||
@@ -311,3 +361,8 @@ declare function addImportsDir(dirs: string | string[], opts?: { | ||
| alias?: Record<string, string>; | ||
| /** The file extensions to try. Default is Nuxt configured extensions. */ | ||
| /** | ||
| * The file extensions to try. | ||
| * Default is Nuxt configured extensions. | ||
| * | ||
| * Isn't considered when `type` is set to `'dir'`. | ||
| */ | ||
| extensions?: string[]; | ||
@@ -321,11 +376,16 @@ /** | ||
| * Whether to fallback to the original path if the resolved path does not exist instead of returning the normalized input path. | ||
| * | ||
| * @default false | ||
| */ | ||
| fallbackToOriginal?: boolean; | ||
| /** | ||
| * The type of the path to be resolved. | ||
| * @default 'file' | ||
| */ | ||
| type?: PathType; | ||
| } | ||
| /** | ||
| * Resolve full path to a file or directory respecting Nuxt alias and extensions options | ||
| * Resolve the full path to a file or a directory (based on the provided type), respecting Nuxt alias and extensions options. | ||
| * | ||
| * If path could not be resolved, normalized input path will be returned | ||
| * If a path cannot be resolved, normalized input will be returned unless the `fallbackToOriginal` option is set to `true`, | ||
| * in which case the original input path will be returned. | ||
| */ | ||
@@ -336,3 +396,3 @@ declare function resolvePath(path: string, opts?: ResolvePathOptions): Promise<string>; | ||
| */ | ||
| declare function findPath(paths: string | string[], opts?: ResolvePathOptions, pathType?: 'file' | 'dir'): Promise<string | null>; | ||
| declare function findPath(paths: string | string[], opts?: ResolvePathOptions, pathType?: PathType): Promise<string | null>; | ||
| /** | ||
@@ -351,4 +411,12 @@ * Resolve path aliases respecting Nuxt alias options | ||
| declare function resolveNuxtModule(base: string, paths: string[]): Promise<string[]>; | ||
| type PathType = 'file' | 'dir'; | ||
| /** | ||
| * Resolve absolute file paths in the provided directory with respect to `.nuxtignore` and return them sorted. | ||
| * @param path path to the directory to resolve files in | ||
| * @param pattern glob pattern or an array of glob patterns to match files | ||
| * @param opts options for globbing | ||
| */ | ||
| declare function resolveFiles(path: string, pattern: string | string[], opts?: { | ||
| followSymbolicLinks?: boolean; | ||
| ignore?: GlobOptions['ignore']; | ||
| }): Promise<string[]>; | ||
@@ -486,3 +554,3 @@ | ||
| export { addBuildPlugin, addComponent, addComponentExports, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addRspackPlugin, addServerHandler, addServerImports, addServerImportsDir, addServerPlugin, addServerScanDir, addServerTemplate, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, compileTemplate, createIsIgnored, createResolver, defineNuxtModule, directoryToURL, extendNuxtSchema, extendPages, extendRouteRules, extendRspackConfig, extendViteConfig, extendWebpackConfig, findPath, getDirectory, getNuxtCtx, getNuxtModuleVersion, getNuxtVersion, hasNuxtCompatibility, hasNuxtModule, hasNuxtModuleCompatibility, importModule, installModule, isIgnored, isNuxt2, isNuxt3, isNuxtMajorVersion, loadNuxt, loadNuxtConfig, loadNuxtModuleInstance, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeSemanticVersion, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveIgnorePatterns, resolveModule, resolveNuxtModule, resolvePath, runWithNuxtContext, templateUtils, tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateRuntimeConfig, updateTemplates, useLogger, useNitro, useNuxt, useRuntimeConfig, writeTypes }; | ||
| export type { AddComponentOptions, AddPluginOptions, AddRouteMiddlewareOptions, ExtendConfigOptions, ExtendRouteRulesOptions, ExtendViteConfigOptions, ExtendWebpackConfigOptions, ImportModuleOptions, LoadNuxtConfigOptions, LoadNuxtOptions, ResolveModuleOptions, ResolvePathOptions, Resolver }; | ||
| export { addBuildPlugin, addComponent, addComponentExports, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addRspackPlugin, addServerHandler, addServerImports, addServerImportsDir, addServerPlugin, addServerScanDir, addServerTemplate, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, compileTemplate, createIsIgnored, createResolver, defineNuxtModule, directoryToURL, extendNuxtSchema, extendPages, extendRouteRules, extendRspackConfig, extendViteConfig, extendWebpackConfig, findPath, getDirectory, getLayerDirectories, getNuxtCtx, getNuxtModuleVersion, getNuxtVersion, hasNuxtCompatibility, hasNuxtModule, hasNuxtModuleCompatibility, importModule, installModule, installModules, isIgnored, isNuxt2, isNuxt3, isNuxtMajorVersion, loadNuxt, loadNuxtConfig, loadNuxtModuleInstance, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeSemanticVersion, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveIgnorePatterns, resolveModule, resolveModuleWithOptions, resolveNuxtModule, resolvePath, runWithNuxtContext, templateUtils, tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateRuntimeConfig, updateTemplates, useLogger, useNitro, useNuxt, useRuntimeConfig, writeTypes }; | ||
| export type { AddComponentOptions, AddPluginOptions, AddRouteMiddlewareOptions, ExtendConfigOptions, ExtendRouteRulesOptions, ExtendViteConfigOptions, ExtendWebpackConfigOptions, ImportModuleOptions, LayerDirectories, LoadNuxtConfigOptions, LoadNuxtOptions, ResolveModuleOptions, ResolvePathOptions, Resolver }; |
+9
-8
| { | ||
| "name": "@nuxt/kit", | ||
| "version": "3.18.1", | ||
| "version": "3.19.0", | ||
| "repository": { | ||
@@ -36,6 +36,7 @@ "type": "git", | ||
| "knitwork": "^1.2.0", | ||
| "mlly": "^1.7.4", | ||
| "mlly": "^1.8.0", | ||
| "ohash": "^2.0.11", | ||
| "pathe": "^2.0.3", | ||
| "pkg-types": "^2.2.0", | ||
| "pkg-types": "^2.3.0", | ||
| "rc9": "^2.1.2", | ||
| "scule": "^1.3.0", | ||
@@ -51,3 +52,3 @@ "semver": "^7.7.2", | ||
| "devDependencies": { | ||
| "@rspack/core": "1.4.11", | ||
| "@rspack/core": "1.5.2", | ||
| "@types/lodash-es": "4.17.12", | ||
@@ -58,7 +59,7 @@ "@types/semver": "7.7.0", | ||
| "nitropack": "2.12.4", | ||
| "unbuild": "3.6.0", | ||
| "vite": "7.0.6", | ||
| "unbuild": "3.6.1", | ||
| "vite": "7.1.4", | ||
| "vitest": "3.2.4", | ||
| "webpack": "5.101.0", | ||
| "@nuxt/schema": "3.18.1" | ||
| "webpack": "5.101.3", | ||
| "@nuxt/schema": "3.19.0" | ||
| }, | ||
@@ -65,0 +66,0 @@ "engines": { |
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
174825
9.74%4045
7.75%19
-9.52%23
4.55%+ Added
Updated
Updated