mirror of
https://github.com/facebook/react.git
synced 2026-02-25 13:13:03 +00:00
* First chunk of new release script * Re-ordered build steps to combine error codes and releases * Reorganized build files; added stub publish script * First pass at publis script. Also collect and print dry-run commits/publish commands. * Deleted old react-release-manager scripts * Cleaned up release package.json * Basic README instructions * Removed unnecessary 'async' keyword from a method * Wordsmithing * Tweaked README * Renamed build -> build-commands and publish -> publish-commands to avoid conflict with .gitignore * Bump pre-release package versions differently * Prettier * Improved CircleCI API token setup instructions message * Lint fix * Typofix
40 lines
1.2 KiB
JavaScript
Executable File
40 lines
1.2 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
'use strict';
|
|
|
|
const chalk = require('chalk');
|
|
const logUpdate = require('log-update');
|
|
|
|
const checkBuildStatus = require('./publish-commands/check-build-status');
|
|
const commitChangelog = require('./publish-commands/commit-changelog');
|
|
const parsePublishParams = require('./publish-commands/parse-publish-params');
|
|
const printPostPublishSummary = require('./publish-commands/print-post-publish-summary');
|
|
const pushGitRemote = require('./publish-commands/push-git-remote');
|
|
const publishToNpm = require('./publish-commands/publish-to-npm');
|
|
|
|
// Follows the steps outlined in github.com/facebook/react/issues/10620
|
|
const run = async () => {
|
|
const params = parsePublishParams();
|
|
|
|
try {
|
|
await checkBuildStatus(params);
|
|
await commitChangelog(params);
|
|
await pushGitRemote(params);
|
|
await publishToNpm(params);
|
|
await printPostPublishSummary(params);
|
|
} catch (error) {
|
|
logUpdate.clear();
|
|
|
|
const message = error.message.trim().replace(/\n +/g, '\n');
|
|
const stack = error.stack.replace(error.message, '');
|
|
|
|
console.log(
|
|
`${chalk.bgRed.white(' ERROR ')} ${chalk.red(message)}\n\n${chalk.gray(stack)}`
|
|
);
|
|
|
|
process.exit(1);
|
|
}
|
|
};
|
|
|
|
run();
|