File tree 4 files changed +31
-3
lines changed
prepare-release-from-npm-commands
4 files changed +31
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,13 @@ const paramDefinitions = [
13
13
'Skip NPM and use the build already present in "build/node_modules".' ,
14
14
defaultValue : false ,
15
15
} ,
16
+ {
17
+ name : 'onlyPackages' ,
18
+ type : String ,
19
+ multiple : true ,
20
+ description : 'Packages to include in publishing' ,
21
+ defaultValue : [ ] ,
22
+ } ,
16
23
{
17
24
name : 'skipPackages' ,
18
25
type : String ,
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ const run = async () => {
28
28
29
29
params . packages = await getPublicPackages ( isExperimental ) ;
30
30
params . packages = params . packages . filter ( packageName => {
31
+ if ( params . onlyPackages . length > 0 ) {
32
+ return params . onlyPackages . includes ( packageName ) ;
33
+ }
31
34
return ! params . skipPackages . includes ( packageName ) ;
32
35
} ) ;
33
36
Original file line number Diff line number Diff line change @@ -19,6 +19,13 @@ const paramDefinitions = [
19
19
description : 'NPM tags to point to the new release.' ,
20
20
defaultValue : [ 'untagged' ] ,
21
21
} ,
22
+ {
23
+ name : 'onlyPackages' ,
24
+ type : String ,
25
+ multiple : true ,
26
+ description : 'Packages to include in publishing' ,
27
+ defaultValue : [ ] ,
28
+ } ,
22
29
{
23
30
name : 'skipPackages' ,
24
31
type : String ,
@@ -32,6 +39,11 @@ const paramDefinitions = [
32
39
description : 'Run in automated environment, without interactive prompts.' ,
33
40
defaultValue : false ,
34
41
} ,
42
+ {
43
+ name : 'publishVersion' ,
44
+ type : String ,
45
+ description : 'Version to publish' ,
46
+ } ,
35
47
] ;
36
48
37
49
module . exports = ( ) => {
Original file line number Diff line number Diff line change @@ -23,14 +23,20 @@ const run = async () => {
23
23
try {
24
24
const params = parseParams ( ) ;
25
25
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 ;
29
29
const isExperimental = version . includes ( 'experimental' ) ;
30
30
31
31
params . cwd = join ( __dirname , '..' , '..' ) ;
32
32
params . packages = await getPublicPackages ( isExperimental ) ;
33
33
34
+ if ( params . onlyPackages . length > 0 ) {
35
+ params . packages = params . packages . filter ( packageName => {
36
+ return params . onlyPackages . includes ( packageName ) ;
37
+ } ) ;
38
+ }
39
+
34
40
// Pre-filter any skipped packages to simplify the following commands.
35
41
// As part of doing this we can also validate that none of the skipped packages were misspelled.
36
42
params . skipPackages . forEach ( packageName => {
You can’t perform that action at this time.
0 commit comments