File tree Expand file tree Collapse file tree 4 files changed +31
-3
lines changed
prepare-release-from-npm-commands Expand file tree Collapse file tree 4 files changed +31
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,13 @@ const paramDefinitions = [
1313 'Skip NPM and use the build already present in "build/node_modules".' ,
1414 defaultValue : false ,
1515 } ,
16+ {
17+ name : 'onlyPackages' ,
18+ type : String ,
19+ multiple : true ,
20+ description : 'Packages to include in publishing' ,
21+ defaultValue : [ ] ,
22+ } ,
1623 {
1724 name : 'skipPackages' ,
1825 type : String ,
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ const run = async () => {
2828
2929 params . packages = await getPublicPackages ( isExperimental ) ;
3030 params . packages = params . packages . filter ( packageName => {
31+ if ( params . onlyPackages . length > 0 ) {
32+ return params . onlyPackages . includes ( packageName ) ;
33+ }
3134 return ! params . skipPackages . includes ( packageName ) ;
3235 } ) ;
3336
Original file line number Diff line number Diff line change @@ -19,6 +19,13 @@ const paramDefinitions = [
1919 description : 'NPM tags to point to the new release.' ,
2020 defaultValue : [ 'untagged' ] ,
2121 } ,
22+ {
23+ name : 'onlyPackages' ,
24+ type : String ,
25+ multiple : true ,
26+ description : 'Packages to include in publishing' ,
27+ defaultValue : [ ] ,
28+ } ,
2229 {
2330 name : 'skipPackages' ,
2431 type : String ,
@@ -32,6 +39,11 @@ const paramDefinitions = [
3239 description : 'Run in automated environment, without interactive prompts.' ,
3340 defaultValue : false ,
3441 } ,
42+ {
43+ name : 'publishVersion' ,
44+ type : String ,
45+ description : 'Version to publish' ,
46+ } ,
3547] ;
3648
3749module . exports = ( ) => {
Original file line number Diff line number Diff line change @@ -23,14 +23,20 @@ const run = async () => {
2323 try {
2424 const params = parseParams ( ) ;
2525
26- const version = readJsonSync (
27- './build/node_modules/react/package.json'
28- ) . version ;
26+ const version =
27+ params . publishVersion ??
28+ readJsonSync ( './build/node_modules/react/package.json' ) . version ;
2929 const isExperimental = version . includes ( 'experimental' ) ;
3030
3131 params . cwd = join ( __dirname , '..' , '..' ) ;
3232 params . packages = await getPublicPackages ( isExperimental ) ;
3333
34+ if ( params . onlyPackages . length > 0 ) {
35+ params . packages = params . packages . filter ( packageName => {
36+ return params . onlyPackages . includes ( packageName ) ;
37+ } ) ;
38+ }
39+
3440 // Pre-filter any skipped packages to simplify the following commands.
3541 // As part of doing this we can also validate that none of the skipped packages were misspelled.
3642 params . skipPackages . forEach ( packageName => {
You can’t perform that action at this time.
0 commit comments