mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01: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
34 lines
697 B
JavaScript
34 lines
697 B
JavaScript
#!/usr/bin/env node
|
|
|
|
'use strict';
|
|
|
|
const chalk = require('chalk');
|
|
const {exec} = require('child-process-promise');
|
|
const {logPromise} = require('../utils');
|
|
|
|
const runYarnTask = async (cwd, task, errorMessage) => {
|
|
try {
|
|
await exec(`yarn ${task}`, {cwd});
|
|
} catch (error) {
|
|
throw Error(
|
|
chalk`
|
|
${errorMessage}
|
|
|
|
{white ${error.stdout}}
|
|
`
|
|
);
|
|
}
|
|
};
|
|
|
|
module.exports = async ({cwd}) => {
|
|
await logPromise(runYarnTask(cwd, 'lint', 'Lint failed'), 'Running ESLint');
|
|
await logPromise(
|
|
runYarnTask(cwd, 'flow', 'Flow failed'),
|
|
'Running Flow checks'
|
|
);
|
|
await logPromise(
|
|
runYarnTask(cwd, 'jest', 'Jest failed'),
|
|
'Running Jest tests'
|
|
);
|
|
};
|