@vizejs/nuxt 0.250.0 → 0.263.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/index.d.mts +20 -2
- package/dist/index.mjs +21 -7
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { MuseaOptions, MuseaOptions as MuseaOptions$1 } from "@vizejs/vite-plugi
|
|
|
2
2
|
|
|
3
3
|
//#region src/compiler-options.d.ts
|
|
4
4
|
type VizeNuxtPattern = string | RegExp;
|
|
5
|
-
type VizeNuxtVueVersion = 0.11 | 1 | 2 | 3 | "legacy";
|
|
5
|
+
type VizeNuxtVueVersion = 0.11 | 1 | 2 | "2.7" | 3 | "legacy";
|
|
6
6
|
interface VizeNuxtCompilerCompatibilityOptions {
|
|
7
7
|
vueVersion?: VizeNuxtVueVersion;
|
|
8
8
|
hostCompiler?: boolean;
|
|
@@ -23,7 +23,7 @@ interface VizeNuxtCompilerOptions {
|
|
|
23
23
|
* Vue major version for the host project.
|
|
24
24
|
*
|
|
25
25
|
* Legacy Vue projects keep the host Vue compiler in charge. When set to
|
|
26
|
-
* `0.11`, `1`, `2`, or `"legacy"`, the underlying Vite plugin runs in
|
|
26
|
+
* `0.11`, `1`, `2`, `"2.7"`, or `"legacy"`, the underlying Vite plugin runs in
|
|
27
27
|
* compatibility mode and does not intercept `.vue` files.
|
|
28
28
|
*/
|
|
29
29
|
vueVersion?: VizeNuxtVueVersion;
|
|
@@ -237,6 +237,24 @@ interface VizeNuxtOptions {
|
|
|
237
237
|
nuxtMusea?: NuxtMuseaOptions;
|
|
238
238
|
}
|
|
239
239
|
//#endregion
|
|
240
|
+
//#region src/schema.d.ts
|
|
241
|
+
declare module "nuxt/schema" {
|
|
242
|
+
interface NuxtConfig {
|
|
243
|
+
vize?: Partial<VizeNuxtOptions>;
|
|
244
|
+
}
|
|
245
|
+
interface NuxtOptions {
|
|
246
|
+
vize?: Partial<VizeNuxtOptions>;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
declare module "@nuxt/schema" {
|
|
250
|
+
interface NuxtConfig {
|
|
251
|
+
vize?: Partial<VizeNuxtOptions>;
|
|
252
|
+
}
|
|
253
|
+
interface NuxtOptions {
|
|
254
|
+
vize?: Partial<VizeNuxtOptions>;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
//#endregion
|
|
240
258
|
//#region src/index.d.ts
|
|
241
259
|
type NuxtWithBuilderOptions = {
|
|
242
260
|
_version?: string;
|
package/dist/index.mjs
CHANGED
|
@@ -53,6 +53,16 @@ function resolveImportPath(importPath) {
|
|
|
53
53
|
}
|
|
54
54
|
return importPath;
|
|
55
55
|
}
|
|
56
|
+
function isBarePackageSpecifier(importPath) {
|
|
57
|
+
if (!importPath) return false;
|
|
58
|
+
if (importPath.startsWith(".")) return false;
|
|
59
|
+
if (importPath.startsWith("/")) return false;
|
|
60
|
+
return !path.isAbsolute(importPath);
|
|
61
|
+
}
|
|
62
|
+
function resolveDtsImportPath(baseDir, importPath) {
|
|
63
|
+
if (isBarePackageSpecifier(importPath)) return importPath;
|
|
64
|
+
return resolveImportPath(path.resolve(baseDir, importPath));
|
|
65
|
+
}
|
|
56
66
|
function detectComponentMode(filePath) {
|
|
57
67
|
if (CLIENT_COMPONENT_RE.test(filePath)) return "client";
|
|
58
68
|
if (SERVER_COMPONENT_RE.test(filePath)) return "server";
|
|
@@ -175,7 +185,7 @@ function loadDtsComponents(rootDir, buildDir) {
|
|
|
175
185
|
const name = doubleQuotedName || singleQuotedName || bareName;
|
|
176
186
|
const exportName = exportNameDot || exportNameBracket;
|
|
177
187
|
if (name && exportName) {
|
|
178
|
-
const componentImport = createComponentImport(
|
|
188
|
+
const componentImport = createComponentImport(resolveDtsImportPath(path.dirname(filePath), importPath), exportName, name.startsWith("Lazy"));
|
|
179
189
|
addComponentAlias(resolved, name, componentImport);
|
|
180
190
|
addLazyComponentAlias(resolved, name, componentImport);
|
|
181
191
|
}
|
|
@@ -187,7 +197,7 @@ function loadDtsComponents(rootDir, buildDir) {
|
|
|
187
197
|
const [, name, , importPath, exportNameDot, exportNameBracket] = match;
|
|
188
198
|
const exportName = exportNameDot || exportNameBracket;
|
|
189
199
|
if (!exportName) return;
|
|
190
|
-
const componentImport = createComponentImport(
|
|
200
|
+
const componentImport = createComponentImport(resolveDtsImportPath(path.dirname(filePath), importPath), exportName, name.startsWith("Lazy"));
|
|
191
201
|
addComponentAlias(resolved, name, componentImport);
|
|
192
202
|
addLazyComponentAlias(resolved, name, componentImport);
|
|
193
203
|
});
|
|
@@ -420,6 +430,7 @@ function buildNuxtDevAssetBase(baseURL = "/", buildAssetsDir = "/_nuxt/") {
|
|
|
420
430
|
function buildNuxtCompilerOptions(rootDir, baseURL = "/", buildAssetsDir = "/_nuxt/", overrides = {}) {
|
|
421
431
|
const defaults = {
|
|
422
432
|
devUrlBase: buildNuxtDevAssetBase(baseURL, buildAssetsDir),
|
|
433
|
+
handleNodeModulesVue: false,
|
|
423
434
|
root: rootDir,
|
|
424
435
|
scanPatterns: []
|
|
425
436
|
};
|
|
@@ -642,7 +653,7 @@ const DEFAULT_NUXT_BRIDGE_OPTIONS = {
|
|
|
642
653
|
const DEFAULT_NUXT_UNOCSS_OPTIONS = { originalSource: {} };
|
|
643
654
|
const DEFAULT_NUXT_DEV_OPTIONS = { stylesheetLinks: true };
|
|
644
655
|
function isLegacyVueVersion(version) {
|
|
645
|
-
return version === .11 || version === 1 || version === 2 || version === "legacy";
|
|
656
|
+
return version === .11 || version === 1 || version === 2 || version === "2.7" || version === "legacy";
|
|
646
657
|
}
|
|
647
658
|
function normalizeNuxtCompilerCompatibilityOptions(compatibility) {
|
|
648
659
|
const normalized = {};
|
|
@@ -906,7 +917,7 @@ async function setupVizeNuxtModule(options, nuxt) {
|
|
|
906
917
|
vueVersion
|
|
907
918
|
});
|
|
908
919
|
const usesVizeCompiler = shouldUseVizeCompiler(compilerOptions);
|
|
909
|
-
if (compilerOptions !== false) {
|
|
920
|
+
if (compilerOptions !== false && compilerOptions.compatibility?.hostCompiler !== true) {
|
|
910
921
|
const { default: vize } = await import("@vizejs/vite-plugin");
|
|
911
922
|
nuxt.options.vite ||= {};
|
|
912
923
|
nuxt.options.vite.plugins = nuxt.options.vite.plugins || [];
|
|
@@ -1032,9 +1043,12 @@ async function setupVizeNuxtModule(options, nuxt) {
|
|
|
1032
1043
|
if (museaOptions !== false && supportsViteCompiler) {
|
|
1033
1044
|
const { musea } = await import("@vizejs/vite-plugin-musea");
|
|
1034
1045
|
const museaBasePath = "basePath" in museaOptions ? museaOptions.basePath : "/__musea__";
|
|
1035
|
-
nuxt.options.vite ||= {};
|
|
1036
|
-
|
|
1037
|
-
|
|
1046
|
+
(nuxt.options.vite ||= {}).plugins ||= [];
|
|
1047
|
+
const museaConfig = {
|
|
1048
|
+
projectRoot: nuxt.options.rootDir,
|
|
1049
|
+
...museaOptions
|
|
1050
|
+
};
|
|
1051
|
+
nuxt.options.vite.plugins.push(...musea(museaConfig));
|
|
1038
1052
|
nuxt.hook("listen", (_server, listener) => {
|
|
1039
1053
|
const url = listener.url?.replace(/\/$/, "") || "http://localhost:3000";
|
|
1040
1054
|
console.log(` \x1b[36m➜\x1b[0m \x1b[1mMusea Gallery:\x1b[0m \x1b[36m${url}${museaBasePath}\x1b[0m`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizejs/nuxt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.263.0",
|
|
4
4
|
"description": "Nuxt module for Vize - compiler, musea gallery, linter, and type checker",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compiler",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@nuxt/kit": "3.11.2",
|
|
45
|
-
"@vizejs/vite-plugin": "0.
|
|
46
|
-
"@vizejs/vite-plugin-musea": "0.
|
|
47
|
-
"vize": "0.
|
|
45
|
+
"@vizejs/vite-plugin": "0.263.0",
|
|
46
|
+
"@vizejs/vite-plugin-musea": "0.263.0",
|
|
47
|
+
"vize": "0.263.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"typescript": "6.0.3",
|