unplugin-vue-components 29.1.0 → 30.0.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 (46) hide show
  1. package/README.md +4 -0
  2. package/dist/esbuild.cjs +2 -2
  3. package/dist/esbuild.d.cts +1 -1
  4. package/dist/esbuild.d.ts +1 -1
  5. package/dist/esbuild.js +2 -2
  6. package/dist/index.cjs +2 -2
  7. package/dist/index.d.cts +1 -1
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.js +2 -2
  10. package/dist/nuxt.cjs +2 -2
  11. package/dist/nuxt.d.cts +1 -1
  12. package/dist/nuxt.d.ts +1 -1
  13. package/dist/nuxt.js +2 -2
  14. package/dist/resolvers.cjs +9 -17
  15. package/dist/resolvers.d.cts +1 -1
  16. package/dist/resolvers.d.ts +1 -1
  17. package/dist/resolvers.js +9 -17
  18. package/dist/rolldown.cjs +2 -2
  19. package/dist/rolldown.d.cts +1 -1
  20. package/dist/rolldown.d.ts +1 -1
  21. package/dist/rolldown.js +2 -2
  22. package/dist/rollup.cjs +2 -2
  23. package/dist/rollup.d.cts +1 -1
  24. package/dist/rollup.d.ts +1 -1
  25. package/dist/rollup.js +2 -2
  26. package/dist/rspack.cjs +2 -2
  27. package/dist/rspack.d.cts +1 -1
  28. package/dist/rspack.d.ts +1 -1
  29. package/dist/rspack.js +2 -2
  30. package/dist/{src-CbJqJu6O.js → src-BcnnO6GN.js} +27 -17
  31. package/dist/{src-Ctx_G96r.cjs → src-DzdkjKhH.cjs} +28 -18
  32. package/dist/{types-BgF15syy.d.ts → types-DSJ5r-ta.d.cts} +9 -1
  33. package/dist/{types-dp3LCoF8.d.cts → types-rC3290ja.d.ts} +9 -1
  34. package/dist/types.d.cts +1 -1
  35. package/dist/types.d.ts +1 -1
  36. package/dist/{utils-c-ZB7b5u.cjs → utils-8UQ22cuO.cjs} +8 -11
  37. package/dist/{utils-BPB1pAS0.js → utils-BoXu-4gQ.js} +8 -11
  38. package/dist/vite.cjs +2 -2
  39. package/dist/vite.d.cts +1 -1
  40. package/dist/vite.d.ts +1 -1
  41. package/dist/vite.js +2 -2
  42. package/dist/webpack.cjs +2 -2
  43. package/dist/webpack.d.cts +1 -1
  44. package/dist/webpack.d.ts +1 -1
  45. package/dist/webpack.js +2 -2
  46. package/package.json +17 -18
package/README.md CHANGED
@@ -423,6 +423,10 @@ Components({
423
423
  // default: `true` if package typescript is installed
424
424
  dts: false,
425
425
 
426
+ // generate dts with TSX support
427
+ // default: `true` if `@vitejs/plugin-vue-jsx` is installed
428
+ dtsTsx: false,
429
+
426
430
  // Allow subdirectories as namespace prefix for components.
427
431
  directoryAsNamespace: false,
428
432
 
package/dist/esbuild.cjs CHANGED
@@ -1,5 +1,5 @@
1
- require('./utils-c-ZB7b5u.cjs');
2
- const require_src = require('./src-Ctx_G96r.cjs');
1
+ require('./utils-8UQ22cuO.cjs');
2
+ const require_src = require('./src-DzdkjKhH.cjs');
3
3
  require('./types-CBTc19th.cjs');
4
4
 
5
5
  //#region src/esbuild.ts
@@ -1,4 +1,4 @@
1
- import { Options } from "./types-dp3LCoF8.cjs";
1
+ import { Options } from "./types-DSJ5r-ta.cjs";
2
2
  import * as esbuild0 from "esbuild";
3
3
 
4
4
  //#region src/esbuild.d.ts
package/dist/esbuild.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options } from "./types-BgF15syy.js";
1
+ import { Options } from "./types-rC3290ja.js";
2
2
  import * as esbuild0 from "esbuild";
3
3
 
4
4
  //#region src/esbuild.d.ts
package/dist/esbuild.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./utils-BPB1pAS0.js";
2
- import { unplugin_default } from "./src-CbJqJu6O.js";
1
+ import "./utils-BoXu-4gQ.js";
2
+ import { unplugin_default } from "./src-BcnnO6GN.js";
3
3
  import "./types-DQoXDiso.js";
4
4
 
5
5
  //#region src/esbuild.ts
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_utils = require('./utils-c-ZB7b5u.cjs');
3
- const require_src = require('./src-Ctx_G96r.cjs');
2
+ const require_utils = require('./utils-8UQ22cuO.cjs');
3
+ const require_src = require('./src-DzdkjKhH.cjs');
4
4
  require('./types-CBTc19th.cjs');
5
5
 
6
6
  exports.camelCase = require_utils.camelCase;
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { ComponentInfo, ComponentResolveResult, ComponentResolver, ComponentResolverFunction, ComponentResolverObject, ComponentsImportMap, ImportInfo, ImportInfoLegacy, Matcher, Options, PublicPluginAPI, ResolvedOptions, SideEffectsInfo, SupportedTransformer, Transformer, TypeImport } from "./types-dp3LCoF8.cjs";
1
+ import { ComponentInfo, ComponentResolveResult, ComponentResolver, ComponentResolverFunction, ComponentResolverObject, ComponentsImportMap, ImportInfo, ImportInfoLegacy, Matcher, Options, PublicPluginAPI, ResolvedOptions, SideEffectsInfo, SupportedTransformer, Transformer, TypeImport } from "./types-DSJ5r-ta.cjs";
2
2
  import * as unplugin0 from "unplugin";
3
3
  import { FilterPattern } from "unplugin-utils";
4
4
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ComponentInfo, ComponentResolveResult, ComponentResolver, ComponentResolverFunction, ComponentResolverObject, ComponentsImportMap, ImportInfo, ImportInfoLegacy, Matcher, Options, PublicPluginAPI, ResolvedOptions, SideEffectsInfo, SupportedTransformer, Transformer, TypeImport } from "./types-BgF15syy.js";
1
+ import { ComponentInfo, ComponentResolveResult, ComponentResolver, ComponentResolverFunction, ComponentResolverObject, ComponentsImportMap, ImportInfo, ImportInfoLegacy, Matcher, Options, PublicPluginAPI, ResolvedOptions, SideEffectsInfo, SupportedTransformer, Transformer, TypeImport } from "./types-rC3290ja.js";
2
2
  import * as unplugin0 from "unplugin";
3
3
  import { FilterPattern } from "unplugin-utils";
4
4
 
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { camelCase, kebabCase, pascalCase } from "./utils-BPB1pAS0.js";
2
- import { unplugin_default } from "./src-CbJqJu6O.js";
1
+ import { camelCase, kebabCase, pascalCase } from "./utils-BoXu-4gQ.js";
2
+ import { unplugin_default } from "./src-BcnnO6GN.js";
3
3
  import "./types-DQoXDiso.js";
