Merge pull request #6199 from SDA-SE/feat/improve-api-extractor

api-extractor: check whether folder has a package.json
This commit is contained in:
Oliver Sand
2021-06-24 16:03:37 +02:00
committed by GitHub
+8
View File
@@ -21,6 +21,7 @@ import {
resolve as resolvePath,
relative as relativePath,
dirname,
join,
} from 'path';
import fs from 'fs-extra';
import {
@@ -96,6 +97,13 @@ async function findPackageDirs() {
continue;
}
try {
const packageJsonPath = join(fullPackageDir, 'package.json');
await fs.access(packageJsonPath);
} catch (_) {
continue;
}
const packageDir = relativePath(projectRoot, fullPackageDir);
if (!SKIPPED_PACKAGES.includes(packageDir)) {
packageDirs.push(packageDir);