@vizejs/nuxt 0.159.0 → 0.160.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.mjs +7 -4
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -56,14 +56,17 @@ function detectComponentMode(filePath) {
|
|
|
56
56
|
if (CLIENT_COMPONENT_RE.test(filePath)) return "client";
|
|
57
57
|
if (SERVER_COMPONENT_RE.test(filePath)) return "server";
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function normalizeComponentMode(mode) {
|
|
60
|
+
return mode === "client" || mode === "server" ? mode : void 0;
|
|
61
|
+
}
|
|
62
|
+
function createComponentImport(filePath, exportName, lazy, mode) {
|
|
60
63
|
const componentImport = {
|
|
61
64
|
exportName,
|
|
62
65
|
filePath
|
|
63
66
|
};
|
|
64
67
|
if (lazy) componentImport.lazy = true;
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
68
|
+
const resolvedMode = normalizeComponentMode(mode) ?? detectComponentMode(filePath);
|
|
69
|
+
if (resolvedMode) componentImport.mode = resolvedMode;
|
|
67
70
|
return componentImport;
|
|
68
71
|
}
|
|
69
72
|
function getNuxtComponentDtsFiles(rootDir, buildDir) {
|
|
@@ -153,7 +156,7 @@ function createNuxtComponentResolver(options) {
|
|
|
153
156
|
return {
|
|
154
157
|
register(components) {
|
|
155
158
|
for (const component of components) {
|
|
156
|
-
const resolved = createComponentImport(component.filePath, component.export || "default");
|
|
159
|
+
const resolved = createComponentImport(component.filePath, component.export || "default", false, component.mode);
|
|
157
160
|
addComponentAlias(registered, component.pascalName, resolved);
|
|
158
161
|
addComponentAlias(registered, component.kebabName, resolved);
|
|
159
162
|
addComponentAlias(registered, component.name, resolved);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizejs/nuxt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.160.0",
|
|
4
4
|
"description": "Nuxt module for Vize - compiler, musea gallery, linter, and type checker",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compiler",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@nuxt/kit": "4.4.6",
|
|
44
|
-
"@vizejs/musea-nuxt": "0.
|
|
45
|
-
"@vizejs/vite-plugin": "0.
|
|
46
|
-
"@vizejs/vite-plugin-musea": "0.
|
|
47
|
-
"vize": "0.
|
|
44
|
+
"@vizejs/musea-nuxt": "0.160.0",
|
|
45
|
+
"@vizejs/vite-plugin": "0.160.0",
|
|
46
|
+
"@vizejs/vite-plugin-musea": "0.160.0",
|
|
47
|
+
"vize": "0.160.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"typescript": "6.0.3",
|