4
4
 
5
5
  export { camelCase, unplugin_default as default, kebabCase, pascalCase };
package/dist/nuxt.cjs CHANGED
@@ -1,5 +1,5 @@
1
- const require_utils = require('./utils-c-ZB7b5u.cjs');
2
- const require_src = require('./src-Ctx_G96r.cjs');
1
+ const require_utils = require('./utils-8UQ22cuO.cjs');
2
+ const require_src = require('./src-DzdkjKhH.cjs');
3
3
  require('./types-CBTc19th.cjs');
4
4
  let __nuxt_kit = require("@nuxt/kit");
5
5
  __nuxt_kit = require_utils.__toESM(__nuxt_kit);
package/dist/nuxt.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options } from "./types-dp3LCoF8.cjs";
1
+ import { Options } from "./types-DSJ5r-ta.cjs";
2
2
  import * as _nuxt_schema0 from "@nuxt/schema";
3
3
 
4
4
  //#region src/nuxt.d.ts
package/dist/nuxt.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options } from "./types-BgF15syy.js";
1
+ import { Options } from "./types-rC3290ja.js";
2
2
  import * as _nuxt_schema0 from "@nuxt/schema";
3
3
 
4
4
  //#region src/nuxt.d.ts
package/dist/nuxt.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./utils-BPB1pAS0.js";
2
- import { unplugin_default } from "./src-CbJqJu6O.js";
1
+ import "./utils-BoXu-4gQ.js";
2
+ import { unplugin_default } from "./src-BcnnO6GN.js";
3
3
  import "./types-DQoXDiso.js";
4
4
  import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
5
5
 
@@ -1,4 +1,4 @@
1
- const require_utils = require('./utils-c-ZB7b5u.cjs');
1
+ const require_utils = require('./utils-8UQ22cuO.cjs');
2
2
  let node_fs = require("node:fs");
3
3
  node_fs = require_utils.__toESM(node_fs);
4
4
  let node_process = require("node:process");
@@ -229,13 +229,8 @@ function getSideEffects$8(compName, options) {
229
229
  if (!importStyle) return;
230
230
  const lib = options.cjs ? "lib" : "es";
231
231
  const packageName = (options === null || options === void 0 ? void 0 : options.packageName) || "ant-design-vue";
232
- if (importStyle === "less" || importStyle === "css-in-js" || importLess) {
233
- const styleDir = getStyleDir(compName);
234
- return `${packageName}/${lib}/${styleDir}/style`;
235
- } else {
236
- const styleDir = getStyleDir(compName);
237
- return `${packageName}/${lib}/${styleDir}/style/css`;
238
- }
232
+ if (importStyle === "less" || importStyle === "css-in-js" || importLess) return `${packageName}/${lib}/${getStyleDir(compName)}/style`;
233
+ else return `${packageName}/${lib}/${getStyleDir(compName)}/style/css`;
239
234
  }
