diff --git a/fixtures/concurrent/time-slicing/src/Clock.js b/fixtures/concurrent/time-slicing/src/Clock.js index 102bf9a33279..32f0da3b2665 100644 --- a/fixtures/concurrent/time-slicing/src/Clock.js +++ b/fixtures/concurrent/time-slicing/src/Clock.js @@ -64,9 +64,7 @@ export default class Clock extends PureComponent { } } - componentDidUpdate() { - console.log('componentDidUpdate()', this.faceRef.current); - } + componentDidUpdate() {} componentWillUnmount() { this.faceRef.current.removeEventListener('click', this.handleClick); diff --git a/fixtures/devtools/scheduling-profiler/run.js b/fixtures/devtools/scheduling-profiler/run.js index 9006956915ae..98eb7318207d 100755 --- a/fixtures/devtools/scheduling-profiler/run.js +++ b/fixtures/devtools/scheduling-profiler/run.js @@ -30,7 +30,6 @@ function initDependencies() { DEPENDENCIES.forEach(([from, to]) => { const fromPath = join(__dirname, BUILD_DIRECTORY, from); const toPath = join(__dirname, DEPENDENCIES_DIRECTORY, to); - console.log(`Copying ${fromPath} => ${toPath}`); copyFileSync(fromPath, toPath); }); } @@ -69,9 +68,7 @@ function initServer() { }; const server = http.createServer(requestListener); - server.listen(port, host, () => { - console.log(`Server is running on http://${host}:${port}`); - }); + server.listen(port, host, () => {}); } initDependencies(); diff --git a/fixtures/dom/public/renderer.js b/fixtures/dom/public/renderer.js index fa8eca8b632e..ef41bb286620 100644 --- a/fixtures/dom/public/renderer.js +++ b/fixtures/dom/public/renderer.js @@ -117,7 +117,6 @@ } function handleError(error) { - console.log(error); failed = true; setStatus('Javascript Error'); output.innerHTML = error; diff --git a/fixtures/fizz/scripts/build.js b/fixtures/fizz/scripts/build.js index 452f7c750f61..eb4334c2f219 100644 --- a/fixtures/fizz/scripts/build.js +++ b/fixtures/fizz/scripts/build.js @@ -43,11 +43,8 @@ webpack( } const info = stats.toJson(); if (stats.hasErrors()) { - console.log('Finished running webpack with errors.'); info.errors.forEach(e => console.error(e)); process.exit(1); - } else { - console.log('Finished running webpack.'); - } + } else {} } ); diff --git a/fixtures/fizz/server/server.js b/fixtures/fizz/server/server.js index 38519e574310..4bb2c166bc31 100644 --- a/fixtures/fizz/server/server.js +++ b/fixtures/fizz/server/server.js @@ -60,9 +60,7 @@ app.use(express.static('build')); app.use(express.static('public')); app - .listen(PORT, () => { - console.log(`Listening at ${PORT}...`); - }) + .listen(PORT, () => {}) .on('error', function(error) { if (error.syscall !== 'listen') { throw error; diff --git a/fixtures/flight/scripts/build.js b/fixtures/flight/scripts/build.js index 20d12bd2ed56..3131f7e8c6b0 100644 --- a/fixtures/flight/scripts/build.js +++ b/fixtures/flight/scripts/build.js @@ -70,23 +70,13 @@ checkBrowsers(paths.appPath, isInteractive) .then( ({stats, previousFileSizes, warnings}) => { if (warnings.length) { - console.log(chalk.yellow('Compiled with warnings.\n')); - console.log(warnings.join('\n\n')); - console.log( - '\nSearch for the ' + - chalk.underline(chalk.yellow('keywords')) + - ' to learn more about each warning.' - ); console.log( 'To ignore, add ' + chalk.cyan('// eslint-disable-next-line') + ' to the line before.\n' ); - } else { - console.log(chalk.green('Compiled successfully.\n')); - } + } else {} - console.log('File sizes after gzip:\n'); printFileSizesAfterBuild( stats, previousFileSizes, @@ -94,7 +84,6 @@ checkBrowsers(paths.appPath, isInteractive) WARN_AFTER_BUNDLE_GZIP_SIZE, WARN_AFTER_CHUNK_GZIP_SIZE ); - console.log(); const appPackage = require(paths.appPackageJson); const publicUrl = paths.publicUrlOrPath; @@ -111,30 +100,20 @@ checkBrowsers(paths.appPath, isInteractive) err => { const tscCompileOnError = process.env.TSC_COMPILE_ON_ERROR === 'true'; if (tscCompileOnError) { - console.log( - chalk.yellow( - 'Compiled with the following type errors (you may want to check these before deploying your app):\n' - ) - ); printBuildError(err); } else { - console.log(chalk.red('Failed to compile.\n')); printBuildError(err); process.exit(1); } } ) .catch(err => { - if (err && err.message) { - console.log(err.message); - } + if (err && err.message) {} process.exit(1); }); // Create the production build and print the deployment instructions. function build(previousFileSizes) { - console.log('Creating an optimized production build...'); - const compiler = webpack(config); return new Promise((resolve, reject) => { compiler.run((err, stats) => { @@ -181,12 +160,6 @@ function build(previousFileSizes) { w => !/Failed to parse source map/.test(w) ); if (filteredWarnings.length) { - console.log( - chalk.yellow( - '\nTreating warnings as errors because process.env.CI = true.\n' + - 'Most CI servers set it automatically.\n' - ) - ); return reject(new Error(filteredWarnings.join('\n\n'))); } } diff --git a/fixtures/flight/scripts/start.js b/fixtures/flight/scripts/start.js index 1473c3bff20a..1739ed763a36 100644 --- a/fixtures/flight/scripts/start.js +++ b/fixtures/flight/scripts/start.js @@ -47,22 +47,7 @@ if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) { const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000; const HOST = process.env.HOST || '0.0.0.0'; -if (process.env.HOST) { - console.log( - chalk.cyan( - `Attempting to bind to HOST environment variable: ${chalk.yellow( - chalk.bold(process.env.HOST) - )}` - ) - ); - console.log( - `If this was unintentional, check that you haven't mistakenly set it in your shell.` - ); - console.log( - `Learn more here: ${chalk.yellow('https://cra.link/advanced-config')}` - ); - console.log(); -} +if (process.env.HOST) {} // We require that you explicitly set browsers and do not fall back to // browserslist defaults. @@ -119,15 +104,8 @@ checkBrowsers(paths.appPath, isInteractive) clearConsole(); } - if (env.raw.FAST_REFRESH && semver.lt(react.version, '16.10.0')) { - console.log( - chalk.yellow( - `Fast Refresh requires React 16.10 or higher. You are using React ${react.version}.` - ) - ); - } + if (env.raw.FAST_REFRESH && semver.lt(react.version, '16.10.0')) {} - console.log(chalk.cyan('Starting the development server...\n')); openBrowser(urls.localUrlForBrowser); }); @@ -147,8 +125,6 @@ checkBrowsers(paths.appPath, isInteractive) } }) .catch(err => { - if (err && err.message) { - console.log(err.message); - } + if (err && err.message) {} process.exit(1); }); diff --git a/fixtures/flight/server/cli.server.js b/fixtures/flight/server/cli.server.js index 3b60f0579614..aa867acf5787 100644 --- a/fixtures/flight/server/cli.server.js +++ b/fixtures/flight/server/cli.server.js @@ -46,9 +46,7 @@ app.get('/todos', function(req, res) { ]); }); -app.listen(3001, () => { - console.log('Flight Server listening on port 3001...'); -}); +app.listen(3001, () => {}); app.on('error', function(error) { if (error.syscall !== 'listen') { diff --git a/fixtures/legacy-jsx-runtimes/lint-runtimes.js b/fixtures/legacy-jsx-runtimes/lint-runtimes.js index fb6584c572f7..0d8428424ca5 100644 --- a/fixtures/legacy-jsx-runtimes/lint-runtimes.js +++ b/fixtures/legacy-jsx-runtimes/lint-runtimes.js @@ -29,7 +29,6 @@ const esLints = { // Performs sanity checks on bundles *built* by Rollup. // Helps catch Rollup regressions. async function lint(folder) { - console.log(`Linting ` + folder); const eslint = esLints.cjs; const results = await eslint.lintFiles([ @@ -42,15 +41,12 @@ async function lint(folder) { results.some(result => result.errorCount > 0 || result.warningCount > 0) ) { process.exitCode = 1; - console.log(`Failed`); const formatter = await eslint.loadFormatter('stylish'); const resultText = formatter.format(results); - console.log(resultText); } } async function lintEverything() { - console.log(`Linting known bundles...`); await lint('react-14'); await lint('react-15'); await lint('react-16'); diff --git a/fixtures/nesting/src/legacy/Greeting.js b/fixtures/nesting/src/legacy/Greeting.js index 11bf3faf31c4..4696d2604188 100644 --- a/fixtures/nesting/src/legacy/Greeting.js +++ b/fixtures/nesting/src/legacy/Greeting.js @@ -8,9 +8,7 @@ import {store} from '../store'; import ThemeContext from './shared/ThemeContext'; import Clock from './shared/Clock'; -store.subscribe(() => { - console.log('Counter:', store.getState()); -}); +store.subscribe(() => {}); class AboutSection extends Component { componentDidMount() { diff --git a/fixtures/packaging/build-all.js b/fixtures/packaging/build-all.js index 62f7170b6196..2a51081644aa 100644 --- a/fixtures/packaging/build-all.js +++ b/fixtures/packaging/build-all.js @@ -38,11 +38,3 @@ fixtureDirs.forEach(dir => { } }); }); - -console.log('-------------------------'); -console.log('All fixtures were built!'); -console.log('Now ensure all frames display a welcome message:'); -console.log(' npm install -g serve'); -console.log(' serve ../..'); -console.log(' open http://localhost:5000/fixtures/packaging/'); -console.log('-------------------------'); diff --git a/fixtures/packaging/systemjs-builder/dev/build.js b/fixtures/packaging/systemjs-builder/dev/build.js index d476c09a6462..485ff085aa19 100644 --- a/fixtures/packaging/systemjs-builder/dev/build.js +++ b/fixtures/packaging/systemjs-builder/dev/build.js @@ -3,10 +3,7 @@ var Builder = require('systemjs-builder'); var builder = new Builder('/', './config.js'); builder .buildStatic('./input.js', './output.js') - .then(function() { - console.log('Build complete'); - }) + .then(function() {}) .catch(function(err) { - console.log('Build error'); - console.log(err); - }); + console.log(err); +}); diff --git a/fixtures/packaging/systemjs-builder/prod/build.js b/fixtures/packaging/systemjs-builder/prod/build.js index d476c09a6462..485ff085aa19 100644 --- a/fixtures/packaging/systemjs-builder/prod/build.js +++ b/fixtures/packaging/systemjs-builder/prod/build.js @@ -3,10 +3,7 @@ var Builder = require('systemjs-builder'); var builder = new Builder('/', './config.js'); builder .buildStatic('./input.js', './output.js') - .then(function() { - console.log('Build complete'); - }) + .then(function() {}) .catch(function(err) { - console.log('Build error'); - console.log(err); - }); + console.log(err); +}); diff --git a/fixtures/ssr/server/index.js b/fixtures/ssr/server/index.js index 2b41c6d9fdeb..6ee00d5c7ad2 100644 --- a/fixtures/ssr/server/index.js +++ b/fixtures/ssr/server/index.js @@ -44,9 +44,7 @@ if (process.env.NODE_ENV === 'development') { ); } -app.listen(3000, () => { - console.log('Listening on port 3000...'); -}); +app.listen(3000, () => {}); app.on('error', function(error) { if (error.syscall !== 'listen') { diff --git a/fixtures/ssr2/scripts/build.js b/fixtures/ssr2/scripts/build.js index 452f7c750f61..eb4334c2f219 100644 --- a/fixtures/ssr2/scripts/build.js +++ b/fixtures/ssr2/scripts/build.js @@ -43,11 +43,8 @@ webpack( } const info = stats.toJson(); if (stats.hasErrors()) { - console.log('Finished running webpack with errors.'); info.errors.forEach(e => console.error(e)); process.exit(1); - } else { - console.log('Finished running webpack.'); - } + } else {} } ); diff --git a/fixtures/ssr2/server/server.js b/fixtures/ssr2/server/server.js index 027c46379ccf..589b406cd5b2 100644 --- a/fixtures/ssr2/server/server.js +++ b/fixtures/ssr2/server/server.js @@ -47,9 +47,7 @@ app.use(express.static('build')); app.use(express.static('public')); app - .listen(PORT, () => { - console.log(`Listening at ${PORT}...`); - }) + .listen(PORT, () => {}) .on('error', function(error) { if (error.syscall !== 'listen') { throw error; diff --git a/fixtures/stacks/Example.js b/fixtures/stacks/Example.js index 3ea0ba14c489..e00db21513fd 100644 --- a/fixtures/stacks/Example.js +++ b/fixtures/stacks/Example.js @@ -10,7 +10,6 @@ class ErrorBoundary extends React.Component { } componentDidCatch(error, errorInfo) { - console.log(error.message, errorInfo.componentStack); this.setState({ componentStack: errorInfo.componentStack, }); diff --git a/packages/react-devtools-extensions/chrome/build.js b/packages/react-devtools-extensions/chrome/build.js index 1cadb6c824fb..7378404c4e6b 100644 --- a/packages/react-devtools-extensions/chrome/build.js +++ b/packages/react-devtools-extensions/chrome/build.js @@ -46,11 +46,6 @@ const main = async () => { } ); } - - console.log(chalk.green('\nThe Chrome extension has been built!')); - console.log(chalk.green('You can test this build by running:')); - console.log(chalk.gray('\n# From the react-devtools root directory:')); - console.log('yarn run test:chrome'); }; main(); diff --git a/packages/react-devtools-extensions/deploy.js b/packages/react-devtools-extensions/deploy.js index c9bfdaf6af73..b6e76fd70565 100644 --- a/packages/react-devtools-extensions/deploy.js +++ b/packages/react-devtools-extensions/deploy.js @@ -51,8 +51,6 @@ const main = async buildId => { cwd: buildPath, stdio: 'inherit', }); - - console.log(`Deployed to https://${alias}.now.sh`); }; module.exports = main; diff --git a/packages/react-devtools-extensions/edge/build.js b/packages/react-devtools-extensions/edge/build.js index 21fa6e5383c2..00d37d547bef 100644 --- a/packages/react-devtools-extensions/edge/build.js +++ b/packages/react-devtools-extensions/edge/build.js @@ -29,18 +29,6 @@ const main = async () => { cwd, }); } - - console.log(chalk.green('\nThe Microsoft Edge extension has been built!')); - - console.log(chalk.green('\nTo load this extension:')); - console.log(chalk.yellow('Navigate to edge://extensions/')); - console.log(chalk.yellow('Enable "Developer mode"')); - console.log(chalk.yellow('Click "LOAD UNPACKED"')); - console.log(chalk.yellow('Select extension folder - ' + cwd + '\\unpacked')); - - console.log(chalk.green('\nYou can test this build by running:')); - console.log(chalk.gray('\n# From the react-devtools root directory:')); - console.log('yarn run test:edge\n'); }; main(); diff --git a/packages/react-devtools-extensions/firefox/build.js b/packages/react-devtools-extensions/firefox/build.js index 65cd0187c097..f8b0331c5d34 100644 --- a/packages/react-devtools-extensions/firefox/build.js +++ b/packages/react-devtools-extensions/firefox/build.js @@ -7,29 +7,6 @@ const build = require('../build'); const main = async () => { await build('firefox'); - - console.log(chalk.green('\nThe Firefox extension has been built!')); - console.log(chalk.green('You can test this build by running:')); - console.log(chalk.gray('\n# From the react-devtools root directory:')); - console.log('yarn run test:firefox'); - console.log( - chalk.gray('\n# You can also test against upcoming Firefox releases.') - ); - console.log( - chalk.gray( - '# First download a release from https://www.mozilla.org/en-US/firefox/channel/desktop/' - ) - ); - console.log( - chalk.gray( - '# And then tell web-ext which release to use (eg firefoxdeveloperedition, nightly, beta):' - ) - ); - console.log('WEB_EXT_FIREFOX=nightly yarn run test:firefox'); - console.log(chalk.gray('\n# You can test against older versions too:')); - console.log( - 'WEB_EXT_FIREFOX=/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox-bin yarn run test:firefox' - ); }; main(); diff --git a/packages/react-devtools-extensions/src/main.js b/packages/react-devtools-extensions/src/main.js index 69f5c21e7962..3b2b3f38a771 100644 --- a/packages/react-devtools-extensions/src/main.js +++ b/packages/react-devtools-extensions/src/main.js @@ -272,36 +272,21 @@ function createPanelIfReactLoaded() { if (__DEBUG__) { debugID = debugIDCounter++; - console.log(`[main] fetchFromNetworkCache(${debugID})`, url); } chrome.devtools.network.getHAR(harLog => { for (let i = 0; i < harLog.entries.length; i++) { const entry = harLog.entries[i]; if (url === entry.request.url) { - if (__DEBUG__) { - console.log( - `[main] fetchFromNetworkCache(${debugID}) Found matching URL in HAR`, - url, - ); - } + if (__DEBUG__) {} entry.getContent(content => { if (content) { - if (__DEBUG__) { - console.log( - `[main] fetchFromNetworkCache(${debugID}) Content retrieved`, - ); - } + if (__DEBUG__) {} resolve(content); } else { - if (__DEBUG__) { - console.log( - `[main] fetchFromNetworkCache(${debugID}) Invalid content returned by getContent()`, - content, - ); - } + if (__DEBUG__) {} // Edge case where getContent() returned null; fall back to fetch. fetchFromPage(url, resolve, reject); @@ -312,11 +297,7 @@ function createPanelIfReactLoaded() { } } - if (__DEBUG__) { - console.log( - `[main] fetchFromNetworkCache(${debugID}) No cached request found in getHAR()`, - ); - } + if (__DEBUG__) {} // No matching URL found; fall back to fetch. fetchFromPage(url, resolve, reject); @@ -324,9 +305,7 @@ function createPanelIfReactLoaded() { }; const fetchFromPage = (url, resolve, reject) => { - if (__DEBUG__) { - console.log('[main] fetchFromPage()', url); - } + if (__DEBUG__) {} function onPortMessage({payload, source}) { if (source === 'react-devtools-content-script') { diff --git a/packages/react-devtools-shared/src/__tests__/console-test.js b/packages/react-devtools-shared/src/__tests__/console-test.js index 407150b5e39b..583b9ce7180b 100644 --- a/packages/react-devtools-shared/src/__tests__/console-test.js +++ b/packages/react-devtools-shared/src/__tests__/console-test.js @@ -580,10 +580,6 @@ describe('console', () => { const root = ReactDOMClient.createRoot(container); function App() { - console.log( - 'CALL', - global.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__, - ); fakeConsole.log('log'); fakeConsole.warn('warn'); fakeConsole.error('error'); diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js index ec547d8cbaa8..4a817718fa87 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js @@ -1227,7 +1227,7 @@ describe('ReactDOMComponent', () => { console.log('onError called')} + onError={e => {}} /> , container, @@ -1478,8 +1478,8 @@ describe('ReactDOMComponent', () => { console.log('onError called')} - onLoad={e => console.log('onLoad called')} + onError={e => {}} + onLoad={e => {}} /> , container, diff --git a/packages/react-dom/src/__tests__/ReactServerRendering-test.js b/packages/react-dom/src/__tests__/ReactServerRendering-test.js index c22846fa637f..ba9813243feb 100644 --- a/packages/react-dom/src/__tests__/ReactServerRendering-test.js +++ b/packages/react-dom/src/__tests__/ReactServerRendering-test.js @@ -1154,7 +1154,7 @@ describe('ReactDOMServer', () => { it('Function properties should not be server rendered for custom elements', () => { const output = ReactDOMServer.renderToString( - console.log('bar')} />, + {}} />, ); expect(output).toBe(``); }); diff --git a/packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js b/packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js index 5465d1f33d36..1b86fa9054a3 100644 --- a/packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js +++ b/packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js @@ -86,14 +86,8 @@ module.exports = function(initModules) { } } if (filteredWarnings.length !== count) { - console.log( - `We expected ${count} warning(s), but saw ${filteredWarnings.length} warning(s).`, - ); if (filteredWarnings.length > 0) { - console.log(`We saw these warnings:`); - for (let i = 0; i < filteredWarnings.length; i++) { - console.log(...filteredWarnings[i]); - } + for (let i = 0; i < filteredWarnings.length; i++) {} } if (__DEV__) { expect(console.error).toHaveBeenCalledTimes(count); diff --git a/packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js b/packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js index eccdef295ad8..16d9be187ae0 100644 --- a/packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js +++ b/packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js @@ -101,12 +101,10 @@ describe('DebugTracing', () => { // @gate experimental && build === 'development' && enableDebugTracing && enableCPUSuspense it('should log sync render with CPU suspense', () => { function Example() { - console.log(''); return null; } function Wrapper({children}) { - console.log(''); return children; } @@ -181,12 +179,10 @@ describe('DebugTracing', () => { // @gate experimental && build === 'development' && enableDebugTracing && enableCPUSuspense it('should log concurrent render with CPU suspense', () => { function Example() { - console.log(''); return null; } function Wrapper({children}) { - console.log(''); return children; } @@ -355,7 +351,6 @@ describe('DebugTracing', () => { // @gate experimental && build === 'development' && enableDebugTracing it('should log when user code logs', () => { function Example() { - console.log('Hello from user code'); return null; } diff --git a/packages/react/src/__tests__/ReactStrictMode-test.js b/packages/react/src/__tests__/ReactStrictMode-test.js index 8aebe33426a0..774705ea2569 100644 --- a/packages/react/src/__tests__/ReactStrictMode-test.js +++ b/packages/react/src/__tests__/ReactStrictMode-test.js @@ -893,7 +893,6 @@ describe('context legacy', () => { class Foo extends React.Component { render() { count++; - console.log('foo ' + count); return null; } } @@ -922,7 +921,6 @@ describe('context legacy', () => { constructor(props) { super(props); count++; - console.log('foo ' + count); } render() { return null; @@ -953,7 +951,6 @@ describe('context legacy', () => { state = {}; static getDerivedStateFromProps() { count++; - console.log('foo ' + count); return {}; } render() { @@ -985,7 +982,6 @@ describe('context legacy', () => { state = {}; shouldComponentUpdate() { count++; - console.log('foo ' + count); return {}; } render() { @@ -1038,7 +1034,6 @@ describe('context legacy', () => { ); inst.setState(() => { count++; - console.log('foo ' + count); return {}; }); @@ -1056,7 +1051,6 @@ describe('context legacy', () => { let count = 0; function Foo() { count++; - console.log('foo ' + count); return null; } @@ -1083,7 +1077,6 @@ describe('context legacy', () => { class Foo extends React.Component { render() { count++; - console.log('foo ' + count); return null; } } @@ -1112,7 +1105,6 @@ describe('context legacy', () => { constructor(props) { super(props); count++; - console.log('foo ' + count); } render() { return null; @@ -1143,7 +1135,6 @@ describe('context legacy', () => { state = {}; static getDerivedStateFromProps() { count++; - console.log('foo ' + count); return {}; } render() { @@ -1175,7 +1166,6 @@ describe('context legacy', () => { state = {}; shouldComponentUpdate() { count++; - console.log('foo ' + count); return {}; } render() { @@ -1228,7 +1218,6 @@ describe('context legacy', () => { ); inst.setState(() => { count++; - console.log('foo ' + count); return {}; }); @@ -1246,7 +1235,6 @@ describe('context legacy', () => { let count = 0; function Foo() { count++; - console.log('foo ' + count); return null; } diff --git a/scripts/bench/runner.js b/scripts/bench/runner.js index 922e914d4ea2..4ed7481b2bb6 100644 --- a/scripts/bench/runner.js +++ b/scripts/bench/runner.js @@ -43,13 +43,7 @@ async function runBenchmarks(reactPath) { !benchmarkFilter || (benchmarkFilter && benchmarkName.indexOf(benchmarkFilter) !== -1) ) { - console.log( - chalk.gray(`- Building benchmark "${chalk.white(benchmarkName)}"...`) - ); await buildBenchmark(reactPath, benchmarkName); - console.log( - chalk.gray(`- Running benchmark "${chalk.white(benchmarkName)}"...`) - ); results[benchmarkName] = await runBenchmark(benchmarkName, headless); } } @@ -63,14 +57,10 @@ async function runBenchmarks(reactPath) { // get the performance benchmark results // from remote main (default React repo) async function benchmarkRemoteMaster() { - console.log(chalk.gray(`- Building React bundles...`)); let commit = argv.remote; if (!commit || typeof commit !== 'string') { commit = await getMergeBaseFromLocalGitRepo(join(__dirname, '..', '..')); - console.log( - chalk.gray(`- Merge base commit ${chalk.white(commit.tostrS())}`) - ); } await buildBenchmarkBundlesFromGitRepo(commit, skipBuild); return { @@ -81,7 +71,6 @@ async function benchmarkRemoteMaster() { // get the performance benchmark results // of the local react repo async function benchmarkLocal(reactPath) { - console.log(chalk.gray(`- Building React bundles...`)); await buildReactBundles(reactPath, skipBuild); return { benchmarks: await runBenchmarks(reactPath), @@ -89,10 +78,6 @@ async function benchmarkLocal(reactPath) { } async function runLocalBenchmarks(showResults) { - console.log( - chalk.white.bold('Running benchmarks for ') + - chalk.green.bold('Local (Current Branch)') - ); const localResults = await benchmarkLocal(join(__dirname, '..', '..')); if (showResults) { @@ -102,10 +87,6 @@ async function runLocalBenchmarks(showResults) { } async function runRemoteBenchmarks(showResults) { - console.log( - chalk.white.bold('Running benchmarks for ') + - chalk.yellow.bold('Remote (Merge Base)') - ); const remoteMasterResults = await benchmarkRemoteMaster(); if (showResults) { @@ -115,12 +96,6 @@ async function runRemoteBenchmarks(showResults) { } async function compareLocalToMaster() { - console.log( - chalk.white.bold('Comparing ') + - chalk.green.bold('Local (Current Branch)') + - chalk.white.bold(' to ') + - chalk.yellow.bold('Remote (Merge Base)') - ); const localResults = await runLocalBenchmarks(false); const remoteMasterResults = await runRemoteBenchmarks(false); printResults(localResults, remoteMasterResults); diff --git a/scripts/bench/stats.js b/scripts/bench/stats.js index 9fb5883d8324..9b1db735c699 100644 --- a/scripts/bench/stats.js +++ b/scripts/bench/stats.js @@ -106,7 +106,6 @@ function printResults(localResults, remoteMasterResults) { } const table = new Table({head}); addBenchmarkResults(table, localResults, remoteMasterResults); - console.log(table.toString()); } module.exports = printResults; diff --git a/scripts/circleci/download_devtools_regression_build.js b/scripts/circleci/download_devtools_regression_build.js index 01ef377094cc..7d2db244480a 100755 --- a/scripts/circleci/download_devtools_regression_build.js +++ b/scripts/circleci/download_devtools_regression_build.js @@ -23,15 +23,6 @@ const version = process.argv[2]; const shouldReplaceBuild = !!argv.replaceBuild; async function downloadRegressionBuild() { - console.log(chalk.bold.white(`Downloading React v${version}\n`)); - - // Make build directory for temporary modules we're going to download - // from NPM - console.log( - chalk.white( - `Make Build directory at ${chalk.underline.blue(regressionBuildPath)}\n` - ) - ); await exec(`mkdir ${regressionBuildPath}`); // Install all necessary React packages that have the same version @@ -55,14 +46,6 @@ async function downloadRegressionBuild() { (str, name) => `${str} ${join(buildPath, name)}`, '' ); - console.log( - chalk.white( - `Removing ${removePackagesStr - .split(' ') - .map(str => chalk.underline.blue(str) + '\n') - .join(' ')}\n` - ) - ); await exec(`rm -r ${removePackagesStr}`); // Move all packages that we downloaded to the original build folder @@ -72,14 +55,6 @@ async function downloadRegressionBuild() { (str, name) => `${str} ${join(regressionBuildPath, 'node_modules', name)}`, '' ); - console.log( - chalk.white( - `Moving ${movePackageString - .split(' ') - .map(str => chalk.underline.blue(str) + '\n') - .join(' ')} to ${chalk.underline.blue(buildPath)}\n` - ) - ); await exec(`mv ${movePackageString} ${buildPath}`); // For React versions earlier than 18.0.0, we explicitly scheduler v0.20.1, which @@ -93,12 +68,10 @@ async function downloadRegressionBuild() { // In v16.5, scheduler is called schedule. We need to make sure we also move // this over. Otherwise the code will break. if (fs.existsSync(join(regressionBuildPath, 'node_modules', 'schedule'))) { - console.log(chalk.white(`Downloading schedule\n`)); await exec( `mv ${join(regressionBuildPath, 'node_modules', 'schedule')} ${buildPath}` ); } else { - console.log(chalk.white(`Downloading scheduler\n`)); await exec(`rm -r ${join(buildPath, 'scheduler')}`); await exec( `mv ${join( @@ -113,7 +86,6 @@ async function downloadRegressionBuild() { async function main() { try { if (!version) { - console.log(chalk.red('Must specify React version to download')); return; } await downloadRegressionBuild(); @@ -123,7 +95,6 @@ async function main() { // We shouldn't remove the regression-build folder unless we're using // it to replace the build folder if (shouldReplaceBuild) { - console.log(chalk.bold.white(`Removing regression build`)); await exec(`rm -r ${regressionBuildPath}`); } } diff --git a/scripts/circleci/run_devtools_e2e_tests.js b/scripts/circleci/run_devtools_e2e_tests.js index 3ae98c42c54f..203259c18c07 100755 --- a/scripts/circleci/run_devtools_e2e_tests.js +++ b/scripts/circleci/run_devtools_e2e_tests.js @@ -25,15 +25,11 @@ function format(loggable) { .join('\n'); } -function logBright(loggable) { - console.log(`\x1b[1m${loggable}\x1b[0m`); -} +function logBright(loggable) {} function logDim(loggable) { const formatted = format(loggable, 2); - if (formatted !== '') { - console.log(`\x1b[2m${formatted}\x1b[0m`); - } + if (formatted !== '') {} } function logError(loggable) { @@ -129,9 +125,7 @@ async function runEndToEndTests() { testProcess.stdout.on('data', data => { // Log without formatting because Playwright applies its own formatting. const formatted = format(data); - if (formatted !== '') { - console.log(formatted); - } + if (formatted !== '') {} }); testProcess.stderr.on('data', data => { // Log without formatting because Playwright applies its own formatting. diff --git a/scripts/devtools/build-and-test.js b/scripts/devtools/build-and-test.js index 3c2f493ddd90..11b230e07ed0 100755 --- a/scripts/devtools/build-and-test.js +++ b/scripts/devtools/build-and-test.js @@ -24,29 +24,13 @@ async function main() { await confirm('Have you stopped all NPM DEV scripts?', () => { const packagesPath = relative(process.cwd(), join(__dirname, 'packages')); - console.log('Stop all NPM DEV scripts in the following directories:'); - console.log( - chalk.bold(' ' + join(packagesPath, 'react-devtools-core')), - chalk.gray('(start:backend, start:standalone)') - ); - console.log( - chalk.bold(' ' + join(packagesPath, 'react-devtools-inline')), - chalk.gray('(start)') - ); - const buildAndTestScriptPath = join(__dirname, 'build-and-test.js'); const pathToPrint = relative(process.cwd(), buildAndTestScriptPath); - - console.log('\nThen restart this release step:'); - console.log(chalk.bold.green(' ' + pathToPrint)); }); await confirm('Have you run the prepare-release script?', () => { const prepareReleaseScriptPath = join(__dirname, 'prepare-release.js'); const pathToPrint = relative(process.cwd(), prepareReleaseScriptPath); - - console.log('Begin by running the prepare-release script:'); - console.log(chalk.bold.green(' ' + pathToPrint)); }); const archivePath = await archiveGitRevision(); @@ -65,9 +49,6 @@ async function archiveGitRevision() { const desktopPath = join(homedir(), 'Desktop'); const archivePath = join(desktopPath, 'DevTools.tgz'); - console.log(`Creating git archive at ${chalk.dim(archivePath)}`); - console.log(''); - if (!DRY_RUN) { await exec(`git archive main | gzip > ${archivePath}`, {cwd: ROOT_PATH}); } @@ -93,21 +74,6 @@ async function buildAndTestExtensions() { } ); - console.log(''); - console.log(`Extensions have been build for Chrome, Edge, and Firefox.`); - console.log(''); - console.log('Smoke test each extension before continuing:'); - console.log(` ${chalk.bold.green('cd ' + extensionsPackagePath)}`); - console.log(''); - console.log(` ${chalk.dim('# Test Chrome extension')}`); - console.log(` ${chalk.bold.green('yarn test:chrome')}`); - console.log(''); - console.log(` ${chalk.dim('# Test Edge extension')}`); - console.log(` ${chalk.bold.green('yarn test:edge')}`); - console.log(''); - console.log(` ${chalk.dim('# Firefox Chrome extension')}`); - console.log(` ${chalk.bold.green('yarn test:firefox')}`); - await confirmContinue(); } @@ -135,18 +101,6 @@ async function buildAndTestStandalonePackage() { 'index.html' ); - console.log(''); - console.log( - `Test the ${chalk.bold('react-devtools-core')} target before continuing:` - ); - console.log(` ${chalk.bold.green('cd ' + standalonePackagePath)}`); - console.log(` ${chalk.bold.green('yarn start')}`); - console.log(''); - console.log( - 'The following fixture can be useful for testing Safari integration:' - ); - console.log(` ${chalk.dim(safariFixturePath)}`); - await confirmContinue(); } @@ -171,13 +125,6 @@ async function buildAndTestInlinePackage() { const shellPackagePath = join(ROOT_PATH, 'packages', 'react-devtools-shell'); - console.log(''); - console.log(`Built ${chalk.bold('react-devtools-inline')} target.`); - console.log(''); - console.log('Test this build before continuing:'); - console.log(` ${chalk.bold.green('cd ' + shellPackagePath)}`); - console.log(` ${chalk.bold.green('yarn start')}`); - await confirmContinue(); } @@ -195,8 +142,6 @@ async function downloadLatestReactBuild() { } ); - console.log(''); - const {commit} = await inquirer.prompt([ { type: 'input', @@ -205,7 +150,6 @@ async function downloadLatestReactBuild() { default: 'main', }, ]); - console.log(''); const downloadScriptPath = join( releaseScriptPath, @@ -229,19 +173,12 @@ async function downloadLatestReactBuild() { const buildID = match[1]; - console.log(''); - console.log(`Downloaded artifacts for CI build ${chalk.bold(buildID)}.`); - return buildID; } function printFinalInstructions() { const publishReleaseScriptPath = join(__dirname, 'publish-release.js'); const pathToPrint = relative(process.cwd(), publishReleaseScriptPath); - - console.log(''); - console.log('Continue by running the publish-release script:'); - console.log(chalk.bold.green(' ' + pathToPrint)); } main(); diff --git a/scripts/devtools/prepare-release.js b/scripts/devtools/prepare-release.js index 6b1f67f533b7..df12af877571 100755 --- a/scripts/devtools/prepare-release.js +++ b/scripts/devtools/prepare-release.js @@ -34,13 +34,6 @@ async function main() { const sha = await getPreviousCommitSha(); const [shortCommitLog, formattedCommitLog] = await getCommitLog(sha); - console.log(''); - console.log( - 'This release includes the following commits:', - chalk.gray(shortCommitLog) - ); - console.log(''); - const releaseType = await getReleaseType(); const path = join(ROOT_PATH, PACKAGE_PATHS[0]); @@ -58,29 +51,12 @@ async function main() { updatePackageVersions(previousVersion, nextVersion); updateManifestVersions(previousVersion, nextVersion); - console.log(''); - console.log( - `Packages and manifests have been updated from version ${chalk.bold( - previousVersion - )} to ${chalk.bold(nextVersion)}` - ); - console.log(''); - await commitPendingChanges(previousVersion, nextVersion); printFinalInstructions(); } async function commitPendingChanges(previousVersion, nextVersion) { - console.log(''); - console.log('Committing revision and changelog.'); - console.log(chalk.dim(' git add .')); - console.log( - chalk.dim( - ` git commit -m "React DevTools ${previousVersion} -> ${nextVersion}"` - ) - ); - if (!DRY_RUN) { await exec(` git add . @@ -88,10 +64,6 @@ async function commitPendingChanges(previousVersion, nextVersion) { `); } - console.log(''); - console.log(`Please push this commit before continuing:`); - console.log(` ${chalk.bold.green('git push')}`); - await confirmContinue(); } @@ -195,29 +167,9 @@ async function getReleaseType() { function printFinalInstructions() { const buildAndTestcriptPath = join(__dirname, 'build-and-test.js'); const pathToPrint = relative(process.cwd(), buildAndTestcriptPath); - - console.log(''); - console.log('Continue by running the build-and-test script:'); - console.log(chalk.bold.green(' ' + pathToPrint)); } async function reviewChangelogPrompt() { - console.log(''); - console.log( - 'The changelog has been updated with commits since the previous release:' - ); - console.log(` ${chalk.bold(CHANGELOG_PATH)}`); - console.log(''); - console.log('Please review the new changelog text for the following:'); - console.log(' 1. Organize the list into Features vs Bugfixes'); - console.log(' 1. Filter out any non-user-visible changes (e.g. typo fixes)'); - console.log(' 1. Combine related PRs into a single bullet list.'); - console.log( - ' 1. Replacing the "USERNAME" placeholder text with the GitHub username(s)' - ); - console.log(''); - console.log(` ${chalk.bold.green(`open ${CHANGELOG_PATH}`)}`); - await confirmContinue(); } @@ -236,8 +188,6 @@ function updateChangelog(nextVersion, commitLog) { const newChangelog = `${beginning}${RELEASE_SCRIPT_TOKEN}\n\n${header}\n${commitLog}${end}`; - console.log(chalk.dim(' Updating changelog: ' + CHANGELOG_PATH)); - if (!DRY_RUN) { writeFileSync(path, newChangelog); } @@ -253,8 +203,6 @@ function updateManifestVersions(previousVersion, nextVersion) { json.version_name = nextVersion; } - console.log(chalk.dim(' Updating manifest JSON: ' + partialPath)); - if (!DRY_RUN) { writeJsonSync(path, json, {spaces: 2}); } @@ -275,8 +223,6 @@ function updatePackageVersions(previousVersion, nextVersion) { } } - console.log(chalk.dim(' Updating package JSON: ' + partialPath)); - if (!DRY_RUN) { writeJsonSync(path, json, {spaces: 2}); } diff --git a/scripts/devtools/publish-release.js b/scripts/devtools/publish-release.js index 5fcfe89cb7ef..0d065984bfa3 100755 --- a/scripts/devtools/publish-release.js +++ b/scripts/devtools/publish-release.js @@ -24,9 +24,6 @@ async function main() { await confirm('Have you run the build-and-test script?', () => { const buildAndTestScriptPath = join(__dirname, 'build-and-test.js'); const pathToPrint = relative(process.cwd(), buildAndTestScriptPath); - - console.log('Begin by running the build-and-test script:'); - console.log(chalk.bold.green(' ' + pathToPrint)); }); const {archivePath, buildID} = readSavedBuildMetadata(); @@ -38,24 +35,7 @@ async function main() { await printFinalInstructions(buildID, archivePath); } -async function printFinalInstructions(buildID, archivePath) { - console.log(''); - console.log( - 'You are now ready to publish the extension to Chrome, Edge, and Firefox:' - ); - console.log( - ` ${chalk.blue.underline( - 'https://fburl.com/publish-react-devtools-extensions' - )}` - ); - console.log(''); - console.log('When publishing to Firefox, remember the following:'); - console.log(` Build id: ${chalk.bold(buildID)}`); - console.log(` Git archive: ${chalk.bold(archivePath)}`); - console.log(''); - console.log('Also consider syncing this release to Facebook:'); - console.log(` ${chalk.bold.green('js1 upgrade react-devtools')}`); -} +async function printFinalInstructions(buildID, archivePath) {} async function publishToNPM() { const {otp} = await inquirer.prompt([ @@ -66,8 +46,6 @@ async function publishToNPM() { }, ]); - console.log(''); - if (!otp) { console.error(chalk.red(`Invalid OTP provided: "${chalk.bold(otp)}"`)); process.exit(0); @@ -84,20 +62,10 @@ async function publishToNPM() { // But for now the easiest way is just to ask if this is expected. const info = await execRead(`npm view ${npmPackage}@${version}`); if (info) { - console.log(''); - console.log( - `${npmPackage} version ${chalk.bold( - version - )} has already been published.` - ); - await confirm('Is this expected?'); } - if (DRY_RUN) { - console.log(`Publishing package ${chalk.bold(npmPackage)}`); - console.log(chalk.dim(` npm publish --otp=${otp}`)); - } else { + if (DRY_RUN) {} else { const publishPromise = exec(`npm publish --otp=${otp}`, { cwd: packagePath, }); diff --git a/scripts/devtools/utils.js b/scripts/devtools/utils.js index 17d0c1f40eb3..09ae50d77e87 100644 --- a/scripts/devtools/utils.js +++ b/scripts/devtools/utils.js @@ -37,8 +37,6 @@ async function checkNPMPermissions() { {estimate: 2500} ); - console.log(''); - if (failedProjects.length) { console.error(chalk.red.bold('Insufficient NPM permissions')); console.error(''); @@ -63,16 +61,12 @@ function clear() { } async function confirm(message, exitFunction) { - console.log(''); - const {confirmation} = await inquirer.prompt({ name: 'confirmation', type: 'confirm', message, }); - console.log(''); - if (!confirmation) { if (typeof exitFunction === 'function') { exitFunction(); diff --git a/scripts/error-codes/extract-errors.js b/scripts/error-codes/extract-errors.js index addb095b4ca1..c35a3c7ff10c 100644 --- a/scripts/error-codes/extract-errors.js +++ b/scripts/error-codes/extract-errors.js @@ -21,8 +21,6 @@ async function main() { } } - console.log('Searching `build` directory for unminified errors...\n'); - let out; try { out = execSync( @@ -54,7 +52,6 @@ async function main() { if (newJSON === null) { newJSON = Object.assign({}, originalJSON); } - console.log(`"${nextCode}": "${message}"`); newJSON[nextCode] = message; nextCode += 1; } diff --git a/scripts/eslint/index.js b/scripts/eslint/index.js index 2fd2730ba73f..1781d79de576 100644 --- a/scripts/eslint/index.js +++ b/scripts/eslint/index.js @@ -81,7 +81,6 @@ async function runESLint({onlyChanged, ...options}) { onlyChanged, options ); - console.log(output); return errorCount === 0 && warningCount === 0; } diff --git a/scripts/flow/createFlowConfigs.js b/scripts/flow/createFlowConfigs.js index 62a54d11122a..5b2b1a4c2b00 100644 --- a/scripts/flow/createFlowConfigs.js +++ b/scripts/flow/createFlowConfigs.js @@ -81,7 +81,6 @@ ${disclaimer} if (newConfig !== oldConfig) { fs.writeFileSync(configFile, newConfig); - console.log(chalk.dim('Wrote a Flow config to ' + configFile)); } } diff --git a/scripts/flow/runFlow.js b/scripts/flow/runFlow.js index 07b0717e6f37..01da77157508 100644 --- a/scripts/flow/runFlow.js +++ b/scripts/flow/runFlow.js @@ -60,10 +60,6 @@ async function runFlow(renderer, args) { fs.utimesSync(destPath, srcStat.atime, srcStat.mtime); } - console.log( - 'Running Flow on the ' + chalk.yellow(renderer) + ' renderer...', - ); - spawn(cmd, args, { // Allow colors to pass through: stdio: 'inherit', @@ -72,12 +68,8 @@ async function runFlow(renderer, args) { console.error( 'Flow failed for the ' + chalk.red(renderer) + ' renderer', ); - console.log(); process.exit(code); } else { - console.log( - 'Flow passed for the ' + chalk.green(renderer) + ' renderer', - ); resolve(); } }); diff --git a/scripts/jest/jest-cli.js b/scripts/jest/jest-cli.js index 4aaf59ba728f..c4d5127b4e95 100644 --- a/scripts/jest/jest-cli.js +++ b/scripts/jest/jest-cli.js @@ -266,7 +266,6 @@ function validateOptions() { } if (!success) { - console.log(''); // Extra newline. process.exit(1); } } @@ -350,7 +349,6 @@ function getEnvars() { function main() { if (argv.deprecated) { - console.log(chalk.red(`\nPlease run: \`${argv.deprecated}\` instead.\n`)); return; } @@ -362,21 +360,10 @@ function main() { // Print the full command we're actually running. const command = `$ ${env.join(' ')} node ${args.join(' ')}`; - console.log(chalk.dim(command)); - - // Print the release channel and project we're running for quick confirmation. - console.log( - chalk.blue( - `\nRunning tests for ${argv.project} (${argv.releaseChannel})...` - ) - ); // Print a message that the debugger is starting just // for some extra feedback when running the debugger. - if (argv.debug) { - console.log(chalk.green('\nStarting debugger...')); - console.log(chalk.green('Open chrome://inspect and press "inspect"\n')); - } + if (argv.debug) {} // Run Jest. const jest = spawn('node', args, { diff --git a/scripts/jest/spec-equivalence-reporter/setupTests.js b/scripts/jest/spec-equivalence-reporter/setupTests.js index 7d6989d14635..4f9c0db62750 100644 --- a/scripts/jest/spec-equivalence-reporter/setupTests.js +++ b/scripts/jest/spec-equivalence-reporter/setupTests.js @@ -54,11 +54,5 @@ expect.extend({ beforeEach(() => (numExpectations = 0)); jasmine.currentEnv_.addReporter({ - specDone: spec => { - console.log( - `EQUIVALENCE: ${spec.description}, ` + - `status: ${spec.status}, ` + - `numExpectations: ${numExpectations}` - ); - }, + specDone: spec => {}, }); diff --git a/scripts/merge-fork/replace-fork.js b/scripts/merge-fork/replace-fork.js index 8369d271bb2b..701d049a3edb 100644 --- a/scripts/merge-fork/replace-fork.js +++ b/scripts/merge-fork/replace-fork.js @@ -41,7 +41,6 @@ async function main() { resolve(); break; default: - console.log('No modifications were made.'); process.exit(0); break; } @@ -58,9 +57,6 @@ async function main() { stdio: ['inherit', 'inherit', 'pipe'], }); if (command.status === 1) { - console.log( - chalk.bold.red('\nreplace-fork script failed with the following error:') - ); console.error(Error(command.stderr)); // If eslint crashes, it may not have successfully fixed all the imports, @@ -69,16 +65,7 @@ async function main() { // but it's only safe to do that if we aren't going to override any previous changes. if (!hadUnstagedChanges) { spawnSync('git', ['checkout', '.']); - } else { - console.log( - `\n${chalk.yellow.bold( - 'Unstaged changes were present when `replace-fork` was run.' - )} ` + - `To cleanup the repository run:\n ${chalk.bold( - 'git checkout packages/react-reconciler' - )}` - ); - } + } else {} process.exit(1); } else { diff --git a/scripts/prettier/index.js b/scripts/prettier/index.js index 18426b81f5b5..dadc5eb31be9 100644 --- a/scripts/prettier/index.js +++ b/scripts/prettier/index.js @@ -54,21 +54,8 @@ files.forEach(file => { } else { if (!prettier.check(input, options)) { if (!didWarn) { - console.log( - '\n' + - chalk.red( - ` This project uses prettier to format all JavaScript code.\n` - ) + - chalk.dim(` Please run `) + - chalk.reset('yarn prettier-all') + - chalk.dim( - ` and add changes to files listed below to your commit:` - ) + - `\n\n` - ); didWarn = true; } - console.log(file); } } } catch (error) { diff --git a/scripts/release/build-release-locally-commands/confirm-automated-testing.js b/scripts/release/build-release-locally-commands/confirm-automated-testing.js index a409c9212aa6..309cbe7e9ac2 100644 --- a/scripts/release/build-release-locally-commands/confirm-automated-testing.js +++ b/scripts/release/build-release-locally-commands/confirm-automated-testing.js @@ -9,13 +9,6 @@ const theme = require('../theme'); const run = async () => { clear(); - console.log( - theme.caution( - 'This script does not run any automated tests.' + - 'You should run them manually before creating a "next" release.' - ) - ); - await confirm('Do you want to proceed?'); clear(); diff --git a/scripts/release/download-experimental-build-commands/print-summary.js b/scripts/release/download-experimental-build-commands/print-summary.js index 6e7454a5a86a..a880e66507a6 100644 --- a/scripts/release/download-experimental-build-commands/print-summary.js +++ b/scripts/release/download-experimental-build-commands/print-summary.js @@ -20,6 +20,4 @@ module.exports = async ({build}) => { You can download this build again by running: {path ${commandPath}} --build={build ${build}} `; - - console.log(message.replace(/\n +/g, '\n').trim()); }; diff --git a/scripts/release/prepare-release-from-npm-commands/update-stable-version-numbers.js b/scripts/release/prepare-release-from-npm-commands/update-stable-version-numbers.js index 47a0907bafad..8c2bae1215da 100644 --- a/scripts/release/prepare-release-from-npm-commands/update-stable-version-numbers.js +++ b/scripts/release/prepare-release-from-npm-commands/update-stable-version-numbers.js @@ -88,11 +88,7 @@ const run = async ({cwd, packages, version}, versionsMap) => { const printDependencies = (maybeDependency, label) => { if (maybeDependency) { for (let dependencyName in maybeDependency) { - if (packages.includes(dependencyName)) { - console.log( - theme`• {package ${dependencyName}} {version ${maybeDependency[dependencyName]}} {dimmed ${label}}` - ); - } + if (packages.includes(dependencyName)) {} } } }; @@ -100,11 +96,6 @@ const run = async ({cwd, packages, version}, versionsMap) => { const packageName = packages[i]; const packageJSONPath = join(nodeModulesPath, packageName, 'package.json'); const packageJSON = await readJson(packageJSONPath); - console.log( - theme`\n{package ${packageName}} {version ${versionsMap.get( - packageName - )}}` - ); printDependencies(packageJSON.dependencies, 'dependency'); printDependencies(packageJSON.peerDependencies, 'peer'); } @@ -163,10 +154,6 @@ const run = async ({cwd, packages, version}, versionsMap) => { }); } writeFileSync(diffPath, diff, {cwd}); - console.log(theme.header(`\n${numFilesModified} files have been updated.`)); - console.log( - theme`A full diff is available at {path ${relative(cwd, diffPath)}}.` - ); await confirm('Do the changes above look correct?'); clear(); diff --git a/scripts/release/publish-commands/confirm-skipped-packages.js b/scripts/release/publish-commands/confirm-skipped-packages.js index 3e7bc03d6854..cbe553ada265 100644 --- a/scripts/release/publish-commands/confirm-skipped-packages.js +++ b/scripts/release/publish-commands/confirm-skipped-packages.js @@ -13,13 +13,7 @@ const run = async ({cwd, packages, skipPackages, tags}) => { clear(); - console.log( - theme`{spinnerSuccess ✓} The following packages will not be published as part of this release` - ); - - skipPackages.forEach(packageName => { - console.log(theme`• {package ${packageName}}`); - }); + skipPackages.forEach(packageName => {}); await confirm('Do you want to proceed?'); diff --git a/scripts/release/publish-commands/confirm-version-and-tags.js b/scripts/release/publish-commands/confirm-version-and-tags.js index 6900878da02f..ff1912e47adb 100644 --- a/scripts/release/publish-commands/confirm-version-and-tags.js +++ b/scripts/release/publish-commands/confirm-version-and-tags.js @@ -14,17 +14,7 @@ const run = async ({cwd, packages, tags, ci}) => { if (tags.length === 0) { console.error('Expected at least one tag.'); process.exit(1); - } else if (tags.length === 1) { - console.log( - theme`{spinnerSuccess ✓} You are about the publish the following packages under the tag {tag ${tags}}:` - ); - } else { - console.log( - theme`{spinnerSuccess ✓} You are about the publish the following packages under the tags {tag ${tags.join( - ', ' - )}}:` - ); - } + } else if (tags.length === 1) {} else {} for (let i = 0; i < packages.length; i++) { const packageName = packages[i]; @@ -35,9 +25,6 @@ const run = async ({cwd, packages, tags, ci}) => { 'package.json' ); const packageJSON = await readJson(packageJSONPath); - console.log( - theme`• {package ${packageName}} {version ${packageJSON.version}}` - ); } if (!ci) { diff --git a/scripts/release/publish-commands/print-follow-up-instructions.js b/scripts/release/publish-commands/print-follow-up-instructions.js index 92eac820e26b..0e866f4fc80c 100644 --- a/scripts/release/publish-commands/print-follow-up-instructions.js +++ b/scripts/release/publish-commands/print-follow-up-instructions.js @@ -17,21 +17,9 @@ const run = async ({cwd, packages, tags}) => { clear(); - if (tags.length === 1 && tags[0] === 'next') { - console.log( - theme`{header A "next" release} {version ${version}} {header has been published!}` - ); - } else if (tags.length === 1 && tags[0] === 'experimental') { - console.log( - theme`{header An "experimental" release} {version ${version}} {header has been published!}` - ); - } else { + if (tags.length === 1 && tags[0] === 'next') {} else if (tags.length === 1 && tags[0] === 'experimental') {} else { const nodeModulesPath = join(cwd, 'build/node_modules'); - console.log( - theme.caution`The release has been published but you're not done yet!` - ); - if (tags.includes('latest')) { // All packages are built from a single source revision, // so it is safe to read build info from any one of them. @@ -50,78 +38,21 @@ const run = async ({cwd, packages, tags}) => { ) ); - console.log(); - console.log( - theme.header`Please review and commit all local, staged changes.` - ); - - console.log(); - console.log('Version numbers have been updated in the following files:'); for (let i = 0; i < packages.length; i++) { const packageName = packages[i]; - console.log(theme.path`• packages/%s/package.json`, packageName); } const status = await execRead( 'git diff packages/shared/ReactVersion.js', {cwd} ); - if (status) { - console.log(theme.path`• packages/shared/ReactVersion.js`); - } - - console.log(); - console.log( - theme`{header Don't forget to also update and commit the }{path CHANGELOG}` - ); + if (status) {} // Prompt the release engineer to tag the commit and update the CHANGELOG. // (The script could automatically do this, but this seems safer.) console.log(); - console.log( - theme.header`Tag the source for this release in Git with the following command:` - ); - console.log( - theme` {command git tag -a v}{version %s} {command -m "v%s"} {version %s}`, - version, - version, - commit - ); - console.log(theme.command` git push origin --tags`); - - console.log(); - console.log(theme.header`Lastly, please fill in the release on GitHub.`); - console.log( - theme.link`https://github.com/facebook/react/releases/tag/v%s`, - version - ); - console.log( - theme`\nThe GitHub release should also include links to the following artifacts:` - ); - for (let i = 0; i < packages.length; i++) { - const packageName = packages[i]; - if (existsSync(join(nodeModulesPath, packageName, 'umd'))) { - const {version: packageVersion} = readJsonSync( - join(nodeModulesPath, packageName, 'package.json') - ); - console.log( - theme`{path • %s:} {link https://unpkg.com/%s@%s/umd/}`, - packageName, - packageName, - packageVersion - ); - } - } // Update reactjs.org so the React version shown in the header is up to date. console.log(); - console.log( - theme.header`Once you've pushed changes, update the docs site.` - ); - console.log( - 'This will ensure that any newly-added error codes can be decoded.' - ); - - console.log(); } } }; diff --git a/scripts/release/publish-commands/prompt-for-otp.js b/scripts/release/publish-commands/prompt-for-otp.js index c89c2884630e..3ed73000fd4f 100644 --- a/scripts/release/publish-commands/prompt-for-otp.js +++ b/scripts/release/publish-commands/prompt-for-otp.js @@ -12,11 +12,7 @@ const run = async () => { if (otp) { return otp; - } else { - console.log(); - console.log(theme.error`Two-factor auth is required to publish.`); - // (Ask again.) - } + } else {} } }; diff --git a/scripts/release/publish-commands/publish-to-npm.js b/scripts/release/publish-commands/publish-to-npm.js index 28035b052107..8c9d26350793 100644 --- a/scripts/release/publish-commands/publish-to-npm.js +++ b/scripts/release/publish-commands/publish-to-npm.js @@ -18,31 +18,20 @@ const run = async ({cwd, dry, tags, ci}, packageName, otp) => { // But for now the easiest way is just to ask if this is expected. const info = await execRead(`npm view ${packageName}@${version}`); if (info) { - console.log( - theme`{package ${packageName}} {version ${version}} has already been published.` - ); if (!ci) { await confirm('Is this expected?'); } } else { - console.log(theme`{spinnerSuccess ✓} Publishing {package ${packageName}}`); - // Publish the package and tag it. if (!dry) { if (!ci) { await exec(`npm publish --tag=${tags[0]} --otp=${otp}`, { cwd: packagePath, }); - console.log(theme.command(` cd ${packagePath}`)); - console.log( - theme.command(` npm publish --tag=${tags[0]} --otp=${otp}`) - ); } else { await exec(`npm publish --tag=${tags[0]}`, { cwd: packagePath, }); - console.log(theme.command(` cd ${packagePath}`)); - console.log(theme.command(` npm publish --tag=${tags[0]}`)); } } @@ -53,20 +42,10 @@ const run = async ({cwd, dry, tags, ci}, packageName, otp) => { `npm dist-tag add ${packageName}@${version} ${tags[j]} --otp=${otp}`, {cwd: packagePath} ); - console.log( - theme.command( - ` npm dist-tag add ${packageName}@${version} ${tags[j]} --otp=${otp}` - ) - ); } else { await exec(`npm dist-tag add ${packageName}@${version} ${tags[j]}`, { cwd: packagePath, }); - console.log( - theme.command( - ` npm dist-tag add ${packageName}@${version} ${tags[j]}` - ) - ); } } } @@ -77,16 +56,8 @@ const run = async ({cwd, dry, tags, ci}, packageName, otp) => { if (!dry) { if (!ci) { await exec(`npm dist-tag rm ${packageName} untagged --otp=${otp}`); - console.log( - theme.command( - ` npm dist-tag rm ${packageName} untagged --otp=${otp}` - ) - ); } else { await exec(`npm dist-tag rm ${packageName} untagged`); - console.log( - theme.command(` npm dist-tag rm ${packageName} untagged`) - ); } } } diff --git a/scripts/release/publish-commands/validate-skip-packages.js b/scripts/release/publish-commands/validate-skip-packages.js index af7324fdf626..9245186437ab 100644 --- a/scripts/release/publish-commands/validate-skip-packages.js +++ b/scripts/release/publish-commands/validate-skip-packages.js @@ -35,10 +35,6 @@ const run = async ({cwd, packages, skipPackages}) => { // Do we depend on a version of the package that has not been published to NPM? const info = await execRead(`npm view ${dependency}@${version}`); if (!info) { - console.log( - theme`{error Package} {package ${name}} {error depends on an unpublished skipped package}`, - theme`{package ${dependency}}@{version ${version}}` - ); process.exit(1); } } diff --git a/scripts/release/publish-commands/validate-tags.js b/scripts/release/publish-commands/validate-tags.js index fbd58e9b3763..87f7d4ee52bf 100644 --- a/scripts/release/publish-commands/validate-tags.js +++ b/scripts/release/publish-commands/validate-tags.js @@ -21,40 +21,20 @@ const run = async ({cwd, packages, tags}) => { const isExperimentalVersion = version.indexOf('experimental') !== -1; if (version.indexOf('-') !== -1) { if (tags.includes('latest')) { - if (isExperimentalVersion) { - console.log( - theme`{error Experimental release} {version ${version}} {error cannot be tagged as} {tag latest}` - ); - } else { - console.log( - theme`{error Next release} {version ${version}} {error cannot be tagged as} {tag latest}` - ); - } + if (isExperimentalVersion) {} else {} process.exit(1); } if (tags.includes('next') && isExperimentalVersion) { - console.log( - theme`{error Experimental release} {version ${version}} {error cannot be tagged as} {tag next}` - ); process.exit(1); } if (tags.includes('experimental') && !isExperimentalVersion) { - console.log( - theme`{error Next release} {version ${version}} {error cannot be tagged as} {tag experimental}` - ); process.exit(1); } } else { if (!tags.includes('latest')) { - console.log( - theme`{error Stable release} {version ${version}} {error must always be tagged as} {tag latest}` - ); process.exit(1); } if (tags.includes('experimental')) { - console.log( - theme`{error Stable release} {version ${version}} {error cannot be tagged as} {tag experimental}` - ); process.exit(1); } } diff --git a/scripts/release/publish.js b/scripts/release/publish.js index 79990cdbdc44..3d182293d382 100755 --- a/scripts/release/publish.js +++ b/scripts/release/publish.js @@ -35,9 +35,6 @@ const run = async () => { params.skipPackages.forEach(packageName => { const index = params.packages.indexOf(packageName); if (index < 0) { - console.log( - theme`Invalid skip package {package ${packageName}} specified.` - ); process.exit(1); } else { params.packages.splice(index, 1); @@ -68,7 +65,6 @@ const run = async () => { } } if (failed) { - console.log(theme.error`One or more packages failed to publish.`); process.exit(1); } } else { diff --git a/scripts/release/shared-commands/download-build-artifacts.js b/scripts/release/shared-commands/download-build-artifacts.js index fba746520273..528d48f23da4 100644 --- a/scripts/release/shared-commands/download-build-artifacts.js +++ b/scripts/release/shared-commands/download-build-artifacts.js @@ -15,9 +15,6 @@ const run = async ({build, cwd, releaseChannel}) => { ); if (!buildArtifacts) { - console.log( - theme`{error The specified build (${build}) does not contain any build artifacts.}` - ); process.exit(1); } diff --git a/scripts/release/shared-commands/print-prerelease-summary.js b/scripts/release/shared-commands/print-prerelease-summary.js index 6492c50bd788..463ce6e8159f 100644 --- a/scripts/release/shared-commands/print-prerelease-summary.js +++ b/scripts/release/shared-commands/print-prerelease-summary.js @@ -36,6 +36,4 @@ module.exports = ({cwd}, isStableRelease) => { {path ${publishPath}} `; } - - console.log(message.replace(/\n +/g, '\n').trim()); }; diff --git a/scripts/release/snapshot-test.js b/scripts/release/snapshot-test.js index d199b51c7b9c..56b33370f3f4 100755 --- a/scripts/release/snapshot-test.js +++ b/scripts/release/snapshot-test.js @@ -77,26 +77,13 @@ const run = async () => { 'utf-8' ); - if (beforeContents === afterContents) { - console.log(theme.header`Snapshot test passed.`); - } else { + if (beforeContents === afterContents) {} else { printDiff( 'scripts/release/snapshot-test.snapshot', beforeContents, afterContents ); - console.log(); console.error(theme.error('Snapshot test failed!')); - console.log(); - console.log( - 'If this failure was expected, please update the contents of the snapshot file:' - ); - console.log( - theme` {command git add} {path scripts/release/snapshot-test.snapshot}` - ); - console.log( - theme` {command git commit -m "Updating release script snapshot file."}` - ); process.exit(1); } } catch (error) { diff --git a/scripts/release/utils.js b/scripts/release/utils.js index 7a940f8f65fb..177db0a79a46 100644 --- a/scripts/release/utils.js +++ b/scripts/release/utils.js @@ -37,7 +37,6 @@ const confirm = async message => { const confirmation = await prompt(theme`\n{caution ${message}} (y/N) `); prompt.done(); if (confirmation !== 'y' && confirmation !== 'Y') { - console.log(theme`\n{caution Release cancelled.}`); process.exit(0); } }; @@ -162,7 +161,6 @@ const handleError = error => { const message = error.message.trim().replace(/\n +/g, '\n'); const stack = error.stack.replace(error.message, ''); - console.log(theme`{error ${message}}\n\n{path ${stack}}`); process.exit(1); }; @@ -192,7 +190,6 @@ const printDiff = (path, beforeContents, afterContents) => { } }) .filter(line => line); - console.log(coloredLines.join('\n')); return patch; }; diff --git a/scripts/rollup/build.js b/scripts/rollup/build.js index 52c0b7dc9fe2..bdb57d4ebecc 100644 --- a/scripts/rollup/build.js +++ b/scripts/rollup/build.js @@ -600,20 +600,16 @@ async function createBundle(bundle, bundleType) { watcher.on('event', async event => { switch (event.code) { case 'BUNDLE_START': - console.log(`${chalk.bgYellow.black(' BUILDING ')} ${logKey}`); break; case 'BUNDLE_END': - console.log(`${chalk.bgGreen.black(' COMPLETE ')} ${logKey}\n`); break; case 'ERROR': case 'FATAL': - console.log(`${chalk.bgRed.black(' OH NOES! ')} ${logKey}\n`); handleRollupError(event.error); break; } }); } else { - console.log(`${chalk.bgYellow.black(' BUILDING ')} ${logKey}`); try { const result = await rollup.rollup(rollupConfig); await result.write(rollupOutputOptions); @@ -622,7 +618,6 @@ async function createBundle(bundle, bundleType) { handleRollupError(error); throw error; } - console.log(`${chalk.bgGreen.black(' COMPLETE ')} ${logKey}\n`); } } @@ -749,7 +744,6 @@ async function buildEverything() { await Sync.syncReactDom('build/facebook-www', syncWWWPath); } - console.log(Stats.printResults()); if (!forcePrettyOutput) { Stats.saveResults(); } diff --git a/scripts/rollup/sync.js b/scripts/rollup/sync.js index 8b2d839b57a6..4a670de5ffdb 100644 --- a/scripts/rollup/sync.js +++ b/scripts/rollup/sync.js @@ -10,10 +10,7 @@ const RELATIVE_RN_OSS_PATH = 'xplat/js/react-native-github/Libraries/Renderer/'; const RELATIVE_WWW_PATH = 'html/shared/react/'; async function doSync(buildPath, destPath) { - console.log(`${chalk.bgYellow.black(' SYNCING ')} React to ${destPath}`); - await asyncCopyTo(buildPath, destPath); - console.log(`${chalk.bgGreen.black(' SYNCED ')} React to ${destPath}`); } async function syncReactDom(buildPath, wwwPath) { diff --git a/scripts/rollup/validate/index.js b/scripts/rollup/validate/index.js index 34faf6ed7340..67648199a7a1 100644 --- a/scripts/rollup/validate/index.js +++ b/scripts/rollup/validate/index.js @@ -69,16 +69,12 @@ async function lint(eslint, filepaths) { results.some(result => result.errorCount > 0 || result.warningCount > 0) ) { process.exitCode = 1; - console.log(`Lint failed`); const formatter = await eslint.loadFormatter('stylish'); const resultText = formatter.format(results); - console.log(resultText); } } async function lintEverything() { - console.log(`Linting build artifacts...`); - const allFilepaths = await glob('build/**/*.js'); const pathsByFormat = new Map(); diff --git a/scripts/shared/listChangedFiles.js b/scripts/shared/listChangedFiles.js index 9db4e1507138..34e3d6668a47 100644 --- a/scripts/shared/listChangedFiles.js +++ b/scripts/shared/listChangedFiles.js @@ -9,7 +9,6 @@ const execFileSync = require('child_process').execFileSync; const exec = (command, args) => { - console.log('> ' + [command].concat(args).join(' ')); const options = { cwd: process.cwd(), env: process.env, diff --git a/scripts/tasks/danger.js b/scripts/tasks/danger.js index e85dba26219c..157a75ac49c5 100644 --- a/scripts/tasks/danger.js +++ b/scripts/tasks/danger.js @@ -31,9 +31,7 @@ spawn( ).on('close', function(code) { if (code !== 0) { console.error('Danger failed'); - } else { - console.log('Danger passed'); - } + } else {} process.exit(code); }); diff --git a/scripts/tasks/eslint.js b/scripts/tasks/eslint.js index 0205873f0aad..5e781cd4d844 100644 --- a/scripts/tasks/eslint.js +++ b/scripts/tasks/eslint.js @@ -11,19 +11,13 @@ const minimist = require('minimist'); const runESLint = require('../eslint'); async function main() { - console.log('Linting all files...'); // https://circleci.com/docs/2.0/env-vars/#circleci-environment-variable-descriptions - if (!process.env.CI) { - console.log('Hint: run `yarn linc` to only lint changed files.'); - } + if (!process.env.CI) {} // eslint-disable-next-line no-unused-vars const {_, ...cliOptions} = minimist(process.argv.slice(2)); - if (await runESLint({onlyChanged: false, ...cliOptions})) { - console.log('Lint passed.'); - } else { - console.log('Lint failed.'); + if (await runESLint({onlyChanged: false, ...cliOptions})) {} else { process.exit(1); } } diff --git a/scripts/tasks/flow-ci.js b/scripts/tasks/flow-ci.js index 99099270cf48..48785b17951d 100644 --- a/scripts/tasks/flow-ci.js +++ b/scripts/tasks/flow-ci.js @@ -28,7 +28,6 @@ async function checkAll() { const rendererInfo = inlinedHostConfigs[i]; if (rendererInfo.isFlowTyped) { await runFlow(rendererInfo.shortName, ['check']); - console.log(); } } } diff --git a/scripts/tasks/flow.js b/scripts/tasks/flow.js index a9543743732d..ff13dcd2eba9 100644 --- a/scripts/tasks/flow.js +++ b/scripts/tasks/flow.js @@ -22,30 +22,9 @@ const primaryRenderer = inlinedHostConfigs.find( info => info.isFlowTyped && info.shortName === process.argv[2] ); if (!primaryRenderer) { - console.log( - 'The ' + - chalk.red('yarn flow') + - ' command now requires you to pick a primary renderer:' - ); - console.log(); inlinedHostConfigs.forEach(rendererInfo => { - if (rendererInfo.isFlowTyped) { - console.log(' * ' + chalk.cyan('yarn flow ' + rendererInfo.shortName)); - } + if (rendererInfo.isFlowTyped) {} }); - console.log(); - console.log('If you are not sure, run ' + chalk.green('yarn flow dom') + '.'); - console.log( - 'This will still typecheck non-DOM packages, although less precisely.' - ); - console.log(); - console.log('Note that checks for all renderers will run on CI.'); - console.log( - 'You can also do this locally with ' + - chalk.cyan('yarn flow-ci') + - ' but it will be slow.' - ); - console.log(); process.exit(1); } diff --git a/scripts/tasks/linc.js b/scripts/tasks/linc.js index e3b89237528d..9335c1da22f2 100644 --- a/scripts/tasks/linc.js +++ b/scripts/tasks/linc.js @@ -11,15 +11,10 @@ const minimist = require('minimist'); const runESLint = require('../eslint'); async function main() { - console.log('Linting changed files...'); - // eslint-disable-next-line no-unused-vars const {_, ...cliOptions} = minimist(process.argv.slice(2)); - if (await runESLint({onlyChanged: true, ...cliOptions})) { - console.log('Lint passed for changed files.'); - } else { - console.log('Lint failed for changed files.'); + if (await runESLint({onlyChanged: true, ...cliOptions})) {} else { process.exit(1); } } diff --git a/scripts/tasks/version-check.js b/scripts/tasks/version-check.js index 57dcfdfba638..d7bee0a73f27 100644 --- a/scripts/tasks/version-check.js +++ b/scripts/tasks/version-check.js @@ -28,12 +28,6 @@ Object.keys(versions).forEach(function(name) { const version = versions[name]; if (version !== reactVersion) { allVersionsMatch = false; - console.log( - '%s version does not match package.json. Expected %s, saw %s.', - name, - reactVersion, - version - ); } });