@vizejs/nuxt 0.443.0 → 0.454.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/dist/{addons-C6yVrK58.d.mts → addons-27NvneGk.d.mts} +1 -1
- package/dist/{generation-QrhC3X7H.mjs → generation-D5zPLtoj.mjs} +9 -16
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +115 -111
- package/dist/lint/index.d.mts +2 -2
- package/dist/lint/index.mjs +1 -1
- package/dist/runtime/server/dev-stylesheet-links.mjs +1 -1
- package/package.json +7 -7
|
@@ -109,7 +109,7 @@ interface VizeNuxtCompilerOptions {
|
|
|
109
109
|
/** Template syntax compatibility mode. */
|
|
110
110
|
templateSyntax?: "standard" | "strict" | "quirks";
|
|
111
111
|
/** Vue template whitespace strategy, or Vize's opt-in Vue 2 line-break migration mode. */
|
|
112
|
-
whitespace?: "condense" | "preserve" | "vue2-line-breaks";
|
|
112
|
+
whitespace?: "condense" | "preserve" | "vue2-line-breaks" | "vue2-preserve";
|
|
113
113
|
/** Root directory to scan for .vue files. */
|
|
114
114
|
root?: string;
|
|
115
115
|
/** Glob patterns to scan for .vue files during pre-compilation. */
|
|
@@ -724,13 +724,6 @@ function toNuxtLintProjectState(options, overrides = {}) {
|
|
|
724
724
|
}
|
|
725
725
|
//#endregion
|
|
726
726
|
//#region src/lint/project-rules.ts
|
|
727
|
-
/**
|
|
728
|
-
* Project lint rules layered under the generated Nuxt oxlint config.
|
|
729
|
-
*
|
|
730
|
-
* The artifact keeps `settings.vize.preset` at `incremental` so Nuxt-only rules
|
|
731
|
-
* stay enabled. A preset from `vize.config.json` is therefore expanded into
|
|
732
|
-
* explicit rule entries instead of replacing that runtime preset.
|
|
733
|
-
*/
|
|
734
727
|
const CONFIG_PRESETS = [
|
|
735
728
|
"happy-path",
|
|
736
729
|
"opinionated",
|
|
@@ -763,15 +756,15 @@ async function loadPresetRules(preset, typeAware) {
|
|
|
763
756
|
return rules;
|
|
764
757
|
}
|
|
765
758
|
async function readVizeConfigLinter(rootDir) {
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
}
|
|
774
|
-
|
|
759
|
+
const { loadConfig } = await import("vize/config");
|
|
760
|
+
const parsed = await loadConfig(rootDir, {
|
|
761
|
+
mode: "auto",
|
|
762
|
+
env: {
|
|
763
|
+
command: "lint",
|
|
764
|
+
mode: "development"
|
|
765
|
+
}
|
|
766
|
+
});
|
|
767
|
+
if (!parsed) return void 0;
|
|
775
768
|
if (!parsed.linter || typeof parsed.linter !== "object") return void 0;
|
|
776
769
|
const linter = parsed.linter;
|
|
777
770
|
return {
|
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-27NvneGk.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,13 +1,125 @@
|
|
|
1
|
-
import { i as setupLintInspector, l as setupNuxtLintChecker, m as hasNuxtViteCompilerSupport, n as setupNuxtLintConfigGeneration, p as getDetectedNuxtMajor } from "./generation-
|
|
1
|
+
import { i as setupLintInspector, l as setupNuxtLintChecker, m as hasNuxtViteCompilerSupport, n as setupNuxtLintConfigGeneration, p as getDetectedNuxtMajor } from "./generation-D5zPLtoj.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path, { dirname, join, resolve } from "node:path";
|
|
5
5
|
import { parseSync } from "vite";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
|
-
//#region src/
|
|
8
|
+
//#region src/component-imports.ts
|
|
9
9
|
const COMPONENT_CALL_RE = /_?resolveComponent\s*\(\s*["'`]([^"'`]+)["'`]\s*(?:,\s*[^)]+)?\)/g;
|
|
10
10
|
const COMPONENTS_IMPORT_RE = /import\s+(?!type\b)\{([^}]*)\}\s+from\s+(["'])#components\2\s*;?/g;
|
|
11
|
+
const NUXT_ROUTE_ANNOUNCER_RE = /(?:^|[/\\])nuxt-route-announcer\.(?:[cm]?js|ts|vue)$/;
|
|
12
|
+
const IMPORT_SPECIFIER_RE = /^(type\s+)?([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/;
|
|
13
|
+
function needsClientOnlyWrapper(resolved) {
|
|
14
|
+
if (resolved.mode !== "client") return false;
|
|
15
|
+
return !NUXT_ROUTE_ANNOUNCER_RE.test(resolved.filePath);
|
|
16
|
+
}
|
|
17
|
+
function parseComponentImportSpecifier(raw) {
|
|
18
|
+
const trimmed = raw.trim();
|
|
19
|
+
if (!trimmed) return null;
|
|
20
|
+
const match = trimmed.match(IMPORT_SPECIFIER_RE);
|
|
21
|
+
if (!match) return null;
|
|
22
|
+
const [, typeKeyword, importedName, localName] = match;
|
|
23
|
+
return {
|
|
24
|
+
importedName,
|
|
25
|
+
localName: localName || importedName,
|
|
26
|
+
typeOnly: Boolean(typeKeyword)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function splitComponentImportSpecifiers(specifiers) {
|
|
30
|
+
return specifiers.split(",").map((specifier) => specifier.trim()).filter(Boolean);
|
|
31
|
+
}
|
|
32
|
+
function addResolvedComponentBinding(componentImports, resolved, variableName, rawVariableName) {
|
|
33
|
+
let needsCreateClientOnly = false;
|
|
34
|
+
let needsDefineAsyncComponent = false;
|
|
35
|
+
const wrapClientOnly = needsClientOnlyWrapper(resolved);
|
|
36
|
+
if (resolved.lazy) {
|
|
37
|
+
needsDefineAsyncComponent = true;
|
|
38
|
+
const exportAccessor = resolved.exportName === "default" ? "module.default" : `module[${JSON.stringify(resolved.exportName)}]`;
|
|
39
|
+
if (wrapClientOnly) {
|
|
40
|
+
needsCreateClientOnly = true;
|
|
41
|
+
componentImports.push(`const ${variableName} = __nuxt_define_async_component(() => import(${JSON.stringify(resolved.filePath)}).then((module) => __nuxt_create_client_only(${exportAccessor})));`);
|
|
42
|
+
} else componentImports.push(`const ${variableName} = __nuxt_define_async_component(() => import(${JSON.stringify(resolved.filePath)}).then((module) => ${exportAccessor}));`);
|
|
43
|
+
return {
|
|
44
|
+
needsCreateClientOnly,
|
|
45
|
+
needsDefineAsyncComponent
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (resolved.exportName === "default") {
|
|
49
|
+
if (wrapClientOnly) {
|
|
50
|
+
needsCreateClientOnly = true;
|
|
51
|
+
componentImports.push(`import ${rawVariableName} from ${JSON.stringify(resolved.filePath)};`);
|
|
52
|
+
componentImports.push(`const ${variableName} = __nuxt_create_client_only(${rawVariableName});`);
|
|
53
|
+
} else componentImports.push(`import ${variableName} from ${JSON.stringify(resolved.filePath)};`);
|
|
54
|
+
return {
|
|
55
|
+
needsCreateClientOnly,
|
|
56
|
+
needsDefineAsyncComponent
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (wrapClientOnly) {
|
|
60
|
+
needsCreateClientOnly = true;
|
|
61
|
+
componentImports.push(`import { ${resolved.exportName} as ${rawVariableName} } from ${JSON.stringify(resolved.filePath)};`);
|
|
62
|
+
componentImports.push(`const ${variableName} = __nuxt_create_client_only(${rawVariableName});`);
|
|
63
|
+
} else componentImports.push(`import { ${resolved.exportName} as ${variableName} } from ${JSON.stringify(resolved.filePath)};`);
|
|
64
|
+
return {
|
|
65
|
+
needsCreateClientOnly,
|
|
66
|
+
needsDefineAsyncComponent
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function injectNuxtComponentImports(code, resolveComponentImport) {
|
|
70
|
+
const componentImports = [];
|
|
71
|
+
const importedComponents = /* @__PURE__ */ new Map();
|
|
72
|
+
let counter = 0;
|
|
73
|
+
let importCounter = 0;
|
|
74
|
+
let needsDefineAsyncComponent = false;
|
|
75
|
+
let needsCreateClientOnly = false;
|
|
76
|
+
const codeWithComponentImports = code.replace(COMPONENTS_IMPORT_RE, (match, specifiers) => {
|
|
77
|
+
const explicitComponentImports = [];
|
|
78
|
+
const unresolvedSpecifiers = [];
|
|
79
|
+
let changed = false;
|
|
80
|
+
for (const rawSpecifier of splitComponentImportSpecifiers(specifiers)) {
|
|
81
|
+
const specifier = parseComponentImportSpecifier(rawSpecifier);
|
|
82
|
+
if (!specifier || specifier.typeOnly) {
|
|
83
|
+
unresolvedSpecifiers.push(rawSpecifier);
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
const resolved = resolveComponentImport(specifier.importedName);
|
|
87
|
+
if (!resolved) {
|
|
88
|
+
unresolvedSpecifiers.push(rawSpecifier);
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
changed = true;
|
|
92
|
+
const result = addResolvedComponentBinding(explicitComponentImports, resolved, specifier.localName, `__nuxt_import_component_${importCounter++}_raw`);
|
|
93
|
+
needsCreateClientOnly ||= result.needsCreateClientOnly;
|
|
94
|
+
needsDefineAsyncComponent ||= result.needsDefineAsyncComponent;
|
|
95
|
+
}
|
|
96
|
+
if (!changed) return match;
|
|
97
|
+
if (unresolvedSpecifiers.length > 0) explicitComponentImports.push(`import { ${unresolvedSpecifiers.join(", ")} } from "#components";`);
|
|
98
|
+
return explicitComponentImports.join("\n");
|
|
99
|
+
});
|
|
100
|
+
const nextCode = codeWithComponentImports.replace(COMPONENT_CALL_RE, (match, name) => {
|
|
101
|
+
const resolved = resolveComponentImport(name);
|
|
102
|
+
if (!resolved) return match;
|
|
103
|
+
const importKey = `${resolved.exportName}\u0000${resolved.filePath}\u0000${resolved.lazy ? "lazy" : "eager"}\u0000${resolved.mode ?? "default"}`;
|
|
104
|
+
let variableName = importedComponents.get(importKey);
|
|
105
|
+
if (!variableName) {
|
|
106
|
+
variableName = `__nuxt_component_${counter++}`;
|
|
107
|
+
importedComponents.set(importKey, variableName);
|
|
108
|
+
const result = addResolvedComponentBinding(componentImports, resolved, variableName, `${variableName}_raw`);
|
|
109
|
+
needsCreateClientOnly ||= result.needsCreateClientOnly;
|
|
110
|
+
needsDefineAsyncComponent ||= result.needsDefineAsyncComponent;
|
|
111
|
+
}
|
|
112
|
+
return variableName;
|
|
113
|
+
});
|
|
114
|
+
if (componentImports.length === 0 && !needsDefineAsyncComponent && !needsCreateClientOnly) return codeWithComponentImports;
|
|
115
|
+
return [
|
|
116
|
+
...needsDefineAsyncComponent ? ["import { defineAsyncComponent as __nuxt_define_async_component } from \"vue\";"] : [],
|
|
117
|
+
...needsCreateClientOnly ? ["import { createClientOnly as __nuxt_create_client_only } from \"#app/components/client-only\";"] : [],
|
|
118
|
+
...componentImports
|
|
119
|
+
].join("\n") + "\n" + nextCode;
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/components.ts
|
|
11
123
|
const COMPONENT_EXT_RE = /\.(?:[cm]?js|ts|vue)$/;
|
|
12
124
|
const DTS_COMPONENT_RE = /^export const (\w+): (?:LazyComponent<)?typeof import\((["'])(.+?)\2\)(?:\.([A-Za-z_$][\w$]*)|\[['"]([A-Za-z_$][\w$]*)['"]\])>?/;
|
|
13
125
|
const DTS_GLOBAL_COMPONENT_RE = /^(?:"([^"]+)"|'([^']+)'|([A-Za-z_$][\w$]*))\??:\s*(?:LazyComponent<)?typeof import\((["'])(.+?)\4\)(?:\.([A-Za-z_$][\w$]*)|\[['"]([A-Za-z_$][\w$]*)['"]\])>?;?$/;
|
|
@@ -20,13 +132,11 @@ const FILE_EXTS = [
|
|
|
20
132
|
];
|
|
21
133
|
const CLIENT_COMPONENT_RE = /\.client\.(?:[cm]?js|ts|vue)$/;
|
|
22
134
|
const SERVER_COMPONENT_RE = /\.server\.(?:[cm]?js|ts|vue)$/;
|
|
23
|
-
const NUXT_ROUTE_ANNOUNCER_RE = /(?:^|[/\\])nuxt-route-announcer\.(?:[cm]?js|ts|vue)$/;
|
|
24
135
|
const RUNTIME_COMPONENT_DIRS = [
|
|
25
136
|
"dist/runtime/components",
|
|
26
137
|
"dist/runtime/components/nuxt4",
|
|
27
138
|
"runtime/components"
|
|
28
139
|
];
|
|
29
|
-
const IMPORT_SPECIFIER_RE = /^(type\s+)?([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/;
|
|
30
140
|
function toKebabCase(name) {
|
|
31
141
|
return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/_/g, "-").toLowerCase();
|
|
32
142
|
}
|
|
@@ -73,25 +183,6 @@ function detectComponentMode(filePath) {
|
|
|
73
183
|
function normalizeComponentMode(mode) {
|
|
74
184
|
return mode === "client" || mode === "server" ? mode : void 0;
|
|
75
185
|
}
|
|
76
|
-
function needsClientOnlyWrapper(resolved) {
|
|
77
|
-
if (resolved.mode !== "client") return false;
|
|
78
|
-
return !NUXT_ROUTE_ANNOUNCER_RE.test(resolved.filePath);
|
|
79
|
-
}
|
|
80
|
-
function parseComponentImportSpecifier(raw) {
|
|
81
|
-
const trimmed = raw.trim();
|
|
82
|
-
if (!trimmed) return null;
|
|
83
|
-
const match = trimmed.match(IMPORT_SPECIFIER_RE);
|
|
84
|
-
if (!match) return null;
|
|
85
|
-
const [, typeKeyword, importedName, localName] = match;
|
|
86
|
-
return {
|
|
87
|
-
importedName,
|
|
88
|
-
localName: localName || importedName,
|
|
89
|
-
typeOnly: Boolean(typeKeyword)
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
function splitComponentImportSpecifiers(specifiers) {
|
|
93
|
-
return specifiers.split(",").map((specifier) => specifier.trim()).filter(Boolean);
|
|
94
|
-
}
|
|
95
186
|
function createComponentImport(filePath, exportName, lazy, mode) {
|
|
96
187
|
const componentImport = {
|
|
97
188
|
exportName,
|
|
@@ -102,43 +193,6 @@ function createComponentImport(filePath, exportName, lazy, mode) {
|
|
|
102
193
|
if (resolvedMode) componentImport.mode = resolvedMode;
|
|
103
194
|
return componentImport;
|
|
104
195
|
}
|
|
105
|
-
function addResolvedComponentBinding(componentImports, resolved, variableName, rawVariableName) {
|
|
106
|
-
let needsCreateClientOnly = false;
|
|
107
|
-
let needsDefineAsyncComponent = false;
|
|
108
|
-
const wrapClientOnly = needsClientOnlyWrapper(resolved);
|
|
109
|
-
if (resolved.lazy) {
|
|
110
|
-
needsDefineAsyncComponent = true;
|
|
111
|
-
const exportAccessor = resolved.exportName === "default" ? "module.default" : `module[${JSON.stringify(resolved.exportName)}]`;
|
|
112
|
-
if (wrapClientOnly) {
|
|
113
|
-
needsCreateClientOnly = true;
|
|
114
|
-
componentImports.push(`const ${variableName} = __nuxt_define_async_component(() => import(${JSON.stringify(resolved.filePath)}).then((module) => __nuxt_create_client_only(${exportAccessor})));`);
|
|
115
|
-
} else componentImports.push(`const ${variableName} = __nuxt_define_async_component(() => import(${JSON.stringify(resolved.filePath)}).then((module) => ${exportAccessor}));`);
|
|
116
|
-
return {
|
|
117
|
-
needsCreateClientOnly,
|
|
118
|
-
needsDefineAsyncComponent
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
if (resolved.exportName === "default") {
|
|
122
|
-
if (wrapClientOnly) {
|
|
123
|
-
needsCreateClientOnly = true;
|
|
124
|
-
componentImports.push(`import ${rawVariableName} from ${JSON.stringify(resolved.filePath)};`);
|
|
125
|
-
componentImports.push(`const ${variableName} = __nuxt_create_client_only(${rawVariableName});`);
|
|
126
|
-
} else componentImports.push(`import ${variableName} from ${JSON.stringify(resolved.filePath)};`);
|
|
127
|
-
return {
|
|
128
|
-
needsCreateClientOnly,
|
|
129
|
-
needsDefineAsyncComponent
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
if (wrapClientOnly) {
|
|
133
|
-
needsCreateClientOnly = true;
|
|
134
|
-
componentImports.push(`import { ${resolved.exportName} as ${rawVariableName} } from ${JSON.stringify(resolved.filePath)};`);
|
|
135
|
-
componentImports.push(`const ${variableName} = __nuxt_create_client_only(${rawVariableName});`);
|
|
136
|
-
} else componentImports.push(`import { ${resolved.exportName} as ${variableName} } from ${JSON.stringify(resolved.filePath)};`);
|
|
137
|
-
return {
|
|
138
|
-
needsCreateClientOnly,
|
|
139
|
-
needsDefineAsyncComponent
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
196
|
function getNuxtComponentDtsFiles(rootDir, buildDir) {
|
|
143
197
|
const candidates = [
|
|
144
198
|
path.join(buildDir, "components.d.ts"),
|
|
@@ -284,56 +338,6 @@ function createNuxtComponentResolver(options) {
|
|
|
284
338
|
}
|
|
285
339
|
};
|
|
286
340
|
}
|
|
287
|
-
function injectNuxtComponentImports(code, resolveComponentImport) {
|
|
288
|
-
const componentImports = [];
|
|
289
|
-
const importedComponents = /* @__PURE__ */ new Map();
|
|
290
|
-
let counter = 0;
|
|
291
|
-
let importCounter = 0;
|
|
292
|
-
let needsDefineAsyncComponent = false;
|
|
293
|
-
let needsCreateClientOnly = false;
|
|
294
|
-
const nextCode = code.replace(COMPONENTS_IMPORT_RE, (match, specifiers) => {
|
|
295
|
-
const unresolvedSpecifiers = [];
|
|
296
|
-
let changed = false;
|
|
297
|
-
for (const rawSpecifier of splitComponentImportSpecifiers(specifiers)) {
|
|
298
|
-
const specifier = parseComponentImportSpecifier(rawSpecifier);
|
|
299
|
-
if (!specifier || specifier.typeOnly) {
|
|
300
|
-
unresolvedSpecifiers.push(rawSpecifier);
|
|
301
|
-
continue;
|
|
302
|
-
}
|
|
303
|
-
const resolved = resolveComponentImport(specifier.importedName);
|
|
304
|
-
if (!resolved) {
|
|
305
|
-
unresolvedSpecifiers.push(rawSpecifier);
|
|
306
|
-
continue;
|
|
307
|
-
}
|
|
308
|
-
changed = true;
|
|
309
|
-
const result = addResolvedComponentBinding(componentImports, resolved, specifier.localName, `__nuxt_import_component_${importCounter++}_raw`);
|
|
310
|
-
needsCreateClientOnly ||= result.needsCreateClientOnly;
|
|
311
|
-
needsDefineAsyncComponent ||= result.needsDefineAsyncComponent;
|
|
312
|
-
}
|
|
313
|
-
if (!changed) return match;
|
|
314
|
-
if (unresolvedSpecifiers.length === 0) return "";
|
|
315
|
-
return `import { ${unresolvedSpecifiers.join(", ")} } from "#components";`;
|
|
316
|
-
}).replace(COMPONENT_CALL_RE, (match, name) => {
|
|
317
|
-
const resolved = resolveComponentImport(name);
|
|
318
|
-
if (!resolved) return match;
|
|
319
|
-
const importKey = `${resolved.exportName}\u0000${resolved.filePath}\u0000${resolved.lazy ? "lazy" : "eager"}\u0000${resolved.mode ?? "default"}`;
|
|
320
|
-
let variableName = importedComponents.get(importKey);
|
|
321
|
-
if (!variableName) {
|
|
322
|
-
variableName = `__nuxt_component_${counter++}`;
|
|
323
|
-
importedComponents.set(importKey, variableName);
|
|
324
|
-
const result = addResolvedComponentBinding(componentImports, resolved, variableName, `${variableName}_raw`);
|
|
325
|
-
needsCreateClientOnly ||= result.needsCreateClientOnly;
|
|
326
|
-
needsDefineAsyncComponent ||= result.needsDefineAsyncComponent;
|
|
327
|
-
}
|
|
328
|
-
return variableName;
|
|
329
|
-
});
|
|
330
|
-
if (componentImports.length === 0) return code;
|
|
331
|
-
return [
|
|
332
|
-
...needsDefineAsyncComponent ? ["import { defineAsyncComponent as __nuxt_define_async_component } from \"vue\";"] : [],
|
|
333
|
-
...needsCreateClientOnly ? ["import { createClientOnly as __nuxt_create_client_only } from \"#app/components/client-only\";"] : [],
|
|
334
|
-
...componentImports
|
|
335
|
-
].join("\n") + "\n" + nextCode;
|
|
336
|
-
}
|
|
337
341
|
//#endregion
|
|
338
342
|
//#region src/i18n.ts
|
|
339
343
|
const I18N_FN_MAP = {
|
|
@@ -1174,7 +1178,7 @@ async function setupNuxtViteCompiler(compilerOptions, host, compiler) {
|
|
|
1174
1178
|
...explicit,
|
|
1175
1179
|
nuxtPageMeta: true,
|
|
1176
1180
|
ssrModuleIdRoot: host.srcDir
|
|
1177
|
-
}, defaults));
|
|
1181
|
+
}, defaults, "nuxt"));
|
|
1178
1182
|
}
|
|
1179
1183
|
//#endregion
|
|
1180
1184
|
//#region src/libraries.ts
|
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-27NvneGk.mjs";
|
|
2
2
|
import { NuxtLintConfigItem, NuxtLintDirNames, NuxtLintLayer, NuxtLintProjectState, NuxtLintSeverity } from "@vizejs/nuxt-lint-config";
|
|
3
3
|
export * from "@vizejs/nuxt-lint-config";
|
|
4
4
|
|
|
@@ -22,7 +22,7 @@ interface NuxtLintGenerationDependencies {
|
|
|
22
22
|
resolveAddons?: () => Awaitable$1<readonly NuxtLintConfigItem[]>;
|
|
23
23
|
hasTypeScript?: (rootDir: string) => boolean;
|
|
24
24
|
resolvePluginSpecifier?: (configDir: string) => string;
|
|
25
|
-
/**
|
|
25
|
+
/** Shared project rules. Tests inject this so generation never loads the native preset binding. */
|
|
26
26
|
resolveProjectLintRules?: (rootDir: string) => Awaitable$1<ProjectLintRules | undefined>;
|
|
27
27
|
}
|
|
28
28
|
interface NuxtLintConfigGeneration {
|
package/dist/lint/index.mjs
CHANGED
|
@@ -1,3 +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-
|
|
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-D5zPLtoj.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 };
|
|
@@ -19,7 +19,7 @@ function sanitizeNuxtDevStylesheetLinks(html, buildAssetsDir = "/_nuxt/") {
|
|
|
19
19
|
return pathPart.split(/[\\/]/).some((segment) => segment === "..");
|
|
20
20
|
}
|
|
21
21
|
function isAllowedNuxtDevStylesheetPath(pathPart) {
|
|
22
|
-
return pathPart.startsWith("@fs/") || pathPart.startsWith("@id/") || pathPart.startsWith("assets/") || pathPart.startsWith("virtual:") || /^__[\w.-]+\.css$/i.test(pathPart) || /^[\w.-]+\.css$/i.test(pathPart);
|
|
22
|
+
return pathPart.startsWith("@fs/") || pathPart.startsWith("@id/") || pathPart.startsWith("assets/") || pathPart.startsWith("virtual:") || /^(?:[^/\\]+\/)*[^/\\]+\.vue\.__vize_style_\d+\.css$/i.test(pathPart) || /^__[\w.-]+\.css$/i.test(pathPart) || /^[\w.-]+\.css$/i.test(pathPart);
|
|
23
23
|
}
|
|
24
24
|
function shouldKeepHref(href) {
|
|
25
25
|
if (seenHrefs.has(href)) return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizejs/nuxt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.454.0",
|
|
4
4
|
"description": "Nuxt module for Vize - compiler, musea gallery, linter, and type checker",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compiler",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@nuxt/kit": "3.11.2",
|
|
52
|
-
"@vizejs/native": "0.
|
|
53
|
-
"@vizejs/nuxt-lint-config": "0.
|
|
54
|
-
"@vizejs/vite-plugin": "0.
|
|
55
|
-
"@vizejs/vite-plugin-musea": "0.
|
|
56
|
-
"oxlint-plugin-vize": "0.
|
|
57
|
-
"vize": "0.
|
|
52
|
+
"@vizejs/native": "0.454.0",
|
|
53
|
+
"@vizejs/nuxt-lint-config": "0.454.0",
|
|
54
|
+
"@vizejs/vite-plugin": "0.454.0",
|
|
55
|
+
"@vizejs/vite-plugin-musea": "0.454.0",
|
|
56
|
+
"oxlint-plugin-vize": "0.454.0",
|
|
57
|
+
"vize": "0.454.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"jiti-nuxt2": "npm:jiti@1.21.7",
|