Skip to content

Commit 0afa04d

Browse files
committed
fix: no record packagejson in project root path
1 parent eb47fba commit 0afa04d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ts-parser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "abcoder-ts-parser",
3-
"version": "0.0.24",
3+
"version": "0.0.28",
44
"description": "TypeScript AST parser for UNIAST specification",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

ts-parser/src/utils/monorepo.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ export class MonorepoUtils {
8282
private static countPackageJsonFiles(rootPath: string): number {
8383
try {
8484
let count = 0;
85+
86+
// Check if rootPath itself has a package.json
87+
const rootPackageJsonPath = path.join(rootPath, 'package.json');
88+
if (fs.existsSync(rootPackageJsonPath)) {
89+
count++;
90+
}
91+
8592
const items = fs.readdirSync(rootPath);
8693

8794
for (const item of items) {

0 commit comments

Comments
 (0)