mirror of
https://github.com/facebook/react.git
synced 2026-02-26 18:58:05 +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
56 lines
1.4 KiB
JavaScript
56 lines
1.4 KiB
JavaScript
#!/usr/bin/env node
|
||
|
||
'use strict';
|
||
|
||
const chalk = require('chalk');
|
||
const commandLineArgs = require('command-line-args');
|
||
const commandLineUsage = require('command-line-usage');
|
||
const figlet = require('figlet');
|
||
const {paramDefinitions} = require('../config');
|
||
|
||
module.exports = () => {
|
||
const params = commandLineArgs(paramDefinitions);
|
||
|
||
if (!params.version) {
|
||
const usage = commandLineUsage([
|
||
{
|
||
content: chalk
|
||
.hex('#61dafb')
|
||
.bold(figlet.textSync('react', {font: 'Graffiti'})),
|
||
raw: true,
|
||
},
|
||
{
|
||
content: 'Automated pre-release build script.',
|
||
},
|
||
{
|
||
header: 'Options',
|
||
optionList: paramDefinitions,
|
||
},
|
||
{
|
||
header: 'Examples',
|
||
content: [
|
||
{
|
||
desc: '1. A concise example.',
|
||
example: '$ ./build.js [bold]{-v} [underline]{16.0.0}',
|
||
},
|
||
{
|
||
desc: '2. Dry run build a release candidate (no git commits).',
|
||
example: '$ ./build.js [bold]{--dry} [bold]{-v} [underline]{16.0.0-rc.0}',
|
||
},
|
||
{
|
||
desc: '3. Release from another checkout.',
|
||
example: '$ ./build.js [bold]{--version}=[underline]{16.0.0} [bold]{--path}=/path/to/react/repo',
|
||
},
|
||
],
|
||
},
|
||
]);
|
||
console.log(usage);
|
||
process.exit(1);
|
||
}
|
||
|
||
return {
|
||
...params,
|
||
cwd: params.path, // For script convenience
|
||
};
|
||
};
|