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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user