unplugin-vue-components 28.3.0 → 28.4.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.
@@ -134,6 +134,7 @@ function getDeclaration(ctx, filepath, originalImports) {
134
134
  // @ts-nocheck
135
135
  // Generated by unplugin-vue-components
136
136
  // Read more: https://github.com/vuejs/core/pull/3399
137
+ // biome-ignore lint: disable
137
138
  export {}
138
139
 
139
140
  /* prettier-ignore */
@@ -178,7 +179,8 @@ function searchComponents(ctx) {
178
179
  ignore: ctx.options.globsExclude,
179
180
  onlyFiles: true,
180
181
  cwd: root,
181
- absolute: true
182
+ absolute: true,
183
+ expandDirectories: false
182
184
  });
183
185
  if (!files.length && !ctx.options.resolvers?.length)
184
186
  console.warn("[unplugin-vue-components] no components found");
@@ -199,7 +201,6 @@ var defaultOptions = {
199
201
  globalNamespaces: [],
200
202
  transformerUserResolveFunctions: true,
201
203
  resolvers: [],
202
- globsExclude: [],
203
204
  importPathTransform: (v) => v,
204
205
  allowOverrides: false
205
206
  };
@@ -208,25 +209,40 @@ function normalizeResolvers(resolvers) {
208
209
  }
209
210
  function resolveGlobsExclude(root, glob) {
210
211
  const excludeReg = /^!/;
211
- return `${excludeReg.test(glob) ? "!" : ""}${resolve(root, glob.replace(excludeReg, ""))}`;
212
+ return slash(`${excludeReg.test(glob) ? "!" : ""}${resolve(root, glob.replace(excludeReg, ""))}`);
212
213
  }
