rsbuild-plugin-dts 0.0.13 → 0.0.14

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 (2) hide show
  1. package/dist/utils.js +7 -6
  2. package/package.json +6 -6
package/dist/utils.js CHANGED
@@ -3,11 +3,10 @@ import * as __WEBPACK_EXTERNAL_MODULE_node_fs_promises__ from "node:fs/promises"
3
3
  import * as __WEBPACK_EXTERNAL_MODULE_node_os__ from "node:os";
4
4
  import * as __WEBPACK_EXTERNAL_MODULE_node_path__ from "node:path";
5
5
  import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_core__ from "@rsbuild/core";
6
- import * as __WEBPACK_EXTERNAL_MODULE_fast_glob__ from "fast-glob";
7
6
  import * as __WEBPACK_EXTERNAL_MODULE_magic_string__ from "magic-string";
8
7
  import * as __WEBPACK_EXTERNAL_MODULE_picocolors__ from "picocolors";
8
+ import * as __WEBPACK_EXTERNAL_MODULE_tinyglobby__ from "tinyglobby";
9
9
  import * as __WEBPACK_EXTERNAL_MODULE_typescript__ from "typescript";
10
- const { convertPathToPattern } = __WEBPACK_EXTERNAL_MODULE_fast_glob__["default"];
11
10
  function loadTsconfig(tsconfigPath) {
12
11
  const configFile = __WEBPACK_EXTERNAL_MODULE_typescript__["default"].readConfigFile(tsconfigPath, __WEBPACK_EXTERNAL_MODULE_typescript__["default"].sys.readFile);
13
12
  const configFileContent = __WEBPACK_EXTERNAL_MODULE_typescript__["default"].parseJsonConfigFileContent(configFile.config, __WEBPACK_EXTERNAL_MODULE_typescript__["default"].sys, __WEBPACK_EXTERNAL_MODULE_node_path__["default"].dirname(tsconfigPath));
@@ -42,10 +41,10 @@ const prettyTime = (seconds)=>{
42
41
  const minutes = seconds / 60;
43
42
  return `${format(minutes.toFixed(2))} m`;
44
43
  };
45
- // fast-glob only accepts posix path
46
- // https://github.com/mrmlnc/fast-glob#convertpathtopatternpath
44
+ // tinyglobby only accepts posix path
45
+ // https://github.com/SuperchupuDev/tinyglobby?tab=readme-ov-file#api
47
46
  const convertPath = (path)=>{
48
- if ('win32' === (0, __WEBPACK_EXTERNAL_MODULE_node_os__.platform)()) return convertPathToPattern(path);
47
+ if ('win32' === (0, __WEBPACK_EXTERNAL_MODULE_node_os__.platform)()) return (0, __WEBPACK_EXTERNAL_MODULE_tinyglobby__.convertPathToPattern)(path);
49
48
  return path;
50
49
  };
51
50
  function getTimeCost(start) {
@@ -62,7 +61,9 @@ async function addBannerAndFooter(file, banner, footer) {
62
61
  }
63
62
  async function processDtsFiles(bundle, dir, dtsExtension, banner, footer) {
64
63
  if (bundle) return;
65
- const dtsFiles = await (0, __WEBPACK_EXTERNAL_MODULE_fast_glob__["default"])(convertPath((0, __WEBPACK_EXTERNAL_MODULE_node_path__.join)(dir, '/**/*.d.ts')));
64
+ const dtsFiles = await (0, __WEBPACK_EXTERNAL_MODULE_tinyglobby__.glob)(convertPath((0, __WEBPACK_EXTERNAL_MODULE_node_path__.join)(dir, '/**/*.d.ts')), {
65
+ absolute: true
66
+ });
66
67
  for (const file of dtsFiles)try {
67
68
  await addBannerAndFooter(file, banner, footer);
68
69
  const newFile = file.replace('.d.ts', dtsExtension);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rsbuild-plugin-dts",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "Dts plugin for Rsbuild",
5
5
  "homepage": "https://lib.rsbuild.dev",
6
6
  "bugs": {
@@ -25,14 +25,14 @@
25
25
  "dist"
26
26
  ],
27
27
  "dependencies": {
28
- "fast-glob": "^3.3.2",
29
28
  "magic-string": "^0.30.12",
30
- "picocolors": "1.1.0"
29
+ "picocolors": "1.1.1",
30
+ "tinyglobby": "^0.2.9"
31
31
  },
32
32
  "devDependencies": {
33
- "@microsoft/api-extractor": "^7.47.9",
34
- "@rsbuild/core": "~1.0.14",
35
- "rslib": "npm:@rslib/core@0.0.12",
33
+ "@microsoft/api-extractor": "^7.47.11",
34
+ "@rsbuild/core": "~1.0.17",
35
+ "rslib": "npm:@rslib/core@0.0.13",
36
36
  "typescript": "^5.6.3",
37
37
  "@rslib/tsconfig": "0.0.1"
38
38
  },