@vizejs/nuxt 0.310.0 → 0.315.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addons-ecITHT3X.d.mts +369 -0
- package/dist/generation-bpnsF4y-.mjs +1201 -0
- package/dist/index.d.mts +11 -242
- package/dist/index.mjs +8 -4
- package/dist/lint/index.d.mts +212 -0
- package/dist/lint/index.mjs +3 -0
- package/package.json +19 -5
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { NuxtLintConfigItem, NuxtLintFeatures } from "@vizejs/nuxt-lint-config";
|
|
2
|
+
import { MuseaOptions } from "@vizejs/vite-plugin-musea";
|
|
3
|
+
|
|
4
|
+
//#region src/compiler-options.d.ts
|
|
5
|
+
type VizeNuxtPattern = string | RegExp;
|
|
6
|
+
type VizeNuxtVueVersion = 0.11 | 1 | 2 | "2.7" | 3 | "legacy";
|
|
7
|
+
interface VizeNuxtCompilerCompatibilityOptions {
|
|
8
|
+
vueVersion?: VizeNuxtVueVersion;
|
|
9
|
+
hostCompiler?: boolean;
|
|
10
|
+
scriptSetupInStandalone?: boolean;
|
|
11
|
+
optionsApiVapor?: boolean;
|
|
12
|
+
nuxtVersion?: 2 | 3 | 4;
|
|
13
|
+
webpackVersion?: 4 | 5;
|
|
14
|
+
}
|
|
15
|
+
interface VizeNuxtInspectorLintPlanRequest {
|
|
16
|
+
files: string[];
|
|
17
|
+
fresh: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface VizeNuxtInspectorOptions {
|
|
20
|
+
lintPlan?: (request: VizeNuxtInspectorLintPlanRequest) => unknown;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Nuxt-facing mirror of the public `@vizejs/vite-plugin` options.
|
|
24
|
+
*
|
|
25
|
+
* Keeping this shape local lets the Nuxt module expose compiler configuration
|
|
26
|
+
* without requiring the sibling package's generated declaration files to exist
|
|
27
|
+
* during monorepo lint runs.
|
|
28
|
+
*/
|
|
29
|
+
interface VizeNuxtCompilerOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Vue major version for the host project.
|
|
32
|
+
*
|
|
33
|
+
* Legacy Vue projects keep the host Vue compiler in charge. When set to
|
|
34
|
+
* `0.11`, `1`, `2`, `"2.7"`, or `"legacy"`, the underlying Vite plugin runs in
|
|
35
|
+
* compatibility mode and does not intercept `.vue` files.
|
|
36
|
+
*/
|
|
37
|
+
vueVersion?: VizeNuxtVueVersion;
|
|
38
|
+
/**
|
|
39
|
+
* Opt-in compatibility features shared with `@vizejs/vite-plugin`.
|
|
40
|
+
*/
|
|
41
|
+
compatibility?: VizeNuxtCompilerCompatibilityOptions;
|
|
42
|
+
/** Emit function-body output for CDN/global Vue evaluation. */
|
|
43
|
+
mode?: "module" | "function";
|
|
44
|
+
/** Module name for runtime imports. */
|
|
45
|
+
runtimeModuleName?: string;
|
|
46
|
+
/** Global variable name for standalone/function mode. */
|
|
47
|
+
runtimeGlobalName?: string;
|
|
48
|
+
/** Development inspector integrations forwarded to the Vite plugin. */
|
|
49
|
+
inspector?: VizeNuxtInspectorOptions;
|
|
50
|
+
/** Override the public base used for dev-time asset URLs. */
|
|
51
|
+
devUrlBase?: string;
|
|
52
|
+
/** Files to include in compilation. */
|
|
53
|
+
include?: VizeNuxtPattern | VizeNuxtPattern[];
|
|
54
|
+
/** Files to exclude from compilation. */
|
|
55
|
+
exclude?: VizeNuxtPattern | VizeNuxtPattern[];
|
|
56
|
+
/** Force production mode. */
|
|
57
|
+
isProduction?: boolean;
|
|
58
|
+
/** Enable SSR mode. */
|
|
59
|
+
ssr?: boolean;
|
|
60
|
+
/** Enable source map generation. */
|
|
61
|
+
sourceMap?: boolean;
|
|
62
|
+
/** Enable Vapor mode compilation. */
|
|
63
|
+
vapor?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Default output mode for `.jsx`/`.tsx` components without a `"use vue:*"`
|
|
66
|
+
* directive (forwarded to the underlying Vize plugin). @default "vdom"
|
|
67
|
+
*/
|
|
68
|
+
jsxMode?: "vdom" | "vapor";
|
|
69
|
+
/** Treat lowercase non-HTML tags as custom renderer elements. */
|
|
70
|
+
customRenderer?: boolean;
|
|
71
|
+
/** Template syntax compatibility mode. */
|
|
72
|
+
templateSyntax?: "standard" | "strict" | "quirks";
|
|
73
|
+
/** Root directory to scan for .vue files. */
|
|
74
|
+
root?: string;
|
|
75
|
+
/** Glob patterns to scan for .vue files during pre-compilation. */
|
|
76
|
+
scanPatterns?: string[];
|
|
77
|
+
/** Maximum number of Vue files to compile in a single native batch. */
|
|
78
|
+
precompileBatchSize?: number;
|
|
79
|
+
/** Glob patterns to ignore during pre-compilation. */
|
|
80
|
+
ignorePatterns?: string[];
|
|
81
|
+
/** Config file search mode. */
|
|
82
|
+
configMode?: "root" | "auto" | false;
|
|
83
|
+
/** Custom config file path. */
|
|
84
|
+
configFile?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Handle .vue files in node_modules during on-demand compilation.
|
|
87
|
+
* @default true
|
|
88
|
+
*/
|
|
89
|
+
handleNodeModulesVue?: boolean;
|
|
90
|
+
/** Enable debug logging. */
|
|
91
|
+
debug?: boolean;
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/lint/checker/options.d.ts
|
|
95
|
+
/** Portable checker options mirrored from `@nuxt/eslint`. */
|
|
96
|
+
interface VizeNuxtLintCheckerOptions {
|
|
97
|
+
/** Reuse the long-lived checker and lint only changed files after startup. */
|
|
98
|
+
cache?: boolean;
|
|
99
|
+
/** Files considered by the checker. */
|
|
100
|
+
include?: string[];
|
|
101
|
+
/** Files and directories excluded from checker runs. */
|
|
102
|
+
exclude?: string[];
|
|
103
|
+
/** Oxlint output formatter. */
|
|
104
|
+
formatter?: string;
|
|
105
|
+
/** Run a complete lint pass when the dev server starts. */
|
|
106
|
+
lintOnStart?: boolean;
|
|
107
|
+
/** Print warning diagnostics and surface them in the browser overlay. */
|
|
108
|
+
emitWarning?: boolean;
|
|
109
|
+
/** Print error diagnostics and surface them in the browser overlay. */
|
|
110
|
+
emitError?: boolean;
|
|
111
|
+
/** Apply safe fixes before reporting diagnostics. */
|
|
112
|
+
fix?: boolean;
|
|
113
|
+
}
|
|
114
|
+
/** Project paths used by upstream's checker defaults. */
|
|
115
|
+
interface NuxtLintCheckerProject {
|
|
116
|
+
buildDir: string;
|
|
117
|
+
srcDir: string;
|
|
118
|
+
}
|
|
119
|
+
/** Fully defaulted checker options consumed by the worker integration. */
|
|
120
|
+
interface ResolvedVizeNuxtLintCheckerOptions {
|
|
121
|
+
cache: boolean;
|
|
122
|
+
include: string[];
|
|
123
|
+
exclude: string[];
|
|
124
|
+
formatter: string;
|
|
125
|
+
lintOnStart: boolean;
|
|
126
|
+
emitWarning: boolean;
|
|
127
|
+
emitError: boolean;
|
|
128
|
+
fix: boolean;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Resolve the engine-neutral part of `@nuxt/eslint`'s checker contract.
|
|
132
|
+
*
|
|
133
|
+
* `configType` and `eslintPath` intentionally do not exist: they choose an
|
|
134
|
+
* ESLint implementation, while this checker always executes oxlint + Patina.
|
|
135
|
+
*/
|
|
136
|
+
declare function resolveNuxtLintCheckerOptions(checker: boolean | VizeNuxtLintCheckerOptions | undefined, project: NuxtLintCheckerProject): ResolvedVizeNuxtLintCheckerOptions | false;
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/lint/options.d.ts
|
|
139
|
+
interface VizeNuxtLintDevtoolsOptions {
|
|
140
|
+
/** Enable the inspector eagerly, lazily from its tab, or not at all. @default "lazy" */
|
|
141
|
+
enabled?: boolean | "lazy";
|
|
142
|
+
/** Localhost port for the in-process inspector UI. An available port is chosen by default. */
|
|
143
|
+
port?: number;
|
|
144
|
+
}
|
|
145
|
+
/** Options for the generated Nuxt-aware oxlint configuration. */
|
|
146
|
+
interface VizeNuxtLintOptions extends NuxtLintFeatures {
|
|
147
|
+
/**
|
|
148
|
+
* File path for the generated oxlint config.
|
|
149
|
+
*
|
|
150
|
+
* Relative paths are resolved from the Nuxt project root.
|
|
151
|
+
* @default ".nuxt/oxlint.config.json"
|
|
152
|
+
*/
|
|
153
|
+
configFile?: string;
|
|
154
|
+
/**
|
|
155
|
+
* Create a root `oxlint.config.mts` loading the generated config when no
|
|
156
|
+
* supported oxlint config exists in the project or an ancestor.
|
|
157
|
+
* @default true
|
|
158
|
+
*/
|
|
159
|
+
autoInit?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Override the directory the generated Nuxt globs are relative to.
|
|
162
|
+
* @default nuxt.options.rootDir
|
|
163
|
+
*/
|
|
164
|
+
rootDir?: string;
|
|
165
|
+
/** Expose the resolved plan in a Nuxt DevTools tab. @default { enabled: "lazy" } */
|
|
166
|
+
devtools?: VizeNuxtLintDevtoolsOptions;
|
|
167
|
+
}
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region src/options.d.ts
|
|
170
|
+
type VizeNuxtMajorVersion = 2 | 3 | 4;
|
|
171
|
+
interface VizeNuxtCompatibilityOptions {
|
|
172
|
+
/**
|
|
173
|
+
* Override the detected Nuxt major version.
|
|
174
|
+
*
|
|
175
|
+
* This exists for projects with unusual module wrappers. Most projects should
|
|
176
|
+
* leave it on automatic detection.
|
|
177
|
+
*/
|
|
178
|
+
nuxtVersion?: VizeNuxtMajorVersion;
|
|
179
|
+
/**
|
|
180
|
+
* Override the detected Vue major version.
|
|
181
|
+
*
|
|
182
|
+
* Nuxt 2 defaults to Vue 2 compatibility mode; Nuxt 3/4 defaults to Vue 3.
|
|
183
|
+
* Vue 0.11, Vue 1, and Vue 2 all use host-compiler compatibility mode.
|
|
184
|
+
*/
|
|
185
|
+
vueVersion?: VizeNuxtVueVersion;
|
|
186
|
+
/**
|
|
187
|
+
* Keep legacy Vue projects on the host Vue compiler while still allowing the
|
|
188
|
+
* Vize Nuxt module to provide bridges, linting, type checking, and Musea.
|
|
189
|
+
*
|
|
190
|
+
* @default true for Vue 0.11, Vue 1, Vue 2, and Nuxt 2
|
|
191
|
+
*/
|
|
192
|
+
hostCompiler?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Allow registering the Vite compiler bridge even when Nuxt's builder
|
|
195
|
+
* detection cannot prove Vite support.
|
|
196
|
+
*
|
|
197
|
+
* @default false
|
|
198
|
+
*/
|
|
199
|
+
forceViteCompiler?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Enable function-body output for CDN/global Vue evaluation.
|
|
202
|
+
*/
|
|
203
|
+
scriptSetupInStandalone?: boolean;
|
|
204
|
+
/**
|
|
205
|
+
* Allow Vapor output for Options API SFCs when the compiler is active.
|
|
206
|
+
*/
|
|
207
|
+
optionsApiVapor?: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Preserve shared compatibility objects that also configure
|
|
210
|
+
* `@vizejs/unplugin/webpack`.
|
|
211
|
+
*/
|
|
212
|
+
webpackVersion?: 4 | 5;
|
|
213
|
+
}
|
|
214
|
+
interface VizeNuxtBridgeOptions {
|
|
215
|
+
/**
|
|
216
|
+
* Re-apply Nuxt auto-import injection to Vize virtual Vue modules.
|
|
217
|
+
* @default true
|
|
218
|
+
*/
|
|
219
|
+
autoImports?: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* Re-apply Nuxt component auto-import resolution to Vize virtual Vue modules.
|
|
222
|
+
* @default true
|
|
223
|
+
*/
|
|
224
|
+
components?: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Re-apply @nuxtjs/i18n helper injection to Vize virtual Vue modules.
|
|
227
|
+
* @default true
|
|
228
|
+
*/
|
|
229
|
+
i18n?: boolean;
|
|
230
|
+
/**
|
|
231
|
+
* Stabilize Nuxt generated async-data keys between client and SSR transforms.
|
|
232
|
+
* @default true
|
|
233
|
+
*/
|
|
234
|
+
stableInjectedKeys?: boolean;
|
|
235
|
+
}
|
|
236
|
+
interface VizeNuxtUnoCssOptions {
|
|
237
|
+
/**
|
|
238
|
+
* Feed the original .vue source to UnoCSS extraction-only plugins so
|
|
239
|
+
* attributify syntax survives Vize's render-function output.
|
|
240
|
+
*
|
|
241
|
+
* Set to `false` to skip reading SFC source files. Use an object to tune the
|
|
242
|
+
* maximum source size read into Node.
|
|
243
|
+
*
|
|
244
|
+
* @default true
|
|
245
|
+
*/
|
|
246
|
+
originalSource?: boolean | {
|
|
247
|
+
/**
|
|
248
|
+
* Maximum original .vue source size to append for UnoCSS extraction.
|
|
249
|
+
* @default 2097152
|
|
250
|
+
*/
|
|
251
|
+
maxBytes?: number;
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
interface VizeNuxtDevOptions {
|
|
255
|
+
/**
|
|
256
|
+
* Remove broken duplicate/unsafe stylesheet links from Nuxt dev SSR HTML
|
|
257
|
+
* when Vize is the Vue compiler.
|
|
258
|
+
*
|
|
259
|
+
* @default true
|
|
260
|
+
*/
|
|
261
|
+
stylesheetLinks?: boolean;
|
|
262
|
+
}
|
|
263
|
+
interface NuxtMuseaOptions {
|
|
264
|
+
route?: {
|
|
265
|
+
path?: string;
|
|
266
|
+
name?: string;
|
|
267
|
+
params?: Record<string, string>;
|
|
268
|
+
query?: Record<string, string>;
|
|
269
|
+
hash?: string;
|
|
270
|
+
fullPath?: string;
|
|
271
|
+
meta?: Record<string, unknown>;
|
|
272
|
+
};
|
|
273
|
+
runtimeConfig?: {
|
|
274
|
+
public?: Record<string, unknown>;
|
|
275
|
+
[key: string]: unknown;
|
|
276
|
+
};
|
|
277
|
+
fetchMocks?: Record<string, unknown>;
|
|
278
|
+
stateMocks?: Record<string, unknown>;
|
|
279
|
+
}
|
|
280
|
+
interface VizeNuxtOptions {
|
|
281
|
+
/**
|
|
282
|
+
* Host framework compatibility overrides.
|
|
283
|
+
*
|
|
284
|
+
* These are usually inferred from Nuxt itself. Set `vueVersion: 0.11`, `1`,
|
|
285
|
+
* `2`, or `"legacy"` for setups that must keep the host compiler.
|
|
286
|
+
*/
|
|
287
|
+
compatibility?: VizeNuxtCompatibilityOptions;
|
|
288
|
+
/**
|
|
289
|
+
* Enable/disable the Vize compiler (Vue SFC compilation via Vite plugin).
|
|
290
|
+
* Pass an object to configure the underlying `@vizejs/vite-plugin`.
|
|
291
|
+
*
|
|
292
|
+
* @default true
|
|
293
|
+
*/
|
|
294
|
+
compiler?: boolean | VizeNuxtCompilerOptions;
|
|
295
|
+
/**
|
|
296
|
+
* Nuxt compatibility bridges for transforms that normally skip Rollup
|
|
297
|
+
* virtual module ids.
|
|
298
|
+
*
|
|
299
|
+
* @default true
|
|
300
|
+
*/
|
|
301
|
+
bridge?: boolean | VizeNuxtBridgeOptions;
|
|
302
|
+
/**
|
|
303
|
+
* UnoCSS bridge options for Vize virtual Vue modules.
|
|
304
|
+
*
|
|
305
|
+
* @default true
|
|
306
|
+
*/
|
|
307
|
+
unocss?: boolean | VizeNuxtUnoCssOptions;
|
|
308
|
+
/**
|
|
309
|
+
* Dev-server integration options.
|
|
310
|
+
*/
|
|
311
|
+
dev?: VizeNuxtDevOptions;
|
|
312
|
+
/**
|
|
313
|
+
* Generate the Nuxt-aware oxlint config consumed by Vize's linting engine.
|
|
314
|
+
* @default true
|
|
315
|
+
*/
|
|
316
|
+
lint?: boolean | VizeNuxtLintOptions;
|
|
317
|
+
/** Run oxlint + Patina beside the dev server. @default false */
|
|
318
|
+
checker?: boolean | VizeNuxtLintCheckerOptions;
|
|
319
|
+
/**
|
|
320
|
+
* Musea gallery options.
|
|
321
|
+
* Set to `true` to enable Musea with default options.
|
|
322
|
+
*
|
|
323
|
+
* @default false
|
|
324
|
+
*/
|
|
325
|
+
musea?: boolean | MuseaOptions;
|
|
326
|
+
/**
|
|
327
|
+
* Nuxt mock options for musea gallery.
|
|
328
|
+
* NOTE: In Nuxt context, nuxtMusea mocks are NOT added as a global Vite plugin
|
|
329
|
+
* because they would intercept `#imports` resolution and break Nuxt's internals.
|
|
330
|
+
* Real Nuxt composables are available via Nuxt's own plugin pipeline.
|
|
331
|
+
*/
|
|
332
|
+
nuxtMusea?: NuxtMuseaOptions;
|
|
333
|
+
}
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/lint/addons.d.ts
|
|
336
|
+
/** Hook other Nuxt modules use to extend Vize's generated lint config. */
|
|
337
|
+
declare const VIZE_NUXT_LINT_CONFIG_ADDONS_HOOK: "vize:lint:config:addons";
|
|
338
|
+
/** A synchronous or asynchronous addon result, matching Nuxt hook conventions. */
|
|
339
|
+
type NuxtLintAwaitable<T> = T | Promise<T>;
|
|
340
|
+
/** The import identity exposed by Nuxt and Nitro's unimport registries. */
|
|
341
|
+
interface NuxtLintImport {
|
|
342
|
+
from: string;
|
|
343
|
+
name: string;
|
|
344
|
+
as?: string;
|
|
345
|
+
}
|
|
346
|
+
/** One extension of the generated, engine-neutral lint config plan. */
|
|
347
|
+
interface NuxtLintConfigAddon {
|
|
348
|
+
name: string;
|
|
349
|
+
getConfigs(): NuxtLintAwaitable<readonly NuxtLintConfigItem[] | undefined>;
|
|
350
|
+
}
|
|
351
|
+
/** The Nuxt hook surface used by lint config addons. */
|
|
352
|
+
interface NuxtLintConfigAddonNuxt {
|
|
353
|
+
hook(name: "imports:context" | "nitro:init", callback: (value: unknown) => unknown): void;
|
|
354
|
+
callHook(name: typeof VIZE_NUXT_LINT_CONFIG_ADDONS_HOOK, addons: NuxtLintConfigAddon[]): NuxtLintAwaitable<void>;
|
|
355
|
+
}
|
|
356
|
+
/** Resolve the config items contributed by the current addon registry. */
|
|
357
|
+
type ResolveNuxtLintConfigAddons = () => Promise<readonly NuxtLintConfigItem[]>;
|
|
358
|
+
/**
|
|
359
|
+
* Register the built-in auto-import addon and return the generation-time
|
|
360
|
+
* resolver consumed by the Nuxt lint config writer.
|
|
361
|
+
*
|
|
362
|
+
* The addon array is rebuilt for every generation. This mirrors Nuxt's addon
|
|
363
|
+
* hook without retaining contributions across `builder:generateApp` runs.
|
|
364
|
+
* The Vize-namespaced hook carries engine-neutral config items instead of raw
|
|
365
|
+
* ESLint source, so contributors remain compatible with the oxlint emitter.
|
|
366
|
+
*/
|
|
367
|
+
declare function setupNuxtLintConfigAddons(nuxt: NuxtLintConfigAddonNuxt): ResolveNuxtLintConfigAddons;
|
|
368
|
+
//#endregion
|
|
369
|
+
export { VizeNuxtLintCheckerOptions as _, ResolveNuxtLintConfigAddons as a, VizeNuxtCompilerOptions as b, NuxtMuseaOptions as c, VizeNuxtDevOptions as d, VizeNuxtMajorVersion as f, ResolvedVizeNuxtLintCheckerOptions as g, VizeNuxtLintOptions as h, NuxtLintImport as i, VizeNuxtBridgeOptions as l, VizeNuxtUnoCssOptions as m, NuxtLintConfigAddon as n, VIZE_NUXT_LINT_CONFIG_ADDONS_HOOK as o, VizeNuxtOptions as p, NuxtLintConfigAddonNuxt as r, setupNuxtLintConfigAddons as s, NuxtLintAwaitable as t, VizeNuxtCompatibilityOptions as u, resolveNuxtLintCheckerOptions as v, VizeNuxtVueVersion as x, VizeNuxtCompilerCompatibilityOptions as y };
|