publish.js — react Source File
Architecture documentation for publish.js, a javascript file in the react codebase.
Entity Profile
Relationship Graph
Source Code
#!/usr/bin/env node
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
const ora = require('ora');
const path = require('path');
const yargs = require('yargs');
const {hashElement} = require('folder-hash');
const promptForOTP = require('./prompt-for-otp');
const {PUBLISHABLE_PACKAGES} = require('./shared/packages');
const {
execHelper,
getDateStringForCommit,
spawnHelper,
} = require('./shared/utils');
const {buildPackages} = require('./shared/build-packages');
const {readJson, writeJson} = require('fs-extra');
/**
* Script for publishing PUBLISHABLE_PACKAGES to npm. By default, this runs in tarball mode, meaning
* the script will only print out what the contents of the files included in the npm tarball would
* be.
*
* Please run this first (ie `yarn npm:publish`) and double check the contents of the files that
* will be pushed to npm.
*
* If it looks good, you can run `yarn npm:publish --for-real` to really publish to npm. You must
* have 2FA enabled first and the script will prompt you to enter a 2FA code before proceeding.
* There's a small annoying delay before the packages are actually pushed to give you time to panic
* cancel. In this mode, we will bump the version field of each package's package.json, and git
* commit it. Then, the packages will be published to npm.
*
* Optionally, you can add the `--debug` flag to `yarn npm:publish --debug --for-real` to run all
* steps, but the final npm publish step will have the `--dry-run` flag added to it. This will make
* the command only report what it would have done, instead of actually publishing to npm.
*/
async function main() {
const argv = yargs(process.argv.slice(2))
.option('packages', {
description: 'which packages to publish, defaults to all',
choices: PUBLISHABLE_PACKAGES,
default: PUBLISHABLE_PACKAGES,
})
.option('for-real', {
alias: 'frfr',
description:
'whether to publish to npm (npm publish) or dryrun (npm publish --dry-run)',
type: 'boolean',
default: false,
})
.option('debug', {
description:
'If enabled, will always run npm commands in dry run mode irregardless of the for-real flag',
type: 'boolean',
// ... (178 more lines)
Domain
Subdomains
Functions
Source
Frequently Asked Questions
What does publish.js do?
publish.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 publish.js?
publish.js defines 1 function(s): main.
Where is publish.js in the architecture?
publish.js is located at compiler/scripts/release/publish.js (domain: BabelCompiler, subdomain: Entrypoint, directory: compiler/scripts/release).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free