vuetify-nuxt-module 0.4.10 β 0.4.12
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 +100 -99
- package/dist/module.d.ts +9 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +9 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,99 +1,100 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/userquin/vuetify-nuxt-module/raw/main/hero-dark.svg" />
|
|
4
|
-
<img alt="vuetify-nuxt-module - Zero-config Nuxt module for Vuetify" src='https://github.com/userquin/vuetify-nuxt-module/raw/main/hero.svg' alt="vuetify-nuxt-module - Zero-config Nuxt module for Vuetify"><br>
|
|
5
|
-
</picture>
|
|
6
|
-
<p>Zero-config Nuxt module for Vuetify</p>
|
|
7
|
-
</div>
|
|
8
|
-
|
|
9
|
-
<p align='center'>
|
|
10
|
-
<a href='https://www.npmjs.com/package/vuetify-nuxt-module' target="__blank">
|
|
11
|
-
<img src='https://img.shields.io/npm/v/vuetify-nuxt-module?color=33A6B8&label=' alt="NPM version">
|
|
12
|
-
</a>
|
|
13
|
-
<a href="https://www.npmjs.com/package/vuetify-nuxt-module" target="__blank">
|
|
14
|
-
<img alt="NPM Downloads" src="https://img.shields.io/npm/dm/vuetify-nuxt-module?color=476582&label=">
|
|
15
|
-
</a>
|
|
16
|
-
<a href="https://vuetify-nuxt-module.netlify.app/" target="__blank">
|
|
17
|
-
<img src="https://img.shields.io/static/v1?label=&message=docs%20%26%20guides&color=2e859c" alt="Docs & Guides">
|
|
18
|
-
</a>
|
|
19
|
-
<br>
|
|
20
|
-
<a href="https://github.com/userquin/vuetify-nuxt-module" target="__blank">
|
|
21
|
-
<img alt="GitHub stars" src="https://img.shields.io/github/stars/userquin/vuetify-nuxt-module?style=social">
|
|
22
|
-
</a>
|
|
23
|
-
</p>
|
|
24
|
-
|
|
25
|
-
<br>
|
|
26
|
-
|
|
27
|
-
## π Features
|
|
28
|
-
|
|
29
|
-
- π [**Documentation & guides**](https://vuetify-nuxt-module.netlify.app/)
|
|
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)
|
|
32
|
-
- β‘ **Fully Tree Shakable**: by default, only the needed Vuetify components are imported
|
|
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
|
-
- β¨ **Configurable Styles**: configure your variables using [Vuetify SASS Variables](https://vuetifyjs.com/en/features/sass-variables/)
|
|
35
|
-
- π₯ **SSR**: automatic SSR detection and configuration
|
|
36
|
-
- π₯ **Pure CSS Icons**: no more font/js icons, use the new `unocss-mdi` icon set or build your own with UnoCSS Preset Icons
|
|
37
|
-
- π **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
|
|
38
|
-
- π **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
|
|
39
|
-
- π¦ **Multiple Icon Sets**: register [multiple icon sets](https://vuetifyjs.com/en/features/icon-fonts/#multiple-icon-sets)
|
|
40
|
-
- π **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
|
|
41
|
-
- π **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
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
yarn
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
pnpm
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/userquin/vuetify-nuxt-module/raw/main/hero-dark.svg" />
|
|
4
|
+
<img alt="vuetify-nuxt-module - Zero-config Nuxt module for Vuetify" src='https://github.com/userquin/vuetify-nuxt-module/raw/main/hero.svg' alt="vuetify-nuxt-module - Zero-config Nuxt module for Vuetify"><br>
|
|
5
|
+
</picture>
|
|
6
|
+
<p>Zero-config Nuxt module for Vuetify</p>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<p align='center'>
|
|
10
|
+
<a href='https://www.npmjs.com/package/vuetify-nuxt-module' target="__blank">
|
|
11
|
+
<img src='https://img.shields.io/npm/v/vuetify-nuxt-module?color=33A6B8&label=' alt="NPM version">
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/vuetify-nuxt-module" target="__blank">
|
|
14
|
+
<img alt="NPM Downloads" src="https://img.shields.io/npm/dm/vuetify-nuxt-module?color=476582&label=">
|
|
15
|
+
</a>
|
|
16
|
+
<a href="https://vuetify-nuxt-module.netlify.app/" target="__blank">
|
|
17
|
+
<img src="https://img.shields.io/static/v1?label=&message=docs%20%26%20guides&color=2e859c" alt="Docs & Guides">
|
|
18
|
+
</a>
|
|
19
|
+
<br>
|
|
20
|
+
<a href="https://github.com/userquin/vuetify-nuxt-module" target="__blank">
|
|
21
|
+
<img alt="GitHub stars" src="https://img.shields.io/github/stars/userquin/vuetify-nuxt-module?style=social">
|
|
22
|
+
</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<br>
|
|
26
|
+
|
|
27
|
+
## π Features
|
|
28
|
+
|
|
29
|
+
- π [**Documentation & guides**](https://vuetify-nuxt-module.netlify.app/)
|
|
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)
|
|
32
|
+
- β‘ **Fully Tree Shakable**: by default, only the needed Vuetify components are imported
|
|
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
|
+
- β¨ **Configurable Styles**: configure your variables using [Vuetify SASS Variables](https://vuetifyjs.com/en/features/sass-variables/)
|
|
35
|
+
- π₯ **SSR**: automatic SSR detection and configuration
|
|
36
|
+
- π₯ **Pure CSS Icons**: no more font/js icons, use the new `unocss-mdi` icon set or build your own with UnoCSS Preset Icons
|
|
37
|
+
- π **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
|
|
38
|
+
- π **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
|
|
39
|
+
- π¦ **Multiple Icon Sets**: register [multiple icon sets](https://vuetifyjs.com/en/features/icon-fonts/#multiple-icon-sets)
|
|
40
|
+
- π **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
|
|
41
|
+
- π **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
|
|
42
|
+
- π¬ **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
|
|
43
|
+
- βοΈ **Auto-Import Vuetify Composables**: you don't need to import Vuetify composables manually, they are automatically imported for you
|
|
44
|
+
- π¨ **Vuetify Blueprints**: use [Vuetify Blueprints](https://vuetifyjs.com/en/features/blueprints/) to quickly scaffold components
|
|
45
|
+
- π© **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)
|
|
46
|
+
- π **Nuxt DevTools**: ready to inspect your Vuetify styles with the [Nuxt DevTools](https://github.com/nuxt/devtools) inspector
|
|
47
|
+
- π¦Ύ **Type Strong**: written in [TypeScript](https://www.typescriptlang.org/)
|
|
48
|
+
|
|
49
|
+
## π¦ Install
|
|
50
|
+
|
|
51
|
+
> Requires Vite, will not work with Webpack
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm i vuetify-nuxt-module -D
|
|
55
|
+
|
|
56
|
+
# yarn
|
|
57
|
+
yarn add vuetify-nuxt-module -D
|
|
58
|
+
|
|
59
|
+
# pnpm
|
|
60
|
+
pnpm add vuetify-nuxt-module -D
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
[](https://stackblitz.com/github/userquin/vuetify-nuxt-module)
|
|
64
|
+
|
|
65
|
+
## π¦ Usage
|
|
66
|
+
|
|
67
|
+
> `vuetify-nuxt-module` is strongly opinionated and has a built-in default configuration out of the box. You can use it without any configuration, and it will work for most use cases.
|
|
68
|
+
|
|
69
|
+
Add `vuetify-nuxt-module` module to `nuxt.config.ts` and configure it:
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
// Nuxt config file
|
|
73
|
+
import { defineNuxtConfig } from 'nuxt/config'
|
|
74
|
+
|
|
75
|
+
export default defineNuxtConfig({
|
|
76
|
+
modules: [
|
|
77
|
+
'vuetify-nuxt-module'
|
|
78
|
+
],
|
|
79
|
+
vuetify: {
|
|
80
|
+
moduleOptions: {
|
|
81
|
+
/* module specific options */
|
|
82
|
+
},
|
|
83
|
+
vuetifyOptions: {
|
|
84
|
+
/* vuetify options */
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Read the [π documentation](https://vuetify-nuxt-module.netlify.app/) for a complete guide on how to configure and use this module.
|
|
91
|
+
|
|
92
|
+
## π Full config
|
|
93
|
+
|
|
94
|
+
Check out the [types](https://github.com/userquin/vuetify-nuxt-module/blob/main/src/types.ts).
|
|
95
|
+
|
|
96
|
+
The virtual modules can be found in [configuration.d.ts](https://github.com/userquin/vuetify-nuxt-module/blob/main/configuration.d.ts) file.
|
|
97
|
+
|
|
98
|
+
## π License
|
|
99
|
+
|
|
100
|
+
[MIT](https://github.com/userquin/vuetify-nuxt-module/blob/main/LICENSE) License © 2023-PRESENT [JoaquΓn SΓ‘nchez](https://github.com/userquin)
|
package/dist/module.d.ts
CHANGED
|
@@ -93,6 +93,15 @@ type LabComponentName = keyof typeof vuetify_labs_components;
|
|
|
93
93
|
type LabComponents = boolean | LabComponentName | LabComponentName[];
|
|
94
94
|
type VuetifyLocale = keyof typeof vuetify_locale;
|
|
95
95
|
interface VOptions extends Partial<Omit<VuetifyOptions, 'ssr' | 'aliases' | 'components' | 'directives' | 'locale' | 'date' | 'icons'>> {
|
|
96
|
+
/**
|
|
97
|
+
* Configure the SSR options.
|
|
98
|
+
*
|
|
99
|
+
* This option is only used when SSR is enabled in your Nuxt configuration.
|
|
100
|
+
*/
|
|
101
|
+
ssr?: {
|
|
102
|
+
clientWidth: number;
|
|
103
|
+
clientHeight?: number;
|
|
104
|
+
};
|
|
96
105
|
aliases?: Record<string, ComponentName>;
|
|
97
106
|
/**
|
|
98
107
|
* Do you need to configure some global components?.
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { isAbsolute, join, relative } from 'pathe';
|
|
|
6
6
|
import { normalizePath as normalizePath$1 } from 'vite';
|
|
7
7
|
import { isPackageExists } from 'local-pkg';
|
|
8
8
|
|
|
9
|
-
const version = "0.4.
|
|
9
|
+
const version = "0.4.12";
|
|
10
10
|
|
|
11
11
|
function isSubdir(root, test) {
|
|
12
12
|
const relative$1 = relative(root, test);
|
|
@@ -184,16 +184,19 @@ const RESOLVED_VIRTUAL_VUETIFY_DATE_CONFIGURATION = `/@nuxt-vuetify-configuratio
|
|
|
184
184
|
const VIRTUAL_VUETIFY_ICONS_CONFIGURATION = "virtual:vuetify-icons-configuration";
|
|
185
185
|
const RESOLVED_VIRTUAL_VUETIFY_ICONS_CONFIGURATION = `/@nuxt-vuetify-configuration/${VIRTUAL_VUETIFY_ICONS_CONFIGURATION.slice("virtual:".length)}`;
|
|
186
186
|
|
|
187
|
-
function vuetifyConfigurationPlugin(isDev, i18n, directives, labComponents, vuetifyAppOptions, componentsPromise, labComponentsPromise, logger) {
|
|
187
|
+
function vuetifyConfigurationPlugin(isDev, isSSR, i18n, directives, labComponents, vuetifyAppOptions, componentsPromise, labComponentsPromise, logger) {
|
|
188
188
|
const {
|
|
189
189
|
directives: _directives,
|
|
190
190
|
date: _date,
|
|
191
191
|
icons: _icons,
|
|
192
192
|
localeMessages,
|
|
193
193
|
components,
|
|
194
|
+
ssr,
|
|
194
195
|
aliases,
|
|
195
196
|
...newVuetifyOptions
|
|
196
197
|
} = vuetifyAppOptions;
|
|
198
|
+
if (isSSR)
|
|
199
|
+
newVuetifyOptions.ssr = ssr ?? true;
|
|
197
200
|
return {
|
|
198
201
|
name: "vuetify:configuration:nuxt",
|
|
199
202
|
enforce: "pre",
|
|
@@ -481,7 +484,7 @@ function prepareIcons(unocssPresent, logger, vuetifyOptions) {
|
|
|
481
484
|
defaultSet = "mdi";
|
|
482
485
|
sets = sets.filter((s) => s.name !== "unocss-mdi");
|
|
483
486
|
}
|
|
484
|
-
sets.filter((s) => cssFonts.includes(s.name)).
|
|
487
|
+
sets.filter((s) => cssFonts.includes(s.name)).forEach(({ name, cdn }) => {
|
|
485
488
|
if (name === "unocss-mdi")
|
|
486
489
|
return;
|
|
487
490
|
resolvedIcons.imports.push(`import {${name === defaultSet ? "aliases," : ""}${name}} from 'vuetify/iconsets/${name}'`);
|
|
@@ -489,7 +492,7 @@ function prepareIcons(unocssPresent, logger, vuetifyOptions) {
|
|
|
489
492
|
if (isPackageExists(iconsPackageNames[name].name))
|
|
490
493
|
resolvedIcons.local.push(iconsPackageNames[name].css);
|
|
491
494
|
else
|
|
492
|
-
resolvedIcons.cdn.push(iconsCDN[name]);
|
|
495
|
+
resolvedIcons.cdn.push(cdn ?? iconsCDN[name]);
|
|
493
496
|
});
|
|
494
497
|
if (resolvedIcons.unocss && defaultSet === "unocss-mdi") {
|
|
495
498
|
if (!resolvedIcons.sets.includes("mdi")) {
|
|
@@ -815,9 +818,7 @@ const module = defineNuxtModule({
|
|
|
815
818
|
prefixComposables: false
|
|
816
819
|
});
|
|
817
820
|
const isSSR = nuxt.options.ssr;
|
|
818
|
-
const vuetifyAppOptions = defu(vOptions, {
|
|
819
|
-
ssr: isSSR
|
|
820
|
-
});
|
|
821
|
+
const vuetifyAppOptions = defu(vOptions, {});
|
|
821
822
|
cleanupBlueprint(vuetifyAppOptions);
|
|
822
823
|
const { styles } = moduleOptions;
|
|
823
824
|
const i18n = hasNuxtModule("@nuxtjs/i18n", nuxt);
|
|
@@ -914,6 +915,7 @@ const module = defineNuxtModule({
|
|
|
914
915
|
viteInlineConfig.plugins.push(vuetifyStylesPlugin({ styles }, logger));
|
|
915
916
|
viteInlineConfig.plugins.push(vuetifyConfigurationPlugin(
|
|
916
917
|
nuxt.options.dev,
|
|
918
|
+
isSSR,
|
|
917
919
|
i18n,
|
|
918
920
|
directives,
|
|
919
921
|
labComponents,
|