vuetify-nuxt-module 0.5.6 → 0.5.8
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/module.d.ts +9 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +31 -8
- package/dist/runtime/plugins/icons.mjs +7 -2
- package/package.json +10 -10
package/dist/module.d.ts
CHANGED
|
@@ -190,11 +190,20 @@ interface MOptions {
|
|
|
190
190
|
/**
|
|
191
191
|
* Vuetify styles.
|
|
192
192
|
*
|
|
193
|
+
* If you want to use configFile on SSR, you have to disable `experimental.inlineSSRStyles` in nuxt.config.
|
|
194
|
+
*
|
|
193
195
|
* @see https://github.com/vuetifyjs/vuetify-loader/tree/master/packages/vite-plugin
|
|
196
|
+
* @see https://github.com/userquin/vuetify-nuxt-module/issues/78 and https://github.com/userquin/vuetify-nuxt-module/issues/74
|
|
194
197
|
*/
|
|
195
198
|
styles?: true | 'none' | 'expose' | 'sass' | {
|
|
196
199
|
configFile: string;
|
|
197
200
|
};
|
|
201
|
+
/**
|
|
202
|
+
* Add Vuetify Vite Plugin `transformAssetsUrls`?
|
|
203
|
+
*
|
|
204
|
+
* @default false
|
|
205
|
+
*/
|
|
206
|
+
includeTransformAssetsUrls?: boolean;
|
|
198
207
|
}
|
|
199
208
|
interface ModuleOptions {
|
|
200
209
|
moduleOptions?: MOptions;
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -3,15 +3,16 @@ import defu from 'defu';
|
|
|
3
3
|
import { debounce } from 'perfect-debounce';
|
|
4
4
|
import { existsSync, statSync } from 'node:fs';
|
|
5
5
|
import { resolve, dirname } from 'node:path';
|
|
6
|
+
import process from 'node:process';
|
|
6
7
|
import { createConfigLoader } from 'unconfig';
|
|
7
8
|
import { readFile, utimes } from 'node:fs/promises';
|
|
8
9
|
import { isPackageExists } from 'local-pkg';
|
|
9
10
|
import { resolveVuetifyBase, normalizePath, writeStyles, cacheDir } from '@vuetify/loader-shared';
|
|
10
|
-
import vuetify from 'vite-plugin-vuetify';
|
|
11
|
+
import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify';
|
|
11
12
|
import { isAbsolute, join, relative } from 'pathe';
|
|
12
13
|
import { normalizePath as normalizePath$1 } from 'vite';
|
|
13
14
|
|
|
14
|
-
const version = "0.5.
|
|
15
|
+
const version = "0.5.8";
|
|
15
16
|
|
|
16
17
|
const VIRTUAL_VUETIFY_CONFIGURATION = "virtual:vuetify-configuration";
|
|
17
18
|
const RESOLVED_VIRTUAL_VUETIFY_CONFIGURATION = `/@nuxt-vuetify-configuration/${VIRTUAL_VUETIFY_CONFIGURATION.slice("virtual:".length)}`;
|
|
@@ -196,6 +197,7 @@ const disabledResolvedIcons = Object.freeze({
|
|
|
196
197
|
unocssIconPrefix: "i-",
|
|
197
198
|
imports: [],
|
|
198
199
|
aliases: [],
|
|
200
|
+
aliasesImportPresent: false,
|
|
199
201
|
sets: [],
|
|
200
202
|
cdn: [],
|
|
201
203
|
local: [],
|
|
@@ -219,6 +221,7 @@ function prepareIcons(unocssPresent, logger, vuetifyOptions) {
|
|
|
219
221
|
defaultSet,
|
|
220
222
|
sets: [],
|
|
221
223
|
aliases: [],
|
|
224
|
+
aliasesImportPresent: false,
|
|
222
225
|
imports: [],
|
|
223
226
|
cdn: [],
|
|
224
227
|
local: [],
|
|
@@ -235,6 +238,7 @@ function prepareIcons(unocssPresent, logger, vuetifyOptions) {
|
|
|
235
238
|
sets.filter((s) => cssFonts.includes(s.name)).forEach(({ name, cdn }) => {
|
|
236
239
|
if (name === "unocss-mdi")
|
|
237
240
|
return;
|
|
241
|
+
resolvedIcons.aliasesImportPresent || (resolvedIcons.aliasesImportPresent = name === defaultSet);
|
|
238
242
|
resolvedIcons.imports.push(`import {${name === defaultSet ? "aliases," : ""}${name}} from 'vuetify/iconsets/${name}'`);
|
|
239
243
|
resolvedIcons.sets.push(name);
|
|
240
244
|
if (isPackageExists(iconsPackageNames[name].name))
|
|
@@ -272,6 +276,7 @@ function prepareIcons(unocssPresent, logger, vuetifyOptions) {
|
|
|
272
276
|
logger.warn("Missing @fortawesome/vue-fontawesome dependency, install it!");
|
|
273
277
|
}
|
|
274
278
|
if (faSvgExists) {
|
|
279
|
+
resolvedIcons.aliasesImportPresent || (resolvedIcons.aliasesImportPresent = defaultSet === "fa-svg");
|
|
275
280
|
resolvedIcons.imports.push(`import {${defaultSet === "fa-svg" ? "aliases," : ""}fa} from 'vuetify/iconsets/fa-svg'`);
|
|
276
281
|
resolvedIcons.imports.push("import { library } from '@fortawesome/fontawesome-svg-core'");
|
|
277
282
|
resolvedIcons.imports.push("import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'");
|
|
@@ -293,6 +298,7 @@ function prepareIcons(unocssPresent, logger, vuetifyOptions) {
|
|
|
293
298
|
const mdiSvgExists = isPackageExists("@mdi/js");
|
|
294
299
|
if (mdiSvgExists) {
|
|
295
300
|
resolvedIcons.svg.mdi = true;
|
|
301
|
+
resolvedIcons.aliasesImportPresent || (resolvedIcons.aliasesImportPresent = defaultSet === "mdi-svg");
|
|
296
302
|
resolvedIcons.imports.push(`import {${defaultSet === "mdi-svg" ? "aliases," : ""}mdi} from 'vuetify/iconsets/mdi-svg'`);
|
|
297
303
|
if (mdiSvg && mdiSvg.aliases) {
|
|
298
304
|
resolvedIcons.imports.push(`import {${Object.values(mdiSvg.aliases).join(",")}} from '@mdi/js'`);
|
|
@@ -363,7 +369,7 @@ async function load(options, nuxt, ctx) {
|
|
|
363
369
|
ctx.dateAdapter = adapter;
|
|
364
370
|
} else {
|
|
365
371
|
if (date.find((d) => d === adapter) === void 0)
|
|
366
|
-
ctx.logger.warn(`Ignoring Vuetify Date configuration, date adapter "@date-io/${adapter}" not installed!`);
|
|
372
|
+
ctx.logger.warn(`[vuetify-nuxt-module] Ignoring Vuetify Date configuration, date adapter "@date-io/${adapter}" not installed!`);
|
|
367
373
|
else
|
|
368
374
|
ctx.dateAdapter = adapter;
|
|
369
375
|
}
|
|
@@ -882,13 +888,17 @@ ${unocss}
|
|
|
882
888
|
};
|
|
883
889
|
}
|
|
884
890
|
let aliases = "aliases,";
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
891
|
+
if (!ctx.icons.aliasesImportPresent || ctx.vuetifyOptions.icons && ctx.vuetifyOptions.icons.defaultSet === "custom") {
|
|
892
|
+
aliases = "";
|
|
893
|
+
} else {
|
|
894
|
+
const alias = ctx.icons.aliases;
|
|
895
|
+
if (alias.length) {
|
|
896
|
+
aliases = `aliases: {
|
|
888
897
|
...aliases,
|
|
889
898
|
${alias.join(",\n")}
|
|
890
899
|
},
|
|
891
900
|
`;
|
|
901
|
+
}
|
|
892
902
|
}
|
|
893
903
|
let unocss = "";
|
|
894
904
|
if (ctx.icons.unocss && ctx.icons.unocssAliases) {
|
|
@@ -1023,8 +1033,13 @@ function toKebabCase(str = "") {
|
|
|
1023
1033
|
toKebabCase.cache = /* @__PURE__ */ new Map();
|
|
1024
1034
|
|
|
1025
1035
|
function configureNuxt(configKey, nuxt, ctx) {
|
|
1026
|
-
var _a;
|
|
1027
|
-
const {
|
|
1036
|
+
var _a, _b, _c;
|
|
1037
|
+
const {
|
|
1038
|
+
importComposables,
|
|
1039
|
+
prefixComposables,
|
|
1040
|
+
styles,
|
|
1041
|
+
includeTransformAssetsUrls = false
|
|
1042
|
+
} = ctx.moduleOptions;
|
|
1028
1043
|
const runtimeDir = ctx.resolver.resolve("./runtime");
|
|
1029
1044
|
nuxt.options.build.transpile.push(configKey);
|
|
1030
1045
|
nuxt.options.build.transpile.push(runtimeDir);
|
|
@@ -1035,6 +1050,14 @@ function configureNuxt(configKey, nuxt, ctx) {
|
|
|
1035
1050
|
nuxt.options.css.unshift("vuetify/styles");
|
|
1036
1051
|
else if (typeof styles === "object" && typeof styles?.configFile === "string")
|
|
1037
1052
|
nuxt.options.css.unshift(styles.configFile);
|
|
1053
|
+
if (includeTransformAssetsUrls) {
|
|
1054
|
+
(_b = nuxt.options.vite).vue ?? (_b.vue = {});
|
|
1055
|
+
(_c = nuxt.options.vite.vue).template ?? (_c.template = {});
|
|
1056
|
+
if (typeof nuxt.options.vite.vue.template.transformAssetUrls === "undefined")
|
|
1057
|
+
nuxt.options.vite.vue.template.transformAssetUrls = transformAssetUrls;
|
|
1058
|
+
else
|
|
1059
|
+
ctx.logger.warn("[vuetify-nuxt-module] `includeTransformAssetsUrls` is enabled but `vite.vue.template.transformAssetUrls` is already configured, ignored!");
|
|
1060
|
+
}
|
|
1038
1061
|
extendWebpackConfig(() => {
|
|
1039
1062
|
throw new Error("Webpack is not supported: vuetify-nuxt-module module can only be used with Vite!");
|
|
1040
1063
|
});
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { enabled, iconsConfiguration } from "virtual:vuetify-icons-configuration";
|
|
2
2
|
export function configureIcons(vuetifyOptions) {
|
|
3
|
-
if (enabled)
|
|
4
|
-
|
|
3
|
+
if (enabled) {
|
|
4
|
+
const icons = iconsConfiguration();
|
|
5
|
+
const custom = icons?.defaultSet === "custom";
|
|
6
|
+
if (custom)
|
|
7
|
+
return;
|
|
8
|
+
vuetifyOptions.icons = icons;
|
|
9
|
+
}
|
|
5
10
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vuetify-nuxt-module",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.5.
|
|
5
|
-
"packageManager": "pnpm@8.
|
|
4
|
+
"version": "0.5.8",
|
|
5
|
+
"packageManager": "pnpm@8.7.4",
|
|
6
6
|
"description": "Zero-Config Nuxt Module for Vuetify",
|
|
7
7
|
"author": "userquin <userquin@gmail.com>",
|
|
8
8
|
"license": "MIT",
|
|
@@ -72,14 +72,14 @@
|
|
|
72
72
|
"vuetify": "^3.3.9"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@antfu/eslint-config": "^0.
|
|
76
|
-
"@antfu/ni": "^0.21.
|
|
75
|
+
"@antfu/eslint-config": "^0.41.0",
|
|
76
|
+
"@antfu/ni": "^0.21.8",
|
|
77
77
|
"@date-io/luxon": "^2.17.0",
|
|
78
78
|
"@fortawesome/fontawesome-svg-core": "^6.4.0",
|
|
79
79
|
"@fortawesome/free-solid-svg-icons": "^6.4.0",
|
|
80
80
|
"@fortawesome/vue-fontawesome": "^3.0.3",
|
|
81
|
-
"@iconify-json/carbon": "^1.1.
|
|
82
|
-
"@iconify-json/mdi": "^1.1.
|
|
81
|
+
"@iconify-json/carbon": "^1.1.21",
|
|
82
|
+
"@iconify-json/mdi": "^1.1.54",
|
|
83
83
|
"@mdi/js": "^7.2.96",
|
|
84
84
|
"@nuxt/devtools": "^0.7.0",
|
|
85
85
|
"@nuxt/module-builder": "^0.4.0",
|
|
@@ -89,12 +89,12 @@
|
|
|
89
89
|
"@parcel/watcher": "^2.2.0",
|
|
90
90
|
"@types/node": "^18",
|
|
91
91
|
"@unocss/nuxt": "^0.53.6",
|
|
92
|
-
"bumpp": "^9.
|
|
93
|
-
"eslint": "^8.
|
|
92
|
+
"bumpp": "^9.2.0",
|
|
93
|
+
"eslint": "^8.49.0",
|
|
94
94
|
"luxon": "^3.3.0",
|
|
95
95
|
"nuxt": "^3.6.5",
|
|
96
96
|
"sass": "^1.63.6",
|
|
97
|
-
"typescript": "^5.
|
|
97
|
+
"typescript": "^5.2.2",
|
|
98
98
|
"vite": "^4.3.9",
|
|
99
99
|
"vitest": "^0.31.4"
|
|
100
100
|
},
|
|
@@ -128,4 +128,4 @@
|
|
|
128
128
|
"installDependencies": false,
|
|
129
129
|
"startCommand": "node .stackblitz.js && pnpm install && pnpm run dev"
|
|
130
130
|
}
|
|
131
|
-
}
|
|
131
|
+
}
|