also looking at this
fix(generator): skip glob and relative entrypoints outside the root
#3126
3 files
+74
-2
| @@ -801,9 +801,15 @@ async function findFiles(config: DtsGenerationConfig): Promise<string[]> { | ||
| 801 | 801 | absolute: true, |
| 802 | 802 | onlyFiles: true, |
| 803 | 803 | })) { |
| 804 | // Skip .d.ts files, node_modules, and excluded patterns | |
| 804 | // Skip .d.ts files, node_modules, and excluded patterns. A pattern | |
| 805 | // reaching above the root (`../*.ts`, `../index.ts`) matches files | |
| 806 | // whose declarations would be written outside outdir; they are | |
| 807 | // skipped as an absolute path outside the root is. | |
| 805 | 808 | if (isProcessableSourceFile(file) && !file.includes('node_modules')) { |
| 806 | if (!isExcluded(file, excludePatterns, rootPath)) { | |
| 809 | if (!isWithinRoot(file, rootPath) && config.outputStructure !== 'flat') { | |
| 810 | logger.warn(`Skipping entrypoint outside root: ${relative(config.cwd, file)}`) | |
| 811 | } | |
| 812 | else if (!isExcluded(file, excludePatterns, rootPath)) { | |
| 807 | 813 | files.push(file) |
| 808 | 814 | } |
| 809 | 815 | } |