Home / File/ prepare-release.js — react Source File

prepare-release.js — react Source File

Architecture documentation for prepare-release.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

#!/usr/bin/env node

'use strict';

const chalk = require('chalk');
const {exec} = require('child-process-promise');
const {readFileSync, writeFileSync} = require('fs');
const {readJsonSync, writeJsonSync} = require('fs-extra');
const inquirer = require('inquirer');
const {join, relative} = require('path');
const semver = require('semver');
const {
  CHANGELOG_PATH,
  DRY_RUN,
  MANIFEST_PATHS,
  PACKAGE_PATHS,
  PULL_REQUEST_BASE_URL,
  RELEASE_SCRIPT_TOKEN,
  ROOT_PATH,
} = require('./configuration');
const {
  checkNPMPermissions,
  clear,
  confirmContinue,
  execRead,
} = require('./utils');

// This is the primary control function for this script.
async function main() {
  clear();

  await checkNPMPermissions();

  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]);
  const previousVersion = readJsonSync(path).version;
  const {major, minor, patch} = semver(previousVersion);
  const nextVersion =
    releaseType === 'minor'
      ? `${major}.${minor + 1}.0`
      : `${major}.${minor}.${patch + 1}`;

  updateChangelog(nextVersion, formattedCommitLog);

  await reviewChangelogPrompt();

  updatePackageVersions(previousVersion, nextVersion);
  updateManifestVersions(previousVersion, nextVersion);

// ... (227 more lines)

Domain

Subdomains

Frequently Asked Questions

What does prepare-release.js do?
prepare-release.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 prepare-release.js?
prepare-release.js defines 11 function(s): commitPendingChanges, getCommitLog, getPreviousCommitSha, getReleaseType, hasGithubCLI, main, printFinalInstructions, reviewChangelogPrompt, updateChangelog, updateManifestVersions, and 1 more.
Where is prepare-release.js in the architecture?
prepare-release.js is located at scripts/devtools/prepare-release.js (domain: BabelCompiler, subdomain: Optimization, directory: scripts/devtools).

Analyze Your Own Codebase

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

Try Supermodel Free