vuetify-nuxt-module 0.13.1 → 0.13.3

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/README.md CHANGED
@@ -39,7 +39,7 @@
39
39
  - 😃 **Icon Fonts**: configure the [icon font](https://vuetifyjs.com/en/features/icon-fonts/) you want to use, the module will automatically import it for you using CDN or local dependencies
40
40
  - 🎭 **SVG Icons**: ready to use [@mdi/js](https://www.npmjs.com/package/@mdi/js) and [@fortawesome/vue-fontawesome](https://www.npmjs.com/package/@fortawesome/vue-fontawesome) SVG icons packs
41
41
  - 📦 **Multiple Icon Sets**: register [multiple icon sets](https://vuetifyjs.com/en/features/icon-fonts/#multiple-icon-sets)
42
- - 🌍 **I18n Ready**: install [@nuxtjs/i18n](https://v8.i18n.nuxtjs.org/) Nuxt module, and you're ready to use Vuetify [internationalization](https://vuetifyjs.com/en/features/internationalization/) features
42
+ - 🌍 **I18n Ready**: install [@nuxtjs/i18n](https://i18n.nuxtjs.org/) Nuxt module, and you're ready to use Vuetify [internationalization](https://vuetifyjs.com/en/features/internationalization/) features
43
43
  - 📆 **Date Components**: use Vuetify components [that require date functionality](https://vuetifyjs.com/en/features/dates/) installing and configuring one of the [@date-io](https://github.com/dmtrKovalenko/date-io#projects) adapters
44
44
  - 💬 **Auto-Import Vuetify Locale Messages**: add [Vuetify Locale Messages](https://vuetifyjs.com/en/features/internationalization/#getting-started) adding just the locales you want to use, no more imports needed
45
45
  - ⚙️ **Auto-Import Vuetify Composables**: you don't need to import Vuetify composables manually, they are automatically imported for you
@@ -52,13 +52,7 @@
52
52
  > Requires Vite, will not work with Webpack
53
53
 
54
54
  ```bash
55
- npm i vuetify-nuxt-module -D
56
-
57
- # yarn
58
- yarn add vuetify-nuxt-module -D
59
-
60
- # pnpm
61
- pnpm add vuetify-nuxt-module -D
55
+ npx nuxi@latest module add vuetify-nuxt-module
62
56
  ```
63
57
 
64
58
  [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/userquin/vuetify-nuxt-module)
package/dist/module.d.mts CHANGED
@@ -59,7 +59,7 @@ interface FontIconSet {
59
59
  /**
60
60
  * Use CDN?
61
61
  *
62
- * - mdi: https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons
62
+ * - mdi: https://cdn.jsdelivr.net/npm/@mdi/font@5.x/css/materialdesignicons.min.css
63
63
  * - md: https://fonts.googleapis.com/css?family=Material+Icons
64
64
  * - fa: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@latest/css/all.min.css
65
65
  * - fa4: https://cdn.jsdelivr.net/npm/font-awesome@4.x/css/font-awesome.min.css
@@ -209,7 +209,7 @@ interface VOptions extends Partial<Omit<VuetifyOptions, 'ssr' | 'aliases' | 'com
209
209
  /**
210
210
  * Include the icons?
211
211
  *
212
- * By default, `mdi` icons will be used via cdn: https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css.
212
+ * By default, `mdi` icons will be used via cdn: https://cdn.jsdelivr.net/npm/@mdi/font@5.x/css/materialdesignicons.min.css.
213
213
  *
214
214
  * @see https://vuetifyjs.com/en/features/icon-fonts/
215
215
  */
package/dist/module.d.ts CHANGED
@@ -59,7 +59,7 @@ interface FontIconSet {
59
59
  /**
60
60
  * Use CDN?
61
61
  *
62
- * - mdi: https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons
62
+ * - mdi: https://cdn.jsdelivr.net/npm/@mdi/font@5.x/css/materialdesignicons.min.css
63
63
  * - md: https://fonts.googleapis.com/css?family=Material+Icons
64
64
  * - fa: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@latest/css/all.min.css
65
65
  * - fa4: https://cdn.jsdelivr.net/npm/font-awesome@4.x/css/font-awesome.min.css
@@ -209,7 +209,7 @@ interface VOptions extends Partial<Omit<VuetifyOptions, 'ssr' | 'aliases' | 'com
209
209
  /**
210
210
  * Include the icons?
211
211
  *
212
- * By default, `mdi` icons will be used via cdn: https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css.
212
+ * By default, `mdi` icons will be used via cdn: https://cdn.jsdelivr.net/npm/@mdi/font@5.x/css/materialdesignicons.min.css.
213
213
  *
214
214
  * @see https://vuetifyjs.com/en/features/icon-fonts/
215
215
  */
package/dist/module.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "nuxt": "^3.9.0",
6
6
  "bridge": false
7
7
  },
8
- "version": "0.13.1"
8
+ "version": "0.13.3"
9
9
  }
package/dist/module.mjs CHANGED
@@ -14,7 +14,7 @@ import { parseQuery, parseURL } from 'ufo';
14
14
  import destr from 'destr';
15
15
  import { transformAssetUrls } from 'vite-plugin-vuetify';
16
16
 
17
- const version = "0.13.1";
17
+ const version = "0.13.3";
18
18
 
19
19
  const VIRTUAL_VUETIFY_CONFIGURATION = "virtual:vuetify-configuration";
20
20
  const RESOLVED_VIRTUAL_VUETIFY_CONFIGURATION = `/@nuxt-vuetify-configuration/${VIRTUAL_VUETIFY_CONFIGURATION.slice("virtual:".length)}`;
@@ -114,9 +114,11 @@ async function mergeVuetifyModules(options, nuxt) {
114
114
  vuetifyOptions: resolvedOptions.config
115
115
  });
116
116
  if (moduleOptions.length > 1) {
117
- const [base, ...rest] = moduleOptions;
117
+ const [base, ...rest] = moduleOptions.reverse();
118
+ const configuration = defu(base, ...rest);
119
+ dedupeIcons(configuration, moduleOptions);
118
120
  return {
119
- configuration: defu(base, ...rest),
121
+ configuration,
120
122
  vuetifyConfigurationFilesToWatch
121
123
  };
122
124
  } else {
@@ -129,6 +131,30 @@ async function mergeVuetifyModules(options, nuxt) {
129
131
  };
130
132
  }
131
133
  }
134
+ function dedupeIcons(configuration, moduleOptions) {
135
+ const vuetifyOptions = configuration.vuetifyOptions;
136
+ if (vuetifyOptions.icons) {
137
+ if (vuetifyOptions.icons.sets) {
138
+ const sets = /* @__PURE__ */ new Map();
139
+ for (const { vuetifyOptions: vuetifyOptions2 } of moduleOptions) {
140
+ if (vuetifyOptions2.icons && vuetifyOptions2.icons.sets) {
141
+ const mSets = vuetifyOptions2.icons.sets;
142
+ if (typeof mSets === "string") {
143
+ sets.set(mSets, { name: mSets });
144
+ } else {
145
+ for (const set of mSets) {
146
+ if (typeof set === "string")
147
+ sets.set(set, { name: set });
148
+ else
149
+ sets.set(set.name, set);
150
+ }
151
+ }
152
+ }
153
+ }
154
+ vuetifyOptions.icons.sets = Array.from(sets.values());
155
+ }
156
+ }
157
+ }
132
158
 
133
159
  function detectDate() {
134
160
  const result = [];
@@ -1226,7 +1252,6 @@ function configureNuxt(configKey, nuxt, ctx) {
1226
1252
  const {
1227
1253
  importComposables,
1228
1254
  prefixComposables,
1229
- styles,
1230
1255
  includeTransformAssetsUrls = true
1231
1256
  } = ctx.moduleOptions;
1232
1257
  const runtimeDir = ctx.resolver.resolve("./runtime");
@@ -1238,12 +1263,7 @@ function configureNuxt(configKey, nuxt, ctx) {
1238
1263
  for (const virtual of RESOLVED_VIRTUAL_MODULES)
1239
1264
  nuxt.options.imports.transform.include.push(new RegExp(`${virtual}$`));
1240
1265
  nuxt.options.css ??= [];
1241
- if (typeof styles === "string" && ["sass", "expose"].includes(styles))
1242
- nuxt.options.css.unshift("vuetify/styles/main.sass");
1243
- else if (styles === true)
1244
- nuxt.options.css.unshift("vuetify/styles");
1245
- else if (typeof styles === "object" && typeof styles?.configFile === "string")
1246
- nuxt.options.css.unshift(styles.configFile);
1266
+ nuxt.options.css.unshift("vuetify/styles");
1247
1267
  if (includeTransformAssetsUrls && typeof nuxt.options.vite.vue?.template?.transformAssetUrls === "undefined") {
1248
1268
  nuxt.options.vite.vue ??= {};
1249
1269
  nuxt.options.vite.vue.template ??= {};
@@ -45,16 +45,21 @@ function createProvideFunction(data) {
45
45
  if (oldVal)
46
46
  i18n.setLocale(val);
47
47
  }, { immediate: true, flush: "post" });
48
+ const t = wrapI18n(i18n.t);
49
+ const n = wrapI18n(i18n.n);
48
50
  return {
49
51
  name: "nuxt-vue-i18n",
50
52
  current: currentLocale,
51
53
  fallback: data.fallback,
52
54
  messages: data.messages,
53
- // todo: fix this, we should check the options
54
- // @ts-expect-error Type instantiation is excessively deep and possibly infinite.ts(2589)
55
- t: (key, ...params) => i18n.t(key, params),
56
- n: i18n.n,
55
+ t,
56
+ n,
57
57
  provide: createProvideFunction({ current: currentLocale, fallback: data.fallback, messages: data.messages })
58
58
  };
59
59
  };
60
60
  }
61
+ function wrapI18n(t) {
62
+ return (...args) => {
63
+ return t(...args);
64
+ };
65
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "vuetify-nuxt-module",
3
3
  "type": "module",
4
- "version": "0.13.1",
5
- "packageManager": "pnpm@8.15.5",
4
+ "version": "0.13.3",
5
+ "packageManager": "pnpm@9.0.5",
6
6
  "description": "Zero-Config Nuxt Module for Vuetify",
7
7
  "author": "userquin <userquin@gmail.com>",
8
8
  "license": "MIT",
@@ -74,7 +74,7 @@
74
74
  "ufo": "^1.5.3",
75
75
  "unconfig": "^0.3.11",
76
76
  "vite-plugin-vuetify": "^2.0.3",
77
- "vuetify": "^3.5.12"
77
+ "vuetify": "^3.5.13"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@antfu/eslint-config": "^0.43.1",