rolldown-plugin-dts 0.15.4 → 0.15.5

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.
@@ -248,6 +248,13 @@ function tscEmit(tscOptions) {
248
248
  debug(`got source file: ${file.fileName}`);
249
249
  let dtsCode;
250
250
  let map;
251
+ const stripPrivateFields = (ctx) => {
252
+ const visitor = (node) => {
253
+ if (ts.isPropertySignature(node) && ts.isPrivateIdentifier(node.name)) return ctx.factory.updatePropertySignature(node, node.modifiers, ctx.factory.createStringLiteral(node.name.text), node.questionToken, node.type);
254
+ return ts.visitEachChild(node, visitor, ctx);
255
+ };
256
+ return (sourceFile) => ts.visitNode(sourceFile, visitor, ts.isSourceFile) ?? sourceFile;
257
+ };
251
258
  const { emitSkipped, diagnostics } = program.emit(file, (fileName, code) => {
252
259
  if (fileName.endsWith(".map")) {
253
260
  debug(`emit dts sourcemap: ${fileName}`);
@@ -256,7 +263,7 @@ function tscEmit(tscOptions) {
256
263
  debug(`emit dts: ${fileName}`);
257
264
  dtsCode = code;
258
265
  }
259
- }, void 0, true, void 0, true);
266
+ }, void 0, true, { afterDeclarations: [stripPrivateFields] }, true);
260
267
  if (emitSkipped && diagnostics.length) return { error: ts.formatDiagnostics(diagnostics, formatHost) };
261
268
  if (!dtsCode && file.isDeclarationFile) {
262
269
  debug("nothing was emitted. fallback to sourceFile text.");
@@ -1,5 +1,5 @@
1
1
  import "./context-BG0dlajy.js";
2
- import { tscEmit } from "./tsc-BSxLVaDe.js";
2
+ import { tscEmit } from "./tsc-BJW5IMTs.js";
3
3
  import process from "node:process";
4
4
  import { createBirpc } from "birpc";
5
5
 
package/dist/tsc.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import "./context-BG0dlajy.js";
2
- import { tscEmit } from "./tsc-BSxLVaDe.js";
2
+ import { tscEmit } from "./tsc-BJW5IMTs.js";
3
3
 
4
4
  export { tscEmit };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown-plugin-dts",
3
- "version": "0.15.4",
3
+ "version": "0.15.5",
4
4
  "description": "A Rolldown plugin to bundle dts files",
5
5
  "type": "module",
6
6
  "license": "MIT",