unplugin-vue-components 30.0.0 → 31.1.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.
Files changed (70) hide show
  1. package/README.md +5 -37
  2. package/dist/esbuild.d.mts +6 -0
  3. package/dist/esbuild.mjs +6 -0
  4. package/dist/index.d.mts +12 -0
  5. package/dist/index.mjs +3 -0
  6. package/dist/nuxt.d.mts +7 -0
  7. package/dist/{nuxt.js → nuxt.mjs} +4 -7
  8. package/dist/{resolvers.d.ts → resolvers.d.mts} +9 -31
  9. package/dist/{resolvers.js → resolvers.mjs} +99 -162
  10. package/dist/rolldown.d.mts +6 -0
  11. package/dist/rolldown.mjs +6 -0
  12. package/dist/rollup.d.mts +6 -0
  13. package/dist/rollup.mjs +6 -0
  14. package/dist/rspack.d.mts +6 -0
  15. package/dist/rspack.mjs +6 -0
  16. package/dist/{src-BcnnO6GN.js → src-M1OY6Uso.mjs} +51 -150
  17. package/dist/{types-DSJ5r-ta.d.cts → types-BbnOeCab.d.mts} +11 -19
  18. package/dist/types.d.mts +2 -0
  19. package/dist/types.mjs +1 -0
  20. package/dist/utils-BfjsfvcK.mjs +229 -0
  21. package/dist/vite.d.mts +9 -0
  22. package/dist/vite.mjs +6 -0
  23. package/dist/webpack.d.mts +6 -0
  24. package/dist/webpack.mjs +6 -0
  25. package/package.json +45 -78
  26. package/dist/esbuild.cjs +0 -9
  27. package/dist/esbuild.d.cts +0 -6
  28. package/dist/esbuild.d.ts +0 -7
  29. package/dist/esbuild.js +0 -9
  30. package/dist/index.cjs +0 -9
  31. package/dist/index.d.cts +0 -13
  32. package/dist/index.d.ts +0 -13
  33. package/dist/index.js +0 -5
  34. package/dist/nuxt.cjs +0 -14
  35. package/dist/nuxt.d.cts +0 -6
  36. package/dist/nuxt.d.ts +0 -7
  37. package/dist/resolvers.cjs +0 -2074
  38. package/dist/resolvers.d.cts +0 -574
  39. package/dist/rolldown.cjs +0 -9
  40. package/dist/rolldown.d.cts +0 -6
  41. package/dist/rolldown.d.ts +0 -7
  42. package/dist/rolldown.js +0 -9
  43. package/dist/rollup.cjs +0 -9
  44. package/dist/rollup.d.cts +0 -6
  45. package/dist/rollup.d.ts +0 -7
  46. package/dist/rollup.js +0 -9
  47. package/dist/rspack.cjs +0 -9
  48. package/dist/rspack.d.cts +0 -5
  49. package/dist/rspack.d.ts +0 -6
  50. package/dist/rspack.js +0 -9
  51. package/dist/src-BTwFq3T3.cjs +0 -188
  52. package/dist/src-D2-JfLYq.js +0 -187
  53. package/dist/src-DzdkjKhH.cjs +0 -769
  54. package/dist/types-CBTc19th.cjs +0 -0
  55. package/dist/types-DQoXDiso.js +0 -1
  56. package/dist/types-rC3290ja.d.ts +0 -225
  57. package/dist/types.cjs +0 -1
  58. package/dist/types.d.cts +0 -2
  59. package/dist/types.d.ts +0 -2
  60. package/dist/types.js +0 -3
  61. package/dist/utils-8UQ22cuO.cjs +0 -1689
  62. package/dist/utils-BoXu-4gQ.js +0 -1523
  63. package/dist/vite.cjs +0 -9
  64. package/dist/vite.d.cts +0 -8
  65. package/dist/vite.d.ts +0 -9
  66. package/dist/vite.js +0 -9
  67. package/dist/webpack.cjs +0 -9
  68. package/dist/webpack.d.cts +0 -6
  69. package/dist/webpack.d.ts +0 -7
  70. package/dist/webpack.js +0 -9
package/README.md CHANGED
@@ -6,9 +6,9 @@ On-demand components auto importing for Vue.
6
6
 
7
7
  ###### Features
8
8
 
