Home / Function/ run() — react Function Reference

run() — react Function Reference

Architecture documentation for the run() function in add-build-info-json.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  df6ef8f2_bf76_0992_0cec_4cfb6110138d["run()"]
  03213774_a5c6_c6c7_c1b4_eaf8a08ccdcf["add-build-info-json.js"]
  df6ef8f2_bf76_0992_0cec_4cfb6110138d -->|defined in| 03213774_a5c6_c6c7_c1b4_eaf8a08ccdcf
  6716a66c_c037_1c81_95f4_2bc6e2f656b9["module()"]
  6716a66c_c037_1c81_95f4_2bc6e2f656b9 -->|calls| df6ef8f2_bf76_0992_0cec_4cfb6110138d
  style df6ef8f2_bf76_0992_0cec_4cfb6110138d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/release/build-release-locally-commands/add-build-info-json.js lines 14–47

const run = async ({branch, checksum, commit, reactVersion, tempDirectory}) => {
  const isExperimental = reactVersion.includes('experimental');
  const packages = getPublicPackages(isExperimental);
  const packagesDir = join(tempDirectory, 'packages');

  const buildInfoJSON = {
    branch,
    buildNumber: null,
    checksum,
    commit,
    environment: 'local',
    reactVersion,
  };

  for (let i = 0; i < packages.length; i++) {
    const packageName = packages[i];
    const packagePath = join(packagesDir, packageName);
    const packageJSON = await readJson(join(packagePath, 'package.json'));

    // Verify all public packages include "build-info.json" in the files array.
    if (!packageJSON.files.includes('build-info.json')) {
      console.error(
        theme`{error ${packageName} must include "build-info.json" in files array.}`
      );
      process.exit(1);
    }

    // Add build info JSON to package.
    if (existsSync(join(packagePath, 'npm'))) {
      const buildInfoJSONPath = join(packagePath, 'npm', 'build-info.json');
      await writeJson(buildInfoJSONPath, buildInfoJSON, {spaces: 2});
    }
  }
};

Domain

Subdomains

Called By

Frequently Asked Questions

What does run() do?
run() is a function in the react codebase, defined in scripts/release/build-release-locally-commands/add-build-info-json.js.
Where is run() defined?
run() is defined in scripts/release/build-release-locally-commands/add-build-info-json.js at line 14.
What calls run()?
run() is called by 1 function(s): module.

Analyze Your Own Codebase

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

Try Supermodel Free