Skip to content

Commit 91397d4

Browse files
hoxyqfacebook-github-bot
authored andcommitted
refactor(bump-all-updated-packages): support force-bump to next minor version of the package (#35810)
Summary: Pull Request resolved: #35810 Changelog: [Internal] `bump-all-updated-packages` script now supports `release-branch-cutoff` argument If this argument is provided, the script will bump each public package to next minor version Updated [wiki](https://github.com/facebook/react-native/wiki/Release-and-its-automated-processes) with relevant information about how to use it Reviewed By: cortinico Differential Revision: D42455329 fbshipit-source-id: a40d2f5dc356f22d3182da3a118c6383b634817d
1 parent f47b5b8 commit 91397d4

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

  • scripts/monorepo/bump-all-updated-packages

scripts/monorepo/bump-all-updated-packages/index.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const chalk = require('chalk');
1111
const inquirer = require('inquirer');
1212
const path = require('path');
1313
const {echo, exec, exit} = require('shelljs');
14+
const yargs = require('yargs');
1415

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

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

23+
const {
24+
argv: {releaseBranchCutoff},
25+
} = yargs
26+
.option('release-branch-cutoff', {
27+
type: 'boolean',
28+
describe: 'Should force bump minor version for each public package',
29+
})
30+
.strict();
31+
2232
const buildExecutor =
2333
(packageAbsolutePath, packageRelativePathFromRoot, packageManifest) =>
2434
async () => {
@@ -29,6 +39,21 @@ const buildExecutor =
2939
return;
3040
}
3141

42+
if (releaseBranchCutoff) {
43+
const updatedVersion = bumpPackageVersion(
44+
packageAbsolutePath,
45+
packageManifest,
46+
'minor',
47+
);
48+
echo(
49+
`\u2705 Successfully bumped ${chalk.green(
50+
packageName,
51+
)} to ${chalk.green(updatedVersion)}`,
52+
);
53+
54+
return;
55+
}
56+
3257
const hashOfLastCommitInsidePackage = exec(
3358
`git log -n 1 --format=format:%H -- ${packageRelativePathFromRoot}`,
3459
{cwd: ROOT_LOCATION, silent: true},

0 commit comments

Comments
 (0)