Home / File/ confirm-version-and-tags.js — react Source File

confirm-version-and-tags.js — react Source File

Architecture documentation for confirm-version-and-tags.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

#!/usr/bin/env node

'use strict';

const clear = require('clear');
const {readJson} = require('fs-extra');
const {join} = require('path');
const {confirm} = require('../utils');
const theme = require('../theme');

const run = async ({cwd, packages, tags, ci}) => {
  clear();

  if (tags.length === 0) {
    console.error('Expected at least one tag.');
    process.exit(1);
  } else if (tags.length === 1) {
    console.log(
      theme`{spinnerSuccess ✓} You are about the publish the following packages under the tag {tag ${tags}}:`
    );
  } else {
    console.log(
      theme`{spinnerSuccess ✓} You are about the publish the following packages under the tags {tag ${tags.join(
        ', '
      )}}:`
    );
  }

  for (let i = 0; i < packages.length; i++) {
    const packageName = packages[i];
    const packageJSONPath = join(
      cwd,
      'build/node_modules',
      packageName,
      'package.json'
    );
    const packageJSON = await readJson(packageJSONPath);
    console.log(
      theme`• {package ${packageName}} {version ${packageJSON.version}}`
    );
    if (ci) {
      console.log(packageJSON);
    }
  }

  if (!ci) {
    await confirm('Do you want to proceed?');
  }

  clear();
};

// Run this directly because it's fast,
// and logPromise would interfere with console prompting.
module.exports = run;

Domain

Subdomains

Functions

Frequently Asked Questions

What does confirm-version-and-tags.js do?
confirm-version-and-tags.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 confirm-version-and-tags.js?
confirm-version-and-tags.js defines 1 function(s): run.
Where is confirm-version-and-tags.js in the architecture?
confirm-version-and-tags.js is located at scripts/release/publish-commands/confirm-version-and-tags.js (domain: BabelCompiler, subdomain: Entrypoint, directory: scripts/release/publish-commands).

Analyze Your Own Codebase

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

Try Supermodel Free