@vizejs/nuxt 0.576.0 → 0.578.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.
|
@@ -357,6 +357,7 @@ interface VizeNuxtOptions {
|
|
|
357
357
|
dev?: VizeNuxtDevOptions;
|
|
358
358
|
/**
|
|
359
359
|
* Generate the Nuxt-aware oxlint config consumed by Vize's linting engine.
|
|
360
|
+
* Needs the optional `oxlint-plugin-vize` peer; lint is skipped without it.
|
|
360
361
|
* @default true
|
|
361
362
|
*/
|
|
362
363
|
lint?: boolean | VizeNuxtLintOptions;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as VizeNuxtUiOptions, S as VizeNuxtComposablesOptions, _ 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-
|
|
1
|
+
import { C as VizeNuxtUiOptions, S as VizeNuxtComposablesOptions, _ 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-Bhz34I5_.mjs";
|
|
2
2
|
import { MuseaOptions } from "@vizejs/vite-plugin-musea";
|
|
3
3
|
|
|
4
4
|
//#region src/schema.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as setupLintInspector, m as hasNuxtViteCompilerSupport, o as setupNuxtLintConfigGeneration, p as getDetectedNuxtMajor, t as setupNuxtLintChecker } from "./setup-DRpeAAOP.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import fs, { readFileSync, realpathSync } from "node:fs";
|
|
4
4
|
import path, { dirname, join, resolve } from "node:path";
|
|
@@ -338,6 +338,17 @@ function createNuxtComponentResolver(options) {
|
|
|
338
338
|
};
|
|
339
339
|
}
|
|
340
340
|
//#endregion
|
|
341
|
+
//#region src/lint/module-setup.ts
|
|
342
|
+
/** Whether user config asks for lint, as opposed to inheriting the module default. */
|
|
343
|
+
function isLintRequested(...configured) {
|
|
344
|
+
return configured.some((options) => options?.lint !== void 0 && options.lint !== false || options?.checker !== void 0 && options.checker !== false);
|
|
345
|
+
}
|
|
346
|
+
async function setupNuxtLint(options, nuxt, inlineOptions) {
|
|
347
|
+
const generation = await setupNuxtLintConfigGeneration(options.lint, nuxt, { reportMissingPlugin: isLintRequested(inlineOptions, nuxt.options.vize) });
|
|
348
|
+
if (generation || options.lint === false) await setupNuxtLintChecker(options.checker, nuxt, generation);
|
|
349
|
+
return generation;
|
|
350
|
+
}
|
|
351
|
+
//#endregion
|
|
341
352
|
//#region src/musea-components.ts
|
|
342
353
|
const MUSEA_ART_COMPONENT_IGNORE = "**/*.art.vue";
|
|
343
354
|
function appendMuseaArtComponentIgnore(dirs) {
|
|
@@ -992,21 +1003,26 @@ function vueVersionSupportsVapor(version) {
|
|
|
992
1003
|
//#endregion
|
|
993
1004
|
//#region src/compiler-option-bridge.ts
|
|
994
1005
|
function unsupportedNuxtVueCompilerOptions(options) {
|
|
995
|
-
return Object.entries(options ?? {}).filter(([key, value]) => value !== void 0 && (key !== "whitespace" || value !== "condense" && value !== "preserve")).map(([key]) => key);
|
|
1006
|
+
return Object.entries(options ?? {}).filter(([key, value]) => value !== void 0 && (key !== "whitespace" || value !== "condense" && value !== "preserve") && (key !== "comments" || typeof value !== "boolean")).map(([key]) => key);
|
|
996
1007
|
}
|
|
997
1008
|
/** Separate Nuxt's inherited default from authored module compiler options. */
|
|
998
1009
|
function splitNuxtCompilerDefaults(resolved, compiler, vueCompilerOptions) {
|
|
1010
|
+
const comments = vueCompilerOptions?.comments;
|
|
1011
|
+
const defaults = typeof comments === "boolean" ? { comments } : {};
|
|
999
1012
|
const whitespace = vueCompilerOptions?.whitespace;
|
|
1000
1013
|
if (whitespace !== "condense" && whitespace !== "preserve") return {
|
|
1001
1014
|
options: resolved,
|
|
1002
|
-
defaults
|
|
1015
|
+
defaults
|
|
1003
1016
|
};
|
|
1004
1017
|
return {
|
|
1005
1018
|
options: {
|
|
1006
1019
|
...resolved,
|
|
1007
1020
|
whitespace: typeof compiler === "object" && compiler != null ? compiler.whitespace : void 0
|
|
1008
1021
|
},
|
|
1009
|
-
defaults: {
|
|
1022
|
+
defaults: {
|
|
1023
|
+
...defaults,
|
|
1024
|
+
whitespace
|
|
1025
|
+
}
|
|
1010
1026
|
};
|
|
1011
1027
|
}
|
|
1012
1028
|
function isLegacyVueVersion(version) {
|
|
@@ -1366,9 +1382,9 @@ function patchNuxtAutoImportTransformPlugin(plugin, isBuild) {
|
|
|
1366
1382
|
};
|
|
1367
1383
|
plugin[VIZE_NUXT_AUTO_IMPORT_PATCHED] = true;
|
|
1368
1384
|
}
|
|
1369
|
-
async function setupVizeNuxtModule(
|
|
1370
|
-
const
|
|
1371
|
-
await
|
|
1385
|
+
async function setupVizeNuxtModule(raw, nuxt) {
|
|
1386
|
+
const options = resolveModuleOptions(raw, nuxt);
|
|
1387
|
+
const lintGeneration = await setupNuxtLint(options, nuxt, raw);
|
|
1372
1388
|
const resolver = createNuxtModuleResolver(nuxt.options.rootDir);
|
|
1373
1389
|
const detectedNuxtMajor = options.compatibility?.nuxtVersion ?? getDetectedNuxtMajor(nuxt) ?? 3;
|
|
1374
1390
|
const vueVersion = options.compatibility?.vueVersion ?? (detectedNuxtMajor === 2 ? 2 : 3);
|
|
@@ -1547,7 +1563,7 @@ const vizeNuxtModule = Object.assign(async function vizeNuxtModule(inlineOptions
|
|
|
1547
1563
|
if (!nuxt) throw new Error("@vizejs/nuxt requires a Nuxt instance");
|
|
1548
1564
|
markNuxtRequiredModule(nuxt);
|
|
1549
1565
|
registerNuxt2CompatibilityHooks(nuxt);
|
|
1550
|
-
await setupVizeNuxtModule(
|
|
1566
|
+
await setupVizeNuxtModule(inlineOptions, nuxt);
|
|
1551
1567
|
}, {
|
|
1552
1568
|
getMeta: () => moduleMeta,
|
|
1553
1569
|
getOptions: (inlineOptions = {}, nuxt) => resolveModuleOptions(inlineOptions, nuxt),
|
package/dist/lint/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-Bhz34I5_.mjs";
|
|
2
2
|
import { NuxtLintConfigItem, NuxtLintDirNames, NuxtLintLayer, NuxtLintProjectState, NuxtLintRuleConfig } from "@vizejs/nuxt-lint-config";
|
|
3
3
|
export * from "@vizejs/nuxt-lint-config";
|
|
4
4
|
|
|
@@ -21,7 +21,10 @@ interface NuxtLintGenerationDependencies {
|
|
|
21
21
|
/** Phase #3614 supplies fresh addon items through this seam. */
|
|
22
22
|
resolveAddons?: () => Awaitable$1<readonly NuxtLintConfigItem[]>;
|
|
23
23
|
hasTypeScript?: (rootDir: string) => boolean;
|
|
24
|
-
|
|
24
|
+
/** Returns `undefined` when the optional `oxlint-plugin-vize` peer is not installed. */
|
|
25
|
+
resolvePluginSpecifier?: (configDir: string) => string | undefined;
|
|
26
|
+
/** Warn when the plugin is missing even if no generated config exists yet. */
|
|
27
|
+
reportMissingPlugin?: boolean;
|
|
25
28
|
/** Shared project rules. Tests inject this so generation never loads the native preset binding. */
|
|
26
29
|
resolveProjectLintRules?: (rootDir: string) => Awaitable$1<ProjectLintRules | undefined>;
|
|
27
30
|
warn?: (message: string) => void;
|
package/dist/lint/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as ROOT_OXLINT_CONFIG_NAMES, d as VIZE_NUXT_LINT_CONFIG_ADDONS_HOOK, f as setupNuxtLintConfigAddons, i as resolveNuxtLintCheckerOptions, l as toNuxtLintProjectState, n as createNuxtLintCheckerWebpackPlugin, o as setupNuxtLintConfigGeneration, r as createNuxtLintCheckerVitePlugin, s as writeFileIfChanged, t as setupNuxtLintChecker, u as renderNuxtOxlintConfig } from "../setup-DRpeAAOP.mjs";
|
|
2
2
|
export * from "@vizejs/nuxt-lint-config";
|
|
3
3
|
export { ROOT_OXLINT_CONFIG_NAMES, VIZE_NUXT_LINT_CONFIG_ADDONS_HOOK, createNuxtLintCheckerVitePlugin, createNuxtLintCheckerWebpackPlugin, renderNuxtOxlintConfig, resolveNuxtLintCheckerOptions, setupNuxtLintChecker, setupNuxtLintConfigAddons, setupNuxtLintConfigGeneration, toNuxtLintProjectState, writeFileIfChanged };
|