@vizejs/nuxt 0.312.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/index.d.mts CHANGED
@@ -1,245 +1,6 @@
1
- import { MuseaOptions, MuseaOptions as MuseaOptions$1 } from "@vizejs/vite-plugin-musea";
1
+ import { _ as VizeNuxtLintCheckerOptions, b as VizeNuxtCompilerOptions, c as NuxtMuseaOptions, d as VizeNuxtDevOptions, f as VizeNuxtMajorVersion, h as VizeNuxtLintOptions, l as VizeNuxtBridgeOptions, m as VizeNuxtUnoCssOptions, n as NuxtLintConfigAddon, p as VizeNuxtOptions, u as VizeNuxtCompatibilityOptions, x as VizeNuxtVueVersion, y as VizeNuxtCompilerCompatibilityOptions } from "./addons-ecITHT3X.mjs";
2
+ import { MuseaOptions } from "@vizejs/vite-plugin-musea";
2
3
 
3
- //#region src/compiler-options.d.ts
4
- type VizeNuxtPattern = string | RegExp;
5
- type VizeNuxtVueVersion = 0.11 | 1 | 2 | "2.7" | 3 | "legacy";
6
- interface VizeNuxtCompilerCompatibilityOptions {
7
- vueVersion?: VizeNuxtVueVersion;
8
- hostCompiler?: boolean;
9
- scriptSetupInStandalone?: boolean;
10
- optionsApiVapor?: boolean;
11
- nuxtVersion?: 2 | 3 | 4;
12
- webpackVersion?: 4 | 5;
13
- }
14
- /**
15
- * Nuxt-facing mirror of the public `@vizejs/vite-plugin` options.
16
- *
17
- * Keeping this shape local lets the Nuxt module expose compiler configuration
18
- * without requiring the sibling package's generated declaration files to exist
19
- * during monorepo lint runs.
20
- */
21
- interface VizeNuxtCompilerOptions {
22
- /**
23
- * Vue major version for the host project.
24
- *
25
- * Legacy Vue projects keep the host Vue compiler in charge. When set to
26
- * `0.11`, `1`, `2`, `"2.7"`, or `"legacy"`, the underlying Vite plugin runs in
27
- * compatibility mode and does not intercept `.vue` files.
28
- */
29
- vueVersion?: VizeNuxtVueVersion;
30
- /**
31
- * Opt-in compatibility features shared with `@vizejs/vite-plugin`.
32
- */
33
- compatibility?: VizeNuxtCompilerCompatibilityOptions;
34
- /** Emit function-body output for CDN/global Vue evaluation. */
35
- mode?: "module" | "function";
36
- /** Module name for runtime imports. */
37
- runtimeModuleName?: string;
38
- /** Global variable name for standalone/function mode. */
39
- runtimeGlobalName?: string;
40
- /** Override the public base used for dev-time asset URLs. */
41
- devUrlBase?: string;
42
- /** Files to include in compilation. */
43
- include?: VizeNuxtPattern | VizeNuxtPattern[];
44
- /** Files to exclude from compilation. */
45
- exclude?: VizeNuxtPattern | VizeNuxtPattern[];
46
- /** Force production mode. */
47
- isProduction?: boolean;
48
- /** Enable SSR mode. */
49
- ssr?: boolean;
50
- /** Enable source map generation. */
51
- sourceMap?: boolean;
52
- /** Enable Vapor mode compilation. */
53
- vapor?: boolean;
54
- /**
55
- * Default output mode for `.jsx`/`.tsx` components without a `"use vue:*"`
56
- * directive (forwarded to the underlying Vize plugin). @default "vdom"
57
- */
58
- jsxMode?: "vdom" | "vapor";
59
- /** Treat lowercase non-HTML tags as custom renderer elements. */
60
- customRenderer?: boolean;
61
- /** Template syntax compatibility mode. */
62
- templateSyntax?: "standard" | "strict" | "quirks";
63
- /** Root directory to scan for .vue files. */
64
- root?: string;
65
- /** Glob patterns to scan for .vue files during pre-compilation. */
66
- scanPatterns?: string[];
67
- /** Maximum number of Vue files to compile in a single native batch. */
68
- precompileBatchSize?: number;
69
- /** Glob patterns to ignore during pre-compilation. */
70
- ignorePatterns?: string[];
71
- /** Config file search mode. */
72
- configMode?: "root" | "auto" | false;
73
- /** Custom config file path. */
74
- configFile?: string;
75
- /**
76
- * Handle .vue files in node_modules during on-demand compilation.
77
- * @default true
78
- */
79
- handleNodeModulesVue?: boolean;
80
- /** Enable debug logging. */
81
- debug?: boolean;
82
- }
83
- //#endregion
84
- //#region src/options.d.ts
85
- type VizeNuxtMajorVersion = 2 | 3 | 4;
86
- interface VizeNuxtCompatibilityOptions {
87
- /**
88
- * Override the detected Nuxt major version.
89
- *
90
- * This exists for projects with unusual module wrappers. Most projects should
91
- * leave it on automatic detection.
92
- */
93
- nuxtVersion?: VizeNuxtMajorVersion;
94
- /**
95
- * Override the detected Vue major version.
96
- *
97
- * Nuxt 2 defaults to Vue 2 compatibility mode; Nuxt 3/4 defaults to Vue 3.
98
- * Vue 0.11, Vue 1, and Vue 2 all use host-compiler compatibility mode.
99
- */
100
- vueVersion?: VizeNuxtVueVersion;
101
- /**
102
- * Keep legacy Vue projects on the host Vue compiler while still allowing the
103
- * Vize Nuxt module to provide bridges, linting, type checking, and Musea.
104
- *
105
- * @default true for Vue 0.11, Vue 1, Vue 2, and Nuxt 2
106
- */
107
- hostCompiler?: boolean;
108
- /**
109
- * Allow registering the Vite compiler bridge even when Nuxt's builder
110
- * detection cannot prove Vite support.
111
- *
112
- * @default false
113
- */
114
- forceViteCompiler?: boolean;
115
- /**
116
- * Enable function-body output for CDN/global Vue evaluation.
117
- */
118
- scriptSetupInStandalone?: boolean;
119
- /**
120
- * Allow Vapor output for Options API SFCs when the compiler is active.
121
- */
122
- optionsApiVapor?: boolean;
123
- /**
124
- * Preserve shared compatibility objects that also configure
125
- * `@vizejs/unplugin/webpack`.
126
- */
127
- webpackVersion?: 4 | 5;
128
- }
129
- interface VizeNuxtBridgeOptions {
130
- /**
131
- * Re-apply Nuxt auto-import injection to Vize virtual Vue modules.
132
- * @default true
133
- */
134
- autoImports?: boolean;
135
- /**
136
- * Re-apply Nuxt component auto-import resolution to Vize virtual Vue modules.
137
- * @default true
138
- */
139
- components?: boolean;
140
- /**
141
- * Re-apply @nuxtjs/i18n helper injection to Vize virtual Vue modules.
142
- * @default true
143
- */
144
- i18n?: boolean;
145
- /**
146
- * Stabilize Nuxt generated async-data keys between client and SSR transforms.
147
- * @default true
148
- */
149
- stableInjectedKeys?: boolean;
150
- }
151
- interface VizeNuxtUnoCssOptions {
152
- /**
153
- * Feed the original .vue source to UnoCSS extraction-only plugins so
154
- * attributify syntax survives Vize's render-function output.
155
- *
156
- * Set to `false` to skip reading SFC source files. Use an object to tune the
157
- * maximum source size read into Node.
158
- *
159
- * @default true
160
- */
161
- originalSource?: boolean | {
162
- /**
163
- * Maximum original .vue source size to append for UnoCSS extraction.
164
- * @default 2097152
165
- */
166
- maxBytes?: number;
167
- };
168
- }
169
- interface VizeNuxtDevOptions {
170
- /**
171
- * Remove broken duplicate/unsafe stylesheet links from Nuxt dev SSR HTML
172
- * when Vize is the Vue compiler.
173
- *
174
- * @default true
175
- */
176
- stylesheetLinks?: boolean;
177
- }
178
- interface NuxtMuseaOptions {
179
- route?: {
180
- path?: string;
181
- name?: string;
182
- params?: Record<string, string>;
183
- query?: Record<string, string>;
184
- hash?: string;
185
- fullPath?: string;
186
- meta?: Record<string, unknown>;
187
- };
188
- runtimeConfig?: {
189
- public?: Record<string, unknown>;
190
- [key: string]: unknown;
191
- };
192
- fetchMocks?: Record<string, unknown>;
193
- stateMocks?: Record<string, unknown>;
194
- }
195
- interface VizeNuxtOptions {
196
- /**
197
- * Host framework compatibility overrides.
198
- *
199
- * These are usually inferred from Nuxt itself. Set `vueVersion: 0.11`, `1`,
200
- * `2`, or `"legacy"` for setups that must keep the host compiler.
201
- */
202
- compatibility?: VizeNuxtCompatibilityOptions;
203
- /**
204
- * Enable/disable the Vize compiler (Vue SFC compilation via Vite plugin).
205
- * Pass an object to configure the underlying `@vizejs/vite-plugin`.
206
- *
207
- * @default true
208
- */
209
- compiler?: boolean | VizeNuxtCompilerOptions;
210
- /**
211
- * Nuxt compatibility bridges for transforms that normally skip Rollup
212
- * virtual module ids.
213
- *
214
- * @default true
215
- */
216
- bridge?: boolean | VizeNuxtBridgeOptions;
217
- /**
218
- * UnoCSS bridge options for Vize virtual Vue modules.
219
- *
220
- * @default true
221
- */
222
- unocss?: boolean | VizeNuxtUnoCssOptions;
223
- /**
224
- * Dev-server integration options.
225
- */
226
- dev?: VizeNuxtDevOptions;
227
- /**
228
- * Musea gallery options.
229
- * Set to `true` to enable Musea with default options.
230
- *
231
- * @default false
232
- */
233
- musea?: boolean | MuseaOptions$1;
234
- /**
235
- * Nuxt mock options for musea gallery.
236
- * NOTE: In Nuxt context, nuxtMusea mocks are NOT added as a global Vite plugin
237
- * because they would intercept `#imports` resolution and break Nuxt's internals.
238
- * Real Nuxt composables are available via Nuxt's own plugin pipeline.
239
- */
240
- nuxtMusea?: NuxtMuseaOptions;
241
- }
242
- //#endregion
243
4
  //#region src/schema.d.ts
