download_devtools_regression_build.js — react Source File
Architecture documentation for download_devtools_regression_build.js, a javascript file in the react codebase.
Entity Profile
Relationship Graph
Source Code
#!/usr/bin/env node
'use strict';
const {exec} = require('child-process-promise');
const chalk = require('chalk');
const {join} = require('path');
const semver = require('semver');
const yargs = require('yargs');
const fs = require('fs');
const REGRESSION_FOLDER = 'build-regression';
const ROOT_PATH = join(__dirname, '..', '..');
const buildPath = join(ROOT_PATH, `build`, 'oss-experimental');
const regressionBuildPath = join(ROOT_PATH, REGRESSION_FOLDER);
const argv = yargs(process.argv.slice(2)).argv;
const version = process.argv[2];
const shouldReplaceBuild = !!argv.replaceBuild;
async function downloadRegressionBuild() {
const reactVersion = semver.coerce(version).version;
const installPackages = ['react-dom', 'react', 'react-test-renderer'];
if (semver.gte(reactVersion, '16.3.0')) {
installPackages.push('react-is');
}
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
const downloadPackagesStr = installPackages.reduce(
(str, name) => `${str} ${name}@${version}`,
''
);
await exec(
`npm install --prefix ${REGRESSION_FOLDER} ${downloadPackagesStr}`
);
// If we shouldn't replace the build folder, we can stop here now
// before we modify anything
if (!shouldReplaceBuild) {
return;
}
// Remove all the packages that we downloaded in the original build folder
// so we can move the modules from the regression build over
const removePackagesStr = installPackages.reduce(
(str, name) => `${str} ${join(buildPath, name)}`,
// ... (93 more lines)
Domain
Subdomains
Functions
Source
Frequently Asked Questions
What does download_devtools_regression_build.js do?
download_devtools_regression_build.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Optimization subdomain.
What functions are defined in download_devtools_regression_build.js?
download_devtools_regression_build.js defines 2 function(s): downloadRegressionBuild, main.
Where is download_devtools_regression_build.js in the architecture?
download_devtools_regression_build.js is located at scripts/ci/download_devtools_regression_build.js (domain: BabelCompiler, subdomain: Optimization, directory: scripts/ci).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free