vuetify-nuxt-module 1.0.0-alpha.2 β†’ 1.0.0-alpha.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 ADDED
@@ -0,0 +1,95 @@
1
+ <div align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://github.com/vuetifyjs/nuxt-module/raw/main/hero-dark.svg" />
4
+ <img alt="vuetify-nuxt-module - Zero-config Nuxt Module for Vuetify" src='https://github.com/vuetifyjs/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://nuxt.vuetifyjs.com/" 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/vuetifyjs/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://nuxt.vuetifyjs.com/)
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 Runtime 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 including [HTTP Client hints](https://developer.mozilla.org/en-US/docs/Web/HTTP/Client_hints)
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
+ - πŸ“₯ **Vuetify Configuration File**: configure your Vuetify options using a custom `vuetify.config` file, no dev server restart needed
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
+ - πŸ˜ƒ **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
+ - 🎭 **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
+ - πŸ“¦ **Multiple Icon Sets**: register [multiple icon sets](https://vuetifyjs.com/en/features/icon-fonts/#multiple-icon-sets)
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
+ - πŸ“† **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
+ - πŸ’¬ **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
+ - βš™οΈ **Auto-Import Vuetify Composables**: you don't need to import Vuetify composables manually, they are automatically imported for you
46
+ - 🎨 **Vuetify Blueprints**: use [Vuetify Blueprints](https://vuetifyjs.com/en/features/blueprints/) to quickly scaffold components
47
+ - πŸ‘€ **Nuxt DevTools**: ready to inspect your Vuetify styles with the [Nuxt DevTools](https://github.com/nuxt/devtools) inspector
48
+ - 🦾 **Type Strong**: written in [TypeScript](https://www.typescriptlang.org/)
49
+
50
+ ## πŸ“¦ Install
51
+
52
+ > Requires Vite, will not work with Webpack
53
+
54
+ ```bash
55
+ npx nuxi@latest module add vuetify-nuxt-module
56
+ ```
57
+
58
+ [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/userquin/vuetify-nuxt-module)
59
+
60
+ ## πŸ¦„ Usage
61
+
62
+ > `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.
63
+
64
+ Add `vuetify-nuxt-module` module to `nuxt.config.ts` and configure it:
65
+
66
+ ```ts
67
+ // Nuxt config file
68
+ import { defineNuxtConfig } from 'nuxt/config'
69
+
70
+ export default defineNuxtConfig({
71
+ modules: [
72
+ 'vuetify-nuxt-module'
73
+ ],
74
+ vuetify: {
75
+ moduleOptions: {
76
+ /* module specific options */
77
+ },
78
+ vuetifyOptions: {
79
+ /* vuetify options */
80
+ }
81
+ }
82
+ })
83
+ ```
84
+
85
+ Read the [πŸ“– documentation](https://nuxt.vuetifyjs.com/) for a complete guide on how to configure and use this module.
86
+
87
+ ## πŸ‘€ Full config
88
+
89
+ Check out the [types](https://github.com/vuetifyjs/nuxt-module/blob/main/src/types.ts).
90
+
91
+ The virtual modules can be found in [configuration.d.ts](https://github.com/vuetifyjs/nuxt-module/blob/main/configuration.d.ts) file.
92
+
93
+ ## πŸ“„ License
94
+
95
+ [MIT](https://github.com/vuetifyjs/nuxt-module/blob/main/LICENSE) License &copy; 2023-PRESENT [JoaquΓ­n SΓ‘nchez](https://github.com/userquin)
package/dist/module.d.mts CHANGED
@@ -309,7 +309,8 @@ interface MOptions {
309
309
  * @default true
310
310
  */
311
311
  rulesConfiguration?: {
312
- fromLabs: boolean;
312
+ fromLabs?: boolean;
313
+ configFile?: string;
313
314
  };
314
315
  /**
315
316
  * Vuetify SSR client hints.
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.15.0"
6
6
  },
7
- "version": "1.0.0-alpha.2",
7
+ "version": "1.0.0-alpha.3",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -17,7 +17,7 @@ import { debounce } from 'perfect-debounce';
17
17
  import process from 'node:process';
18
18
  import { createConfigLoader } from 'unconfig';
19
19
 
20
- const version = "1.0.0-alpha.2";
20
+ const version = "1.0.0-alpha.3";
21
21
 
22
22
  const VIRTUAL_VUETIFY_CONFIGURATION = "virtual:vuetify-configuration";
23
23
  const RESOLVED_VIRTUAL_VUETIFY_CONFIGURATION = `\0${VIRTUAL_VUETIFY_CONFIGURATION}`;
@@ -158,7 +158,7 @@ function addVuetifyNuxtPlugin(nuxt, ctx, mode) {
158
158
  }
159
159
  let rulesImports = "";
160
160
  let rulesPlugin = "";
161
- if (mode === "client" && ctx.enableRules) {
161
+ if (ctx.enableRules) {
162
162
  rulesImports = [
163
163
  "",
164
164
  `import { rulesOptions } from '#build/vuetify/${ctx.rulesConfiguration.fromLabs ? "labs-" : ""}rules-configuration.mjs'`,
@@ -204,7 +204,7 @@ async function configureNuxt(configKey, nuxt, ctx) {
204
204
  prefixComposables
205
205
  } = ctx.moduleOptions;
206
206
  const runtimeDir = ctx.resolver.resolve("./runtime");
207
- if (ctx.enableRules !== void 0) {
207
+ if (ctx.enableRules === void 0) {
208
208
  ctx.enableRules = ctx.vuetifyGte("3.8.0");
209
209
  }
210
210
  if (styles !== "none" && styles !== false) {
@@ -229,7 +229,19 @@ async function configureNuxt(configKey, nuxt, ctx) {
229
229
  }
230
230
  nuxt.options.build.transpile.push(configKey, runtimeDir);
231
231
  if (ctx.enableRules) {
232
- nuxt.options.build.transpile.push(`#build/vuetify/${ctx.rulesConfiguration.fromLabs ? "labs-" : ""}rules-configuration.mjs`);
232
+ const rulesConfigurationFile = `vuetify/${ctx.rulesConfiguration.fromLabs ? "labs-" : ""}rules-configuration.mjs`;
233
+ nuxt.options.build.transpile.push(`#build/${rulesConfigurationFile}`);
234
+ addTemplate({
235
+ filename: rulesConfigurationFile,
236
+ getContents: async () => {
237
+ if (ctx.rulesConfiguration?.configFile) {
238
+ const resolvedPath = await resolvePath(ctx.rulesConfiguration.configFile);
239
+ return `export { default as rulesOptions } from '${resolvedPath}'`;
240
+ }
241
+ return "export const rulesOptions = {}";
242
+ },
243
+ write: true
244
+ });
233
245
  }
234
246
  nuxt.options.build.transpile.push(/\/vuetify-nuxt-plugin\.(client|server)\.mjs$/);
235
247
  nuxt.options.imports.transform ??= {};
@@ -267,12 +279,18 @@ async function configureNuxt(configKey, nuxt, ctx) {
267
279
  if (ctx.vuetifyGte("3.10.0")) {
268
280
  composables.push("useMask");
269
281
  }
270
- addImports(composables.map((name) => ({
271
- name,
272
- from: ctx.vuetifyGte("3.4.0") || name !== "useDate" ? "vuetify" : "vuetify/labs/date",
273
- as: prefixComposables ? name.replace(/^use/, "useV") : void 0,
274
- meta: { docsUrl: name === "useRules" ? "https://vuetifyjs.com/en/features/rules/" : `https://vuetifyjs.com/en/api/${toKebabCase(name)}/` }
275
- })));
282
+ addImports(composables.map((name) => {
283
+ let from = ctx.vuetifyGte("3.4.0") || name !== "useDate" ? "vuetify" : "vuetify/labs/date";
284
+ if (name === "useRules" && ctx.rulesConfiguration?.fromLabs) {
285
+ from = "vuetify/labs/rules";
286
+ }
287
+ return {
288
+ name,
289
+ from,
290
+ as: prefixComposables ? name.replace(/^use/, "useV") : void 0,
291
+ meta: { docsUrl: name === "useRules" ? "https://vuetifyjs.com/en/features/rules/" : `https://vuetifyjs.com/en/api/${toKebabCase(name)}/` }
292
+ };
293
+ }));
276
294
  }
277
295
  if (ctx.ssrClientHints.enabled) {
278
296
  addPlugin({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vuetify-nuxt-module",
3
3
  "type": "module",
4
- "version": "1.0.0-alpha.2",
4
+ "version": "1.0.0-alpha.3",
5
5
  "description": "Zero-Config Nuxt Module for Vuetify",
6
6
  "author": "userquin <userquin@gmail.com>",
7
7
  "license": "MIT",
@@ -82,7 +82,7 @@
82
82
  "@parcel/watcher": "^2.5.6",
83
83
  "@types/node": "^25.3.3",
84
84
  "@types/semver": "^7.7.1",
85
- "@unocss/nuxt": "^66.6.2",
85
+ "@unocss/nuxt": "^66.6.5",
86
86
  "bumpp": "^10.4.1",
87
87
  "eslint": "^10.0.2",
88
88
  "luxon": "^3.7.2",