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

Function run

scripts/release/publish.js:14–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12const validateTags = require('./publish-commands/validate-tags');
13
14const run = async () => {
15 try {
16 const params = parseParams();
17
18 const isExperimental = params.tag === 'experimental';
19
20 params.cwd = join(__dirname, '..', '..');
21 params.packages = await getPublicPackages(isExperimental);
22
23 if (params.onlyPackages.length > 0) {
24 params.packages = params.packages.filter(packageName => {
25 return params.onlyPackages.includes(packageName);
26 });
27 }
28
29 await validateTags(params);
30 await confirmVersionAndTags(params);
31 // npm ownership / whoami no longer applies — OIDC trusted publishing
32 // verifies the publisher via the registry's per-package config, not via a
33 // logged-in npm user.
34
35 const packageNames = params.packages;
36
37 let failed = false;
38 for (let i = 0; i < packageNames.length; i++) {
39 try {
40 const packageName = packageNames[i];
41 await publishToNPM(params, packageName, null);
42 } catch (error) {
43 failed = true;
44 console.error(error.message);
45 console.log();
46 console.log(
47 theme.error`Publish failed. Will attempt to publish remaining packages.`
48 );
49 }
50 }
51 if (failed) {
52 console.log(theme.error`One or more packages failed to publish.`);
53 process.exit(1);
54 }
55 } catch (error) {
56 handleError(error);
57 }
58};
59
60run();

Callers 1

publish.jsFile · 0.70

Calls 5

getPublicPackagesFunction · 0.85
publishToNPMFunction · 0.85
exitMethod · 0.80
handleErrorFunction · 0.70
errorMethod · 0.65

Tested by

no test coverage detected