rolldown-plugin-dts 0.16.11 → 0.17.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 +17 -0
- package/dist/{context-BGY_fVH1.js → context-BacUE4pM.js} +1 -1
- package/dist/{context-DXNtAHtR.d.ts → context-Cf8MAZaX.d.ts} +1 -1
- package/dist/{filename-D2iIogqp.d.ts → filename-0s1tyon-.d.ts} +1 -1
- package/dist/{filename-DLc-rcyI.js → filename-DDjuEak0.js} +1 -1
- package/dist/filename.d.ts +1 -1
- package/dist/filename.js +1 -1
- package/dist/{index-CxJisQQS.d.ts → index-UvaKF8Pg.d.ts} +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +92 -48
- package/dist/{tsc-BsZXDoCU.js → tsc--GG3zA2e.js} +4 -5
- package/dist/tsc-context.d.ts +1 -1
- package/dist/tsc-context.js +1 -1
- package/dist/tsc-worker.d.ts +2 -2
- package/dist/tsc-worker.js +2 -2
- package/dist/tsc.d.ts +2 -2
- package/dist/tsc.js +2 -2
- package/package.json +17 -17
package/README.md
CHANGED
|
@@ -190,6 +190,23 @@ To use this option, ensure that `@typescript/native-preview` is installed as a d
|
|
|
190
190
|
|
|
191
191
|
`tsconfigRaw` and `compilerOptions` options will be ignored when this option is enabled.
|
|
192
192
|
|
|
193
|
+
## Advanced Chunks Support
|
|
194
|
+
|
|
195
|
+
When using Rolldown's advanced chunking features such as `manualChunks` or `advancedChunks`, you should pay special attention to handling `.d.ts` files. The chunk names for `.d.ts` files must end with `.d`.
|
|
196
|
+
|
|
197
|
+
```ts
|
|
198
|
+
export default {
|
|
199
|
+
advancedChunks: {
|
|
200
|
+
groups: [
|
|
201
|
+
// handle .d.ts files
|
|
202
|
+
{ test: /foo.*\.d\.[cm]?ts$/, name: 'shared.d' },
|
|
203
|
+
// handle source files
|
|
204
|
+
{ test: /foo/, name: 'shared' },
|
|
205
|
+
],
|
|
206
|
+
},
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
193
210
|
## Differences from `rollup-plugin-dts`
|
|
194
211
|
|
|
195
212
|
### Isolated Declarations
|
|
@@ -15,4 +15,4 @@ declare function createContext(): TscContext;
|
|
|
15
15
|
declare function invalidateContextFile(context: TscContext, file: string): void;
|
|
16
16
|
declare const globalContext: TscContext;
|
|
17
17
|
//#endregion
|
|
18
|
-
export {
|
|
18
|
+
export { globalContext as a, createContext as i, SourceFileToProjectMap as n, invalidateContextFile as o, TscContext as r, ParsedProject as t };
|
|
@@ -15,4 +15,4 @@ declare function filename_dts_to(id: string, ext: "js" | "ts"): string;
|
|
|
15
15
|
declare function resolveTemplateFn(fn: string | ChunkFileNamesFunction, chunk: PreRenderedChunk): string;
|
|
16
16
|
declare function replaceTemplateName(template: string, name: string): string;
|
|
17
17
|
//#endregion
|
|
18
|
-
export {
|
|
18
|
+
export { RE_JSON as a, RE_VUE as c, filename_to_dts as d, replaceTemplateName as f, RE_JS as i, filename_dts_to as l, RE_DTS as n, RE_NODE_MODULES as o, resolveTemplateFn as p, RE_DTS_MAP as r, RE_TS as s, RE_CSS as t, filename_js_to_dts as u };
|
|
@@ -24,4 +24,4 @@ function replaceTemplateName(template, name) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
|
-
export {
|
|
27
|
+
export { RE_JSON as a, RE_VUE as c, filename_to_dts as d, replaceTemplateName as f, RE_JS as i, filename_dts_to as l, RE_DTS as n, RE_NODE_MODULES as o, resolveTemplateFn as p, RE_DTS_MAP as r, RE_TS as s, RE_CSS as t, filename_js_to_dts as u };
|
package/dist/filename.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
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-0s1tyon-.js";
|
|
2
2
|
export { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_JSON, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts, replaceTemplateName, resolveTemplateFn };
|
package/dist/filename.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
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-DDjuEak0.js";
|
|
2
2
|
|
|
3
3
|
export { RE_CSS, RE_DTS, RE_DTS_MAP, RE_JS, RE_JSON, RE_NODE_MODULES, RE_TS, RE_VUE, filename_dts_to, filename_js_to_dts, filename_to_dts, replaceTemplateName, resolveTemplateFn };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TscContext } from "./context-
|
|
1
|
+
import { r as TscContext } from "./context-Cf8MAZaX.js";
|
|
2
2
|
import { TsConfigJson } from "get-tsconfig";
|
|
3
3
|
import ts from "typescript";
|
|
4
4
|
import { SourceMapInput } from "rolldown";
|
|
@@ -30,4 +30,4 @@ interface TscResult {
|
|
|
30
30
|
//#region src/tsc/index.d.ts
|
|
31
31
|
declare function tscEmit(tscOptions: TscOptions): TscResult;
|
|
32
32
|
//#endregion
|
|
33
|
-
export {
|
|
33
|
+
export { TscResult as i, TscModule as n, TscOptions as r, tscEmit as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as RE_JSON, c as RE_VUE, i as RE_JS, n as RE_DTS, o as RE_NODE_MODULES, r as RE_DTS_MAP, s as RE_TS, t as RE_CSS } from "./filename-0s1tyon-.js";
|
|
2
2
|
import { IsolatedDeclarationsOptions } from "rolldown/experimental";
|
|
3
3
|
import { TsConfigJson } from "get-tsconfig";
|
|
4
4
|
import { AddonFunction, Plugin } from "rolldown";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const __cjs_require = globalThis.process.getBuiltinModule("module").createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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-DDjuEak0.js";
|
|
3
|
+
import { n as globalContext, r as invalidateContextFile, t as createContext } from "./context-BacUE4pM.js";
|
|
4
4
|
const Debug = __cjs_require("debug");
|
|
5
5
|
import MagicString from "magic-string";
|
|
6
6
|
const {
|
|
@@ -336,14 +336,14 @@ function createFakeJsPlugin({ sourcemap, cjsDefault }) {
|
|
|
336
336
|
const appendStmts = [];
|
|
337
337
|
const namespaceStmts = /* @__PURE__ */ new Map();
|
|
338
338
|
for (const [i, stmt] of program.body.entries()) {
|
|
339
|
-
const setStmt = (
|
|
339
|
+
const setStmt = (stmt$1) => program.body[i] = stmt$1;
|
|
340
340
|
if (rewriteImportExport(stmt, setStmt, typeOnlyIds)) continue;
|
|
341
341
|
const sideEffect = stmt.type === "TSModuleDeclaration" && stmt.kind !== "namespace";
|
|
342
342
|
if (sideEffect && id.endsWith(".vue.d.ts") && code.slice(stmt.start, stmt.end).includes("__VLS_")) continue;
|
|
343
343
|
const isDefaultExport = stmt.type === "ExportDefaultDeclaration";
|
|
344
344
|
const isDecl = isTypeOf(stmt, ["ExportNamedDeclaration", "ExportDefaultDeclaration"]) && stmt.declaration;
|
|
345
345
|
const decl = isDecl ? stmt.declaration : stmt;
|
|
346
|
-
const setDecl = isDecl ? (
|
|
346
|
+
const setDecl = isDecl ? (decl$1) => stmt.declaration = decl$1 : setStmt;
|
|
347
347
|
if (decl.type !== "TSDeclareFunction" && !isDeclarationType(decl)) continue;
|
|
348
348
|
if (isTypeOf(decl, [
|
|
349
349
|
"TSEnumDeclaration",
|
|
@@ -364,20 +364,23 @@ function createFakeJsPlugin({ sourcemap, cjsDefault }) {
|
|
|
364
364
|
bindings.push(binding);
|
|
365
365
|
decl.id = binding;
|
|
366
366
|
}
|
|
367
|
+
const params = "typeParameters" in decl && decl.typeParameters?.type === "TSTypeParameterDeclaration" ? decl.typeParameters.params : [];
|
|
367
368
|
const deps = collectDependencies(decl, namespaceStmts);
|
|
368
|
-
const elements = [
|
|
369
|
-
t.numericLiteral(0),
|
|
370
|
-
...deps.map((dep) => t.arrowFunctionExpression([], dep)),
|
|
371
|
-
...sideEffect ? [t.callExpression(t.identifier("sideEffect"), [bindings[0]])] : []
|
|
372
|
-
];
|
|
373
|
-
const runtime = t.arrayExpression(elements);
|
|
374
369
|
if (decl !== stmt) decl.leadingComments = stmt.leadingComments;
|
|
375
370
|
const symbolId = registerSymbol({
|
|
376
371
|
decl,
|
|
377
372
|
deps,
|
|
378
|
-
bindings
|
|
373
|
+
bindings,
|
|
374
|
+
params
|
|
379
375
|
});
|
|
380
|
-
|
|
376
|
+
const symbolIdNode = t.numericLiteral(symbolId);
|
|
377
|
+
const depsNode = t.arrowFunctionExpression(params.map((param) => t.identifier(param.name)), t.arrayExpression(deps));
|
|
378
|
+
const sideEffectNode = sideEffect && t.callExpression(t.identifier("sideEffect"), [bindings[0]]);
|
|
379
|
+
const runtimeArrayNode = runtimeBindingArrayExpression(sideEffectNode ? [
|
|
380
|
+
symbolIdNode,
|
|
381
|
+
depsNode,
|
|
382
|
+
sideEffectNode
|
|
383
|
+
] : [symbolIdNode, depsNode]);
|
|
381
384
|
const runtimeAssignment = {
|
|
382
385
|
type: "VariableDeclaration",
|
|
383
386
|
kind: "var",
|
|
@@ -387,7 +390,7 @@ function createFakeJsPlugin({ sourcemap, cjsDefault }) {
|
|
|
387
390
|
...bindings[0],
|
|
388
391
|
typeAnnotation: null
|
|
389
392
|
},
|
|
390
|
-
init:
|
|
393
|
+
init: runtimeArrayNode
|
|
391
394
|
}, ...bindings.slice(1).map((binding) => ({
|
|
392
395
|
type: "VariableDeclarator",
|
|
393
396
|
id: {
|
|
@@ -423,27 +426,31 @@ function createFakeJsPlugin({ sourcemap, cjsDefault }) {
|
|
|
423
426
|
const file = parse(code, { sourceType: "module" });
|
|
424
427
|
const { program } = file;
|
|
425
428
|
program.body = patchTsNamespace(program.body);
|
|
429
|
+
program.body = patchReExport(program.body);
|
|
426
430
|
program.body = program.body.map((node) => {
|
|
427
431
|
if (isHelperImport(node)) return null;
|
|
428
432
|
if (node.type === "ExpressionStatement") return null;
|
|
429
433
|
const newNode = patchImportExport(node, typeOnlyIds, cjsDefault);
|
|
430
434
|
if (newNode || newNode === false) return newNode;
|
|
431
435
|
if (node.type !== "VariableDeclaration") return node;
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
const [symbolIdNode, ...depsFns] = decl.init.elements;
|
|
435
|
-
if (symbolIdNode?.type !== "NumericLiteral") return null;
|
|
436
|
+
if (!isRuntimeBindingVariableDeclaration(node)) return null;
|
|
437
|
+
const [symbolIdNode, depsFn] = node.declarations[0].init.elements;
|
|
436
438
|
const symbolId = symbolIdNode.value;
|
|
437
439
|
const original = getSymbol(symbolId);
|
|
438
|
-
for (const [i, decl
|
|
440
|
+
for (const [i, decl] of node.declarations.entries()) {
|
|
439
441
|
const transformedBinding = {
|
|
440
|
-
...decl
|
|
442
|
+
...decl.id,
|
|
441
443
|
typeAnnotation: original.bindings[i].typeAnnotation
|
|
442
444
|
};
|
|
443
445
|
overwriteNode(original.bindings[i], transformedBinding);
|
|
444
446
|
}
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
+
const transformedParams = depsFn.params;
|
|
448
|
+
for (let i = 0; i < original.params.length; i++) {
|
|
449
|
+
const originalParam = original.params[i];
|
|
450
|
+
originalParam.name = transformedParams[i].name;
|
|
451
|
+
}
|
|
452
|
+
const transformedDeps = depsFn.body.elements;
|
|
453
|
+
for (let i = 0; i < original.deps.length; i++) {
|
|
447
454
|
const originalDep = original.deps[i];
|
|
448
455
|
if (originalDep.replace) originalDep.replace(transformedDeps[i]);
|
|
449
456
|
else Object.assign(originalDep, transformedDeps[i]);
|
|
@@ -519,8 +526,7 @@ function createFakeJsPlugin({ sourcemap, cjsDefault }) {
|
|
|
519
526
|
seen.add(node$1);
|
|
520
527
|
const source = node$1.argument;
|
|
521
528
|
const imported = node$1.qualifier;
|
|
522
|
-
|
|
523
|
-
addDependency(dep);
|
|
529
|
+
addDependency(importNamespace(node$1, imported, source, namespaceStmts));
|
|
524
530
|
break;
|
|
525
531
|
}
|
|
526
532
|
}
|
|
@@ -561,6 +567,28 @@ const REFERENCE_RE = /\/\s*<reference\s+(?:path|types)=/;
|
|
|
561
567
|
function collectReferenceDirectives(comment, negative = false) {
|
|
562
568
|
return comment.filter((c) => REFERENCE_RE.test(c.value) !== negative);
|
|
563
569
|
}
|
|
570
|
+
/**
|
|
571
|
+
* Check if the given node is a {@link RuntimeBindingVariableDeclration}
|
|
572
|
+
*/
|
|
573
|
+
function isRuntimeBindingVariableDeclaration(node) {
|
|
574
|
+
return t.isVariableDeclaration(node) && node.declarations.length > 0 && t.isVariableDeclarator(node.declarations[0]) && isRuntimeBindingArrayExpression(node.declarations[0].init);
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Check if the given node is a {@link RuntimeBindingArrayExpression}
|
|
578
|
+
*/
|
|
579
|
+
function isRuntimeBindingArrayExpression(node) {
|
|
580
|
+
return t.isArrayExpression(node) && isRuntimeBindingArrayElements(node.elements);
|
|
581
|
+
}
|
|
582
|
+
function runtimeBindingArrayExpression(elements) {
|
|
583
|
+
return t.arrayExpression(elements);
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Check if the given array is a {@link RuntimeBindingArrayElements}
|
|
587
|
+
*/
|
|
588
|
+
function isRuntimeBindingArrayElements(elements) {
|
|
589
|
+
const [symbolId, deps, effect] = elements;
|
|
590
|
+
return t.isNumericLiteral(symbolId) && t.isArrowFunctionExpression(deps) && (!effect || t.isCallExpression(effect));
|
|
591
|
+
}
|
|
564
592
|
function isThisExpression(node) {
|
|
565
593
|
return node.type === "Identifier" && node.name === "this" || node.type === "MemberExpression" && isThisExpression(node.object);
|
|
566
594
|
}
|
|
@@ -579,6 +607,9 @@ function isReferenceId(node) {
|
|
|
579
607
|
function isHelperImport(node) {
|
|
580
608
|
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));
|
|
581
609
|
}
|
|
610
|
+
/**
|
|
611
|
+
* patch `.d.ts` suffix in import source to `.js`
|
|
612
|
+
*/
|
|
582
613
|
function patchImportExport(node, typeOnlyIds, cjsDefault) {
|
|
583
614
|
if (node.type === "ExportNamedDeclaration" && !node.declaration && !node.source && !node.specifiers.length && !node.attributes?.length) return false;
|
|
584
615
|
if (isTypeOf(node, [
|
|
@@ -601,11 +632,13 @@ function patchImportExport(node, typeOnlyIds, cjsDefault) {
|
|
|
601
632
|
};
|
|
602
633
|
}
|
|
603
634
|
}
|
|
635
|
+
/**
|
|
636
|
+
* Handle `__export` call
|
|
637
|
+
*/
|
|
604
638
|
function patchTsNamespace(nodes) {
|
|
605
|
-
const emptyObjectAssignments = /* @__PURE__ */ new Map();
|
|
606
639
|
const removed = /* @__PURE__ */ new Set();
|
|
607
640
|
for (const [i, node] of nodes.entries()) {
|
|
608
|
-
const result = handleExport(node)
|
|
641
|
+
const result = handleExport(node);
|
|
609
642
|
if (!result) continue;
|
|
610
643
|
const [binding, exports] = result;
|
|
611
644
|
nodes[i] = {
|
|
@@ -631,29 +664,41 @@ function patchTsNamespace(nodes) {
|
|
|
631
664
|
return nodes.filter((node) => !removed.has(node));
|
|
632
665
|
function handleExport(node) {
|
|
633
666
|
if (node.type !== "VariableDeclaration" || node.declarations.length !== 1 || node.declarations[0].id.type !== "Identifier" || node.declarations[0].init?.type !== "CallExpression" || node.declarations[0].init.callee.type !== "Identifier" || node.declarations[0].init.callee.name !== "__export" || node.declarations[0].init.arguments.length !== 1 || node.declarations[0].init.arguments[0].type !== "ObjectExpression") return false;
|
|
634
|
-
|
|
635
|
-
const exports = node.declarations[0].init.arguments[0];
|
|
636
|
-
return [source, exports];
|
|
667
|
+
return [node.declarations[0].id, node.declarations[0].init.arguments[0]];
|
|
637
668
|
}
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* Handle `__reExport` call
|
|
672
|
+
*/
|
|
673
|
+
function patchReExport(nodes) {
|
|
674
|
+
const exportsNames = /* @__PURE__ */ new Map();
|
|
675
|
+
for (const [i, node] of nodes.entries()) if (node.type === "ImportDeclaration" && node.specifiers.length === 1 && node.specifiers[0].type === "ImportSpecifier" && node.specifiers[0].local.type === "Identifier" && node.specifiers[0].local.name.endsWith("_exports")) exportsNames.set(node.specifiers[0].local.name, node.specifiers[0].local.name);
|
|
676
|
+
else if (node.type === "ExpressionStatement" && node.expression.type === "CallExpression" && node.expression.callee.type === "Identifier" && node.expression.callee.name === "__reExport") {
|
|
677
|
+
const args = node.expression.arguments;
|
|
678
|
+
exportsNames.set(args[0].name, args[1].name);
|
|
679
|
+
} else if (node.type === "VariableDeclaration" && node.declarations.length === 1 && node.declarations[0].init?.type === "MemberExpression" && node.declarations[0].init.object.type === "Identifier" && exportsNames.has(node.declarations[0].init.object.name)) nodes[i] = {
|
|
680
|
+
type: "TSTypeAliasDeclaration",
|
|
681
|
+
id: {
|
|
682
|
+
type: "Identifier",
|
|
683
|
+
name: node.declarations[0].id.name
|
|
684
|
+
},
|
|
685
|
+
typeAnnotation: {
|
|
686
|
+
type: "TSTypeReference",
|
|
687
|
+
typeName: {
|
|
688
|
+
type: "TSQualifiedName",
|
|
689
|
+
left: {
|
|
690
|
+
type: "Identifier",
|
|
691
|
+
name: exportsNames.get(node.declarations[0].init.object.name)
|
|
692
|
+
},
|
|
693
|
+
right: {
|
|
694
|
+
type: "Identifier",
|
|
695
|
+
name: node.declarations[0].init.property.name
|
|
696
|
+
}
|
|
697
|
+
}
|
|
654
698
|
}
|
|
655
|
-
|
|
656
|
-
|
|
699
|
+
};
|
|
700
|
+
else if (node.type === "ExportNamedDeclaration" && node.specifiers.length === 1 && node.specifiers[0].type === "ExportSpecifier" && node.specifiers[0].local.type === "Identifier" && exportsNames.has(node.specifiers[0].local.name)) node.specifiers[0].local.name = exportsNames.get(node.specifiers[0].local.name);
|
|
701
|
+
return nodes;
|
|
657
702
|
}
|
|
658
703
|
function rewriteImportExport(node, set, typeOnlyIds) {
|
|
659
704
|
if (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" && !node.declaration) {
|
|
@@ -856,14 +901,13 @@ function createGeneratePlugin({ tsconfig, tsconfigRaw, build, incremental, cwd,
|
|
|
856
901
|
map.sourcesContent = void 0;
|
|
857
902
|
}
|
|
858
903
|
} else {
|
|
859
|
-
const entries = eager ? void 0 : Array.from(dtsMap.values()).filter((v) => v.isEntry).map((v) => v.id);
|
|
860
904
|
const options = {
|
|
861
905
|
tsconfig,
|
|
862
906
|
tsconfigRaw,
|
|
863
907
|
build,
|
|
864
908
|
incremental,
|
|
865
909
|
cwd,
|
|
866
|
-
entries,
|
|
910
|
+
entries: eager ? void 0 : Array.from(dtsMap.values()).filter((v) => v.isEntry).map((v) => v.id),
|
|
867
911
|
id,
|
|
868
912
|
sourcemap,
|
|
869
913
|
vue,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __cjs_require = globalThis.process.getBuiltinModule("module").createRequire(import.meta.url);
|
|
2
|
-
import { globalContext } from "./context-
|
|
2
|
+
import { n as globalContext } from "./context-BacUE4pM.js";
|
|
3
3
|
const {
|
|
4
4
|
createRequire
|
|
5
5
|
} = globalThis.process.getBuiltinModule("node:module");
|
|
@@ -160,14 +160,13 @@ function buildProjects(fsSystem, tsconfig, force, sourcemap) {
|
|
|
160
160
|
const projects = collectProjectGraph(tsconfig, fsSystem, force, sourcemap);
|
|
161
161
|
debug$2("collected %d projects: %j", projects.length, projects.map((project) => project.tsconfigPath));
|
|
162
162
|
const host = ts.createSolutionBuilderHost(fsSystem, createProgramWithPatchedCompilerOptions);
|
|
163
|
-
|
|
163
|
+
debug$2(`built solution for ${tsconfig} with exit status ${ts.createSolutionBuilder(host, [tsconfig], {
|
|
164
164
|
force,
|
|
165
165
|
verbose: true
|
|
166
166
|
}).build(void 0, void 0, void 0, (project) => {
|
|
167
167
|
debug$2(`transforming project ${project}`);
|
|
168
168
|
return customTransformers;
|
|
169
|
-
});
|
|
170
|
-
debug$2(`built solution for ${tsconfig} with exit status ${exitStatus}`);
|
|
169
|
+
})}`);
|
|
171
170
|
const sourceFileToProjectMap = /* @__PURE__ */ new Map();
|
|
172
171
|
for (const project of projects) for (const fileName of project.parsedConfig.fileNames) sourceFileToProjectMap.set(fsSystem.resolvePath(fileName), project);
|
|
173
172
|
return sourceFileToProjectMap;
|
|
@@ -426,4 +425,4 @@ function tscEmit(tscOptions) {
|
|
|
426
425
|
}
|
|
427
426
|
|
|
428
427
|
//#endregion
|
|
429
|
-
export { tscEmit };
|
|
428
|
+
export { tscEmit as t };
|
package/dist/tsc-context.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as globalContext, i as createContext, n as SourceFileToProjectMap, o as invalidateContextFile, r as TscContext, t as ParsedProject } from "./context-Cf8MAZaX.js";
|
|
2
2
|
export { ParsedProject, SourceFileToProjectMap, TscContext, createContext, globalContext, invalidateContextFile };
|
package/dist/tsc-context.js
CHANGED
package/dist/tsc-worker.d.ts
CHANGED
package/dist/tsc-worker.js
CHANGED
package/dist/tsc.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./context-
|
|
2
|
-
import { TscModule, TscOptions,
|
|
1
|
+
import "./context-Cf8MAZaX.js";
|
|
2
|
+
import { i as TscResult, n as TscModule, r as TscOptions, t as tscEmit } from "./index-UvaKF8Pg.js";
|
|
3
3
|
export { TscModule, TscOptions, TscResult, tscEmit };
|
package/dist/tsc.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown-plugin-dts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.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.44",
|
|
46
46
|
"typescript": "^5.0.0",
|
|
47
47
|
"vue-tsc": "~3.1.0"
|
|
48
48
|
},
|
|
@@ -64,38 +64,38 @@
|
|
|
64
64
|
"@babel/generator": "^7.28.3",
|
|
65
65
|
"@babel/parser": "^7.28.4",
|
|
66
66
|
"@babel/types": "^7.28.4",
|
|
67
|
-
"ast-kit": "^2.1.
|
|
67
|
+
"ast-kit": "^2.1.3",
|
|
68
68
|
"birpc": "^2.6.1",
|
|
69
69
|
"debug": "^4.4.3",
|
|
70
70
|
"dts-resolver": "^2.1.2",
|
|
71
|
-
"get-tsconfig": "^4.
|
|
71
|
+
"get-tsconfig": "^4.13.0",
|
|
72
72
|
"magic-string": "^0.30.19"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@sxzz/eslint-config": "^7.2.
|
|
75
|
+
"@sxzz/eslint-config": "^7.2.7",
|
|
76
76
|
"@sxzz/prettier-config": "^2.2.4",
|
|
77
77
|
"@sxzz/test-utils": "^0.5.11",
|
|
78
78
|
"@types/babel__generator": "^7.27.0",
|
|
79
79
|
"@types/debug": "^4.1.12",
|
|
80
|
-
"@types/node": "^24.
|
|
81
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
80
|
+
"@types/node": "^24.9.1",
|
|
81
|
+
"@typescript/native-preview": "7.0.0-dev.20251022.1",
|
|
82
82
|
"@volar/typescript": "^2.4.23",
|
|
83
|
-
"@vue/language-core": "^3.1.
|
|
84
|
-
"arktype": "^2.1.
|
|
85
|
-
"bumpp": "^10.
|
|
83
|
+
"@vue/language-core": "^3.1.1",
|
|
84
|
+
"arktype": "^2.1.23",
|
|
85
|
+
"bumpp": "^10.3.1",
|
|
86
86
|
"diff": "^8.0.2",
|
|
87
|
-
"eslint": "^9.
|
|
87
|
+
"eslint": "^9.38.0",
|
|
88
88
|
"estree-walker": "^3.0.3",
|
|
89
89
|
"prettier": "^3.6.2",
|
|
90
|
-
"rolldown": "^1.0.0-beta.
|
|
91
|
-
"rolldown-plugin-require-cjs": "^0.3.
|
|
90
|
+
"rolldown": "^1.0.0-beta.44",
|
|
91
|
+
"rolldown-plugin-require-cjs": "^0.3.1",
|
|
92
92
|
"rollup-plugin-dts": "^6.2.3",
|
|
93
93
|
"tinyglobby": "^0.2.15",
|
|
94
|
-
"tsdown": "^0.15.
|
|
95
|
-
"typescript": "^5.9.
|
|
96
|
-
"vitest": "^
|
|
94
|
+
"tsdown": "^0.15.9",
|
|
95
|
+
"typescript": "^5.9.3",
|
|
96
|
+
"vitest": "^4.0.1",
|
|
97
97
|
"vue": "^3.5.22",
|
|
98
|
-
"vue-tsc": "^3.1.
|
|
98
|
+
"vue-tsc": "^3.1.1"
|
|
99
99
|
},
|
|
100
100
|
"engines": {
|
|
101
101
|
"node": ">=20.18.0"
|