run() — react Function Reference
Architecture documentation for the run() function in print-follow-up-instructions.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 31555c8b_8c3d_b744_a56d_f19e159f0357["run()"] dc151680_745c_8d94_a10f_30238d7540aa["print-follow-up-instructions.js"] 31555c8b_8c3d_b744_a56d_f19e159f0357 -->|defined in| dc151680_745c_8d94_a10f_30238d7540aa style 31555c8b_8c3d_b744_a56d_f19e159f0357 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
scripts/release/publish-commands/print-follow-up-instructions.js lines 12–127
const run = async ({cwd, packages, tags}) => {
// Tags are named after the react version.
const {version} = readJsonSync(
`${cwd}/build/node_modules/react/package.json`
);
clear();
if (tags.length === 1 && tags[0] === 'next') {
console.log(
theme`{header A "next" release} {version ${version}} {header has been published!}`
);
} else if (tags.length === 1 && tags[0] === 'experimental') {
console.log(
theme`{header An "experimental" release} {version ${version}} {header has been published!}`
);
} else {
const nodeModulesPath = join(cwd, 'build/node_modules');
console.log(
theme.caution`The release has been published but you're not done yet!`
);
if (tags.includes('latest')) {
// All packages are built from a single source revision,
// so it is safe to read build info from any one of them.
const arbitraryPackageName = packages[0];
// FIXME: New build script does not output build-info.json. It's only used
// by this post-publish print job, and only for "latest" releases, so I've
// disabled it as a workaround so the publish script doesn't crash for
// "next" and "experimental" pre-releases.
const {commit} = readJsonSync(
join(
cwd,
'build',
'node_modules',
arbitraryPackageName,
'build-info.json'
)
);
console.log();
console.log(
theme.header`Please review and commit all local, staged changes.`
);
console.log();
console.log('Version numbers have been updated in the following files:');
for (let i = 0; i < packages.length; i++) {
const packageName = packages[i];
console.log(theme.path`• packages/%s/package.json`, packageName);
}
const status = await execRead(
'git diff packages/shared/ReactVersion.js',
{cwd}
);
if (status) {
console.log(theme.path`• packages/shared/ReactVersion.js`);
}
console.log();
console.log(
theme`{header Don't forget to also update and commit the }{path CHANGELOG}`
);
// Prompt the release engineer to tag the commit and update the CHANGELOG.
// (The script could automatically do this, but this seems safer.)
console.log();
console.log(
theme.header`Tag the source for this release in Git with the following command:`
);
console.log(
theme` {command git tag -a v}{version %s} {command -m "v%s"} {version %s}`,
version,
version,
commit
);
console.log(theme.command` git push origin --tags`);
console.log();
console.log(theme.header`Lastly, please fill in the release on GitHub.`);
Domain
Subdomains
Source
Frequently Asked Questions
What does run() do?
run() is a function in the react codebase, defined in scripts/release/publish-commands/print-follow-up-instructions.js.
Where is run() defined?
run() is defined in scripts/release/publish-commands/print-follow-up-instructions.js at line 12.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free