vuetify-nuxt-module 0.6.6 → 0.7.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/README.md CHANGED
@@ -28,12 +28,12 @@
28
28
 
29
29
  - 📖 [**Documentation & guides**](https://vuetify-nuxt-module.netlify.app/)
30
30
  - 👌 **Zero-Config**: sensible built-in default [Vuetify](https://vuetifyjs.com/) configuration for common use cases
31
- - 🔌 **Extensible**: expose the ability to customize the Vuetify configuration via [Nuxt Plugin Hooks](https://nuxt.com/docs/guide/going-further/hooks#usage-with-plugins)
31
+ - 🔌 **Extensible**: expose the ability to customize the Vuetify configuration via [Nuxt Runtime Hooks](https://nuxt.com/docs/guide/going-further/hooks#usage-with-plugins)
32
32
  - ⚡ **Fully Tree Shakable**: by default, only the needed Vuetify components are imported
33
33
  - 🛠️ **Versatile**: custom Vuetify [directives](https://vuetifyjs.com/en/getting-started/installation/#manual-steps) and [labs components](https://vuetifyjs.com/en/labs/introduction/) registration
34
34
  - ✨ **Configurable Styles**: configure your variables using [Vuetify SASS Variables](https://vuetifyjs.com/en/features/sass-variables/)
35
35
  - 💥 **SSR**: automatic SSR detection and configuration including [HTTP Client hints](https://developer.mozilla.org/en-US/docs/Web/HTTP/Client_hints)
36
- - 🔩 **Nuxt Layers and Hooks**: load your Vuetify configuration using [Nuxt Layers](https://nuxt.com/docs/getting-started/layers#layers) or using a custom module via `vuetify:registerModule` [Nuxt Hook](https://nuxt.com/docs/guide/going-further/hooks#nuxt-hooks-build-time)
36
+ - 🔩 **Nuxt Layers and Module Hooks**: load your Vuetify configuration using [Nuxt Layers](https://nuxt.com/docs/getting-started/layers#layers) or using a custom module via `vuetify:registerModule` [Nuxt Module Hook](https://nuxt.com/docs/guide/going-further/hooks#nuxt-hooks-build-time)
37
37
  - 📥 **Vuetify Configuration File**: configure your Vuetify options using a custom `vuetify.config` file, no dev server restart needed
38
38
  - 🔥 **Pure CSS Icons**: no more font/js icons, use the new `unocss-mdi` icon set or build your own with UnoCSS Preset Icons
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
@@ -1,3 +1,3 @@
1
- import { ExternalVuetifyOptions } from './dist/types';
1
+ import type { ExternalVuetifyOptions } from './dist/module'
2
2
  declare function defineVuetifyConfiguration(vuetifyOptions: ExternalVuetifyOptions): ExternalVuetifyOptions;
3
3
  export { defineVuetifyConfiguration };
@@ -0,0 +1,446 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+ import { HookResult } from '@nuxt/schema';
3
+ import { VuetifyOptions, LocaleOptions, RtlOptions, createVuetify } from 'vuetify';
4
+ import * as vuetify_locale from 'vuetify/locale';
5
+ import * as vuetify_labs_components from 'vuetify/labs/components';
6
+ import * as vuetify_directives from 'vuetify/directives';
7
+ import * as vuetify_components from 'vuetify/components';
8
+
9
+ type DateAdapter = 'vuetify' | 'date-fns' | 'moment' | 'luxon' | 'dayjs' | 'js-joda' | 'date-fns-jalali' | 'jalaali' | 'hijri' | 'custom';
10
+ /**
11
+ * Date configuration.
12
+ */
13
+ interface DateOptions {
14
+ /**
15
+ * The date adapter.
16
+ *
17
+ * The adapter will be picked from the dependencies.
18
+ * When multiple `@date-io/xxxx` libraries installed in your project,
19
+ * you should specify the adapter otherwise an error will be thrown.
20
+ *
21
+ * If you want to use a custom adapter, configure `adapter: 'custom'`,
22
+ * and then add a Nuxt plugin to configure the adapter using `vuetify:configuration` hook.
23
+ *
24
+ * @default 'vuetify'
25
+ */
26
+ adapter?: DateAdapter;
27
+ /**
28
+ * Formats.
29
+ */
30
+ formats?: Record<string, string>;
31
+ /**
32
+ * Locales.
33
+ *
34
+ * When `@nuxtjs/i18n` Nuxt module is present, this option will be ignored, locales will be extracted from the available locales.
35
+ */
36
+ locale?: Record<string, any>;
37
+ }
38
+ type IconSetName = 'mdi' | 'fa' | 'fa4' | 'md' | 'mdi-svg' | 'fa-svg' | 'unocss-mdi' | 'custom';
39
+ type IconFontName = 'unocss-mdi' | 'mdi' | 'fa' | 'fa4' | 'md';
40
+ interface JSSVGIconSet {
41
+ aliases?: Record<string, string>;
42
+ }
43
+ interface FontAwesomeSvgIconSet {
44
+ /**
45
+ * The libraries to import and register with the corresponding name.
46
+ *
47
+ * For example, to import free svg icons, `libraries` should be (the default):
48
+ * `libraries: [[false, 'fas', '@fortawesome/free-solid-svg-icons']]
49
+ *
50
+ * Following with the example, the resulting import will be:
51
+ * `import { fas } from '@fortawesome/free-solid-svg-icons'`
52
+ *
53
+ * @default [[false, 'fas', '@fortawesome/free-solid-svg-icons']]
54
+ */
55
+ libraries?: [defaultExport: boolean, name: string, library: string][];
56
+ }
57
+ interface FontIconSet {
58
+ name: IconFontName;
59
+ /**
60
+ * Use CDN?
61
+ *
62
+ * - mdi: https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons
63
+ * - md: https://fonts.googleapis.com/css?family=Material+Icons
64
+ * - fa: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@latest/css/all.min.css
65
+ * - fa4: https://cdn.jsdelivr.net/npm/font-awesome@4.x/css/font-awesome.min.css
66
+ *
67
+ * @default the corresponding CDN for the icon set
68
+ */
69
+ cdn?: string;
70
+ }
71
+ interface UnoCCSMdiIconSet {
72
+ collapse?: string;
73
+ complete?: string;
74
+ cancel?: string;
75
+ close?: string;
76
+ delete?: string;
77
+ clear?: string;
78
+ success?: string;
79
+ info?: string;
80
+ warning?: string;
81
+ error?: string;
82
+ prev?: string;
83
+ next?: string;
84
+ checkboxOn?: string;
85
+ checkboxOff?: string;
86
+ checkboxIndeterminate?: string;
87
+ delimiter?: string;
88
+ sortAsc?: string;
89
+ sortDesc?: string;
90
+ expand?: string;
91
+ menu?: string;
92
+ subgroup?: string;
93
+ dropdown?: string;
94
+ radioOn?: string;
95
+ radioOff?: string;
96
+ edit?: string;
97
+ ratingEmpty?: string;
98
+ ratingFull?: string;
99
+ ratingHalf?: string;
100
+ loading?: string;
101
+ first?: string;
102
+ last?: string;
103
+ unfold?: string;
104
+ file?: string;
105
+ plus?: string;
106
+ minus?: string;
107
+ calendar?: string;
108
+ }
109
+ interface IconsOptions {
110
+ /**
111
+ * @default 'mdi'
112
+ */
113
+ defaultSet: IconSetName;
114
+ /**
115
+ * The prefix for UnoCSS Preset Icons.
116
+ *
117
+ * @default 'i-'
118
+ */
119
+ unocssIconPrefix?: string;
120
+ /**
121
+ * Override the default mdi icons.
122
+ *
123
+ * Icon names should include the prefix and the collection, for example:
124
+ * - home: i-<collection>:<icon>
125
+ */
126
+ unocssIcons?: UnoCCSMdiIconSet;
127
+ unocssAdditionalIcons?: Record<string, string>;
128
+ sets?: IconFontName | IconFontName[] | FontIconSet[];
129
+ svg?: {
130
+ mdi?: JSSVGIconSet;
131
+ fa?: FontAwesomeSvgIconSet;
132
+ };
133
+ }
134
+ type ComponentName = keyof typeof vuetify_components;
135
+ type Components = false | ComponentName | ComponentName[];
136
+ type DirectiveName = keyof typeof vuetify_directives;
137
+ type Directives = boolean | DirectiveName | DirectiveName[];
138
+ type LabComponentName = keyof typeof vuetify_labs_components;
139
+ type LabComponents = boolean | LabComponentName | LabComponentName[];
140
+ type VuetifyLocale = keyof typeof vuetify_locale;
141
+ interface VOptions extends Partial<Omit<VuetifyOptions, 'ssr' | 'aliases' | 'components' | 'directives' | 'locale' | 'date' | 'icons'>> {
142
+ /**
143
+ * Configure the SSR options.
144
+ *
145
+ * This option is only used when SSR is enabled in your Nuxt configuration.
146
+ */
147
+ ssr?: {
148
+ clientWidth: number;
149
+ clientHeight?: number;
150
+ };
151
+ aliases?: Record<string, ComponentName>;
152
+ /**
153
+ * Do you need to configure some global components?.
154
+ *
155
+ * @default false
156
+ */
157
+ components?: Components;
158
+ /**
159
+ * Configure the locale messages, the locale, the fallback locale and RTL options.
160
+ *
161
+ * When `@nuxtjs/i18n` Nuxt module is present, the following options will be ignored:
162
+ * - `locale`
163
+ * - `fallback`
164
+ * - `rtl`
165
+ * - `messages`
166
+ *
167
+ * The adapter will be `vuetify`, if you want to use another adapter, check `date` option.
168
+ */
169
+ locale?: Omit<LocaleOptions, 'adapter'> & RtlOptions;
170
+ /**
171
+ * Include locale messages?
172
+ *
173
+ * When `@nuxtjs/i18n` Nuxt module is present, this option will be ignored.
174
+ *
175
+ * You can include the locales you want to use in your application, this module will load and configure the messages for you.
176
+ */
177
+ localeMessages?: VuetifyLocale | VuetifyLocale[];
178
+ /**
179
+ * Include the lab components?
180
+ *
181
+ * You can include all lab components configuring `labComponents: true`.
182
+ *
183
+ * You can provide an array with the names of the lab components to include.
184
+ *
185
+ * @see https://vuetifyjs.com/en/labs/introduction/
186
+ *
187
+ * @default false
188
+ */
189
+ labComponents?: LabComponents;
190
+ /**
191
+ * Include the directives?
192
+ *
193
+ * You can include all directives configuring `directives: true`.
194
+ *
195
+ * You can provide an array with the names of the directives to include.
196
+ *
197
+ * @default false
198
+ */
199
+ directives?: Directives;
200
+ /**
201
+ * Date configuration.
202
+ *
203
+ * When this option is configured, the `v-date-picker` lab component will be included.
204
+ *
205
+ * @see https://vuetifyjs.com/features/dates/
206
+ * @see https://vuetifyjs.com/components/date-pickers/
207
+ */
208
+ date?: DateOptions;
209
+ /**
210
+ * Include the icons?
211
+ *
212
+ * By default, `mdi` icons will be used via cdn: https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css.
213
+ *
214
+ * @see https://vuetifyjs.com/en/features/icon-fonts/
215
+ */
216
+ icons?: false | IconsOptions;
217
+ }
218
+ interface MOptions {
219
+ /**
220
+ * @default true
221
+ */
222
+ importComposables?: boolean;
223
+ /**
224
+ * If you are using another composables that collide with the Vuetify ones,
225
+ * enable this flag to prefix them with `V`:
226
+ * - `useLocale` -> `useVLocale`
227
+ * - `useDefaults` -> `useVDefaults`
228
+ * - `useDisplay` -> `useVDisplay`
229
+ * - `useLayout` -> `useVLayout`
230
+ * - `useRtl` -> `useVRtl`
231
+ * - `useTheme` -> `useVTheme`
232
+ *
233
+ * @default false
234
+ */
235
+ prefixComposables?: boolean;
236
+ /**
237
+ * Vuetify styles.
238
+ *
239
+ * If you want to use configFile on SSR, you have to disable `experimental.inlineSSRStyles` in nuxt.config.
240
+ *
241
+ * @see https://github.com/vuetifyjs/vuetify-loader/tree/master/packages/vite-plugin
242
+ * @see https://github.com/userquin/vuetify-nuxt-module/issues/78 and https://github.com/userquin/vuetify-nuxt-module/issues/74
243
+ */
244
+ styles?: true | 'none' | 'expose' | 'sass' | {
245
+ configFile: string;
246
+ };
247
+ /**
248
+ * Add Vuetify Vite Plugin `transformAssetsUrls`?
249
+ *
250
+ * @default true
251
+ */
252
+ includeTransformAssetsUrls?: boolean | Record<string, string[]>;
253
+ /**
254
+ * Vuetify SSR client hints.
255
+ *
256
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Client_hints
257
+ */
258
+ ssrClientHints?: {
259
+ /**
260
+ * Should the module reload the page on first request?
261
+ *
262
+ * @default false
263
+ */
264
+ reloadOnFirstRequest?: boolean;
265
+ /**
266
+ * Enable `Sec-CH-Viewport-Width` and `Sec-CH-Viewport-Height` headers?
267
+ *
268
+ * @see https://wicg.github.io/responsive-image-client-hints/#sec-ch-viewport-width
269
+ * @see https://wicg.github.io/responsive-image-client-hints/#sec-ch-viewport-height
270
+ *
271
+ * @default false
272
+ */
273
+ viewportSize?: boolean;
274
+ /**
275
+ * Enable `Sec-CH-Prefers-Color-Scheme` header?
276
+ *
277
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Color-Scheme
278
+ *
279
+ * @default false
280
+ */
281
+ prefersColorScheme?: boolean;
282
+ /**
283
+ * The options for `prefersColorScheme`, `prefersColorScheme` must be enabled.
284
+ *
285
+ * If you want the module to handle the color scheme for you, you should configure this option, otherwise you'll need to add your custom implementation.
286
+ */
287
+ prefersColorSchemeOptions?: {
288
+ /**
289
+ * The name for the cookie.
290
+ *
291
+ * @default 'color-scheme'
292
+ */
293
+ cookieName?: string;
294
+ /**
295
+ * The name for the dark theme.
296
+ *
297
+ * @default 'dark'
298
+ */
299
+ darkThemeName?: string;
300
+ /**
301
+ * The name for the light theme.
302
+ *
303
+ * @default 'light'
304
+ */
305
+ lightThemeName?: string;
306
+ /**
307
+ * Use the browser theme only?
308
+ *
309
+ * This flag can be used when your application provides a custom dark and light themes,
310
+ * but will not provide a theme switcher, that's, using by default the browser theme.
311
+ *
312
+ * @default false
313
+ */
314
+ useBrowserThemeOnly?: boolean;
315
+ };
316
+ /**
317
+ * Enable `Sec-CH-Prefers-Reduced-Motion` header?
318
+ *
319
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Reduced-Motion
320
+ *
321
+ * @default false
322
+ */
323
+ prefersReducedMotion?: boolean;
324
+ };
325
+ }
326
+ interface VuetifyModuleOptions {
327
+ moduleOptions?: MOptions;
328
+ /**
329
+ * Vuetify options.
330
+ *
331
+ * You can inline the configuration or specify a file path:
332
+ * `vuetifyOptions: './vuetify.options.ts'`
333
+ *
334
+ * The path should be relative to the root folder.
335
+ */
336
+ vuetifyOptions?: string | VOptions;
337
+ }
338
+ interface InlineModuleOptions extends Omit<VuetifyModuleOptions, 'vuetifyOptions'> {
339
+ vuetifyOptions: VOptions;
340
+ }
341
+ interface ExternalVuetifyOptions extends VOptions {
342
+ config?: boolean;
343
+ }
344
+ /**
345
+ * Request headers received from the client in SSR.
346
+ */
347
+ interface SSRClientHints {
348
+ /**
349
+ * Is the first request the browser hits the server?
350
+ */
351
+ firstRequest: boolean;
352
+ /**
353
+ * The browser supports prefer-color-scheme client hints?
354
+ */
355
+ prefersColorSchemeAvailable: boolean;
356
+ /**
357
+ * The browser supports prefer-reduced-motion client hints?
358
+ */
359
+ prefersReducedMotionAvailable: boolean;
360
+ /**
361
+ * The browser supports viewport-height client hints?
362
+ */
363
+ viewportHeightAvailable: boolean;
364
+ /**
365
+ * The browser supports viewport-width client hints?
366
+ */
367
+ viewportWidthAvailable: boolean;
368
+ prefersColorScheme?: 'dark' | 'light' | 'no-preference';
369
+ prefersReducedMotion?: 'no-preference' | 'reduce';
370
+ viewportHeight?: number;
371
+ viewportWidth?: number;
372
+ /**
373
+ * The theme name from the cookie.
374
+ */
375
+ colorSchemeFromCookie?: string;
376
+ colorSchemeCookie?: string;
377
+ }
378
+ interface SSRClientHintsConfiguration {
379
+ enabled: boolean;
380
+ viewportSize: boolean;
381
+ prefersColorScheme: boolean;
382
+ prefersReducedMotion: boolean;
383
+ prefersColorSchemeOptions?: {
384
+ baseUrl: string;
385
+ defaultTheme: string;
386
+ themeNames: string[];
387
+ cookieName: string;
388
+ darkThemeName: string;
389
+ lightThemeName: string;
390
+ };
391
+ }
392
+
393
+ declare const _default: _nuxt_schema.NuxtModule<VuetifyModuleOptions>;
394
+
395
+ interface ModuleOptions extends VuetifyModuleOptions {
396
+ }
397
+ interface ModuleHooks {
398
+ 'vuetify:registerModule': (registerModule: (config: InlineModuleOptions) => void) => HookResult;
399
+ }
400
+ interface RuntimeModuleHooks {
401
+ 'vuetify:configuration': (options: {
402
+ isDev: boolean;
403
+ vuetifyOptions: VuetifyOptions;
404
+ }) => HookResult;
405
+ 'vuetify:before-create': (options: {
406
+ isDev: boolean;
407
+ vuetifyOptions: VuetifyOptions;
408
+ }) => HookResult;
409
+ 'vuetify:ready': (vuetify: ReturnType<typeof createVuetify>) => HookResult;
410
+ 'vuetify:ssr-client-hints': (options: {
411
+ vuetifyOptions: VuetifyOptions;
412
+ ssrClientHints: SSRClientHints;
413
+ ssrClientHintsConfiguration: SSRClientHintsConfiguration;
414
+ }) => HookResult;
415
+ }
416
+ declare module '#app' {
417
+ interface RuntimeNuxtHooks {
418
+ 'vuetify:configuration': (options: {
419
+ isDev: boolean;
420
+ vuetifyOptions: VuetifyOptions;
421
+ }) => HookResult;
422
+ 'vuetify:before-create': (options: {
423
+ isDev: boolean;
424
+ vuetifyOptions: VuetifyOptions;
425
+ }) => HookResult;
426
+ 'vuetify:ready': (vuetify: ReturnType<typeof createVuetify>) => HookResult;
427
+ 'vuetify:ssr-client-hints': (options: {
428
+ vuetifyOptions: VuetifyOptions;
429
+ ssrClientHints: SSRClientHints;
430
+ ssrClientHintsConfiguration: SSRClientHintsConfiguration;
431
+ }) => HookResult;
432
+ }
433
+ }
434
+ declare module '@nuxt/schema' {
435
+ interface NuxtConfig {
436
+ ['vuetify']?: Partial<ModuleOptions>;
437
+ }
438
+ interface NuxtOptions {
439
+ ['vuetify']?: ModuleOptions;
440
+ }
441
+ interface NuxtHooks {
442
+ 'vuetify:registerModule': (registerModule: (config: InlineModuleOptions) => void) => HookResult;
443
+ }
444
+ }
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 };
package/dist/module.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
  import { HookResult } from '@nuxt/schema';
3
+ import { VuetifyOptions, LocaleOptions, RtlOptions, createVuetify } from 'vuetify';
3
4
  import * as vuetify_locale from 'vuetify/locale';
4
5
  import * as vuetify_labs_components from 'vuetify/labs/components';
5
6
  import * as vuetify_directives from 'vuetify/directives';
6
7
  import * as vuetify_components from 'vuetify/components';
7
- import { VuetifyOptions, createVuetify, LocaleOptions, RtlOptions } from 'vuetify';
8
8
 
9
9
  type DateAdapter = 'vuetify' | 'date-fns' | 'moment' | 'luxon' | 'dayjs' | 'js-joda' | 'date-fns-jalali' | 'jalaali' | 'hijri' | 'custom';
10
10
  /**
@@ -323,7 +323,7 @@ interface MOptions {
323
323
  prefersReducedMotion?: boolean;
324
324
  };
325
325
  }
326
- interface ModuleOptions {
326
+ interface VuetifyModuleOptions {
327
327
  moduleOptions?: MOptions;
328
328
  /**
329
329
  * Vuetify options.
@@ -335,7 +335,7 @@ interface ModuleOptions {
335
335
  */
336
336
  vuetifyOptions?: string | VOptions;
337
337
  }
338
- interface InlineModuleOptions extends Omit<ModuleOptions, 'vuetifyOptions'> {
338
+ interface InlineModuleOptions extends Omit<VuetifyModuleOptions, 'vuetifyOptions'> {
339
339
  vuetifyOptions: VOptions;
340
340
  }
341
341
  interface ExternalVuetifyOptions extends VOptions {
@@ -389,10 +389,31 @@ interface SSRClientHintsConfiguration {
389
389
  lightThemeName: string;
390
390
  };
391
391
  }
392
+
393
+ declare const _default: _nuxt_schema.NuxtModule<VuetifyModuleOptions>;
394
+
395
+ interface ModuleOptions extends VuetifyModuleOptions {
396
+ }
392
397
  interface ModuleHooks {
393
398
  'vuetify:registerModule': (registerModule: (config: InlineModuleOptions) => void) => HookResult;
394
399
  }
395
- declare module '#app/nuxt' {
400
+ interface RuntimeModuleHooks {
401
+ 'vuetify:configuration': (options: {
402
+ isDev: boolean;
403
+ vuetifyOptions: VuetifyOptions;
404
+ }) => HookResult;
405
+ 'vuetify:before-create': (options: {
406
+ isDev: boolean;
407
+ vuetifyOptions: VuetifyOptions;
408
+ }) => HookResult;
409
+ 'vuetify:ready': (vuetify: ReturnType<typeof createVuetify>) => HookResult;
410
+ 'vuetify:ssr-client-hints': (options: {
411
+ vuetifyOptions: VuetifyOptions;
412
+ ssrClientHints: SSRClientHints;
413
+ ssrClientHintsConfiguration: SSRClientHintsConfiguration;
414
+ }) => HookResult;
415
+ }
416
+ declare module '#app' {
396
417
  interface RuntimeNuxtHooks {
397
418
  'vuetify:configuration': (options: {
398
419
  isDev: boolean;
@@ -417,10 +438,9 @@ declare module '@nuxt/schema' {
417
438
  interface NuxtOptions {
418
439
  ['vuetify']?: ModuleOptions;
419
440
  }
420
- interface NuxtHooks extends ModuleHooks {
441
+ interface NuxtHooks {
442
+ 'vuetify:registerModule': (registerModule: (config: InlineModuleOptions) => void) => HookResult;
421
443
  }
422
444
  }
423
445
 
424
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
425
-
426
- export { ComponentName, Components, DateAdapter, DateOptions, DirectiveName, Directives, ExternalVuetifyOptions, FontAwesomeSvgIconSet, FontIconSet, IconFontName, IconSetName, IconsOptions, InlineModuleOptions, JSSVGIconSet, LabComponentName, LabComponents, MOptions, ModuleHooks, ModuleOptions, SSRClientHints, SSRClientHintsConfiguration, UnoCCSMdiIconSet, VOptions, VuetifyLocale, _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 RuntimeModuleHooks, type SSRClientHints, type SSRClientHintsConfiguration, type UnoCCSMdiIconSet, type VOptions, type VuetifyLocale, type VuetifyModuleOptions, _default as default };
package/dist/module.json CHANGED
@@ -2,7 +2,8 @@
2
2
  "name": "vuetify-nuxt-module",
3
3
  "configKey": "vuetify",
4
4
  "compatibility": {
5
- "nuxt": "^3.0.0"
5
+ "nuxt": "^3.6.5",
6
+ "bridge": false
6
7
  },
7
- "version": "0.6.6"
8
+ "version": "0.7.0"
8
9
  }
package/dist/module.mjs CHANGED
@@ -15,7 +15,7 @@ import { parseQuery, parseURL } from 'ufo';
15
15
  import destr from 'destr';
16
16
  import { transformAssetUrls } from 'vite-plugin-vuetify';
17
17
 
18
- const version = "0.6.6";
18
+ const version = "0.7.0";
19
19
 
20
20
  const VIRTUAL_VUETIFY_CONFIGURATION = "virtual:vuetify-configuration";
21
21
  const RESOLVED_VIRTUAL_VUETIFY_CONFIGURATION = `/@nuxt-vuetify-configuration/${VIRTUAL_VUETIFY_CONFIGURATION.slice("virtual:".length)}`;
@@ -246,7 +246,7 @@ function prepareIcons(unocssPresent, logger, vuetifyOptions) {
246
246
  sets = sets.filter((s) => s.name !== "unocss-mdi");
247
247
  }
248
248
  sets.filter((s) => cssFonts.includes(s.name)).forEach(({ name, cdn }) => {
249
- resolvedIcons.aliasesImportPresent || (resolvedIcons.aliasesImportPresent = name === defaultSet);
249
+ resolvedIcons.aliasesImportPresent ||= name === defaultSet;
250
250
  if (name === "unocss-mdi")
251
251
  return;
252
252
  resolvedIcons.imports.push(`import {${name === defaultSet ? "aliases," : ""}${name}} from 'vuetify/iconsets/${name}'`);
@@ -286,7 +286,7 @@ function prepareIcons(unocssPresent, logger, vuetifyOptions) {
286
286
  logger.warn("Missing @fortawesome/vue-fontawesome dependency, install it!");
287
287
  }
288
288
  if (faSvgExists) {
289
- resolvedIcons.aliasesImportPresent || (resolvedIcons.aliasesImportPresent = defaultSet === "fa-svg");
289
+ resolvedIcons.aliasesImportPresent ||= defaultSet === "fa-svg";
290
290
  resolvedIcons.imports.push(`import {${defaultSet === "fa-svg" ? "aliases," : ""}fa} from 'vuetify/iconsets/fa-svg'`);
291
291
  resolvedIcons.imports.push("import { library } from '@fortawesome/fontawesome-svg-core'");
292
292
  resolvedIcons.imports.push("import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'");
@@ -308,7 +308,7 @@ function prepareIcons(unocssPresent, logger, vuetifyOptions) {
308
308
  const mdiSvgExists = isPackageExists("@mdi/js");
309
309
  if (mdiSvgExists) {
310
310
  resolvedIcons.svg.mdi = true;
311
- resolvedIcons.aliasesImportPresent || (resolvedIcons.aliasesImportPresent = defaultSet === "mdi-svg");
311
+ resolvedIcons.aliasesImportPresent ||= defaultSet === "mdi-svg";
312
312
  resolvedIcons.imports.push(`import {${defaultSet === "mdi-svg" ? "aliases," : ""}mdi} from 'vuetify/iconsets/mdi-svg'`);
313
313
  if (mdiSvg && mdiSvg.aliases) {
314
314
  resolvedIcons.imports.push(`import {${Object.values(mdiSvg.aliases).join(",")}} from '@mdi/js'`);
@@ -398,7 +398,6 @@ function prepareSSRClientHints(baseUrl, ctx) {
398
398
  }
399
399
 
400
400
  async function load(options, nuxt, ctx) {
401
- var _a;
402
401
  const {
403
402
  configuration,
404
403
  vuetifyConfigurationFilesToWatch
@@ -452,7 +451,7 @@ async function load(options, nuxt, ctx) {
452
451
  if (ctx.icons.enabled) {
453
452
  ctx.icons.local?.forEach((css) => nuxt.options.css.push(css));
454
453
  if (ctx.icons.cdn?.length) {
455
- (_a = nuxt.options.app.head).link ?? (_a.link = []);
454
+ nuxt.options.app.head.link ??= [];
456
455
  ctx.icons.cdn.forEach(([key, href]) => nuxt.options.app.head.link.push({
457
456
  key,
458
457
  rel: "stylesheet",
@@ -1249,7 +1248,7 @@ function configureVite(configKey, nuxt, ctx) {
1249
1248
  checkVuetifyPlugins(viteInlineConfig);
1250
1249
  viteInlineConfig.optimizeDeps = defu(viteInlineConfig.optimizeDeps, { exclude: ["vuetify"] });
1251
1250
  if (nuxt.options.ssr) {
1252
- viteInlineConfig.ssr || (viteInlineConfig.ssr = {});
1251
+ viteInlineConfig.ssr ||= {};
1253
1252
  viteInlineConfig.ssr.noExternal = [
1254
1253
  ...Array.isArray(viteInlineConfig.ssr.noExternal) ? viteInlineConfig.ssr.noExternal : viteInlineConfig.ssr.noExternal && typeof viteInlineConfig.ssr.noExternal !== "boolean" ? [viteInlineConfig.ssr.noExternal] : [],
1255
1254
  configKey
@@ -1266,7 +1265,6 @@ function configureVite(configKey, nuxt, ctx) {
1266
1265
  }
1267
1266
 
1268
1267
  function configureNuxt(configKey, nuxt, ctx) {
1269
- var _a, _b, _c;
1270
1268
  const {
1271
1269
  importComposables,
1272
1270
  prefixComposables,
@@ -1278,7 +1276,7 @@ function configureNuxt(configKey, nuxt, ctx) {
1278
1276
  nuxt.options.build.transpile.push(configKey);
1279
1277
  nuxt.options.build.transpile.push(runtimeDir);
1280
1278
  }
1281
- (_a = nuxt.options).css ?? (_a.css = []);
1279
+ nuxt.options.css ??= [];
1282
1280
  if (typeof styles === "string" && ["sass", "expose"].includes(styles))
1283
1281
  nuxt.options.css.unshift("vuetify/styles/main.sass");
1284
1282
  else if (styles === true)
@@ -1286,8 +1284,8 @@ function configureNuxt(configKey, nuxt, ctx) {
1286
1284
  else if (typeof styles === "object" && typeof styles?.configFile === "string")
1287
1285
  nuxt.options.css.unshift(styles.configFile);
1288
1286
  if (includeTransformAssetsUrls && typeof nuxt.options.vite.vue?.template?.transformAssetUrls === "undefined") {
1289
- (_b = nuxt.options.vite).vue ?? (_b.vue = {});
1290
- (_c = nuxt.options.vite.vue).template ?? (_c.template = {});
1287
+ nuxt.options.vite.vue ??= {};
1288
+ nuxt.options.vite.vue.template ??= {};
1291
1289
  nuxt.options.vite.vue.template.transformAssetUrls = normalizeTransformAssetUrls(
1292
1290
  typeof includeTransformAssetsUrls === "object" ? defu(includeTransformAssetsUrls, transformAssetUrls) : transformAssetUrls
1293
1291
  );
@@ -1299,12 +1297,14 @@ function configureNuxt(configKey, nuxt, ctx) {
1299
1297
  references.push({ types: "vuetify" });
1300
1298
  references.push({ types: "vuetify-nuxt-module/custom-configuration" });
1301
1299
  references.push({ types: "vuetify-nuxt-module/configuration" });
1300
+ const types = ctx.resolver.resolve(runtimeDir, "plugins/types");
1301
+ references.push({ path: ctx.resolver.resolve(nuxt.options.buildDir, types) });
1302
1302
  });
1303
1303
  if (importComposables) {
1304
- const composables = ["useLocale", "useDefaults", "useDisplay", "useLayout", "useRtl", "useTheme"];
1304
+ const composables = ["useDate", "useLocale", "useDefaults", "useDisplay", "useLayout", "useRtl", "useTheme"];
1305
1305
  addImports(composables.map((name) => ({
1306
1306
  name,
1307
- from: "vuetify",
1307
+ from: ctx.vuetify3_4 || name !== "useDate" ? "vuetify" : "vuetify/labs/date",
1308
1308
  as: prefixComposables ? name.replace(/^use/, "useV") : void 0,
1309
1309
  meta: { docsUrl: `https://vuetifyjs.com/en/api/${toKebabCase(name)}/` }
1310
1310
  })));
@@ -1347,7 +1347,10 @@ const module = defineNuxtModule({
1347
1347
  meta: {
1348
1348
  name: "vuetify-nuxt-module",
1349
1349
  configKey: "vuetify",
1350
- compatibility: { nuxt: "^3.0.0" },
1350
+ compatibility: {
1351
+ nuxt: "^3.6.5",
1352
+ bridge: false
1353
+ },
1351
1354
  version
1352
1355
  },
1353
1356
  // Default configuration options of the Nuxt module
@@ -1366,7 +1369,7 @@ const module = defineNuxtModule({
1366
1369
  logger.error(`Cannot support nuxt version: ${getNuxtVersion(nuxt)}`);
1367
1370
  const vuetifyPkg = await getPackageInfo("vuetify");
1368
1371
  const versions = vuetifyPkg?.version?.split(".").map((v) => Number.parseInt(v));
1369
- const vuetify3_4 = versions && versions.length > 1 && versions[0] >= 3 && versions[1] >= 4;
1372
+ const vuetify3_4 = versions && versions.length > 1 && (versions[0] > 3 || versions[0] === 3 && versions[1] >= 4);
1370
1373
  const ctx = {
1371
1374
  logger,
1372
1375
  resolver: createResolver(import.meta.url),
@@ -1,16 +1 @@
1
- export interface ClientHintRequestFeatures {
2
- firstRequest: boolean;
3
- prefersColorSchemeAvailable: boolean;
4
- prefersReducedMotionAvailable: boolean;
5
- viewportHeightAvailable: boolean;
6
- viewportWidthAvailable: boolean;
7
- }
8
- export interface SSRClientHints extends ClientHintRequestFeatures {
9
- prefersColorScheme?: 'dark' | 'light' | 'no-preference';
10
- prefersReducedMotion?: 'no-preference' | 'reduce';
11
- viewportHeight?: number;
12
- viewportWidth?: number;
13
- colorSchemeFromCookie?: string;
14
- colorSchemeCookie?: string;
15
- }
16
1
  export declare const VuetifyHTTPClientHints = "vuetify:nuxt:ssr-client-hints";
@@ -0,0 +1,27 @@
1
+ import type { UnwrapNestedRefs } from 'vue'
2
+ import type { createVuetify } from 'vuetify'
3
+
4
+ export interface ClientHintRequestFeatures {
5
+ firstRequest: boolean
6
+ prefersColorSchemeAvailable: boolean
7
+ prefersReducedMotionAvailable: boolean
8
+ viewportHeightAvailable: boolean
9
+ viewportWidthAvailable: boolean
10
+ }
11
+ export interface SSRClientHints extends ClientHintRequestFeatures {
12
+ prefersColorScheme?: 'dark' | 'light' | 'no-preference'
13
+ prefersReducedMotion?: 'no-preference' | 'reduce'
14
+ viewportHeight?: number
15
+ viewportWidth?: number
16
+ colorSchemeFromCookie?: string
17
+ colorSchemeCookie?: string
18
+ }
19
+
20
+ declare module '#app' {
21
+ interface NuxtApp {
22
+ $vuetify: ReturnType<typeof createVuetify>
23
+ $ssrClientHints: UnwrapNestedRefs<SSRClientHints>
24
+ }
25
+ }
26
+
27
+ export {}
@@ -1,6 +1,6 @@
1
1
  import type { UnwrapNestedRefs } from 'vue';
2
- import type { SSRClientHints } from './client-hints';
3
- import type { Plugin } from '#app/nuxt';
2
+ import type { SSRClientHints } from './types';
3
+ import type { Plugin } from '#app';
4
4
  declare const plugin: Plugin<{
5
5
  ssrClientHints: UnwrapNestedRefs<SSRClientHints>;
6
6
  }>;
@@ -1,6 +1,6 @@
1
1
  import type { UnwrapNestedRefs } from 'vue';
2
- import type { SSRClientHints } from './client-hints';
3
- import type { Plugin } from '#app/nuxt';
2
+ import type { SSRClientHints } from './types';
3
+ import type { Plugin } from '#app';
4
4
  declare const plugin: Plugin<{
5
5
  ssrClientHints: UnwrapNestedRefs<SSRClientHints>;
6
6
  }>;
@@ -1,6 +1,6 @@
1
1
  import type { UnwrapNestedRefs } from 'vue';
2
- import type { SSRClientHints } from './client-hints';
3
- import type { Plugin } from '#app/nuxt';
2
+ import type { SSRClientHints } from './types';
3
+ import type { Plugin } from '#app';
4
4
  declare const plugin: Plugin<{
5
5
  ssrClientHints: UnwrapNestedRefs<SSRClientHints>;
6
6
  }>;
@@ -1,5 +1,5 @@
1
1
  import type { createVuetify } from 'vuetify';
2
- import type { Plugin } from '#app/nuxt';
2
+ import type { Plugin } from '#app';
3
3
  declare const plugin: Plugin<{
4
4
  vuetify: ReturnType<typeof createVuetify>;
5
5
  }>;
@@ -1,5 +1,5 @@
1
1
  import type { createVuetify } from 'vuetify';
2
- import type { Plugin } from '#app/nuxt';
2
+ import type { Plugin } from '#app';
3
3
  declare const plugin: Plugin<{
4
4
  vuetify: ReturnType<typeof createVuetify>;
5
5
  }>;
@@ -0,0 +1,21 @@
1
+
2
+ import type { ModuleOptions, ModuleHooks, RuntimeModuleHooks } from './module'
3
+
4
+ declare module '#app' {
5
+ interface RuntimeNuxtHooks extends RuntimeModuleHooks {}
6
+ }
7
+
8
+ declare module '@nuxt/schema' {
9
+ interface NuxtConfig { ['vuetify']?: Partial<ModuleOptions> }
10
+ interface NuxtOptions { ['vuetify']?: ModuleOptions }
11
+ interface NuxtHooks extends ModuleHooks {}
12
+ }
13
+
14
+ declare module 'nuxt/schema' {
15
+ interface NuxtConfig { ['vuetify']?: Partial<ModuleOptions> }
16
+ interface NuxtOptions { ['vuetify']?: ModuleOptions }
17
+ interface NuxtHooks extends ModuleHooks {}
18
+ }
19
+
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'
package/dist/types.d.ts CHANGED
@@ -1,5 +1,9 @@
1
1
 
2
- import { ModuleOptions, ModuleHooks } from './module'
2
+ import type { ModuleOptions, ModuleHooks, RuntimeModuleHooks } from './module'
3
+
4
+ declare module '#app' {
5
+ interface RuntimeNuxtHooks extends RuntimeModuleHooks {}
6
+ }
3
7
 
4
8
  declare module '@nuxt/schema' {
5
9
  interface NuxtConfig { ['vuetify']?: Partial<ModuleOptions> }
@@ -14,4 +18,4 @@ declare module 'nuxt/schema' {
14
18
  }
15
19
 
16
20
 
17
- export { ComponentName, Components, DateAdapter, DateOptions, DirectiveName, Directives, ExternalVuetifyOptions, FontAwesomeSvgIconSet, FontIconSet, IconFontName, IconSetName, IconsOptions, InlineModuleOptions, JSSVGIconSet, LabComponentName, LabComponents, MOptions, ModuleHooks, ModuleOptions, SSRClientHints, SSRClientHintsConfiguration, UnoCCSMdiIconSet, VOptions, VuetifyLocale, 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, RuntimeModuleHooks, SSRClientHints, SSRClientHintsConfiguration, UnoCCSMdiIconSet, VOptions, VuetifyLocale, VuetifyModuleOptions, default } from './module'
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "vuetify-nuxt-module",
3
3
  "type": "module",
4
- "version": "0.6.6",
5
- "packageManager": "pnpm@8.10.2",
4
+ "version": "0.7.0",
5
+ "packageManager": "pnpm@8.10.5",
6
6
  "description": "Zero-Config Nuxt Module for Vuetify",
7
7
  "author": "userquin <userquin@gmail.com>",
8
8
  "license": "MIT",
@@ -21,18 +21,17 @@
21
21
  ],
22
22
  "exports": {
23
23
  ".": {
24
- "types": "./dist/types.d.ts",
25
- "require": "./dist/module.cjs",
26
- "import": "./dist/module.mjs"
24
+ "types": "./dist/types.d.mts",
25
+ "default": "./dist/module.mjs"
27
26
  },
28
27
  "./custom-configuration": {
29
28
  "types": "./custom-configuration.d.ts",
30
- "require": "./custom-configuration.cjs",
31
- "import": "./custom-configuration.mjs"
29
+ "default": "./custom-configuration.mjs"
32
30
  },
33
31
  "./configuration": {
34
32
  "types": "./configuration.d.ts"
35
- }
33
+ },
34
+ "./*": "./*"
36
35
  },
37
36
  "main": "./dist/module.cjs",
38
37
  "types": "./dist/types.d.ts",
@@ -43,7 +42,7 @@
43
42
  "*.mjs"
44
43
  ],
45
44
  "scripts": {
46
- "prepack": "nuxt-module-build prepare && nuxt-module-build",
45
+ "prepack": "nuxt-module-build prepare && nuxt-module-build build",
47
46
  "dev": "nuxi dev playground",
48
47
  "dev:multiple-json": "MULTIPLE_LANG_FILES=true nuxi dev playground",
49
48
  "dev:prepare": "nuxt-module-build --stub && nuxt-module-build prepare && nuxi prepare playground",
@@ -58,48 +57,52 @@
58
57
  "docs:serve": "pnpm -C docs run serve",
59
58
  "lint": "eslint .",
60
59
  "lint:fix": "nr lint --fix",
60
+ "publint": "publint",
61
61
  "test": "vitest run",
62
62
  "test:watch": "vitest watch",
63
63
  "release": "bumpp && npm publish"
64
64
  },
65
65
  "dependencies": {
66
- "@nuxt/kit": "^3.6.2",
67
- "defu": "^6.1.2",
66
+ "@nuxt/kit": "^3.8.2",
67
+ "defu": "^6.1.3",
68
68
  "destr": "^2.0.2",
69
69
  "local-pkg": "^0.5.0",
70
70
  "pathe": "^1.1.1",
71
71
  "perfect-debounce": "^1.0.0",
72
72
  "ufo": "^1.3.1",
73
- "unconfig": "^0.3.9",
73
+ "unconfig": "^0.3.11",
74
74
  "vite-plugin-vuetify": "^1.0.2",
75
- "vuetify": "^3.3.23"
75
+ "vuetify": "^3.4.3"
76
76
  },
77
77
  "devDependencies": {
78
- "@antfu/eslint-config": "^0.41.0",
79
- "@antfu/ni": "^0.21.8",
78
+ "@antfu/eslint-config": "^0.43.1",
79
+ "@antfu/ni": "^0.21.10",
80
80
  "@date-io/luxon": "^2.17.0",
81
- "@fortawesome/fontawesome-svg-core": "^6.4.0",
82
- "@fortawesome/free-solid-svg-icons": "^6.4.0",
83
- "@fortawesome/vue-fontawesome": "^3.0.3",
81
+ "@fortawesome/fontawesome-svg-core": "^6.4.2",
82
+ "@fortawesome/free-solid-svg-icons": "^6.4.2",
83
+ "@fortawesome/vue-fontawesome": "^3.0.5",
84
84
  "@iconify-json/carbon": "^1.1.21",
85
- "@iconify-json/mdi": "^1.1.54",
86
- "@mdi/js": "^7.2.96",
87
- "@nuxt/devtools": "^0.7.0",
88
- "@nuxt/module-builder": "^0.4.0",
89
- "@nuxt/schema": "^3.6.5",
90
- "@nuxt/test-utils": "^3.6.5",
91
- "@nuxtjs/i18n": "8.0.0-rc.5",
92
- "@parcel/watcher": "^2.2.0",
85
+ "@iconify-json/mdi": "^1.1.55",
86
+ "@mdi/js": "^7.3.67",
87
+ "@nuxt/devtools": "^0.8.5",
88
+ "@nuxt/module-builder": "^0.5.4",
89
+ "@nuxt/schema": "^3.8.2",
90
+ "@nuxt/test-utils": "^3.8.1",
91
+ "@nuxtjs/i18n": "npm:@nuxtjs/i18n-edge",
92
+ "@parcel/watcher": "^2.3.0",
93
93
  "@types/node": "^18",
94
- "@unocss/nuxt": "^0.53.6",
94
+ "@unocss/nuxt": "^0.57.7",
95
95
  "bumpp": "^9.2.0",
96
- "eslint": "^8.49.0",
97
- "luxon": "^3.3.0",
98
- "nuxt": "^3.6.5",
96
+ "eslint": "^8.54.0",
97
+ "luxon": "^3.4.3",
98
+ "nuxt": "^3.8.2",
99
+ "publint": "^0.2.5",
100
+ "rimraf": "^5.0.5",
99
101
  "sass": "^1.63.6",
100
- "typescript": "^5.2.2",
101
- "vite": "^4.3.9",
102
- "vitest": "^0.31.4"
102
+ "typescript": "^5.3.2",
103
+ "vite": "^4.5.0",
104
+ "vitest": "^0.34.6",
105
+ "vue-tsc": "^1.8.22"
103
106
  },
104
107
  "build": {
105
108
  "externals": [