9
- - 💚 Supports both Vue 2 and Vue 3 out-of-the-box.
9
+ - 💚 Supports Vue 3 out-of-the-box.
10
10
  - ✨ Supports both components and directives.
11
- - ⚡️ Supports Vite, Webpack, Rspack, Vue CLI, Rollup, esbuild and more, powered by <a href="https://github.com/unjs/unplugin">unplugin</a>.
11
+ - ⚡️ Supports Vite, Webpack, Rspack, Rollup, Rolldown, esbuild and more, powered by <a href="https://github.com/unjs/unplugin">unplugin</a>.
12
12
  - 🏝 Tree-shakable, only registers the components you use.
13
13
  - 🪐 Folder names as namespaces.
14
14
  - 🦾 Full TypeScript support.
@@ -19,7 +19,7 @@ On-demand components auto importing for Vue.
19
19
 
20
20
  <p align="center">
21
21
  <a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg">
22
- <img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>
22
+ <img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg' alt='Sponsors'/>
23
23
  </a>
24
24
  </p>
25
25
 
@@ -86,6 +86,7 @@ export default {
86
86
 
87
87
  ```ts
88
88
  // webpack.config.js
89
+ // unplugin-vue-components removed support for CommonJS after version 29.1.0
89
90
  module.exports = {
90
91
  /* ... */
91
92
  plugins: [
@@ -101,6 +102,7 @@ module.exports = {
101
102
 
102
103
  ```ts
103
104
  // rspack.config.js
105
+ // unplugin-vue-components removed support for CommonJS after version 29.1.0
104
106
  module.exports = {
105
107
  /* ... */
106
108
  plugins: [
@@ -118,36 +120,6 @@ You might not need this plugin for Nuxt. Use [`@nuxt/components`](https://github
118
120
 
119
121
  <br></details>
120
122
 
121
- <details>
122
- <summary>Vue CLI</summary><br>
123
-
124
- ```ts
125
- // vue.config.js
126
- module.exports = {
127
- /* ... */
128
- plugins: [
129
- require('unplugin-vue-components/webpack')({ /* options */ }),
130
- ],
131
- }
132
- ```
133
-
134
- You can also rename the Vue configuration file to `vue.config.mjs` and use static import syntax (you should use latest `@vue/cli-service ^5.0.8`):
135
-
136
- ```ts
137
- // vue.config.mjs
138
- import Components from 'unplugin-vue-components/webpack'
139
-
140
- export default {
141
- configureWebpack: {
142
- plugins: [
143
- Components({ /* options */ }),
144
- ],
145
- },
146
- }
147
- ```
148
-
149
- <br></details>
150
-
151
123
  <details>
152
124
  <summary>Quasar</summary><br>
153
125
 
@@ -266,7 +238,6 @@ Supported Resolvers:
266
238
  - [Arco Design Vue](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/arco.ts)
267
239
  - [BootstrapVue](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/bootstrap-vue.ts)
268
240
  - [Element Plus](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/element-plus.ts)
269
- - [Element UI](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/element-ui.ts)
270
241
  - [Headless UI](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/headless-ui.ts)
271
242
  - [IDux](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/idux.ts)
272
243
  - [Inkline](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/inkline.ts)
@@ -440,9 +411,6 @@ Components({
440
411
  globalNamespaces: [],
441
412
 
442
413
  // auto import for directives
443
- // default: `true` for Vue 3, `false` for Vue 2
444
- // Babel is needed to do the transformation for Vue 2, it's disabled by default for performance concerns.
445
- // To install Babel, run: `npm install -D @babel/parser`
446
414
  directives: true,
447
415
 
448
416
  // Transform path before resolving
@@ -0,0 +1,6 @@
1
+ import { u as Options } from "./types-BbnOeCab.mjs";
2
+
3
+ //#region src/esbuild.d.ts
4
+ declare const esbuild: (options: Options) => esbuild.Plugin;
5
+ //#endregion
6
+ export { esbuild as default, esbuild as "module.exports" };
@@ -0,0 +1,6 @@
1
+ import "./utils-BfjsfvcK.mjs";
2
+ import { t as unplugin_default } from "./src-M1OY6Uso.mjs";
3
+ //#region src/esbuild.ts
4
+ const esbuild = unplugin_default.esbuild;
5
+ //#endregion
6
+ export { esbuild as default, esbuild as "module.exports" };
@@ -0,0 +1,12 @@
1
+ import { a as ComponentResolverObject, c as ImportInfoLegacy, d as PublicPluginAPI, f as ResolvedOptions, h as TypeImport, i as ComponentResolverFunction, l as Matcher, m as Transformer, n as ComponentResolveResult, o as ComponentsImportMap, p as SideEffectsInfo, r as ComponentResolver, s as ImportInfo, t as ComponentInfo, u as Options } from "./types-BbnOeCab.mjs";
2
+ import * as unplugin from "unplugin";
3
+ import { FilterPattern } from "unplugin-utils";
4
+ //#region src/core/unplugin.d.ts
5
+ declare const _default: unplugin.UnpluginInstance<Options, boolean>;
6
+ //#endregion
7
+ //#region src/core/utils.d.ts
8
+ declare function pascalCase(str: string): string;
9
+ declare function camelCase(str: string): string;
10
+ declare function kebabCase(key: string): string;
11
+ //#endregion
12
+ export { ComponentInfo, ComponentResolveResult, ComponentResolver, ComponentResolverFunction, ComponentResolverObject, ComponentsImportMap, ImportInfo, ImportInfoLegacy, Matcher, Options, PublicPluginAPI, ResolvedOptions, SideEffectsInfo, Transformer, TypeImport, camelCase, _default as default, kebabCase, pascalCase };
package/dist/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { c as kebabCase, f as pascalCase, t as camelCase } from "./utils-BfjsfvcK.mjs";
2
+ import { t as unplugin_default } from "./src-M1OY6Uso.mjs";
3
+ export { camelCase, unplugin_default as default, kebabCase, pascalCase };
@@ -0,0 +1,7 @@
1
+ import { u as Options } from "./types-BbnOeCab.mjs";
2
+ import { NuxtModule } from "@nuxt/schema";
3
+
4
+ //#region src/nuxt.d.ts
5
+ declare const module: NuxtModule<Options, Options, false>;
6
+ //#endregion
7
+ export { module as default };
@@ -1,13 +1,10 @@
1
- import "./utils-BoXu-4gQ.js";
2
- import { unplugin_default } from "./src-BcnnO6GN.js";
3
- import "./types-DQoXDiso.js";
1
+ import "./utils-BfjsfvcK.mjs";
2
+ import { t as unplugin_default } from "./src-M1OY6Uso.mjs";
4
3
  import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
5
-
6
4
  //#region src/nuxt.ts
7
- var nuxt_default = defineNuxtModule({ setup(options) {
5
+ const module = defineNuxtModule({ setup(options) {
8
6
  addWebpackPlugin(unplugin_default.webpack(options));
9
7
  addVitePlugin(unplugin_default.vite(options));
10
8
  } });
11
-
12
9
  //#endregion
13
- export { nuxt_default as default };
10
+ export { module as default };
@@ -1,7 +1,8 @@
1
- import { ComponentResolveResult, ComponentResolver } from "./types-rC3290ja.js";
1
+ import { n as ComponentResolveResult, r as ComponentResolver } from "./types-BbnOeCab.mjs";
2
2
  import { FilterPattern } from "unplugin-utils";
3
3
 
4
4
  //#region src/core/resolvers/antdv.d.ts
5
+ type AntDesignVueResolveDateLibrary = 'dayjs' | 'date-fns' | 'moment';
5
6
  interface AntDesignVueResolverOptions {
6
7
  /**
7
8
  * exclude components that do not require automatic import
@@ -46,6 +47,12 @@ interface AntDesignVueResolverOptions {
46
47
  * @default 'A'
47
48
  */
48
49
  prefix?: string;
50
+ /**
51
+ * Custom date library.
52
+ *
53
+ * @default 'dayjs'
54
+ */
55
+ resolveDateLibrary?: AntDesignVueResolveDateLibrary;
49
56
  }
50
57
  /**
51
58
  * Resolver for Ant Design Vue
@@ -206,27 +213,6 @@ interface ElementPlusResolverOptions {
206
213
  */
207
214
  declare function ElementPlusResolver(options?: ElementPlusResolverOptions): ComponentResolver[];
208
215
  //#endregion
209
- //#region src/core/resolvers/element-ui.d.ts
210
- interface ElementUiResolverOptions {
211
- /**
212
- * import style css or sass with components
213
- *
214
- * @default 'css'
215
- */
216
- importStyle?: boolean | 'css' | 'sass';
217
- /**
218
- * exclude component name, if match do not resolve the name
219
- */
220
- exclude?: RegExp;
221
- }
222
- /**
223
- * Resolver for Element-UI
224
- * @link https://element.eleme.cn/#/zh-CN
225
- * @version @element-ui ^2.15.3, @vue ^2.6.14
226
- * @author @nabaonan
227
- */
228
- declare function ElementUiResolver(options?: ElementUiResolverOptions): ComponentResolver;
229
- //#endregion
230
216
  //#region src/core/resolvers/headless-ui.d.ts
231
217
  interface HeadlessUiResolverOptions {
232
218
  /**
@@ -429,13 +415,6 @@ declare function VantResolver(options?: VantResolverOptions): ComponentResolver;
429
415
  //#endregion
430
416
  //#region src/core/resolvers/varlet-ui.d.ts
431
417
  interface VarletUIResolverOptions {
432
- /**
433
- * support vue version
434
- * vue3 use @varlet/ui, vue2 use @varlet-vue2/ui
435
- *
436
- * @default 'vue3'
437
- */
438
- version?: 'vue3' | 'vue2';
439
418
  /**
440
419
  * import style along with components
441
420
  *
@@ -474,7 +453,6 @@ declare function getResolved(name: string, options: VarletUIResolverOptions): Co
474
453
  * Resolver for VarletUI
475
454
  *
476
455
  * @link https://github.com/varletjs/varlet
477
- * @link https://github.com/varletjs/varlet-vue2
478
456
  */
479
457
  declare function VarletUIResolver(options?: VarletUIResolverOptions): ComponentResolver[];
480
458
  //#endregion
@@ -571,4 +549,4 @@ declare function VueUseComponentsResolver(): ComponentResolver;
571
549
  */
572
550
  declare function VueUseDirectiveResolver(): ComponentResolver;
573
551
  //#endregion
574
- export { AllowResolveIconOption, AntDesignVueResolver, AntDesignVueResolverOptions, ArcoResolver, ArcoResolverOptions, BootstrapVue3Resolver, BootstrapVueNextResolver, BootstrapVueResolver, BootstrapVueResolverOptions, DevResolverOptions, DevUiResolver, DisallowResolveIconOption, ElementPlusResolver, ElementPlusResolverOptions, ElementUiResolver, ElementUiResolverOptions, HeadlessUiResolver, HeadlessUiResolverOptions, IduxResolver, IduxResolverOptions, InklineResolver, IonicBuiltInComponents, IonicResolver, LayuiVueResolver, LayuiVueResolverOptions, NaiveUiResolver, PrimeVueResolver, PrimeVueResolverOptions, QuasarResolver, ResolveIconsOption, TDesignResolver, TDesignResolverOptions, VantResolver, VantResolverOptions, VarletUIResolver, VarletUIResolverOptions, VeuiResolver, VeuiResolverOptions, ViewUiResolver, VueUseComponentsResolver, VueUseDirectiveResolver, Vuetify3Resolver, VuetifyResolver, getResolved };
552
+ export { AllowResolveIconOption, AntDesignVueResolveDateLibrary, AntDesignVueResolver, AntDesignVueResolverOptions, ArcoResolver, ArcoResolverOptions, BootstrapVue3Resolver, BootstrapVueNextResolver, BootstrapVueResolver, BootstrapVueResolverOptions, DevResolverOptions, DevUiResolver, DisallowResolveIconOption, ElementPlusResolver, ElementPlusResolverOptions, HeadlessUiResolver, HeadlessUiResolverOptions, IduxResolver, IduxResolverOptions, InklineResolver, IonicBuiltInComponents, IonicResolver, LayuiVueResolver, LayuiVueResolverOptions, NaiveUiResolver, PrimeVueResolver, PrimeVueResolverOptions, QuasarResolver, ResolveIconsOption, TDesignResolver, TDesignResolverOptions, VantResolver, VantResolverOptions, VarletUIResolver, VarletUIResolverOptions, VeuiResolver, VeuiResolverOptions, ViewUiResolver, VueUseComponentsResolver, VueUseDirectiveResolver, Vuetify3Resolver, VuetifyResolver, getResolved };