rolldown-plugin-dts 0.15.1 → 0.15.3
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.
|
@@ -9,6 +9,5 @@ declare const RE_VUE: RegExp;
|
|
|
9
9
|
declare function filename_js_to_dts(id: string): string;
|
|
10
10
|
declare function filename_to_dts(id: string): string;
|
|
11
11
|
declare function filename_dts_to(id: string, ext: "js" | "ts"): string;
|
|
12
|
-
declare function isRelative(id: string): boolean;
|
|
13
12
|
//#endregion
|
|
14
|
-
export { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts
|
|
13
|
+
export { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
|
|
3
1
|
//#region src/filename.ts
|
|
4
2
|
const RE_JS = /\.([cm]?)jsx?$/;
|
|
5
3
|
const RE_TS = /\.([cm]?)tsx?$/;
|
|
@@ -17,9 +15,6 @@ function filename_to_dts(id) {
|
|
|
17
15
|
function filename_dts_to(id, ext) {
|
|
18
16
|
return id.replace(RE_DTS, `.$1${ext}`);
|
|
19
17
|
}
|
|
20
|
-
function isRelative(id) {
|
|
21
|
-
return path.isAbsolute(id) || id[0] === ".";
|
|
22
|
-
}
|
|
23
18
|
|
|
24
19
|
//#endregion
|
|
25
|
-
export { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts
|
|
20
|
+
export { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts };
|
package/dist/filename.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts
|
|
2
|
-
export { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts
|
|
1
|
+
import { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts } from "./filename-DUAyqgqS.js";
|
|
2
|
+
export { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts };
|
package/dist/filename.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts
|
|
1
|
+
import { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts } from "./filename-DtB5setL.js";
|
|
2
2
|
|
|
3
|
-
export { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts
|
|
3
|
+
export { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE } from "./filename-
|
|
1
|
+
import { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE } from "./filename-DUAyqgqS.js";
|
|
2
2
|
import { IsolatedDeclarationsOptions } from "rolldown/experimental";
|
|
3
3
|
import { TsConfigJson } from "get-tsconfig";
|
|
4
4
|
import { Plugin } from "rolldown";
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts } from "./filename-
|
|
1
|
+
import { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts } from "./filename-DtB5setL.js";
|
|
2
2
|
import { createContext, globalContext, invalidateContextFile } from "./context-BG0dlajy.js";
|
|
3
3
|
import Debug from "debug";
|
|
4
4
|
import _generate from "@babel/generator";
|
|
5
5
|
import { parse } from "@babel/parser";
|
|
6
6
|
import * as t from "@babel/types";
|
|
7
7
|
import { isDeclarationType, isTypeOf, resolveString } from "ast-kit";
|
|
8
|
-
import path from "node:path";
|
|
9
8
|
import { fork, spawn } from "node:child_process";
|
|
10
9
|
import { existsSync } from "node:fs";
|
|
11
10
|
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
12
11
|
import { tmpdir } from "node:os";
|
|
12
|
+
import path from "node:path";
|
|
13
13
|
import { ResolverFactory, isolatedDeclaration } from "rolldown/experimental";
|
|
14
14
|
import process from "node:process";
|
|
15
15
|
import { getTsconfig, parseTsconfig } from "get-tsconfig";
|
|
@@ -627,6 +627,7 @@ function inheritNodeComments(oldNode, newNode) {
|
|
|
627
627
|
const leadingComments = oldNode.leadingComments?.filter((comment) => comment.value.startsWith("#"));
|
|
628
628
|
if (leadingComments) newNode.leadingComments.unshift(...leadingComments);
|
|
629
629
|
newNode.leadingComments = collectReferenceDirectives(newNode.leadingComments, true);
|
|
630
|
+
newNode.trailingComments = newNode.trailingComments?.filter((comment) => !comment.value.startsWith("# sourceMappingURL"));
|
|
630
631
|
return newNode;
|
|
631
632
|
}
|
|
632
633
|
|
|
@@ -905,29 +906,27 @@ function createDtsResolvePlugin({ tsconfig, resolve }) {
|
|
|
905
906
|
moduleSideEffects: false
|
|
906
907
|
};
|
|
907
908
|
if (!importer || !RE_DTS.test(importer)) return;
|
|
908
|
-
if (RE_CSS.test(id)) return
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
if (!resolution || !RE_TS.test(resolution) && !RE_VUE.test(resolution)) {
|
|
916
|
-
const result = await this.resolve(id, importer, options);
|
|
917
|
-
if (!result || !RE_TS.test(result.id)) return external;
|
|
918
|
-
resolution = result.id;
|
|
909
|
+
if (RE_CSS.test(id)) return external;
|
|
910
|
+
const rolldownResolution = await this.resolve(id, importer, options);
|
|
911
|
+
let dtsResolution = resolver(id, importer);
|
|
912
|
+
dtsResolution &&= path.normalize(dtsResolution);
|
|
913
|
+
if (!dtsResolution || !RE_TS.test(dtsResolution) && !RE_VUE.test(dtsResolution)) {
|
|
914
|
+
if (!rolldownResolution || !RE_TS.test(rolldownResolution.id) && !RE_VUE.test(rolldownResolution.id)) return external;
|
|
915
|
+
dtsResolution = rolldownResolution.id;
|
|
919
916
|
}
|
|
920
|
-
if (
|
|
917
|
+
if (RE_NODE_MODULES.test(dtsResolution)) {
|
|
921
918
|
let shouldResolve;
|
|
922
919
|
if (typeof resolve === "boolean") shouldResolve = resolve;
|
|
923
920
|
else shouldResolve = resolve.some((pattern) => typeof pattern === "string" ? id === pattern : pattern.test(id));
|
|
924
|
-
if (!shouldResolve)
|
|
921
|
+
if (!shouldResolve) if (RE_NODE_MODULES.test(importer)) {
|
|
922
|
+
if (rolldownResolution?.external) return external;
|
|
923
|
+
} else return external;
|
|
925
924
|
}
|
|
926
|
-
if (RE_TS.test(
|
|
927
|
-
await this.load({ id:
|
|
928
|
-
|
|
925
|
+
if (RE_TS.test(dtsResolution) && !RE_DTS.test(dtsResolution) || RE_VUE.test(dtsResolution)) {
|
|
926
|
+
await this.load({ id: dtsResolution });
|
|
927
|
+
dtsResolution = filename_to_dts(dtsResolution);
|
|
929
928
|
}
|
|
930
|
-
if (RE_DTS.test(
|
|
929
|
+
if (RE_DTS.test(dtsResolution)) return dtsResolution;
|
|
931
930
|
}
|
|
932
931
|
}
|
|
933
932
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown-plugin-dts",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3",
|
|
4
4
|
"description": "A Rolldown plugin to bundle dts files",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -64,23 +64,23 @@
|
|
|
64
64
|
"@sxzz/test-utils": "^0.5.9",
|
|
65
65
|
"@types/babel__generator": "^7.27.0",
|
|
66
66
|
"@types/debug": "^4.1.12",
|
|
67
|
-
"@types/node": "^24.
|
|
68
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
67
|
+
"@types/node": "^24.2.0",
|
|
68
|
+
"@typescript/native-preview": "7.0.0-dev.20250804.1",
|
|
69
69
|
"@volar/typescript": "^2.4.22",
|
|
70
|
-
"@vue/language-core": "^3.0.
|
|
71
|
-
"bumpp": "^10.2.
|
|
70
|
+
"@vue/language-core": "^3.0.5",
|
|
71
|
+
"bumpp": "^10.2.2",
|
|
72
72
|
"diff": "^8.0.2",
|
|
73
73
|
"eslint": "^9.32.0",
|
|
74
74
|
"estree-walker": "^3.0.3",
|
|
75
75
|
"prettier": "^3.6.2",
|
|
76
|
-
"rolldown": "^1.0.0-beta.
|
|
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.
|
|
80
|
-
"typescript": "^5.
|
|
79
|
+
"tsdown": "^0.13.2",
|
|
80
|
+
"typescript": "^5.9.2",
|
|
81
81
|
"vitest": "^3.2.4",
|
|
82
82
|
"vue": "^3.5.18",
|
|
83
|
-
"vue-tsc": "^3.0.
|
|
83
|
+
"vue-tsc": "^3.0.5"
|
|
84
84
|
},
|
|
85
85
|
"engines": {
|
|
86
86
|
"node": ">=20.18.0"
|