Home / File/ build-all-release-channels.js — react Source File

build-all-release-channels.js — react Source File

Architecture documentation for build-all-release-channels.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

'use strict';

/* eslint-disable no-for-of-loops/no-for-of-loops */

const fs = require('fs');
const fse = require('fs-extra');
const {spawnSync} = require('child_process');
const path = require('path');
const tmp = require('tmp');
const shell = require('shelljs');
const {
  ReactVersion,
  stablePackages,
  experimentalPackages,
  canaryChannelLabel,
  rcNumber,
} = require('../../ReactVersions');
const yargs = require('yargs');
const Bundles = require('./bundles');

// Runs the build script for both stable and experimental release channels,
// by configuring an environment variable.

const sha = String(spawnSync('git', ['rev-parse', 'HEAD']).stdout).slice(0, 8);

let dateString = String(
  spawnSync('git', [
    'show',
    '-s',
    '--no-show-signature',
    '--format=%cd',
    '--date=format:%Y%m%d',
    sha,
  ]).stdout
).trim();

// On CI environment, this string is wrapped with quotes '...'s
if (dateString.startsWith("'")) {
  dateString = dateString.slice(1, 9);
}

// Build the artifacts using a placeholder React version. We'll then do a string
// replace to swap it with the correct version per release channel.
//
// The placeholder version is the same format that the "next" channel uses
const PLACEHOLDER_REACT_VERSION =
  ReactVersion + '-' + canaryChannelLabel + '-' + sha + '-' + dateString;

// TODO: We should inject the React version using a build-time parameter
// instead of overwriting the source files.
fs.writeFileSync(
  './packages/shared/ReactVersion.js',
  `export default '${PLACEHOLDER_REACT_VERSION}';\n`
);

const argv = yargs.wrap(yargs.terminalWidth()).options({
  releaseChannel: {
    alias: 'r',
    describe: 'Build the given release channel.',
    requiresArg: true,
// ... (455 more lines)

Domain

Subdomains

Frequently Asked Questions

What does build-all-release-channels.js do?
build-all-release-channels.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Entrypoint subdomain.
What functions are defined in build-all-release-channels.js?
build-all-release-channels.js defines 8 function(s): buildForChannel, crossDeviceRenameSync, main, mergeDirsSync, processExperimental, processStable, updatePackageVersions, updatePlaceholderReactVersionInCompiledArtifacts.
Where is build-all-release-channels.js in the architecture?
build-all-release-channels.js is located at scripts/rollup/build-all-release-channels.js (domain: BabelCompiler, subdomain: Entrypoint, directory: scripts/rollup).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free