Home / File/ args.js — react Source File

args.js — react Source File

Architecture documentation for args.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

'use strict';

const semver = require('semver');
const yargs = require('yargs/yargs');

const {stablePackages} = require('../../../ReactVersions');
const {isCommandAvailable} = require('./utils');

function parseArgs(argv) {
  const parser = yargs(argv)
    .usage(
      'Usage: yarn generate-changelog [--codex|--claude] [--debug] [--format <text|csv|json>] [<pkg@version> ...]'
    )
    .example(
      '$0 --codex eslint-plugin-react-hooks@7.0.1',
      'Generate changelog for a single package using Codex.'
    )
    .example(
      '$0 --claude react@19.3 react-dom@19.3',
      'Generate changelog entries for multiple packages using Claude.'
    )
    .example(
      '$0 --codex',
      'Generate changelog for all stable packages using recorded versions.'
    )
    .option('codex', {
      type: 'boolean',
      describe: 'Use Codex for commit summarization.',
    })
    .option('claude', {
      type: 'boolean',
      describe: 'Use Claude for commit summarization.',
    })
    .option('debug', {
      type: 'boolean',
      describe: 'Enable verbose debug logging.',
      default: false,
    })
    .option('format', {
      type: 'string',
      describe: 'Output format for the generated changelog.',
      choices: ['text', 'csv', 'json'],
      default: 'text',
    })
    .help('help')
    .alias('h', 'help')
    .version(false)
    .parserConfiguration({
      'parse-numbers': false,
      'parse-positional-numbers': false,
    });

  const args = parser.scriptName('generate-changelog').parse();
  const packageSpecs = [];
  const debug = !!args.debug;
  const format = args.format || 'text';
  let summarizer = null;

  if (args.codex && args.claude) {
    throw new Error('Choose either --codex or --claude, not both.');
// ... (69 more lines)

Domain

Subdomains

Functions

Frequently Asked Questions

What does args.js do?
args.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 args.js?
args.js defines 1 function(s): parseArgs.
Where is args.js in the architecture?
args.js is located at scripts/tasks/generate-changelog/args.js (domain: BabelCompiler, subdomain: Optimization, directory: scripts/tasks/generate-changelog).

Analyze Your Own Codebase

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

Try Supermodel Free