vuetify-nuxt-module 1.0.0-rc.1 → 1.0.0-rc.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
@@ -222,9 +222,13 @@ interface VOptions extends Partial<Omit<VuetifyOptions, 'ssr' | 'aliases' | 'com
222
222
  }
223
223
  interface MOptions {
224
224
  /**
225
+ * Auto-import Vuetify composables.
226
+ *
227
+ * Pass an array of composable names to import only those, e.g. `['useDisplay', 'useTheme']`.
228
+ *
225
229
  * @default true
226
230
  */
227
- importComposables?: boolean;
231
+ importComposables?: boolean | string[];
228
232
  /**
229
233
  * If you are using another composables that collide with the Vuetify ones,
230
234
  * enable this flag to prefix them with `V`:
@@ -236,9 +240,11 @@ interface MOptions {
236
240
  * - `useTheme` -> `useVTheme`
237
241
  * - `useGoTo` -> `useVGoTo`
238
242
  *
243
+ * Pass an array of composable names to prefix only those, e.g. `['useLocale', 'useTheme']`.
244
+ *
239
245
  * @default false
240
246
  */
241
- prefixComposables?: boolean;
247
+ prefixComposables?: boolean | string[];
242
248
  /**
243
249
  * Vuetify styles.
244
250
  *
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-rc.1",
7
+ "version": "1.0.0-rc.3",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -13,7 +13,7 @@ import { readFile } from 'node:fs/promises';
13
13
  import process from 'node:process';
14
14
  import { createConfigLoader } from 'unconfig';
15
15
 
16
- const version = "1.0.0-rc.1";
16
+ const version = "1.0.0-rc.3";
17
17
 
18
18
  const VIRTUAL_VUETIFY_CONFIGURATION = "virtual:vuetify-configuration";
19
19
  const RESOLVED_VIRTUAL_VUETIFY_CONFIGURATION = `\0${VIRTUAL_VUETIFY_CONFIGURATION}`;
@@ -280,7 +280,7 @@ async function configureNuxt(configKey, nuxt, ctx) {
280
280
  }
281
281
  });
282
282
  if (importComposables) {
283
- const composables = ["useDate", "useLocale", "useDefaults", "useDisplay", "useLayout", "useRtl", "useTheme"];
283
+ let composables = ["useDate", "useLocale", "useDefaults", "useDisplay", "useLayout", "useRtl", "useTheme"];
284
284
  if (ctx.vuetifyGte("3.5.0")) {
285
285
  composables.push("useGoTo");
286
286
  }
@@ -293,6 +293,9 @@ async function configureNuxt(configKey, nuxt, ctx) {
293
293
  if (ctx.vuetifyGte("3.10.0")) {
294
294
  composables.push("useMask");
295
295
  }
296
+ if (Array.isArray(importComposables)) {
297
+ composables = composables.filter((name) => importComposables.includes(name));
298
+ }
296
299
  addImports(composables.map((name) => {
297
300
  let from = ctx.vuetifyGte("3.4.0") || name !== "useDate" ? "vuetify" : "vuetify/labs/date";
298
301
  if (name === "useRules" && ctx.rulesConfiguration?.fromLabs) {
@@ -301,7 +304,7 @@ async function configureNuxt(configKey, nuxt, ctx) {
301
304
  return {
302
305
  name,
303
306
  from,
304
- as: prefixComposables ? name.replace(/^use/, "useV") : void 0,
307
+ as: (Array.isArray(prefixComposables) ? prefixComposables.includes(name) : prefixComposables) ? name.replace(/^use/, "useV") : void 0,
305
308
  meta: { docsUrl: name === "useRules" ? "https://vuetifyjs.com/en/features/rules/" : `https://vuetifyjs.com/en/api/${toKebabCase(name)}/` }
306
309
  };
307
310
  }));
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-rc.1",
4
+ "version": "1.0.0-rc.3",
5
5
  "description": "Zero-Config Nuxt Module for Vuetify",
6
6
  "author": "userquin <userquin@gmail.com>",
7
7
  "license": "MIT",