vuetify-nuxt-module 0.10.1 → 0.10.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/dist/module.d.mts CHANGED
@@ -414,7 +414,7 @@ interface ModuleRuntimeHooks {
414
414
  }) => HookResult;
415
415
  }
416
416
  declare module '#app' {
417
- interface RuntimeNuxtHooks {
417
+ interface ModuleRuntimeHooks {
418
418
  'vuetify:configuration': (options: {
419
419
  isDev: boolean;
420
420
  vuetifyOptions: VuetifyOptions;
package/dist/module.d.ts CHANGED
@@ -414,7 +414,7 @@ interface ModuleRuntimeHooks {
414
414
  }) => HookResult;
415
415
  }
416
416
  declare module '#app' {
417
- interface RuntimeNuxtHooks {
417
+ interface ModuleRuntimeHooks {
418
418
  'vuetify:configuration': (options: {
419
419
  isDev: boolean;
420
420
  vuetifyOptions: VuetifyOptions;
package/dist/module.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "nuxt": "^3.6.5",
6
6
  "bridge": false
7
7
  },
8
- "version": "0.10.1"
8
+ "version": "0.10.3"
9
9
  }
package/dist/module.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { addVitePlugin, extendWebpackConfig, addImports, addPlugin, addPluginTemplate, useLogger, defineNuxtModule, isNuxt3, getNuxtVersion, createResolver, hasNuxtModule } from '@nuxt/kit';
1
+ import { addVitePlugin, addPluginTemplate, extendWebpackConfig, addImports, addPlugin, useLogger, defineNuxtModule, isNuxt3, getNuxtVersion, createResolver, hasNuxtModule } from '@nuxt/kit';
2
2
  import { isPackageExists, getPackageInfo } from 'local-pkg';
3
3
  import defu from 'defu';
4
4
  import { debounce } from 'perfect-debounce';
@@ -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.10.1";
17
+ const version = "0.10.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)}`;
@@ -498,7 +498,7 @@ function isSubdir(root, test) {
498
498
  const relative$1 = relative(root, test);
499
499
  return relative$1 && !relative$1.startsWith("..") && !isAbsolute(relative$1);
500
500
  }
501
- function vuetifyStylesPlugin(options, logger) {
501
+ function vuetifyStylesPlugin(options, _logger) {
502
502
  const vuetifyBase = resolveVuetifyBase();
503
503
  let configFile;
504
504
  const tempFiles = /* @__PURE__ */ new Map();
@@ -546,6 +546,8 @@ function vuetifyStylesPlugin(options, logger) {
546
546
  const file = /^\/@fs\/plugin-vuetify\/lib\/(.*?)(\?.*)?$/.exec(id)[1];
547
547
  return tempFiles.get(file);
548
548
  }
549
+ if (id.includes("plugin-vuetify/lib"))
550
+ return "";
549
551
  }
550
552
  };
551
553
  }
@@ -1160,6 +1162,61 @@ function configureVite(configKey, nuxt, ctx) {
1160
1162
  });
1161
1163
  }
1162
1164
 
1165
+ function addVuetifyNuxtPlugins(nuxt, ctx) {
1166
+ addVuetifyNuxtPlugin(nuxt, ctx, "client");
1167
+ addVuetifyNuxtPlugin(nuxt, ctx, "server");
1168
+ }
1169
+ function addVuetifyNuxtPlugin(nuxt, ctx, mode) {
1170
+ addPluginTemplate({
1171
+ filename: `vuetify-nuxt-plugin.${mode}.mjs`,
1172
+ name: `vuetify:nuxt:${mode}:plugin`,
1173
+ write: false,
1174
+ mode,
1175
+ getContents() {
1176
+ const dependsOn = ["vuetify:icons:plugin"];
1177
+ if (ctx.ssrClientHints.enabled) {
1178
+ if (mode === "client")
1179
+ dependsOn.push("vuetify:client-hints:client:plugin");
1180
+ else
1181
+ dependsOn.push("vuetify:client-hints:server:plugin");
1182
+ }
1183
+ if (ctx.i18n) {
1184
+ dependsOn.push("vuetify:i18n:plugin");
1185
+ }
1186
+ if (nuxt.options.dev || ctx.dateAdapter) {
1187
+ if (ctx.i18n) {
1188
+ dependsOn.push("vuetify:date-i18n:plugin");
1189
+ } else {
1190
+ dependsOn.push("vuetify:date:plugin");
1191
+ }
1192
+ }
1193
+ return `
1194
+ import { defineNuxtPlugin } from '#imports'
1195
+ import { isDev, vuetifyConfiguration } from 'virtual:vuetify-configuration'
1196
+ import { createVuetify } from 'vuetify'
1197
+
1198
+ export default defineNuxtPlugin({
1199
+ name: 'vuetify:nuxt:${mode}:plugin',
1200
+ order: 25,
1201
+ dependsOn: ${JSON.stringify(dependsOn)},
1202
+ parallel: true,
1203
+ async setup(nuxtApp) {
1204
+ const vuetifyOptions = vuetifyConfiguration()
1205
+ await nuxtApp.hooks.callHook('vuetify:configuration', { isDev, vuetifyOptions })
1206
+ await nuxtApp.hooks.callHook('vuetify:before-create', { isDev, vuetifyOptions })
1207
+ const vuetify = createVuetify(vuetifyOptions)
1208
+ nuxtApp.vueApp.use(vuetify)
1209
+ nuxtApp.provide('vuetify', vuetify)
1210
+ await nuxtApp.hooks.callHook('vuetify:ready', vuetify)
1211
+ if (process.client)
1212
+ isDev && console.log('Vuetify 3 initialized', vuetify)
1213
+ },
1214
+ })
1215
+ `;
1216
+ }
1217
+ });
1218
+ }
1219
+
1163
1220
  function configureNuxt(configKey, nuxt, ctx) {
1164
1221
  const {
1165
1222
  importComposables,
@@ -1204,14 +1261,7 @@ function configureNuxt(configKey, nuxt, ctx) {
1204
1261
  meta: { docsUrl: `https://vuetifyjs.com/en/api/${toKebabCase(name)}/` }
1205
1262
  })));
1206
1263
  }
1207
- let addHttpClientHintsPlugin = "";
1208
1264
  if (ctx.ssrClientHints.enabled) {
1209
- addHttpClientHintsPlugin = `
1210
- if (import.meta.client)
1211
- dependsOn.push('vuetify:client-hints:client:plugin')
1212
- if (import.meta.server)
1213
- dependsOn.push('vuetify:client-hints:server:plugin')
1214
- `;
1215
1265
  addPlugin({
1216
1266
  src: ctx.resolver.resolve(runtimeDir, "plugins/vuetify-client-hints.client"),
1217
1267
  mode: "client"
@@ -1225,61 +1275,26 @@ dependsOn.push('vuetify:client-hints:server:plugin')
1225
1275
  src: ctx.resolver.resolve(runtimeDir, "plugins/vuetify-no-client-hints")
1226
1276
  });
1227
1277
  }
1228
- const dependsOn = ["vuetify:icons:plugin"];
1229
1278
  addPlugin({
1230
1279
  src: ctx.resolver.resolve(runtimeDir, "plugins/vuetify-icons")
1231
1280
  });
1232
1281
  if (ctx.i18n) {
1233
- dependsOn.push("vuetify:i18n:plugin");
1234
1282
  addPlugin({
1235
1283
  src: ctx.resolver.resolve(runtimeDir, "plugins/vuetify-i18n")
1236
1284
  });
1237
1285
  }
1238
1286
  if (nuxt.options.dev || ctx.dateAdapter) {
1239
1287
  if (ctx.i18n) {
1240
- dependsOn.push("vuetify:date-i18n:plugin");
1241
1288
  addPlugin({
1242
1289
  src: ctx.resolver.resolve(runtimeDir, "plugins/vuetify-i18n-date")
1243
1290
  });
1244
1291
  } else {
1245
- dependsOn.push("vuetify:date:plugin");
1246
1292
  addPlugin({
1247
1293
  src: ctx.resolver.resolve(runtimeDir, "plugins/vuetify-date")
1248
1294
  });
1249
1295
  }
1250
1296
  }
1251
- addPluginTemplate({
1252
- filename: "vuetify-nuxt-plugin.mjs",
1253
- write: false,
1254
- getContents() {
1255
- return `
1256
- import { defineNuxtPlugin } from '#imports'
1257
- import { isDev, vuetifyConfiguration } from 'virtual:vuetify-configuration'
1258
- import { createVuetify } from 'vuetify'
1259
-
1260
- const dependsOn = ${JSON.stringify(dependsOn)}
1261
- ${addHttpClientHintsPlugin}
1262
-
1263
- export default defineNuxtPlugin({
1264
- name: 'vuetify:nuxt:plugin',
1265
- order: 25,
1266
- dependsOn,
1267
- parallel: true,
1268
- async setup(nuxtApp) {
1269
- const vuetifyOptions = vuetifyConfiguration()
1270
- await nuxtApp.hooks.callHook('vuetify:configuration', { isDev, vuetifyOptions })
1271
- await nuxtApp.hooks.callHook('vuetify:before-create', { isDev, vuetifyOptions })
1272
- const vuetify = createVuetify(vuetifyOptions)
1273
- nuxtApp.vueApp.use(vuetify)
1274
- nuxtApp.provide('vuetify', vuetify)
1275
- await nuxtApp.hooks.callHook('vuetify:ready', vuetify)
1276
- if (process.client)
1277
- isDev && console.log('Vuetify 3 initialized', vuetify)
1278
- },
1279
- })
1280
- `;
1281
- }
1282
- });
1297
+ addVuetifyNuxtPlugins(nuxt, ctx);
1283
1298
  }
1284
1299
 
1285
1300
  const CONFIG_KEY = "vuetify";
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "vuetify-nuxt-module",
3
3
  "type": "module",
4
- "version": "0.10.1",
5
- "packageManager": "pnpm@8.14.1",
4
+ "version": "0.10.3",
5
+ "packageManager": "pnpm@8.14.3",
6
6
  "description": "Zero-Config Nuxt Module for Vuetify",
7
7
  "author": "userquin <userquin@gmail.com>",
8
8
  "license": "MIT",
@@ -137,4 +137,4 @@
137
137
  "installDependencies": false,
138
138
  "startCommand": "node .stackblitz.js && pnpm install && nr prepack && nr dev:prepare && nr dev"
139
139
  }
140
- }
140
+ }