244
5
  declare module "nuxt/schema" {
245
6
  interface NuxtConfig {
@@ -248,6 +9,9 @@ declare module "nuxt/schema" {
248
9
  interface NuxtOptions {
249
10
  vize?: Partial<VizeNuxtOptions>;
250
11
  }
12
+ interface NuxtHooks {
13
+ "vize:lint:config:addons": (addons: NuxtLintConfigAddon[]) => void;
14
+ }
251
15
  }
252
16
  declare module "@nuxt/schema" {
253
17
  interface NuxtConfig {
@@ -256,6 +20,9 @@ declare module "@nuxt/schema" {
256
20
  interface NuxtOptions {
257
21
  vize?: Partial<VizeNuxtOptions>;
258
22
  }
23
+ interface NuxtHooks {
24
+ "vize:lint:config:addons": (addons: NuxtLintConfigAddon[]) => void;
25
+ }
259
26
  }
260
27
  //#endregion
261
28
  //#region src/index.d.ts
@@ -309,6 +76,8 @@ declare const vizeNuxtModule: ((this: VizeNuxtModuleContext | void, inlineOption
309
76
  readonly configKey: "vize";
310
77
  };
311
78
  defaults: {
79
+ checker: false;
80
+ lint: true;
312
81
  musea: false;
313
82
  nuxtMusea: {
314
83
  route: {
@@ -318,4 +87,4 @@ declare const vizeNuxtModule: ((this: VizeNuxtModuleContext | void, inlineOption
318
87
  };
319
88
  };
320
89
  //#endregion
321
- export { type MuseaOptions, type NuxtMuseaOptions, type VizeNuxtBridgeOptions, type VizeNuxtCompatibilityOptions, type VizeNuxtCompilerCompatibilityOptions, type VizeNuxtCompilerOptions, type VizeNuxtDevOptions, type VizeNuxtMajorVersion, type VizeNuxtOptions, type VizeNuxtUnoCssOptions, type VizeNuxtVueVersion, vizeNuxtModule as default };
90
+ export { type MuseaOptions, type NuxtMuseaOptions, type VizeNuxtBridgeOptions, type VizeNuxtCompatibilityOptions, type VizeNuxtCompilerCompatibilityOptions, type VizeNuxtCompilerOptions, type VizeNuxtDevOptions, type VizeNuxtLintCheckerOptions, type VizeNuxtLintOptions, type VizeNuxtMajorVersion, type VizeNuxtOptions, type VizeNuxtUnoCssOptions, type VizeNuxtVueVersion, vizeNuxtModule as default };
package/dist/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import { i as setupLintInspector, l as setupNuxtLintChecker, n as setupNuxtLintConfigGeneration } from "./generation-bpnsF4y-.mjs";
1
2
  import { createRequire } from "node:module";
2
3
  import fs from "node:fs";
3
4
  import path, { dirname, resolve } from "node:path";
@@ -898,6 +899,8 @@ const moduleMeta = {
898
899
  configKey: "vize"
899
900
  };
900
901
  const moduleDefaults = {
902
+ checker: false,
903
+ lint: true,
901
904
  musea: false,
902
905
  nuxtMusea: { route: { path: "/" } }
903
906
  };
@@ -907,12 +910,10 @@ function loadNuxtKit() {
907
910
  return nuxtKitPromise;
908
911
  }
909
912
  async function addNuxtServerPlugin(plugin) {
910
- const { addServerPlugin } = await loadNuxtKit();
911
- addServerPlugin(plugin);
913
+ (await loadNuxtKit()).addServerPlugin(plugin);
912
914
  }
913
915
  async function addNuxtVitePlugin(plugin) {
914
- const { addVitePlugin } = await loadNuxtKit();
915
- addVitePlugin(plugin);
916
+ (await loadNuxtKit()).addVitePlugin(plugin);
916
917
  }
917
918
  function isPlainRecord(value) {
918
919
  return value != null && typeof value === "object" && !Array.isArray(value);
@@ -1032,6 +1033,8 @@ function patchNuxtAutoImportTransformPlugin(plugin, isBuild) {
1032
1033
  plugin[VIZE_NUXT_AUTO_IMPORT_PATCHED] = true;
1033
1034
  }
1034
1035
  async function setupVizeNuxtModule(options, nuxt) {
1036
+ const lintGeneration = await setupNuxtLintConfigGeneration(options.lint, nuxt);
1037
+ await setupNuxtLintChecker(options.checker, nuxt, lintGeneration);
1035
1038
  const resolver = createNuxtModuleResolver();
1036
1039
  const detectedNuxtMajor = options.compatibility?.nuxtVersion ?? getDetectedNuxtMajor(nuxt) ?? 3;
1037
1040
  const vueVersion = options.compatibility?.vueVersion ?? (detectedNuxtMajor === 2 ? 2 : 3);
@@ -1048,6 +1051,7 @@ async function setupVizeNuxtModule(options, nuxt) {
1048
1051
  supportsViteCompiler,
1049
1052
  vueVersion
1050
1053
  });
1054
+ await setupLintInspector(options.lint, nuxt, compilerOptions, lintGeneration, nuxt.options.dev);
1051
1055
  const usesVizeCompiler = shouldUseVizeCompiler(compilerOptions);
1052
1056
  if (compilerOptions !== false && compilerOptions.compatibility?.hostCompiler !== true) {
1053
1057
  const { default: vize } = await import("@vizejs/vite-plugin");
@@ -0,0 +1,212 @@
1
+ import { _ as VizeNuxtLintCheckerOptions, a as ResolveNuxtLintConfigAddons, g as ResolvedVizeNuxtLintCheckerOptions, h as VizeNuxtLintOptions, i as NuxtLintImport, n as NuxtLintConfigAddon, o as VIZE_NUXT_LINT_CONFIG_ADDONS_HOOK, r as NuxtLintConfigAddonNuxt, s as setupNuxtLintConfigAddons, t as NuxtLintAwaitable, v as resolveNuxtLintCheckerOptions } from "../addons-ecITHT3X.mjs";
2
+ import { NuxtLintConfigItem, NuxtLintDirNames, NuxtLintLayer, NuxtLintProjectState } from "@vizejs/nuxt-lint-config";
3
+ export * from "@vizejs/nuxt-lint-config";
4
+
5
+ //#region src/lint/generation.d.ts
6
+ /** Root config names supported by oxlint's config discovery. */
7
+ declare const ROOT_OXLINT_CONFIG_NAMES: readonly [".oxlintrc.json", ".oxlintrc.jsonc", "oxlint.config.ts", "oxlint.config.mts"];
8
+ type Awaitable$1<T> = T | Promise<T>;
9
+ interface NuxtLintGenerationNuxt {
10
+ options: {
11
+ buildDir: string;
12
+ rootDir: string;
13
+ [key: string]: unknown;
14
+ };
15
+ hook(name: string, callback: (...args: unknown[]) => unknown): void;
16
+ }
17
+ interface NuxtLintGenerationDependencies {
18
+ /** Phase #3614 supplies fresh addon items through this seam. */
19
+ resolveAddons?: () => Awaitable$1<readonly NuxtLintConfigItem[]>;
20
+ hasTypeScript?: (rootDir: string) => boolean;
21
+ resolvePluginSpecifier?: (configDir: string) => string;
22
+ }
23
+ interface NuxtLintConfigGeneration {
24
+ configFile: string;
25
+ root: string;
26
+ regenerate(): Promise<boolean>;
27
+ resolvePlan(fresh?: boolean): Promise<readonly NuxtLintConfigItem[]>;
28
+ }
29
+ /**
30
+ * Write bytes only when they differ from the current regular file.
31
+ *
32
+ * The length fast path mirrors Canon's materializer. A full byte comparison is
33
+ * still required before skipping so equal-size edits are never mistaken for a
34
+ * cache hit. Symlinks are rejected instead of followed.
35
+ */
36
+ declare function writeFileIfChanged(file: string, content: string): Promise<boolean>;
37
+ /**
38
+ * Generate the initial config and register the Nuxt regeneration hook.
39
+ *
40
+ * Addons are resolved inside `regenerate`, not at setup time, so Nuxt's import
41
+ * registry and third-party module hooks can change between generateApp passes.
42
+ */
43
+ declare function setupNuxtLintConfigGeneration(lint: boolean | VizeNuxtLintOptions | undefined, nuxt: NuxtLintGenerationNuxt, dependencies?: NuxtLintGenerationDependencies): Promise<NuxtLintConfigGeneration | undefined>;
44
+ //#endregion
45
+ //#region src/lint/checker/worker.d.ts
46
+ interface NuxtLintCheckerTask {
47
+ cwd: string;
48
+ configFile: string;
49
+ targets: string[];
50
+ exclude: string[];
51
+ formatter: string;
52
+ emitWarning: boolean;
53
+ emitError: boolean;
54
+ fix: boolean;
55
+ /** Test/integration override. Normal callers resolve the project's oxlint. */
56
+ oxlintEntrypoint?: string;
57
+ }
58
+ interface NuxtLintCheckerResult {
59
+ diagnosticCount: number;
60
+ hasErrors: boolean;
61
+ hasWarnings: boolean;
62
+ output: string;
63
+ }
64
+ //#endregion
65
+ //#region src/lint/checker/vite.d.ts
66
+ declare const PLUGIN_NAME = "vize:nuxt-lint-checker";
67
+ interface CheckerWatcher {
68
+ add(file: string): void;
69
+ on(event: "add" | "change" | "unlink", listener: (file: string) => void): unknown;
70
+ }
71
+ interface CheckerServer {
72
+ config: {
73
+ logger: {
74
+ error(message: string): void;
75
+ warn(message: string): void;
76
+ };
77
+ };
78
+ httpServer?: {
79
+ once(event: "close", listener: () => void): unknown;
80
+ } | null;
81
+ watcher: CheckerWatcher;
82
+ ws: {
83
+ send(message: unknown): void;
84
+ };
85
+ }
86
+ interface NuxtLintCheckerVitePlugin {
87
+ apply: "serve";
88
+ enforce: "post";
89
+ name: typeof PLUGIN_NAME;
90
+ configureServer(server: CheckerServer): void;
91
+ }
92
+ interface NuxtLintCheckerViteOptions {
93
+ configFile: string;
94
+ options: ResolvedVizeNuxtLintCheckerOptions;
95
+ rootDir: string;
96
+ }
97
+ interface NuxtLintCheckerRunner {
98
+ close(): void | Promise<void>;
99
+ run(task: NuxtLintCheckerTask): Promise<NuxtLintCheckerResult>;
100
+ }
101
+ interface NuxtLintCheckerViteDependencies {
102
+ createRunner?: () => NuxtLintCheckerRunner;
103
+ oxlintEntrypoint?: string;
104
+ }
105
+ /** Create the client-side Vite dev plugin; it has no transform/render hooks. */
106
+ declare function createNuxtLintCheckerVitePlugin(config: NuxtLintCheckerViteOptions, dependencies?: NuxtLintCheckerViteDependencies): NuxtLintCheckerVitePlugin;
107
+ //#endregion
108
+ //#region src/lint/checker/webpack.d.ts
109
+ interface WebpackCompilation {
110
+ errors: Error[];
111
+ fileDependencies: Set<string>;
112
+ warnings: Error[];
113
+ }
114
+ interface WebpackCompiler {
115
+ modifiedFiles?: Set<string>;
116
+ hooks: {
117
+ watchRun: {
118
+ tap(name: string, callback: (compiler: WebpackCompiler) => void): void;
119
+ };
120
+ afterCompile: {
121
+ tapPromise(name: string, callback: (compilation: WebpackCompilation) => Promise<void>): void;
122
+ };
123
+ watchClose: {
124
+ tap(name: string, callback: () => void): void;
125
+ };
126
+ };
127
+ }
128
+ interface NuxtLintCheckerWebpackPlugin {
129
+ apply(compiler: WebpackCompiler): void;
130
+ }
131
+ interface NuxtLintCheckerWebpackOptions {
132
+ configFile: string;
133
+ options: ResolvedVizeNuxtLintCheckerOptions;
134
+ rootDir: string;
135
+ }
136
+ interface NuxtLintCheckerWebpackRunner {
137
+ close(): void | Promise<void>;
138
+ run(task: NuxtLintCheckerTask): Promise<NuxtLintCheckerResult>;
139
+ }
140
+ interface NuxtLintCheckerWebpackDependencies {
141
+ createRunner?: () => NuxtLintCheckerWebpackRunner;
142
+ oxlintEntrypoint?: string;
143
+ }
144
+ /**
145
+ * Create Nuxt 2's webpack adapter.
146
+ *
147
+ * The worker starts at `watchRun`, concurrently with compilation; only the
148
+ * final diagnostic handoff happens at `afterCompile`, where webpack can feed
149
+ * the result to its existing terminal and browser overlays.
150
+ */
151
+ declare function createNuxtLintCheckerWebpackPlugin(config: NuxtLintCheckerWebpackOptions, dependencies?: NuxtLintCheckerWebpackDependencies): NuxtLintCheckerWebpackPlugin;
152
+ //#endregion
153
+ //#region src/lint/checker/setup.d.ts
154
+ interface NuxtLintCheckerNuxt {
155
+ options: {
156
+ buildDir: string;
157
+ builder?: unknown;
158
+ dev?: boolean;
159
+ rootDir: string;
160
+ srcDir?: string;
161
+ };
162
+ }
163
+ type Awaitable<T> = T | Promise<T>;
164
+ interface NuxtLintCheckerSetupDependencies {
165
+ addVitePlugin?: (plugin: NuxtLintCheckerVitePlugin) => Awaitable<void>;
166
+ addWebpackPlugin?: (plugin: NuxtLintCheckerWebpackPlugin) => Awaitable<void>;
167
+ warn?: (message: string) => void;
168
+ }
169
+ interface NuxtLintCheckerSetup {
170
+ builder: "unsupported" | "vite" | "webpack";
171
+ configFile: string;
172
+ options: ResolvedVizeNuxtLintCheckerOptions;
173
+ }
174
+ /** Register the dev-only adapter over Phase 3's generated config artifact. */
175
+ declare function setupNuxtLintChecker(checker: boolean | VizeNuxtLintCheckerOptions | undefined, nuxt: NuxtLintCheckerNuxt, generation: NuxtLintConfigGeneration | undefined, dependencies?: NuxtLintCheckerSetupDependencies): Promise<NuxtLintCheckerSetup | undefined>;
176
+ //#endregion
177
+ //#region src/lint/nuxt-state.d.ts
178
+ /** The subset of a Nuxt instance lint config generation reads. */
179
+ interface NuxtLintSourceOptions {
180
+ rootDir: string;
181
+ srcDir?: string;
182
+ dir?: NuxtLintDirNames;
183
+ _layers?: Array<{
184
+ config?: Partial<NuxtLintLayer> & {
185
+ srcDir?: string;
186
+ };
187
+ }>;
188
+ }
189
+ /** Options that can redirect where the emitted globs are anchored. */
190
+ interface NuxtLintStateOverrides {
191
+ /**
192
+ * Anchor the emitted globs somewhere other than the Nuxt root.
193
+ *
194
+ * Needed when the lint config is generated for a directory that is not the
195
+ * project root, because every glob is written relative to it.
196
+ */
197
+ rootDir?: string;
198
+ }
199
+ /**
200
+ * Reduce a Nuxt instance to the project state lint config generation needs.
201
+ *
202
+ * Nuxt 2 has no `_layers`, so the project is treated as a single layer rooted
203
+ * at `srcDir` (falling back to `rootDir`). That keeps the Nuxt 2, 3 and 4 paths
204
+ * on one code path rather than branching on the detected major version.
205
+ */
206
+ declare function toNuxtLintProjectState(options: NuxtLintSourceOptions, overrides?: NuxtLintStateOverrides): NuxtLintProjectState;
207
+ //#endregion
208
+ //#region src/lint/emitter.d.ts
209
+ /** Render the complete generated oxlint config, including its trailing newline. */
210
+ declare function renderNuxtOxlintConfig(items: readonly NuxtLintConfigItem[], pluginSpecifier: string): string;
211
+ //#endregion
212
+ export { type NuxtLintAwaitable, type NuxtLintCheckerSetup, type NuxtLintCheckerSetupDependencies, type NuxtLintConfigAddon, type NuxtLintConfigAddonNuxt, type NuxtLintConfigGeneration, type NuxtLintGenerationDependencies, type NuxtLintImport, type NuxtLintSourceOptions, type NuxtLintStateOverrides, ROOT_OXLINT_CONFIG_NAMES, type ResolveNuxtLintConfigAddons, type ResolvedVizeNuxtLintCheckerOptions, VIZE_NUXT_LINT_CONFIG_ADDONS_HOOK, type VizeNuxtLintCheckerOptions, type VizeNuxtLintOptions, createNuxtLintCheckerVitePlugin, createNuxtLintCheckerWebpackPlugin, renderNuxtOxlintConfig, resolveNuxtLintCheckerOptions, setupNuxtLintChecker, setupNuxtLintConfigAddons, setupNuxtLintConfigGeneration, toNuxtLintProjectState, writeFileIfChanged };
@@ -0,0 +1,3 @@
1
+ import { a as toNuxtLintProjectState, c as setupNuxtLintConfigAddons, d as createNuxtLintCheckerVitePlugin, f as resolveNuxtLintCheckerOptions, l as setupNuxtLintChecker, n as setupNuxtLintConfigGeneration, o as renderNuxtOxlintConfig, r as writeFileIfChanged, s as VIZE_NUXT_LINT_CONFIG_ADDONS_HOOK, t as ROOT_OXLINT_CONFIG_NAMES, u as createNuxtLintCheckerWebpackPlugin } from "../generation-bpnsF4y-.mjs";
2
+ export * from "@vizejs/nuxt-lint-config";
3
+ export { ROOT_OXLINT_CONFIG_NAMES, VIZE_NUXT_LINT_CONFIG_ADDONS_HOOK, createNuxtLintCheckerVitePlugin, createNuxtLintCheckerWebpackPlugin, renderNuxtOxlintConfig, resolveNuxtLintCheckerOptions, setupNuxtLintChecker, setupNuxtLintConfigAddons, setupNuxtLintConfigGeneration, toNuxtLintProjectState, writeFileIfChanged };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/nuxt",
3
- "version": "0.312.0",
3
+ "version": "0.315.1",
4
4
  "description": "Nuxt module for Vize - compiler, musea gallery, linter, and type checker",
5
5
  "keywords": [
6
6
  "compiler",
@@ -35,6 +35,11 @@
35
35
  "types": "./dist/index.d.mts",
36
36
  "import": "./dist/index.mjs",
37
37
  "default": "./dist/index.mjs"
38
+ },
39
+ "./lint": {
40
+ "types": "./dist/lint/index.d.mts",
41
+ "import": "./dist/lint/index.mjs",
42
+ "default": "./dist/lint/index.mjs"
38
43
  }
39
44
  },
40
45
  "publishConfig": {
@@ -42,9 +47,12 @@
42
47
  },
43
48
  "dependencies": {
44
49
  "@nuxt/kit": "3.11.2",
45
- "@vizejs/vite-plugin": "0.312.0",
46
- "@vizejs/vite-plugin-musea": "0.312.0",
47
- "vize": "0.312.0"
50
+ "@vizejs/native": "0.315.1",
51
+ "@vizejs/nuxt-lint-config": "0.315.1",
52
+ "@vizejs/vite-plugin": "0.315.1",
53
+ "@vizejs/vite-plugin-musea": "0.315.1",
54
+ "oxlint-plugin-vize": "0.315.1",
55
+ "vize": "0.315.1"
48
56
  },
49
57
  "devDependencies": {
50
58
  "typescript": "6.0.3",
@@ -55,15 +63,21 @@
55
63
  },
56
64
  "peerDependencies": {
57
65
  "nuxt": "^2.16.0 || ^3.0.0 || ^4.0.0",
66
+ "oxlint": "^1.64.0",
58
67
  "vite": "^7.3.0 || ^8.0.0"
59
68
  },
69
+ "peerDependenciesMeta": {
70
+ "oxlint": {
71
+ "optional": true
72
+ }
73
+ },
60
74
  "engines": {
61
75
  "node": ">=22"
62
76
  },
63
77
  "scripts": {
64
78
  "build": "vp pack",
65
79
  "dev": "vp pack --watch",
66
- "test": "pnpm build && node --test src/*.test.ts src/**/*.test.ts",
80
+ "test": "pnpm --filter @vizejs/nuxt-lint-config build && pnpm build && node --test src/*.test.ts src/**/*.test.ts src/lint/checker/*.test.ts",
67
81
  "check": "vp check src vite.config.ts",
68
82
  "check:fix": "vp check --fix src vite.config.ts",
69
83
  "fmt": "vp fmt --write src vite.config.ts"