rolldown-plugin-dts 0.13.4 → 0.13.6
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.d.ts +0 -4
- package/dist/index.js +5 -11
- package/dist/utils/tsc-worker.d.ts +2 -2
- package/package.json +8 -11
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ declare function createFakeJsPlugin({
|
|
|
7
7
|
dtsInput,
|
|
8
8
|
sourcemap
|
|
9
9
|
}: Pick<OptionsResolved, "dtsInput" | "sourcemap">): Plugin;
|
|
10
|
-
|
|
11
10
|
//#endregion
|
|
12
11
|
//#region src/generate.d.ts
|
|
13
12
|
declare function createGeneratePlugin({
|
|
@@ -19,7 +18,6 @@ declare function createGeneratePlugin({
|
|
|
19
18
|
parallel,
|
|
20
19
|
eager
|
|
21
20
|
}: Pick<OptionsResolved, "tsconfigRaw" | "tsconfigDir" | "isolatedDeclarations" | "emitDtsOnly" | "vue" | "parallel" | "eager">): Plugin;
|
|
22
|
-
|
|
23
21
|
//#endregion
|
|
24
22
|
//#region src/utils/filename.d.ts
|
|
25
23
|
declare const RE_JS: RegExp;
|
|
@@ -29,7 +27,6 @@ declare const RE_DTS_MAP: RegExp;
|
|
|
29
27
|
declare const RE_NODE_MODULES: RegExp;
|
|
30
28
|
declare const RE_CSS: RegExp;
|
|
31
29
|
declare const RE_VUE: RegExp;
|
|
32
|
-
|
|
33
30
|
//#endregion
|
|
34
31
|
//#region src/index.d.ts
|
|
35
32
|
interface Options {
|
|
@@ -123,6 +120,5 @@ declare function resolveOptions({
|
|
|
123
120
|
parallel,
|
|
124
121
|
eager
|
|
125
122
|
}: Options): OptionsResolved;
|
|
126
|
-
|
|
127
123
|
//#endregion
|
|
128
124
|
export { Options, OptionsResolved, RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE, createFakeJsPlugin, createGeneratePlugin, dts, resolveOptions };
|
package/dist/index.js
CHANGED
|
@@ -365,7 +365,7 @@ function createFakeJsPlugin({ dtsInput, sourcemap }) {
|
|
|
365
365
|
...appendStmts
|
|
366
366
|
];
|
|
367
367
|
const result = generate(file, {
|
|
368
|
-
comments:
|
|
368
|
+
comments: false,
|
|
369
369
|
sourceMaps: sourcemap,
|
|
370
370
|
sourceFileName: id
|
|
371
371
|
});
|
|
@@ -616,17 +616,10 @@ function overwriteNode(node, newNode) {
|
|
|
616
616
|
}
|
|
617
617
|
function inheritNodeComments(oldNode, newNode) {
|
|
618
618
|
newNode.leadingComments ||= [];
|
|
619
|
-
|
|
620
|
-
const leadingComments = filterHashtag(oldNode.leadingComments);
|
|
619
|
+
const leadingComments = oldNode.leadingComments?.filter((comment) => comment.value.startsWith("#"));
|
|
621
620
|
if (leadingComments) newNode.leadingComments.unshift(...leadingComments);
|
|
622
|
-
const trailingComments = filterHashtag(oldNode.trailingComments);
|
|
623
|
-
if (trailingComments) newNode.trailingComments.unshift(...trailingComments);
|
|
624
621
|
newNode.leadingComments = collectReferenceDirectives(newNode.leadingComments, true);
|
|
625
|
-
newNode.trailingComments = collectReferenceDirectives(newNode.trailingComments || [], true);
|
|
626
622
|
return newNode;
|
|
627
|
-
function filterHashtag(comments) {
|
|
628
|
-
return comments?.filter((comment) => comment.value.startsWith("#"));
|
|
629
|
-
}
|
|
630
623
|
}
|
|
631
624
|
|
|
632
625
|
//#endregion
|
|
@@ -673,8 +666,9 @@ function createGeneratePlugin({ tsconfigRaw, tsconfigDir, isolatedDeclarations,
|
|
|
673
666
|
...options,
|
|
674
667
|
entryFileNames(chunk) {
|
|
675
668
|
const original = (typeof options.entryFileNames === "function" ? options.entryFileNames(chunk) : options.entryFileNames) || "[name].js";
|
|
676
|
-
if (!
|
|
677
|
-
return original;
|
|
669
|
+
if (!chunk.name.endsWith(".d")) return original;
|
|
670
|
+
if (RE_DTS.test(original)) return original.replace("[name]", chunk.name.slice(0, -2));
|
|
671
|
+
return original.replace(RE_JS, ".$1ts");
|
|
678
672
|
}
|
|
679
673
|
};
|
|
680
674
|
},
|
|
@@ -15,12 +15,12 @@ interface TscResult {
|
|
|
15
15
|
map?: any;
|
|
16
16
|
error?: string;
|
|
17
17
|
}
|
|
18
|
-
declare function tscEmit(tscOptions: TscOptions): TscResult;
|
|
18
|
+
declare function tscEmit(tscOptions: TscOptions): TscResult;
|
|
19
|
+
//#endregion
|
|
19
20
|
//#region src/utils/tsc-worker.d.ts
|
|
20
21
|
declare const functions: {
|
|
21
22
|
tscEmit: typeof tscEmit;
|
|
22
23
|
};
|
|
23
24
|
type TscFunctions = typeof functions;
|
|
24
|
-
|
|
25
25
|
//#endregion
|
|
26
26
|
export { TscFunctions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown-plugin-dts",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.6",
|
|
4
4
|
"description": "A Rolldown plugin to bundle dts files",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@babel/generator": "^7.27.
|
|
45
|
-
"@babel/parser": "^7.27.
|
|
46
|
-
"@babel/types": "^7.27.
|
|
44
|
+
"@babel/generator": "^7.27.3",
|
|
45
|
+
"@babel/parser": "^7.27.3",
|
|
46
|
+
"@babel/types": "^7.27.3",
|
|
47
47
|
"ast-kit": "^2.0.0",
|
|
48
48
|
"birpc": "^2.3.0",
|
|
49
49
|
"debug": "^4.4.1",
|
|
@@ -60,26 +60,23 @@
|
|
|
60
60
|
"@volar/typescript": "^2.4.14",
|
|
61
61
|
"@vue/language-core": "^2.2.10",
|
|
62
62
|
"bumpp": "^10.1.1",
|
|
63
|
-
"diff": "^8.0.
|
|
63
|
+
"diff": "^8.0.2",
|
|
64
64
|
"eslint": "^9.27.0",
|
|
65
65
|
"estree-walker": "^3.0.3",
|
|
66
66
|
"prettier": "^3.5.3",
|
|
67
67
|
"rolldown": "1.0.0-beta.9",
|
|
68
68
|
"rollup-plugin-dts": "^6.2.1",
|
|
69
|
-
"tinyglobby": "^0.2.
|
|
70
|
-
"tsdown": "^0.
|
|
69
|
+
"tinyglobby": "^0.2.14",
|
|
70
|
+
"tsdown": "^0.12.3",
|
|
71
71
|
"tsx": "^4.19.4",
|
|
72
72
|
"typescript": "^5.8.3",
|
|
73
73
|
"vitest": "^3.1.4",
|
|
74
|
-
"vue": "^3.5.
|
|
74
|
+
"vue": "^3.5.15",
|
|
75
75
|
"vue-tsc": "^2.2.10"
|
|
76
76
|
},
|
|
77
77
|
"engines": {
|
|
78
78
|
"node": ">=20.18.0"
|
|
79
79
|
},
|
|
80
|
-
"resolutions": {
|
|
81
|
-
"rolldown-plugin-dts": "workspace:*"
|
|
82
|
-
},
|
|
83
80
|
"prettier": "@sxzz/prettier-config",
|
|
84
81
|
"scripts": {
|
|
85
82
|
"lint": "eslint --cache .",
|