rolldown-plugin-dts 0.15.7 → 0.15.9
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.d.ts +1 -2
- package/dist/index.js +6 -4
- package/dist/{tsc-BLPzoCMq.js → tsc-BJW5IMTs.js} +1 -6
- package/dist/tsc-worker.js +1 -1
- package/dist/tsc.js +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -182,10 +182,9 @@ declare function resolveOptions({
|
|
|
182
182
|
//#endregion
|
|
183
183
|
//#region src/fake-js.d.ts
|
|
184
184
|
declare function createFakeJsPlugin({
|
|
185
|
-
dtsInput,
|
|
186
185
|
sourcemap,
|
|
187
186
|
cjsDefault
|
|
188
|
-
}: Pick<OptionsResolved, "
|
|
187
|
+
}: Pick<OptionsResolved, "sourcemap" | "cjsDefault">): Plugin;
|
|
189
188
|
//#endregion
|
|
190
189
|
//#region src/generate.d.ts
|
|
191
190
|
declare function createGeneratePlugin({
|
package/dist/index.js
CHANGED
|
@@ -239,7 +239,7 @@ function walk(ast, { enter, leave }) {
|
|
|
239
239
|
//#endregion
|
|
240
240
|
//#region src/fake-js.ts
|
|
241
241
|
const generate = _generate.default || _generate;
|
|
242
|
-
function createFakeJsPlugin({
|
|
242
|
+
function createFakeJsPlugin({ sourcemap, cjsDefault }) {
|
|
243
243
|
let symbolIdx = 0;
|
|
244
244
|
const identifierMap = Object.create(null);
|
|
245
245
|
const symbolMap = /* @__PURE__ */ new Map();
|
|
@@ -253,7 +253,6 @@ function createFakeJsPlugin({ dtsInput, sourcemap, cjsDefault }) {
|
|
|
253
253
|
return {
|
|
254
254
|
...options,
|
|
255
255
|
sourcemap: options.sourcemap || sourcemap,
|
|
256
|
-
entryFileNames: options.entryFileNames ?? (dtsInput ? "[name].ts" : void 0),
|
|
257
256
|
chunkFileNames(chunk) {
|
|
258
257
|
const nameTemplate = resolveTemplateFn(chunkFileNames || "[name]-[hash].js", chunk);
|
|
259
258
|
if (chunk.name.endsWith(".d")) {
|
|
@@ -708,8 +707,11 @@ function createGeneratePlugin({ tsconfig, tsconfigRaw, build, incremental, cwd,
|
|
|
708
707
|
...options,
|
|
709
708
|
entryFileNames(chunk) {
|
|
710
709
|
const { entryFileNames } = options;
|
|
711
|
-
const nameTemplate = (
|
|
712
|
-
if (chunk.name.endsWith(".d")
|
|
710
|
+
const nameTemplate = resolveTemplateFn(entryFileNames || "[name].js", chunk);
|
|
711
|
+
if (chunk.name.endsWith(".d")) {
|
|
712
|
+
if (RE_DTS.test(nameTemplate)) return replaceTemplateName(nameTemplate, chunk.name.slice(0, -2));
|
|
713
|
+
if (RE_JS.test(nameTemplate)) return nameTemplate.replace(RE_JS, ".$1ts");
|
|
714
|
+
}
|
|
713
715
|
return nameTemplate;
|
|
714
716
|
}
|
|
715
717
|
};
|
|
@@ -264,12 +264,7 @@ function tscEmit(tscOptions) {
|
|
|
264
264
|
dtsCode = code;
|
|
265
265
|
}
|
|
266
266
|
}, void 0, true, { afterDeclarations: [stripPrivateFields] }, true);
|
|
267
|
-
|
|
268
|
-
if (emitErrors.length > 0) return { error: ts.formatDiagnostics(emitErrors, formatHost) };
|
|
269
|
-
if (emitSkipped) {
|
|
270
|
-
const errors = ts.getPreEmitDiagnostics(program).filter((d) => d.category === ts.DiagnosticCategory.Error);
|
|
271
|
-
if (errors.length > 0) return { error: ts.formatDiagnostics(errors, formatHost) };
|
|
272
|
-
}
|
|
267
|
+
if (emitSkipped && diagnostics.length) return { error: ts.formatDiagnostics(diagnostics, formatHost) };
|
|
273
268
|
if (!dtsCode && file.isDeclarationFile) {
|
|
274
269
|
debug("nothing was emitted. fallback to sourceFile text.");
|
|
275
270
|
dtsCode = file.getFullText();
|
package/dist/tsc-worker.js
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.15.
|
|
3
|
+
"version": "0.15.9",
|
|
4
4
|
"description": "A Rolldown plugin to generate and bundle dts files.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"ast-kit": "^2.1.2",
|
|
64
64
|
"birpc": "^2.5.0",
|
|
65
65
|
"debug": "^4.4.1",
|
|
66
|
-
"dts-resolver": "^2.1.
|
|
66
|
+
"dts-resolver": "^2.1.2",
|
|
67
67
|
"get-tsconfig": "^4.10.1"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
@@ -73,12 +73,12 @@
|
|
|
73
73
|
"@types/babel__generator": "^7.27.0",
|
|
74
74
|
"@types/debug": "^4.1.12",
|
|
75
75
|
"@types/node": "^24.3.0",
|
|
76
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
76
|
+
"@typescript/native-preview": "7.0.0-dev.20250824.1",
|
|
77
77
|
"@volar/typescript": "^2.4.23",
|
|
78
78
|
"@vue/language-core": "^3.0.6",
|
|
79
79
|
"bumpp": "^10.2.3",
|
|
80
80
|
"diff": "^8.0.2",
|
|
81
|
-
"eslint": "^9.
|
|
81
|
+
"eslint": "^9.34.0",
|
|
82
82
|
"estree-walker": "^3.0.3",
|
|
83
83
|
"prettier": "^3.6.2",
|
|
84
84
|
"rolldown": "^1.0.0-beta.33",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"tsdown": "^0.14.1",
|
|
88
88
|
"typescript": "^5.9.2",
|
|
89
89
|
"vitest": "^3.2.4",
|
|
90
|
-
"vue": "^3.5.
|
|
90
|
+
"vue": "^3.5.19",
|
|
91
91
|
"vue-tsc": "^3.0.6"
|
|
92
92
|
},
|
|
93
93
|
"engines": {
|