@bunup/dts 0.14.26 → 0.14.28
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 +16 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -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
|
}
|
|
@@ -492,6 +493,20 @@ async function generateDts(entrypoints, options = {}) {
|
|
|
492
493
|
const { resolve, preferredTsconfig, naming } = options;
|
|
493
494
|
const cwd = options.cwd ? path2.resolve(options.cwd) : process.cwd();
|
|
494
495
|
const tsconfig = await loadTsConfig(cwd, preferredTsconfig);
|
|
496
|
+
if (options.inferTypes && !tsconfig.filepath) {
|
|
497
|
+
throw new Error(`The "inferTypes" option requires a tsconfig.json file. Please create a tsconfig.json file in your project root with at least a basic configuration:
|
|
498
|
+
|
|
499
|
+
` + `{
|
|
500
|
+
` + ` "compilerOptions": {
|
|
501
|
+
` + ` "target": "ESNext",
|
|
502
|
+
` + ` "module": "ESNext",
|
|
503
|
+
` + ` "moduleResolution": "bundler",
|
|
504
|
+
` + ` "declaration": true
|
|
505
|
+
` + ` }
|
|
506
|
+
` + `}
|
|
507
|
+
|
|
508
|
+
` + 'Alternatively, you can specify a custom path using the "preferredTsconfig" option.');
|
|
509
|
+
}
|
|
495
510
|
const nonAbsoluteEntrypoints = entrypoints.filter((entrypoint) => !path2.isAbsolute(entrypoint));
|
|
496
511
|
const resolvedEntrypoints = await getFilesFromGlobs(nonAbsoluteEntrypoints, cwd);
|
|
497
512
|
const absoluteEntrypoints = entrypoints.filter((entrypoint) => path2.isAbsolute(entrypoint));
|