@bunup/dts 0.14.27 → 0.14.29
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.js +10 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ var TOKENIZE_RE = /(\s+|\/\/.*?(?:\n|$)|\/\*[\s\S]*?\*\/|[a-zA-Z_$][a-zA-Z0-9_$]
|
|
|
22
22
|
var CAPITAL_LETTER_RE = /[A-Z]/;
|
|
23
23
|
var JS_RE = /\.[cm]?jsx?$/;
|
|
24
24
|
var TS_RE = /\.[cm]?tsx?$|\.d\.[cm]?ts$/;
|
|
25
|
-
var EXTENSION_REGEX = /\.(d\.(ts|cts|mts)|[cm]?[jt]
|
|
25
|
+
var EXTENSION_REGEX = /\.(d\.(ts|cts|mts)|[cm]?[jt]sx?)$/;
|
|
26
26
|
var NODE_MODULES_RE = /node_modules/;
|
|
27
27
|
|
|
28
28
|
// src/ast.ts
|
|
@@ -155,7 +155,8 @@ async function loadTsConfig(cwd, preferredPath) {
|
|
|
155
155
|
name: "tsconfig",
|
|
156
156
|
extensions: [".json"],
|
|
157
157
|
preferredPath,
|
|
158
|
-
cwd
|
|
158
|
+
cwd,
|
|
159
|
+
maxDepth: 1
|
|
159
160
|
});
|
|
160
161
|
return config;
|
|
161
162
|
}
|
|
@@ -476,6 +477,8 @@ async function runTypescriptCompiler(root, tsgo, tsconfig) {
|
|
|
476
477
|
"false",
|
|
477
478
|
"--declaration",
|
|
478
479
|
"--emitDeclarationOnly",
|
|
480
|
+
"--isolatedDeclarations",
|
|
481
|
+
"false",
|
|
479
482
|
...tsconfig ? ["-p", tsconfig] : [],
|
|
480
483
|
"--outDir",
|
|
481
484
|
dist,
|
|
@@ -483,7 +486,11 @@ async function runTypescriptCompiler(root, tsgo, tsconfig) {
|
|
|
483
486
|
root,
|
|
484
487
|
"--noCheck"
|
|
485
488
|
]);
|
|
486
|
-
await proc.exited;
|
|
489
|
+
const exitCode = await proc.exited;
|
|
490
|
+
if (exitCode !== 0) {
|
|
491
|
+
const stderr = await new Response(proc.stdout).text();
|
|
492
|
+
throw new Error(stderr || `TypeScript compiler failed with exit code ${exitCode}`);
|
|
493
|
+
}
|
|
487
494
|
return dist;
|
|
488
495
|
}
|
|
489
496
|
|