Skip to content
Closed
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
25 changes: 25 additions & 0 deletions scripts/monorepo/bump-all-updated-packages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const chalk = require('chalk');
const inquirer = require('inquirer');
const path = require('path');
const {echo, exec, exit} = require('shelljs');
const yargs = require('yargs');

const {BUMP_COMMIT_MESSAGE} = require('../constants');
const forEachPackage = require('../for-each-package');
Expand All @@ -19,6 +20,15 @@ const bumpPackageVersion = require('./bump-package-version');

const ROOT_LOCATION = path.join(__dirname, '..', '..', '..');

const {
argv: {releaseBranchCutoff},
} = yargs
.option('release-branch-cutoff', {
type: 'boolean',
describe: 'Should force bump minor version for each public package',
})
.strict();

const buildExecutor =
(packageAbsolutePath, packageRelativePathFromRoot, packageManifest) =>
async () => {
Expand All @@ -29,6 +39,21 @@ const buildExecutor =
return;
}

if (releaseBranchCutoff) {
const updatedVersion = bumpPackageVersion(
packageAbsolutePath,
packageManifest,
'minor',
);
echo(
`\u2705 Successfully bumped ${chalk.green(
packageName,
)} to ${chalk.green(updatedVersion)}`,
);

return;
}

const hashOfLastCommitInsidePackage = exec(
`git log -n 1 --format=format:%H -- ${packageRelativePathFromRoot}`,
{cwd: ROOT_LOCATION, silent: true},
Expand Down