@bunup/dts 0.14.21 → 0.14.23
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/LICENSE +21 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +166 -122
- package/package.json +51 -37
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 bunup
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -44,6 +44,16 @@ type GenerateDtsOptions = {
|
|
|
44
44
|
* Whether to minify the generated declaration files to reduce the size of the declaration file.
|
|
45
45
|
*/
|
|
46
46
|
minify?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* When using isolated declarations, exports typically require explicit type annotations.
|
|
49
|
+
*
|
|
50
|
+
* When this option is enabled, TypeScript's compiler is used to generate declaration files,
|
|
51
|
+
* which will automatically infer the types of exports, eliminating the need for explicit type annotations.
|
|
52
|
+
*
|
|
53
|
+
* This option is enabled by default if `isolatedDeclarations` is disabled or not specified
|
|
54
|
+
* in your tsconfig.json's compilerOptions.
|
|
55
|
+
*/
|
|
56
|
+
inferTypes?: boolean;
|
|
47
57
|
};
|
|
48
58
|
type GenerateDtsResultFile = {
|
|
49
59
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
//
|
|
2
|
-
import
|
|
1
|
+
// src/generate.ts
|
|
2
|
+
import { rm } from "node:fs/promises";
|
|
3
|
+
import path2 from "node:path";
|
|
3
4
|
import { isolatedDeclaration } from "oxc-transform";
|
|
4
5
|
import { resolveTsImportPath } from "ts-import-resolver";
|
|
5
6
|
|
|
6
|
-
//
|
|
7
|
+
// src/constants.ts
|
|
7
8
|
var EMPTY_EXPORT = "export {};";
|
|
8
9
|
|
|
9
|
-
//
|
|
10
|
+
// src/fake-js.ts
|
|
10
11
|
import { parse } from "@babel/parser";
|
|
11
12
|
|
|
12
|
-
//
|
|
13
|
+
// src/re.ts
|
|
13
14
|
var IMPORT_TYPE_RE = /import\s+type\s+/g;
|
|
14
15
|
var EXPORT_TYPE_RE = /export\s+type\s+/g;
|
|
15
16
|
var IMPORT_EXPORT_NAMES_RE = /(import|export)\s*{([^}]*)}/g;
|
|
@@ -24,7 +25,7 @@ var TS_RE = /\.[cm]?tsx?$|\.d\.[cm]?ts$/;
|
|
|
24
25
|
var EXTENSION_REGEX = /\.(d\.(ts|cts|mts)|[cm]?[jt]s)$/;
|
|
25
26
|
var NODE_MODULES_RE = /node_modules/;
|
|
26
27
|
|
|
27
|
-
//
|
|
28
|
+
// src/ast.ts
|
|
28
29
|
function isLikelyVariableOrTypeName(token) {
|
|
29
30
|
return CAPITAL_LETTER_RE.test(token) && !token.startsWith("/*") && !token.startsWith("@") && !token.startsWith('"') && !token.startsWith("'") && !token.startsWith("`");
|
|
30
31
|
}
|
|
@@ -119,7 +120,7 @@ function getAllImportNames(body) {
|
|
|
119
120
|
return importNames;
|
|
120
121
|
}
|
|
121
122
|
|
|
122
|
-
//
|
|
123
|
+
// src/utils.ts
|
|
123
124
|
import { existsSync } from "node:fs";
|
|
124
125
|
import { normalize } from "node:path";
|
|
125
126
|
import { loadConfig } from "coffi";
|
|
@@ -220,7 +221,7 @@ function minifyDts(dts) {
|
|
|
220
221
|
}).code;
|
|
221
222
|
}
|
|
222
223
|
|
|
223
|
-
//
|
|
224
|
+
// src/fake-js.ts
|
|
224
225
|
async function dtsToFakeJs(dtsContent) {
|
|
225
226
|
const parsed = parse(dtsContent, {
|
|
226
227
|
sourceType: "module",
|
|
@@ -242,8 +243,9 @@ async function dtsToFakeJs(dtsContent) {
|
|
|
242
243
|
referencedNames.add(name);
|
|
243
244
|
}
|
|
244
245
|
const isDefaultExport = hasDefaultExportModifier(statement, statementText);
|
|
246
|
+
const varName = name || generateRandomString();
|
|
245
247
|
if (isDefaultExport) {
|
|
246
|
-
result.push(`export { ${
|
|
248
|
+
result.push(`export { ${varName} as default };`);
|
|
247
249
|
if (isDefaultReExport(statement)) {
|
|
248
250
|
continue;
|
|
249
251
|
}
|
|
@@ -265,7 +267,6 @@ async function dtsToFakeJs(dtsContent) {
|
|
|
265
267
|
statementTextWithCommentsAttatched = removeExportSyntaxes(statementTextWithCommentsAttatched);
|
|
266
268
|
}
|
|
267
269
|
const tokens = tokenizeText(statementTextWithCommentsAttatched, referencedNames);
|
|
268
|
-
const varName = name || generateRandomString();
|
|
269
270
|
result.push(`var ${varName} = [${tokens.join(", ")}];`);
|
|
270
271
|
if (isExported && !isDefaultExport && !exportedNames.has(varName)) {
|
|
271
272
|
result.push(`export { ${varName} };`);
|
|
@@ -368,7 +369,7 @@ function processTokenElement(element) {
|
|
|
368
369
|
parts.push(unescapeNewlinesAndTabs(element.quasis[0]?.value?.raw || ""));
|
|
369
370
|
for (let i = 0;i < element.expressions.length; i++) {
|
|
370
371
|
const expr = element.expressions[i];
|
|
371
|
-
if (expr
|
|
372
|
+
if (expr?.type === "Identifier") {
|
|
372
373
|
parts.push(expr.name);
|
|
373
374
|
}
|
|
374
375
|
parts.push(unescapeNewlinesAndTabs(element.quasis[i + 1]?.value?.raw || ""));
|
|
@@ -406,7 +407,7 @@ function handleNamespace(stmt) {
|
|
|
406
407
|
}`;
|
|
407
408
|
}
|
|
408
409
|
|
|
409
|
-
//
|
|
410
|
+
// src/resolver.ts
|
|
410
411
|
import { dirname } from "node:path";
|
|
411
412
|
import process2 from "node:process";
|
|
412
413
|
import { ResolverFactory } from "oxc-resolver";
|
|
@@ -421,20 +422,18 @@ function createResolver({
|
|
|
421
422
|
extensions: [".d.ts", ".d.mts", ".d.cts", ".ts", ".mts", ".cts"],
|
|
422
423
|
tsconfig: tsconfig ? { configFile: tsconfig, references: "auto" } : undefined
|
|
423
424
|
});
|
|
424
|
-
const resolutionCache = new Map;
|
|
425
425
|
return (importSource, importer) => {
|
|
426
426
|
if (importSource === "bun")
|
|
427
427
|
return null;
|
|
428
|
-
const cacheKey = `${importSource}:${importer || ""}`;
|
|
429
|
-
if (resolutionCache.has(cacheKey)) {
|
|
430
|
-
return resolutionCache.get(cacheKey) || null;
|
|
431
|
-
}
|
|
432
428
|
let shouldResolve = false;
|
|
433
429
|
if (resolveOption !== undefined) {
|
|
434
430
|
if (typeof resolveOption === "boolean") {
|
|
435
431
|
shouldResolve = resolveOption;
|
|
436
432
|
} else if (Array.isArray(resolveOption)) {
|
|
437
433
|
shouldResolve = resolveOption.some((resolver2) => {
|
|
434
|
+
if (importer?.includes(resolver2.toString())) {
|
|
435
|
+
return true;
|
|
436
|
+
}
|
|
438
437
|
if (typeof resolver2 === "string") {
|
|
439
438
|
return resolver2 === importSource;
|
|
440
439
|
}
|
|
@@ -443,36 +442,56 @@ function createResolver({
|
|
|
443
442
|
}
|
|
444
443
|
}
|
|
445
444
|
if (!shouldResolve) {
|
|
446
|
-
resolutionCache.set(cacheKey, null);
|
|
447
445
|
return null;
|
|
448
446
|
}
|
|
449
447
|
const directory = importer ? dirname(importer) : cwd;
|
|
450
448
|
const resolution = resolver.sync(directory, importSource);
|
|
451
449
|
if (!resolution.path) {
|
|
452
|
-
resolutionCache.set(cacheKey, null);
|
|
453
450
|
return null;
|
|
454
451
|
}
|
|
455
452
|
const resolved = resolution.path;
|
|
456
453
|
if (JS_RE.test(resolved)) {
|
|
457
454
|
const dts = returnPathIfExists(resolved.replace(JS_RE, ".d.ts")) || returnPathIfExists(resolved.replace(JS_RE, ".d.mts")) || returnPathIfExists(resolved.replace(JS_RE, ".d.cts"));
|
|
458
|
-
|
|
459
|
-
resolutionCache.set(cacheKey, result2);
|
|
460
|
-
return result2;
|
|
455
|
+
return isTypeScriptFile(dts) ? dts : null;
|
|
461
456
|
}
|
|
462
|
-
|
|
463
|
-
resolutionCache.set(cacheKey, result);
|
|
464
|
-
return result;
|
|
457
|
+
return isTypeScriptFile(resolved) ? resolved : null;
|
|
465
458
|
};
|
|
466
459
|
}
|
|
467
460
|
|
|
468
|
-
//
|
|
461
|
+
// src/tsgo.ts
|
|
462
|
+
import { mkdtemp } from "node:fs/promises";
|
|
463
|
+
import { tmpdir } from "node:os";
|
|
464
|
+
import path from "node:path";
|
|
465
|
+
async function runTsgo(root, tsconfig) {
|
|
466
|
+
const tsgoPackage = import.meta.resolve("@typescript/native-preview/package.json");
|
|
467
|
+
const { default: getExePath } = await import(new URL("lib/getExePath.js", tsgoPackage).href);
|
|
468
|
+
const tsgo = getExePath();
|
|
469
|
+
const dist = await mkdtemp(path.join(tmpdir(), "bunup-dts-"));
|
|
470
|
+
const proc = Bun.spawn([
|
|
471
|
+
tsgo,
|
|
472
|
+
"--noEmit",
|
|
473
|
+
"false",
|
|
474
|
+
"--declaration",
|
|
475
|
+
"--emitDeclarationOnly",
|
|
476
|
+
...tsconfig ? ["-p", tsconfig] : [],
|
|
477
|
+
"--outDir",
|
|
478
|
+
dist,
|
|
479
|
+
"--rootDir",
|
|
480
|
+
root,
|
|
481
|
+
"--noCheck"
|
|
482
|
+
]);
|
|
483
|
+
await proc.exited;
|
|
484
|
+
return dist;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// src/generate.ts
|
|
469
488
|
async function generateDts(entrypoints, options = {}) {
|
|
470
489
|
const { resolve, preferredTsconfig, naming } = options;
|
|
471
|
-
const cwd = options.cwd ?
|
|
490
|
+
const cwd = options.cwd ? path2.resolve(options.cwd) : process.cwd();
|
|
472
491
|
const tsconfig = await loadTsConfig(cwd, preferredTsconfig);
|
|
473
|
-
const nonAbsoluteEntrypoints = entrypoints.filter((entrypoint) => !
|
|
492
|
+
const nonAbsoluteEntrypoints = entrypoints.filter((entrypoint) => !path2.isAbsolute(entrypoint));
|
|
474
493
|
const resolvedEntrypoints = await getFilesFromGlobs(nonAbsoluteEntrypoints, cwd);
|
|
475
|
-
const absoluteEntrypoints = entrypoints.filter((entrypoint) =>
|
|
494
|
+
const absoluteEntrypoints = entrypoints.filter((entrypoint) => path2.isAbsolute(entrypoint));
|
|
476
495
|
if (!filterTypescriptFiles([...resolvedEntrypoints, ...absoluteEntrypoints]).length) {
|
|
477
496
|
throw new Error("One or more of the entrypoints you provided do not exist. Please check that each entrypoint points to a valid file.");
|
|
478
497
|
}
|
|
@@ -482,108 +501,133 @@ async function generateDts(entrypoints, options = {}) {
|
|
|
482
501
|
resolveOption: resolve,
|
|
483
502
|
tsconfig: tsconfig.filepath
|
|
484
503
|
});
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
return { path: resolved };
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
const resolvedFromNodeModules = resolver(args.path, args.importer);
|
|
501
|
-
if (resolvedFromNodeModules) {
|
|
502
|
-
return { path: resolvedFromNodeModules };
|
|
503
|
-
}
|
|
504
|
-
return {
|
|
505
|
-
path: args.path,
|
|
506
|
-
external: true
|
|
507
|
-
};
|
|
508
|
-
});
|
|
509
|
-
build.onLoad({ filter: /\.(ts|tsx|d\.ts|d\.mts|d\.cts)$/ }, async (args) => {
|
|
510
|
-
const sourceText = await Bun.file(args.path).text();
|
|
511
|
-
const declarationResult = isolatedDeclaration(args.path, sourceText);
|
|
512
|
-
let fakeJsContent = "";
|
|
513
|
-
if (!collectedErrors.some((e) => e.file === args.path)) {
|
|
514
|
-
for (const error of declarationResult.errors) {
|
|
515
|
-
collectedErrors.push({
|
|
516
|
-
error,
|
|
517
|
-
file: args.path,
|
|
518
|
-
content: sourceText
|
|
504
|
+
let tsgoDist;
|
|
505
|
+
try {
|
|
506
|
+
const fakeJsPlugin = {
|
|
507
|
+
name: "fake-js",
|
|
508
|
+
async setup(build) {
|
|
509
|
+
build.onResolve({ filter: /.*/ }, (args) => {
|
|
510
|
+
if (!NODE_MODULES_RE.test(args.importer)) {
|
|
511
|
+
const resolved = resolveTsImportPath({
|
|
512
|
+
importer: args.importer,
|
|
513
|
+
path: args.path,
|
|
514
|
+
cwd,
|
|
515
|
+
tsconfig: tsconfig.config
|
|
519
516
|
});
|
|
517
|
+
if (resolved && isTypeScriptFile(resolved)) {
|
|
518
|
+
return { path: resolved };
|
|
519
|
+
}
|
|
520
520
|
}
|
|
521
|
+
const resolvedFromNodeModules = resolver(args.path, args.importer);
|
|
522
|
+
if (resolvedFromNodeModules) {
|
|
523
|
+
return { path: resolvedFromNodeModules };
|
|
524
|
+
}
|
|
525
|
+
return {
|
|
526
|
+
path: args.path,
|
|
527
|
+
external: true
|
|
528
|
+
};
|
|
529
|
+
});
|
|
530
|
+
if (options.inferTypes) {
|
|
531
|
+
tsgoDist = await runTsgo(cwd, tsconfig.filepath ?? undefined);
|
|
521
532
|
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
533
|
+
build.onLoad({ filter: /\.(ts|tsx|d\.ts|d\.mts|d\.cts)$/ }, async (args) => {
|
|
534
|
+
const sourceText = await Bun.file(args.path).text();
|
|
535
|
+
let declaration = "";
|
|
536
|
+
let isolatedDeclarationErrors = [];
|
|
537
|
+
if (NODE_MODULES_RE.test(args.path)) {
|
|
538
|
+
declaration = sourceText;
|
|
539
|
+
} else {
|
|
540
|
+
if (options.inferTypes && tsgoDist) {
|
|
541
|
+
const declarationPath = replaceExtension(path2.join(tsgoDist, args.path.replace(cwd, "")), ".d.ts");
|
|
542
|
+
declaration = await Bun.file(declarationPath).text();
|
|
543
|
+
} else {
|
|
544
|
+
const isolatedDeclarationResult = isolatedDeclaration(args.path, sourceText);
|
|
545
|
+
declaration = isolatedDeclarationResult.code;
|
|
546
|
+
if (isolatedDeclarationResult.errors) {
|
|
547
|
+
isolatedDeclarationErrors = isolatedDeclarationResult.errors;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
let fakeJsContent = "";
|
|
552
|
+
if (!collectedErrors.some((e) => e.file === args.path)) {
|
|
553
|
+
for (const error of isolatedDeclarationErrors) {
|
|
554
|
+
collectedErrors.push({
|
|
555
|
+
error,
|
|
556
|
+
file: args.path,
|
|
557
|
+
content: sourceText
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
if (declaration) {
|
|
562
|
+
fakeJsContent = await dtsToFakeJs(declaration);
|
|
563
|
+
} else {
|
|
564
|
+
fakeJsContent = EMPTY_EXPORT;
|
|
565
|
+
}
|
|
566
|
+
return {
|
|
567
|
+
loader: "js",
|
|
568
|
+
contents: fakeJsContent
|
|
569
|
+
};
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
const result = await Bun.build({
|
|
574
|
+
entrypoints: [
|
|
575
|
+
...filterTypescriptFiles(resolvedEntrypoints).map((entry) => path2.resolve(path2.join(cwd, entry))),
|
|
576
|
+
...filterTypescriptFiles(absoluteEntrypoints)
|
|
577
|
+
],
|
|
578
|
+
format: "esm",
|
|
579
|
+
target: "node",
|
|
580
|
+
naming,
|
|
581
|
+
splitting: options.splitting,
|
|
582
|
+
plugins: [fakeJsPlugin],
|
|
583
|
+
packages: "external",
|
|
584
|
+
minify: options.minify,
|
|
585
|
+
throw: false,
|
|
586
|
+
tsconfig: options.preferredTsconfig ? path2.resolve(cwd, options.preferredTsconfig) : undefined
|
|
587
|
+
});
|
|
588
|
+
if (!result.success) {
|
|
589
|
+
throw new Error(`DTS bundling failed: ${result.logs}`);
|
|
563
590
|
}
|
|
564
|
-
|
|
565
|
-
|
|
591
|
+
const outputs = result.outputs.filter((output) => output.kind === "chunk" || output.kind === "entry-point");
|
|
592
|
+
const bundledFiles = [];
|
|
593
|
+
for (const output of outputs) {
|
|
594
|
+
const bundledFakeJsContent = await output.text();
|
|
595
|
+
const dtsContent = await fakeJsToDts(bundledFakeJsContent);
|
|
596
|
+
const entrypoint = output.kind === "entry-point" ? entrypoints[bundledFiles.length] : undefined;
|
|
597
|
+
const chunkFileName = output.kind === "chunk" ? replaceExtension(path2.basename(output.path), getDeclarationExtensionFromJsExtension(getExtension(output.path))) : undefined;
|
|
598
|
+
const outputPath = cleanPath(replaceExtension(cleanPath(output.path), getDeclarationExtensionFromJsExtension(getExtension(output.path))));
|
|
599
|
+
const treeshakedDts = isolatedDeclaration(`${generateRandomString()}.d.ts`, dtsContent);
|
|
600
|
+
if (!treeshakedDts.code.length && !treeshakedDts.errors.length) {
|
|
601
|
+
continue;
|
|
602
|
+
}
|
|
603
|
+
if (treeshakedDts.errors.length && !treeshakedDts.code) {
|
|
604
|
+
throw new Error(`DTS treeshaking failed for ${entrypoint || outputPath}
|
|
566
605
|
|
|
567
606
|
${JSON.stringify(treeshakedDts.errors, null, 2)}`);
|
|
568
|
-
}
|
|
569
|
-
bundledFiles.push({
|
|
570
|
-
kind: output.kind === "entry-point" ? "entry-point" : "chunk",
|
|
571
|
-
entrypoint,
|
|
572
|
-
chunkFileName,
|
|
573
|
-
outputPath,
|
|
574
|
-
dts: options.minify ? minifyDts(treeshakedDts.code) : treeshakedDts.code,
|
|
575
|
-
pathInfo: {
|
|
576
|
-
outputPathWithoutExtension: deleteExtension(outputPath),
|
|
577
|
-
ext: getExtension(outputPath)
|
|
578
607
|
}
|
|
579
|
-
|
|
608
|
+
bundledFiles.push({
|
|
609
|
+
kind: output.kind === "entry-point" ? "entry-point" : "chunk",
|
|
610
|
+
entrypoint,
|
|
611
|
+
chunkFileName,
|
|
612
|
+
outputPath,
|
|
613
|
+
dts: options.minify ? minifyDts(treeshakedDts.code) : treeshakedDts.code,
|
|
614
|
+
pathInfo: {
|
|
615
|
+
outputPathWithoutExtension: deleteExtension(outputPath),
|
|
616
|
+
ext: getExtension(outputPath)
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
return {
|
|
621
|
+
files: bundledFiles,
|
|
622
|
+
errors: collectedErrors
|
|
623
|
+
};
|
|
624
|
+
} finally {
|
|
625
|
+
if (tsgoDist) {
|
|
626
|
+
await rm(tsgoDist, { recursive: true, force: true });
|
|
627
|
+
}
|
|
580
628
|
}
|
|
581
|
-
return {
|
|
582
|
-
files: bundledFiles,
|
|
583
|
-
errors: collectedErrors
|
|
584
|
-
};
|
|
585
629
|
}
|
|
586
|
-
//
|
|
630
|
+
// src/isolated-decl-logger.ts
|
|
587
631
|
import pc from "picocolors";
|
|
588
632
|
var SEVERITY_CONFIG = {
|
|
589
633
|
dev: {
|
package/package.json
CHANGED
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bunup/dts",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.14.23",
|
|
4
|
+
"description": "An extremely fast TypeScript declaration bundler built on Bun's native bundler.",
|
|
5
|
+
"homepage": "https://github.com/bunup/dts#readme",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/bunup/dts/issues"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
6
10
|
"files": [
|
|
7
11
|
"dist"
|
|
8
12
|
],
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
".": {
|
|
13
|
-
"import": {
|
|
14
|
-
"types": "./dist/index.d.ts",
|
|
15
|
-
"default": "./dist/index.js"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"./package.json": "./package.json"
|
|
19
|
-
},
|
|
20
|
-
"scripts": {
|
|
21
|
-
"type-check": "tsc --noEmit"
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/bunup/dts.git"
|
|
22
16
|
},
|
|
23
17
|
"dependencies": {
|
|
24
18
|
"@babel/parser": "^7.28.4",
|
|
19
|
+
"@typescript/native-preview": "^7.0.0-dev.20251016.1",
|
|
25
20
|
"coffi": "^0.1.37",
|
|
26
21
|
"oxc-minify": "^0.93.0",
|
|
27
22
|
"oxc-resolver": "^11.9.0",
|
|
@@ -30,15 +25,31 @@
|
|
|
30
25
|
"std-env": "^3.9.0",
|
|
31
26
|
"ts-import-resolver": "^0.1.23"
|
|
32
27
|
},
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "bunup --exports --unused",
|
|
30
|
+
"dev": "bunup --watch",
|
|
31
|
+
"postinstall": "bun simple-git-hooks",
|
|
32
|
+
"lint": "biome check .",
|
|
33
|
+
"lint:fix": "biome check --write .",
|
|
34
|
+
"release": "bumpp --commit --push --tag",
|
|
35
|
+
"test": "bun test",
|
|
36
|
+
"test:coverage": "bun test --coverage",
|
|
37
|
+
"test:watch": "bun test --watch",
|
|
38
|
+
"type-check": "tsc --noEmit"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@biomejs/biome": "^2.2.6",
|
|
42
|
+
"@types/bun": "^1.3.0",
|
|
43
|
+
"bumpp": "^10.3.1",
|
|
44
|
+
"bunup": "^0.14.21",
|
|
45
|
+
"simple-git-hooks": "^2.13.1",
|
|
46
|
+
"type-fest": "^5.1.0",
|
|
47
|
+
"typescript": "^5.9.3",
|
|
48
|
+
"zod": "^4.1.12"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"typescript": ">=4.5.0"
|
|
52
|
+
},
|
|
42
53
|
"keywords": [
|
|
43
54
|
"typescript",
|
|
44
55
|
"dts",
|
|
@@ -47,21 +58,24 @@
|
|
|
47
58
|
"bun",
|
|
48
59
|
"bun dts"
|
|
49
60
|
],
|
|
50
|
-
"repository": {
|
|
51
|
-
"type": "git",
|
|
52
|
-
"url": "git+https://github.com/bunup/bunup.git"
|
|
53
|
-
},
|
|
54
|
-
"funding": "https://github.com/sponsors/arshad-yaseen",
|
|
55
|
-
"homepage": "https://bunup.dev",
|
|
56
|
-
"peerDependencies": {
|
|
57
|
-
"typescript": "latest"
|
|
58
|
-
},
|
|
59
61
|
"peerDependenciesMeta": {
|
|
60
62
|
"typescript": {
|
|
61
63
|
"optional": true
|
|
62
64
|
}
|
|
63
65
|
},
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
"type": "module",
|
|
67
|
+
"exports": {
|
|
68
|
+
".": {
|
|
69
|
+
"import": {
|
|
70
|
+
"types": "./dist/index.d.ts",
|
|
71
|
+
"default": "./dist/index.js"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"./package.json": "./package.json"
|
|
75
|
+
},
|
|
76
|
+
"module": "./dist/index.js",
|
|
77
|
+
"simple-git-hooks": {
|
|
78
|
+
"pre-commit": "bun run lint && bun run type-check"
|
|
79
|
+
},
|
|
80
|
+
"types": "./dist/index.d.ts"
|
|
67
81
|
}
|