Skip to content

Commit 0e67969

Browse files
authored
Prompt to include UMD build artifact links in GitHub release (#14864)
1 parent fad0842 commit 0e67969

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

scripts/release/publish-commands/print-follow-up-instructions.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
'use strict';
44

55
const clear = require('clear');
6+
const {existsSync} = require('fs');
67
const {readJsonSync} = require('fs-extra');
8+
const {join} = require('path');
79
const theme = require('../theme');
810

911
const run = async ({cwd, packages, tags}) => {
@@ -25,6 +27,8 @@ const run = async ({cwd, packages, tags}) => {
2527
theme`{header A canary release} {version ${version}} {header has been published!}`
2628
);
2729
} else {
30+
const nodeModulesPath = join(cwd, 'build/node_modules');
31+
2832
console.log(
2933
theme.caution`The release has been published but you're not done yet!`
3034
);
@@ -78,14 +82,28 @@ const run = async ({cwd, packages, tags}) => {
7882
console.log(theme.command` git push origin --tags`);
7983

8084
console.log();
81-
console.log(
82-
theme.header`Lastly, please fill in the release on GitHub. ` +
83-
theme`Don't forget to attach build artifacts from {path build/node_modules/}`
84-
);
85+
console.log(theme.header`Lastly, please fill in the release on GitHub.`);
8586
console.log(
8687
theme.link`https://github.com/facebook/react/releases/tag/v%s`,
8788
version
8889
);
90+
console.log(
91+
theme`\nThe GitHub release should also include links to the following artifacts:`
92+
);
93+
for (let i = 0; i < packages.length; i++) {
94+
const packageName = packages[i];
95+
if (existsSync(join(nodeModulesPath, packageName, 'umd'))) {
96+
const {version: packageVersion} = readJsonSync(
97+
join(nodeModulesPath, packageName, 'package.json')
98+
);
99+
console.log(
100+
theme`{path • %s:} {link https://unpkg.com/%s@%s/umd/}`,
101+
packageName,
102+
packageName,
103+
packageVersion
104+
);
105+
}
106+
}
89107
console.log();
90108
}
91109
};

0 commit comments

Comments
 (0)