rolldown-plugin-dts 0.15.3 → 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.
- package/dist/index.js +20 -17
- package/dist/{tsc-BSxLVaDe.js → tsc-BJW5IMTs.js} +8 -1
- package/dist/tsc-worker.js +1 -1
- package/dist/tsc.js +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -701,29 +701,32 @@ function createGeneratePlugin({ tsconfig, tsconfigRaw, build, incremental, cwd,
|
|
|
701
701
|
order: "pre",
|
|
702
702
|
filter: { id: {
|
|
703
703
|
include: [
|
|
704
|
+
RE_JS,
|
|
704
705
|
RE_TS,
|
|
705
|
-
RE_VUE
|
|
706
|
-
...emitJs ? [RE_JS] : []
|
|
706
|
+
RE_VUE
|
|
707
707
|
],
|
|
708
708
|
exclude: [RE_DTS, RE_NODE_MODULES]
|
|
709
709
|
} },
|
|
710
710
|
handler(code, id) {
|
|
711
|
-
const
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
if (isEntry) {
|
|
721
|
-
const name = inputAliasMap.get(id);
|
|
722
|
-
this.emitFile({
|
|
723
|
-
type: "chunk",
|
|
724
|
-
id: dtsId,
|
|
725
|
-
name: name ? `${name}.d` : void 0
|
|
711
|
+
const shouldEmit = !RE_JS.test(id) || emitJs;
|
|
712
|
+
if (shouldEmit) {
|
|
713
|
+
const mod = this.getModuleInfo(id);
|
|
714
|
+
const isEntry = !!mod?.isEntry;
|
|
715
|
+
const dtsId = filename_to_dts(id);
|
|
716
|
+
dtsMap.set(dtsId, {
|
|
717
|
+
code,
|
|
718
|
+
id,
|
|
719
|
+
isEntry
|
|
726
720
|
});
|
|
721
|
+
debug$1("register dts source: %s", id);
|
|
722
|
+
if (isEntry) {
|
|
723
|
+
const name = inputAliasMap.get(id);
|
|
724
|
+
this.emitFile({
|
|
725
|
+
type: "chunk",
|
|
726
|
+
id: dtsId,
|
|
727
|
+
name: name ? `${name}.d` : void 0
|
|
728
|
+
});
|
|
729
|
+
}
|
|
727
730
|
}
|
|
728
731
|
if (emitDtsOnly) return "export { }";
|
|
729
732
|
}
|
|
@@ -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,
|
|
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.");
|
package/dist/tsc-worker.js
CHANGED
package/dist/tsc.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown-plugin-dts",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.5",
|
|
4
4
|
"description": "A Rolldown plugin to bundle dts files",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@types/babel__generator": "^7.27.0",
|
|
66
66
|
"@types/debug": "^4.1.12",
|
|
67
67
|
"@types/node": "^24.2.0",
|
|
68
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
68
|
+
"@typescript/native-preview": "7.0.0-dev.20250806.1",
|
|
69
69
|
"@volar/typescript": "^2.4.22",
|
|
70
70
|
"@vue/language-core": "^3.0.5",
|
|
71
71
|
"bumpp": "^10.2.2",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"rolldown": "^1.0.0-beta.31",
|
|
77
77
|
"rollup-plugin-dts": "^6.2.1",
|
|
78
78
|
"tinyglobby": "^0.2.14",
|
|
79
|
-
"tsdown": "^0.13.
|
|
79
|
+
"tsdown": "^0.13.3",
|
|
80
80
|
"typescript": "^5.9.2",
|
|
81
81
|
"vitest": "^3.2.4",
|
|
82
82
|
"vue": "^3.5.18",
|