rolldown-plugin-dts 0.22.4 → 0.23.0
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/README.md +1 -1
- package/dist/{filename.mjs → filename-DQnUJlio.mjs} +1 -1
- package/dist/{index-lpAqB_wE.d.mts → index-DAUYR4Qd.d.mts} +1 -1
- package/dist/index.mjs +10 -10
- package/dist/{filename.d.mts → internal.d.mts} +2 -1
- package/dist/internal.mjs +3 -0
- package/dist/{resolver-CdD-yT15.mjs → resolver-DkvdaW3s.mjs} +3 -2
- package/dist/{tsc-Bq8zpODY.mjs → tsc-8hYVvCE4.mjs} +6 -5
- package/dist/tsc-context.d.mts +1 -1
- package/dist/tsc-context.mjs +1 -1
- package/dist/tsc-worker.d.mts +1 -1
- package/dist/tsc-worker.mjs +2 -2
- package/dist/tsc.d.mts +1 -1
- package/dist/tsc.mjs +1 -1
- package/package.json +25 -25
- /package/dist/{context-Cc-Tkynb.d.mts → context-3rlTPR48.d.mts} +0 -0
package/README.md
CHANGED
|
@@ -26,4 +26,4 @@ function replaceTemplateName(template, name) {
|
|
|
26
26
|
return template.replaceAll("[name]", name);
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
|
-
export {
|
|
29
|
+
export { RE_JSON as a, RE_TS as c, filename_js_to_dts as d, filename_to_dts as f, RE_JS as i, RE_VUE as l, resolveTemplateFn as m, RE_DTS as n, RE_NODE_MODULES as o, replaceTemplateName as p, RE_DTS_MAP as r, RE_ROLLDOWN_RUNTIME as s, RE_CSS as t, filename_dts_to as u };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as RE_JSON, c as RE_TS, d as filename_js_to_dts, f as filename_to_dts, i as RE_JS, l as RE_VUE, m as resolveTemplateFn, n as RE_DTS, o as RE_NODE_MODULES, p as replaceTemplateName, r as RE_DTS_MAP, s as RE_ROLLDOWN_RUNTIME, t as RE_CSS, u as filename_dts_to } from "./filename-DQnUJlio.mjs";
|
|
2
2
|
import { createContext, globalContext, invalidateContextFile } from "./tsc-context.mjs";
|
|
3
3
|
import { createDebug } from "obug";
|
|
4
4
|
import { importerId, include } from "rolldown/filter";
|
|
@@ -7,13 +7,13 @@ import { isIdentifierName } from "@babel/helper-validator-identifier";
|
|
|
7
7
|
import { parse } from "@babel/parser";
|
|
8
8
|
import * as t from "@babel/types";
|
|
9
9
|
import { isDeclarationType, isIdentifierOf, isTypeOf, resolveString, walkAST } from "ast-kit";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
import { fork, spawn } from "node:child_process";
|
|
11
|
+
import { existsSync } from "node:fs";
|
|
12
|
+
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
13
|
+
import path from "node:path";
|
|
14
14
|
import { ResolverFactory, isolatedDeclarationSync } from "rolldown/experimental";
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
import { tmpdir } from "node:os";
|
|
16
|
+
import process from "node:process";
|
|
17
17
|
import { getTsconfig, parseTsconfig } from "get-tsconfig";
|
|
18
18
|
import { createResolver } from "dts-resolver";
|
|
19
19
|
//#region src/dts-input.ts
|
|
@@ -95,7 +95,7 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
|
|
|
95
95
|
};
|
|
96
96
|
function transform(code, id) {
|
|
97
97
|
const file = parse(code, {
|
|
98
|
-
plugins: [["typescript", { dts: true }]],
|
|
98
|
+
plugins: [["typescript", { dts: true }], "decoratorAutoAccessors"],
|
|
99
99
|
sourceType: "module",
|
|
100
100
|
errorRecovery: true,
|
|
101
101
|
createParenthesizedExpressions: true
|
|
@@ -1010,7 +1010,7 @@ function createDtsResolvePlugin({ cwd, tsconfig, tsconfigRaw, resolver, sideEffe
|
|
|
1010
1010
|
debug$1("Rolldown resolution for dts import %O from %O: %O", id, importer, rolldownResolution);
|
|
1011
1011
|
if (rolldownResolution?.external) {
|
|
1012
1012
|
debug$1("Rolldown marked dts import as external:", id);
|
|
1013
|
-
return
|
|
1013
|
+
return rolldownResolution;
|
|
1014
1014
|
}
|
|
1015
1015
|
const dtsResolution = await resolveDtsPath(id, importer, rolldownResolution);
|
|
1016
1016
|
debug$1("Dts resolution for dts import %O from %O: %O", id, importer, dtsResolution);
|
|
@@ -1043,7 +1043,7 @@ function createDtsResolvePlugin({ cwd, tsconfig, tsconfigRaw, resolver, sideEffe
|
|
|
1043
1043
|
async function resolveDtsPath(id, importer, rolldownResolution) {
|
|
1044
1044
|
let dtsPath;
|
|
1045
1045
|
if (resolver === "tsc") {
|
|
1046
|
-
const { tscResolve } = await import("./resolver-
|
|
1046
|
+
const { tscResolve } = await import("./resolver-DkvdaW3s.mjs");
|
|
1047
1047
|
dtsPath = tscResolve(id, importer, cwd, tsconfig, tsconfigRaw);
|
|
1048
1048
|
} else dtsPath = baseDtsResolver(id, importer);
|
|
1049
1049
|
debug$1("Using %s for dts import: %O -> %O", resolver, id, dtsPath);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChunkFileNamesFunction, PreRenderedChunk } from "rolldown";
|
|
2
|
+
import { parseTsconfig } from "get-tsconfig";
|
|
2
3
|
|
|
3
4
|
//#region src/filename.d.ts
|
|
4
5
|
declare const RE_JS: RegExp;
|
|
@@ -16,4 +17,4 @@ declare function filename_dts_to(id: string, ext: "js" | "ts"): string;
|
|
|
16
17
|
declare function resolveTemplateFn(fn: string | ChunkFileNamesFunction, chunk: PreRenderedChunk): string;
|
|
17
18
|
declare function replaceTemplateName(template: string, name: string): string;
|
|
18
19
|
//#endregion
|
|
19
|
-
export { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_JSON, RE_NODE_MODULES, RE_ROLLDOWN_RUNTIME, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts, replaceTemplateName, resolveTemplateFn };
|
|
20
|
+
export { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_JSON, RE_NODE_MODULES, RE_ROLLDOWN_RUNTIME, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts, parseTsconfig, replaceTemplateName, resolveTemplateFn };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as RE_JSON, c as RE_TS, d as filename_js_to_dts, f as filename_to_dts, i as RE_JS, l as RE_VUE, m as resolveTemplateFn, n as RE_DTS, o as RE_NODE_MODULES, p as replaceTemplateName, r as RE_DTS_MAP, s as RE_ROLLDOWN_RUNTIME, t as RE_CSS, u as filename_dts_to } from "./filename-DQnUJlio.mjs";
|
|
2
|
+
import { parseTsconfig } from "get-tsconfig";
|
|
3
|
+
export { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_JSON, RE_NODE_MODULES, RE_ROLLDOWN_RUNTIME, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts, parseTsconfig, replaceTemplateName, resolveTemplateFn };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { createRequire as __cjs_createRequire } from "node:module";
|
|
2
|
+
const __cjs_require = __cjs_createRequire(import.meta.url);
|
|
2
3
|
import { createDebug } from "obug";
|
|
3
|
-
|
|
4
|
+
import path from "node:path";
|
|
4
5
|
const ts = __cjs_require("typescript");
|
|
5
6
|
//#region src/tsc/resolver.ts
|
|
6
7
|
const debug = createDebug("rolldown-plugin-dts:tsc-resolver");
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { createRequire as __cjs_createRequire } from "node:module";
|
|
2
|
+
const __cjs_require = __cjs_createRequire(import.meta.url);
|
|
3
|
+
import { n as RE_DTS, r as RE_DTS_MAP } from "./filename-DQnUJlio.mjs";
|
|
3
4
|
import { globalContext } from "./tsc-context.mjs";
|
|
4
|
-
|
|
5
|
+
import { createRequire } from "node:module";
|
|
5
6
|
import { createDebug } from "obug";
|
|
6
|
-
|
|
7
|
+
import path from "node:path";
|
|
7
8
|
const ts = __cjs_require("typescript");
|
|
8
|
-
|
|
9
|
+
import { pathToFileURL } from "node:url";
|
|
9
10
|
//#region \0rolldown/runtime.js
|
|
10
11
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
11
12
|
//#endregion
|
package/dist/tsc-context.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as globalContext, i as createContext, n as SourceFileToProjectMap, o as invalidateContextFile, r as TscContext, t as ParsedProject } from "./context-
|
|
1
|
+
import { a as globalContext, i as createContext, n as SourceFileToProjectMap, o as invalidateContextFile, r as TscContext, t as ParsedProject } from "./context-3rlTPR48.mjs";
|
|
2
2
|
export { ParsedProject, SourceFileToProjectMap, TscContext, createContext, globalContext, invalidateContextFile };
|
package/dist/tsc-context.mjs
CHANGED
package/dist/tsc-worker.d.mts
CHANGED
package/dist/tsc-worker.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as tscEmit } from "./tsc-
|
|
2
|
-
|
|
1
|
+
import { t as tscEmit } from "./tsc-8hYVvCE4.mjs";
|
|
2
|
+
import process from "node:process";
|
|
3
3
|
import { createBirpc } from "birpc";
|
|
4
4
|
//#region src/tsc/worker.ts
|
|
5
5
|
createBirpc({ tscEmit }, {
|
package/dist/tsc.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as TscResult, n as TscModule, r as TscOptions, t as tscEmit } from "./index-
|
|
1
|
+
import { i as TscResult, n as TscModule, r as TscOptions, t as tscEmit } from "./index-DAUYR4Qd.mjs";
|
|
2
2
|
export { TscModule, TscOptions, TscResult, tscEmit };
|
package/dist/tsc.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as tscEmit } from "./tsc-
|
|
1
|
+
import { t as tscEmit } from "./tsc-8hYVvCE4.mjs";
|
|
2
2
|
export { tscEmit };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown-plugin-dts",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.23.0",
|
|
5
5
|
"description": "A Rolldown plugin to generate and bundle dts files.",
|
|
6
6
|
"author": "Kevin Deng <sxzz@sxzz.moe>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
],
|
|
25
25
|
"exports": {
|
|
26
26
|
".": "./dist/index.mjs",
|
|
27
|
-
"./
|
|
27
|
+
"./internal": "./dist/internal.mjs",
|
|
28
28
|
"./tsc": "./dist/tsc.mjs",
|
|
29
29
|
"./tsc-context": "./dist/tsc-context.mjs",
|
|
30
30
|
"./tsc-worker": "./dist/tsc-worker.mjs",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@ts-macro/tsc": "^0.3.6",
|
|
45
|
-
"@typescript/native-preview": ">=7.0.0-dev.
|
|
46
|
-
"rolldown": "^1.0.0-rc.
|
|
47
|
-
"typescript": "^5.0.0 || ^6.0.0
|
|
45
|
+
"@typescript/native-preview": ">=7.0.0-dev.20260325.1",
|
|
46
|
+
"rolldown": "^1.0.0-rc.12",
|
|
47
|
+
"typescript": "^5.0.0 || ^6.0.0",
|
|
48
48
|
"vue-tsc": "~3.2.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
@@ -62,14 +62,14 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@babel/generator": "8.0.0-rc.
|
|
66
|
-
"@babel/helper-validator-identifier": "8.0.0-rc.
|
|
67
|
-
"@babel/parser": "8.0.0-rc.
|
|
68
|
-
"@babel/types": "8.0.0-rc.
|
|
65
|
+
"@babel/generator": "8.0.0-rc.3",
|
|
66
|
+
"@babel/helper-validator-identifier": "8.0.0-rc.3",
|
|
67
|
+
"@babel/parser": "8.0.0-rc.3",
|
|
68
|
+
"@babel/types": "8.0.0-rc.3",
|
|
69
69
|
"ast-kit": "^3.0.0-beta.1",
|
|
70
70
|
"birpc": "^4.0.0",
|
|
71
71
|
"dts-resolver": "^2.1.3",
|
|
72
|
-
"get-tsconfig": "^4.13.
|
|
72
|
+
"get-tsconfig": "^4.13.7",
|
|
73
73
|
"obug": "^2.1.1"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
@@ -77,29 +77,29 @@
|
|
|
77
77
|
"@sxzz/eslint-config": "^7.8.3",
|
|
78
78
|
"@sxzz/prettier-config": "^2.3.1",
|
|
79
79
|
"@sxzz/test-utils": "^0.5.15",
|
|
80
|
-
"@types/node": "^25.
|
|
81
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
80
|
+
"@types/node": "^25.5.0",
|
|
81
|
+
"@typescript/native-preview": "7.0.0-dev.20260325.1",
|
|
82
82
|
"@volar/typescript": "^2.4.28",
|
|
83
|
-
"@vue/language-core": "^3.2.
|
|
83
|
+
"@vue/language-core": "^3.2.6",
|
|
84
84
|
"arktype": "^2.2.0",
|
|
85
|
-
"bumpp": "^
|
|
86
|
-
"diff": "^8.0.
|
|
87
|
-
"eslint": "^10.0
|
|
85
|
+
"bumpp": "^11.0.1",
|
|
86
|
+
"diff": "^8.0.4",
|
|
87
|
+
"eslint": "^10.1.0",
|
|
88
88
|
"prettier": "^3.8.1",
|
|
89
|
-
"rolldown": "^1.0.0-rc.
|
|
89
|
+
"rolldown": "^1.0.0-rc.12",
|
|
90
90
|
"rolldown-plugin-dts-snapshot": "^0.4.0",
|
|
91
|
-
"rolldown-plugin-require-cjs": "^0.
|
|
92
|
-
"rollup-plugin-dts": "^6.
|
|
91
|
+
"rolldown-plugin-require-cjs": "^0.4.0",
|
|
92
|
+
"rollup-plugin-dts": "^6.4.1",
|
|
93
93
|
"tinyglobby": "^0.2.15",
|
|
94
|
-
"tsdown": "^0.21.
|
|
95
|
-
"typescript": "6.0.
|
|
96
|
-
"vitest": "^4.
|
|
97
|
-
"vue": "^3.5.
|
|
98
|
-
"vue-tsc": "^3.2.
|
|
94
|
+
"tsdown": "^0.21.5",
|
|
95
|
+
"typescript": "^6.0.2",
|
|
96
|
+
"vitest": "^4.1.1",
|
|
97
|
+
"vue": "^3.5.31",
|
|
98
|
+
"vue-tsc": "^3.2.6",
|
|
99
99
|
"zod": "^4.3.6"
|
|
100
100
|
},
|
|
101
101
|
"resolutions": {
|
|
102
|
-
"rolldown": "^1.0.0-rc.
|
|
102
|
+
"rolldown": "^1.0.0-rc.12"
|
|
103
103
|
},
|
|
104
104
|
"prettier": "@sxzz/prettier-config",
|
|
105
105
|
"scripts": {
|
|
File without changes
|