Home / File/ parse-params.js — react Source File

parse-params.js — react Source File

Architecture documentation for parse-params.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

#!/usr/bin/env node

'use strict';

const commandLineArgs = require('command-line-args');
const theme = require('../theme');

const paramDefinitions = [
  {
    name: 'build',
    type: String,
    description:
      'CI build ID corresponding to the "process_artifacts_combined" task.',
    defaultValue: null,
  },
  {
    name: 'commit',
    type: String,
    description:
      'GitHub commit SHA. When provided, automatically finds corresponding CI build.',
    defaultValue: null,
  },
  {
    name: 'skipTests',
    type: Boolean,
    description: 'Skip automated fixture tests.',
    defaultValue: false,
  },
  {
    name: 'releaseChannel',
    alias: 'r',
    type: String,
    description: 'Release channel (stable, experimental, or latest)',
  },
  {
    name: 'allowBrokenCI',
    type: Boolean,
    description:
      'Continue even if CI is failing. Useful if you need to debug a broken build.',
    defaultValue: false,
  },
];

module.exports = async () => {
  const params = commandLineArgs(paramDefinitions);

  const channel = params.releaseChannel;
  if (
    channel !== 'experimental' &&
    channel !== 'stable' &&
    channel !== 'rc' &&
    channel !== 'latest'
  ) {
    console.error(
      theme.error`Invalid release channel (-r) "${channel}". Must be "stable", "experimental", "rc", or "latest".`
    );
    process.exit(1);
  }

  if (params.commit === null) {
    console.error(theme.error`A --commit param must be specified.`);
    process.exit(1);
  }

  return params;
};

Domain

Subdomains

Functions

Frequently Asked Questions

What does parse-params.js do?
parse-params.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 parse-params.js?
parse-params.js defines 1 function(s): module.
Where is parse-params.js in the architecture?
parse-params.js is located at scripts/release/shared-commands/parse-params.js (domain: BabelCompiler, subdomain: Optimization, directory: scripts/release/shared-commands).

Analyze Your Own Codebase

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

Try Supermodel Free