rolldown-plugin-dts 0.17.7 → 0.18.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/dist/{context-CEOWNXv9.mjs → context-EuY-ImLj.mjs} +2 -2
- package/dist/index.mjs +7 -7
- package/dist/{resolver-CqKwRBz4.mjs → resolver-DksQRwY1.mjs} +2 -2
- package/dist/{tsc-DUcMz78D.mjs → tsc-BW5Mr7EL.mjs} +8 -8
- package/dist/tsc-context.mjs +1 -1
- package/dist/tsc-worker.mjs +2 -2
- package/dist/tsc.mjs +2 -2
- package/package.json +13 -13
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createDebug } from "obug";
|
|
2
2
|
const path = globalThis.process.getBuiltinModule("node:path");
|
|
3
3
|
|
|
4
4
|
//#region src/tsc/context.ts
|
|
5
|
-
const debug =
|
|
5
|
+
const debug = createDebug("rolldown-plugin-dts:tsc-context");
|
|
6
6
|
function createContext() {
|
|
7
7
|
return {
|
|
8
8
|
programs: [],
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const __cjs_require = globalThis.process.getBuiltinModule("module").createRequire(import.meta.url);
|
|
2
2
|
import { a as RE_JSON, c as RE_VUE, d as filename_to_dts, f as replaceTemplateName, i as RE_JS, l as filename_dts_to, n as RE_DTS, o as RE_NODE_MODULES, p as resolveTemplateFn, r as RE_DTS_MAP, s as RE_TS, t as RE_CSS, u as filename_js_to_dts } from "./filename-Cqnsj8Gp.mjs";
|
|
3
|
-
import { n as globalContext, r as invalidateContextFile, t as createContext } from "./context-
|
|
4
|
-
import
|
|
3
|
+
import { n as globalContext, r as invalidateContextFile, t as createContext } from "./context-EuY-ImLj.mjs";
|
|
4
|
+
import { createDebug } from "obug";
|
|
5
5
|
import MagicString from "magic-string";
|
|
6
6
|
const {
|
|
7
7
|
generate
|
|
@@ -27,7 +27,7 @@ const {
|
|
|
27
27
|
tmpdir
|
|
28
28
|
} = globalThis.process.getBuiltinModule("node:os");
|
|
29
29
|
const path = globalThis.process.getBuiltinModule("node:path");
|
|
30
|
-
import { ResolverFactory,
|
|
30
|
+
import { ResolverFactory, isolatedDeclarationSync } from "rolldown/experimental";
|
|
31
31
|
const process = globalThis.process;
|
|
32
32
|
import { getTsconfig, parseTsconfig } from "get-tsconfig";
|
|
33
33
|
import { createResolver } from "dts-resolver";
|
|
@@ -603,7 +603,7 @@ function inheritNodeComments(oldNode, newNode) {
|
|
|
603
603
|
|
|
604
604
|
//#endregion
|
|
605
605
|
//#region src/generate.ts
|
|
606
|
-
const debug$1 =
|
|
606
|
+
const debug$1 = createDebug("rolldown-plugin-dts:generate");
|
|
607
607
|
const WORKER_URL = "./tsc-worker.js";
|
|
608
608
|
const spawnAsync = (...args) => new Promise((resolve, reject) => {
|
|
609
609
|
const child = spawn(...args);
|
|
@@ -726,7 +726,7 @@ function createGeneratePlugin({ tsconfig, tsconfigRaw, build, incremental, cwd,
|
|
|
726
726
|
throw new Error(`tsgo did not generate dts file for ${id}, please check your tsconfig.`);
|
|
727
727
|
}
|
|
728
728
|
} else if (oxc && !RE_VUE.test(id)) {
|
|
729
|
-
const result =
|
|
729
|
+
const result = isolatedDeclarationSync(id, code, oxc);
|
|
730
730
|
if (result.errors.length) {
|
|
731
731
|
const [error] = result.errors;
|
|
732
732
|
return this.error({
|
|
@@ -970,7 +970,7 @@ function createDtsResolvePlugin({ cwd, tsconfig, tsconfigRaw, resolve, resolver,
|
|
|
970
970
|
async function resolveDtsPath(id, importer, rolldownResolution) {
|
|
971
971
|
let dtsPath;
|
|
972
972
|
if (resolver === "tsc") {
|
|
973
|
-
const { tscResolve } = await import("./resolver-
|
|
973
|
+
const { tscResolve } = await import("./resolver-DksQRwY1.mjs");
|
|
974
974
|
dtsPath = tscResolve(id, importer, cwd, tsconfig, tsconfigRaw);
|
|
975
975
|
} else dtsPath = baseDtsResolver(id, importer);
|
|
976
976
|
if (dtsPath) dtsPath = path.normalize(dtsPath);
|
|
@@ -987,7 +987,7 @@ function isFilePath(id) {
|
|
|
987
987
|
|
|
988
988
|
//#endregion
|
|
989
989
|
//#region src/index.ts
|
|
990
|
-
const debug =
|
|
990
|
+
const debug = createDebug("rolldown-plugin-dts:options");
|
|
991
991
|
function dts(options = {}) {
|
|
992
992
|
debug("resolving dts options");
|
|
993
993
|
const resolved = resolveOptions(options);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const __cjs_require = globalThis.process.getBuiltinModule("module").createRequire(import.meta.url);
|
|
2
|
-
import
|
|
2
|
+
import { createDebug } from "obug";
|
|
3
3
|
const path = globalThis.process.getBuiltinModule("node:path");
|
|
4
4
|
const ts = __cjs_require("typescript");
|
|
5
5
|
|
|
6
6
|
//#region src/tsc/resolver.ts
|
|
7
|
-
const debug =
|
|
7
|
+
const debug = createDebug("rolldown-plugin-dts:tsc-resolver");
|
|
8
8
|
function tscResolve(id, importer, cwd, tsconfig, tsconfigRaw, reference) {
|
|
9
9
|
const baseDir = tsconfig ? path.dirname(tsconfig) : cwd;
|
|
10
10
|
const parsedConfig = ts.parseJsonConfigFileContent(tsconfigRaw, ts.sys, baseDir);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const __cjs_require = globalThis.process.getBuiltinModule("module").createRequire(import.meta.url);
|
|
2
|
-
import { n as globalContext } from "./context-
|
|
2
|
+
import { n as globalContext } from "./context-EuY-ImLj.mjs";
|
|
3
3
|
const {
|
|
4
4
|
createRequire
|
|
5
5
|
} = globalThis.process.getBuiltinModule("node:module");
|
|
6
|
-
import
|
|
6
|
+
import { createDebug } from "obug";
|
|
7
7
|
const path = globalThis.process.getBuiltinModule("node:path");
|
|
8
8
|
const ts = __cjs_require("typescript");
|
|
9
9
|
const {
|
|
@@ -15,7 +15,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/tsc/system.ts
|
|
18
|
-
const debug$3 =
|
|
18
|
+
const debug$3 = createDebug("rolldown-plugin-dts:tsc-system");
|
|
19
19
|
/**
|
|
20
20
|
* A system that writes files to both memory and disk. It will try read files
|
|
21
21
|
* from memory firstly and fallback to disk if not found.
|
|
@@ -89,7 +89,7 @@ function setSourceMapRoot(map, originalFilePath, finalFilePath) {
|
|
|
89
89
|
|
|
90
90
|
//#endregion
|
|
91
91
|
//#region src/tsc/emit-build.ts
|
|
92
|
-
const debug$2 =
|
|
92
|
+
const debug$2 = createDebug("rolldown-plugin-dts:tsc-build");
|
|
93
93
|
function tscEmitBuild(tscOptions) {
|
|
94
94
|
const { id, tsconfig, incremental, context = globalContext, sourcemap } = tscOptions;
|
|
95
95
|
debug$2(`running tscEmitBuild id: ${id}, tsconfig: ${tsconfig}, incremental: ${incremental}`);
|
|
@@ -244,7 +244,7 @@ const createProgramWithPatchedCompilerOptions = (rootNames, options, ...args) =>
|
|
|
244
244
|
//#endregion
|
|
245
245
|
//#region src/tsc/volar.ts
|
|
246
246
|
function loadVueLanguageTools() {
|
|
247
|
-
const debug$4 =
|
|
247
|
+
const debug$4 = createDebug("rolldown-plugin-dts:vue");
|
|
248
248
|
debug$4("loading vue language tools");
|
|
249
249
|
try {
|
|
250
250
|
const vueTscPath = __require.resolve("vue-tsc");
|
|
@@ -269,7 +269,7 @@ function loadVueLanguageTools() {
|
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
function loadTsMacro() {
|
|
272
|
-
const debug$4 =
|
|
272
|
+
const debug$4 = createDebug("rolldown-plugin-dts:ts-macro");
|
|
273
273
|
debug$4("loading ts-macro language tools");
|
|
274
274
|
try {
|
|
275
275
|
const tsMacroPath = __require.resolve("@ts-macro/tsc");
|
|
@@ -304,7 +304,7 @@ function createProgramFactory(ts$1, options) {
|
|
|
304
304
|
|
|
305
305
|
//#endregion
|
|
306
306
|
//#region src/tsc/emit-compiler.ts
|
|
307
|
-
const debug$1 =
|
|
307
|
+
const debug$1 = createDebug("rolldown-plugin-dts:tsc-compiler");
|
|
308
308
|
const defaultCompilerOptions = {
|
|
309
309
|
declaration: true,
|
|
310
310
|
noEmit: false,
|
|
@@ -416,7 +416,7 @@ function tscEmitCompiler(tscOptions) {
|
|
|
416
416
|
|
|
417
417
|
//#endregion
|
|
418
418
|
//#region src/tsc/index.ts
|
|
419
|
-
const debug =
|
|
419
|
+
const debug = createDebug("rolldown-plugin-dts:tsc");
|
|
420
420
|
debug(`loaded typescript: ${ts.version}`);
|
|
421
421
|
function tscEmit(tscOptions) {
|
|
422
422
|
debug(`running tscEmit ${tscOptions.id}`);
|
package/dist/tsc-context.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as globalContext, r as invalidateContextFile, t as createContext } from "./context-
|
|
1
|
+
import { n as globalContext, r as invalidateContextFile, t as createContext } from "./context-EuY-ImLj.mjs";
|
|
2
2
|
|
|
3
3
|
export { createContext, globalContext, invalidateContextFile };
|
package/dist/tsc-worker.mjs
CHANGED
package/dist/tsc.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown-plugin-dts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "A Rolldown plugin to generate and bundle dts files.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@ts-macro/tsc": "^0.3.6",
|
|
44
44
|
"@typescript/native-preview": ">=7.0.0-dev.20250601.1",
|
|
45
|
-
"rolldown": "^1.0.0-beta.
|
|
45
|
+
"rolldown": "^1.0.0-beta.51",
|
|
46
46
|
"typescript": "^5.0.0",
|
|
47
47
|
"vue-tsc": "~3.1.0"
|
|
48
48
|
},
|
|
@@ -69,34 +69,34 @@
|
|
|
69
69
|
"dts-resolver": "^2.1.3",
|
|
70
70
|
"get-tsconfig": "^4.13.0",
|
|
71
71
|
"magic-string": "^0.30.21",
|
|
72
|
-
"obug": "^
|
|
72
|
+
"obug": "^2.0.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@sxzz/eslint-config": "^7.
|
|
76
|
-
"@sxzz/prettier-config": "^2.2.
|
|
75
|
+
"@sxzz/eslint-config": "^7.3.0",
|
|
76
|
+
"@sxzz/prettier-config": "^2.2.5",
|
|
77
77
|
"@sxzz/test-utils": "^0.5.12",
|
|
78
78
|
"@types/babel__generator": "^7.27.0",
|
|
79
79
|
"@types/node": "^24.10.1",
|
|
80
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
80
|
+
"@typescript/native-preview": "7.0.0-dev.20251118.1",
|
|
81
81
|
"@volar/typescript": "^2.4.23",
|
|
82
|
-
"@vue/language-core": "^3.1.
|
|
83
|
-
"arktype": "^2.1.
|
|
82
|
+
"@vue/language-core": "^3.1.4",
|
|
83
|
+
"arktype": "^2.1.27",
|
|
84
84
|
"bumpp": "^10.3.1",
|
|
85
85
|
"diff": "^8.0.2",
|
|
86
86
|
"eslint": "^9.39.1",
|
|
87
87
|
"prettier": "^3.6.2",
|
|
88
|
-
"rolldown": "^1.0.0-beta.
|
|
88
|
+
"rolldown": "^1.0.0-beta.51",
|
|
89
89
|
"rolldown-plugin-require-cjs": "^0.3.1",
|
|
90
90
|
"rollup-plugin-dts": "^6.2.3",
|
|
91
91
|
"tinyglobby": "^0.2.15",
|
|
92
|
-
"tsdown": "^0.16.
|
|
92
|
+
"tsdown": "^0.16.5",
|
|
93
93
|
"typescript": "^5.9.3",
|
|
94
|
-
"vitest": "^4.0.
|
|
94
|
+
"vitest": "^4.0.10",
|
|
95
95
|
"vue": "^3.5.24",
|
|
96
|
-
"vue-tsc": "^3.1.
|
|
96
|
+
"vue-tsc": "^3.1.4"
|
|
97
97
|
},
|
|
98
98
|
"engines": {
|
|
99
|
-
"node": ">=20.
|
|
99
|
+
"node": ">=20.19.0"
|
|
100
100
|
},
|
|
101
101
|
"prettier": "@sxzz/prettier-config",
|
|
102
102
|
"scripts": {
|