@bunup/dts 0.14.35 → 0.14.37
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 +9 -0
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,15 @@ type GenerateDtsOptions = {
|
|
|
61
61
|
* Ensure `@typescript/native-preview` is installed as dev dependency: `bun add --dev @typescript/native-preview`
|
|
62
62
|
*/
|
|
63
63
|
tsgo?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* The root directory for the project.
|
|
66
|
+
*
|
|
67
|
+
* It is computed to be the first common ancestor of all entrypoint files.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* root: './src'
|
|
71
|
+
*/
|
|
72
|
+
root?: string;
|
|
64
73
|
};
|
|
65
74
|
type GenerateDtsResultFile = {
|
|
66
75
|
/**
|
package/dist/index.js
CHANGED
|
@@ -373,7 +373,7 @@ async function fakeJsToDts(fakeJsContent) {
|
|
|
373
373
|
const statementText = fakeJsContent.substring(statement.start, statement.end);
|
|
374
374
|
if (isImportDeclaration(statement) || isExportAllDeclaration(statement) || isReExportStatement(statement)) {
|
|
375
375
|
if (isImportDeclaration(statement)) {
|
|
376
|
-
resultParts.push(statementText.replace(
|
|
376
|
+
resultParts.push(statementText.replace(/\.(mjs|cjs|js)\b/g, ""));
|
|
377
377
|
continue;
|
|
378
378
|
}
|
|
379
379
|
resultParts.push(statementText);
|
|
@@ -656,6 +656,7 @@ async function generateDts(entrypoints, options = {}) {
|
|
|
656
656
|
plugins: [fakeJsPlugin],
|
|
657
657
|
packages: "external",
|
|
658
658
|
minify: options.minify,
|
|
659
|
+
root: options.root,
|
|
659
660
|
throw: false,
|
|
660
661
|
tsconfig: options.preferredTsconfig ? path2.resolve(cwd, options.preferredTsconfig) : undefined
|
|
661
662
|
});
|