MCPcopy Index your code
hub / github.com/react/react / prepareNpmPackage

Function prepareNpmPackage

scripts/rollup/packaging.js:253–273  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

251}
252
253async function prepareNpmPackage(name) {
254 await Promise.all([
255 asyncCopyTo('LICENSE', `build/node_modules/${name}/LICENSE`),
256 asyncCopyTo(
257 `packages/${name}/package.json`,
258 `build/node_modules/${name}/package.json`
259 ),
260 asyncCopyTo(
261 `packages/${name}/README.md`,
262 `build/node_modules/${name}/README.md`
263 ),
264 asyncCopyTo(`packages/${name}/npm`, `build/node_modules/${name}`),
265 ]);
266 filterOutEntrypoints(name);
267 const tgzName = (
268 await asyncExecuteCommand(`npm pack build/node_modules/${name}`)
269 ).trim();
270 await asyncRimRaf(`build/node_modules/${name}`);
271 await asyncExtractTar(getTarOptions(tgzName, name));
272 unlinkSync(tgzName);
273}
274
275async function prepareNpmPackages() {
276 if (!existsSync('build/node_modules')) {

Callers

nothing calls this directly

Calls 6

filterOutEntrypointsFunction · 0.85
asyncExecuteCommandFunction · 0.85
asyncRimRafFunction · 0.85
asyncExtractTarFunction · 0.85
getTarOptionsFunction · 0.85
asyncCopyToFunction · 0.70

Tested by

no test coverage detected