chore(deps): update devdependency eslint-plugin-jsdoc to v46 (main) (#23614)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
renovate[bot] 2023-10-11 13:31:22 +01:00 committed by GitHub
parent d8d0ef561e
commit a5dad0d2e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 19 additions and 215 deletions

View File

@ -51,7 +51,7 @@
"devalue": "4.3.2", "devalue": "4.3.2",
"eslint": "8.51.0", "eslint": "8.51.0",
"eslint-plugin-import": "2.28.1", "eslint-plugin-import": "2.28.1",
"eslint-plugin-jsdoc": "41.1.2", "eslint-plugin-jsdoc": "46.8.2",
"eslint-plugin-no-only-tests": "3.1.0", "eslint-plugin-no-only-tests": "3.1.0",
"execa": "7.2.0", "execa": "7.2.0",
"fs-extra": "11.1.1", "fs-extra": "11.1.1",

View File

@ -5,25 +5,21 @@ import { useNuxt } from './context'
export interface ExtendConfigOptions { export interface ExtendConfigOptions {
/** /**
* Install plugin on dev * Install plugin on dev
*
* @default true * @default true
*/ */
dev?: boolean dev?: boolean
/** /**
* Install plugin on build * Install plugin on build
*
* @default true * @default true
*/ */
build?: boolean build?: boolean
/** /**
* Install plugin on server side * Install plugin on server side
*
* @default true * @default true
*/ */
server?: boolean server?: boolean
/** /**
* Install plugin on client side * Install plugin on client side
*
* @default true * @default true
*/ */
client?: boolean client?: boolean

View File

@ -10,7 +10,6 @@ export const nuxtCtx = getContext<Nuxt>('nuxt')
* Get access to Nuxt instance. * Get access to Nuxt instance.
* *
* Throws an error if Nuxt instance is unavailable. * Throws an error if Nuxt instance is unavailable.
*
* @example * @example
* ```js * ```js
* const nuxt = useNuxt() * const nuxt = useNuxt()
@ -28,7 +27,6 @@ export function useNuxt (): Nuxt {
* Get access to Nuxt instance. * Get access to Nuxt instance.
* *
* Returns null if Nuxt instance is unavailable. * Returns null if Nuxt instance is unavailable.
*
* @example * @example
* ```js * ```js
* const nuxt = tryUseNuxt() * const nuxt = tryUseNuxt()

View File

@ -57,7 +57,6 @@ export function resolveIgnorePatterns (relativePath?: string): string[] {
* This function turns string containing groups '**\/*.{spec,test}.{js,ts}' into an array of strings. * This function turns string containing groups '**\/*.{spec,test}.{js,ts}' into an array of strings.
* For example will '**\/*.{spec,test}.{js,ts}' be resolved to: * For example will '**\/*.{spec,test}.{js,ts}' be resolved to:
* ['**\/*.spec.js', '**\/*.spec.ts', '**\/*.test.js', '**\/*.test.ts'] * ['**\/*.spec.js', '**\/*.spec.ts', '**\/*.test.js', '**\/*.test.ts']
*
* @param group string containing the group syntax * @param group string containing the group syntax
* @returns {string[]} array of strings without the group syntax * @returns {string[]} array of strings without the group syntax
*/ */

View File

@ -67,7 +67,6 @@ export function addPrerenderRoutes (routes: string | string[]) {
* **Note:** You can call `useNitro()` only after `ready` hook. * **Note:** You can call `useNitro()` only after `ready` hook.
* *
* **Note:** Changes to the Nitro instance configuration are not applied. * **Note:** Changes to the Nitro instance configuration are not applied.
*
* @example * @example
* *
* ```ts * ```ts

View File

@ -18,7 +18,6 @@ export function extendPages (cb: NuxtHooks['pages:extend']) {
export interface ExtendRouteRulesOptions { export interface ExtendRouteRulesOptions {
/** /**
* Override route rule config * Override route rule config
*
* @default false * @default false
*/ */
override?: boolean override?: boolean
@ -39,7 +38,6 @@ export function extendRouteRules (route: string, rule: NitroRouteConfig, options
export interface AddRouteMiddlewareOptions { export interface AddRouteMiddlewareOptions {
/** /**
* Override existing middleware with the same name, if it exists * Override existing middleware with the same name, if it exists
*
* @default false * @default false
*/ */
override?: boolean override?: boolean

View File

@ -48,7 +48,6 @@ export function normalizePlugin (plugin: NuxtPlugin | string): NuxtPlugin {
* to use plugin only in client or server side. * to use plugin only in client or server side.
* *
* Note: By default plugin is prepended to the plugins array. You can use second argument to append (push) instead. * Note: By default plugin is prepended to the plugins array. You can use second argument to append (push) instead.
*
* @example * @example
* ```js * ```js
* addPlugin({ * addPlugin({

View File

@ -6,7 +6,6 @@ import destr from 'destr'
/** /**
* Internal utility * Internal utility
*
* @private * @private
*/ */
export const _wrapIf = (component: Component, props: any, slots: any) => { export const _wrapIf = (component: Component, props: any, slots: any) => {
@ -20,7 +19,6 @@ export type SSRBufferItem = string | SSRBuffer | Promise<SSRBuffer>
/** /**
* create buffer retrieved from @vue/server-renderer * create buffer retrieved from @vue/server-renderer
*
* @see https://github.com/vuejs/core/blob/9617dd4b2abc07a5dc40de6e5b759e851b4d0da1/packages/server-renderer/src/render.ts#L57 * @see https://github.com/vuejs/core/blob/9617dd4b2abc07a5dc40de6e5b759e851b4d0da1/packages/server-renderer/src/render.ts#L57
* @private * @private
*/ */
@ -102,7 +100,6 @@ export function vforToArray (source: any): any[] {
/** /**
* Retrieve the HTML content from an element * Retrieve the HTML content from an element
* Handles `<!--[-->` Fragment elements * Handles `<!--[-->` Fragment elements
*
* @param element the element to retrieve the HTML * @param element the element to retrieve the HTML
* @param withoutSlots purge all slots from the HTML string retrieved * @param withoutSlots purge all slots from the HTML string retrieved
* @returns {string[]} An array of string which represent the content of each element. Use `.join('')` to retrieve a component vnode.el HTML * @returns {string[]} An array of string which represent the content of each element. Use `.join('')` to retrieve a component vnode.el HTML

View File

@ -4,26 +4,22 @@ import { useNuxtApp } from '#app/nuxt'
export interface ReloadNuxtAppOptions { export interface ReloadNuxtAppOptions {
/** /**
* Number of milliseconds in which to ignore future reload requests * Number of milliseconds in which to ignore future reload requests
*
* @default {10000} * @default {10000}
*/ */
ttl?: number ttl?: number
/** /**
* Force a reload even if one has occurred within the previously specified TTL. * Force a reload even if one has occurred within the previously specified TTL.
*
* @default {false} * @default {false}
*/ */
force?: boolean force?: boolean
/** /**
* Whether to dump the current Nuxt state to sessionStorage (as `nuxt:reload:state`). * Whether to dump the current Nuxt state to sessionStorage (as `nuxt:reload:state`).
*
* @default {false} * @default {false}
*/ */
persistState?: boolean persistState?: boolean
/** /**
* The path to reload. If this is different from the current window location it will * The path to reload. If this is different from the current window location it will
* trigger a navigation and add an entry in the browser history. * trigger a navigation and add an entry in the browser history.
*
* @default {window.location.pathname} * @default {window.location.pathname}
*/ */
path?: string path?: string

View File

@ -3,7 +3,6 @@ import type { NuxtPayload } from '#app'
/** /**
* Allows full control of the hydration cycle to set and receive data from the server. * Allows full control of the hydration cycle to set and receive data from the server.
*
* @param key a unique key to identify the data in the Nuxt payload * @param key a unique key to identify the data in the Nuxt payload
* @param get a function that returns the value to set the initial data * @param get a function that returns the value to set the initial data
* @param set a function that will receive the data on the client-side * @param set a function that will receive the data on the client-side

View File

@ -5,7 +5,6 @@ import { useRouter } from './router'
/** /**
* Preload a component or components that have been globally registered. * Preload a component or components that have been globally registered.
*
* @param components Pascal-cased name or names of components to prefetch * @param components Pascal-cased name or names of components to prefetch
*/ */
export const preloadComponents = async (components: string | string[]) => { export const preloadComponents = async (components: string | string[]) => {
@ -18,7 +17,6 @@ export const preloadComponents = async (components: string | string[]) => {
/** /**
* Prefetch a component or components that have been globally registered. * Prefetch a component or components that have been globally registered.
*
* @param components Pascal-cased name or names of components to prefetch * @param components Pascal-cased name or names of components to prefetch
*/ */
export const prefetchComponents = (components: string | string[]) => { export const prefetchComponents = (components: string | string[]) => {

View File

@ -5,7 +5,6 @@ import { useNuxtApp } from '../nuxt'
const useStateKeyPrefix = '$s' const useStateKeyPrefix = '$s'
/** /**
* Create a global reactive ref that will be hydrated but not shared across ssr requests * Create a global reactive ref that will be hydrated but not shared across ssr requests
*
* @param key a unique key ensuring that data fetching can be properly de-duplicated across requests * @param key a unique key ensuring that data fetching can be properly de-duplicated across requests
* @param init a function that provides initial value for the state when it's not initiated * @param init a function that provides initial value for the state when it's not initiated
*/ */

View File

@ -163,7 +163,6 @@ export interface PluginEnvContext {
/** /**
* This enable the plugin for islands components. * This enable the plugin for islands components.
* Require `experimental.componentsIslands`. * Require `experimental.componentsIslands`.
*
* @default true * @default true
*/ */
islands?: boolean islands?: boolean
@ -186,7 +185,6 @@ export interface ObjectPlugin<Injections extends Record<string, unknown> = Recor
env?: PluginEnvContext env?: PluginEnvContext
/** /**
* Execute plugin in parallel with other parallel plugins. * Execute plugin in parallel with other parallel plugins.
*
* @default false * @default false
*/ */
parallel?: boolean parallel?: boolean
@ -361,7 +359,6 @@ export function isNuxtPlugin (plugin: unknown) {
/** /**
* Ensures that the setup function passed in has access to the Nuxt instance via `useNuxt`. * Ensures that the setup function passed in has access to the Nuxt instance via `useNuxt`.
*
* @param nuxt A Nuxt instance * @param nuxt A Nuxt instance
* @param setup The function to call * @param setup The function to call
*/ */

View File

@ -11,7 +11,6 @@ import type { Component, ComponentsDir } from 'nuxt/schema'
/** /**
* Scan the components inside different components folders * Scan the components inside different components folders
* and return a unique list of components * and return a unique list of components
*
* @param dirs all folders where components are defined * @param dirs all folders where components are defined
* @param srcDir src path of your app * @param srcDir src path of your app
* @returns {Promise} Component found promise * @returns {Promise} Component found promise
@ -65,7 +64,6 @@ export async function scanComponents (dirs: ComponentsDir[], srcDir: string): Pr
/** /**
* Create an array of prefixes base on the prefix config * Create an array of prefixes base on the prefix config
* Empty prefix will be an empty array * Empty prefix will be an empty array
*
* @example prefix: 'nuxt' -> ['nuxt'] * @example prefix: 'nuxt' -> ['nuxt']
* @example prefix: 'nuxt-test' -> ['nuxt', 'test'] * @example prefix: 'nuxt-test' -> ['nuxt', 'test']
*/ */
@ -76,7 +74,6 @@ export async function scanComponents (dirs: ComponentsDir[], srcDir: string): Pr
/** /**
* In case we have index as filename the component become the parent path * In case we have index as filename the component become the parent path
*
* @example third-components/index.vue -> third-component * @example third-components/index.vue -> third-component
* if not take the filename * if not take the filename
* @example third-components/Awesome.vue -> Awesome * @example third-components/Awesome.vue -> Awesome
@ -163,7 +160,6 @@ export async function scanComponents (dirs: ComponentsDir[], srcDir: string): Pr
export function resolveComponentName (fileName: string, prefixParts: string[]) { export function resolveComponentName (fileName: string, prefixParts: string[]) {
/** /**
* Array of fileName parts splitted by case, / or - * Array of fileName parts splitted by case, / or -
*
* @example third-component -> ['third', 'component'] * @example third-component -> ['third', 'component']
* @example AwesomeComponent -> ['Awesome', 'Component'] * @example AwesomeComponent -> ['Awesome', 'Component']
*/ */

View File

@ -220,7 +220,6 @@ function isComponentNotCalledInSetup (codeAst: Node, name: string): string | voi
/** /**
* retrieve the component identifier being used on ssrRender callExpression * retrieve the component identifier being used on ssrRender callExpression
*
* @param {CallExpression} ssrRenderNode - ssrRender callExpression * @param {CallExpression} ssrRenderNode - ssrRender callExpression
*/ */
function getComponentName (ssrRenderNode: AcornNode<CallExpression>): string { function getComponentName (ssrRenderNode: AcornNode<CallExpression>): string {

View File

@ -5,7 +5,6 @@ import { generateApp as _generateApp } from './app'
/** /**
* Check for those external configuration files that are not compatible with Nuxt, * Check for those external configuration files that are not compatible with Nuxt,
* and warns the user about them. * and warns the user about them.
*
* @see {@link https://nuxt.com/docs/getting-started/configuration#external-configuration-files} * @see {@link https://nuxt.com/docs/getting-started/configuration#external-configuration-files}
*/ */
export async function checkForExternalConfigurationFiles () { export async function checkForExternalConfigurationFiles () {

View File

@ -6,7 +6,6 @@ export default defineUntypedSchema({
* *
* Any components in the directories configured here can be used throughout your * Any components in the directories configured here can be used throughout your
* pages, layouts (and other components) without needing to explicitly import them. * pages, layouts (and other components) without needing to explicitly import them.
*
* @see https://nuxt.com/docs/guide/directory-structure/components * @see https://nuxt.com/docs/guide/directory-structure/components
* @type {boolean | typeof import('../src/types/components').ComponentsOptions | typeof import('../src/types/components').ComponentsOptions['dirs']} * @type {boolean | typeof import('../src/types/components').ComponentsOptions | typeof import('../src/types/components').ComponentsOptions['dirs']}
*/ */
@ -24,7 +23,6 @@ export default defineUntypedSchema({
/** /**
* Configure how Nuxt auto-imports composables into your application. * Configure how Nuxt auto-imports composables into your application.
*
* @see [Nuxt 3 documentation](https://nuxt.com/docs/guide/directory-structure/composables) * @see [Nuxt 3 documentation](https://nuxt.com/docs/guide/directory-structure/composables)
* @type {typeof import('../src/types/imports').ImportsOptions} * @type {typeof import('../src/types/imports').ImportsOptions}
*/ */
@ -34,7 +32,6 @@ export default defineUntypedSchema({
/** /**
* An array of custom directories that will be auto-imported. * An array of custom directories that will be auto-imported.
* Note that this option will not override the default directories (~/composables, ~/utils). * Note that this option will not override the default directories (~/composables, ~/utils).
*
* @example * @example
* ```js * ```js
* imports: { * imports: {
@ -49,14 +46,12 @@ export default defineUntypedSchema({
/** /**
* Whether to use the vue-router integration in Nuxt 3. If you do not provide a value it will be * Whether to use the vue-router integration in Nuxt 3. If you do not provide a value it will be
* enabled if you have a `pages/` directory in your source folder. * enabled if you have a `pages/` directory in your source folder.
*
* @type {boolean} * @type {boolean}
*/ */
pages: undefined, pages: undefined,
/** /**
* Manually disable nuxt telemetry. * Manually disable nuxt telemetry.
*
* @see [Nuxt Telemetry](https://github.com/nuxt/telemetry) for more information. * @see [Nuxt Telemetry](https://github.com/nuxt/telemetry) for more information.
* @type {boolean | Record<string, any>} * @type {boolean | Record<string, any>}
*/ */
@ -67,7 +62,6 @@ export default defineUntypedSchema({
* *
* This is an experimental feature. * This is an experimental feature.
* Breaking changes for devtools might not reflect on the version of Nuxt. * Breaking changes for devtools might not reflect on the version of Nuxt.
*
* @see [Nuxt DevTools](https://devtools.nuxtjs.org/) for more information. * @see [Nuxt DevTools](https://devtools.nuxtjs.org/) for more information.
* @experimental * @experimental
* @type {boolean | { enabled: boolean, [key: string]: any }} * @type {boolean | { enabled: boolean, [key: string]: any }}

View File

@ -10,7 +10,6 @@ export default defineUntypedSchema({
vue: { vue: {
/** /**
* Options for the Vue compiler that will be passed at build time. * Options for the Vue compiler that will be passed at build time.
*
* @see [documentation](https://vuejs.org/api/application.html#app-config-compileroptions) * @see [documentation](https://vuejs.org/api/application.html#app-config-compileroptions)
* @type {typeof import('@vue/compiler-core').CompilerOptions} * @type {typeof import('@vue/compiler-core').CompilerOptions}
*/ */
@ -25,7 +24,6 @@ export default defineUntypedSchema({
/** /**
* Vue Experimental: Enable reactive destructure for `defineProps` * Vue Experimental: Enable reactive destructure for `defineProps`
*
* @see [Vue RFC#502](https://github.com/vuejs/rfcs/discussions/502) * @see [Vue RFC#502](https://github.com/vuejs/rfcs/discussions/502)
* @type {boolean} * @type {boolean}
*/ */
@ -33,7 +31,6 @@ export default defineUntypedSchema({
/** /**
* Vue Experimental: Enable macro `defineModel` * Vue Experimental: Enable macro `defineModel`
*
* @see [Vue RFC#503](https://github.com/vuejs/rfcs/discussions/503) * @see [Vue RFC#503](https://github.com/vuejs/rfcs/discussions/503)
* @type {boolean} * @type {boolean}
*/ */
@ -48,7 +45,6 @@ export default defineUntypedSchema({
* The base path of your Nuxt application. * The base path of your Nuxt application.
* *
* This can be set at runtime by setting the NUXT_APP_BASE_URL environment variable. * This can be set at runtime by setting the NUXT_APP_BASE_URL environment variable.
*
* @example * @example
* ```bash * ```bash
* NUXT_APP_BASE_URL=/prefix/ node .output/server/index.mjs * NUXT_APP_BASE_URL=/prefix/ node .output/server/index.mjs
@ -67,7 +63,6 @@ export default defineUntypedSchema({
* An absolute URL to serve the public folder from (production-only). * An absolute URL to serve the public folder from (production-only).
* *
* This can be set to a different value at runtime by setting the `NUXT_APP_CDN_URL` environment variable. * This can be set to a different value at runtime by setting the `NUXT_APP_CDN_URL` environment variable.
*
* @example * @example
* ```bash * ```bash
* NUXT_APP_CDN_URL=https://mycdn.org/ node .output/server/index.mjs * NUXT_APP_CDN_URL=https://mycdn.org/ node .output/server/index.mjs
@ -79,7 +74,6 @@ export default defineUntypedSchema({
/** /**
* Set default configuration for `<head>` on every page. * Set default configuration for `<head>` on every page.
*
* @example * @example
* ```js * ```js
* app: { * app: {
@ -143,7 +137,6 @@ export default defineUntypedSchema({
* *
* This can be overridden with `definePageMeta` on an individual page. * This can be overridden with `definePageMeta` on an individual page.
* Only JSON-serializable values are allowed. * Only JSON-serializable values are allowed.
*
* @see https://vuejs.org/api/built-in-components.html#transition * @see https://vuejs.org/api/built-in-components.html#transition
* @type {typeof import('../src/types/config').NuxtAppConfig['layoutTransition']} * @type {typeof import('../src/types/config').NuxtAppConfig['layoutTransition']}
*/ */
@ -154,7 +147,6 @@ export default defineUntypedSchema({
* *
* This can be overridden with `definePageMeta` on an individual page. * This can be overridden with `definePageMeta` on an individual page.
* Only JSON-serializable values are allowed. * Only JSON-serializable values are allowed.
*
* @see https://vuejs.org/api/built-in-components.html#transition * @see https://vuejs.org/api/built-in-components.html#transition
* @type {typeof import('../src/types/config').NuxtAppConfig['pageTransition']} * @type {typeof import('../src/types/config').NuxtAppConfig['pageTransition']}
*/ */
@ -165,7 +157,6 @@ export default defineUntypedSchema({
* *
* This can be overridden with `definePageMeta` on an individual page. * This can be overridden with `definePageMeta` on an individual page.
* Only JSON-serializable values are allowed. * Only JSON-serializable values are allowed.
*
* @see https://vuejs.org/api/built-in-components.html#keepalive * @see https://vuejs.org/api/built-in-components.html#keepalive
* @type {typeof import('../src/types/config').NuxtAppConfig['keepalive']} * @type {typeof import('../src/types/config').NuxtAppConfig['keepalive']}
*/ */
@ -173,7 +164,6 @@ export default defineUntypedSchema({
/** /**
* Customize Nuxt root element id. * Customize Nuxt root element id.
*
* @type {string | false} * @type {string | false}
*/ */
rootId: { rootId: {
@ -196,7 +186,6 @@ export default defineUntypedSchema({
* - If true, Nuxt will look for `~/app/spa-loading-template.html` file or a default Nuxt image will be used. * - If true, Nuxt will look for `~/app/spa-loading-template.html` file or a default Nuxt image will be used.
* *
* Some good sources for spinners are [SpinKit](https://github.com/tobiasahlin/SpinKit) or [SVG Spinners](https://icones.js.org/collection/svg-spinners). * Some good sources for spinners are [SpinKit](https://github.com/tobiasahlin/SpinKit) or [SVG Spinners](https://icones.js.org/collection/svg-spinners).
*
* @example ~/app/spa-loading-template.html * @example ~/app/spa-loading-template.html
* ```html * ```html
* <!-- https://github.com/barelyhuman/snips/blob/dev/pages/css-loader.md --> * <!-- https://github.com/barelyhuman/snips/blob/dev/pages/css-loader.md -->
@ -254,7 +243,6 @@ export default defineUntypedSchema({
* in the appropriate context. * in the appropriate context.
* *
* It can also be an object with `src` and `mode` keys. * It can also be an object with `src` and `mode` keys.
*
* @note Plugins are also auto-registered from the `~/plugins` directory * @note Plugins are also auto-registered from the `~/plugins` directory
* and these plugins do not need to be listed in `nuxt.config` unless you * and these plugins do not need to be listed in `nuxt.config` unless you
* need to customize their order. All plugins are deduplicated by their src path. * need to customize their order. All plugins are deduplicated by their src path.
@ -281,7 +269,6 @@ export default defineUntypedSchema({
* Nuxt will automatically guess the file type by its extension and use the * Nuxt will automatically guess the file type by its extension and use the
* appropriate pre-processor. You will still need to install the required * appropriate pre-processor. You will still need to install the required
* loader if you need to use them. * loader if you need to use them.
*
* @example * @example
* ```js * ```js
* css: [ * css: [

View File

@ -7,7 +7,6 @@ import { consola } from 'consola'
export default defineUntypedSchema({ export default defineUntypedSchema({
/** /**
* The builder to use for bundling the Vue part of your application. * The builder to use for bundling the Vue part of your application.
*
* @type {'vite' | 'webpack' | { bundle: (nuxt: typeof import('../src/types/nuxt').Nuxt) => Promise<void> }} * @type {'vite' | 'webpack' | { bundle: (nuxt: typeof import('../src/types/nuxt').Nuxt) => Promise<void> }}
*/ */
builder: { builder: {
@ -25,7 +24,6 @@ export default defineUntypedSchema({
/** /**
* Whether to generate sourcemaps. * Whether to generate sourcemaps.
*
* @type {boolean | { server?: boolean | 'hidden', client?: boolean | 'hidden' }} * @type {boolean | { server?: boolean | 'hidden', client?: boolean | 'hidden' }}
*/ */
sourcemap: { sourcemap: {
@ -45,7 +43,6 @@ export default defineUntypedSchema({
* *
* Defaults to 'silent' when running in CI or when a TTY is not available. * Defaults to 'silent' when running in CI or when a TTY is not available.
* This option is then used as 'silent' in Vite and 'none' in Webpack * This option is then used as 'silent' in Vite and 'none' in Webpack
*
* @type {'silent' | 'info' | 'verbose'} * @type {'silent' | 'info' | 'verbose'}
*/ */
logLevel: { logLevel: {
@ -67,7 +64,6 @@ export default defineUntypedSchema({
* dependency's file name. * dependency's file name.
* *
* You can also use a function to conditionally transpile. The function will receive an object ({ isDev, isServer, isClient, isModern, isLegacy }). * You can also use a function to conditionally transpile. The function will receive an object ({ isDev, isServer, isClient, isModern, isLegacy }).
*
* @example * @example
* ```js * ```js
transpile: [({ isLegacy }) => isLegacy && 'ky'] transpile: [({ isLegacy }) => isLegacy && 'ky']
@ -83,7 +79,6 @@ export default defineUntypedSchema({
* on Nuxt configuration. This feature is specially useful for using with modules. * on Nuxt configuration. This feature is specially useful for using with modules.
* *
* Templates are rendered using [`lodash/template`](https://lodash.com/docs/4.17.15#template). * Templates are rendered using [`lodash/template`](https://lodash.com/docs/4.17.15#template).
*
* @example * @example
* ```js * ```js
* templates: [ * templates: [
@ -105,7 +100,6 @@ export default defineUntypedSchema({
* Nuxt uses `webpack-bundle-analyzer` to visualize your bundles and how to optimize them. * Nuxt uses `webpack-bundle-analyzer` to visualize your bundles and how to optimize them.
* *
* Set to `true` to enable bundle analysis, or pass an object with options: [for webpack](https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin) or [for vite](https://github.com/btd/rollup-plugin-visualizer#options). * Set to `true` to enable bundle analysis, or pass an object with options: [for webpack](https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin) or [for vite](https://github.com/btd/rollup-plugin-visualizer#options).
*
* @example * @example
* ```js * ```js
* analyze: { * analyze: {
@ -142,7 +136,6 @@ export default defineUntypedSchema({
* and client. You will need to take steps to handle this additional key. * and client. You will need to take steps to handle this additional key.
* *
* The key will be unique based on the location of the function being invoked within the file. * The key will be unique based on the location of the function being invoked within the file.
*
* @type {Array<{ name: string, source?: string | RegExp, argumentLength: number }>} * @type {Array<{ name: string, source?: string | RegExp, argumentLength: number }>}
*/ */
keyedComposables: { keyedComposables: {
@ -162,7 +155,6 @@ export default defineUntypedSchema({
treeShake: { treeShake: {
/** /**
* Tree shake composables from the server or client builds. * Tree shake composables from the server or client builds.
*
* @example * @example
* ```js * ```js
* treeShake: { client: { myPackage: ['useServerOnlyComposable'] } } * treeShake: { client: { myPackage: ['useServerOnlyComposable'] } }
@ -195,7 +187,6 @@ export default defineUntypedSchema({
/** /**
* Options passed directly to the transformer from `unctx` that preserves async context * Options passed directly to the transformer from `unctx` that preserves async context
* after `await`. * after `await`.
*
* @type {typeof import('unctx/transform').TransformerOptions} * @type {typeof import('unctx/transform').TransformerOptions}
*/ */
asyncTransforms: { asyncTransforms: {

View File

@ -12,7 +12,6 @@ export default defineUntypedSchema({
* Value should be either a string or array of strings pointing to source directories or config path relative to current config. * Value should be either a string or array of strings pointing to source directories or config path relative to current config.
* *
* You can use `github:`, `gitlab:`, `bitbucket:` or `https://` to extend from a remote git repository. * You can use `github:`, `gitlab:`, `bitbucket:` or `https://` to extend from a remote git repository.
*
* @type {string|string[]} * @type {string|string[]}
*/ */
extends: null, extends: null,
@ -23,7 +22,6 @@ export default defineUntypedSchema({
* Value should be a string pointing to source directory or config path relative to current config. * Value should be a string pointing to source directory or config path relative to current config.
* *
* You can use `github:`, `gitlab:`, `bitbucket:` or `https://` to extend from a remote git repository. * You can use `github:`, `gitlab:`, `bitbucket:` or `https://` to extend from a remote git repository.
*
* @type {string} * @type {string}
*/ */
theme: null, theme: null,
@ -57,7 +55,6 @@ export default defineUntypedSchema({
* Define the source directory of your Nuxt application. * Define the source directory of your Nuxt application.
* *
* If a relative path is specified, it will be relative to the `rootDir`. * If a relative path is specified, it will be relative to the `rootDir`.
*
* @example * @example
* ```js * ```js
* export default { * export default {
@ -105,7 +102,6 @@ export default defineUntypedSchema({
* *
* Many tools assume that `.nuxt` is a hidden directory (because it starts * Many tools assume that `.nuxt` is a hidden directory (because it starts
* with a `.`). If that is a problem, you can use this option to prevent that. * with a `.`). If that is a problem, you can use this option to prevent that.
*
* @example * @example
* ```js * ```js
* export default { * export default {
@ -124,7 +120,6 @@ export default defineUntypedSchema({
* The configuration path is relative to `options.rootDir` (default is current working directory). * The configuration path is relative to `options.rootDir` (default is current working directory).
* *
* Setting this field may be necessary if your project is organized as a yarn workspace-styled mono-repository. * Setting this field may be necessary if your project is organized as a yarn workspace-styled mono-repository.
*
* @example * @example
* ```js * ```js
* export default { * export default {
@ -190,7 +185,6 @@ export default defineUntypedSchema({
* *
* Nuxt tries to resolve each item in the modules array using node require path * Nuxt tries to resolve each item in the modules array using node require path
* (in `node_modules`) and then will be resolved from project `srcDir` if `~` alias is used. * (in `node_modules`) and then will be resolved from project `srcDir` if `~` alias is used.
*
* @note Modules are executed sequentially so the order is important. * @note Modules are executed sequentially so the order is important.
* @example * @example
* ```js * ```js
@ -271,7 +265,6 @@ export default defineUntypedSchema({
/** /**
* You can improve your DX by defining additional aliases to access custom directories * You can improve your DX by defining additional aliases to access custom directories
* within your JavaScript and CSS. * within your JavaScript and CSS.
*
* @note Within a webpack context (image sources, CSS - but not JavaScript) you _must_ access * @note Within a webpack context (image sources, CSS - but not JavaScript) you _must_ access
* your alias by prefixing it with `~`. * your alias by prefixing it with `~`.
* @note These aliases will be automatically added to the generated `.nuxt/tsconfig.json` so you can get full * @note These aliases will be automatically added to the generated `.nuxt/tsconfig.json` so you can get full
@ -323,7 +316,6 @@ export default defineUntypedSchema({
/** /**
* Pass options directly to `node-ignore` (which is used by Nuxt to ignore files). * Pass options directly to `node-ignore` (which is used by Nuxt to ignore files).
*
* @see [node-ignore](https://github.com/kaelzhang/node-ignore) * @see [node-ignore](https://github.com/kaelzhang/node-ignore)
* @example * @example
* ```js * ```js
@ -364,7 +356,6 @@ export default defineUntypedSchema({
* It is an array of strings or regular expressions. Strings should be either absolute paths or * It is an array of strings or regular expressions. Strings should be either absolute paths or
* relative to the `srcDir` (and the `srcDir` of any layers). Regular expressions will be matched * relative to the `srcDir` (and the `srcDir` of any layers). Regular expressions will be matched
* against the path relative to the project `srcDir` (and the `srcDir` of any layers). * against the path relative to the project `srcDir` (and the `srcDir` of any layers).
*
* @type {Array<string | RegExp>} * @type {Array<string | RegExp>}
*/ */
watch: { watch: {
@ -379,7 +370,6 @@ export default defineUntypedSchema({
rewatchOnRawEvents: undefined, rewatchOnRawEvents: undefined,
/** /**
* `watchOptions` to pass directly to webpack. * `watchOptions` to pass directly to webpack.
*
* @see [webpack@4 watch options](https://v4.webpack.js.org/configuration/watch/#watchoptions). * @see [webpack@4 watch options](https://v4.webpack.js.org/configuration/watch/#watchoptions).
*/ */
webpack: { webpack: {
@ -387,7 +377,6 @@ export default defineUntypedSchema({
}, },
/** /**
* Options to pass directly to `chokidar`. * Options to pass directly to `chokidar`.
*
* @see [chokidar](https://github.com/paulmillr/chokidar#api) * @see [chokidar](https://github.com/paulmillr/chokidar#api)
*/ */
chokidar: { chokidar: {
@ -403,7 +392,6 @@ export default defineUntypedSchema({
* *
* For ease of configuration, you can also structure them as an hierarchical * For ease of configuration, you can also structure them as an hierarchical
* object in `nuxt.config` (as below). * object in `nuxt.config` (as below).
*
* @example * @example
* ```js'node:fs' * ```js'node:fs'
* import fs from 'node:fs' * import fs from 'node:fs'
@ -438,7 +426,6 @@ export default defineUntypedSchema({
* *
* Values are automatically replaced by matching env variables at runtime, e.g. setting an environment * Values are automatically replaced by matching env variables at runtime, e.g. setting an environment
* variable `NUXT_API_KEY=my-api-key NUXT_PUBLIC_BASE_URL=/foo/` would overwrite the two values in the example below. * variable `NUXT_API_KEY=my-api-key NUXT_PUBLIC_BASE_URL=/foo/` would overwrite the two values in the example below.
*
* @example * @example
* ```js * ```js
* export default { * export default {
@ -471,7 +458,6 @@ export default defineUntypedSchema({
* *
* For programmatic usage and type support, you can directly provide app config with this option. * For programmatic usage and type support, you can directly provide app config with this option.
* It will be merged with `app.config` file as default value. * It will be merged with `app.config` file as default value.
*
* @type {typeof import('../src/types/config').AppConfig} * @type {typeof import('../src/types/config').AppConfig}
*/ */
appConfig: { appConfig: {

View File

@ -5,7 +5,6 @@ export default defineUntypedSchema({
devServer: { devServer: {
/** /**
* Whether to enable HTTPS. * Whether to enable HTTPS.
*
* @example * @example
* ``` * ```
* export default defineNuxtConfig({ * export default defineNuxtConfig({
@ -37,7 +36,6 @@ export default defineUntypedSchema({
/** /**
* Template to show a loading screen * Template to show a loading screen
*
* @type {(data: { loading?: string }) => string} * @type {(data: { loading?: string }) => string}
*/ */
loadingTemplate loadingTemplate

View File

@ -11,7 +11,6 @@ export default defineUntypedSchema({
/** /**
* Enable Vue's reactivity transform * Enable Vue's reactivity transform
*
* @see https://vuejs.org/guide/extras/reactivity-transform.html * @see https://vuejs.org/guide/extras/reactivity-transform.html
* *
* Warning: Reactivity transform feature has been marked as deprecated in Vue 3.3 and is planned to be * Warning: Reactivity transform feature has been marked as deprecated in Vue 3.3 and is planned to be
@ -24,14 +23,12 @@ export default defineUntypedSchema({
// https://github.com/unjs/nitro/issues/1118 // https://github.com/unjs/nitro/issues/1118
/** /**
* Externalize `vue`, `@vue/*` and `vue-router` when building. * Externalize `vue`, `@vue/*` and `vue-router` when building.
*
* @see https://github.com/nuxt/nuxt/issues/13632 * @see https://github.com/nuxt/nuxt/issues/13632
*/ */
externalVue: true, externalVue: true,
/** /**
* Tree shakes contents of client-only components from server bundle. * Tree shakes contents of client-only components from server bundle.
*
* @see https://github.com/nuxt/framework/pull/5750 * @see https://github.com/nuxt/framework/pull/5750
*/ */
treeshakeClientOnly: true, treeshakeClientOnly: true,
@ -45,7 +42,6 @@ export default defineUntypedSchema({
* *
* You can disable automatic handling by setting this to `false`, or handle * You can disable automatic handling by setting this to `false`, or handle
* chunk errors manually by setting it to `manual`. * chunk errors manually by setting it to `manual`.
*
* @see https://github.com/nuxt/nuxt/pull/19038 * @see https://github.com/nuxt/nuxt/pull/19038
* @type {false | 'manual' | 'automatic'} * @type {false | 'manual' | 'automatic'}
*/ */
@ -82,7 +78,6 @@ export default defineUntypedSchema({
* Consider carefully before enabling this as it can cause unexpected behavior, and * Consider carefully before enabling this as it can cause unexpected behavior, and
* consider providing explicit keys to `useState` as auto-generated keys may not match * consider providing explicit keys to `useState` as auto-generated keys may not match
* across builds. * across builds.
*
* @type {boolean} * @type {boolean}
*/ */
restoreState: false, restoreState: false,
@ -92,7 +87,6 @@ export default defineUntypedSchema({
* *
* You can also pass a function that receives the path of a Vue component * You can also pass a function that receives the path of a Vue component
* and returns a boolean indicating whether to inline the styles for that component. * and returns a boolean indicating whether to inline the styles for that component.
*
* @type {boolean | ((id?: string) => boolean)} * @type {boolean | ((id?: string) => boolean)}
*/ */
inlineSSRStyles: { inlineSSRStyles: {
@ -121,7 +115,6 @@ export default defineUntypedSchema({
/** /**
* When this option is enabled (by default) payload of pages that are prerendered are extracted * When this option is enabled (by default) payload of pages that are prerendered are extracted
*
* @type {boolean | undefined} * @type {boolean | undefined}
*/ */
payloadExtraction: true, payloadExtraction: true,
@ -137,21 +130,18 @@ export default defineUntypedSchema({
/** /**
* Enable View Transition API integration with client-side router. * Enable View Transition API integration with client-side router.
*
* @see https://developer.chrome.com/docs/web-platform/view-transitions * @see https://developer.chrome.com/docs/web-platform/view-transitions
*/ */
viewTransition: false, viewTransition: false,
/** /**
* Write early hints when using node server. * Write early hints when using node server.
*
* @note nginx does not support 103 Early hints in the current version. * @note nginx does not support 103 Early hints in the current version.
*/ */
writeEarlyHints: false, writeEarlyHints: false,
/** /**
* Experimental component islands support with <NuxtIsland> and .island.vue files. * Experimental component islands support with <NuxtIsland> and .island.vue files.
*
* @type {true | 'local' | 'local+remote' | false} * @type {true | 'local' | 'local+remote' | false}
*/ */
componentIslands: { componentIslands: {
@ -164,7 +154,6 @@ export default defineUntypedSchema({
/** /**
* Config schema support * Config schema support
*
* @see https://github.com/nuxt/nuxt/issues/15592 * @see https://github.com/nuxt/nuxt/issues/15592
*/ */
configSchema: true, configSchema: true,
@ -227,7 +216,6 @@ export default defineUntypedSchema({
* performance in large projects or on Windows platforms. * performance in large projects or on Windows platforms.
* *
* You can also set this to `chokidar` to watch all files in your source directory. * You can also set this to `chokidar` to watch all files in your source directory.
*
* @see https://github.com/paulmillr/chokidar * @see https://github.com/paulmillr/chokidar
* @see https://github.com/parcel-bundler/watcher * @see https://github.com/parcel-bundler/watcher
* @type {'chokidar' | 'parcel' | 'chokidar-granular'} * @type {'chokidar' | 'parcel' | 'chokidar-granular'}
@ -236,7 +224,6 @@ export default defineUntypedSchema({
/** /**
* Enable native async context to be accessible for nested composables * Enable native async context to be accessible for nested composables
*
* @see https://github.com/nuxt/nuxt/pull/20918 * @see https://github.com/nuxt/nuxt/pull/20918
*/ */
asyncContext: false, asyncContext: false,
@ -245,7 +232,6 @@ export default defineUntypedSchema({
* Use new experimental head optimisations: * Use new experimental head optimisations:
* - Add the capo.js head plugin in order to render tags in of the head in a more performant way. * - Add the capo.js head plugin in order to render tags in of the head in a more performant way.
* - Uses the hash hydration plugin to reduce initial hydration * - Uses the hash hydration plugin to reduce initial hydration
*
* @see https://github.com/nuxt/nuxt/discussions/22632 * @see https://github.com/nuxt/nuxt/discussions/22632
*/ */
headNext: false, headNext: false,

View File

@ -9,7 +9,6 @@ export default defineUntypedSchema({
* This is often necessary when using dynamic routes. * This is often necessary when using dynamic routes.
* *
* It is preferred to use `nitro.prerender.routes`. * It is preferred to use `nitro.prerender.routes`.
*
* @example * @example
* ```js * ```js
* routes: ['/users/1', '/users/2', '/users/3'] * routes: ['/users/1', '/users/2', '/users/3']
@ -20,7 +19,6 @@ export default defineUntypedSchema({
/** /**
* This option is no longer used. Instead, use `nitro.prerender.ignore`. * This option is no longer used. Instead, use `nitro.prerender.ignore`.
*
* @deprecated * @deprecated
*/ */
exclude: [] exclude: []

View File

@ -3,7 +3,6 @@ import { defineUntypedSchema } from 'untyped'
export default defineUntypedSchema({ export default defineUntypedSchema({
/** /**
* Configuration for Nitro. * Configuration for Nitro.
*
* @see https://nitro.unjs.io/config/ * @see https://nitro.unjs.io/config/
* @type {typeof import('nitropack')['NitroConfig']} * @type {typeof import('nitropack')['NitroConfig']}
*/ */
@ -18,7 +17,6 @@ export default defineUntypedSchema({
/** /**
* Global route options applied to matching server routes. * Global route options applied to matching server routes.
*
* @experimental This is an experimental feature and API may change in the future. * @experimental This is an experimental feature and API may change in the future.
* @see https://nitro.unjs.io/config/#routerules * @see https://nitro.unjs.io/config/#routerules
* @type {typeof import('nitropack')['NitroConfig']['routeRules']} * @type {typeof import('nitropack')['NitroConfig']['routeRules']}
@ -34,7 +32,6 @@ export default defineUntypedSchema({
* - method: The HTTP method of requests that should be handled. * - method: The HTTP method of requests that should be handled.
* - middleware: Specifies whether it is a middleware handler. * - middleware: Specifies whether it is a middleware handler.
* - lazy: Specifies whether to use lazy loading to import the handler. * - lazy: Specifies whether to use lazy loading to import the handler.
*
* @see https://nuxt.com/docs/guide/directory-structure/server * @see https://nuxt.com/docs/guide/directory-structure/server
* @note Files from `server/api`, `server/middleware` and `server/routes` will be automatically registered by Nuxt. * @note Files from `server/api`, `server/middleware` and `server/routes` will be automatically registered by Nuxt.
* @example * @example
@ -49,7 +46,6 @@ export default defineUntypedSchema({
/** /**
* Nitro development-only server handlers. * Nitro development-only server handlers.
*
* @see https://nitro.unjs.io/guide/routing * @see https://nitro.unjs.io/guide/routing
* @type {typeof import('nitropack')['NitroDevEventHandler'][]} * @type {typeof import('nitropack')['NitroDevEventHandler'][]}
*/ */

View File

@ -8,7 +8,6 @@ export default defineUntypedSchema({
* Options for configuring PostCSS plugins. * Options for configuring PostCSS plugins.
* *
* https://postcss.org/ * https://postcss.org/
*
* @type {Record<string, any>} * @type {Record<string, any>}
*/ */
plugins: { plugins: {

View File

@ -8,7 +8,6 @@ export default defineUntypedSchema({
* Note: Only JSON serializable options should be passed by nuxt config. * Note: Only JSON serializable options should be passed by nuxt config.
* *
* For more control, you can use `app/router.options.ts` file. * For more control, you can use `app/router.options.ts` file.
*
* @see [documentation](https://router.vuejs.org/api/interfaces/routeroptions.html). * @see [documentation](https://router.vuejs.org/api/interfaces/routeroptions.html).
* @type {typeof import('../src/types/router').RouterConfigSerializable} * @type {typeof import('../src/types/router').RouterConfigSerializable}
*/ */

View File

@ -20,7 +20,6 @@ export default defineUntypedSchema({
* builder environment types (with `false`) to handle this fully yourself, or opt for a 'shared' option. * builder environment types (with `false`) to handle this fully yourself, or opt for a 'shared' option.
* *
* The 'shared' option is advised for module authors, who will want to support multiple possible builders. * The 'shared' option is advised for module authors, who will want to support multiple possible builders.
*
* @type {'vite' | 'webpack' | 'shared' | false | undefined} * @type {'vite' | 'webpack' | 'shared' | false | undefined}
*/ */
builder: { builder: {
@ -37,7 +36,6 @@ export default defineUntypedSchema({
* *
* If set to true, this will type check in development. You can restrict this to build-time type checking by setting it to `build`. * If set to true, this will type check in development. You can restrict this to build-time type checking by setting it to `build`.
* Requires to install `typescript` and `vue-tsc` as dev dependencies. * Requires to install `typescript` and `vue-tsc` as dev dependencies.
*
* @see https://nuxt.com/docs/guide/concepts/typescript * @see https://nuxt.com/docs/guide/concepts/typescript
* @type {boolean | 'build'} * @type {boolean | 'build'}
*/ */
@ -45,7 +43,6 @@ export default defineUntypedSchema({
/** /**
* You can extend generated `.nuxt/tsconfig.json` using this option. * You can extend generated `.nuxt/tsconfig.json` using this option.
*
* @type {typeof import('pkg-types')['TSConfig']} * @type {typeof import('pkg-types')['TSConfig']}
*/ */
tsConfig: {}, tsConfig: {},

View File

@ -10,7 +10,6 @@ export default defineUntypedSchema({
* *
* See https://vitejs.dev/config for more information. * See https://vitejs.dev/config for more information.
* Please note that not all vite options are supported in Nuxt. * Please note that not all vite options are supported in Nuxt.
*
* @type {typeof import('../src/types/config').ViteConfig & { $client?: typeof import('../src/types/config').ViteConfig, $server?: typeof import('../src/types/config').ViteConfig }} * @type {typeof import('../src/types/config').ViteConfig & { $client?: typeof import('../src/types/config').ViteConfig, $server?: typeof import('../src/types/config').ViteConfig }}
*/ */
vite: { vite: {

View File

@ -7,7 +7,6 @@ export default defineUntypedSchema({
* Nuxt uses `webpack-bundle-analyzer` to visualize your bundles and how to optimize them. * Nuxt uses `webpack-bundle-analyzer` to visualize your bundles and how to optimize them.
* *
* Set to `true` to enable bundle analysis, or pass an object with options: [for webpack](https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin) or [for vite](https://github.com/btd/rollup-plugin-visualizer#options). * Set to `true` to enable bundle analysis, or pass an object with options: [for webpack](https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin) or [for vite](https://github.com/btd/rollup-plugin-visualizer#options).
*
* @example * @example
* ```js * ```js
* analyze: { * analyze: {
@ -35,7 +34,6 @@ export default defineUntypedSchema({
* Enable the profiler in webpackbar. * Enable the profiler in webpackbar.
* *
* It is normally enabled by CLI argument `--profile`. * It is normally enabled by CLI argument `--profile`.
*
* @see [webpackbar](https://github.com/unjs/webpackbar#profile). * @see [webpackbar](https://github.com/unjs/webpackbar#profile).
*/ */
profile: process.argv.includes('--profile'), profile: process.argv.includes('--profile'),
@ -46,7 +44,6 @@ export default defineUntypedSchema({
* Using [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) under the hood, your CSS will be extracted * Using [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) under the hood, your CSS will be extracted
* into separate files, usually one per component. This allows caching your CSS and * into separate files, usually one per component. This allows caching your CSS and
* JavaScript separately. * JavaScript separately.
*
* @example * @example
* ```js * ```js
* export default { * export default {
@ -107,7 +104,6 @@ export default defineUntypedSchema({
* Customize bundle filenames. * Customize bundle filenames.
* *
* To understand a bit more about the use of manifests, take a look at [this webpack documentation](https://webpack.js.org/guides/code-splitting/). * To understand a bit more about the use of manifests, take a look at [this webpack documentation](https://webpack.js.org/guides/code-splitting/).
*
* @note Be careful when using non-hashed based filenames in production * @note Be careful when using non-hashed based filenames in production
* as most browsers will cache the asset and not detect the changes on first load. * as most browsers will cache the asset and not detect the changes on first load.
* *
@ -165,14 +161,12 @@ export default defineUntypedSchema({
/** /**
* See https://github.com/esbuild-kit/esbuild-loader * See https://github.com/esbuild-kit/esbuild-loader
*
* @type {Omit<typeof import('esbuild-loader')['LoaderOptions'], 'loader'>} * @type {Omit<typeof import('esbuild-loader')['LoaderOptions'], 'loader'>}
*/ */
esbuild: {}, esbuild: {},
/** /**
* See: https://github.com/webpack-contrib/file-loader#options * See: https://github.com/webpack-contrib/file-loader#options
*
* @type {Omit<typeof import('file-loader')['Options'], 'name'>} * @type {Omit<typeof import('file-loader')['Options'], 'name'>}
* @default * @default
* ```ts * ```ts
@ -183,7 +177,6 @@ export default defineUntypedSchema({
/** /**
* See: https://github.com/webpack-contrib/file-loader#options * See: https://github.com/webpack-contrib/file-loader#options
*
* @type {Omit<typeof import('file-loader')['Options'], 'name'>} * @type {Omit<typeof import('file-loader')['Options'], 'name'>}
* @default * @default
* ```ts * ```ts
@ -194,7 +187,6 @@ export default defineUntypedSchema({
/** /**
* See: https://github.com/webpack-contrib/file-loader#options * See: https://github.com/webpack-contrib/file-loader#options
*
* @type {Omit<typeof import('file-loader')['Options'], 'name'>} * @type {Omit<typeof import('file-loader')['Options'], 'name'>}
* @default * @default
* ```ts * ```ts
@ -205,14 +197,12 @@ export default defineUntypedSchema({
/** /**
* See: https://pugjs.org/api/reference.html#options * See: https://pugjs.org/api/reference.html#options
*
* @type {typeof import('pug')['Options']} * @type {typeof import('pug')['Options']}
*/ */
pugPlain: {}, pugPlain: {},
/** /**
* See [vue-loader](https://github.com/vuejs/vue-loader) for available options. * See [vue-loader](https://github.com/vuejs/vue-loader) for available options.
*
* @type {Partial<typeof import('vue-loader')['VueLoaderOptions']>} * @type {Partial<typeof import('vue-loader')['VueLoaderOptions']>}
*/ */
vue: { vue: {
@ -253,7 +243,6 @@ export default defineUntypedSchema({
/** /**
* See: https://github.com/webpack-contrib/sass-loader#options * See: https://github.com/webpack-contrib/sass-loader#options
*
* @type {typeof import('sass-loader')['Options']} * @type {typeof import('sass-loader')['Options']}
* @default * @default
* ```ts * ```ts
@ -272,7 +261,6 @@ export default defineUntypedSchema({
/** /**
* See: https://github.com/webpack-contrib/sass-loader#options * See: https://github.com/webpack-contrib/sass-loader#options
*
* @type {typeof import('sass-loader')['Options']} * @type {typeof import('sass-loader')['Options']}
*/ */
scss: {}, scss: {},
@ -287,7 +275,6 @@ export default defineUntypedSchema({
/** /**
* Add webpack plugins. * Add webpack plugins.
*
* @example * @example
* ```js * ```js
* import webpack from 'webpack' * import webpack from 'webpack'
@ -311,7 +298,6 @@ export default defineUntypedSchema({
* OptimizeCSSAssets plugin options. * OptimizeCSSAssets plugin options.
* *
* Defaults to true when `extractCSS` is enabled. * Defaults to true when `extractCSS` is enabled.
*
* @see [css-minimizer-webpack-plugin documentation](https://github.com/webpack-contrib/css-minimizer-webpack-plugin). * @see [css-minimizer-webpack-plugin documentation](https://github.com/webpack-contrib/css-minimizer-webpack-plugin).
* @type {false | typeof import('css-minimizer-webpack-plugin').BasePluginOptions & typeof import('css-minimizer-webpack-plugin').DefinedDefaultMinimizerAndOptions<any>} * @type {false | typeof import('css-minimizer-webpack-plugin').BasePluginOptions & typeof import('css-minimizer-webpack-plugin').DefinedDefaultMinimizerAndOptions<any>}
*/ */
@ -321,7 +307,6 @@ export default defineUntypedSchema({
/** /**
* Configure [webpack optimization](https://webpack.js.org/configuration/optimization/). * Configure [webpack optimization](https://webpack.js.org/configuration/optimization/).
*
* @type {false | typeof import('webpack').Configuration['optimization']} * @type {false | typeof import('webpack').Configuration['optimization']}
*/ */
optimization: { optimization: {
@ -340,7 +325,6 @@ export default defineUntypedSchema({
/** /**
* Customize PostCSS Loader. * Customize PostCSS Loader.
* Same options as https://github.com/webpack-contrib/postcss-loader#options * Same options as https://github.com/webpack-contrib/postcss-loader#options
*
* @type {{ execute?: boolean, postcssOptions: typeof import('postcss').ProcessOptions, sourceMap?: boolean, implementation?: any }} * @type {{ execute?: boolean, postcssOptions: typeof import('postcss').ProcessOptions, sourceMap?: boolean, implementation?: any }}
*/ */
postcss: { postcss: {
@ -356,7 +340,6 @@ export default defineUntypedSchema({
/** /**
* See [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) for available options. * See [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) for available options.
*
* @type {typeof import('webpack-dev-middleware').Options<typeof import('http').IncomingMessage, typeof import('http').ServerResponse>} * @type {typeof import('webpack-dev-middleware').Options<typeof import('http').IncomingMessage, typeof import('http').ServerResponse>}
*/ */
devMiddleware: { devMiddleware: {
@ -365,7 +348,6 @@ export default defineUntypedSchema({
/** /**
* See [webpack-hot-middleware](https://github.com/webpack-contrib/webpack-hot-middleware) for available options. * See [webpack-hot-middleware](https://github.com/webpack-contrib/webpack-hot-middleware) for available options.
*
* @type {typeof import('webpack-hot-middleware').MiddlewareOptions & { client?: typeof import('webpack-hot-middleware').ClientOptions }} * @type {typeof import('webpack-hot-middleware').MiddlewareOptions & { client?: typeof import('webpack-hot-middleware').ClientOptions }}
*/ */
hotMiddleware: {}, hotMiddleware: {},
@ -377,14 +359,12 @@ export default defineUntypedSchema({
/** /**
* Filters to hide build warnings. * Filters to hide build warnings.
*
* @type {Array<(warn: typeof import('webpack').WebpackError) => boolean>} * @type {Array<(warn: typeof import('webpack').WebpackError) => boolean>}
*/ */
warningIgnoreFilters: [], warningIgnoreFilters: [],
/** /**
* Configure [webpack experiments](https://webpack.js.org/configuration/experiments/) * Configure [webpack experiments](https://webpack.js.org/configuration/experiments/)
*
* @type {false | typeof import('webpack').Configuration['experiments']} * @type {false | typeof import('webpack').Configuration['experiments']}
*/ */
experiments: {} experiments: {}

View File

@ -38,7 +38,6 @@ export interface ImportGlobOptions<
as?: AsType as?: AsType
/** /**
* Import as static or dynamic * Import as static or dynamic
*
* @default false * @default false
*/ */
eager?: Eager eager?: Eager
@ -52,7 +51,6 @@ export interface ImportGlobOptions<
query?: string | Record<string, string | number | boolean> query?: string | Record<string, string | number | boolean>
/** /**
* Search files also inside `node_modules/` and hidden directories (e.g. `.git/`). This might have impact on performance. * Search files also inside `node_modules/` and hidden directories (e.g. `.git/`). This might have impact on performance.
*
* @default false * @default false
*/ */
exhaustive?: boolean exhaustive?: boolean

View File

@ -93,7 +93,6 @@ export interface AcceptOptions {
export interface WebpackHot { export interface WebpackHot {
/** /**
* Accept code updates for the specified dependencies. The callback is called when dependencies were replaced. * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced.
*
* @param dependencies * @param dependencies
* @param callback * @param callback
* @param errorHandler * @param errorHandler
@ -101,7 +100,6 @@ export interface WebpackHot {
accept (dependencies: string[], callback?: (updatedDependencies: WebpackModuleId[]) => void, errorHandler?: (err: Error) => void): void accept (dependencies: string[], callback?: (updatedDependencies: WebpackModuleId[]) => void, errorHandler?: (err: Error) => void): void
/** /**
* Accept code updates for the specified dependencies. The callback is called when dependencies were replaced. * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced.
*
* @param dependency * @param dependency
* @param callback * @param callback
* @param errorHandler * @param errorHandler
@ -111,7 +109,6 @@ export interface WebpackHot {
* Accept code updates for this module without notification of parents. * Accept code updates for this module without notification of parents.
* This should only be used if the module doesnt export anything. * This should only be used if the module doesnt export anything.
* The errHandler can be used to handle errors that occur while loading the updated module. * The errHandler can be used to handle errors that occur while loading the updated module.
*
* @param errHandler * @param errHandler
*/ */
accept (errHandler?: (err: Error) => void): void accept (errHandler?: (err: Error) => void): void
@ -132,7 +129,6 @@ export interface WebpackHot {
* Here you should destroy/remove any persistent resource you have claimed/created. * Here you should destroy/remove any persistent resource you have claimed/created.
* If you want to transfer state to the new module, add it to data object. * If you want to transfer state to the new module, add it to data object.
* The data will be available at module.hot.data on the new module. * The data will be available at module.hot.data on the new module.
*
* @param callback * @param callback
*/ */
dispose (callback: (data: any) => void): void dispose (callback: (data: any) => void): void
@ -142,7 +138,6 @@ export interface WebpackHot {
* Here you should destroy/remove any persistent resource you have claimed/created. * Here you should destroy/remove any persistent resource you have claimed/created.
* If you want to transfer state to the new module, add it to data object. * If you want to transfer state to the new module, add it to data object.
* The data will be available at module.hot.data on the new module. * The data will be available at module.hot.data on the new module.
*
* @param callback * @param callback
*/ */
addDisposeHandler (callback: (data: any) => void): void addDisposeHandler (callback: (data: any) => void): void
@ -150,7 +145,6 @@ export interface WebpackHot {
/** /**
* Remove a handler. * Remove a handler.
* This can useful to add a temporary dispose handler. You could i. e. replace code while in the middle of a multi-step async function. * This can useful to add a temporary dispose handler. You could i. e. replace code while in the middle of a multi-step async function.
*
* @param callback * @param callback
*/ */
removeDisposeHandler (callback: (data: any) => void): void removeDisposeHandler (callback: (data: any) => void): void
@ -162,7 +156,6 @@ export interface WebpackHot {
* If autoApply is truthy the callback will be called with all modules that were disposed. * If autoApply is truthy the callback will be called with all modules that were disposed.
* apply() is automatically called with autoApply as options parameter. * apply() is automatically called with autoApply as options parameter.
* If autoApply is not set the callback will be called with all modules that will be disposed on apply(). * If autoApply is not set the callback will be called with all modules that will be disposed on apply().
*
* @param autoApply * @param autoApply
* @param callback * @param callback
*/ */
@ -172,14 +165,12 @@ export interface WebpackHot {
* Check all currently loaded modules for updates and apply updates if found. * Check all currently loaded modules for updates and apply updates if found.
* If no update was found, the callback is called with null. * If no update was found, the callback is called with null.
* The callback will be called with all modules that will be disposed on apply(). * The callback will be called with all modules that will be disposed on apply().
*
* @param callback * @param callback
*/ */
check (callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void check (callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void
/** /**
* If status() != "ready" it throws an error. * If status() != "ready" it throws an error.
* Continue the update process. * Continue the update process.
*
* @param options * @param options
* @param callback * @param callback
*/ */
@ -187,7 +178,6 @@ export interface WebpackHot {
/** /**
* If status() != "ready" it throws an error. * If status() != "ready" it throws an error.
* Continue the update process. * Continue the update process.
*
* @param callback * @param callback
*/ */
apply (callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void apply (callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void
@ -201,7 +191,6 @@ export interface WebpackHot {
addStatusHandler (callback: (status: string) => void): void addStatusHandler (callback: (status: string) => void): void
/** /**
* Remove a registered status change handler. * Remove a registered status change handler.
*
* @param callback * @param callback
*/ */
removeStatusHandler (callback: (status: string) => void): void removeStatusHandler (callback: (status: string) => void): void

View File

@ -1,7 +1,6 @@
export interface NuxtCompatibility { export interface NuxtCompatibility {
/** /**
* Required nuxt version in semver format. * Required nuxt version in semver format.
*
* @example `^2.14.0` or `>=3.0.0-27219851.6e49637`. * @example `^2.14.0` or `>=3.0.0-27219851.6e49637`.
*/ */
nuxt?: string nuxt?: string

View File

@ -111,7 +111,6 @@ export interface ComponentsOptions {
* but they can also be used dynamically, for example `<component :is="`icon-${myIcon}`">`. * but they can also be used dynamically, for example `<component :is="`icon-${myIcon}`">`.
* *
* This can be overridden by an individual component directory entry. * This can be overridden by an individual component directory entry.
*
* @default false * @default false
*/ */
global?: boolean global?: boolean

View File

@ -88,7 +88,6 @@ export interface NuxtConfig extends DeepPartial<Omit<ConfigSchema, 'vite' | 'run
/** /**
* Experimental custom config schema * Experimental custom config schema
*
* @see https://github.com/nuxt/nuxt/issues/15592 * @see https://github.com/nuxt/nuxt/issues/15592
*/ */
$schema?: SchemaDefinition $schema?: SchemaDefinition
@ -126,21 +125,18 @@ export interface ViteConfig extends Omit<ViteUserConfig, 'publicDir'> {
entry?: string entry?: string
/** /**
* Options passed to @vitejs/plugin-vue. * Options passed to @vitejs/plugin-vue.
*
* @see https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue * @see https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue
*/ */
vue?: VuePluginOptions vue?: VuePluginOptions
/** /**
* Options passed to @vitejs/plugin-vue-jsx. * Options passed to @vitejs/plugin-vue-jsx.
*
* @see https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx * @see https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx
*/ */
vueJsx?: VueJsxPluginOptions vueJsx?: VueJsxPluginOptions
/** /**
* Bundler for dev time server-side rendering. * Bundler for dev time server-side rendering.
*
* @default 'vite-node' * @default 'vite-node'
*/ */
devBundler?: 'vite-node' | 'legacy' devBundler?: 'vite-node' | 'legacy'
@ -158,7 +154,6 @@ export interface ViteConfig extends Omit<ViteUserConfig, 'publicDir'> {
* Directly configuring the `vite.publicDir` option is not supported. Instead, set `dir.public`. * Directly configuring the `vite.publicDir` option is not supported. Instead, set `dir.public`.
* *
* You can read more in <https://nuxt.com/docs/api/configuration/nuxt-config#public>. * You can read more in <https://nuxt.com/docs/api/configuration/nuxt-config#public>.
*
* @deprecated * @deprecated
*/ */
publicDir?: never publicDir?: never

View File

@ -19,14 +19,12 @@ export type MetaObject = MetaObjectRaw
export type AppHeadMetaObject = MetaObjectRaw & { export type AppHeadMetaObject = MetaObjectRaw & {
/** /**
* The character encoding in which the document is encoded => `<meta charset="<value>" />` * The character encoding in which the document is encoded => `<meta charset="<value>" />`
*
* @default `'utf-8'` * @default `'utf-8'`
*/ */
charset?: string charset?: string
/** /**
* Configuration of the viewport (the area of the window in which web content can be seen), * Configuration of the viewport (the area of the window in which web content can be seen),
* mapped to => `<meta name="viewport" content="<value>" />` * mapped to => `<meta name="viewport" content="<value>" />`
*
* @default `'width=device-width, initial-scale=1'` * @default `'width=device-width, initial-scale=1'`
*/ */
viewport?: string viewport?: string

View File

@ -65,7 +65,6 @@ export interface NuxtHooks {
// Kit // Kit
/** /**
* Allows extending compatibility checks. * Allows extending compatibility checks.
*
* @param compatibility Compatibility object * @param compatibility Compatibility object
* @param issues Issues to be mapped * @param issues Issues to be mapped
* @returns Promise * @returns Promise
@ -75,21 +74,18 @@ export interface NuxtHooks {
// Nuxt // Nuxt
/** /**
* Called after Nuxt initialization, when the Nuxt instance is ready to work. * Called after Nuxt initialization, when the Nuxt instance is ready to work.
*
* @param nuxt The configured Nuxt object * @param nuxt The configured Nuxt object
* @returns Promise * @returns Promise
*/ */
'ready': (nuxt: Nuxt) => HookResult 'ready': (nuxt: Nuxt) => HookResult
/** /**
* Called when Nuxt instance is gracefully closing. * Called when Nuxt instance is gracefully closing.
*
* @param nuxt The configured Nuxt object * @param nuxt The configured Nuxt object
* @returns Promise * @returns Promise
*/ */
'close': (nuxt: Nuxt) => HookResult 'close': (nuxt: Nuxt) => HookResult
/** /**
* Called to restart the current Nuxt instance. * Called to restart the current Nuxt instance.
*
* @returns Promise * @returns Promise
*/ */
'restart': (options?: { 'restart': (options?: {
@ -101,34 +97,29 @@ export interface NuxtHooks {
/** /**
* Called during Nuxt initialization, before installing user modules. * Called during Nuxt initialization, before installing user modules.
*
* @returns Promise * @returns Promise
*/ */
'modules:before': () => HookResult 'modules:before': () => HookResult
/** /**
* Called during Nuxt initialization, after installing user modules. * Called during Nuxt initialization, after installing user modules.
*
* @returns Promise * @returns Promise
*/ */
'modules:done': () => HookResult 'modules:done': () => HookResult
/** /**
* Called after resolving the `app` instance. * Called after resolving the `app` instance.
*
* @param app The resolved `NuxtApp` object * @param app The resolved `NuxtApp` object
* @returns Promise * @returns Promise
*/ */
'app:resolve': (app: NuxtApp) => HookResult 'app:resolve': (app: NuxtApp) => HookResult
/** /**
* Called during `NuxtApp` generation, to allow customizing, modifying or adding new files to the build directory (either virtually or to written to `.nuxt`). * Called during `NuxtApp` generation, to allow customizing, modifying or adding new files to the build directory (either virtually or to written to `.nuxt`).
*
* @param app The configured `NuxtApp` object * @param app The configured `NuxtApp` object
* @returns Promise * @returns Promise
*/ */
'app:templates': (app: NuxtApp) => HookResult 'app:templates': (app: NuxtApp) => HookResult
/** /**
* Called after templates are compiled into the [virtual file system](https://nuxt.com/docs/guide/directory-structure/nuxt#virtual-file-system) (vfs). * Called after templates are compiled into the [virtual file system](https://nuxt.com/docs/guide/directory-structure/nuxt#virtual-file-system) (vfs).
*
* @param app The configured `NuxtApp` object * @param app The configured `NuxtApp` object
* @returns Promise * @returns Promise
*/ */
@ -136,19 +127,16 @@ export interface NuxtHooks {
/** /**
* Called before Nuxt bundle builder. * Called before Nuxt bundle builder.
*
* @returns Promise * @returns Promise
*/ */
'build:before': () => HookResult 'build:before': () => HookResult
/** /**
* Called after Nuxt bundle builder is complete. * Called after Nuxt bundle builder is complete.
*
* @returns Promise * @returns Promise
*/ */
'build:done': () => HookResult 'build:done': () => HookResult
/** /**
* Called during the manifest build by Vite and Webpack. This allows customizing the manifest that Nitro will use to render `<script>` and `<link>` tags in the final HTML. * Called during the manifest build by Vite and Webpack. This allows customizing the manifest that Nitro will use to render `<script>` and `<link>` tags in the final HTML.
*
* @param manifest The manifest object to build * @param manifest The manifest object to build
* @returns Promise * @returns Promise
*/ */
@ -156,7 +144,6 @@ export interface NuxtHooks {
/** /**
* Called when `nuxt analyze` is finished * Called when `nuxt analyze` is finished
*
* @param meta the analyze meta object, mutations will be saved to `meta.json` * @param meta the analyze meta object, mutations will be saved to `meta.json`
* @returns Promise * @returns Promise
*/ */
@ -164,14 +151,12 @@ export interface NuxtHooks {
/** /**
* Called before generating the app. * Called before generating the app.
*
* @param options GenerateAppOptions object * @param options GenerateAppOptions object
* @returns Promise * @returns Promise
*/ */
'builder:generateApp': (options?: GenerateAppOptions) => HookResult 'builder:generateApp': (options?: GenerateAppOptions) => HookResult
/** /**
* Called at build time in development when the watcher spots a change to a file or directory in the project. * Called at build time in development when the watcher spots a change to a file or directory in the project.
*
* @param event "add" | "addDir" | "change" | "unlink" | "unlinkDir" * @param event "add" | "addDir" | "change" | "unlink" | "unlinkDir"
* @param path the path to the watched file * @param path the path to the watched file
* @returns Promise * @returns Promise
@ -180,7 +165,6 @@ export interface NuxtHooks {
/** /**
* Called after pages routes are resolved. * Called after pages routes are resolved.
*
* @param pages Array containing resolved pages * @param pages Array containing resolved pages
* @returns Promise * @returns Promise
*/ */
@ -188,7 +172,6 @@ export interface NuxtHooks {
/** /**
* Called when the dev middleware is being registered on the Nitro dev server. * Called when the dev middleware is being registered on the Nitro dev server.
*
* @param handler the Vite or Webpack event handler * @param handler the Vite or Webpack event handler
* @returns Promise * @returns Promise
*/ */
@ -196,28 +179,24 @@ export interface NuxtHooks {
/** /**
* Called at setup allowing modules to extend sources. * Called at setup allowing modules to extend sources.
*
* @param presets Array containing presets objects * @param presets Array containing presets objects
* @returns Promise * @returns Promise
*/ */
'imports:sources': (presets: ImportPresetWithDeprecation[]) => HookResult 'imports:sources': (presets: ImportPresetWithDeprecation[]) => HookResult
/** /**
* Called at setup allowing modules to extend imports. * Called at setup allowing modules to extend imports.
*
* @param imports Array containing the imports to extend * @param imports Array containing the imports to extend
* @returns Promise * @returns Promise
*/ */
'imports:extend': (imports: Import[]) => HookResult 'imports:extend': (imports: Import[]) => HookResult
/** /**
* Called when the [unimport](https://github.com/unjs/unimport) context is created. * Called when the [unimport](https://github.com/unjs/unimport) context is created.
*
* @param context The Unimport context * @param context The Unimport context
* @returns Promise * @returns Promise
*/ */
'imports:context': (context: Unimport) => HookResult 'imports:context': (context: Unimport) => HookResult
/** /**
* Allows extending import directories. * Allows extending import directories.
*
* @param dirs Array containing directories as string * @param dirs Array containing directories as string
* @returns Promise * @returns Promise
*/ */
@ -226,14 +205,12 @@ export interface NuxtHooks {
// Components // Components
/** /**
* Called within `app:resolve` allowing to extend the directories that are scanned for auto-importable components. * Called within `app:resolve` allowing to extend the directories that are scanned for auto-importable components.
*
* @param dirs The `dirs` option to push new items * @param dirs The `dirs` option to push new items
* @returns Promise * @returns Promise
*/ */
'components:dirs': (dirs: ComponentsOptions['dirs']) => HookResult 'components:dirs': (dirs: ComponentsOptions['dirs']) => HookResult
/** /**
* Allows extending new components. * Allows extending new components.
*
* @param components The `components` array to push new items * @param components The `components` array to push new items
* @returns Promise * @returns Promise
*/ */
@ -242,35 +219,30 @@ export interface NuxtHooks {
// Nitropack // Nitropack
/** /**
* Called before initializing Nitro, allowing customization of Nitro's configuration. * Called before initializing Nitro, allowing customization of Nitro's configuration.
*
* @param nitroConfig The nitro config to be extended * @param nitroConfig The nitro config to be extended
* @returns Promise * @returns Promise
*/ */
'nitro:config': (nitroConfig: NitroConfig) => HookResult 'nitro:config': (nitroConfig: NitroConfig) => HookResult
/** /**
* Called after Nitro is initialized, which allows registering Nitro hooks and interacting directly with Nitro. * Called after Nitro is initialized, which allows registering Nitro hooks and interacting directly with Nitro.
*
* @param nitro The created nitro object * @param nitro The created nitro object
* @returns Promise * @returns Promise
*/ */
'nitro:init': (nitro: Nitro) => HookResult 'nitro:init': (nitro: Nitro) => HookResult
/** /**
* Called before building the Nitro instance. * Called before building the Nitro instance.
*
* @param nitro The created nitro object * @param nitro The created nitro object
* @returns Promise * @returns Promise
*/ */
'nitro:build:before': (nitro: Nitro) => HookResult 'nitro:build:before': (nitro: Nitro) => HookResult
/** /**
* Called after copying public assets. Allows modifying public assets before Nitro server is built. * Called after copying public assets. Allows modifying public assets before Nitro server is built.
*
* @param nitro The created nitro object * @param nitro The created nitro object
* @returns Promise * @returns Promise
*/ */
'nitro:build:public-assets': (nitro: Nitro) => HookResult 'nitro:build:public-assets': (nitro: Nitro) => HookResult
/** /**
* Allows extending the routes to be pre-rendered. * Allows extending the routes to be pre-rendered.
*
* @param ctx Nuxt context * @param ctx Nuxt context
* @returns Promise * @returns Promise
*/ */
@ -279,21 +251,18 @@ export interface NuxtHooks {
// Nuxi // Nuxi
/** /**
* Called when an error occurs at build time. * Called when an error occurs at build time.
*
* @param error Error object * @param error Error object
* @returns Promise * @returns Promise
*/ */
'build:error': (error: Error) => HookResult 'build:error': (error: Error) => HookResult
/** /**
* Called before Nuxi writes `.nuxt/tsconfig.json` and `.nuxt/nuxt.d.ts`, allowing addition of custom references and declarations in `nuxt.d.ts`, or directly modifying the options in `tsconfig.json` * Called before Nuxi writes `.nuxt/tsconfig.json` and `.nuxt/nuxt.d.ts`, allowing addition of custom references and declarations in `nuxt.d.ts`, or directly modifying the options in `tsconfig.json`
*
* @param options Objects containing `references`, `declarations`, `tsConfig` * @param options Objects containing `references`, `declarations`, `tsConfig`
* @returns Promise * @returns Promise
*/ */
'prepare:types': (options: { references: TSReference[], declarations: string[], tsConfig: TSConfig }) => HookResult 'prepare:types': (options: { references: TSReference[], declarations: string[], tsConfig: TSConfig }) => HookResult
/** /**
* Called when the dev server is loading. * Called when the dev server is loading.
*
* @param listenerServer The HTTP/HTTPS server object * @param listenerServer The HTTP/HTTPS server object
* @param listener The server's listener object * @param listener The server's listener object
* @returns Promise * @returns Promise
@ -303,28 +272,24 @@ export interface NuxtHooks {
// Schema // Schema
/** /**
* Allows extending default schemas. * Allows extending default schemas.
*
* @param schemas Schemas to be extend * @param schemas Schemas to be extend
* @returns void * @returns void
*/ */
'schema:extend': (schemas: SchemaDefinition[]) => void 'schema:extend': (schemas: SchemaDefinition[]) => void
/** /**
* Allows extending resolved schema. * Allows extending resolved schema.
*
* @param schema Schema object * @param schema Schema object
* @returns void * @returns void
*/ */
'schema:resolved': (schema: Schema) => void 'schema:resolved': (schema: Schema) => void
/** /**
* Called before writing the given schema. * Called before writing the given schema.
*
* @param schema Schema object * @param schema Schema object
* @returns void * @returns void
*/ */
'schema:beforeWrite': (schema: Schema) => void 'schema:beforeWrite': (schema: Schema) => void
/** /**
* Called after the schema is written. * Called after the schema is written.
*
* @returns void * @returns void
*/ */
'schema:written': () => void 'schema:written': () => void
@ -332,14 +297,12 @@ export interface NuxtHooks {
// Vite // Vite
/** /**
* Allows to extend Vite default context. * Allows to extend Vite default context.
*
* @param viteBuildContext The vite build context object * @param viteBuildContext The vite build context object
* @returns Promise * @returns Promise
*/ */
'vite:extend': (viteBuildContext: { nuxt: Nuxt, config: ViteConfig }) => HookResult 'vite:extend': (viteBuildContext: { nuxt: Nuxt, config: ViteConfig }) => HookResult
/** /**
* Allows to extend Vite default config. * Allows to extend Vite default config.
*
* @param viteInlineConfig The vite inline config object * @param viteInlineConfig The vite inline config object
* @param env Server or client * @param env Server or client
* @returns Promise * @returns Promise
@ -347,7 +310,6 @@ export interface NuxtHooks {
'vite:extendConfig': (viteInlineConfig: ViteConfig, env: { isClient: boolean, isServer: boolean }) => HookResult 'vite:extendConfig': (viteInlineConfig: ViteConfig, env: { isClient: boolean, isServer: boolean }) => HookResult
/** /**
* Allows to read the resolved Vite config. * Allows to read the resolved Vite config.
*
* @param viteInlineConfig The vite inline config object * @param viteInlineConfig The vite inline config object
* @param env Server or client * @param env Server or client
* @returns Promise * @returns Promise
@ -355,7 +317,6 @@ export interface NuxtHooks {
'vite:configResolved': (viteInlineConfig: Readonly<ViteConfig>, env: { isClient: boolean, isServer: boolean }) => HookResult 'vite:configResolved': (viteInlineConfig: Readonly<ViteConfig>, env: { isClient: boolean, isServer: boolean }) => HookResult
/** /**
* Called when the Vite server is created. * Called when the Vite server is created.
*
* @param viteServer Vite development server * @param viteServer Vite development server
* @param env Server or client * @param env Server or client
* @returns Promise * @returns Promise
@ -363,7 +324,6 @@ export interface NuxtHooks {
'vite:serverCreated': (viteServer: ViteDevServer, env: { isClient: boolean, isServer: boolean }) => HookResult 'vite:serverCreated': (viteServer: ViteDevServer, env: { isClient: boolean, isServer: boolean }) => HookResult
/** /**
* Called after Vite server is compiled. * Called after Vite server is compiled.
*
* @returns Promise * @returns Promise
*/ */
'vite:compiled': () => HookResult 'vite:compiled': () => HookResult
@ -371,28 +331,24 @@ export interface NuxtHooks {
// webpack // webpack
/** /**
* Called before configuring the webpack compiler. * Called before configuring the webpack compiler.
*
* @param webpackConfigs Configs objects to be pushed to the compiler * @param webpackConfigs Configs objects to be pushed to the compiler
* @returns Promise * @returns Promise
*/ */
'webpack:config': (webpackConfigs: Configuration[]) => HookResult 'webpack:config': (webpackConfigs: Configuration[]) => HookResult
/** /**
* Allows to read the resolved webpack config * Allows to read the resolved webpack config
*
* @param webpackConfigs Configs objects to be pushed to the compiler * @param webpackConfigs Configs objects to be pushed to the compiler
* @returns Promise * @returns Promise
*/ */
'webpack:configResolved': (webpackConfigs: Readonly<Configuration>[]) => HookResult 'webpack:configResolved': (webpackConfigs: Readonly<Configuration>[]) => HookResult
/** /**
* Called right before compilation. * Called right before compilation.
*
* @param options The options to be added * @param options The options to be added
* @returns Promise * @returns Promise
*/ */
'webpack:compile': (options: { name: string, compiler: Compiler }) => HookResult 'webpack:compile': (options: { name: string, compiler: Compiler }) => HookResult
/** /**
* Called after resources are loaded. * Called after resources are loaded.
*
* @param options The compiler options * @param options The compiler options
* @returns Promise * @returns Promise
*/ */
@ -400,26 +356,22 @@ export interface NuxtHooks {
/** /**
* Called on `change` on WebpackBar. * Called on `change` on WebpackBar.
*
* @param shortPath the short path * @param shortPath the short path
* @returns void * @returns void
*/ */
'webpack:change': (shortPath: string) => void 'webpack:change': (shortPath: string) => void
/** /**
* Called on `done` if has errors on WebpackBar. * Called on `done` if has errors on WebpackBar.
*
* @returns void * @returns void
*/ */
'webpack:error': () => void 'webpack:error': () => void
/** /**
* Called on `allDone` on WebpackBar. * Called on `allDone` on WebpackBar.
*
* @returns void * @returns void
*/ */
'webpack:done': () => void 'webpack:done': () => void
/** /**
* Called on `progress` on WebpackBar. * Called on `progress` on WebpackBar.
*
* @param statesArray The array containing the states on progress * @param statesArray The array containing the states on progress
* @returns void * @returns void
*/ */

View File

@ -4,14 +4,12 @@ export interface ImportsOptions extends UnimportOptions {
/** /**
* Enable implicit auto import from Vue, Nuxt and module contributed utilities. * Enable implicit auto import from Vue, Nuxt and module contributed utilities.
* Generate global TypeScript definitions. * Generate global TypeScript definitions.
*
* @default true * @default true
*/ */
autoImport?: boolean autoImport?: boolean
/** /**
* Directories to scan for auto imports. * Directories to scan for auto imports.
*
* @see https://nuxt.com/docs/guide/directory-structure/composables#how-files-are-scanned * @see https://nuxt.com/docs/guide/directory-structure/composables#how-files-are-scanned
* @default ['./composables', './utils'] * @default ['./composables', './utils']
*/ */
@ -19,7 +17,6 @@ export interface ImportsOptions extends UnimportOptions {
/** /**
* Assign auto imported utilities to `globalThis` instead of using built time transformation. * Assign auto imported utilities to `globalThis` instead of using built time transformation.
*
* @default false * @default false
*/ */
global?: boolean global?: boolean

View File

@ -2,7 +2,6 @@
import { Agent as HTTPSAgent } from 'node:https' import { Agent as HTTPSAgent } from 'node:https'
import { $fetch } from 'ofetch' import { $fetch } from 'ofetch'
// eslint-disable-next-line jsdoc/valid-types
/** @type {import('../vite-node').ViteNodeServerOptions} */ /** @type {import('../vite-node').ViteNodeServerOptions} */
export const viteNodeOptions = JSON.parse(process.env.NUXT_VITE_NODE_OPTIONS || '{}') export const viteNodeOptions = JSON.parse(process.env.NUXT_VITE_NODE_OPTIONS || '{}')

View File

@ -8,7 +8,6 @@ import { viteNodeFetch, viteNodeOptions } from './vite-node-shared.mjs'
const runner = createRunner() const runner = createRunner()
// eslint-disable-next-line jsdoc/valid-types
/** @type {(ssrContext: import('#app').NuxtSSRContext) => Promise<any>} */ /** @type {(ssrContext: import('#app').NuxtSSRContext) => Promise<any>} */
let render let render

View File

@ -171,7 +171,7 @@ function baseTranspile (ctx: WebpackConfigContext) {
ctx.transpile = [...transpile, ...ctx.transpile] ctx.transpile = [...transpile, ...ctx.transpile]
} }
function getCache (ctx: WebpackConfigContext): webpack.Configuration['cache'] { function getCache (ctx: WebpackConfigContext): Configuration['cache'] {
if (!ctx.options.dev) { if (!ctx.options.dev) {
return false return false
} }
@ -192,7 +192,7 @@ function getCache (ctx: WebpackConfigContext): webpack.Configuration['cache'] {
// } // }
} }
function getOutput (ctx: WebpackConfigContext): webpack.Configuration['output'] { function getOutput (ctx: WebpackConfigContext): Configuration['output'] {
return { return {
path: resolve(ctx.options.buildDir, 'dist', ctx.isServer ? 'server' : joinURL('client', ctx.options.app.buildAssetsDir)), path: resolve(ctx.options.buildDir, 'dist', ctx.isServer ? 'server' : joinURL('client', ctx.options.app.buildAssetsDir)),
filename: fileName(ctx, 'app'), filename: fileName(ctx, 'app'),

View File

@ -5,7 +5,7 @@ import { defineEventHandler, fromNodeMiddleware } from 'h3'
import type { OutputFileSystem } from 'webpack-dev-middleware' import type { OutputFileSystem } from 'webpack-dev-middleware'
import webpackDevMiddleware from 'webpack-dev-middleware' import webpackDevMiddleware from 'webpack-dev-middleware'
import webpackHotMiddleware from 'webpack-hot-middleware' import webpackHotMiddleware from 'webpack-hot-middleware'
import type { Compiler, Watching } from 'webpack' import type { Compiler, Stats, Watching } from 'webpack'
import { defu } from 'defu' import { defu } from 'defu'
import type { NuxtBuilder } from '@nuxt/schema' import type { NuxtBuilder } from '@nuxt/schema'
import { joinURL } from 'ufo' import { joinURL } from 'ufo'
@ -163,7 +163,7 @@ async function compile (compiler: Compiler) {
} }
// --- Production Build --- // --- Production Build ---
const stats = await new Promise<webpack.Stats>((resolve, reject) => compiler.run((err, stats) => err ? reject(err) : resolve(stats!))) const stats = await new Promise<Stats>((resolve, reject) => compiler.run((err, stats) => err ? reject(err) : resolve(stats!)))
if (stats.hasErrors()) { if (stats.hasErrors()) {
const error = new Error('Nuxt build error') const error = new Error('Nuxt build error')

View File

@ -56,8 +56,8 @@ importers:
specifier: 2.28.1 specifier: 2.28.1
version: 2.28.1(@typescript-eslint/parser@6.6.0)(eslint-import-resolver-typescript@3.6.0)(eslint@8.51.0) version: 2.28.1(@typescript-eslint/parser@6.6.0)(eslint-import-resolver-typescript@3.6.0)(eslint@8.51.0)
eslint-plugin-jsdoc: eslint-plugin-jsdoc:
specifier: 41.1.2 specifier: 46.8.2
version: 41.1.2(eslint@8.51.0) version: 46.8.2(eslint@8.51.0)
eslint-plugin-no-only-tests: eslint-plugin-no-only-tests:
specifier: 3.1.0 specifier: 3.1.0
version: 3.1.0 version: 3.1.0
@ -1341,11 +1341,11 @@ packages:
engines: {node: '>=10.0.0'} engines: {node: '>=10.0.0'}
dev: false dev: false
/@es-joy/jsdoccomment@0.37.1: /@es-joy/jsdoccomment@0.40.1:
resolution: {integrity: sha512-5vxWJ1gEkEF0yRd0O+uK6dHJf7adrxwQSX8PuRiPfFSAbNLnY0ZJfXaZucoz14Jj2N11xn2DnlEPwWRpYpvRjg==} resolution: {integrity: sha512-YORCdZSusAlBrFpZ77pJjc5r1bQs5caPWtAu+WWmiSo+8XaUzseapVrfAtiRFbQWnrBxxLLEwF6f6ZG/UgCQCg==}
engines: {node: ^14 || ^16 || ^17 || ^18 || ^19 || ^20} engines: {node: '>=16'}
dependencies: dependencies:
comment-parser: 1.3.1 comment-parser: 1.4.0
esquery: 1.5.0 esquery: 1.5.0
jsdoc-type-pratt-parser: 4.0.0 jsdoc-type-pratt-parser: 4.0.0
dev: true dev: true
@ -4538,8 +4538,8 @@ packages:
engines: {node: ^12.20.0 || >=14} engines: {node: ^12.20.0 || >=14}
dev: true dev: true
/comment-parser@1.3.1: /comment-parser@1.4.0:
resolution: {integrity: sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA==} resolution: {integrity: sha512-QLyTNiZ2KDOibvFPlZ6ZngVsZ/0gYnE6uTXi5aoDg8ed3AkJAz4sEje3Y8a29hQ1s6A99MZXe47fLAXQ1rTqaw==}
engines: {node: '>= 12.0.0'} engines: {node: '>= 12.0.0'}
dev: true dev: true
@ -5486,19 +5486,20 @@ packages:
- supports-color - supports-color
dev: true dev: true
/eslint-plugin-jsdoc@41.1.2(eslint@8.51.0): /eslint-plugin-jsdoc@46.8.2(eslint@8.51.0):
resolution: {integrity: sha512-MePJXdGiPW7AG06CU5GbKzYtKpoHwTq1lKijjq+RwL/cQkZtBZ59Zbv5Ep0RVxSMnq6242249/n+w4XrTZ1Afg==} resolution: {integrity: sha512-5TSnD018f3tUJNne4s4gDWQflbsgOycIKEUBoCLn6XtBMgNHxQFmV8vVxUtiPxAQq8lrX85OaSG/2gnctxw9uQ==}
engines: {node: ^14 || ^16 || ^17 || ^18 || ^19} engines: {node: '>=16'}
peerDependencies: peerDependencies:
eslint: ^7.0.0 || ^8.0.0 eslint: ^7.0.0 || ^8.0.0
dependencies: dependencies:
'@es-joy/jsdoccomment': 0.37.1 '@es-joy/jsdoccomment': 0.40.1
are-docs-informative: 0.0.2 are-docs-informative: 0.0.2
comment-parser: 1.3.1 comment-parser: 1.4.0
debug: 4.3.4 debug: 4.3.4
escape-string-regexp: 4.0.0 escape-string-regexp: 4.0.0
eslint: 8.51.0 eslint: 8.51.0
esquery: 1.5.0 esquery: 1.5.0
is-builtin-module: 3.2.1
semver: 7.5.4 semver: 7.5.4
spdx-expression-parse: 3.0.1 spdx-expression-parse: 3.0.1
transitivePeerDependencies: transitivePeerDependencies:

View File

@ -2,7 +2,6 @@ export default defineNuxtSchema({
appConfig: { appConfig: {
/** /**
* This is an example app config defined in custom schema * This is an example app config defined in custom schema
*
* @type {123 | 456} * @type {123 | 456}
*/ */
userConfig: 123 userConfig: 123