rsbuild-plugin-dts 0.20.1 → 0.20.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/350.js CHANGED
@@ -1,6 +1,3 @@
1
- import { createRequire as __rspack_createRequire } from "node:module";
2
- const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
3
- import { __webpack_require__ } from "./rslib-runtime.js";
4
1
  import node_fs from "node:fs";
5
2
  import promises from "node:fs/promises";
6
3
  import { createRequire } from "node:module";
@@ -12,6 +9,9 @@ import fs_0, * as __rspack_external_fs from "fs";
12
9
  import path_0, { basename as external_path_basename, dirname as external_path_dirname, normalize as external_path_normalize, posix, relative as external_path_relative, resolve as external_path_resolve, sep as external_path_sep } from "path";
13
10
  import { fileURLToPath } from "url";
14
11
  import { createRequire as external_module_createRequire } from "module";
12
+ import { __webpack_require__ } from "./rslib-runtime.js";
13
+ import { createRequire as __rspack_createRequire } from "node:module";
14
+ const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
15
15
  __webpack_require__.add({
16
16
  "../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.js" (module, __unused_rspack_exports, __webpack_require__) {
17
17
  const pico = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.js");
@@ -3436,7 +3436,7 @@ async function redirectDtsImports(dtsFile, dtsExtension, redirect, matchPath, ou
3436
3436
  for (const imp of matchModule){
3437
3437
  const { n: importPath, s: start, e: end } = imp;
3438
3438
  if (importPath) try {
3439
- const absoluteImportPath = matchPath(importPath, void 0, void 0, [
3439
+ let absoluteImportPath = matchPath(importPath, void 0, void 0, [
3440
3440
  '.jsx',
3441
3441
  '.tsx',
3442
3442
  '.js',
@@ -3448,6 +3448,7 @@ async function redirectDtsImports(dtsFile, dtsExtension, redirect, matchPath, ou
3448
3448
  '.d.ts'
3449
3449
  ]);
3450
3450
  let redirectImportPath = importPath;
3451
+ if (absoluteImportPath?.endsWith('.d')) absoluteImportPath = absoluteImportPath.slice(0, -2);
3451
3452
  if (absoluteImportPath && !absoluteImportPath.includes('node_modules') && redirect.path) {
3452
3453
  const relativeRootDir = node_path.relative(normalize(rootDir), normalize(absoluteImportPath));
3453
3454
  const isOutsideRootdir = relativeRootDir.startsWith('..') || node_path.isAbsolute(relativeRootDir);
package/dist/dts.js CHANGED
@@ -13,7 +13,7 @@ const calcBundledPackages = (options)=>{
13
13
  try {
14
14
  const content = node_fs.readFileSync(join(cwd, 'package.json'), 'utf-8');
15
15
  pkgJson = JSON.parse(content);
16
- } catch (_err) {
16
+ } catch {
17
17
  logger.warn('The type of third-party packages will not be bundled due to read package.json failed');
18
18
  return [];
19
19
  }
package/dist/index.js CHANGED
@@ -100,7 +100,7 @@ const pluginDts = (options = {})=>({
100
100
  const killProcesses = ()=>{
101
101
  for (const childProcess of childProcesses)if (!childProcess.killed) try {
102
102
  childProcess.kill();
103
- } catch (_err) {}
103
+ } catch {}
104
104
  childProcesses = [];
105
105
  };
106
106
  api.onCloseBuild(killProcesses);
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type RsbuildConfig } from '@rsbuild/core';
2
- import { type MatchPath } from '../compiled/tsconfig-paths';
2
+ import { type MatchPath } from '../compiled/tsconfig-paths/index.js';
3
3
  import type { CompilerOptions, Diagnostic, ParsedCommandLine } from 'typescript';
4
4
  import type { DtsEntry, DtsRedirect } from './index.js';
5
5
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rsbuild-plugin-dts",
3
- "version": "0.20.1",
3
+ "version": "0.20.2",
4
4
  "description": "Rsbuild plugin that supports emitting declaration files for TypeScript.",
5
5
  "homepage": "https://rslib.rs",
6
6
  "bugs": {
@@ -30,12 +30,12 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "@microsoft/api-extractor": "^7.57.7",
33
- "@rsbuild/core": "2.0.0-beta.10",
34
- "@typescript/native-preview": "7.0.0-dev.20260322.1",
33
+ "@rsbuild/core": "2.0.0-beta.11",
34
+ "@typescript/native-preview": "7.0.0-dev.20260329.1",
35
35
  "magic-string": "^0.30.21",
36
36
  "prebundle": "1.6.4",
37
37
  "rsbuild-plugin-publint": "^0.3.4",
38
- "rslib": "npm:@rslib/core@0.20.0",
38
+ "rslib": "npm:@rslib/core@0.20.1",
39
39
  "tinyglobby": "^0.2.15",
40
40
  "tsconfig-paths": "^4.2.0",
41
41
  "typescript": "^6.0.2",
@@ -66,8 +66,8 @@
66
66
  "registry": "https://registry.npmjs.org/"
67
67
  },
68
68
  "scripts": {
69
- "build": "rslib build",
70
- "dev": "rslib build --watch",
69
+ "build": "rslib",
70
+ "dev": "rslib --watch",
71
71
  "prebundle": "prebundle",
72
72
  "test": "rstest"
73
73
  }