3
3
'use strict' ;
4
4
5
5
const clear = require ( 'clear' ) ;
6
+ const { existsSync} = require ( 'fs' ) ;
6
7
const { readJsonSync} = require ( 'fs-extra' ) ;
8
+ const { join} = require ( 'path' ) ;
7
9
const theme = require ( '../theme' ) ;
8
10
9
11
const run = async ( { cwd, packages, tags} ) => {
@@ -25,6 +27,8 @@ const run = async ({cwd, packages, tags}) => {
25
27
theme `{header A canary release} {version ${ version } } {header has been published!}`
26
28
) ;
27
29
} else {
30
+ const nodeModulesPath = join ( cwd , 'build/node_modules' ) ;
31
+
28
32
console . log (
29
33
theme . caution `The release has been published but you're not done yet!`
30
34
) ;
@@ -78,14 +82,28 @@ const run = async ({cwd, packages, tags}) => {
78
82
console . log ( theme . command ` git push origin --tags` ) ;
79
83
80
84
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.` ) ;
85
86
console . log (
86
87
theme . link `https://github.com/facebook/react/releases/tag/v%s` ,
87
88
version
88
89
) ;
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
+ }
89
107
console . log ( ) ;
90
108
}
91
109
} ;
0 commit comments