index.js — react Source File
Architecture documentation for index.js, a javascript file in the react codebase.
Entity Profile
Relationship Graph
Source Code
'use strict';
const {stablePackages} = require('../../../ReactVersions');
const {parseArgs} = require('./args');
const {
fetchNpmInfo,
collectCommitsSince,
loadCommitDetails,
extractPrNumber,
fetchPullRequestMetadata,
} = require('./data');
const {summarizePackages} = require('./summaries');
const {buildChangelogEntries, renderChangelog} = require('./formatters');
const {noopLogger} = require('./utils');
async function main() {
const {packageSpecs, summarizer, debug, format} = parseArgs(
process.argv.slice(2)
);
const log = debug
? (...args) => console.log('[generate-changelog]', ...args)
: noopLogger;
const allStablePackages = Object.keys(stablePackages);
const packageTargets = new Map();
for (let i = 0; i < packageSpecs.length; i++) {
const spec = packageSpecs[i];
if (!allStablePackages.includes(spec.name)) {
throw new Error(
`Package "${spec.name}" is not listed in stablePackages.`
);
}
if (packageTargets.has(spec.name)) {
throw new Error(`Package "${spec.name}" was specified more than once.`);
}
packageTargets.set(spec.name, spec);
}
const targetPackages = packageSpecs.map(spec => spec.name);
log(
`Starting changelog generation for: ${packageSpecs
.map(spec => `${spec.name}@${spec.displayVersion || spec.version}`)
.join(', ')}`
);
const packageInfoMap = new Map();
const packageInfoResults = await Promise.all(
targetPackages.map(async pkg => {
const info = await fetchNpmInfo(pkg, {log});
return {pkg, info};
})
);
for (let i = 0; i < packageInfoResults.length; i++) {
const entry = packageInfoResults[i];
packageInfoMap.set(entry.pkg, entry.info);
}
const commitPackagesMap = new Map();
const commitCollections = await Promise.all(
targetPackages.map(async pkg => {
// ... (99 more lines)
Domain
Subdomains
Functions
Source
Frequently Asked Questions
What does index.js do?
index.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 index.js?
index.js defines 1 function(s): main.
Where is index.js in the architecture?
index.js is located at scripts/tasks/generate-changelog/index.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