vuetify-nuxt-module 0.10.0 → 0.10.2

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
@@ -397,7 +397,7 @@ interface ModuleOptions extends VuetifyModuleOptions {
397
397
  interface ModuleHooks {
398
398
  'vuetify:registerModule': (registerModule: (config: InlineModuleOptions) => void) => HookResult;
399
399
  }
400
- interface RuntimeModuleHooks {
400
+ interface ModuleRuntimeHooks {
401
401
  'vuetify:configuration': (options: {
402
402
  isDev: boolean;
403
403
  vuetifyOptions: VuetifyOptions;
@@ -414,7 +414,7 @@ interface RuntimeModuleHooks {
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;
@@ -443,4 +443,4 @@ declare module '@nuxt/schema' {
443
443
  }
444
444
  }
445
445
 
446
- export { type ComponentName, type Components, type DateAdapter, type DateOptions, type DirectiveName, type Directives, type ExternalVuetifyOptions, type FontAwesomeSvgIconSet, type FontIconSet, type IconFontName, type IconSetName, type IconsOptions, type InlineModuleOptions, type JSSVGIconSet, type LabComponentName, type LabComponents, type MOptions, type ModuleHooks, type ModuleOptions, type RuntimeModuleHooks, type SSRClientHints, type SSRClientHintsConfiguration, type UnoCCSMdiIconSet, type VOptions, type VuetifyLocale, type VuetifyModuleOptions, _default as default };
446
+ export { type ComponentName, type Components, type DateAdapter, type DateOptions, type DirectiveName, type Directives, type ExternalVuetifyOptions, type FontAwesomeSvgIconSet, type FontIconSet, type IconFontName, type IconSetName, type IconsOptions, type InlineModuleOptions, type JSSVGIconSet, type LabComponentName, type LabComponents, type MOptions, type ModuleHooks, type ModuleOptions, type ModuleRuntimeHooks, type SSRClientHints, type SSRClientHintsConfiguration, type UnoCCSMdiIconSet, type VOptions, type VuetifyLocale, type VuetifyModuleOptions, _default as default };
package/dist/module.d.ts CHANGED
@@ -397,7 +397,7 @@ interface ModuleOptions extends VuetifyModuleOptions {
397
397
  interface ModuleHooks {
398
398
  'vuetify:registerModule': (registerModule: (config: InlineModuleOptions) => void) => HookResult;
399
399
  }
400
- interface RuntimeModuleHooks {
400
+ interface ModuleRuntimeHooks {
401
401
  'vuetify:configuration': (options: {
402
402
  isDev: boolean;
403
403
  vuetifyOptions: VuetifyOptions;
@@ -414,7 +414,7 @@ interface RuntimeModuleHooks {
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;
@@ -443,4 +443,4 @@ declare module '@nuxt/schema' {
443
443
  }
444
444
  }
445
445
 
446
- export { type ComponentName, type Components, type DateAdapter, type DateOptions, type DirectiveName, type Directives, type ExternalVuetifyOptions, type FontAwesomeSvgIconSet, type FontIconSet, type IconFontName, type IconSetName, type IconsOptions, type InlineModuleOptions, type JSSVGIconSet, type LabComponentName, type LabComponents, type MOptions, type ModuleHooks, type ModuleOptions, type RuntimeModuleHooks, type SSRClientHints, type SSRClientHintsConfiguration, type UnoCCSMdiIconSet, type VOptions, type VuetifyLocale, type VuetifyModuleOptions, _default as default };
446
+ export { type ComponentName, type Components, type DateAdapter, type DateOptions, type DirectiveName, type Directives, type ExternalVuetifyOptions, type FontAwesomeSvgIconSet, type FontIconSet, type IconFontName, type IconSetName, type IconsOptions, type InlineModuleOptions, type JSSVGIconSet, type LabComponentName, type LabComponents, type MOptions, type ModuleHooks, type ModuleOptions, type ModuleRuntimeHooks, type SSRClientHints, type SSRClientHintsConfiguration, type UnoCCSMdiIconSet, type VOptions, type VuetifyLocale, type VuetifyModuleOptions, _default as default };
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.0"
8
+ "version": "0.10.2"
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.0";
17
+ const version = "0.10.2";
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)}`;
@@ -1160,6 +1160,61 @@ function configureVite(configKey, nuxt, ctx) {
1160
1160
  });
1161
1161
  }
1162
1162
 
1163
+ function addVuetifyNuxtPlugins(nuxt, ctx) {
1164
+ addVuetifyNuxtPlugin(nuxt, ctx, "client");
1165
+ addVuetifyNuxtPlugin(nuxt, ctx, "server");
1166
+ }
1167
+ function addVuetifyNuxtPlugin(nuxt, ctx, mode) {
1168
+ addPluginTemplate({
1169
+ filename: `vuetify-nuxt-plugin.${mode}.mjs`,
1170
+ name: `vuetify:nuxt:${mode}:plugin`,
1171
+ write: false,
1172
+ mode,
1173
+ getContents() {
1174
+ const dependsOn = ["vuetify:icons:plugin"];
1175
+ if (ctx.ssrClientHints.enabled) {
1176
+ if (mode === "client")
1177
+ dependsOn.push("vuetify:client-hints:client:plugin");
1178
+ else
1179
+ dependsOn.push("vuetify:client-hints:server:plugin");
1180
+ }
1181
+ if (ctx.i18n) {
1182
+ dependsOn.push("vuetify:i18n:plugin");
1183
+ }
1184
+ if (nuxt.options.dev || ctx.dateAdapter) {
1185
+ if (ctx.i18n) {
1186
+ dependsOn.push("vuetify:date-i18n:plugin");
1187
+ } else {
1188
+ dependsOn.push("vuetify:date:plugin");
1189
+ }
1190
+ }
1191
+ return `
1192
+ import { defineNuxtPlugin } from '#imports'
1193
+ import { isDev, vuetifyConfiguration } from 'virtual:vuetify-configuration'
1194
+ import { createVuetify } from 'vuetify'
1195
+
1196
+ export default defineNuxtPlugin({
1197
+ name: 'vuetify:nuxt:${mode}:plugin',
1198
+ order: 25,
1199
+ dependsOn: ${JSON.stringify(dependsOn)},
1200
+ parallel: true,
1201
+ async setup(nuxtApp) {
1202
+ const vuetifyOptions = vuetifyConfiguration()
1203
+ await nuxtApp.hooks.callHook('vuetify:configuration', { isDev, vuetifyOptions })
1204
+ await nuxtApp.hooks.callHook('vuetify:before-create', { isDev, vuetifyOptions })
1205
+ const vuetify = createVuetify(vuetifyOptions)
1206
+ nuxtApp.vueApp.use(vuetify)
1207
+ nuxtApp.provide('vuetify', vuetify)
1208
+ await nuxtApp.hooks.callHook('vuetify:ready', vuetify)
1209
+ if (process.client)
1210
+ isDev && console.log('Vuetify 3 initialized', vuetify)
1211
+ },
1212
+ })
1213
+ `;
1214
+ }
1215
+ });
1216
+ }
1217
+
1163
1218
  function configureNuxt(configKey, nuxt, ctx) {
1164
1219
  const {
1165
1220
  importComposables,
@@ -1204,14 +1259,7 @@ function configureNuxt(configKey, nuxt, ctx) {
1204
1259
  meta: { docsUrl: `https://vuetifyjs.com/en/api/${toKebabCase(name)}/` }
1205
1260
  })));
1206
1261
  }
1207
- let addHttpClientHintsPlugin = "";
1208
1262
  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
1263
  addPlugin({
1216
1264
  src: ctx.resolver.resolve(runtimeDir, "plugins/vuetify-client-hints.client"),
1217
1265
  mode: "client"
@@ -1225,58 +1273,26 @@ dependsOn.push('vuetify:client-hints:server:plugin')
1225
1273
  src: ctx.resolver.resolve(runtimeDir, "plugins/vuetify-no-client-hints")
1226
1274
  });
1227
1275
  }
1228
- const dependsOn = ["vuetify:icons:plugin"];
1229
1276
  addPlugin({
1230
1277
  src: ctx.resolver.resolve(runtimeDir, "plugins/vuetify-icons")
1231
1278
  });
1232
1279
  if (ctx.i18n) {
1233
- dependsOn.push("vuetify:i18n:plugin");
1234
1280
  addPlugin({
1235
1281
  src: ctx.resolver.resolve(runtimeDir, "plugins/vuetify-i18n")
1236
1282
  });
1237
1283
  }
1238
1284
  if (nuxt.options.dev || ctx.dateAdapter) {
1239
1285
  if (ctx.i18n) {
1240
- dependsOn.push("vuetify:date-i18n:plugin");
1241
1286
  addPlugin({
1242
1287
  src: ctx.resolver.resolve(runtimeDir, "plugins/vuetify-i18n-date")
1243
1288
  });
1244
1289
  } else {
1245
- dependsOn.push("vuetify:date:plugin");
1246
1290
  addPlugin({
1247
1291
  src: ctx.resolver.resolve(runtimeDir, "plugins/vuetify-date")
1248
1292
  });
1249
1293
  }
1250
1294
  }
1251
- addPluginTemplate({
1252
- filename: "vuetify-nuxt-plugin.ts",
1253
- write: false,
1254
- getContents() {
1255
- return `
1256
- import type { createVuetify } from 'vuetify'
1257
- import { configureVuetify } from 'vuetify-nuxt-module/dist/runtime/plugins/config'
1258
- import { defineNuxtPlugin } from '#imports'
1259
- import type { Plugin } from '#app'
1260
-
1261
- const dependsOn = ${JSON.stringify(dependsOn)}
1262
- ${addHttpClientHintsPlugin}
1263
-
1264
- const plugin: Plugin<{
1265
- vuetify: ReturnType<typeof createVuetify>
1266
- }> = defineNuxtPlugin({
1267
- name: 'vuetify:configuration:plugin',
1268
- order: 25,
1269
- dependsOn,
1270
- parallel: true,
1271
- async setup() {
1272
- await configureVuetify()
1273
- },
1274
- })
1275
-
1276
- export default plugin
1277
- `;
1278
- }
1279
- });
1295
+ addVuetifyNuxtPlugins(nuxt, ctx);
1280
1296
  }
1281
1297
 
1282
1298
  const CONFIG_KEY = "vuetify";
package/dist/types.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
- import type { ModuleOptions, ModuleHooks, RuntimeModuleHooks } from './module.js'
2
+ import type { ModuleOptions, ModuleHooks, ModuleRuntimeHooks } from './module.js'
3
3
 
4
4
  declare module '#app' {
5
- interface RuntimeNuxtHooks extends RuntimeModuleHooks {}
5
+ interface RuntimeNuxtHooks extends ModuleRuntimeHooks {}
6
6
  }
7
7
 
8
8
  declare module '@nuxt/schema' {
@@ -18,4 +18,4 @@ declare module 'nuxt/schema' {
18
18
  }
19
19
 
20
20
 
21
- export type { ComponentName, Components, DateAdapter, DateOptions, DirectiveName, Directives, ExternalVuetifyOptions, FontAwesomeSvgIconSet, FontIconSet, IconFontName, IconSetName, IconsOptions, InlineModuleOptions, JSSVGIconSet, LabComponentName, LabComponents, MOptions, ModuleHooks, ModuleOptions, RuntimeModuleHooks, SSRClientHints, SSRClientHintsConfiguration, UnoCCSMdiIconSet, VOptions, VuetifyLocale, VuetifyModuleOptions, default } from './module.js'
21
+ export type { ComponentName, Components, DateAdapter, DateOptions, DirectiveName, Directives, ExternalVuetifyOptions, FontAwesomeSvgIconSet, FontIconSet, IconFontName, IconSetName, IconsOptions, InlineModuleOptions, JSSVGIconSet, LabComponentName, LabComponents, MOptions, ModuleHooks, ModuleOptions, ModuleRuntimeHooks, SSRClientHints, SSRClientHintsConfiguration, UnoCCSMdiIconSet, VOptions, VuetifyLocale, VuetifyModuleOptions, default } from './module.js'
package/dist/types.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
- import type { ModuleOptions, ModuleHooks, RuntimeModuleHooks } from './module'
2
+ import type { ModuleOptions, ModuleHooks, ModuleRuntimeHooks } from './module'
3
3
 
4
4
  declare module '#app' {
5
- interface RuntimeNuxtHooks extends RuntimeModuleHooks {}
5
+ interface RuntimeNuxtHooks extends ModuleRuntimeHooks {}
6
6
  }
7
7
 
8
8
  declare module '@nuxt/schema' {
@@ -18,4 +18,4 @@ declare module 'nuxt/schema' {
18
18
  }
19
19
 
20
20
 
21
- export type { ComponentName, Components, DateAdapter, DateOptions, DirectiveName, Directives, ExternalVuetifyOptions, FontAwesomeSvgIconSet, FontIconSet, IconFontName, IconSetName, IconsOptions, InlineModuleOptions, JSSVGIconSet, LabComponentName, LabComponents, MOptions, ModuleHooks, ModuleOptions, RuntimeModuleHooks, SSRClientHints, SSRClientHintsConfiguration, UnoCCSMdiIconSet, VOptions, VuetifyLocale, VuetifyModuleOptions, default } from './module'
21
+ export type { ComponentName, Components, DateAdapter, DateOptions, DirectiveName, Directives, ExternalVuetifyOptions, FontAwesomeSvgIconSet, FontIconSet, IconFontName, IconSetName, IconsOptions, InlineModuleOptions, JSSVGIconSet, LabComponentName, LabComponents, MOptions, ModuleHooks, ModuleOptions, ModuleRuntimeHooks, SSRClientHints, SSRClientHintsConfiguration, UnoCCSMdiIconSet, VOptions, VuetifyLocale, VuetifyModuleOptions, default } from './module'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vuetify-nuxt-module",
3
3
  "type": "module",
4
- "version": "0.10.0",
4
+ "version": "0.10.2",
5
5
  "packageManager": "pnpm@8.14.1",
6
6
  "description": "Zero-Config Nuxt Module for Vuetify",
7
7
  "author": "userquin <userquin@gmail.com>",
@@ -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
+ }
@@ -1 +0,0 @@
1
- export declare function configureVuetify(): Promise<void>;
@@ -1,16 +0,0 @@
1
- import { createVuetify } from "vuetify";
2
- import { isDev, vuetifyConfiguration } from "virtual:vuetify-configuration";
3
- import { useNuxtApp } from "#imports";
4
- export async function configureVuetify() {
5
- const nuxtApp = useNuxtApp();
6
- const vuetifyOptions = vuetifyConfiguration();
7
- await nuxtApp.hooks.callHook("vuetify:configuration", { isDev, vuetifyOptions });
8
- await nuxtApp.hooks.callHook("vuetify:before-create", { isDev, vuetifyOptions });
9
- const vuetify = createVuetify(vuetifyOptions);
10
- nuxtApp.vueApp.use(vuetify);
11
- nuxtApp.provide("vuetify", vuetify);
12
- await nuxtApp.hooks.callHook("vuetify:ready", vuetify);
13
- if (process.client) {
14
- isDev && console.log("Vuetify 3 initialized", vuetify);
15
- }
16
- }