rolldown-plugin-dts 0.16.2 → 0.16.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/{index-Cbz-60ZO.d.ts → index-CxJisQQS.d.ts} +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +11 -11
- package/dist/{tsc-q7n7-QbP.js → tsc-DLbQk3B6.js} +67 -35
- package/dist/tsc-worker.d.ts +1 -1
- package/dist/tsc-worker.js +1 -1
- package/dist/tsc.d.ts +1 -1
- package/dist/tsc.js +1 -1
- package/package.json +7 -3
package/dist/index.d.ts
CHANGED
|
@@ -110,6 +110,10 @@ interface TscOptions {
|
|
|
110
110
|
*/
|
|
111
111
|
vue?: boolean;
|
|
112
112
|
/**
|
|
113
|
+
* If `true`, the plugin will generate `.d.ts` files using `@ts-macro/tsc`.
|
|
114
|
+
*/
|
|
115
|
+
tsMacro?: boolean;
|
|
116
|
+
/**
|
|
113
117
|
* If `true`, the plugin will launch a separate process for `tsc` or `vue-tsc`.
|
|
114
118
|
* This enables processing multiple projects in parallel.
|
|
115
119
|
*/
|
|
@@ -178,6 +182,7 @@ declare function resolveOptions({
|
|
|
178
182
|
build,
|
|
179
183
|
incremental,
|
|
180
184
|
vue,
|
|
185
|
+
tsMacro,
|
|
181
186
|
parallel,
|
|
182
187
|
eager,
|
|
183
188
|
newContext,
|
|
@@ -202,13 +207,14 @@ declare function createGeneratePlugin({
|
|
|
202
207
|
oxc,
|
|
203
208
|
emitDtsOnly,
|
|
204
209
|
vue,
|
|
210
|
+
tsMacro,
|
|
205
211
|
parallel,
|
|
206
212
|
eager,
|
|
207
213
|
tsgo,
|
|
208
214
|
newContext,
|
|
209
215
|
emitJs,
|
|
210
216
|
sourcemap
|
|
211
|
-
}: Pick<OptionsResolved, "cwd" | "tsconfig" | "tsconfigRaw" | "build" | "incremental" | "oxc" | "emitDtsOnly" | "vue" | "parallel" | "eager" | "tsgo" | "newContext" | "emitJs" | "sourcemap">): Plugin;
|
|
217
|
+
}: Pick<OptionsResolved, "cwd" | "tsconfig" | "tsconfigRaw" | "build" | "incremental" | "oxc" | "emitDtsOnly" | "vue" | "tsMacro" | "parallel" | "eager" | "tsgo" | "newContext" | "emitJs" | "sourcemap">): Plugin;
|
|
212
218
|
//#endregion
|
|
213
219
|
//#region src/index.d.ts
|
|
214
220
|
declare function dts(options?: Options): Plugin[];
|
package/dist/index.js
CHANGED
|
@@ -325,11 +325,7 @@ function createFakeJsPlugin({ sourcemap, cjsDefault }) {
|
|
|
325
325
|
...sideEffect ? [t.callExpression(t.identifier("sideEffect"), [bindings[0]])] : []
|
|
326
326
|
];
|
|
327
327
|
const runtime = t.arrayExpression(elements);
|
|
328
|
-
if (decl !== stmt)
|
|
329
|
-
decl.innerComments = stmt.innerComments;
|
|
330
|
-
decl.leadingComments = stmt.leadingComments;
|
|
331
|
-
decl.trailingComments = stmt.trailingComments;
|
|
332
|
-
}
|
|
328
|
+
if (decl !== stmt) decl.leadingComments = stmt.leadingComments;
|
|
333
329
|
const symbolId = registerSymbol({
|
|
334
330
|
decl,
|
|
335
331
|
deps,
|
|
@@ -385,7 +381,7 @@ function createFakeJsPlugin({ sourcemap, cjsDefault }) {
|
|
|
385
381
|
if (isHelperImport(node)) return null;
|
|
386
382
|
if (node.type === "ExpressionStatement") return null;
|
|
387
383
|
const newNode = patchImportExport(node, typeOnlyIds, cjsDefault);
|
|
388
|
-
if (newNode) return newNode;
|
|
384
|
+
if (newNode || newNode === false) return newNode;
|
|
389
385
|
if (node.type !== "VariableDeclaration") return node;
|
|
390
386
|
const [decl] = node.declarations;
|
|
391
387
|
if (decl.init?.type !== "ArrayExpression" || !decl.init.elements[0]) return null;
|
|
@@ -528,12 +524,13 @@ function isHelperImport(node) {
|
|
|
528
524
|
return node.type === "ImportDeclaration" && node.specifiers.length === 1 && node.specifiers.every((spec) => spec.type === "ImportSpecifier" && spec.imported.type === "Identifier" && ["__export", "__reExport"].includes(spec.imported.name));
|
|
529
525
|
}
|
|
530
526
|
function patchImportExport(node, typeOnlyIds, cjsDefault) {
|
|
527
|
+
if (node.type === "ExportNamedDeclaration" && !node.declaration && !node.source && !node.specifiers.length && !node.attributes?.length) return false;
|
|
531
528
|
if (isTypeOf(node, [
|
|
532
529
|
"ImportDeclaration",
|
|
533
530
|
"ExportAllDeclaration",
|
|
534
531
|
"ExportNamedDeclaration"
|
|
535
532
|
])) {
|
|
536
|
-
if (
|
|
533
|
+
if (node.type === "ExportNamedDeclaration" && typeOnlyIds.length) for (const spec of node.specifiers) {
|
|
537
534
|
const name = resolveString(spec.exported);
|
|
538
535
|
if (typeOnlyIds.includes(name)) if (spec.type === "ExportSpecifier") spec.exportKind = "type";
|
|
539
536
|
else node.exportKind = "type";
|
|
@@ -661,7 +658,6 @@ function inheritNodeComments(oldNode, newNode) {
|
|
|
661
658
|
const leadingComments = oldNode.leadingComments?.filter((comment) => comment.value.startsWith("#"));
|
|
662
659
|
if (leadingComments) newNode.leadingComments.unshift(...leadingComments);
|
|
663
660
|
newNode.leadingComments = collectReferenceDirectives(newNode.leadingComments, true);
|
|
664
|
-
newNode.trailingComments = newNode.trailingComments?.filter((comment) => !comment.value.startsWith("# sourceMappingURL"));
|
|
665
661
|
return newNode;
|
|
666
662
|
}
|
|
667
663
|
|
|
@@ -674,7 +670,7 @@ const spawnAsync = (...args) => new Promise((resolve, reject) => {
|
|
|
674
670
|
child.on("close", () => resolve());
|
|
675
671
|
child.on("error", (error) => reject(error));
|
|
676
672
|
});
|
|
677
|
-
function createGeneratePlugin({ tsconfig, tsconfigRaw, build, incremental, cwd, oxc, emitDtsOnly, vue, parallel, eager, tsgo, newContext, emitJs, sourcemap }) {
|
|
673
|
+
function createGeneratePlugin({ tsconfig, tsconfigRaw, build, incremental, cwd, oxc, emitDtsOnly, vue, tsMacro, parallel, eager, tsgo, newContext, emitJs, sourcemap }) {
|
|
678
674
|
const dtsMap = /* @__PURE__ */ new Map();
|
|
679
675
|
/**
|
|
680
676
|
* A map of input id to output file name
|
|
@@ -811,6 +807,7 @@ function createGeneratePlugin({ tsconfig, tsconfigRaw, build, incremental, cwd,
|
|
|
811
807
|
id,
|
|
812
808
|
sourcemap,
|
|
813
809
|
vue,
|
|
810
|
+
tsMacro,
|
|
814
811
|
context: tscContext
|
|
815
812
|
};
|
|
816
813
|
let result;
|
|
@@ -868,7 +865,7 @@ async function runTsgo(root, tsconfig) {
|
|
|
868
865
|
//#endregion
|
|
869
866
|
//#region src/options.ts
|
|
870
867
|
let warnedTsgo = false;
|
|
871
|
-
function resolveOptions({ cwd = process.cwd(), dtsInput = false, emitDtsOnly = false, tsconfig, tsconfigRaw: overriddenTsconfigRaw = {}, compilerOptions = {}, sourcemap, resolve = false, cjsDefault = false, build = false, incremental = false, vue = false, parallel = false, eager = false, newContext = false, emitJs, oxc, tsgo = false }) {
|
|
868
|
+
function resolveOptions({ cwd = process.cwd(), dtsInput = false, emitDtsOnly = false, tsconfig, tsconfigRaw: overriddenTsconfigRaw = {}, compilerOptions = {}, sourcemap, resolve = false, cjsDefault = false, build = false, incremental = false, vue = false, tsMacro = false, parallel = false, eager = false, newContext = false, emitJs, oxc, tsgo = false }) {
|
|
872
869
|
let resolvedTsconfig;
|
|
873
870
|
if (tsconfig === true || tsconfig == null) {
|
|
874
871
|
const { config, path: path$1 } = getTsconfig(cwd) || {};
|
|
@@ -890,7 +887,7 @@ function resolveOptions({ cwd = process.cwd(), dtsInput = false, emitDtsOnly = f
|
|
|
890
887
|
...overriddenTsconfigRaw,
|
|
891
888
|
compilerOptions
|
|
892
889
|
};
|
|
893
|
-
oxc ??= !!(compilerOptions?.isolatedDeclarations && !vue && !tsgo);
|
|
890
|
+
oxc ??= !!(compilerOptions?.isolatedDeclarations && !vue && !tsgo && !tsMacro);
|
|
894
891
|
if (oxc === true) oxc = {};
|
|
895
892
|
if (oxc) {
|
|
896
893
|
oxc.stripInternal ??= !!compilerOptions?.stripInternal;
|
|
@@ -899,9 +896,11 @@ function resolveOptions({ cwd = process.cwd(), dtsInput = false, emitDtsOnly = f
|
|
|
899
896
|
emitJs ??= !!(compilerOptions.checkJs || compilerOptions.allowJs);
|
|
900
897
|
if (tsgo) {
|
|
901
898
|
if (vue) throw new Error("[rolldown-plugin-dts] The `tsgo` option is not compatible with the `vue` option. Please disable one of them.");
|
|
899
|
+
if (tsMacro) throw new Error("[rolldown-plugin-dts] The `tsgo` option is not compatible with the `tsMacro` option. Please disable one of them.");
|
|
902
900
|
if (oxc) throw new Error("[rolldown-plugin-dts] The `tsgo` option is not compatible with the `oxc` option. Please disable one of them.");
|
|
903
901
|
}
|
|
904
902
|
if (oxc && vue) throw new Error("[rolldown-plugin-dts] The `oxc` option is not compatible with the `vue` option. Please disable one of them.");
|
|
903
|
+
if (oxc && tsMacro) throw new Error("[rolldown-plugin-dts] The `oxc` option is not compatible with the `tsMacro` option. Please disable one of them.");
|
|
905
904
|
if (tsgo && !warnedTsgo) {
|
|
906
905
|
console.warn("The `tsgo` option is experimental and may change in the future.");
|
|
907
906
|
warnedTsgo = true;
|
|
@@ -918,6 +917,7 @@ function resolveOptions({ cwd = process.cwd(), dtsInput = false, emitDtsOnly = f
|
|
|
918
917
|
build,
|
|
919
918
|
incremental,
|
|
920
919
|
vue,
|
|
920
|
+
tsMacro,
|
|
921
921
|
parallel,
|
|
922
922
|
eager,
|
|
923
923
|
newContext,
|
|
@@ -6,7 +6,7 @@ import ts from "typescript";
|
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
|
|
8
8
|
//#region src/tsc/system.ts
|
|
9
|
-
const debug$
|
|
9
|
+
const debug$3 = Debug("rolldown-plugin-dts:tsc-system");
|
|
10
10
|
/**
|
|
11
11
|
* A system that writes files to both memory and disk. It will try read files
|
|
12
12
|
* from memory firstly and fallback to disk if not found.
|
|
@@ -15,7 +15,7 @@ function createFsSystem(files) {
|
|
|
15
15
|
return {
|
|
16
16
|
...ts.sys,
|
|
17
17
|
write(message) {
|
|
18
|
-
debug$
|
|
18
|
+
debug$3(message);
|
|
19
19
|
},
|
|
20
20
|
resolvePath(path$1) {
|
|
21
21
|
if (files.has(path$1)) return path$1;
|
|
@@ -80,20 +80,20 @@ function setSourceMapRoot(map, originalFilePath, finalFilePath) {
|
|
|
80
80
|
|
|
81
81
|
//#endregion
|
|
82
82
|
//#region src/tsc/emit-build.ts
|
|
83
|
-
const debug$
|
|
83
|
+
const debug$2 = Debug("rolldown-plugin-dts:tsc-build");
|
|
84
84
|
function tscEmitBuild(tscOptions) {
|
|
85
85
|
const { id, tsconfig, incremental, context = globalContext, sourcemap } = tscOptions;
|
|
86
|
-
debug$
|
|
86
|
+
debug$2(`running tscEmitBuild id: ${id}, tsconfig: ${tsconfig}, incremental: ${incremental}`);
|
|
87
87
|
if (!tsconfig) return { error: "[rolldown-plugin-dts] build mode requires a tsconfig path" };
|
|
88
88
|
const fsSystem = (incremental ? createFsSystem : createMemorySystem)(context.files);
|
|
89
89
|
const resolvedId = fsSystem.resolvePath(id);
|
|
90
|
-
if (resolvedId !== id) debug$
|
|
90
|
+
if (resolvedId !== id) debug$2(`resolved id from ${id} to ${resolvedId}`);
|
|
91
91
|
const project = getOrBuildProjects(context, fsSystem, tsconfig, !incremental, sourcemap).get(resolvedId);
|
|
92
92
|
if (!project) {
|
|
93
|
-
debug$
|
|
93
|
+
debug$2(`unable to locate a project containing ${resolvedId}`);
|
|
94
94
|
return { error: `Unable to locate ${id} from the given tsconfig file ${tsconfig}` };
|
|
95
95
|
}
|
|
96
|
-
debug$
|
|
96
|
+
debug$2(`loaded project ${project.tsconfigPath} for ${id}`);
|
|
97
97
|
const ignoreCase = !fsSystem.useCaseSensitiveFileNames;
|
|
98
98
|
const outputFiles = ts.getOutputFileNames(project.parsedConfig, resolvedId, ignoreCase);
|
|
99
99
|
let code;
|
|
@@ -123,20 +123,20 @@ function tscEmitBuild(tscOptions) {
|
|
|
123
123
|
map
|
|
124
124
|
};
|
|
125
125
|
if (incremental) {
|
|
126
|
-
debug$
|
|
126
|
+
debug$2(`incremental build failed`);
|
|
127
127
|
return tscEmitBuild({
|
|
128
128
|
...tscOptions,
|
|
129
129
|
incremental: false
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
debug$
|
|
132
|
+
debug$2(`unable to build .d.ts file for ${id}`);
|
|
133
133
|
if (project.parsedConfig.options.declaration !== true) return { error: `Unable to build .d.ts file for ${id}; Make sure the "declaration" option is set to true in ${project.tsconfigPath}` };
|
|
134
134
|
return { error: `Unable to build .d.ts file for ${id}; This seems like a bug of rolldown-plugin-dts. Please report this issue to https://github.com/sxzz/rolldown-plugin-dts/issues` };
|
|
135
135
|
}
|
|
136
136
|
function getOrBuildProjects(context, fsSystem, tsconfig, force, sourcemap) {
|
|
137
137
|
let projectMap = context.projects.get(tsconfig);
|
|
138
138
|
if (projectMap) {
|
|
139
|
-
debug$
|
|
139
|
+
debug$2(`skip building projects for ${tsconfig}`);
|
|
140
140
|
return projectMap;
|
|
141
141
|
}
|
|
142
142
|
projectMap = buildProjects(fsSystem, tsconfig, force, sourcemap);
|
|
@@ -147,18 +147,18 @@ function getOrBuildProjects(context, fsSystem, tsconfig, force, sourcemap) {
|
|
|
147
147
|
* Use TypeScript compiler to build all projects referenced
|
|
148
148
|
*/
|
|
149
149
|
function buildProjects(fsSystem, tsconfig, force, sourcemap) {
|
|
150
|
-
debug$
|
|
150
|
+
debug$2(`start building projects for ${tsconfig}`);
|
|
151
151
|
const projects = collectProjectGraph(tsconfig, fsSystem, force, sourcemap);
|
|
152
|
-
debug$
|
|
152
|
+
debug$2("collected %d projects: %j", projects.length, projects.map((project) => project.tsconfigPath));
|
|
153
153
|
const host = ts.createSolutionBuilderHost(fsSystem, createProgramWithPatchedCompilerOptions);
|
|
154
154
|
const exitStatus = ts.createSolutionBuilder(host, [tsconfig], {
|
|
155
155
|
force,
|
|
156
156
|
verbose: true
|
|
157
157
|
}).build(void 0, void 0, void 0, (project) => {
|
|
158
|
-
debug$
|
|
158
|
+
debug$2(`transforming project ${project}`);
|
|
159
159
|
return customTransformers;
|
|
160
160
|
});
|
|
161
|
-
debug$
|
|
161
|
+
debug$2(`built solution for ${tsconfig} with exit status ${exitStatus}`);
|
|
162
162
|
const sourceFileToProjectMap = /* @__PURE__ */ new Map();
|
|
163
163
|
for (const project of projects) for (const fileName of project.parsedConfig.fileNames) sourceFileToProjectMap.set(fsSystem.resolvePath(fileName), project);
|
|
164
164
|
return sourceFileToProjectMap;
|
|
@@ -234,36 +234,64 @@ const createProgramWithPatchedCompilerOptions = (rootNames, options, ...args) =>
|
|
|
234
234
|
};
|
|
235
235
|
|
|
236
236
|
//#endregion
|
|
237
|
-
//#region src/tsc/
|
|
238
|
-
const debug$2 = Debug("rolldown-plugin-dts:vue");
|
|
239
|
-
let createVueProgram;
|
|
237
|
+
//#region src/tsc/volar.ts
|
|
240
238
|
const require = createRequire(import.meta.url);
|
|
241
239
|
function loadVueLanguageTools() {
|
|
240
|
+
const debug$4 = Debug("rolldown-plugin-dts:vue");
|
|
241
|
+
debug$4("loading vue language tools");
|
|
242
242
|
try {
|
|
243
243
|
const vueTscPath = require.resolve("vue-tsc");
|
|
244
244
|
const { proxyCreateProgram } = require(require.resolve("@volar/typescript", { paths: [vueTscPath] }));
|
|
245
245
|
const vue = require(require.resolve("@vue/language-core", { paths: [vueTscPath] }));
|
|
246
|
+
const getLanguagePlugin = (ts$1, options) => {
|
|
247
|
+
const $rootDir = options.options.$rootDir;
|
|
248
|
+
const $configRaw = options.options.$configRaw;
|
|
249
|
+
const resolver = new vue.CompilerOptionsResolver(ts$1.sys.fileExists);
|
|
250
|
+
resolver.addConfig($configRaw?.vueCompilerOptions ?? {}, $rootDir);
|
|
251
|
+
const vueOptions = resolver.build();
|
|
252
|
+
vue.writeGlobalTypes(vueOptions, ts$1.sys.writeFile);
|
|
253
|
+
return vue.createVueLanguagePlugin(ts$1, options.options, vueOptions, (id) => id);
|
|
254
|
+
};
|
|
246
255
|
return {
|
|
247
256
|
proxyCreateProgram,
|
|
248
|
-
|
|
257
|
+
getLanguagePlugin
|
|
249
258
|
};
|
|
250
259
|
} catch (error) {
|
|
251
|
-
debug$
|
|
260
|
+
debug$4("vue language tools not found", error);
|
|
252
261
|
throw new Error("Failed to load vue language tools. Please manually install vue-tsc.");
|
|
253
262
|
}
|
|
254
263
|
}
|
|
255
|
-
function
|
|
256
|
-
|
|
257
|
-
debug$
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
const
|
|
261
|
-
const
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
264
|
+
function loadTsMacro() {
|
|
265
|
+
const debug$4 = Debug("rolldown-plugin-dts:ts-macro");
|
|
266
|
+
debug$4("loading ts-macro language tools");
|
|
267
|
+
try {
|
|
268
|
+
const tsMacroPath = require.resolve("@ts-macro/tsc");
|
|
269
|
+
const { proxyCreateProgram } = require(require.resolve("@volar/typescript", { paths: [tsMacroPath] }));
|
|
270
|
+
const tsMacro = require(require.resolve("@ts-macro/language-plugin", { paths: [tsMacroPath] }));
|
|
271
|
+
const { getOptions } = require(require.resolve("@ts-macro/language-plugin/options", { paths: [tsMacroPath] }));
|
|
272
|
+
const getLanguagePlugin = (ts$1, options) => {
|
|
273
|
+
const $rootDir = options.options.$rootDir;
|
|
274
|
+
return tsMacro.getLanguagePlugins(ts$1, options.options, getOptions(ts$1, $rootDir))[0];
|
|
275
|
+
};
|
|
276
|
+
return {
|
|
277
|
+
proxyCreateProgram,
|
|
278
|
+
getLanguagePlugin
|
|
279
|
+
};
|
|
280
|
+
} catch (error) {
|
|
281
|
+
debug$4("ts-macro language tools not found", error);
|
|
282
|
+
throw new Error("Failed to load ts-macro language tools. Please manually install @ts-macro/tsc.");
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
function createProgramFactory(ts$1, options) {
|
|
286
|
+
const vueLanguageTools = options.vue ? loadVueLanguageTools() : void 0;
|
|
287
|
+
const tsMacroLanguageTools = options.tsMacro ? loadTsMacro() : void 0;
|
|
288
|
+
const proxyCreateProgram = vueLanguageTools?.proxyCreateProgram || tsMacroLanguageTools?.proxyCreateProgram;
|
|
289
|
+
if (!proxyCreateProgram) return ts$1.createProgram;
|
|
290
|
+
return proxyCreateProgram(ts$1, ts$1.createProgram, (ts$2, options$1) => {
|
|
291
|
+
const languagePlugins = [];
|
|
292
|
+
if (vueLanguageTools) languagePlugins.push(vueLanguageTools.getLanguagePlugin(ts$2, options$1));
|
|
293
|
+
if (tsMacroLanguageTools) languagePlugins.push(tsMacroLanguageTools.getLanguagePlugin(ts$2, options$1));
|
|
294
|
+
return { languagePlugins };
|
|
267
295
|
});
|
|
268
296
|
}
|
|
269
297
|
|
|
@@ -302,7 +330,7 @@ function createOrGetTsModule(options) {
|
|
|
302
330
|
context.programs.push(module.program);
|
|
303
331
|
return module;
|
|
304
332
|
}
|
|
305
|
-
function createTsProgram({ entries, id, tsconfig, tsconfigRaw, vue, cwd, context = globalContext }) {
|
|
333
|
+
function createTsProgram({ entries, id, tsconfig, tsconfigRaw, vue, tsMacro, cwd, context = globalContext }) {
|
|
306
334
|
const fsSystem = createFsSystem(context.files);
|
|
307
335
|
const baseDir = tsconfig ? path.dirname(tsconfig) : cwd;
|
|
308
336
|
const parsedConfig = ts.parseJsonConfigFileContent(tsconfigRaw, fsSystem, baseDir);
|
|
@@ -313,10 +341,11 @@ function createTsProgram({ entries, id, tsconfig, tsconfigRaw, vue, cwd, context
|
|
|
313
341
|
baseDir,
|
|
314
342
|
id,
|
|
315
343
|
entries,
|
|
316
|
-
vue
|
|
344
|
+
vue,
|
|
345
|
+
tsMacro
|
|
317
346
|
});
|
|
318
347
|
}
|
|
319
|
-
function createTsProgramFromParsedConfig({ parsedConfig, fsSystem, baseDir, id, entries, vue }) {
|
|
348
|
+
function createTsProgramFromParsedConfig({ parsedConfig, fsSystem, baseDir, id, entries, vue, tsMacro }) {
|
|
320
349
|
const compilerOptions = {
|
|
321
350
|
...defaultCompilerOptions,
|
|
322
351
|
...parsedConfig.options,
|
|
@@ -325,7 +354,10 @@ function createTsProgramFromParsedConfig({ parsedConfig, fsSystem, baseDir, id,
|
|
|
325
354
|
};
|
|
326
355
|
const rootNames = [...new Set([id, ...entries || parsedConfig.fileNames].map((f) => fsSystem.resolvePath(f)))];
|
|
327
356
|
const host = ts.createCompilerHost(compilerOptions, true);
|
|
328
|
-
const program = (
|
|
357
|
+
const program = createProgramFactory(ts, {
|
|
358
|
+
vue,
|
|
359
|
+
tsMacro
|
|
360
|
+
})({
|
|
329
361
|
rootNames,
|
|
330
362
|
options: compilerOptions,
|
|
331
363
|
host,
|
package/dist/tsc-worker.d.ts
CHANGED
package/dist/tsc-worker.js
CHANGED
package/dist/tsc.d.ts
CHANGED
package/dist/tsc.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown-plugin-dts",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.4",
|
|
4
4
|
"description": "A Rolldown plugin to generate and bundle dts files.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -40,12 +40,16 @@
|
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
+
"@ts-macro/tsc": "^0.3.6",
|
|
43
44
|
"@typescript/native-preview": ">=7.0.0-dev.20250601.1",
|
|
44
45
|
"rolldown": "^1.0.0-beta.9",
|
|
45
46
|
"typescript": "^5.0.0",
|
|
46
47
|
"vue-tsc": "~3.0.3"
|
|
47
48
|
},
|
|
48
49
|
"peerDependenciesMeta": {
|
|
50
|
+
"@ts-macro/tsc": {
|
|
51
|
+
"optional": true
|
|
52
|
+
},
|
|
49
53
|
"@typescript/native-preview": {
|
|
50
54
|
"optional": true
|
|
51
55
|
},
|
|
@@ -73,7 +77,7 @@
|
|
|
73
77
|
"@types/babel__generator": "^7.27.0",
|
|
74
78
|
"@types/debug": "^4.1.12",
|
|
75
79
|
"@types/node": "^24.3.1",
|
|
76
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
80
|
+
"@typescript/native-preview": "7.0.0-dev.20250911.1",
|
|
77
81
|
"@volar/typescript": "^2.4.23",
|
|
78
82
|
"@vue/language-core": "^3.0.6",
|
|
79
83
|
"bumpp": "^10.2.3",
|
|
@@ -81,7 +85,7 @@
|
|
|
81
85
|
"eslint": "^9.35.0",
|
|
82
86
|
"estree-walker": "^3.0.3",
|
|
83
87
|
"prettier": "^3.6.2",
|
|
84
|
-
"rolldown": "^1.0.0-beta.
|
|
88
|
+
"rolldown": "^1.0.0-beta.37",
|
|
85
89
|
"rollup-plugin-dts": "^6.2.3",
|
|
86
90
|
"tinyglobby": "^0.2.15",
|
|
87
91
|
"tsdown": "^0.15.0",
|