@depup/nuxt__kit 4.4.2-depup.0 → 4.5.0-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/changes.json +8 -4
- package/dist/index.d.mts +1020 -261
- package/dist/index.mjs +925 -67
- package/package.json +40 -34
package/dist/index.d.mts
CHANGED
|
@@ -2,19 +2,18 @@ import { ConsolaInstance, ConsolaOptions } from "consola";
|
|
|
2
2
|
import { UseContext } from "unctx";
|
|
3
3
|
import { GlobOptions } from "tinyglobby";
|
|
4
4
|
import { LoadConfigOptions } from "c12";
|
|
5
|
-
import { Component, ComponentsDir, ModuleDefinition, ModuleMeta, ModuleOptions, Nuxt, NuxtAppConfig, NuxtCompatibility, NuxtCompatibilityIssues, NuxtConfig, NuxtHooks, NuxtMiddleware, NuxtModule, NuxtOptions, NuxtPlugin, NuxtPluginTemplate, NuxtServerTemplate, NuxtTemplate, NuxtTypeTemplate, ResolvedNuxtTemplate, SchemaDefinition } from "@nuxt/schema";
|
|
6
|
-
import { Import,
|
|
5
|
+
import { Component, ComponentsDir, ModuleDefinition, ModuleMeta, ModuleOptions, Nuxt, NuxtAppConfig, NuxtBuildOutputs, NuxtCompatibility, NuxtCompatibilityIssues, NuxtConfig, NuxtHooks, NuxtMiddleware, NuxtModule, NuxtOptions, NuxtPlugin, NuxtPluginTemplate, NuxtServerTemplate, NuxtTemplate, NuxtTypeTemplate, ResolvedNuxtTemplate, SchemaDefinition } from "@nuxt/schema";
|
|
6
|
+
import { Import, Preset } from "unimport";
|
|
7
7
|
import { Configuration, WebpackPluginInstance } from "webpack";
|
|
8
|
-
import { RspackPluginInstance } from "@rspack/core";
|
|
9
8
|
import { Plugin, UserConfig } from "vite";
|
|
10
9
|
import * as NitroV2 from "nitropack/types";
|
|
11
10
|
import * as NitroV3 from "nitro/types";
|
|
12
11
|
|
|
13
12
|
//#region src/module/define.d.ts
|
|
14
13
|
/**
|
|
15
|
-
* Define a Nuxt module, automatically merging defaults with user provided options, installing
|
|
16
|
-
* any hooks that are provided, and calling an optional setup function for full control.
|
|
17
|
-
*/
|
|
14
|
+
* Define a Nuxt module, automatically merging defaults with user provided options, installing
|
|
15
|
+
* any hooks that are provided, and calling an optional setup function for full control.
|
|
16
|
+
*/
|
|
18
17
|
declare function defineNuxtModule<TOptions extends ModuleOptions>(definition: ModuleDefinition<TOptions, Partial<TOptions>, false> | NuxtModule<TOptions, Partial<TOptions>, false>): NuxtModule<TOptions, TOptions, false>;
|
|
19
18
|
declare function defineNuxtModule<TOptions extends ModuleOptions>(): {
|
|
20
19
|
with: <TOptionsDefaults extends Partial<TOptions>>(definition: ModuleDefinition<TOptions, TOptionsDefaults, true> | NuxtModule<TOptions, TOptionsDefaults, true>) => NuxtModule<TOptions, TOptionsDefaults, true>;
|
|
@@ -23,15 +22,15 @@ declare function defineNuxtModule<TOptions extends ModuleOptions>(): {
|
|
|
23
22
|
//#region src/module/install.d.ts
|
|
24
23
|
type ModuleToInstall = string | NuxtModule<ModuleOptions, Partial<ModuleOptions>, false>;
|
|
25
24
|
/**
|
|
26
|
-
* Installs a set of modules on a Nuxt instance.
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
25
|
+
* Installs a set of modules on a Nuxt instance.
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
29
28
|
declare function installModules(modulesToInstall: Map<ModuleToInstall, Record<string, any>>, resolvedModulePaths: Set<string>, nuxt?: Nuxt): Promise<void>;
|
|
30
29
|
/**
|
|
31
|
-
* Installs a module on a Nuxt instance.
|
|
32
|
-
* @deprecated Use module dependencies.
|
|
33
|
-
*/
|
|
34
|
-
declare function installModule<T extends string | NuxtModule, Config extends Extract<NonNullable<NuxtConfig[
|
|
30
|
+
* Installs a module on a Nuxt instance.
|
|
31
|
+
* @deprecated Use module dependencies.
|
|
32
|
+
*/
|
|
33
|
+
declare function installModule<T extends string | NuxtModule, Config extends Extract<NonNullable<NuxtConfig['modules']>[number], [T, any]>>(moduleToInstall: T, inlineOptions?: [Config] extends [never] ? any : Config[1], nuxt?: Nuxt): Promise<void>;
|
|
35
34
|
declare function resolveModuleWithOptions(definition: NuxtModule<any> | string | false | undefined | null | [(NuxtModule | string)?, Record<string, any>?], nuxt: Nuxt): {
|
|
36
35
|
resolvedPath?: string;
|
|
37
36
|
module: string | NuxtModule<any>;
|
|
@@ -47,26 +46,26 @@ declare const normalizeModuleTranspilePath: (p: string) => string;
|
|
|
47
46
|
//#endregion
|
|
48
47
|
//#region src/module/compatibility.d.ts
|
|
49
48
|
/**
|
|
50
|
-
* Check if a Nuxt module is installed by name.
|
|
51
|
-
*
|
|
52
|
-
* This will check both the installed modules and the modules to be installed. Note
|
|
53
|
-
* that it cannot detect if a module is _going to be_ installed programmatically by another module.
|
|
54
|
-
*/
|
|
49
|
+
* Check if a Nuxt module is installed by name.
|
|
50
|
+
*
|
|
51
|
+
* This will check both the installed modules and the modules to be installed. Note
|
|
52
|
+
* that it cannot detect if a module is _going to be_ installed programmatically by another module.
|
|
53
|
+
*/
|
|
55
54
|
declare function hasNuxtModule(moduleName: string, nuxt?: Nuxt): boolean;
|
|
56
55
|
/**
|
|
57
|
-
* Checks if a Nuxt module is compatible with a given semver version.
|
|
58
|
-
*/
|
|
56
|
+
* Checks if a Nuxt module is compatible with a given semver version.
|
|
57
|
+
*/
|
|
59
58
|
declare function hasNuxtModuleCompatibility(module: string | NuxtModule, semverVersion: string, nuxt?: Nuxt): Promise<boolean>;
|
|
60
59
|
/**
|
|
61
|
-
* Get the version of a Nuxt module.
|
|
62
|
-
*
|
|
63
|
-
* Scans installed modules for the version, if it's not found it will attempt to load the module instance and get the version from there.
|
|
64
|
-
*/
|
|
60
|
+
* Get the version of a Nuxt module.
|
|
61
|
+
*
|
|
62
|
+
* Scans installed modules for the version, if it's not found it will attempt to load the module instance and get the version from there.
|
|
63
|
+
*/
|
|
65
64
|
declare function getNuxtModuleVersion(module: string | NuxtModule, nuxt?: Nuxt | any): Promise<string | false>;
|
|
66
65
|
//#endregion
|
|
67
66
|
//#region src/loader/config.d.ts
|
|
68
|
-
interface LoadNuxtConfigOptions extends Omit<LoadConfigOptions<NuxtConfig>,
|
|
69
|
-
overrides?: Exclude<LoadConfigOptions<NuxtConfig>[
|
|
67
|
+
interface LoadNuxtConfigOptions extends Omit<LoadConfigOptions<NuxtConfig>, 'overrides'> {
|
|
68
|
+
overrides?: Exclude<LoadConfigOptions<NuxtConfig>['overrides'], Promise<any> | Function>;
|
|
70
69
|
}
|
|
71
70
|
declare function loadNuxtConfig(opts: LoadNuxtConfigOptions): Promise<NuxtOptions>;
|
|
72
71
|
//#endregion
|
|
@@ -107,218 +106,233 @@ interface LayerDirectories {
|
|
|
107
106
|
readonly appPlugins: string;
|
|
108
107
|
}
|
|
109
108
|
/**
|
|
110
|
-
* Get the resolved directory paths for all layers in a Nuxt application.
|
|
111
|
-
*
|
|
112
|
-
* Returns an array of LayerDirectories objects, ordered by layer priority:
|
|
113
|
-
* - The first layer is the user/project layer (highest priority)
|
|
114
|
-
* - Earlier layers override later layers in the array
|
|
115
|
-
* - Base layers appear last in the array (lowest priority)
|
|
116
|
-
*
|
|
117
|
-
* @param nuxt - The Nuxt instance to get layers from. Defaults to the current Nuxt context.
|
|
118
|
-
* @returns Array of LayerDirectories objects, ordered by priority (user layer first)
|
|
119
|
-
*/
|
|
109
|
+
* Get the resolved directory paths for all layers in a Nuxt application.
|
|
110
|
+
*
|
|
111
|
+
* Returns an array of LayerDirectories objects, ordered by layer priority:
|
|
112
|
+
* - The first layer is the user/project layer (highest priority)
|
|
113
|
+
* - Earlier layers override later layers in the array
|
|
114
|
+
* - Base layers appear last in the array (lowest priority)
|
|
115
|
+
*
|
|
116
|
+
* @param nuxt - The Nuxt instance to get layers from. Defaults to the current Nuxt context.
|
|
117
|
+
* @returns Array of LayerDirectories objects, ordered by priority (user layer first)
|
|
118
|
+
*/
|
|
120
119
|
declare function getLayerDirectories(nuxt?: Nuxt): LayerDirectories[];
|
|
121
120
|
//#endregion
|
|
122
121
|
//#region src/head.d.ts
|
|
123
|
-
declare function setGlobalHead(head: NuxtAppConfig[
|
|
122
|
+
declare function setGlobalHead(head: NuxtAppConfig['head']): void;
|
|
124
123
|
//#endregion
|
|
125
124
|
//#region src/imports.d.ts
|
|
126
125
|
declare function addImports(imports: Import | Import[]): void;
|
|
127
126
|
declare function addImportsDir(dirs: string | string[], opts?: {
|
|
128
127
|
prepend?: boolean;
|
|
129
128
|
}): void;
|
|
130
|
-
declare function addImportsSources(presets:
|
|
129
|
+
declare function addImportsSources(presets: Preset | Preset[]): void;
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region src/app-config.d.ts
|
|
132
|
+
/**
|
|
133
|
+
* Update Nuxt app configuration.
|
|
134
|
+
* @since 4.5.0
|
|
135
|
+
*/
|
|
136
|
+
declare function updateAppConfig(appConfig: Record<string, unknown>): void;
|
|
131
137
|
//#endregion
|
|
132
138
|
//#region src/runtime-config.d.ts
|
|
133
139
|
/**
|
|
134
|
-
* Access 'resolved' Nuxt runtime configuration, with values updated from environment.
|
|
135
|
-
*
|
|
136
|
-
* This mirrors the runtime behavior of Nitro.
|
|
137
|
-
*/
|
|
140
|
+
* Access 'resolved' Nuxt runtime configuration, with values updated from environment.
|
|
141
|
+
*
|
|
142
|
+
* This mirrors the runtime behavior of Nitro.
|
|
143
|
+
*/
|
|
138
144
|
declare function useRuntimeConfig(): Record<string, any>;
|
|
139
145
|
/**
|
|
140
|
-
* Update Nuxt runtime configuration.
|
|
141
|
-
*/
|
|
146
|
+
* Update Nuxt runtime configuration.
|
|
147
|
+
*/
|
|
142
148
|
declare function updateRuntimeConfig(runtimeConfig: Record<string, unknown>): void | Promise<void>;
|
|
143
149
|
//#endregion
|
|
144
150
|
//#region src/build.d.ts
|
|
145
151
|
type Arrayable<T> = T | T[];
|
|
146
152
|
type Thenable<T> = T | Promise<T>;
|
|
153
|
+
type RspackCompatiblePluginInstance = {
|
|
154
|
+
apply: (...args: any[]) => void;
|
|
155
|
+
[k: string]: any;
|
|
156
|
+
};
|
|
147
157
|
interface ExtendConfigOptions {
|
|
148
158
|
/**
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
159
|
+
* Install plugin on dev
|
|
160
|
+
* @default true
|
|
161
|
+
*/
|
|
152
162
|
dev?: boolean;
|
|
153
163
|
/**
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
164
|
+
* Install plugin on build
|
|
165
|
+
* @default true
|
|
166
|
+
*/
|
|
157
167
|
build?: boolean;
|
|
158
168
|
/**
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
169
|
+
* Install plugin on server side
|
|
170
|
+
* @default true
|
|
171
|
+
*/
|
|
162
172
|
server?: boolean;
|
|
163
173
|
/**
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
174
|
+
* Install plugin on client side
|
|
175
|
+
* @default true
|
|
176
|
+
*/
|
|
167
177
|
client?: boolean;
|
|
168
178
|
/**
|
|
169
|
-
|
|
170
|
-
|
|
179
|
+
* Prepends the plugin to the array with `unshift()` instead of `push()`.
|
|
180
|
+
*/
|
|
171
181
|
prepend?: boolean;
|
|
172
182
|
}
|
|
173
183
|
interface ExtendWebpackConfigOptions extends ExtendConfigOptions {}
|
|
174
|
-
interface ExtendViteConfigOptions extends Omit<ExtendConfigOptions,
|
|
184
|
+
interface ExtendViteConfigOptions extends Omit<ExtendConfigOptions, 'server' | 'client'> {
|
|
175
185
|
/**
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
186
|
+
* Extend server Vite configuration
|
|
187
|
+
* @default true
|
|
188
|
+
* @deprecated calling \`extendViteConfig\` with only server/client environment is deprecated.
|
|
189
|
+
* Nuxt 5+ uses the Vite Environment API which shares a configuration between environments.
|
|
190
|
+
* You can likely use a Vite plugin to achieve the same result.
|
|
191
|
+
*/
|
|
182
192
|
server?: boolean;
|
|
183
193
|
/**
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
194
|
+
* Extend client Vite configuration
|
|
195
|
+
* @default true
|
|
196
|
+
* @deprecated calling \`extendViteConfig\` with only server/client environment is deprecated.
|
|
197
|
+
* Nuxt 5+ uses the Vite Environment API which shares a configuration between environments.
|
|
198
|
+
* You can likely use a Vite plugin to achieve the same result.
|
|
199
|
+
*/
|
|
190
200
|
client?: boolean;
|
|
191
201
|
}
|
|
192
202
|
type ExtendWebpacklikeConfig = (fn: (config: Configuration) => void, options?: ExtendWebpackConfigOptions) => void;
|
|
193
203
|
/**
|
|
194
|
-
* Extend webpack config
|
|
195
|
-
*
|
|
196
|
-
* The fallback function might be called multiple times
|
|
197
|
-
* when applying to both client and server builds.
|
|
198
|
-
*/
|
|
204
|
+
* Extend webpack config
|
|
205
|
+
*
|
|
206
|
+
* The fallback function might be called multiple times
|
|
207
|
+
* when applying to both client and server builds.
|
|
208
|
+
*/
|
|
199
209
|
declare const extendWebpackConfig: ExtendWebpacklikeConfig;
|
|
200
210
|
/**
|
|
201
|
-
* Extend rspack config
|
|
202
|
-
*
|
|
203
|
-
* The fallback function might be called multiple times
|
|
204
|
-
* when applying to both client and server builds.
|
|
205
|
-
*/
|
|
211
|
+
* Extend rspack config
|
|
212
|
+
*
|
|
213
|
+
* The fallback function might be called multiple times
|
|
214
|
+
* when applying to both client and server builds.
|
|
215
|
+
*/
|
|
206
216
|
declare const extendRspackConfig: ExtendWebpacklikeConfig;
|
|
207
217
|
/**
|
|
208
|
-
* Extend Vite config
|
|
209
|
-
*/
|
|
218
|
+
* Extend Vite config
|
|
219
|
+
*/
|
|
210
220
|
declare function extendViteConfig(fn: ((config: UserConfig) => Thenable<void>), options?: ExtendViteConfigOptions): (() => void) | undefined;
|
|
211
221
|
/**
|
|
212
|
-
* Append webpack plugin to the config.
|
|
213
|
-
*/
|
|
222
|
+
* Append webpack plugin to the config.
|
|
223
|
+
*/
|
|
214
224
|
declare function addWebpackPlugin(pluginOrGetter: Arrayable<WebpackPluginInstance> | (() => Thenable<Arrayable<WebpackPluginInstance>>), options?: ExtendWebpackConfigOptions): void;
|
|
215
225
|
/**
|
|
216
|
-
* Append rspack plugin to the config.
|
|
217
|
-
*/
|
|
218
|
-
declare function addRspackPlugin(pluginOrGetter: Arrayable<
|
|
226
|
+
* Append rspack plugin to the config.
|
|
227
|
+
*/
|
|
228
|
+
declare function addRspackPlugin(pluginOrGetter: Arrayable<RspackCompatiblePluginInstance> | (() => Thenable<Arrayable<RspackCompatiblePluginInstance>>), options?: ExtendWebpackConfigOptions): void;
|
|
219
229
|
/**
|
|
220
|
-
* Append Vite plugin to the config.
|
|
221
|
-
*/
|
|
230
|
+
* Append Vite plugin to the config.
|
|
231
|
+
*/
|
|
222
232
|
declare function addVitePlugin(pluginOrGetter: Arrayable<Plugin> | (() => Thenable<Arrayable<Plugin>>), options?: ExtendConfigOptions): void;
|
|
223
233
|
interface AddBuildPluginFactory {
|
|
224
234
|
vite?: () => Thenable<Arrayable<Plugin>>;
|
|
225
235
|
webpack?: () => Thenable<Arrayable<WebpackPluginInstance>>;
|
|
226
|
-
rspack?: () => Thenable<Arrayable<
|
|
236
|
+
rspack?: () => Thenable<Arrayable<RspackCompatiblePluginInstance>>;
|
|
227
237
|
}
|
|
228
238
|
declare function addBuildPlugin(pluginFactory: AddBuildPluginFactory, options?: ExtendConfigOptions): void;
|
|
239
|
+
/**
|
|
240
|
+
* Set the build output for the given key. See {@link NuxtBuildOutputs}.
|
|
241
|
+
*/
|
|
242
|
+
declare function setBuildOutput<K extends keyof NuxtBuildOutputs>(key: K, provider: NuxtBuildOutputs[K], nuxt?: Nuxt): void;
|
|
229
243
|
//#endregion
|
|
230
244
|
//#region src/compatibility.d.ts
|
|
231
245
|
declare function normalizeSemanticVersion(version: string): string;
|
|
232
246
|
/**
|
|
233
|
-
* Check version constraints and return incompatibility issues as an array
|
|
234
|
-
*/
|
|
247
|
+
* Check version constraints and return incompatibility issues as an array
|
|
248
|
+
*/
|
|
235
249
|
declare function checkNuxtCompatibility(constraints: NuxtCompatibility, nuxt?: Nuxt): Promise<NuxtCompatibilityIssues>;
|
|
236
250
|
/**
|
|
237
|
-
* Check version constraints and throw a detailed error if has any, otherwise returns true
|
|
238
|
-
*/
|
|
251
|
+
* Check version constraints and throw a detailed error if has any, otherwise returns true
|
|
252
|
+
*/
|
|
239
253
|
declare function assertNuxtCompatibility(constraints: NuxtCompatibility, nuxt?: Nuxt): Promise<true>;
|
|
240
254
|
/**
|
|
241
|
-
* Check version constraints and return true if passed, otherwise returns false
|
|
242
|
-
*/
|
|
255
|
+
* Check version constraints and return true if passed, otherwise returns false
|
|
256
|
+
*/
|
|
243
257
|
declare function hasNuxtCompatibility(constraints: NuxtCompatibility, nuxt?: Nuxt): Promise<boolean>;
|
|
244
258
|
type NuxtMajorVersion = 2 | 3 | 4;
|
|
245
259
|
/**
|
|
246
|
-
* Check if current Nuxt instance is of specified major version
|
|
247
|
-
*/
|
|
260
|
+
* Check if current Nuxt instance is of specified major version
|
|
261
|
+
*/
|
|
248
262
|
declare function isNuxtMajorVersion(majorVersion: NuxtMajorVersion, nuxt?: Nuxt): boolean;
|
|
249
263
|
/**
|
|
250
|
-
* @deprecated Use `isNuxtMajorVersion(2, nuxt)` instead. This may be removed in \@nuxt/kit v5 or a future major version.
|
|
251
|
-
*/
|
|
264
|
+
* @deprecated Use `isNuxtMajorVersion(2, nuxt)` instead. This may be removed in \@nuxt/kit v5 or a future major version.
|
|
265
|
+
*/
|
|
252
266
|
declare function isNuxt2(nuxt?: Nuxt): boolean;
|
|
253
267
|
/**
|
|
254
|
-
* @deprecated Use `isNuxtMajorVersion(3, nuxt)` instead. This may be removed in \@nuxt/kit v5 or a future major version.
|
|
255
|
-
*/
|
|
268
|
+
* @deprecated Use `isNuxtMajorVersion(3, nuxt)` instead. This may be removed in \@nuxt/kit v5 or a future major version.
|
|
269
|
+
*/
|
|
256
270
|
declare function isNuxt3(nuxt?: Nuxt): boolean;
|
|
257
271
|
/**
|
|
258
|
-
* Get nuxt version
|
|
259
|
-
*/
|
|
272
|
+
* Get nuxt version
|
|
273
|
+
*/
|
|
260
274
|
declare function getNuxtVersion(nuxt?: Nuxt | any): string;
|
|
261
275
|
//#endregion
|
|
262
276
|
//#region src/components.d.ts
|
|
263
277
|
/**
|
|
264
|
-
* Register a directory to be scanned for components and imported only when used.
|
|
265
|
-
*/
|
|
278
|
+
* Register a directory to be scanned for components and imported only when used.
|
|
279
|
+
*/
|
|
266
280
|
declare function addComponentsDir(dir: ComponentsDir, opts?: {
|
|
267
281
|
prepend?: boolean;
|
|
268
282
|
}): void;
|
|
269
283
|
type AddComponentOptions = {
|
|
270
284
|
name: string;
|
|
271
285
|
filePath: string;
|
|
272
|
-
} & Partial<Exclude<Component,
|
|
286
|
+
} & Partial<Exclude<Component, 'shortPath' | 'async' | 'level' | 'import' | 'asyncImport'>>;
|
|
273
287
|
/**
|
|
274
|
-
* This utility takes a file path or npm package that is scanned for named exports, which are get added automatically
|
|
275
|
-
*/
|
|
276
|
-
declare function addComponentExports(opts: Omit<AddComponentOptions,
|
|
288
|
+
* This utility takes a file path or npm package that is scanned for named exports, which are get added automatically
|
|
289
|
+
*/
|
|
290
|
+
declare function addComponentExports(opts: Omit<AddComponentOptions, 'name'> & {
|
|
277
291
|
prefix?: string;
|
|
278
292
|
}): void;
|
|
279
293
|
/**
|
|
280
|
-
* Register a component by its name and filePath.
|
|
281
|
-
*/
|
|
294
|
+
* Register a component by its name and filePath.
|
|
295
|
+
*/
|
|
282
296
|
declare function addComponent(opts: AddComponentOptions): void;
|
|
283
297
|
//#endregion
|
|
284
298
|
//#region src/context.d.ts
|
|
285
299
|
/**
|
|
286
|
-
* Direct access to the Nuxt global context - see https://github.com/unjs/unctx.
|
|
287
|
-
* @deprecated Use `getNuxtCtx` instead
|
|
288
|
-
*/
|
|
300
|
+
* Direct access to the Nuxt global context - see https://github.com/unjs/unctx.
|
|
301
|
+
* @deprecated Use `getNuxtCtx` instead
|
|
302
|
+
*/
|
|
289
303
|
declare const nuxtCtx: UseContext<Nuxt>;
|
|
290
304
|
/** Direct access to the Nuxt context with asyncLocalStorage - see https://github.com/unjs/unctx. */
|
|
291
305
|
declare const getNuxtCtx: () => Nuxt | null;
|
|
292
306
|
/**
|
|
293
|
-
* Get access to Nuxt instance.
|
|
294
|
-
*
|
|
295
|
-
* Throws an error if Nuxt instance is unavailable.
|
|
296
|
-
* @example
|
|
297
|
-
* ```js
|
|
298
|
-
* const nuxt = useNuxt()
|
|
299
|
-
* ```
|
|
300
|
-
*/
|
|
307
|
+
* Get access to Nuxt instance.
|
|
308
|
+
*
|
|
309
|
+
* Throws an error if Nuxt instance is unavailable.
|
|
310
|
+
* @example
|
|
311
|
+
* ```js
|
|
312
|
+
* const nuxt = useNuxt()
|
|
313
|
+
* ```
|
|
314
|
+
*/
|
|
301
315
|
declare function useNuxt(): Nuxt;
|
|
302
316
|
/**
|
|
303
|
-
* Get access to Nuxt instance.
|
|
304
|
-
*
|
|
305
|
-
* Returns null if Nuxt instance is unavailable.
|
|
306
|
-
* @example
|
|
307
|
-
* ```js
|
|
308
|
-
* const nuxt = tryUseNuxt()
|
|
309
|
-
* if (nuxt) {
|
|
310
|
-
* // Do something
|
|
311
|
-
* }
|
|
312
|
-
* ```
|
|
313
|
-
*/
|
|
317
|
+
* Get access to Nuxt instance.
|
|
318
|
+
*
|
|
319
|
+
* Returns null if Nuxt instance is unavailable.
|
|
320
|
+
* @example
|
|
321
|
+
* ```js
|
|
322
|
+
* const nuxt = tryUseNuxt()
|
|
323
|
+
* if (nuxt) {
|
|
324
|
+
* // Do something
|
|
325
|
+
* }
|
|
326
|
+
* ```
|
|
327
|
+
*/
|
|
314
328
|
declare function tryUseNuxt(): Nuxt | null;
|
|
315
329
|
declare function runWithNuxtContext<T extends (...args: any[]) => any>(nuxt: Nuxt, fn: T): ReturnType<T>;
|
|
316
330
|
//#endregion
|
|
317
331
|
//#region src/ignore.d.ts
|
|
318
332
|
declare function createIsIgnored(nuxt?: Nuxt | null | undefined): (pathname: string, stats?: unknown) => boolean;
|
|
319
333
|
/**
|
|
320
|
-
* Return a filter function to filter an array of paths
|
|
321
|
-
*/
|
|
334
|
+
* Return a filter function to filter an array of paths
|
|
335
|
+
*/
|
|
322
336
|
declare function isIgnored(pathname: string, _stats?: unknown, nuxt?: Nuxt | null | undefined): boolean;
|
|
323
337
|
declare function resolveIgnorePatterns(relativePath?: string): string[];
|
|
324
338
|
//#endregion
|
|
@@ -326,33 +340,33 @@ declare function resolveIgnorePatterns(relativePath?: string): string[];
|
|
|
326
340
|
declare function addLayout(template: NuxtTemplate | string, name?: string): void;
|
|
327
341
|
//#endregion
|
|
328
342
|
//#region src/nitro-types.d.ts
|
|
329
|
-
type isNitroV2 =
|
|
330
|
-
type isNitroV3 =
|
|
343
|
+
type isNitroV2 = 'options' extends keyof NitroV2.Nitro ? '___INVALID' extends keyof NitroV2.Nitro ? false : true : false;
|
|
344
|
+
type isNitroV3 = 'options' extends keyof NitroV3.Nitro ? '___INVALID' extends keyof NitroV3.Nitro ? false : true : false;
|
|
331
345
|
type Nitro = isNitroV2 extends true ? isNitroV3 extends true ? NitroV2.Nitro | NitroV3.Nitro : NitroV2.Nitro : NitroV3.Nitro;
|
|
332
346
|
type NitroDevEventHandler = isNitroV2 extends true ? isNitroV3 extends true ? NitroV2.NitroDevEventHandler | NitroV3.NitroDevEventHandler : NitroV2.NitroDevEventHandler : NitroV3.NitroDevEventHandler;
|
|
333
347
|
type NitroEventHandler = isNitroV2 extends true ? isNitroV3 extends true ? NitroV2.NitroEventHandler | NitroV3.NitroEventHandler : NitroV2.NitroEventHandler : NitroV3.NitroEventHandler;
|
|
334
348
|
type NitroRouteConfig = isNitroV2 extends true ? isNitroV3 extends true ? NitroV2.NitroRouteConfig | NitroV3.NitroRouteConfig : NitroV2.NitroRouteConfig : NitroV3.NitroRouteConfig;
|
|
335
349
|
//#endregion
|
|
336
350
|
//#region src/pages.d.ts
|
|
337
|
-
declare function extendPages(cb: NuxtHooks[
|
|
351
|
+
declare function extendPages(cb: NuxtHooks['pages:extend']): void;
|
|
338
352
|
interface ExtendRouteRulesOptions {
|
|
339
353
|
/**
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
354
|
+
* Override route rule config
|
|
355
|
+
* @default false
|
|
356
|
+
*/
|
|
343
357
|
override?: boolean;
|
|
344
358
|
}
|
|
345
359
|
declare function extendRouteRules(route: string, rule: NitroRouteConfig, options?: ExtendRouteRulesOptions): void;
|
|
346
360
|
interface AddRouteMiddlewareOptions {
|
|
347
361
|
/**
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
362
|
+
* Override existing middleware with the same name, if it exists
|
|
363
|
+
* @default false
|
|
364
|
+
*/
|
|
351
365
|
override?: boolean;
|
|
352
366
|
/**
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
367
|
+
* Prepend middleware to the list
|
|
368
|
+
* @default false
|
|
369
|
+
*/
|
|
356
370
|
prepend?: boolean;
|
|
357
371
|
}
|
|
358
372
|
declare function addRouteMiddleware(input: NuxtMiddleware | NuxtMiddleware[], options?: AddRouteMiddlewareOptions): void;
|
|
@@ -360,30 +374,30 @@ declare function addRouteMiddleware(input: NuxtMiddleware | NuxtMiddleware[], op
|
|
|
360
374
|
//#region src/plugin.d.ts
|
|
361
375
|
declare function normalizePlugin(plugin: NuxtPlugin | string): NuxtPlugin;
|
|
362
376
|
/**
|
|
363
|
-
* Registers a nuxt plugin and to the plugins array.
|
|
364
|
-
*
|
|
365
|
-
* Note: You can use mode or .client and .server modifiers with fileName option
|
|
366
|
-
* to use plugin only in client or server side.
|
|
367
|
-
*
|
|
368
|
-
* Note: By default plugin is prepended to the plugins array. You can use second argument to append (push) instead.
|
|
369
|
-
* @example
|
|
370
|
-
* ```js
|
|
371
|
-
* import { createResolver } from '@nuxt/kit'
|
|
372
|
-
* const resolver = createResolver(import.meta.url)
|
|
373
|
-
*
|
|
374
|
-
* addPlugin({
|
|
375
|
-
* src: resolver.resolve('templates/foo.js'),
|
|
376
|
-
* filename: 'foo.server.js' // [optional] only include in server bundle
|
|
377
|
-
* })
|
|
378
|
-
* ```
|
|
379
|
-
*/
|
|
377
|
+
* Registers a nuxt plugin and to the plugins array.
|
|
378
|
+
*
|
|
379
|
+
* Note: You can use mode or .client and .server modifiers with fileName option
|
|
380
|
+
* to use plugin only in client or server side.
|
|
381
|
+
*
|
|
382
|
+
* Note: By default plugin is prepended to the plugins array. You can use second argument to append (push) instead.
|
|
383
|
+
* @example
|
|
384
|
+
* ```js
|
|
385
|
+
* import { createResolver } from '@nuxt/kit'
|
|
386
|
+
* const resolver = createResolver(import.meta.url)
|
|
387
|
+
*
|
|
388
|
+
* addPlugin({
|
|
389
|
+
* src: resolver.resolve('templates/foo.js'),
|
|
390
|
+
* filename: 'foo.server.js' // [optional] only include in server bundle
|
|
391
|
+
* })
|
|
392
|
+
* ```
|
|
393
|
+
*/
|
|
380
394
|
interface AddPluginOptions {
|
|
381
395
|
append?: boolean;
|
|
382
396
|
}
|
|
383
397
|
declare function addPlugin(_plugin: NuxtPlugin | string, opts?: AddPluginOptions): NuxtPlugin;
|
|
384
398
|
/**
|
|
385
|
-
* Adds a template and registers as a nuxt plugin.
|
|
386
|
-
*/
|
|
399
|
+
* Adds a template and registers as a nuxt plugin.
|
|
400
|
+
*/
|
|
387
401
|
declare function addPluginTemplate(plugin: NuxtPluginTemplate | string, opts?: AddPluginOptions): NuxtPlugin;
|
|
388
402
|
//#endregion
|
|
389
403
|
//#region src/resolve.d.ts
|
|
@@ -393,136 +407,136 @@ interface ResolvePathOptions {
|
|
|
393
407
|
/** An object of aliases. Default is Nuxt configured aliases. */
|
|
394
408
|
alias?: Record<string, string>;
|
|
395
409
|
/**
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
410
|
+
* The file extensions to try.
|
|
411
|
+
* Default is Nuxt configured extensions.
|
|
412
|
+
*
|
|
413
|
+
* Isn't considered when `type` is set to `'dir'`.
|
|
414
|
+
*/
|
|
401
415
|
extensions?: string[];
|
|
402
416
|
/**
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
417
|
+
* Whether to resolve files that exist in the Nuxt VFS (for example, as a Nuxt template).
|
|
418
|
+
* @default false
|
|
419
|
+
*/
|
|
406
420
|
virtual?: boolean;
|
|
407
421
|
/**
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
422
|
+
* Whether to fallback to the original path if the resolved path does not exist instead of returning the normalized input path.
|
|
423
|
+
* @default false
|
|
424
|
+
*/
|
|
411
425
|
fallbackToOriginal?: boolean;
|
|
412
426
|
/**
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
427
|
+
* The type of the path to be resolved.
|
|
428
|
+
* @default 'file'
|
|
429
|
+
*/
|
|
416
430
|
type?: PathType;
|
|
417
431
|
}
|
|
418
432
|
/**
|
|
419
|
-
* Resolve the full path to a file or a directory (based on the provided type), respecting Nuxt alias and extensions options.
|
|
420
|
-
*
|
|
421
|
-
* If a path cannot be resolved, normalized input will be returned unless the `fallbackToOriginal` option is set to `true`,
|
|
422
|
-
* in which case the original input path will be returned.
|
|
423
|
-
*/
|
|
433
|
+
* Resolve the full path to a file or a directory (based on the provided type), respecting Nuxt alias and extensions options.
|
|
434
|
+
*
|
|
435
|
+
* If a path cannot be resolved, normalized input will be returned unless the `fallbackToOriginal` option is set to `true`,
|
|
436
|
+
* in which case the original input path will be returned.
|
|
437
|
+
*/
|
|
424
438
|
declare function resolvePath(path: string, opts?: ResolvePathOptions): Promise<string>;
|
|
425
439
|
/**
|
|
426
|
-
* Try to resolve first existing file in paths
|
|
427
|
-
*/
|
|
440
|
+
* Try to resolve first existing file in paths
|
|
441
|
+
*/
|
|
428
442
|
declare function findPath(paths: string | string[], opts?: ResolvePathOptions, pathType?: PathType): Promise<string | null>;
|
|
429
443
|
/**
|
|
430
|
-
* Resolve path aliases respecting Nuxt alias options
|
|
431
|
-
*/
|
|
444
|
+
* Resolve path aliases respecting Nuxt alias options
|
|
445
|
+
*/
|
|
432
446
|
declare function resolveAlias(path: string, alias?: Record<string, string>): string;
|
|
433
447
|
interface Resolver {
|
|
434
448
|
resolve(...path: string[]): string;
|
|
435
449
|
resolvePath(path: string, opts?: ResolvePathOptions): Promise<string>;
|
|
436
450
|
}
|
|
437
451
|
/**
|
|
438
|
-
* Create a relative resolver
|
|
439
|
-
*/
|
|
452
|
+
* Create a relative resolver
|
|
453
|
+
*/
|
|
440
454
|
declare function createResolver(base: string | URL): Resolver;
|
|
441
455
|
declare function resolveNuxtModule(base: string, paths: string[]): Promise<string[]>;
|
|
442
|
-
type PathType =
|
|
443
|
-
/**
|
|
444
|
-
* Resolve absolute file paths in the provided directory with respect to `.nuxtignore` and return them sorted.
|
|
445
|
-
* @param path path to the directory to resolve files in
|
|
446
|
-
* @param pattern glob pattern or an array of glob patterns to match files
|
|
447
|
-
* @param opts options for globbing
|
|
448
|
-
* @param opts.followSymbolicLinks whether to follow symbolic links, default is `true`
|
|
449
|
-
* @param opts.ignore additional glob patterns to ignore
|
|
450
|
-
* @returns sorted array of absolute file paths
|
|
451
|
-
*/
|
|
456
|
+
type PathType = 'file' | 'dir';
|
|
457
|
+
/**
|
|
458
|
+
* Resolve absolute file paths in the provided directory with respect to `.nuxtignore` and return them sorted.
|
|
459
|
+
* @param path path to the directory to resolve files in
|
|
460
|
+
* @param pattern glob pattern or an array of glob patterns to match files
|
|
461
|
+
* @param opts options for globbing
|
|
462
|
+
* @param opts.followSymbolicLinks whether to follow symbolic links, default is `true`
|
|
463
|
+
* @param opts.ignore additional glob patterns to ignore
|
|
464
|
+
* @returns sorted array of absolute file paths
|
|
465
|
+
*/
|
|
452
466
|
declare function resolveFiles(path: string, pattern: string | string[], opts?: {
|
|
453
467
|
followSymbolicLinks?: boolean;
|
|
454
|
-
ignore?: GlobOptions[
|
|
468
|
+
ignore?: GlobOptions['ignore'];
|
|
455
469
|
}): Promise<string[]>;
|
|
456
470
|
//#endregion
|
|
457
471
|
//#region src/nitro.d.ts
|
|
458
472
|
/**
|
|
459
|
-
* Adds a nitro server handler
|
|
460
|
-
*
|
|
461
|
-
*/
|
|
473
|
+
* Adds a nitro server handler
|
|
474
|
+
*
|
|
475
|
+
*/
|
|
462
476
|
declare function addServerHandler(handler: NitroEventHandler): void;
|
|
463
477
|
/**
|
|
464
|
-
* Adds a nitro server handler for development-only
|
|
465
|
-
*
|
|
466
|
-
*/
|
|
478
|
+
* Adds a nitro server handler for development-only
|
|
479
|
+
*
|
|
480
|
+
*/
|
|
467
481
|
declare function addDevServerHandler(handler: NitroDevEventHandler): void;
|
|
468
482
|
/**
|
|
469
|
-
* Adds a Nitro plugin
|
|
470
|
-
*/
|
|
483
|
+
* Adds a Nitro plugin
|
|
484
|
+
*/
|
|
471
485
|
declare function addServerPlugin(plugin: string): void;
|
|
472
486
|
/**
|
|
473
|
-
* Adds routes to be prerendered
|
|
474
|
-
*/
|
|
487
|
+
* Adds routes to be prerendered
|
|
488
|
+
*/
|
|
475
489
|
declare function addPrerenderRoutes(routes: string | string[]): void;
|
|
476
490
|
/**
|
|
477
|
-
* Access to the Nitro instance
|
|
478
|
-
*
|
|
479
|
-
* **Note:** You can call `useNitro()` only after `ready` hook.
|
|
480
|
-
*
|
|
481
|
-
* **Note:** Changes to the Nitro instance configuration are not applied.
|
|
482
|
-
* @example
|
|
483
|
-
*
|
|
484
|
-
* ```ts
|
|
485
|
-
* nuxt.hook('ready', () => {
|
|
486
|
-
* console.log(useNitro())
|
|
487
|
-
* })
|
|
488
|
-
* ```
|
|
489
|
-
*/
|
|
491
|
+
* Access to the Nitro instance
|
|
492
|
+
*
|
|
493
|
+
* **Note:** You can call `useNitro()` only after `ready` hook.
|
|
494
|
+
*
|
|
495
|
+
* **Note:** Changes to the Nitro instance configuration are not applied.
|
|
496
|
+
* @example
|
|
497
|
+
*
|
|
498
|
+
* ```ts
|
|
499
|
+
* nuxt.hook('ready', () => {
|
|
500
|
+
* console.log(useNitro())
|
|
501
|
+
* })
|
|
502
|
+
* ```
|
|
503
|
+
*/
|
|
490
504
|
declare function useNitro(): Nitro;
|
|
491
505
|
/**
|
|
492
|
-
* Add server imports to be auto-imported by Nitro
|
|
493
|
-
*/
|
|
506
|
+
* Add server imports to be auto-imported by Nitro
|
|
507
|
+
*/
|
|
494
508
|
declare function addServerImports(imports: Import | Import[]): void;
|
|
495
509
|
/**
|
|
496
|
-
* Add directories to be scanned for auto-imports by Nitro
|
|
497
|
-
*/
|
|
510
|
+
* Add directories to be scanned for auto-imports by Nitro
|
|
511
|
+
*/
|
|
498
512
|
declare function addServerImportsDir(dirs: string | string[], opts?: {
|
|
499
513
|
prepend?: boolean;
|
|
500
514
|
}): void;
|
|
501
515
|
/**
|
|
502
|
-
* Add directories to be scanned by Nitro. It will check for subdirectories,
|
|
503
|
-
* which will be registered just like the `~~/server` folder is.
|
|
504
|
-
*/
|
|
516
|
+
* Add directories to be scanned by Nitro. It will check for subdirectories,
|
|
517
|
+
* which will be registered just like the `~~/server` folder is.
|
|
518
|
+
*/
|
|
505
519
|
declare function addServerScanDir(dirs: string | string[], opts?: {
|
|
506
520
|
prepend?: boolean;
|
|
507
521
|
}): void;
|
|
508
522
|
//#endregion
|
|
509
523
|
//#region src/template.d.ts
|
|
510
524
|
/**
|
|
511
|
-
* Renders given template during build into the virtual file system (and optionally to disk in the project `buildDir`)
|
|
512
|
-
*/
|
|
525
|
+
* Renders given template during build into the virtual file system (and optionally to disk in the project `buildDir`)
|
|
526
|
+
*/
|
|
513
527
|
declare function addTemplate<T>(_template: NuxtTemplate<T> | string): ResolvedNuxtTemplate<T>;
|
|
514
528
|
/**
|
|
515
|
-
* Adds a virtual file that can be used within the Nuxt Nitro server build.
|
|
516
|
-
*/
|
|
529
|
+
* Adds a virtual file that can be used within the Nuxt Nitro server build.
|
|
530
|
+
*/
|
|
517
531
|
declare function addServerTemplate(template: NuxtServerTemplate): NuxtServerTemplate;
|
|
518
532
|
/**
|
|
519
|
-
* Renders given types during build to disk in the project `buildDir`
|
|
520
|
-
* and register them as types.
|
|
521
|
-
*
|
|
522
|
-
* You can pass a second context object to specify in which context the type should be added.
|
|
523
|
-
*
|
|
524
|
-
* If no context object is passed, then it will only be added to the nuxt context.
|
|
525
|
-
*/
|
|
533
|
+
* Renders given types during build to disk in the project `buildDir`
|
|
534
|
+
* and register them as types.
|
|
535
|
+
*
|
|
536
|
+
* You can pass a second context object to specify in which context the type should be added.
|
|
537
|
+
*
|
|
538
|
+
* If no context object is passed, then it will only be added to the nuxt context.
|
|
539
|
+
*/
|
|
526
540
|
declare function addTypeTemplate<T>(_template: NuxtTypeTemplate<T>, context?: {
|
|
527
541
|
nitro?: boolean;
|
|
528
542
|
nuxt?: boolean;
|
|
@@ -530,23 +544,768 @@ declare function addTypeTemplate<T>(_template: NuxtTypeTemplate<T>, context?: {
|
|
|
530
544
|
shared?: boolean;
|
|
531
545
|
}): ResolvedNuxtTemplate<T>;
|
|
532
546
|
/**
|
|
533
|
-
* Normalize a nuxt template object
|
|
534
|
-
*/
|
|
547
|
+
* Normalize a nuxt template object
|
|
548
|
+
*/
|
|
535
549
|
declare function normalizeTemplate<T>(template: NuxtTemplate<T> | string, buildDir?: string): ResolvedNuxtTemplate<T>;
|
|
536
550
|
/**
|
|
537
|
-
* Trigger rebuilding Nuxt templates
|
|
538
|
-
*
|
|
539
|
-
* You can pass a filter within the options to selectively regenerate a subset of templates.
|
|
540
|
-
*/
|
|
551
|
+
* Trigger rebuilding Nuxt templates
|
|
552
|
+
*
|
|
553
|
+
* You can pass a filter within the options to selectively regenerate a subset of templates.
|
|
554
|
+
*/
|
|
541
555
|
declare function updateTemplates(options?: {
|
|
542
556
|
filter?: (template: ResolvedNuxtTemplate<any>) => boolean;
|
|
543
557
|
}): Promise<void>;
|
|
544
558
|
declare function writeTypes(nuxt: Nuxt): Promise<void>;
|
|
545
559
|
//#endregion
|
|
560
|
+
//#region src/types.d.ts
|
|
561
|
+
/**
|
|
562
|
+
* Rewrite a resolved module path to the declaration file TypeScript will load for it.
|
|
563
|
+
*
|
|
564
|
+
* A `.d.ts` / `.d.mts` / `.d.cts` or `.ts` / `.tsx` path is returned unchanged (or with
|
|
565
|
+
* the extension stripped, where TypeScript's extensionless `paths` retry will find it).
|
|
566
|
+
* A `.mjs` / `.cjs` / `.mts` / `.cts` runtime path is rewritten to an adjacent declaration
|
|
567
|
+
* sibling when one exists; otherwise it is returned as-is for the caller to handle.
|
|
568
|
+
*/
|
|
569
|
+
declare function resolveDeclarationPath(absolutePath: string): Promise<string>;
|
|
570
|
+
/** Extract the package name (including scope) from a (possibly subpath) module specifier. */
|
|
571
|
+
declare function packageName(specifier: string): string;
|
|
572
|
+
/**
|
|
573
|
+
* Resolve auto-import / `tsConfig.paths` entries to the path TypeScript should load types from.
|
|
574
|
+
*
|
|
575
|
+
* A bare package resolves to its package root, so TypeScript follows the package's own
|
|
576
|
+
* `exports` / `types` (which may differ from the file its `.` export condition points at).
|
|
577
|
+
* A subpath export resolves to its entry's declaration sibling when one exists, otherwise to
|
|
578
|
+
* the resolved file itself.
|
|
579
|
+
*
|
|
580
|
+
* Returns `[specifier, absolutePath]` pairs, omitting any specifier that cannot be resolved.
|
|
581
|
+
*/
|
|
582
|
+
declare function resolveTypePaths(packages: string[], searchPaths: string[]): Promise<Array<[string, string]>>;
|
|
583
|
+
//#endregion
|
|
546
584
|
//#region src/logger.d.ts
|
|
547
585
|
declare const logger: ConsolaInstance;
|
|
548
586
|
declare function useLogger(tag?: string, options?: Partial<ConsolaOptions>): ConsolaInstance;
|
|
549
587
|
//#endregion
|
|
588
|
+
//#region src/diagnostics/build.d.ts
|
|
589
|
+
/**
|
|
590
|
+
* B1xxx
|
|
591
|
+
* Build / compilation diagnostics.
|
|
592
|
+
*
|
|
593
|
+
* @internal
|
|
594
|
+
*/
|
|
595
|
+
declare const buildDiagnostics: import("nostics").Diagnostics<{
|
|
596
|
+
readonly NUXT_B1001: {
|
|
597
|
+
readonly why: (p: {
|
|
598
|
+
filename: string;
|
|
599
|
+
}) => string;
|
|
600
|
+
readonly fix: (p: {
|
|
601
|
+
src?: string;
|
|
602
|
+
}) => string;
|
|
603
|
+
readonly docs: false;
|
|
604
|
+
};
|
|
605
|
+
readonly NUXT_B1002: {
|
|
606
|
+
readonly why: (p: {
|
|
607
|
+
src: string;
|
|
608
|
+
}) => string;
|
|
609
|
+
readonly fix: "Check that the template `src` path exists and is readable.";
|
|
610
|
+
readonly docs: false;
|
|
611
|
+
};
|
|
612
|
+
readonly NUXT_B1003: {
|
|
613
|
+
readonly why: "Invalid template. Templates must have either `src` or `getContents`.";
|
|
614
|
+
readonly fix: "Add a `getContents` function or a `src` path to the `addTemplate()` call.";
|
|
615
|
+
readonly docs: false;
|
|
616
|
+
};
|
|
617
|
+
readonly NUXT_B1004: {
|
|
618
|
+
readonly why: "Failed to install dependencies.";
|
|
619
|
+
readonly fix: (p: {
|
|
620
|
+
packages: string;
|
|
621
|
+
}) => string;
|
|
622
|
+
readonly docs: false;
|
|
623
|
+
};
|
|
624
|
+
readonly NUXT_B1005: {
|
|
625
|
+
readonly why: (p: {
|
|
626
|
+
plugin: string;
|
|
627
|
+
file: string;
|
|
628
|
+
}) => string;
|
|
629
|
+
readonly fix: "Check the file for syntax errors, or report this issue to the plugin author.";
|
|
630
|
+
readonly docs: false;
|
|
631
|
+
};
|
|
632
|
+
readonly NUXT_B1006: {
|
|
633
|
+
readonly why: (p: {
|
|
634
|
+
file: string;
|
|
635
|
+
}) => string;
|
|
636
|
+
readonly fix: "Check that the file exists and has correct permissions.";
|
|
637
|
+
readonly docs: false;
|
|
638
|
+
};
|
|
639
|
+
readonly NUXT_B1007: {
|
|
640
|
+
readonly why: (p: {
|
|
641
|
+
plugin: string;
|
|
642
|
+
}) => string;
|
|
643
|
+
readonly fix: "Check the plugin implementation or report this issue to the plugin author.";
|
|
644
|
+
readonly docs: false;
|
|
645
|
+
};
|
|
646
|
+
readonly NUXT_B1008: {
|
|
647
|
+
readonly why: (p: {
|
|
648
|
+
function: string;
|
|
649
|
+
file: string;
|
|
650
|
+
}) => string;
|
|
651
|
+
readonly fix: "Please report this issue at https://github.com/nuxt/nuxt/issues with the file contents.";
|
|
652
|
+
readonly docs: false;
|
|
653
|
+
};
|
|
654
|
+
readonly NUXT_B1009: {
|
|
655
|
+
readonly why: (p: {
|
|
656
|
+
functionName: string;
|
|
657
|
+
name?: string;
|
|
658
|
+
source?: string;
|
|
659
|
+
}) => string;
|
|
660
|
+
readonly fix: "Ensure each keyed function has a unique name, or use a different source to distinguish them.";
|
|
661
|
+
readonly docs: false;
|
|
662
|
+
};
|
|
663
|
+
readonly NUXT_B1010: {
|
|
664
|
+
readonly why: (p: {
|
|
665
|
+
file: string;
|
|
666
|
+
}) => string;
|
|
667
|
+
readonly fix: "The file was modified while being read, usually by a concurrent process writing to it. Try restarting the build.";
|
|
668
|
+
readonly docs: false;
|
|
669
|
+
};
|
|
670
|
+
readonly NUXT_B1011: {
|
|
671
|
+
readonly why: (p: {
|
|
672
|
+
file: string;
|
|
673
|
+
}) => string;
|
|
674
|
+
readonly fix: "Check that the file exists and is readable, or try clearing the build cache with `nuxi clean`.";
|
|
675
|
+
readonly docs: false;
|
|
676
|
+
};
|
|
677
|
+
readonly NUXT_B1012: {
|
|
678
|
+
readonly why: (p: {
|
|
679
|
+
path: string;
|
|
680
|
+
}) => string;
|
|
681
|
+
readonly fix: "Delete the cache with `nuxi clean` and rebuild.";
|
|
682
|
+
readonly docs: false;
|
|
683
|
+
};
|
|
684
|
+
readonly NUXT_B1013: {
|
|
685
|
+
readonly why: (p: {
|
|
686
|
+
file: string;
|
|
687
|
+
}) => string;
|
|
688
|
+
readonly fix: "Try clearing the build cache with `nuxi clean` and rebuilding from scratch.";
|
|
689
|
+
readonly docs: false;
|
|
690
|
+
};
|
|
691
|
+
readonly NUXT_B1014: {
|
|
692
|
+
readonly why: "Problem checking for external configuration files.";
|
|
693
|
+
readonly fix: "This is likely a transient file system error. If it persists, check file permissions in your project root.";
|
|
694
|
+
readonly docs: false;
|
|
695
|
+
};
|
|
696
|
+
readonly NUXT_B1015: {
|
|
697
|
+
readonly why: "Falling back to `chokidar-granular` as `@parcel/watcher` cannot be resolved in your project.";
|
|
698
|
+
readonly fix: "Install `@parcel/watcher` for better performance: `npm install -D @parcel/watcher`.";
|
|
699
|
+
readonly docs: false;
|
|
700
|
+
};
|
|
701
|
+
readonly NUXT_B1016: {
|
|
702
|
+
readonly why: "Failed to set up the `@parcel/watcher` file watcher.";
|
|
703
|
+
readonly fix: "This is likely an environment or file system issue. Watching for file changes may not work; restart the dev server and, if the problem persists, report it.";
|
|
704
|
+
readonly docs: false;
|
|
705
|
+
};
|
|
706
|
+
readonly NUXT_B1017: {
|
|
707
|
+
readonly why: (p: {
|
|
708
|
+
builder: string;
|
|
709
|
+
}) => string;
|
|
710
|
+
readonly fix: (p: {
|
|
711
|
+
builder: string;
|
|
712
|
+
}) => string;
|
|
713
|
+
readonly docs: false;
|
|
714
|
+
};
|
|
715
|
+
readonly NUXT_B1018: {
|
|
716
|
+
readonly why: (p: {
|
|
717
|
+
builder: string;
|
|
718
|
+
}) => string;
|
|
719
|
+
readonly fix: (p: {
|
|
720
|
+
builder: string;
|
|
721
|
+
}) => string;
|
|
722
|
+
readonly docs: false;
|
|
723
|
+
};
|
|
724
|
+
readonly NUXT_B1019: {
|
|
725
|
+
readonly why: (p: {
|
|
726
|
+
mode: string;
|
|
727
|
+
}) => string;
|
|
728
|
+
readonly fix: "If you are a module author, ensure the component `mode` is set to `client`, `server`, or `all`. Otherwise, please report this issue.";
|
|
729
|
+
readonly docs: false;
|
|
730
|
+
};
|
|
731
|
+
readonly NUXT_B1020: {
|
|
732
|
+
readonly why: "`experimental.watcher: \"builder\"` is set but the active builder does not implement `setupWatcher`. Falling back to the default file watcher.";
|
|
733
|
+
readonly fix: "Remove `experimental.watcher` from your `nuxt.config`, or use a builder that supports its own watcher.";
|
|
734
|
+
readonly docs: false;
|
|
735
|
+
};
|
|
736
|
+
}, readonly [import("nostics").DiagnosticReporter<{
|
|
737
|
+
method?: import("nostics").ConsoleMethod;
|
|
738
|
+
}>]>;
|
|
739
|
+
//#endregion
|
|
740
|
+
//#region src/diagnostics/plugins.d.ts
|
|
741
|
+
/**
|
|
742
|
+
* B2xxx
|
|
743
|
+
* Plugin diagnostics (`addPlugin`, plugin metadata, plugin ordering).
|
|
744
|
+
*
|
|
745
|
+
* @internal
|
|
746
|
+
*/
|
|
747
|
+
declare const pluginDiagnostics: import("nostics").Diagnostics<{
|
|
748
|
+
readonly NUXT_B2001: {
|
|
749
|
+
readonly why: (p: {
|
|
750
|
+
type: string;
|
|
751
|
+
name: string;
|
|
752
|
+
}) => string;
|
|
753
|
+
readonly fix: "Pass an object literal as the second argument, e.g. `defineNuxtPlugin(() => {}, { name: 'my-plugin' })`.";
|
|
754
|
+
readonly docs: false;
|
|
755
|
+
};
|
|
756
|
+
readonly NUXT_B2002: {
|
|
757
|
+
readonly why: "Plugin options contain spread elements or computed keys, which are not supported.";
|
|
758
|
+
readonly fix: "Use static properties instead.";
|
|
759
|
+
readonly docs: false;
|
|
760
|
+
};
|
|
761
|
+
readonly NUXT_B2003: {
|
|
762
|
+
readonly why: "`dependsOn` is not an array of string literals.";
|
|
763
|
+
readonly fix: "Use string literals in the `dependsOn` array, e.g. `dependsOn: ['my-plugin']`.";
|
|
764
|
+
readonly docs: false;
|
|
765
|
+
};
|
|
766
|
+
readonly NUXT_B2004: {
|
|
767
|
+
readonly why: (p: {
|
|
768
|
+
src: string;
|
|
769
|
+
}) => string;
|
|
770
|
+
readonly fix: "Add content to the plugin file, or remove it from the `plugins/` directory.";
|
|
771
|
+
readonly docs: false;
|
|
772
|
+
};
|
|
773
|
+
readonly NUXT_B2005: {
|
|
774
|
+
readonly why: (p: {
|
|
775
|
+
src: string;
|
|
776
|
+
}) => string;
|
|
777
|
+
readonly fix: "Add `export default defineNuxtPlugin(() => {})` to your plugin.";
|
|
778
|
+
readonly docs: false;
|
|
779
|
+
};
|
|
780
|
+
readonly NUXT_B2006: {
|
|
781
|
+
readonly why: (p: {
|
|
782
|
+
src: string;
|
|
783
|
+
}) => string;
|
|
784
|
+
readonly fix: "Check the plugin file for syntax errors.";
|
|
785
|
+
readonly docs: false;
|
|
786
|
+
};
|
|
787
|
+
readonly NUXT_B2007: {
|
|
788
|
+
readonly why: (p: {
|
|
789
|
+
src: string;
|
|
790
|
+
}) => string;
|
|
791
|
+
readonly fix: "Wrap your plugin with `defineNuxtPlugin`. This may enable enhancements in future.";
|
|
792
|
+
readonly docs: false;
|
|
793
|
+
};
|
|
794
|
+
readonly NUXT_B2008: {
|
|
795
|
+
readonly why: (p: {
|
|
796
|
+
name: string;
|
|
797
|
+
missing: string;
|
|
798
|
+
}) => string;
|
|
799
|
+
readonly fix: "Register the missing dependency plugins, or remove them from the `dependsOn` array.";
|
|
800
|
+
readonly docs: false;
|
|
801
|
+
};
|
|
802
|
+
readonly NUXT_B2009: {
|
|
803
|
+
readonly why: (p: {
|
|
804
|
+
cycle: string;
|
|
805
|
+
}) => string;
|
|
806
|
+
readonly fix: "Restructure the plugin `dependsOn` declarations to break the cycle.";
|
|
807
|
+
readonly docs: false;
|
|
808
|
+
};
|
|
809
|
+
readonly NUXT_B2010: {
|
|
810
|
+
readonly why: (p: {
|
|
811
|
+
src: string;
|
|
812
|
+
}) => string;
|
|
813
|
+
readonly fix: "Use an object literal with static values as the second argument to `defineNuxtPlugin()`, and check the plugin file for syntax errors or unsupported constructs in the metadata.";
|
|
814
|
+
readonly docs: false;
|
|
815
|
+
};
|
|
816
|
+
readonly NUXT_B2011: {
|
|
817
|
+
readonly why: (p: {
|
|
818
|
+
src: string;
|
|
819
|
+
}) => string;
|
|
820
|
+
readonly fix: "Pass a string path, or an object with a `src` property, to `addPlugin()`.";
|
|
821
|
+
readonly docs: false;
|
|
822
|
+
};
|
|
823
|
+
}, readonly [import("nostics").DiagnosticReporter<{
|
|
824
|
+
method?: import("nostics").ConsoleMethod;
|
|
825
|
+
}>]>;
|
|
826
|
+
//#endregion
|
|
827
|
+
//#region src/diagnostics/components.d.ts
|
|
828
|
+
/**
|
|
829
|
+
* B3xxx
|
|
830
|
+
* Component diagnostics.
|
|
831
|
+
*
|
|
832
|
+
* @internal
|
|
833
|
+
*/
|
|
834
|
+
declare const componentDiagnostics: import("nostics").Diagnostics<{
|
|
835
|
+
readonly NUXT_B3001: {
|
|
836
|
+
readonly why: (p: {
|
|
837
|
+
dirPath: string;
|
|
838
|
+
}) => string;
|
|
839
|
+
readonly fix: "If this is intentional, remove it from `components.dirs` in your `nuxt.config`.";
|
|
840
|
+
readonly docs: false;
|
|
841
|
+
};
|
|
842
|
+
readonly NUXT_B3002: {
|
|
843
|
+
readonly why: (p: {
|
|
844
|
+
component: string;
|
|
845
|
+
}) => string;
|
|
846
|
+
readonly fix: "Set `experimental.componentIslands` to `true` in your `nuxt.config`, or convert the component to a client component.";
|
|
847
|
+
readonly docs: false;
|
|
848
|
+
};
|
|
849
|
+
readonly NUXT_B3003: {
|
|
850
|
+
readonly why: (p: {
|
|
851
|
+
component: string;
|
|
852
|
+
}) => string;
|
|
853
|
+
readonly fix: "Set `experimental.componentIslands` to `true` in your `nuxt.config`.";
|
|
854
|
+
readonly docs: false;
|
|
855
|
+
};
|
|
856
|
+
readonly NUXT_B3004: {
|
|
857
|
+
readonly why: (p: {
|
|
858
|
+
file: string;
|
|
859
|
+
component: string;
|
|
860
|
+
requiredModule: string;
|
|
861
|
+
}) => string;
|
|
862
|
+
readonly fix: (p: {
|
|
863
|
+
requiredModule: string;
|
|
864
|
+
}) => string;
|
|
865
|
+
readonly docs: false;
|
|
866
|
+
};
|
|
867
|
+
readonly NUXT_B3005: {
|
|
868
|
+
readonly why: (p: {
|
|
869
|
+
component: string;
|
|
870
|
+
file: string;
|
|
871
|
+
}) => string;
|
|
872
|
+
readonly fix: "Use only one hydration strategy attribute (e.g. `hydrate-on-visible` or `hydrate-on-idle`) per component.";
|
|
873
|
+
readonly docs: false;
|
|
874
|
+
};
|
|
875
|
+
readonly NUXT_B3006: {
|
|
876
|
+
readonly why: (p: {
|
|
877
|
+
component: string;
|
|
878
|
+
file: string;
|
|
879
|
+
}) => string;
|
|
880
|
+
readonly fix: (p: {
|
|
881
|
+
lazyName: string;
|
|
882
|
+
}) => string;
|
|
883
|
+
readonly docs: false;
|
|
884
|
+
};
|
|
885
|
+
readonly NUXT_B3007: {
|
|
886
|
+
readonly why: (p: {
|
|
887
|
+
file: string;
|
|
888
|
+
}) => string;
|
|
889
|
+
readonly fix: "Set `experimental.componentIslands.selectiveClient` to `true` in your `nuxt.config`.";
|
|
890
|
+
readonly docs: false;
|
|
891
|
+
};
|
|
892
|
+
readonly NUXT_B3008: {
|
|
893
|
+
readonly why: (p: {
|
|
894
|
+
scannedPath: string;
|
|
895
|
+
}) => string;
|
|
896
|
+
readonly fix: (p: {
|
|
897
|
+
scannedPath: string;
|
|
898
|
+
expectedPath: string;
|
|
899
|
+
}) => string;
|
|
900
|
+
readonly docs: false;
|
|
901
|
+
};
|
|
902
|
+
readonly NUXT_B3009: {
|
|
903
|
+
readonly why: (p: {
|
|
904
|
+
component: string;
|
|
905
|
+
filePath: string;
|
|
906
|
+
}) => string;
|
|
907
|
+
readonly fix: "Rename the component to avoid the `Lazy` prefix.";
|
|
908
|
+
readonly docs: false;
|
|
909
|
+
};
|
|
910
|
+
readonly NUXT_B3010: {
|
|
911
|
+
readonly why: (p: {
|
|
912
|
+
filePath: string;
|
|
913
|
+
}) => string;
|
|
914
|
+
readonly fix: "Rename the component file to something other than `index` (e.g. `MyComponent.vue`).";
|
|
915
|
+
readonly docs: false;
|
|
916
|
+
};
|
|
917
|
+
readonly NUXT_B3011: {
|
|
918
|
+
readonly why: (p: {
|
|
919
|
+
component: string;
|
|
920
|
+
filePath: string;
|
|
921
|
+
duplicatePath: string;
|
|
922
|
+
}) => string;
|
|
923
|
+
readonly fix: "Rename one of the files or adjust the `components.dirs` prefix settings in your `nuxt.config`.";
|
|
924
|
+
readonly docs: false;
|
|
925
|
+
};
|
|
926
|
+
readonly NUXT_B3012: {
|
|
927
|
+
readonly why: (p: {
|
|
928
|
+
name: string;
|
|
929
|
+
}) => string;
|
|
930
|
+
readonly fix: "Specify a `priority` option when calling `addComponent` to avoid this warning.";
|
|
931
|
+
readonly docs: false;
|
|
932
|
+
};
|
|
933
|
+
readonly NUXT_B3013: {
|
|
934
|
+
readonly why: (p: {
|
|
935
|
+
file: string;
|
|
936
|
+
}) => string;
|
|
937
|
+
readonly fix: "Switch to the Vite builder with `builder: 'vite'` in your `nuxt.config`.";
|
|
938
|
+
readonly docs: false;
|
|
939
|
+
};
|
|
940
|
+
}, readonly [import("nostics").DiagnosticReporter<{
|
|
941
|
+
method?: import("nostics").ConsoleMethod;
|
|
942
|
+
}>]>;
|
|
943
|
+
//#endregion
|
|
944
|
+
//#region src/diagnostics/pages.d.ts
|
|
945
|
+
/**
|
|
946
|
+
* B4xxx
|
|
947
|
+
* Pages / routing diagnostics.
|
|
948
|
+
*
|
|
949
|
+
* @internal
|
|
950
|
+
*/
|
|
951
|
+
declare const pageDiagnostics: import("nostics").Diagnostics<{
|
|
952
|
+
readonly NUXT_B4001: {
|
|
953
|
+
readonly why: (p: {
|
|
954
|
+
pathname: string;
|
|
955
|
+
}) => string;
|
|
956
|
+
readonly fix: "Add a `<template>` block to the page file, or remove the empty file from the `pages/` directory.";
|
|
957
|
+
readonly docs: false;
|
|
958
|
+
};
|
|
959
|
+
readonly NUXT_B4002: {
|
|
960
|
+
readonly why: "An `await` expression is used in a variable referenced by `definePageMeta`, which runs synchronously.";
|
|
961
|
+
readonly fix: (p: {
|
|
962
|
+
codeSnippet: string;
|
|
963
|
+
offset: number;
|
|
964
|
+
}) => string;
|
|
965
|
+
readonly docs: false;
|
|
966
|
+
};
|
|
967
|
+
readonly NUXT_B4003: {
|
|
968
|
+
readonly why: (p: {
|
|
969
|
+
callCount: number;
|
|
970
|
+
file: string;
|
|
971
|
+
}) => string;
|
|
972
|
+
readonly fix: "Merge all `definePageMeta()` calls into a single call.";
|
|
973
|
+
readonly docs: false;
|
|
974
|
+
};
|
|
975
|
+
readonly NUXT_B4004: {
|
|
976
|
+
readonly why: (p: {
|
|
977
|
+
file: string;
|
|
978
|
+
existingFile: string;
|
|
979
|
+
}) => string;
|
|
980
|
+
readonly fix: "Set a custom name using `definePageMeta` within one of the page files.";
|
|
981
|
+
readonly docs: false;
|
|
982
|
+
};
|
|
983
|
+
readonly NUXT_B4005: {
|
|
984
|
+
readonly why: (p: {
|
|
985
|
+
fnName: string;
|
|
986
|
+
file: string;
|
|
987
|
+
receivedType: string;
|
|
988
|
+
}) => string;
|
|
989
|
+
readonly fix: (p: {
|
|
990
|
+
fnName: string;
|
|
991
|
+
}) => string;
|
|
992
|
+
readonly docs: false;
|
|
993
|
+
};
|
|
994
|
+
readonly NUXT_B4006: {
|
|
995
|
+
readonly why: (p: {
|
|
996
|
+
fnName: string;
|
|
997
|
+
file: string;
|
|
998
|
+
}) => string;
|
|
999
|
+
readonly fix: "Use only JSON-serializable values (strings, numbers, booleans, arrays, plain objects) in `defineRouteRules()`.";
|
|
1000
|
+
readonly docs: false;
|
|
1001
|
+
};
|
|
1002
|
+
readonly NUXT_B4008: {
|
|
1003
|
+
readonly why: "Server pages with `ssr: false` are not supported while component islands are auto-detected.";
|
|
1004
|
+
readonly fix: "Set `experimental.componentIslands` to `true`.";
|
|
1005
|
+
readonly docs: false;
|
|
1006
|
+
};
|
|
1007
|
+
readonly NUXT_B4009: {
|
|
1008
|
+
readonly why: (p: {
|
|
1009
|
+
file: string;
|
|
1010
|
+
}) => string;
|
|
1011
|
+
readonly fix: "Rename the layout file to something other than `index` (e.g. `layouts/default.vue`).";
|
|
1012
|
+
readonly docs: false;
|
|
1013
|
+
};
|
|
1014
|
+
readonly NUXT_B4010: {
|
|
1015
|
+
readonly why: (p: {
|
|
1016
|
+
file: string;
|
|
1017
|
+
}) => string;
|
|
1018
|
+
readonly fix: "Rename the middleware file to something other than `index` (e.g. `middleware/auth.ts`).";
|
|
1019
|
+
readonly docs: false;
|
|
1020
|
+
};
|
|
1021
|
+
readonly NUXT_B4011: {
|
|
1022
|
+
readonly why: (p: {
|
|
1023
|
+
message: string;
|
|
1024
|
+
}) => string;
|
|
1025
|
+
readonly fix: "Check the page file naming and directory structure for issues.";
|
|
1026
|
+
readonly docs: false;
|
|
1027
|
+
};
|
|
1028
|
+
readonly NUXT_B4012: {
|
|
1029
|
+
readonly why: (p: {
|
|
1030
|
+
event: string;
|
|
1031
|
+
path: string;
|
|
1032
|
+
}) => string;
|
|
1033
|
+
readonly fix: "This is usually harmless: the full rebuild will recover. If it happens repeatedly, check for unusual file naming in `pages/`.";
|
|
1034
|
+
readonly docs: false;
|
|
1035
|
+
};
|
|
1036
|
+
readonly NUXT_B4013: {
|
|
1037
|
+
readonly why: (p: {
|
|
1038
|
+
name: string;
|
|
1039
|
+
foundPath: string;
|
|
1040
|
+
}) => string;
|
|
1041
|
+
readonly fix: "Set `override: true` to replace it.";
|
|
1042
|
+
readonly docs: false;
|
|
1043
|
+
};
|
|
1044
|
+
readonly NUXT_B4014: {
|
|
1045
|
+
readonly why: (p: {
|
|
1046
|
+
layoutName: string;
|
|
1047
|
+
existingPath: string;
|
|
1048
|
+
newPath: string;
|
|
1049
|
+
}) => string;
|
|
1050
|
+
readonly fix: "Rename one of the layouts, or remove the duplicate layout registration.";
|
|
1051
|
+
readonly docs: false;
|
|
1052
|
+
};
|
|
1053
|
+
}, readonly [import("nostics").DiagnosticReporter<{
|
|
1054
|
+
method?: import("nostics").ConsoleMethod;
|
|
1055
|
+
}>]>;
|
|
1056
|
+
//#endregion
|
|
1057
|
+
//#region src/diagnostics/config.d.ts
|
|
1058
|
+
/**
|
|
1059
|
+
* B5xxx
|
|
1060
|
+
* Configuration diagnostics.
|
|
1061
|
+
*
|
|
1062
|
+
* @internal
|
|
1063
|
+
*/
|
|
1064
|
+
declare const configDiagnostics: import("nostics").Diagnostics<{
|
|
1065
|
+
readonly NUXT_B5001: {
|
|
1066
|
+
readonly why: (p: {
|
|
1067
|
+
fallback: string;
|
|
1068
|
+
}) => string;
|
|
1069
|
+
readonly fix: (p: {
|
|
1070
|
+
latest: string;
|
|
1071
|
+
}) => string;
|
|
1072
|
+
};
|
|
1073
|
+
readonly NUXT_B5002: {
|
|
1074
|
+
readonly why: (p: {
|
|
1075
|
+
rootDir: string;
|
|
1076
|
+
}) => string;
|
|
1077
|
+
readonly fix: "Install it manually with `npm install -D @nuxt/webpack-builder`, or change the `builder` option to `vite` in `nuxt.config`.";
|
|
1078
|
+
readonly docs: false;
|
|
1079
|
+
};
|
|
1080
|
+
readonly NUXT_B5003: {
|
|
1081
|
+
readonly why: (p: {
|
|
1082
|
+
key: string;
|
|
1083
|
+
}) => string;
|
|
1084
|
+
readonly fix: "Move the key to `runtimeConfig.public` or a custom namespace.";
|
|
1085
|
+
};
|
|
1086
|
+
readonly NUXT_B5004: {
|
|
1087
|
+
readonly why: (p: {
|
|
1088
|
+
files: string;
|
|
1089
|
+
}) => string;
|
|
1090
|
+
readonly fix: "Move these configurations into `nuxt.config.ts` and delete the external config files.";
|
|
1091
|
+
};
|
|
1092
|
+
readonly NUXT_B5005: {
|
|
1093
|
+
readonly why: (p: {
|
|
1094
|
+
filePath: string;
|
|
1095
|
+
}) => string;
|
|
1096
|
+
readonly fix: "Ensure the file exports a valid object with `defineNuxtSchema()` or as a plain object.";
|
|
1097
|
+
readonly docs: false;
|
|
1098
|
+
};
|
|
1099
|
+
readonly NUXT_B5006: {
|
|
1100
|
+
readonly why: (p: {
|
|
1101
|
+
option: string;
|
|
1102
|
+
}) => string;
|
|
1103
|
+
readonly fix: "Remove the hash option from your webpack config.";
|
|
1104
|
+
readonly docs: false;
|
|
1105
|
+
};
|
|
1106
|
+
readonly NUXT_B5007: {
|
|
1107
|
+
readonly why: "The webpack server config `target` is not set to \"node\".";
|
|
1108
|
+
readonly fix: "Set `target: \"node\"` in your webpack server configuration.";
|
|
1109
|
+
readonly docs: false;
|
|
1110
|
+
};
|
|
1111
|
+
readonly NUXT_B5009: {
|
|
1112
|
+
readonly why: "`@parcel/watcher` cannot be resolved in your project, so `chokidar` is being used instead.";
|
|
1113
|
+
readonly fix: "Install `@parcel/watcher` for better file watching: `npm install -D @parcel/watcher`.";
|
|
1114
|
+
readonly docs: false;
|
|
1115
|
+
};
|
|
1116
|
+
readonly NUXT_B5010: {
|
|
1117
|
+
readonly why: (p: {
|
|
1118
|
+
names: string;
|
|
1119
|
+
}) => string;
|
|
1120
|
+
readonly fix: (p: {
|
|
1121
|
+
install: string;
|
|
1122
|
+
}) => string;
|
|
1123
|
+
readonly docs: false;
|
|
1124
|
+
};
|
|
1125
|
+
readonly NUXT_B5011: {
|
|
1126
|
+
readonly why: (p: {
|
|
1127
|
+
name: string;
|
|
1128
|
+
}) => string;
|
|
1129
|
+
readonly fix: (p: {
|
|
1130
|
+
name: string;
|
|
1131
|
+
}) => string;
|
|
1132
|
+
readonly docs: false;
|
|
1133
|
+
};
|
|
1134
|
+
}, readonly [import("nostics").DiagnosticReporter<{
|
|
1135
|
+
method?: import("nostics").ConsoleMethod;
|
|
1136
|
+
}>]>;
|
|
1137
|
+
//#endregion
|
|
1138
|
+
//#region src/diagnostics/head.d.ts
|
|
1139
|
+
/**
|
|
1140
|
+
* B6xxx
|
|
1141
|
+
* Head / auto-import diagnostics.
|
|
1142
|
+
*
|
|
1143
|
+
* @internal
|
|
1144
|
+
*/
|
|
1145
|
+
declare const headDiagnostics: import("nostics").Diagnostics<{
|
|
1146
|
+
readonly NUXT_B6001: {
|
|
1147
|
+
readonly why: (p: {
|
|
1148
|
+
module: string;
|
|
1149
|
+
file: string;
|
|
1150
|
+
}) => string;
|
|
1151
|
+
readonly fix: "Import from `#imports` instead.";
|
|
1152
|
+
readonly docs: false;
|
|
1153
|
+
};
|
|
1154
|
+
readonly NUXT_B6002: {
|
|
1155
|
+
readonly why: (p: {
|
|
1156
|
+
name: string;
|
|
1157
|
+
}) => string;
|
|
1158
|
+
readonly fix: (p: {
|
|
1159
|
+
name: string;
|
|
1160
|
+
file: string;
|
|
1161
|
+
}) => string;
|
|
1162
|
+
readonly docs: false;
|
|
1163
|
+
};
|
|
1164
|
+
readonly NUXT_B6003: {
|
|
1165
|
+
readonly why: "`unhead.legacy` is deprecated and will be removed.";
|
|
1166
|
+
readonly fix: "Remove deprecated head patterns (`hid`, `vmid`, `children`, `body: true`) and resolve promise values before passing them to `useHead`.";
|
|
1167
|
+
readonly docs: false;
|
|
1168
|
+
};
|
|
1169
|
+
readonly NUXT_B6004: {
|
|
1170
|
+
readonly why: "`experimental.headNext` is deprecated. CAPO sorting is now the default.";
|
|
1171
|
+
readonly fix: "Remove `experimental.headNext` from your `nuxt.config`, or set `unhead.legacy: true` to opt out temporarily.";
|
|
1172
|
+
readonly docs: false;
|
|
1173
|
+
};
|
|
1174
|
+
}, readonly [import("nostics").DiagnosticReporter<{
|
|
1175
|
+
method?: import("nostics").ConsoleMethod;
|
|
1176
|
+
}>]>;
|
|
1177
|
+
//#endregion
|
|
1178
|
+
//#region src/diagnostics/bundler.d.ts
|
|
1179
|
+
/**
|
|
1180
|
+
* B7xxx
|
|
1181
|
+
* Bundler (Vite / webpack / Nitro) diagnostics.
|
|
1182
|
+
*
|
|
1183
|
+
* @internal
|
|
1184
|
+
*/
|
|
1185
|
+
declare const bundlerDiagnostics: import("nostics").Diagnostics<{
|
|
1186
|
+
readonly NUXT_B7001: {
|
|
1187
|
+
readonly why: "`rollup-plugin-visualizer` is not installed, so bundle analysis cannot run.";
|
|
1188
|
+
readonly fix: "Run `npm install -D rollup-plugin-visualizer` to enable bundle analysis.";
|
|
1189
|
+
readonly docs: false;
|
|
1190
|
+
};
|
|
1191
|
+
readonly NUXT_B7002: {
|
|
1192
|
+
readonly why: (p: {
|
|
1193
|
+
deps: string;
|
|
1194
|
+
}) => string;
|
|
1195
|
+
readonly fix: "Remove or correct these entries in the `vite.optimizeDeps.include` array of your `nuxt.config.ts`. Report entries added by a Nuxt module to the module author.";
|
|
1196
|
+
readonly docs: false;
|
|
1197
|
+
};
|
|
1198
|
+
readonly NUXT_B7003: {
|
|
1199
|
+
readonly why: "The server-side bundle produced more than one JS entry file.";
|
|
1200
|
+
readonly fix: "Avoid using `optimization.splitChunks` in the server config.";
|
|
1201
|
+
readonly docs: false;
|
|
1202
|
+
};
|
|
1203
|
+
readonly NUXT_B7004: {
|
|
1204
|
+
readonly why: (p: {
|
|
1205
|
+
entryName: string;
|
|
1206
|
+
}) => string;
|
|
1207
|
+
readonly fix: (p: {
|
|
1208
|
+
entryName: string;
|
|
1209
|
+
}) => string;
|
|
1210
|
+
readonly docs: false;
|
|
1211
|
+
};
|
|
1212
|
+
readonly NUXT_B7005: {
|
|
1213
|
+
readonly why: (p: {
|
|
1214
|
+
input: string;
|
|
1215
|
+
}) => string;
|
|
1216
|
+
readonly fix: "Set `vite.build.rollupOptions.input` to a string or an object with an `entry` key in your `nuxt.config`.";
|
|
1217
|
+
readonly docs: false;
|
|
1218
|
+
};
|
|
1219
|
+
readonly NUXT_B7006: {
|
|
1220
|
+
readonly why: (p: {
|
|
1221
|
+
input: string;
|
|
1222
|
+
}) => string;
|
|
1223
|
+
readonly fix: "Set `vite.build.rollupOptions.input` to a string or an object with a `server` key in your `nuxt.config`.";
|
|
1224
|
+
readonly docs: false;
|
|
1225
|
+
};
|
|
1226
|
+
readonly NUXT_B7007: {
|
|
1227
|
+
readonly why: (p: {
|
|
1228
|
+
pluginName: string;
|
|
1229
|
+
}) => string;
|
|
1230
|
+
readonly fix: (p: {
|
|
1231
|
+
pluginName: string;
|
|
1232
|
+
}) => string;
|
|
1233
|
+
readonly docs: false;
|
|
1234
|
+
};
|
|
1235
|
+
readonly NUXT_B7008: {
|
|
1236
|
+
readonly why: "`@vitejs/plugin-vue-jsx` is not installed, so JSX support is unavailable.";
|
|
1237
|
+
readonly fix: "Run `npm install -D @vitejs/plugin-vue-jsx` to install it.";
|
|
1238
|
+
readonly docs: false;
|
|
1239
|
+
};
|
|
1240
|
+
readonly NUXT_B7009: {
|
|
1241
|
+
readonly why: (p: {
|
|
1242
|
+
deps: string;
|
|
1243
|
+
}) => string;
|
|
1244
|
+
readonly fix: (p: {
|
|
1245
|
+
install: string;
|
|
1246
|
+
}) => string;
|
|
1247
|
+
readonly docs: false;
|
|
1248
|
+
};
|
|
1249
|
+
readonly NUXT_B7011: {
|
|
1250
|
+
readonly why: (p: {
|
|
1251
|
+
pluginName: string;
|
|
1252
|
+
}) => string;
|
|
1253
|
+
readonly fix: (p: {
|
|
1254
|
+
pluginName: string;
|
|
1255
|
+
}) => string;
|
|
1256
|
+
readonly docs: false;
|
|
1257
|
+
};
|
|
1258
|
+
readonly NUXT_B7012: {
|
|
1259
|
+
readonly why: (p: {
|
|
1260
|
+
requiredSize: number;
|
|
1261
|
+
maxSize: number;
|
|
1262
|
+
}) => string;
|
|
1263
|
+
readonly fix: "Reduce the payload size sent through the ViteNode socket.";
|
|
1264
|
+
readonly docs: false;
|
|
1265
|
+
};
|
|
1266
|
+
readonly NUXT_B7013: {
|
|
1267
|
+
readonly why: "The ViteNode socket server was started without a configured socket path.";
|
|
1268
|
+
readonly fix: "This is likely an internal Nuxt bug. Please report it at https://github.com/nuxt/nuxt/issues.";
|
|
1269
|
+
readonly docs: false;
|
|
1270
|
+
};
|
|
1271
|
+
readonly NUXT_B7014: {
|
|
1272
|
+
readonly why: (p: {
|
|
1273
|
+
name: string;
|
|
1274
|
+
}) => string;
|
|
1275
|
+
readonly fix: "Fix the build errors listed above. If the errors are unclear, try running `nuxi clean` and rebuilding.";
|
|
1276
|
+
readonly docs: false;
|
|
1277
|
+
};
|
|
1278
|
+
readonly NUXT_B7015: {
|
|
1279
|
+
readonly why: "Payload extraction is disabled, which is suboptimal for full-static output.";
|
|
1280
|
+
readonly fix: "Set `experimental.payloadExtraction` to `true` or `'client'`.";
|
|
1281
|
+
readonly docs: false;
|
|
1282
|
+
};
|
|
1283
|
+
readonly NUXT_B7016: {
|
|
1284
|
+
readonly why: (p: {
|
|
1285
|
+
path: string;
|
|
1286
|
+
}) => string;
|
|
1287
|
+
readonly fix: "Point `spaLoadingTemplate` in `nuxt.config` at an existing HTML file, or set it to `true` to use the default template.";
|
|
1288
|
+
readonly docs: false;
|
|
1289
|
+
};
|
|
1290
|
+
readonly NUXT_B7017: {
|
|
1291
|
+
readonly why: "Could not find the Nuxt dev server to attach Rspack HMR to; hot module replacement will be disabled.";
|
|
1292
|
+
readonly fix: "This is likely an internal Nuxt bug. Please report it with a reproduction.";
|
|
1293
|
+
readonly docs: false;
|
|
1294
|
+
};
|
|
1295
|
+
readonly NUXT_B7018: {
|
|
1296
|
+
readonly why: "Failed to restrict vite-node socket permissions; closing the socket.";
|
|
1297
|
+
readonly fix: "Check that the temporary directory used for the vite-node socket is writable and supports `chmod`.";
|
|
1298
|
+
readonly docs: false;
|
|
1299
|
+
};
|
|
1300
|
+
readonly NUXT_B7019: {
|
|
1301
|
+
readonly why: "The server webpack build does not externalize dependencies.";
|
|
1302
|
+
readonly fix: "Externalize dependencies in the server build (`externals`) for better build performance.";
|
|
1303
|
+
readonly docs: false;
|
|
1304
|
+
};
|
|
1305
|
+
}, readonly [import("nostics").DiagnosticReporter<{
|
|
1306
|
+
method?: import("nostics").ConsoleMethod;
|
|
1307
|
+
}>]>;
|
|
1308
|
+
//#endregion
|
|
550
1309
|
//#region src/internal/esm.d.ts
|
|
551
1310
|
interface ResolveModuleOptions {
|
|
552
1311
|
/** @deprecated use `url` with URLs pointing at a file - never a directory */
|
|
@@ -557,11 +1316,11 @@ interface ResolveModuleOptions {
|
|
|
557
1316
|
}
|
|
558
1317
|
declare function directoryToURL(dir: string): URL;
|
|
559
1318
|
/**
|
|
560
|
-
* Resolve a module from a given root path using an algorithm patterned on
|
|
561
|
-
* the upcoming `import.meta.resolve`. It returns a file URL
|
|
562
|
-
*
|
|
563
|
-
* @internal
|
|
564
|
-
*/
|
|
1319
|
+
* Resolve a module from a given root path using an algorithm patterned on
|
|
1320
|
+
* the upcoming `import.meta.resolve`. It returns a file URL
|
|
1321
|
+
*
|
|
1322
|
+
* @internal
|
|
1323
|
+
*/
|
|
565
1324
|
declare function tryResolveModule(id: string, url: URL | URL[]): Promise<string | undefined>;
|
|
566
1325
|
/** @deprecated pass URLs pointing at files */
|
|
567
1326
|
declare function tryResolveModule(id: string, url: string | string[]): Promise<string | undefined>;
|
|
@@ -573,12 +1332,12 @@ interface ImportModuleOptions extends ResolveModuleOptions {
|
|
|
573
1332
|
declare function importModule<T = unknown>(id: string, opts?: ImportModuleOptions): Promise<T>;
|
|
574
1333
|
declare function tryImportModule<T = unknown>(id: string, opts?: ImportModuleOptions): Promise<T | undefined> | undefined;
|
|
575
1334
|
/**
|
|
576
|
-
* @deprecated Please use `importModule` instead.
|
|
577
|
-
*/
|
|
1335
|
+
* @deprecated Please use `importModule` instead.
|
|
1336
|
+
*/
|
|
578
1337
|
declare function requireModule<T = unknown>(id: string, opts?: ImportModuleOptions): T;
|
|
579
1338
|
/**
|
|
580
|
-
* @deprecated Please use `tryImportModule` instead.
|
|
581
|
-
*/
|
|
1339
|
+
* @deprecated Please use `tryImportModule` instead.
|
|
1340
|
+
*/
|
|
582
1341
|
declare function tryRequireModule<T = unknown>(id: string, opts?: ImportModuleOptions): T | undefined;
|
|
583
1342
|
//#endregion
|
|
584
|
-
export { type AddComponentOptions, type AddPluginOptions, type AddRouteMiddlewareOptions, type ExtendConfigOptions, type ExtendRouteRulesOptions, type ExtendViteConfigOptions, type ExtendWebpackConfigOptions, type ImportModuleOptions, type LayerDirectories, type LoadNuxtConfigOptions, type LoadNuxtOptions, type NuxtMajorVersion, type ResolveModuleOptions, type ResolvePathOptions, type Resolver, addBuildPlugin, addComponent, addComponentExports, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addRspackPlugin, addServerHandler, addServerImports, addServerImportsDir, addServerPlugin, addServerScanDir, addServerTemplate, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildNuxt, checkNuxtCompatibility, createIsIgnored, createResolver, defineNuxtModule, directoryToURL, extendNuxtSchema, extendPages, extendRouteRules, extendRspackConfig, extendViteConfig, extendWebpackConfig, findPath, getDirectory, getLayerDirectories, getNuxtCtx, getNuxtModuleVersion, getNuxtVersion, hasNuxtCompatibility, hasNuxtModule, hasNuxtModuleCompatibility, importModule, installModule, installModules, isIgnored, isNuxt2, isNuxt3, isNuxtMajorVersion, loadNuxt, loadNuxtConfig, loadNuxtModuleInstance, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeSemanticVersion, normalizeTemplate, nuxtCtx, requireModule, resolveAlias, resolveFiles, resolveIgnorePatterns, resolveModule, resolveModuleWithOptions, resolveNuxtModule, resolvePath, runWithNuxtContext, setGlobalHead, tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateRuntimeConfig, updateTemplates, useLogger, useNitro, useNuxt, useRuntimeConfig, writeTypes };
|
|
1343
|
+
export { type AddComponentOptions, type AddPluginOptions, type AddRouteMiddlewareOptions, type ExtendConfigOptions, type ExtendRouteRulesOptions, type ExtendViteConfigOptions, type ExtendWebpackConfigOptions, type ImportModuleOptions, type LayerDirectories, type LoadNuxtConfigOptions, type LoadNuxtOptions, type NuxtMajorVersion, type ResolveModuleOptions, type ResolvePathOptions, type Resolver, addBuildPlugin, addComponent, addComponentExports, addComponentsDir, addDevServerHandler, addImports, addImportsDir, addImportsSources, addLayout, addPlugin, addPluginTemplate, addPrerenderRoutes, addRouteMiddleware, addRspackPlugin, addServerHandler, addServerImports, addServerImportsDir, addServerPlugin, addServerScanDir, addServerTemplate, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, assertNuxtCompatibility, buildDiagnostics, buildNuxt, bundlerDiagnostics, checkNuxtCompatibility, componentDiagnostics, configDiagnostics, createIsIgnored, createResolver, defineNuxtModule, directoryToURL, extendNuxtSchema, extendPages, extendRouteRules, extendRspackConfig, extendViteConfig, extendWebpackConfig, findPath, getDirectory, getLayerDirectories, getNuxtCtx, getNuxtModuleVersion, getNuxtVersion, hasNuxtCompatibility, hasNuxtModule, hasNuxtModuleCompatibility, headDiagnostics, importModule, installModule, installModules, isIgnored, isNuxt2, isNuxt3, isNuxtMajorVersion, loadNuxt, loadNuxtConfig, loadNuxtModuleInstance, logger, normalizeModuleTranspilePath, normalizePlugin, normalizeSemanticVersion, normalizeTemplate, nuxtCtx, packageName, pageDiagnostics, pluginDiagnostics, requireModule, resolveAlias, resolveDeclarationPath, resolveFiles, resolveIgnorePatterns, resolveModule, resolveModuleWithOptions, resolveNuxtModule, resolvePath, resolveTypePaths, runWithNuxtContext, setBuildOutput, setGlobalHead, tryImportModule, tryRequireModule, tryResolveModule, tryUseNuxt, updateAppConfig, updateRuntimeConfig, updateTemplates, useLogger, useNitro, useNuxt, useRuntimeConfig, writeTypes };
|