Skip to content

Commit dba2bae

Browse files
authored
chore: fix bump version script (#50)
1 parent 294f382 commit dba2bae

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/bump-version.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,22 @@ function getWorkspacePackageJsonFiles(workspaceFile: string): string[] {
77
const workspaceYaml = fs.readFileSync(workspaceFile, 'utf8');
88
const workspace = yaml.parse(workspaceYaml) as { packages?: string[] };
99
if (!workspace.packages) throw new Error('No "packages" key found in pnpm-workspace.yaml');
10-
const rootDir = path.dirname(workspaceFile);
10+
1111
const files = new Set<string>();
12+
13+
// include all package.json files in the workspace
14+
const rootDir = path.dirname(workspaceFile);
1215
for (const pattern of workspace.packages) {
1316
const matches = glob.sync(path.join(pattern, 'package.json'), {
1417
cwd: rootDir,
1518
absolute: true,
1619
});
1720
matches.filter((f) => !f.includes('node_modules')).forEach((f) => files.add(f));
1821
}
22+
23+
// include root package.json
24+
files.add(path.resolve(__dirname, '../package.json'));
25+
1926
return Array.from(files);
2027
}
2128

0 commit comments

Comments
 (0)