rsbuild-plugin-dts 0.18.1 → 0.18.2

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/dts.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { DtsGenOptions } from './index';
2
+ export declare const DEFAULT_EXCLUDED_PACKAGES: string[];
2
3
  export declare const calcBundledPackages: (options: {
3
4
  cwd: string;
4
5
  autoExternal: DtsGenOptions["autoExternal"];
package/dist/dts.js CHANGED
@@ -4,6 +4,9 @@ import { logger } from "@rsbuild/core";
4
4
  import picocolors from "../compiled/picocolors/index.js";
5
5
  import { calcLongestCommonPath, ensureTempDeclarationDir, mergeAliasWithTsConfigPaths } from "./utils.js";
6
6
  const isObject = (obj)=>'[object Object]' === Object.prototype.toString.call(obj);
7
+ const DEFAULT_EXCLUDED_PACKAGES = [
8
+ '@types/react'
9
+ ];
7
10
  const calcBundledPackages = (options)=>{
8
11
  const { cwd, autoExternal, userExternals, overrideBundledPackages } = options;
9
12
  if (overrideBundledPackages) return overrideBundledPackages;
@@ -49,7 +52,8 @@ const calcBundledPackages = (options)=>{
49
52
  }
50
53
  }
51
54
  const bundledPackages = allDeps.filter((d)=>!externals.some((e)=>'string' == typeof e ? d === e : e.test(d)));
52
- return Array.from(new Set(bundledPackages));
55
+ const filteredBundledPackages = Array.from(new Set(bundledPackages)).filter((pkg)=>!DEFAULT_EXCLUDED_PACKAGES.includes(pkg));
56
+ return filteredBundledPackages;
53
57
  };
54
58
  async function generateDts(data) {
55
59
  const { bundle, dtsEntry, dtsEmitPath, tsconfigPath, tsConfigResult, name, cwd, build, isWatch, dtsExtension = '.d.ts', autoExternal = true, alias = {}, userExternals, apiExtractorOptions, banner, footer, redirect = {
@@ -141,4 +145,4 @@ process.on('message', async (data)=>{
141
145
  process.send('success');
142
146
  if (!data.isWatch) process.exit();
143
147
  });
144
- export { calcBundledPackages, generateDts };
148
+ export { DEFAULT_EXCLUDED_PACKAGES, calcBundledPackages, generateDts };
package/dist/utils.js CHANGED
@@ -9,9 +9,9 @@ import { logger } from "@rsbuild/core";
9
9
  import magic_string from "../compiled/magic-string/index.js";
10
10
  import picocolors from "../compiled/picocolors/index.js";
11
11
  import { convertPathToPattern, glob } from "../compiled/tinyglobby/index.js";
12
- import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "node:module";
13
- const __WEBPACK_EXTERNAL_createRequire_require = __WEBPACK_EXTERNAL_createRequire(import.meta.url);
14
- const tsconfig_paths_index_js_namespaceObject = __WEBPACK_EXTERNAL_createRequire_require("../compiled/tsconfig-paths/index.js");
12
+ import { createRequire as __rspack_createRequire } from "node:module";
13
+ const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
14
+ const tsconfig_paths_index_js_namespaceObject = __rspack_createRequire_require("../compiled/tsconfig-paths/index.js");
15
15
  const { createMatchPath, loadConfig } = tsconfig_paths_index_js_namespaceObject;
16
16
  const utils_filename = fileURLToPath(import.meta.url);
17
17
  const utils_require = createRequire(utils_filename);
@@ -320,7 +320,10 @@ async function cleanDtsFiles(dir) {
320
320
  const patterns = [
321
321
  '/**/*.d.ts',
322
322
  '/**/*.d.cts',
323
- '/**/*.d.mts'
323
+ '/**/*.d.mts',
324
+ '/**/*.d.ts.map',
325
+ '/**/*.d.cts.map',
326
+ '/**/*.d.mts.map'
324
327
  ];
325
328
  const allFiles = await globDtsFiles(dir, patterns);
326
329
  await Promise.all(allFiles.map(async (file)=>promises.rm(file, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rsbuild-plugin-dts",
3
- "version": "0.18.1",
3
+ "version": "0.18.2",
4
4
  "description": "Rsbuild plugin that supports emitting declaration files for TypeScript.",
5
5
  "homepage": "https://rslib.rs",
6
6
  "bugs": {
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "@microsoft/api-extractor": "^7.55.1",
33
- "@rsbuild/core": "~1.6.8",
33
+ "@rsbuild/core": "~1.6.9",
34
34
  "@typescript/native-preview": "7.0.0-dev.20251123.1",
35
35
  "magic-string": "^0.30.21",
36
36
  "picocolors": "1.1.1",