Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions libs/codegen/src/release/updatePkgsForGenericBump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,26 +103,29 @@ async function updateChangelog(pkgPath: string, highestVersion: string) {

async function updatePkgsForGenericBump() {
// Find package.json paths for cds-web, cds-mobile, and cds-common
const pkgJsonPaths = await glob(`packages/(${PACKAGES_TO_SYNC_VERSION.join('|')})/package.json`, {
absolute: true,
cwd: MONOREPO_ROOT,
onlyFiles: true,
});
const pkgJsonPaths = await glob(
`packages/(${PACKAGES_TO_SYNC_VERSION.join('|')})/package.json`,
{
absolute: true,
cwd: MONOREPO_ROOT,
onlyFiles: true,
},
);

// Get the highest version number among the specified packages
const highestVersion = await getHighestVersion(pkgJsonPaths);

console.info(chalk.blue(`Updating all versions to ${highestVersion}`));

// Update versions in package.json and CHANGELOG for each package
pkgJsonPaths.forEach(async (pkgPath) => {
for (const pkgPath of pkgJsonPaths) {
const packageVersion = await getPkgVersion(pkgPath);

if (semver.lt(packageVersion, highestVersion)) {
await updatePkgVersion(pkgPath, highestVersion);
await updateChangelog(pkgPath, highestVersion);
}
});
}

// Write updated package.json
console.info(chalk.green(`Versions updated successfully!`));
Expand Down
Loading