rolldown-plugin-dts 0.22.3 → 0.22.4
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/filename.mjs +2 -4
- package/dist/index.mjs +6 -25
- package/dist/{resolver-Ds-R63_O.mjs → resolver-CdD-yT15.mjs} +1 -3
- package/dist/{tsc-GSZeR8WO.mjs → tsc-Bq8zpODY.mjs} +3 -15
- package/dist/tsc-context.mjs +1 -3
- package/dist/tsc-worker.mjs +2 -4
- package/dist/tsc.mjs +2 -3
- package/package.json +6 -6
package/dist/filename.mjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { RUNTIME_MODULE_ID } from "rolldown";
|
|
2
2
|
import { exactRegex } from "rolldown/filter";
|
|
3
|
-
|
|
4
3
|
//#region src/filename.ts
|
|
5
4
|
const RE_JS = /\.([cm]?)jsx?$/;
|
|
6
5
|
const RE_TS = /\.([cm]?)tsx?$/;
|
|
7
6
|
const RE_DTS = /\.d\.([cm]?)ts$/;
|
|
8
7
|
const RE_DTS_MAP = /\.d\.([cm]?)ts\.map$/;
|
|
9
8
|
const RE_NODE_MODULES = /[\\/]node_modules[\\/]/;
|
|
10
|
-
const RE_CSS = /\.css$/;
|
|
9
|
+
const RE_CSS = /\.(?:css|scss|sass|less|styl|stylus)$/;
|
|
11
10
|
const RE_VUE = /\.vue$/;
|
|
12
11
|
const RE_JSON = /\.json$/;
|
|
13
12
|
const RE_ROLLDOWN_RUNTIME = exactRegex(RUNTIME_MODULE_ID);
|
|
@@ -26,6 +25,5 @@ function resolveTemplateFn(fn, chunk) {
|
|
|
26
25
|
function replaceTemplateName(template, name) {
|
|
27
26
|
return template.replaceAll("[name]", name);
|
|
28
27
|
}
|
|
29
|
-
|
|
30
28
|
//#endregion
|
|
31
|
-
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 };
|
|
29
|
+
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 };
|
package/dist/index.mjs
CHANGED
|
@@ -7,27 +7,15 @@ 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
|
-
const {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} = globalThis.process.getBuiltinModule("node:child_process");
|
|
14
|
-
const {
|
|
15
|
-
existsSync
|
|
16
|
-
} = globalThis.process.getBuiltinModule("node:fs");
|
|
17
|
-
const {
|
|
18
|
-
mkdtemp,
|
|
19
|
-
readFile,
|
|
20
|
-
rm
|
|
21
|
-
} = globalThis.process.getBuiltinModule("node:fs/promises");
|
|
10
|
+
const { fork, spawn } = globalThis.process.getBuiltinModule("node:child_process");
|
|
11
|
+
const { existsSync } = globalThis.process.getBuiltinModule("node:fs");
|
|
12
|
+
const { mkdtemp, readFile, rm } = globalThis.process.getBuiltinModule("node:fs/promises");
|
|
22
13
|
const path = globalThis.process.getBuiltinModule("node:path");
|
|
23
14
|
import { ResolverFactory, isolatedDeclarationSync } from "rolldown/experimental";
|
|
24
|
-
const {
|
|
25
|
-
tmpdir
|
|
26
|
-
} = globalThis.process.getBuiltinModule("node:os");
|
|
15
|
+
const { tmpdir } = globalThis.process.getBuiltinModule("node:os");
|
|
27
16
|
const process = globalThis.process;
|
|
28
17
|
import { getTsconfig, parseTsconfig } from "get-tsconfig";
|
|
29
18
|
import { createResolver } from "dts-resolver";
|
|
30
|
-
|
|
31
19
|
//#region src/dts-input.ts
|
|
32
20
|
function createDtsInputPlugin({ sideEffects }) {
|
|
33
21
|
return {
|
|
@@ -61,7 +49,6 @@ function createDtsInputPlugin({ sideEffects }) {
|
|
|
61
49
|
}
|
|
62
50
|
};
|
|
63
51
|
}
|
|
64
|
-
|
|
65
52
|
//#endregion
|
|
66
53
|
//#region src/fake-js.ts
|
|
67
54
|
function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
|
|
@@ -647,7 +634,6 @@ function inheritNodeComments(oldNode, newNode) {
|
|
|
647
634
|
newNode.leadingComments = collectReferenceDirectives(newNode.leadingComments, true);
|
|
648
635
|
return newNode;
|
|
649
636
|
}
|
|
650
|
-
|
|
651
637
|
//#endregion
|
|
652
638
|
//#region src/tsgo.ts
|
|
653
639
|
const debug$3 = createDebug("rolldown-plugin-dts:tsgo");
|
|
@@ -690,7 +676,6 @@ async function runTsgo(rootDir, tsconfig, sourcemap, tsgoPath) {
|
|
|
690
676
|
await spawnAsync(tsgo, args, { stdio: "inherit" });
|
|
691
677
|
return tsgoDist;
|
|
692
678
|
}
|
|
693
|
-
|
|
694
679
|
//#endregion
|
|
695
680
|
//#region src/generate.ts
|
|
696
681
|
const debug$2 = createDebug("rolldown-plugin-dts:generate");
|
|
@@ -929,7 +914,6 @@ function collectJsonExports(code) {
|
|
|
929
914
|
else if (member.key.type === "StringLiteral") exports.push(member.key.value);
|
|
930
915
|
return exports;
|
|
931
916
|
}
|
|
932
|
-
|
|
933
917
|
//#endregion
|
|
934
918
|
//#region src/options.ts
|
|
935
919
|
let warnedTsgo = false;
|
|
@@ -997,7 +981,6 @@ function resolveOptions({ cwd = process.cwd(), dtsInput = false, emitDtsOnly = f
|
|
|
997
981
|
tsgo
|
|
998
982
|
};
|
|
999
983
|
}
|
|
1000
|
-
|
|
1001
984
|
//#endregion
|
|
1002
985
|
//#region src/resolver.ts
|
|
1003
986
|
const debug$1 = createDebug("rolldown-plugin-dts:resolver");
|
|
@@ -1060,7 +1043,7 @@ function createDtsResolvePlugin({ cwd, tsconfig, tsconfigRaw, resolver, sideEffe
|
|
|
1060
1043
|
async function resolveDtsPath(id, importer, rolldownResolution) {
|
|
1061
1044
|
let dtsPath;
|
|
1062
1045
|
if (resolver === "tsc") {
|
|
1063
|
-
const { tscResolve } = await import("./resolver-
|
|
1046
|
+
const { tscResolve } = await import("./resolver-CdD-yT15.mjs");
|
|
1064
1047
|
dtsPath = tscResolve(id, importer, cwd, tsconfig, tsconfigRaw);
|
|
1065
1048
|
} else dtsPath = baseDtsResolver(id, importer);
|
|
1066
1049
|
debug$1("Using %s for dts import: %O -> %O", resolver, id, dtsPath);
|
|
@@ -1075,7 +1058,6 @@ function createDtsResolvePlugin({ cwd, tsconfig, tsconfigRaw, resolver, sideEffe
|
|
|
1075
1058
|
function isFilePath(id) {
|
|
1076
1059
|
return id.startsWith(".") || path.isAbsolute(id);
|
|
1077
1060
|
}
|
|
1078
|
-
|
|
1079
1061
|
//#endregion
|
|
1080
1062
|
//#region src/index.ts
|
|
1081
1063
|
const debug = createDebug("rolldown-plugin-dts:options");
|
|
@@ -1089,6 +1071,5 @@ function dts(options = {}) {
|
|
|
1089
1071
|
plugins.push(createDtsResolvePlugin(resolved), createFakeJsPlugin(resolved));
|
|
1090
1072
|
return plugins;
|
|
1091
1073
|
}
|
|
1092
|
-
|
|
1093
1074
|
//#endregion
|
|
1094
|
-
export { createFakeJsPlugin, createGeneratePlugin, dts, resolveOptions };
|
|
1075
|
+
export { createFakeJsPlugin, createGeneratePlugin, dts, resolveOptions };
|
|
@@ -2,7 +2,6 @@ const __cjs_require = globalThis.process.getBuiltinModule("module").createRequir
|
|
|
2
2
|
import { createDebug } from "obug";
|
|
3
3
|
const path = globalThis.process.getBuiltinModule("node:path");
|
|
4
4
|
const ts = __cjs_require("typescript");
|
|
5
|
-
|
|
6
5
|
//#region src/tsc/resolver.ts
|
|
7
6
|
const debug = createDebug("rolldown-plugin-dts:tsc-resolver");
|
|
8
7
|
function tscResolve(id, importer, cwd, tsconfig, tsconfigRaw, reference) {
|
|
@@ -15,6 +14,5 @@ function tscResolve(id, importer, cwd, tsconfig, tsconfigRaw, reference) {
|
|
|
15
14
|
debug(`tsc resolving id "%s" from "%s" -> %O`, id, importer, resolved.resolvedModule);
|
|
16
15
|
return resolved.resolvedModule?.resolvedFileName;
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
//#endregion
|
|
20
|
-
export { tscResolve };
|
|
18
|
+
export { tscResolve };
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
const __cjs_require = globalThis.process.getBuiltinModule("module").createRequire(import.meta.url);
|
|
2
2
|
import { RE_DTS, RE_DTS_MAP } from "./filename.mjs";
|
|
3
3
|
import { globalContext } from "./tsc-context.mjs";
|
|
4
|
-
const {
|
|
5
|
-
createRequire
|
|
6
|
-
} = globalThis.process.getBuiltinModule("node:module");
|
|
4
|
+
const { createRequire } = globalThis.process.getBuiltinModule("node:module");
|
|
7
5
|
import { createDebug } from "obug";
|
|
8
6
|
const path = globalThis.process.getBuiltinModule("node:path");
|
|
9
7
|
const ts = __cjs_require("typescript");
|
|
10
|
-
const {
|
|
11
|
-
pathToFileURL
|
|
12
|
-
} = globalThis.process.getBuiltinModule("node:url");
|
|
13
|
-
|
|
8
|
+
const { pathToFileURL } = globalThis.process.getBuiltinModule("node:url");
|
|
14
9
|
//#region \0rolldown/runtime.js
|
|
15
10
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
16
|
-
|
|
17
11
|
//#endregion
|
|
18
12
|
//#region src/tsc/system.ts
|
|
19
13
|
const debug$4 = createDebug("rolldown-plugin-dts:tsc-system");
|
|
@@ -64,7 +58,6 @@ function createMemorySystem(files) {
|
|
|
64
58
|
}
|
|
65
59
|
};
|
|
66
60
|
}
|
|
67
|
-
|
|
68
61
|
//#endregion
|
|
69
62
|
//#region src/tsc/utils.ts
|
|
70
63
|
const formatHost = {
|
|
@@ -87,7 +80,6 @@ function setSourceMapRoot(map, originalFilePath, finalFilePath) {
|
|
|
87
80
|
const finalDir = path.posix.dirname(pathToFileURL(finalFilePath).pathname);
|
|
88
81
|
if (originalDir !== finalDir) map.sourceRoot = path.posix.relative(finalDir, originalDir);
|
|
89
82
|
}
|
|
90
|
-
|
|
91
83
|
//#endregion
|
|
92
84
|
//#region src/tsc/emit-build.ts
|
|
93
85
|
const debug$3 = createDebug("rolldown-plugin-dts:tsc-build");
|
|
@@ -241,7 +233,6 @@ function patchCompilerOptions(options, extraOptions) {
|
|
|
241
233
|
const createProgramWithPatchedCompilerOptions = (rootNames, options, ...args) => {
|
|
242
234
|
return ts.createEmitAndSemanticDiagnosticsBuilderProgram(rootNames, patchCompilerOptions(options ?? {}, null), ...args);
|
|
243
235
|
};
|
|
244
|
-
|
|
245
236
|
//#endregion
|
|
246
237
|
//#region src/tsc/volar.ts
|
|
247
238
|
const debug$2 = createDebug("rolldown-plugin-dts:volar");
|
|
@@ -306,7 +297,6 @@ function createProgramFactory(ts, options) {
|
|
|
306
297
|
return { languagePlugins };
|
|
307
298
|
});
|
|
308
299
|
}
|
|
309
|
-
|
|
310
300
|
//#endregion
|
|
311
301
|
//#region src/tsc/emit-compiler.ts
|
|
312
302
|
const debug$1 = createDebug("rolldown-plugin-dts:tsc-compiler");
|
|
@@ -425,7 +415,6 @@ function tscEmitCompiler(tscOptions) {
|
|
|
425
415
|
map
|
|
426
416
|
};
|
|
427
417
|
}
|
|
428
|
-
|
|
429
418
|
//#endregion
|
|
430
419
|
//#region src/tsc/index.ts
|
|
431
420
|
const debug = createDebug("rolldown-plugin-dts:tsc");
|
|
@@ -435,6 +424,5 @@ function tscEmit(tscOptions) {
|
|
|
435
424
|
if (tscOptions.build) return tscEmitBuild(tscOptions);
|
|
436
425
|
else return tscEmitCompiler(tscOptions);
|
|
437
426
|
}
|
|
438
|
-
|
|
439
427
|
//#endregion
|
|
440
|
-
export { tscEmit as t };
|
|
428
|
+
export { tscEmit as t };
|
package/dist/tsc-context.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createDebug } from "obug";
|
|
2
2
|
const path = globalThis.process.getBuiltinModule("node:path");
|
|
3
|
-
|
|
4
3
|
//#region src/tsc/context.ts
|
|
5
4
|
const debug = createDebug("rolldown-plugin-dts:tsc-context");
|
|
6
5
|
function createContext() {
|
|
@@ -20,6 +19,5 @@ function invalidateContextFile(context, file) {
|
|
|
20
19
|
context.projects.clear();
|
|
21
20
|
}
|
|
22
21
|
const globalContext = createContext();
|
|
23
|
-
|
|
24
22
|
//#endregion
|
|
25
|
-
export { createContext, globalContext, invalidateContextFile };
|
|
23
|
+
export { createContext, globalContext, invalidateContextFile };
|
package/dist/tsc-worker.mjs
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { t as tscEmit } from "./tsc-
|
|
1
|
+
import { t as tscEmit } from "./tsc-Bq8zpODY.mjs";
|
|
2
2
|
const process = globalThis.process;
|
|
3
3
|
import { createBirpc } from "birpc";
|
|
4
|
-
|
|
5
4
|
//#region src/tsc/worker.ts
|
|
6
5
|
createBirpc({ tscEmit }, {
|
|
7
6
|
post: (data) => process.send(data),
|
|
8
7
|
on: (fn) => process.on("message", fn)
|
|
9
8
|
});
|
|
10
|
-
|
|
11
9
|
//#endregion
|
|
12
|
-
export {
|
|
10
|
+
export {};
|
package/dist/tsc.mjs
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { t as tscEmit } from "./tsc-
|
|
2
|
-
|
|
3
|
-
export { tscEmit };
|
|
1
|
+
import { t as tscEmit } from "./tsc-Bq8zpODY.mjs";
|
|
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.22.
|
|
4
|
+
"version": "0.22.4",
|
|
5
5
|
"description": "A Rolldown plugin to generate and bundle dts files.",
|
|
6
6
|
"author": "Kevin Deng <sxzz@sxzz.moe>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -74,19 +74,19 @@
|
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@jridgewell/source-map": "^0.3.11",
|
|
77
|
-
"@sxzz/eslint-config": "^7.8.
|
|
77
|
+
"@sxzz/eslint-config": "^7.8.3",
|
|
78
78
|
"@sxzz/prettier-config": "^2.3.1",
|
|
79
79
|
"@sxzz/test-utils": "^0.5.15",
|
|
80
80
|
"@types/node": "^25.3.3",
|
|
81
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
81
|
+
"@typescript/native-preview": "7.0.0-dev.20260305.1",
|
|
82
82
|
"@volar/typescript": "^2.4.28",
|
|
83
83
|
"@vue/language-core": "^3.2.5",
|
|
84
|
-
"arktype": "^2.
|
|
84
|
+
"arktype": "^2.2.0",
|
|
85
85
|
"bumpp": "^10.4.1",
|
|
86
86
|
"diff": "^8.0.3",
|
|
87
87
|
"eslint": "^10.0.2",
|
|
88
88
|
"prettier": "^3.8.1",
|
|
89
|
-
"rolldown": "^1.0.0-rc.
|
|
89
|
+
"rolldown": "^1.0.0-rc.7",
|
|
90
90
|
"rolldown-plugin-dts-snapshot": "^0.4.0",
|
|
91
91
|
"rolldown-plugin-require-cjs": "^0.3.3",
|
|
92
92
|
"rollup-plugin-dts": "^6.3.0",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"zod": "^4.3.6"
|
|
100
100
|
},
|
|
101
101
|
"resolutions": {
|
|
102
|
-
"rolldown": "^1.0.0-rc.
|
|
102
|
+
"rolldown": "^1.0.0-rc.7"
|
|
103
103
|
},
|
|
104
104
|
"prettier": "@sxzz/prettier-config",
|
|
105
105
|
"scripts": {
|