213
214
  function resolveOptions(options, root) {
214
215
  const resolved = Object.assign({}, defaultOptions, options);
215
216
  resolved.resolvers = normalizeResolvers(resolved.resolvers);
216
217
  resolved.extensions = toArray(resolved.extensions);
217
218
  if (resolved.globs) {
218
- resolved.globs = toArray(resolved.globs).map((glob) => slash(resolveGlobsExclude(root, glob)));
219
+ resolved.globs = toArray(resolved.globs).map((glob) => resolveGlobsExclude(root, glob));
219
220
  resolved.resolvedDirs = [];
220
221
  } else {
221
222
  const extsGlob = resolved.extensions.length === 1 ? resolved.extensions : `{${resolved.extensions.join(",")}}`;
222
223
  resolved.dirs = toArray(resolved.dirs);
223
- resolved.resolvedDirs = resolved.dirs.map((i) => slash(resolveGlobsExclude(root, i)));
224
- resolved.globs = resolved.resolvedDirs.map(
225
- (i) => resolved.deep ? slash(join(i, `**/*.${extsGlob}`)) : slash(join(i, `*.${extsGlob}`))
226
- );
224
+ const globs = resolved.dirs.map((i) => resolveGlobsExclude(root, i));
225
+ resolved.resolvedDirs = globs.filter((i) => !i.startsWith("!"));
226
+ resolved.globs = globs.map((i) => {
227
+ let prefix = "";
228
+ if (i.startsWith("!")) {
229
+ prefix = "!";
230
+ i = i.slice(1);
231
+ }
232
+ return resolved.deep ? prefix + slash(join(i, `**/*.${extsGlob}`)) : prefix + slash(join(i, `*.${extsGlob}`));
233
+ });
227
234
  if (!resolved.extensions.length)
228
235
  throw new Error("[unplugin-vue-components] `extensions` option is required to search for components");
229
236
  }
237
+ if (!resolved.globsExclude)
238
+ resolved.globsExclude = [`**/node_modules/**`];
239
+ resolved.globsExclude = toArray(resolved.globsExclude || []).map((i) => resolveGlobsExclude(root, i));
240
+ resolved.globs = resolved.globs.filter((i) => {
241
+ if (!i.startsWith("!"))
242
+ return true;
243
+ resolved.globsExclude.push(i.slice(1));
244
+ return false;
245
+ });
230
246
  resolved.dts = !resolved.dts ? false : resolve(
231
247
  root,
232
248
  typeof resolved.dts === "string" ? resolved.dts : "components.d.ts"
@@ -134,6 +134,7 @@ function getDeclaration(ctx, filepath, originalImports) {
134
134
  // @ts-nocheck
135
135
  // Generated by unplugin-vue-components
136
136
  // Read more: https://github.com/vuejs/core/pull/3399
137
+ // biome-ignore lint: disable
137
138
  export {}
138
139
 
139
140
  /* prettier-ignore */
@@ -178,7 +179,8 @@ function searchComponents(ctx) {
178
179
  ignore: ctx.options.globsExclude,
179
180
  onlyFiles: true,
180
181
  cwd: root,
181
- absolute: true
182
+ absolute: true,
183
+ expandDirectories: false
182
184
  });
183
185
  if (!files.length && !_optionalChain([ctx, 'access', _9 => _9.options, 'access', _10 => _10.resolvers, 'optionalAccess', _11 => _11.length]))
184
186
  console.warn("[unplugin-vue-components] no components found");
@@ -199,7 +201,6 @@ var defaultOptions = {
199
201
  globalNamespaces: [],
200
202
  transformerUserResolveFunctions: true,
201
203
  resolvers: [],
202
- globsExclude: [],
203
204
  importPathTransform: (v) => v,
204
205
  allowOverrides: false
205
206
  };
@@ -208,25 +209,40 @@ function normalizeResolvers(resolvers) {
208
209
  }
209
210
  function resolveGlobsExclude(root, glob) {
210
211
  const excludeReg = /^!/;
211
- return `${excludeReg.test(glob) ? "!" : ""}${_path.resolve.call(void 0, root, glob.replace(excludeReg, ""))}`;
212
+ return _chunkCYD4VYHZcjs.slash.call(void 0, `${excludeReg.test(glob) ? "!" : ""}${_path.resolve.call(void 0, root, glob.replace(excludeReg, ""))}`);
212
213
  }
213
214
  function resolveOptions(options, root) {
214
215
  const resolved = Object.assign({}, defaultOptions, options);
215
216
  resolved.resolvers = normalizeResolvers(resolved.resolvers);
216
217
  resolved.extensions = _chunkCYD4VYHZcjs.toArray.call(void 0, resolved.extensions);
217
218
  if (resolved.globs) {
218
- resolved.globs = _chunkCYD4VYHZcjs.toArray.call(void 0, resolved.globs).map((glob) => _chunkCYD4VYHZcjs.slash.call(void 0, resolveGlobsExclude(root, glob)));
219
+ resolved.globs = _chunkCYD4VYHZcjs.toArray.call(void 0, resolved.globs).map((glob) => resolveGlobsExclude(root, glob));
219
220
  resolved.resolvedDirs = [];
220
221
  } else {
221
222
  const extsGlob = resolved.extensions.length === 1 ? resolved.extensions : `{${resolved.extensions.join(",")}}`;
222
223
  resolved.dirs = _chunkCYD4VYHZcjs.toArray.call(void 0, resolved.dirs);
223
- resolved.resolvedDirs = resolved.dirs.map((i) => _chunkCYD4VYHZcjs.slash.call(void 0, resolveGlobsExclude(root, i)));
224
- resolved.globs = resolved.resolvedDirs.map(
225
- (i) => resolved.deep ? _chunkCYD4VYHZcjs.slash.call(void 0, _path.join.call(void 0, i, `**/*.${extsGlob}`)) : _chunkCYD4VYHZcjs.slash.call(void 0, _path.join.call(void 0, i, `*.${extsGlob}`))
226
- );
224
+ const globs = resolved.dirs.map((i) => resolveGlobsExclude(root, i));
225
+ resolved.resolvedDirs = globs.filter((i) => !i.startsWith("!"));
226
+ resolved.globs = globs.map((i) => {
227
+ let prefix = "";
228
+ if (i.startsWith("!")) {
229
+ prefix = "!";
230
+ i = i.slice(1);
231
+ }
232
+ return resolved.deep ? prefix + _chunkCYD4VYHZcjs.slash.call(void 0, _path.join.call(void 0, i, `**/*.${extsGlob}`)) : prefix + _chunkCYD4VYHZcjs.slash.call(void 0, _path.join.call(void 0, i, `*.${extsGlob}`));
233
+ });
227
234
  if (!resolved.extensions.length)
228
235
  throw new Error("[unplugin-vue-components] `extensions` option is required to search for components");
229
236
  }
237
+ if (!resolved.globsExclude)
238
+ resolved.globsExclude = [`**/node_modules/**`];
239
+ resolved.globsExclude = _chunkCYD4VYHZcjs.toArray.call(void 0, resolved.globsExclude || []).map((i) => resolveGlobsExclude(root, i));
240
+ resolved.globs = resolved.globs.filter((i) => {
241
+ if (!i.startsWith("!"))
242
+ return true;
243
+ resolved.globsExclude.push(i.slice(1));
244
+ return false;
245
+ });
230
246
  resolved.dts = !resolved.dts ? false : _path.resolve.call(void 0,
231
247
  root,
232
248
  typeof resolved.dts === "string" ? resolved.dts : "components.d.ts"
package/dist/esbuild.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkQKHJKWZTcjs = require('./chunk-QKHJKWZT.cjs');
3
+ var _chunkZ44OFZ6Mcjs = require('./chunk-Z44OFZ6M.cjs');
4
4
  require('./chunk-CYD4VYHZ.cjs');
5
5
  require('./chunk-3HT76LNN.cjs');
6
6
  require('./chunk-ZBPRDZS4.cjs');
7
7
 
8
8
  // src/esbuild.ts
9
- var esbuild_default = _chunkQKHJKWZTcjs.unplugin_default.esbuild;
9
+ var esbuild_default = _chunkZ44OFZ6Mcjs.unplugin_default.esbuild;
10
10
 
11
11
 
12
12
  exports.default = esbuild_default;
package/dist/esbuild.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-ZEYMMBWZ.js";
3
+ } from "./chunk-GDXMSVFX.js";
4
4
  import "./chunk-UZ5LIG7M.js";
5
5
  import "./chunk-QGM4M3NI.js";
6
6
  import "./chunk-6F4PWJZI.js";
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkQKHJKWZTcjs = require('./chunk-QKHJKWZT.cjs');
3
+ var _chunkZ44OFZ6Mcjs = require('./chunk-Z44OFZ6M.cjs');
4
4
 
5
5
 
6
6
 
@@ -13,4 +13,4 @@ require('./chunk-ZBPRDZS4.cjs');
13
13
 
14
14
 
15
15
 
16
- exports.camelCase = _chunkCYD4VYHZcjs.camelCase; exports.default = _chunkQKHJKWZTcjs.unplugin_default; exports.kebabCase = _chunkCYD4VYHZcjs.kebabCase; exports.pascalCase = _chunkCYD4VYHZcjs.pascalCase;
16
+ exports.camelCase = _chunkCYD4VYHZcjs.camelCase; exports.default = _chunkZ44OFZ6Mcjs.unplugin_default; exports.kebabCase = _chunkCYD4VYHZcjs.kebabCase; exports.pascalCase = _chunkCYD4VYHZcjs.pascalCase;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-ZEYMMBWZ.js";
3
+ } from "./chunk-GDXMSVFX.js";
4
4
  import {
5
5
  camelCase,
6
6
  kebabCase,
package/dist/nuxt.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkQKHJKWZTcjs = require('./chunk-QKHJKWZT.cjs');
3
+ var _chunkZ44OFZ6Mcjs = require('./chunk-Z44OFZ6M.cjs');
4
4
  require('./chunk-CYD4VYHZ.cjs');
5
5
  require('./chunk-3HT76LNN.cjs');
6
6
  require('./chunk-ZBPRDZS4.cjs');
@@ -9,8 +9,8 @@ require('./chunk-ZBPRDZS4.cjs');
9
9
  var _kit = require('@nuxt/kit');
10
10
  var nuxt_default = _kit.defineNuxtModule.call(void 0, {
11
11
  setup(options) {
12
- _kit.addWebpackPlugin.call(void 0, _chunkQKHJKWZTcjs.unplugin_default.webpack(options));
13
- _kit.addVitePlugin.call(void 0, _chunkQKHJKWZTcjs.unplugin_default.vite(options));
12
+ _kit.addWebpackPlugin.call(void 0, _chunkZ44OFZ6Mcjs.unplugin_default.webpack(options));
13
+ _kit.addVitePlugin.call(void 0, _chunkZ44OFZ6Mcjs.unplugin_default.vite(options));
14
14
  }
15
15
  });
16
16
 
package/dist/nuxt.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-ZEYMMBWZ.js";
3
+ } from "./chunk-GDXMSVFX.js";
4
4
  import "./chunk-UZ5LIG7M.js";
5
5
  import "./chunk-QGM4M3NI.js";
6
6
  import "./chunk-6F4PWJZI.js";
@@ -1458,6 +1458,12 @@ function TDesignResolver(options = {}) {
1458
1458
  from: `tdesign-icons-${library}${importFrom}`
1459
1459
  };
1460
1460
  }
1461
+ if (name.startsWith("TTypography") || name.startsWith("Typography")) {
1462
+ return {
1463
+ name: name.slice(name.startsWith("TTypography") ? 11 : 10),
1464
+ from: `tdesign-${library}${importFrom}`
1465
+ };
1466
+ }
1461
1467
  if (name.match(/^T[A-Z]/) || pluginList.includes(name)) {
1462
1468
  const importName = name.match(/^T[A-Z]/) ? name.slice(1) : name;
1463
1469
  return {
package/dist/resolvers.js CHANGED
@@ -1458,6 +1458,12 @@ function TDesignResolver(options = {}) {
1458
1458
  from: `tdesign-icons-${library}${importFrom}`
1459
1459
  };
1460
1460
  }
1461
+ if (name.startsWith("TTypography") || name.startsWith("Typography")) {
1462
+ return {
1463
+ name: name.slice(name.startsWith("TTypography") ? 11 : 10),
1464
+ from: `tdesign-${library}${importFrom}`
1465
+ };
1466
+ }
1461
1467
  if (name.match(/^T[A-Z]/) || pluginList.includes(name)) {
1462
1468
  const importName = name.match(/^T[A-Z]/) ? name.slice(1) : name;
1463
1469
  return {
package/dist/rollup.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkQKHJKWZTcjs = require('./chunk-QKHJKWZT.cjs');
3
+ var _chunkZ44OFZ6Mcjs = require('./chunk-Z44OFZ6M.cjs');
4
4
  require('./chunk-CYD4VYHZ.cjs');
5
5
  require('./chunk-3HT76LNN.cjs');
6
6
  require('./chunk-ZBPRDZS4.cjs');
7
7
 
8
8
  // src/rollup.ts
9
- var rollup_default = _chunkQKHJKWZTcjs.unplugin_default.rollup;
9
+ var rollup_default = _chunkZ44OFZ6Mcjs.unplugin_default.rollup;
10
10
 
11
11
 
12
12
  exports.default = rollup_default;
package/dist/rollup.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-ZEYMMBWZ.js";
3
+ } from "./chunk-GDXMSVFX.js";
4
4
  import "./chunk-UZ5LIG7M.js";
5
5
  import "./chunk-QGM4M3NI.js";
6
6
  import "./chunk-6F4PWJZI.js";
package/dist/rspack.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkQKHJKWZTcjs = require('./chunk-QKHJKWZT.cjs');
3
+ var _chunkZ44OFZ6Mcjs = require('./chunk-Z44OFZ6M.cjs');
4
4
  require('./chunk-CYD4VYHZ.cjs');
5
5
  require('./chunk-3HT76LNN.cjs');
6
6
  require('./chunk-ZBPRDZS4.cjs');
7
7
 
8
8
  // src/rspack.ts
9
- var rspack_default = _chunkQKHJKWZTcjs.unplugin_default.rspack;
9
+ var rspack_default = _chunkZ44OFZ6Mcjs.unplugin_default.rspack;
10
10
 
11
11
 
12
12
  exports.default = rspack_default;
package/dist/rspack.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-ZEYMMBWZ.js";
3
+ } from "./chunk-GDXMSVFX.js";
4
4
  import "./chunk-UZ5LIG7M.js";
5
5
  import "./chunk-QGM4M3NI.js";
6
6
  import "./chunk-6F4PWJZI.js";
package/dist/types.d.cts CHANGED
@@ -81,7 +81,7 @@ interface Options {
81
81
  /**
82
82
  * Negated glob patterns to exclude files from being detected as components.
83
83
  *
84
- * @default []
84
+ * @default ['<root>/**\/node_modules/**']
85
85
  */
86
86
  globsExclude?: string | string[];
87
87
  /**
@@ -175,6 +175,7 @@ type ResolvedOptions = Omit<Required<Options>, 'resolvers' | 'extensions' | 'dir
175
175
  dirs: string[];
176
176
  resolvedDirs: string[];
177
177
  globs: string[];
178
+ globsExclude: string[];
178
179
  dts: string | false;
179
180
  root: string;
180
181
  };
package/dist/types.d.ts CHANGED
@@ -81,7 +81,7 @@ interface Options {
81
81
  /**
82
82
  * Negated glob patterns to exclude files from being detected as components.
83
83
  *
84
- * @default []
84
+ * @default ['<root>/**\/node_modules/**']
85
85
  */
86
86
  globsExclude?: string | string[];
87
87
  /**
@@ -175,6 +175,7 @@ type ResolvedOptions = Omit<Required<Options>, 'resolvers' | 'extensions' | 'dir
175
175
  dirs: string[];
176
176
  resolvedDirs: string[];
177
177
  globs: string[];
178
+ globsExclude: string[];
178
179
  dts: string | false;
179
180
  root: string;
180
181
  };
package/dist/vite.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkQKHJKWZTcjs = require('./chunk-QKHJKWZT.cjs');
3
+ var _chunkZ44OFZ6Mcjs = require('./chunk-Z44OFZ6M.cjs');
4
4
  require('./chunk-CYD4VYHZ.cjs');
5
5
  require('./chunk-3HT76LNN.cjs');
6
6
  require('./chunk-ZBPRDZS4.cjs');
7
7
 
8
8
  // src/vite.ts
9
- var vite_default = _chunkQKHJKWZTcjs.unplugin_default.vite;
9
+ var vite_default = _chunkZ44OFZ6Mcjs.unplugin_default.vite;
10
10
 
11
11
 
12
12
  exports.default = vite_default;
package/dist/vite.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-ZEYMMBWZ.js";
3
+ } from "./chunk-GDXMSVFX.js";
4
4
  import "./chunk-UZ5LIG7M.js";
5
5
  import "./chunk-QGM4M3NI.js";
6
6
  import "./chunk-6F4PWJZI.js";
package/dist/webpack.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkQKHJKWZTcjs = require('./chunk-QKHJKWZT.cjs');
3
+ var _chunkZ44OFZ6Mcjs = require('./chunk-Z44OFZ6M.cjs');
4
4
  require('./chunk-CYD4VYHZ.cjs');
5
5
  require('./chunk-3HT76LNN.cjs');
6
6
  require('./chunk-ZBPRDZS4.cjs');
7
7
 
8
8
  // src/webpack.ts
9
- var webpack_default = _chunkQKHJKWZTcjs.unplugin_default.webpack;
9
+ var webpack_default = _chunkZ44OFZ6Mcjs.unplugin_default.webpack;
10
10
 
11
11
 
12
12
  exports.default = webpack_default;
package/dist/webpack.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unplugin_default
3
- } from "./chunk-ZEYMMBWZ.js";
3
+ } from "./chunk-GDXMSVFX.js";
4
4
  import "./chunk-UZ5LIG7M.js";
5
5
  import "./chunk-QGM4M3NI.js";
6
6
  import "./chunk-6F4PWJZI.js";
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "unplugin-vue-components",
3
3
  "type": "module",
4
- "version": "28.3.0",
5
- "packageManager": "pnpm@10.4.0",
4
+ "version": "28.4.0",
6
5
  "description": "Components auto importing for Vue",
7
6
  "author": "antfu <anthonyfu117@hotmail.com>",
8
7
  "license": "MIT",
@@ -68,17 +67,6 @@
68
67
  "engines": {
69
68
  "node": ">=14"
70
69
  },
71
- "scripts": {
72
- "build": "tsup",
73
- "dev": "tsup --watch src",
74
- "example:build": "npm -C examples/vite-vue3 run build",
75
- "example:dev": "npm -C examples/vite-vue3 run dev",
76
- "prepublishOnly": "npm run build",
77
- "lint": "eslint .",
78
- "release": "bumpp && npm publish",
79
- "test": "vitest",
80
- "test:update": "vitest --u"
81
- },
82
70
  "peerDependencies": {
83
71
  "@babel/parser": "^7.15.8",
84
72
  "@nuxt/kit": "^3.2.2",
@@ -128,5 +116,15 @@
128
116
  "vitest": "^3.0.5",
129
117
  "vue": "3.2.45",
130
118
  "vue-tsc": "^2.2.0"
119
+ },
120
+ "scripts": {
121
+ "build": "tsup",
122
+ "dev": "tsup --watch src",
123
+ "example:build": "npm -C examples/vite-vue3 run build",
124
+ "example:dev": "npm -C examples/vite-vue3 run dev",
125
+ "lint": "eslint .",
126
+ "release": "bumpp && npm publish",
127
+ "test": "vitest",
128
+ "test:update": "vitest --u"
131
129
  }
132
- }
130
+ }