240
235
  const primitiveNames = [
241
236
  "Affix",
@@ -1122,8 +1117,7 @@ function ElementUiResolver(options = {}) {
1122
1117
  resolve: (name) => {
1123
1118
  if (options.exclude && name.match(options.exclude)) return;
1124
1119
  if (/^El[A-Z]/.test(name)) {
1125
- const compName = name.slice(2);
1126
- const partialName = require_utils.kebabCase(compName);
1120
+ const partialName = require_utils.kebabCase(name.slice(2));
1127
1121
  if (partialName === "collapse-transition") return { from: `element-ui/lib/transitions/${partialName}` };
1128
1122
  return {
1129
1123
  from: `element-ui/lib/${partialName}`,
@@ -1249,11 +1243,10 @@ function IduxResolver(options = {}) {
1249
1243
  dirname = require_utils.kebabCase(name).split("-")[nameIndex];
1250
1244
  }
1251
1245
  const path = `${scope}/${packageName}/${dirname}`;
1252
- const sideEffects = packageName === "cdk" ? void 0 : getSideEffects$4(resolvedVersion, path, importStyle, importStyleTheme);
1253
1246
  return {
1254
1247
  name,
1255
1248
  from: path,
1256
- sideEffects
1249
+ sideEffects: packageName === "cdk" ? void 0 : getSideEffects$4(resolvedVersion, path, importStyle, importStyleTheme)
1257
1250
  };
1258
1251
  }
1259
1252
  };
@@ -1344,6 +1337,7 @@ const IonicBuiltInComponents = [
1344
1337
  "IonInfiniteScroll",
1345
1338
  "IonInfiniteScrollContent",
1346
1339
  "IonInput",
1340
+ "IonInputOtp",
1347
1341
  "IonInputPasswordToggle",
1348
1342
  "IonItem",
1349
1343
  "IonItemDivider",
@@ -1863,11 +1857,10 @@ function VeuiResolver(options = {}) {
1863
1857
  if (name.match(/^Veui[A-Z]/)) {
1864
1858
  const componentName = name.slice(4);
1865
1859
  if (!components$1.has(componentName)) return;
1866
- const sideEffects = getSideEffects$1(componentName, options);
1867
1860
  return {
1868
1861
  name: componentName,
1869
1862
  from: alias,
1870
- sideEffects
1863
+ sideEffects: getSideEffects$1(componentName, options)
1871
1864
  };
1872
1865
  }
1873
1866
  }
@@ -1892,8 +1885,7 @@ function getSideEffects$1(name, { alias = VEUI_PACKAGE_NAME, modules = [], local
1892
1885
  const localeModules = (locale ? Array.isArray(locale) ? locale : [locale] : []).map((locale$1) => `${alias}/locale/${locale$1}/${name}.js`);
1893
1886
  const peerModules = modules.map(({ package: pack, path = "components", fileName = "{module}.css", transform = "kebab-case" }) => {
1894
1887
  const peer = transform ? formatters[transform](name) : name;
1895
- const file = fileName.replace(/\$?\{module\}/g, peer);
1896
- return (0, node_path.normalize)((0, node_path.join)(pack, path, file));
1888
+ return (0, node_path.normalize)((0, node_path.join)(pack, path, fileName.replace(/\$?\{module\}/g, peer)));
1897
1889
  });
1898
1890
  return [
1899
1891
  ...localeModules,
@@ -2045,7 +2037,7 @@ function VueUseDirectiveResolver() {
2045
2037
  }
2046
2038
  if (directives && directives.includes(name)) return {
2047
2039
  name: `v${name}`,
2048
- as: name,
2040
+ as: `v${name}`,
2049
2041
  from: "@vueuse/components"
2050
2042
  };
2051
2043
  }
@@ -1,4 +1,4 @@
1
- import { ComponentResolveResult, ComponentResolver } from "./types-dp3LCoF8.cjs";
1
+ import { ComponentResolveResult, ComponentResolver } from "./types-DSJ5r-ta.cjs";
2
2
  import { FilterPattern } from "unplugin-utils";
3
3
 
4
4
  //#region src/core/resolvers/antdv.d.ts
@@ -1,4 +1,4 @@
1
- import { ComponentResolveResult, ComponentResolver } from "./types-BgF15syy.js";
1
+ import { ComponentResolveResult, ComponentResolver } from "./types-rC3290ja.js";
2
2
  import { FilterPattern } from "unplugin-utils";
3
3
 
4
4
  //#region src/core/resolvers/antdv.d.ts
package/dist/resolvers.js CHANGED
@@ -1,4 +1,4 @@
1
- import { camelCase, getPkgVersion, isExclude, isSSR, kebabCase, pascalCase } from "./utils-BPB1pAS0.js";
1
+ import { camelCase, getPkgVersion, isExclude, isSSR, kebabCase, pascalCase } from "./utils-BoXu-4gQ.js";
2
2
  import { createRequire } from "node:module";
3
3
  import { promises, readFileSync } from "node:fs";
4
4
  import process from "node:process";
@@ -251,13 +251,8 @@ function getSideEffects$8(compName, options) {
251
251
  if (!importStyle) return;
252
252
  const lib = options.cjs ? "lib" : "es";
253
253
  const packageName = (options === null || options === void 0 ? void 0 : options.packageName) || "ant-design-vue";
254
- if (importStyle === "less" || importStyle === "css-in-js" || importLess) {
255
- const styleDir = getStyleDir(compName);
256
- return `${packageName}/${lib}/${styleDir}/style`;
257
- } else {
258
- const styleDir = getStyleDir(compName);
259
- return `${packageName}/${lib}/${styleDir}/style/css`;
260
- }
254
+ if (importStyle === "less" || importStyle === "css-in-js" || importLess) return `${packageName}/${lib}/${getStyleDir(compName)}/style`;
255
+ else return `${packageName}/${lib}/${getStyleDir(compName)}/style/css`;
261
256
  }
262
257
  const primitiveNames = [
263
258
  "Affix",
@@ -1144,8 +1139,7 @@ function ElementUiResolver(options = {}) {
1144
1139
  resolve: (name) => {
1145
1140
  if (options.exclude && name.match(options.exclude)) return;
1146
1141
  if (/^El[A-Z]/.test(name)) {
1147
- const compName = name.slice(2);
1148
- const partialName = kebabCase(compName);
1142
+ const partialName = kebabCase(name.slice(2));
1149
1143
  if (partialName === "collapse-transition") return { from: `element-ui/lib/transitions/${partialName}` };
1150
1144
  return {
1151
1145
  from: `element-ui/lib/${partialName}`,
@@ -1271,11 +1265,10 @@ function IduxResolver(options = {}) {
1271
1265
  dirname$1 = kebabCase(name).split("-")[nameIndex];
1272
1266
  }
1273
1267
  const path = `${scope}/${packageName}/${dirname$1}`;
1274
- const sideEffects = packageName === "cdk" ? void 0 : getSideEffects$4(resolvedVersion, path, importStyle, importStyleTheme);
1275
1268
  return {
1276
1269
  name,
1277
1270
  from: path,
1278
- sideEffects
1271
+ sideEffects: packageName === "cdk" ? void 0 : getSideEffects$4(resolvedVersion, path, importStyle, importStyleTheme)
1279
1272
  };
1280
1273
  }
1281
1274
  };
@@ -1366,6 +1359,7 @@ const IonicBuiltInComponents = [
1366
1359
  "IonInfiniteScroll",
1367
1360
  "IonInfiniteScrollContent",
1368
1361
  "IonInput",
1362
+ "IonInputOtp",
1369
1363
  "IonInputPasswordToggle",
1370
1364
  "IonItem",
1371
1365
  "IonItemDivider",
@@ -1885,11 +1879,10 @@ function VeuiResolver(options = {}) {
1885
1879
  if (name.match(/^Veui[A-Z]/)) {
1886
1880
  const componentName = name.slice(4);
1887
1881
  if (!components$1.has(componentName)) return;
1888
- const sideEffects = getSideEffects$1(componentName, options);
1889
1882
  return {
1890
1883
  name: componentName,
1891
1884
  from: alias,
1892
- sideEffects
1885
+ sideEffects: getSideEffects$1(componentName, options)
1893
1886
  };
1894
1887
  }
1895
1888
  }
@@ -1914,8 +1907,7 @@ function getSideEffects$1(name, { alias = VEUI_PACKAGE_NAME, modules = [], local
1914
1907
  const localeModules = (locale ? Array.isArray(locale) ? locale : [locale] : []).map((locale$1) => `${alias}/locale/${locale$1}/${name}.js`);
1915
1908
  const peerModules = modules.map(({ package: pack, path = "components", fileName = "{module}.css", transform = "kebab-case" }) => {
1916
1909
  const peer = transform ? formatters[transform](name) : name;
1917
- const file = fileName.replace(/\$?\{module\}/g, peer);
1918
- return normalize(join(pack, path, file));
1910
+ return normalize(join(pack, path, fileName.replace(/\$?\{module\}/g, peer)));
1919
1911
  });
1920
1912
  return [
1921
1913
  ...localeModules,
@@ -2067,7 +2059,7 @@ function VueUseDirectiveResolver() {
2067
2059
  }
2068
2060
  if (directives && directives.includes(name)) return {
2069
2061
  name: `v${name}`,
2070
- as: name,
2062
+ as: `v${name}`,
2071
2063
  from: "@vueuse/components"
2072
2064
  };
2073
2065
  }
package/dist/rolldown.cjs CHANGED
@@ -1,5 +1,5 @@
1
- require('./utils-c-ZB7b5u.cjs');
2
- const require_src = require('./src-Ctx_G96r.cjs');
1
+ require('./utils-8UQ22cuO.cjs');
2
+ const require_src = require('./src-DzdkjKhH.cjs');
3
3
  require('./types-CBTc19th.cjs');
4
4
 
5
5
  //#region src/rolldown.ts
@@ -1,4 +1,4 @@
1
- import { Options } from "./types-dp3LCoF8.cjs";
1
+ import { Options } from "./types-DSJ5r-ta.cjs";
2
2
  import * as rolldown0 from "rolldown";
3
3
 
4
4
  //#region src/rolldown.d.ts
@@ -1,4 +1,4 @@
1
- import { Options } from "./types-BgF15syy.js";
1
+ import { Options } from "./types-rC3290ja.js";
2
2
  import * as rolldown0 from "rolldown";
3
3
 
4
4
  //#region src/rolldown.d.ts
package/dist/rolldown.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./utils-BPB1pAS0.js";
2
- import { unplugin_default } from "./src-CbJqJu6O.js";
1
+ import "./utils-BoXu-4gQ.js";
2
+ import { unplugin_default } from "./src-BcnnO6GN.js";
3
3
  import "./types-DQoXDiso.js";
4
4
 
5
5
  //#region src/rolldown.ts
package/dist/rollup.cjs CHANGED
@@ -1,5 +1,5 @@
1
- require('./utils-c-ZB7b5u.cjs');
2
- const require_src = require('./src-Ctx_G96r.cjs');
1
+ require('./utils-8UQ22cuO.cjs');
2
+ const require_src = require('./src-DzdkjKhH.cjs');
3
3
  require('./types-CBTc19th.cjs');
4
4
 
5
5
  //#region src/rollup.ts
package/dist/rollup.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options } from "./types-dp3LCoF8.cjs";
1
+ import { Options } from "./types-DSJ5r-ta.cjs";
2
2
  import * as rollup0 from "rollup";
3
3
 
4
4
  //#region src/rollup.d.ts
package/dist/rollup.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options } from "./types-BgF15syy.js";
1
+ import { Options } from "./types-rC3290ja.js";
2
2
  import * as rollup0 from "rollup";
3
3
 
4
4
  //#region src/rollup.d.ts
package/dist/rollup.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./utils-BPB1pAS0.js";
2
- import { unplugin_default } from "./src-CbJqJu6O.js";
1
+ import "./utils-BoXu-4gQ.js";
2
+ import { unplugin_default } from "./src-BcnnO6GN.js";
3
3
  import "./types-DQoXDiso.js";
4
4
 
5
5
  //#region src/rollup.ts
package/dist/rspack.cjs CHANGED
@@ -1,5 +1,5 @@
1
- require('./utils-c-ZB7b5u.cjs');
2
- const require_src = require('./src-Ctx_G96r.cjs');
1
+ require('./utils-8UQ22cuO.cjs');
2
+ const require_src = require('./src-DzdkjKhH.cjs');
3
3
  require('./types-CBTc19th.cjs');
4
4
 
5
5
  //#region src/rspack.ts
package/dist/rspack.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options } from "./types-dp3LCoF8.cjs";
1
+ import { Options } from "./types-DSJ5r-ta.cjs";
2
2
 
3
3
  //#region src/rspack.d.ts
4
4
  declare const _default: (options: Options) => RspackPluginInstance;
package/dist/rspack.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options } from "./types-BgF15syy.js";
1
+ import { Options } from "./types-rC3290ja.js";
2
2
 
3
3
  //#region src/rspack.d.ts
4
4
  declare const _default: (options: Options) => RspackPluginInstance;
package/dist/rspack.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./utils-BPB1pAS0.js";
2
- import { unplugin_default } from "./src-CbJqJu6O.js";
1
+ import "./utils-BoXu-4gQ.js";
2
+ import { unplugin_default } from "./src-BcnnO6GN.js";
3
3
  import "./types-DQoXDiso.js";
4
4
 
5
5
  //#region src/rspack.ts
@@ -1,14 +1,14 @@
1
- import { DIRECTIVE_IMPORT_PREFIX, DISABLE_COMMENT, escapeSpecialChars, getNameFromFilePath, getTransformedPath, isExclude, matchGlobs, normalizeComponentInfo, notNullish, parseId, pascalCase, resolveAlias, shouldTransform, slash, stringifyComponentImport, throttle, toArray } from "./utils-BPB1pAS0.js";
1
+ import { DIRECTIVE_IMPORT_PREFIX, DISABLE_COMMENT, escapeSpecialChars, getNameFromFilePath, getTransformedPath, isExclude, matchGlobs, normalizeComponentInfo, notNullish, parseId, pascalCase, resolveAlias, shouldTransform, slash, stringifyComponentImport, throttle, toArray } from "./utils-BoXu-4gQ.js";
2
2
  import { existsSync } from "node:fs";
3
3
  import process from "node:process";
4
4
  import chokidar from "chokidar";
5
+ import { glob, globSync } from "tinyglobby";
5
6
  import { createUnplugin } from "unplugin";
6
7
  import { createFilter } from "unplugin-utils";
7
8
  import { dirname, isAbsolute, join, relative, resolve } from "node:path";
8
9
  import Debug from "debug";
9
10
  import { mkdir, readFile, writeFile } from "node:fs/promises";
10
11
  import { getPackageInfoSync, importModule, isPackageExists } from "local-pkg";
11
- import { globSync } from "tinyglobby";
12
12
  import MagicString from "magic-string";
13
13
 
14
14
  //#region src/core/type-imports/index.ts
@@ -62,9 +62,7 @@ function parseDeclaration(code) {
62
62
  function stringifyComponentInfo(filepath, { from: path, as: name, name: importName }, importPathTransform) {
63
63
  if (!name) return void 0;
64
64
  path = getTransformedPath(path, importPathTransform);
65
- const related = isAbsolute(path) ? `./${relative(dirname(filepath), path)}` : path;
66
- const entry = `typeof import('${slash(related)}')['${importName || "default"}']`;
67
- return [name, entry];
65
+ return [name, `typeof import('${slash(isAbsolute(path) ? `./${relative(dirname(filepath), path)}` : path)}')['${importName || "default"}']`];
68
66
  }
69
67
  /**
70
68
  * Converts array of `ComponentInfo` to an import map
@@ -107,9 +105,12 @@ function getDeclaration(ctx, filepath, originalImports) {
107
105
  };
108
106
  let code = `/* eslint-disable */
109
107
  // @ts-nocheck
108
+ // biome-ignore lint: disable
109
+ // oxlint-disable
110
+ // ------
110
111
  // Generated by unplugin-vue-components
111
112
  // Read more: https://github.com/vuejs/core/pull/3399
112
- // biome-ignore lint: disable
113
+ ${ctx.options.dtsTsx ? `import { GlobalComponents } from 'vue'\n` : ""}
113
114
  export {}
114
115
 
115
116
  /* prettier-ignore */
@@ -123,6 +124,13 @@ declare module 'vue' {`;
123
124
  ${declarations.directive.join("\n ")}
124
125
  }`;
125
126
  code += "\n}\n";
127
+ if (ctx.options.dtsTsx) {
128
+ if (Object.keys(declarations.component).length > 0) code += `
129
+ // For TSX support
130
+ declare global {
131
+ ${declarations.component.map((d) => d.replace(/(.+):/, "const $1:")).join("\n ")}
132
+ }`;
133
+ }
126
134
  return code;
127
135
  }
128
136
  async function writeFile$1(filePath, content) {
@@ -131,8 +139,7 @@ async function writeFile$1(filePath, content) {
131
139
  }
132
140
  async function writeDeclaration(ctx, filepath, removeUnused = false) {
133
141
  const originalContent = existsSync(filepath) ? await readFile(filepath, "utf-8") : "";
134
- const originalImports = removeUnused ? void 0 : parseDeclaration(originalContent);
135
- const code = getDeclaration(ctx, filepath, originalImports);
142
+ const code = getDeclaration(ctx, filepath, removeUnused ? void 0 : parseDeclaration(originalContent));
136
143
  if (!code) return;
137
144
  if (code !== originalContent) await writeFile$1(filepath, code);
138
145
  }
@@ -175,6 +182,7 @@ const defaultOptions = {
175
182
  extensions: "vue",
176
183
  deep: true,
177
184
  dts: isPackageExists("typescript"),
185
+ dtsTsx: isPackageExists("@vitejs/plugin-vue-jsx"),
178
186
  directoryAsNamespace: false,
179
187
  collapseSamePrefixes: false,
180
188
  globalNamespaces: [],
@@ -193,16 +201,16 @@ function normalizeResolvers(resolvers) {
193
201
  type: "component"
194
202
  } : r);
195
203
  }
196
- function resolveGlobsExclude(root, glob) {
204
+ function resolveGlobsExclude(root, glob$1) {
197
205
  const excludeReg = /^!/;
198
- return slash(`${excludeReg.test(glob) ? "!" : ""}${resolve(root, glob.replace(excludeReg, ""))}`);
206
+ return slash(`${excludeReg.test(glob$1) ? "!" : ""}${resolve(root, glob$1.replace(excludeReg, ""))}`);
199
207
  }
200
208
  function resolveOptions(options, root) {
201
209
  const resolved = Object.assign({}, defaultOptions, options);
202
210
  resolved.resolvers = normalizeResolvers(resolved.resolvers);
203
211
  resolved.extensions = toArray(resolved.extensions);
204
212
  if (resolved.globs) {
205
- resolved.globs = toArray(resolved.globs).map((glob) => resolveGlobsExclude(root, glob));
213
+ resolved.globs = toArray(resolved.globs).map((glob$1) => resolveGlobsExclude(root, glob$1));
206
214
  resolved.resolvedDirs = [];
207
215
  } else {
208
216
  const extsGlob = resolved.extensions.length === 1 ? resolved.extensions : `{${resolved.extensions.join(",")}}`;
@@ -445,7 +453,7 @@ var Context = class {
445
453
  this.options = resolveOptions(rawOptions, this.root);
446
454
  this.sourcemap = rawOptions.sourcemap ?? true;
447
455
  this.generateDeclaration = throttle(500, this._generateDeclaration.bind(this), { noLeading: false });
448
- this._removeUnused = this.options.syncMode === "overwrite";
456
+ this._removeUnused = this.options.syncMode !== "append";
449
457
  if (this.options.dumpComponentsInfo) {
450
458
  this.dumpComponentsInfoPath = this.options.dumpComponentsInfo === true ? "./.components-info.json" : this.options.dumpComponentsInfo ?? false;
451
459
  this.generateComponentsJson = throttle(500, this._generateComponentsJson.bind(this), { noLeading: false });
@@ -469,11 +477,12 @@ var Context = class {
469
477
  setupViteServer(server) {
470
478
  if (this._server === server) return;
471
479
  this._server = server;
472
- this._removeUnused = this.options.syncMode !== "append";
480
+ this._removeUnused = this.options.syncMode === "overwrite";
473
481
  this.setupWatcher(server.watcher);
474
482
  }
475
483
  setupWatcher(watcher) {
476
484
  const { globs } = this.options;
485
+ this._removeUnused = this.options.syncMode === "overwrite";
477
486
  watcher.on("unlink", (path) => {
478
487
  if (!matchGlobs(path, globs)) return;
479
488
  path = slash(path);
@@ -492,6 +501,7 @@ var Context = class {
492
501
  */
493
502
  setupWatcherWebpack(watcher, emitUpdate) {
494
503
  const { globs } = this.options;
504
+ this._removeUnused = this.options.syncMode === "overwrite";
495
505
  watcher.on("unlink", (path) => {
496
506
  if (!matchGlobs(path, globs)) return;
497
507
  path = slash(path);
@@ -692,7 +702,7 @@ var unplugin_default = createUnplugin((options = {}) => {
692
702
  }
693
703
  },
694
704
  vite: {
695
- configResolved(config) {
705
+ async configResolved(config) {
696
706
  ctx.setRoot(config.root);
697
707
  ctx.sourcemap = true;
698
708
  if (config.plugins.find((i) => i.name === "vite-plugin-vue2")) ctx.setTransformer("vue2");
@@ -703,7 +713,7 @@ var unplugin_default = createUnplugin((options = {}) => {
703
713
  if (ctx.options.dumpComponentsInfo && ctx.dumpComponentsInfoPath) {
704
714
  if (!existsSync(ctx.dumpComponentsInfoPath)) ctx.generateComponentsJson();
705
715
  }
706
- if (config.build.watch && config.command === "build") ctx.setupWatcher(chokidar.watch(ctx.options.globs));
716
+ if (config.build.watch && config.command === "build") ctx.setupWatcher(chokidar.watch(await glob(ctx.options.globs)));
707
717
  },
708
718
  configureServer(server) {
709
719
  ctx.setupViteServer(server);
@@ -712,10 +722,10 @@ var unplugin_default = createUnplugin((options = {}) => {
712
722
  webpack(compiler) {
713
723
  let watcher;
714
724
  let fileDepQueue = [];
715
- compiler.hooks.watchRun.tap(PLUGIN_NAME, () => {
725
+ compiler.hooks.watchRun.tapAsync(PLUGIN_NAME, async () => {
716
726
  if (!watcher && compiler.watching) {
717
727
  watcher = compiler.watching;
718
- ctx.setupWatcherWebpack(chokidar.watch(ctx.options.globs), (path, type) => {
728
+ ctx.setupWatcherWebpack(chokidar.watch(await glob(ctx.options.globs)), (path, type) => {
719
729
  fileDepQueue.push({
720
730
  path,
721
731
  type
@@ -1,10 +1,12 @@
1
- const require_utils = require('./utils-c-ZB7b5u.cjs');
1
+ const require_utils = require('./utils-8UQ22cuO.cjs');
2
2
  let node_fs = require("node:fs");
3
3
  node_fs = require_utils.__toESM(node_fs);
4
4
  let node_process = require("node:process");
5
5
  node_process = require_utils.__toESM(node_process);
6
6
  let chokidar = require("chokidar");
7
7
  chokidar = require_utils.__toESM(chokidar);
8
+ let tinyglobby = require("tinyglobby");
9
+ tinyglobby = require_utils.__toESM(tinyglobby);
8
10
  let unplugin = require("unplugin");
9
11
  unplugin = require_utils.__toESM(unplugin);
10
12
  let unplugin_utils = require("unplugin-utils");
@@ -17,8 +19,6 @@ let node_fs_promises = require("node:fs/promises");
17
19
  node_fs_promises = require_utils.__toESM(node_fs_promises);
18
20
  let local_pkg = require("local-pkg");
19
21
  local_pkg = require_utils.__toESM(local_pkg);
20
- let tinyglobby = require("tinyglobby");
21
- tinyglobby = require_utils.__toESM(tinyglobby);
22
22
  let magic_string = require("magic-string");
23
23
  magic_string = require_utils.__toESM(magic_string);
24
24
 
@@ -73,9 +73,7 @@ function parseDeclaration(code) {
73
73
  function stringifyComponentInfo(filepath, { from: path, as: name, name: importName }, importPathTransform) {
74
74
  if (!name) return void 0;
75
75
  path = require_utils.getTransformedPath(path, importPathTransform);
76
- const related = (0, node_path.isAbsolute)(path) ? `./${(0, node_path.relative)((0, node_path.dirname)(filepath), path)}` : path;
77
- const entry = `typeof import('${require_utils.slash(related)}')['${importName || "default"}']`;
78
- return [name, entry];
76
+ return [name, `typeof import('${require_utils.slash((0, node_path.isAbsolute)(path) ? `./${(0, node_path.relative)((0, node_path.dirname)(filepath), path)}` : path)}')['${importName || "default"}']`];
79
77
  }
80
78
  /**
81
79
  * Converts array of `ComponentInfo` to an import map
@@ -118,9 +116,12 @@ function getDeclaration(ctx, filepath, originalImports) {
118
116
  };
119
117
  let code = `/* eslint-disable */
120
118
  // @ts-nocheck
119
+ // biome-ignore lint: disable
120
+ // oxlint-disable
121
+ // ------
121
122
  // Generated by unplugin-vue-components
122
123
  // Read more: https://github.com/vuejs/core/pull/3399
123
- // biome-ignore lint: disable
124
+ ${ctx.options.dtsTsx ? `import { GlobalComponents } from 'vue'\n` : ""}
124
125
  export {}
125
126
 
126
127
  /* prettier-ignore */
@@ -134,6 +135,13 @@ declare module 'vue' {`;
134
135
  ${declarations.directive.join("\n ")}
135
136
  }`;
136
137
  code += "\n}\n";
138
+ if (ctx.options.dtsTsx) {
139
+ if (Object.keys(declarations.component).length > 0) code += `
140
+ // For TSX support
141
+ declare global {
142
+ ${declarations.component.map((d) => d.replace(/(.+):/, "const $1:")).join("\n ")}
143
+ }`;
144
+ }
137
145
  return code;
138
146
  }
139
147
  async function writeFile(filePath, content) {
@@ -142,8 +150,7 @@ async function writeFile(filePath, content) {
142
150
  }
143
151
  async function writeDeclaration(ctx, filepath, removeUnused = false) {
144
152
  const originalContent = (0, node_fs.existsSync)(filepath) ? await (0, node_fs_promises.readFile)(filepath, "utf-8") : "";
145
- const originalImports = removeUnused ? void 0 : parseDeclaration(originalContent);
146
- const code = getDeclaration(ctx, filepath, originalImports);
153
+ const code = getDeclaration(ctx, filepath, removeUnused ? void 0 : parseDeclaration(originalContent));
147
154
  if (!code) return;
148
155
  if (code !== originalContent) await writeFile(filepath, code);
149
156
  }
@@ -186,6 +193,7 @@ const defaultOptions = {
186
193
  extensions: "vue",
187
194
  deep: true,
188
195
  dts: (0, local_pkg.isPackageExists)("typescript"),
196
+ dtsTsx: (0, local_pkg.isPackageExists)("@vitejs/plugin-vue-jsx"),
189
197
  directoryAsNamespace: false,
190
198
  collapseSamePrefixes: false,
191
199
  globalNamespaces: [],
@@ -204,16 +212,16 @@ function normalizeResolvers(resolvers) {
204
212
  type: "component"
205
213
  } : r);
206
214
  }
207
- function resolveGlobsExclude(root, glob) {
215
+ function resolveGlobsExclude(root, glob$1) {
208
216
  const excludeReg = /^!/;
209
- return require_utils.slash(`${excludeReg.test(glob) ? "!" : ""}${(0, node_path.resolve)(root, glob.replace(excludeReg, ""))}`);
217
+ return require_utils.slash(`${excludeReg.test(glob$1) ? "!" : ""}${(0, node_path.resolve)(root, glob$1.replace(excludeReg, ""))}`);
210
218
  }
211
219
  function resolveOptions(options, root) {
212
220
  const resolved = Object.assign({}, defaultOptions, options);
213
221
  resolved.resolvers = normalizeResolvers(resolved.resolvers);
214
222
  resolved.extensions = require_utils.toArray(resolved.extensions);
215
223
  if (resolved.globs) {
216
- resolved.globs = require_utils.toArray(resolved.globs).map((glob) => resolveGlobsExclude(root, glob));
224
+ resolved.globs = require_utils.toArray(resolved.globs).map((glob$1) => resolveGlobsExclude(root, glob$1));
217
225
  resolved.resolvedDirs = [];
218
226
  } else {
219
227
  const extsGlob = resolved.extensions.length === 1 ? resolved.extensions : `{${resolved.extensions.join(",")}}`;
@@ -456,7 +464,7 @@ var Context = class {
456
464
  this.options = resolveOptions(rawOptions, this.root);
457
465
  this.sourcemap = rawOptions.sourcemap ?? true;
458
466
  this.generateDeclaration = require_utils.throttle(500, this._generateDeclaration.bind(this), { noLeading: false });
459
- this._removeUnused = this.options.syncMode === "overwrite";
467
+ this._removeUnused = this.options.syncMode !== "append";
460
468
  if (this.options.dumpComponentsInfo) {
461
469
  this.dumpComponentsInfoPath = this.options.dumpComponentsInfo === true ? "./.components-info.json" : this.options.dumpComponentsInfo ?? false;
462
470
  this.generateComponentsJson = require_utils.throttle(500, this._generateComponentsJson.bind(this), { noLeading: false });
@@ -480,11 +488,12 @@ var Context = class {
480
488
  setupViteServer(server) {
481
489
  if (this._server === server) return;
482
490
  this._server = server;
483
- this._removeUnused = this.options.syncMode !== "append";
491
+ this._removeUnused = this.options.syncMode === "overwrite";
484
492
  this.setupWatcher(server.watcher);
485
493
  }
486
494
  setupWatcher(watcher) {
487
495
  const { globs } = this.options;
496
+ this._removeUnused = this.options.syncMode === "overwrite";
488
497
  watcher.on("unlink", (path) => {
489
498
  if (!require_utils.matchGlobs(path, globs)) return;
490
499
  path = require_utils.slash(path);
@@ -503,6 +512,7 @@ var Context = class {
503
512
  */
504
513
  setupWatcherWebpack(watcher, emitUpdate) {
505
514
  const { globs } = this.options;
515
+ this._removeUnused = this.options.syncMode === "overwrite";
506
516
  watcher.on("unlink", (path) => {
507
517
  if (!require_utils.matchGlobs(path, globs)) return;
508
518
  path = require_utils.slash(path);
@@ -703,7 +713,7 @@ var unplugin_default = (0, unplugin.createUnplugin)((options = {}) => {
703
713
  }
704
714
  },
705
715
  vite: {
706
- configResolved(config) {
716
+ async configResolved(config) {
707
717
  ctx.setRoot(config.root);
708
718
  ctx.sourcemap = true;
709
719
  if (config.plugins.find((i) => i.name === "vite-plugin-vue2")) ctx.setTransformer("vue2");
@@ -714,7 +724,7 @@ var unplugin_default = (0, unplugin.createUnplugin)((options = {}) => {
714
724
  if (ctx.options.dumpComponentsInfo && ctx.dumpComponentsInfoPath) {
715
725
  if (!(0, node_fs.existsSync)(ctx.dumpComponentsInfoPath)) ctx.generateComponentsJson();
716
726
  }
717
- if (config.build.watch && config.command === "build") ctx.setupWatcher(chokidar.default.watch(ctx.options.globs));
727
+ if (config.build.watch && config.command === "build") ctx.setupWatcher(chokidar.default.watch(await (0, tinyglobby.glob)(ctx.options.globs)));
718
728
  },
719
729
  configureServer(server) {
720
730
  ctx.setupViteServer(server);
@@ -723,10 +733,10 @@ var unplugin_default = (0, unplugin.createUnplugin)((options = {}) => {
723
733
  webpack(compiler) {
724
734
  let watcher;
725
735
  let fileDepQueue = [];
726
- compiler.hooks.watchRun.tap(PLUGIN_NAME, () => {
736
+ compiler.hooks.watchRun.tapAsync(PLUGIN_NAME, async () => {
727
737
  if (!watcher && compiler.watching) {
728
738
  watcher = compiler.watching;
729
- ctx.setupWatcherWebpack(chokidar.default.watch(ctx.options.globs), (path, type) => {
739
+ ctx.setupWatcherWebpack(chokidar.default.watch(await (0, tinyglobby.glob)(ctx.options.globs)), (path, type) => {
730
740
  fileDepQueue.push({
731
741
  path,
732
742
  type
@@ -1,6 +1,6 @@
1
+ import { Awaitable } from "@antfu/utils";
1
2
  import { TransformResult } from "unplugin";
2
3
  import { FilterPattern } from "unplugin-utils";
3
- import { Awaitable } from "@antfu/utils";
4
4
 
5
5
  //#region src/types.d.ts
6
6
  interface ImportInfoLegacy {
@@ -149,6 +149,13 @@ interface Options {
149
149
  * @default true
150
150
  */
151
151
  dts?: boolean | string;
152
+ /**
153
+ * Generate TypeScript declaration for global components
154
+ * For TSX support
155
+ *
156
+ * @default true if `@vitejs/plugin-vue-jsx` is installed
157
+ */
158
+ dtsTsx?: boolean;
152
159
  /**
153
160
  * Do not emit warning on component overriding
154
161
  *
@@ -206,6 +213,7 @@ type ResolvedOptions = Omit<Required<Options>, 'resolvers' | 'extensions' | 'dir
206
213
  globs: string[];
207
214
  globsExclude: string[];
208
215
  dts: string | false;
216
+ dtsTsx: boolean;
209
217
  root: string;
210
218
  };
211
219
  type ComponentsImportMap = Record<string, string[] | undefined>;
@@ -1,6 +1,6 @@
1
- import { Awaitable } from "@antfu/utils";
2
1
  import { TransformResult } from "unplugin";
3
2
  import { FilterPattern } from "unplugin-utils";
3
+ import { Awaitable } from "@antfu/utils";
4
4
 
5
5
  //#region src/types.d.ts
6
6
  interface ImportInfoLegacy {
@@ -149,6 +149,13 @@ interface Options {
149
149
  * @default true
150
150
  */
151
151
  dts?: boolean | string;
152
+ /**
153
+ * Generate TypeScript declaration for global components
154
+ * For TSX support
155
+ *
156
+ * @default true if `@vitejs/plugin-vue-jsx` is installed
157
+ */
158
+ dtsTsx?: boolean;
152
159
  /**
153
160
  * Do not emit warning on component overriding
154
161
  *
@@ -206,6 +213,7 @@ type ResolvedOptions = Omit<Required<Options>, 'resolvers' | 'extensions' | 'dir
206
213
  globs: string[];
207
214
  globsExclude: string[];
208
215
  dts: string | false;
216
+ dtsTsx: boolean;
209
217
  root: string;
210
218
  };
211
219
  type ComponentsImportMap = Record<string, string[] | undefined>;
package/dist/types.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { ComponentInfo, ComponentResolveResult, ComponentResolver, ComponentResolverFunction, ComponentResolverObject, ComponentsImportMap, ImportInfo, ImportInfoLegacy, Matcher, Options, PublicPluginAPI, ResolvedOptions, SideEffectsInfo, SupportedTransformer, Transformer, TypeImport } from "./types-dp3LCoF8.cjs";
1
+ import { ComponentInfo, ComponentResolveResult, ComponentResolver, ComponentResolverFunction, ComponentResolverObject, ComponentsImportMap, ImportInfo, ImportInfoLegacy, Matcher, Options, PublicPluginAPI, ResolvedOptions, SideEffectsInfo, SupportedTransformer, Transformer, TypeImport } from "./types-DSJ5r-ta.cjs";
2
2
  export { ComponentInfo, ComponentResolveResult, ComponentResolver, ComponentResolverFunction, ComponentResolverObject, ComponentsImportMap, ImportInfo, ImportInfoLegacy, Matcher, Options, PublicPluginAPI, ResolvedOptions, SideEffectsInfo, SupportedTransformer, Transformer, TypeImport };
package/dist/types.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { ComponentInfo, ComponentResolveResult, ComponentResolver, ComponentResolverFunction, ComponentResolverObject, ComponentsImportMap, ImportInfo, ImportInfoLegacy, Matcher, Options, PublicPluginAPI, ResolvedOptions, SideEffectsInfo, SupportedTransformer, Transformer, TypeImport } from "./types-BgF15syy.js";
1
+ import { ComponentInfo, ComponentResolveResult, ComponentResolver, ComponentResolverFunction, ComponentResolverObject, ComponentsImportMap, ImportInfo, ImportInfoLegacy, Matcher, Options, PublicPluginAPI, ResolvedOptions, SideEffectsInfo, SupportedTransformer, Transformer, TypeImport } from "./types-rC3290ja.js";
2
2
  export { ComponentInfo, ComponentResolveResult, ComponentResolver, ComponentResolverFunction, ComponentResolverObject, ComponentsImportMap, ImportInfo, ImportInfoLegacy, Matcher, Options, PublicPluginAPI, ResolvedOptions, SideEffectsInfo, SupportedTransformer, Transformer, TypeImport };
@@ -31,7 +31,7 @@ node_path = __toESM(node_path);
31
31
  let local_pkg = require("local-pkg");
32
32
  local_pkg = __toESM(local_pkg);
33
33
 
34
- //#region node_modules/.pnpm/@antfu+utils@9.2.1/node_modules/@antfu/utils/dist/index.mjs
34
+ //#region node_modules/.pnpm/@antfu+utils@9.3.0/node_modules/@antfu/utils/dist/index.mjs
35
35
  function toArray(array) {
36
36
  array = array ?? [];
37
37
  return Array.isArray(array) ? array : [array];
@@ -73,7 +73,7 @@ function throttle$1(delay, callback, options) {
73
73
  if (timeoutID) clearTimeout(timeoutID);
74
74
  }
75
75
  function cancel(options$1) {
76
- var _ref2 = options$1 || {}, _ref2$upcomingOnly = _ref2.upcomingOnly, upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
76
+ var _ref2$upcomingOnly = (options$1 || {}).upcomingOnly, upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
77
77
  clearExistingTimeout();
78
78
  cancelled = !upcomingOnly;
79
79
  }
@@ -412,15 +412,12 @@ const parseClass = (glob, position) => {
412
412
  glob.length - pos,
413
413
  true
414
414
  ];
415
- if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
416
- const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
417
- return [
418
- regexpEscape(r),
419
- false,
420
- endPos - pos,
421
- false
422
- ];
423
- }
415
+ if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) return [
416
+ regexpEscape(ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]),
417
+ false,
418
+ endPos - pos,
419
+ false
420
+ ];
424
421
  const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
425
422
  const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
426
423
  return [
@@ -2,7 +2,7 @@ import process$1 from "node:process";
2
2
  import { parse } from "node:path";
3
3
  import { getPackageInfo, isPackageExists } from "local-pkg";
4
4
 
5
- //#region node_modules/.pnpm/@antfu+utils@9.2.1/node_modules/@antfu/utils/dist/index.mjs
5
+ //#region node_modules/.pnpm/@antfu+utils@9.3.0/node_modules/@antfu/utils/dist/index.mjs
6
6
  function toArray(array) {
7
7
  array = array ?? [];
8
8
  return Array.isArray(array) ? array : [array];
@@ -44,7 +44,7 @@ function throttle$1(delay, callback, options) {
44
44
  if (timeoutID) clearTimeout(timeoutID);
45
45
  }
46
46
  function cancel(options$1) {
47
- var _ref2 = options$1 || {}, _ref2$upcomingOnly = _ref2.upcomingOnly, upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
47
+ var _ref2$upcomingOnly = (options$1 || {}).upcomingOnly, upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
48
48
  clearExistingTimeout();
49
49
  cancelled = !upcomingOnly;
50
50
  }
@@ -383,15 +383,12 @@ const parseClass = (glob, position) => {
383
383
  glob.length - pos,
384
384
  true
385
385
  ];
386
- if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
387
- const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
388
- return [
389
- regexpEscape(r),
390
- false,
391
- endPos - pos,
392
- false
393
- ];
394
- }
386
+ if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) return [
387
+ regexpEscape(ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]),
388
+ false,
389
+ endPos - pos,
390
+ false
391
+ ];
395
392
  const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
396
393
  const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
397
394
  return [
package/dist/vite.cjs CHANGED
@@ -1,5 +1,5 @@
1
- require('./utils-c-ZB7b5u.cjs');
2
- const require_src = require('./src-Ctx_G96r.cjs');
1
+ require('./utils-8UQ22cuO.cjs');
2
+ const require_src = require('./src-DzdkjKhH.cjs');
3
3
  require('./types-CBTc19th.cjs');
4
4
 
5
5
  //#region src/vite.ts
package/dist/vite.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options, PublicPluginAPI } from "./types-dp3LCoF8.cjs";
1
+ import { Options, PublicPluginAPI } from "./types-DSJ5r-ta.cjs";
2
2
  import { Plugin } from "vite";
3
3
 
4
4
  //#region src/vite.d.ts
package/dist/vite.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options, PublicPluginAPI } from "./types-BgF15syy.js";
1
+ import { Options, PublicPluginAPI } from "./types-rC3290ja.js";
2
2
  import { Plugin } from "vite";
3
3
 
4
4
  //#region src/vite.d.ts
package/dist/vite.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./utils-BPB1pAS0.js";
2
- import { unplugin_default } from "./src-CbJqJu6O.js";
1
+ import "./utils-BoXu-4gQ.js";
2
+ import { unplugin_default } from "./src-BcnnO6GN.js";
3
3
  import "./types-DQoXDiso.js";
4
4
 
5
5
  //#region src/vite.ts
package/dist/webpack.cjs CHANGED
@@ -1,5 +1,5 @@
1
- require('./utils-c-ZB7b5u.cjs');
2
- const require_src = require('./src-Ctx_G96r.cjs');
1
+ require('./utils-8UQ22cuO.cjs');
2
+ const require_src = require('./src-DzdkjKhH.cjs');
3
3
  require('./types-CBTc19th.cjs');
4
4
 
5
5
  //#region src/webpack.ts
@@ -1,4 +1,4 @@
1
- import { Options } from "./types-dp3LCoF8.cjs";
1
+ import { Options } from "./types-DSJ5r-ta.cjs";
2
2
  import * as webpack0 from "webpack";
3
3
 
4
4
  //#region src/webpack.d.ts
package/dist/webpack.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options } from "./types-BgF15syy.js";
1
+ import { Options } from "./types-rC3290ja.js";
2
2
  import * as webpack0 from "webpack";
3
3
 
4
4
  //#region src/webpack.d.ts
package/dist/webpack.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./utils-BPB1pAS0.js";
2
- import { unplugin_default } from "./src-CbJqJu6O.js";
1
+ import "./utils-BoXu-4gQ.js";
2
+ import { unplugin_default } from "./src-BcnnO6GN.js";
3
3
  import "./types-DQoXDiso.js";
4
4
 
5
5
  //#region src/webpack.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unplugin-vue-components",
3
3
  "type": "module",
4
- "version": "29.1.0",
4
+ "version": "30.0.0",
5
5
  "description": "Components auto importing for Vue",
6
6
  "author": "antfu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -85,42 +85,41 @@
85
85
  }
86
86
  },
87
87
  "dependencies": {
88
- "chokidar": "^3.6.0",
88
+ "chokidar": "^4.0.3",
89
89
  "debug": "^4.4.3",
90
90
  "local-pkg": "^1.1.2",
91
91
  "magic-string": "^0.30.19",
92
92
  "mlly": "^1.8.0",
93
93
  "tinyglobby": "^0.2.15",
94
94
  "unplugin": "^2.3.10",
95
- "unplugin-utils": "^0.3.0"
95
+ "unplugin-utils": "^0.3.1"
96
96
  },
97
97
  "devDependencies": {
98
- "@antfu/eslint-config": "^5.4.1",
99
- "@antfu/utils": "^9.2.1",
98
+ "@antfu/eslint-config": "^6.0.0",
99
+ "@antfu/utils": "^9.3.0",
100
100
  "@babel/parser": "^7.28.4",
101
101
  "@babel/types": "^7.28.4",
102
- "@nuxt/kit": "^4.1.2",
103
- "@nuxt/schema": "^4.1.2",
102
+ "@nuxt/kit": "^4.1.3",
103
+ "@nuxt/schema": "^4.1.3",
104
104
  "@types/debug": "^4.1.12",
105
- "@types/minimatch": "^6.0.0",
106
- "@types/node": "^24.5.2",
107
- "bumpp": "^10.2.3",
105
+ "@types/node": "^24.8.1",
106
+ "bumpp": "^10.3.1",
108
107
  "compare-versions": "^6.1.1",
109
- "element-plus": "^2.11.3",
110
- "eslint": "^9.36.0",
108
+ "element-plus": "^2.11.5",
109
+ "eslint": "^9.38.0",
111
110
  "eslint-plugin-format": "^1.0.2",
112
111
  "esno": "^4.8.0",
113
112
  "estree-walker": "^3.0.3",
114
113
  "minimatch": "^10.0.3",
115
114
  "pathe": "^2.0.3",
116
- "rolldown": "^1.0.0-beta.38",
117
- "rollup": "^4.52.0",
118
- "tsdown": "^0.13.5",
119
- "typescript": "^5.9.2",
120
- "vite": "^7.1.6",
115
+ "rolldown": "^1.0.0-beta.43",
116
+ "rollup": "^4.52.5",
117
+ "tsdown": "^0.15.8",
118
+ "typescript": "^5.9.3",
119
+ "vite": "^7.1.10",
121
120
  "vitest": "^3.2.4",
122
121
  "vue": "3.2.45",
123
- "vue-tsc": "^3.0.7"
122
+ "vue-tsc": "^3.1.1"
124
123
  },
125
124
  "scripts": {
126
125
  "build": "tsdown",