@@ -13,7 +13,7 @@ const tmpName = denodeify<string>(tmp.tmpName);
13
13
export interface IPublishOptions {
14
14
readonly packagePath ?: string [ ] ;
15
15
readonly version ?: string ;
16
- readonly target ?: string ;
16
+ readonly targets ?: string [ ] ;
17
17
readonly commitMessage ?: string ;
18
18
readonly gitTagVersion ?: boolean ;
19
19
readonly cwd ?: string ;
@@ -32,7 +32,7 @@ export async function publish(options: IPublishOptions = {}): Promise<any> {
32
32
if ( options . packagePath ) {
33
33
if ( options . version ) {
34
34
throw new Error ( `Both options not supported simultaneously: 'packagePath' and 'version'.` ) ;
35
- } else if ( options . target ) {
35
+ } else if ( options . targets ) {
36
36
throw new Error ( `Both options not supported simultaneously: 'packagePath' and 'target'.` ) ;
37
37
}
38
38
@@ -51,13 +51,27 @@ export async function publish(options: IPublishOptions = {}): Promise<any> {
51
51
} else {
52
52
await versionBump ( options . cwd , options . version , options . commitMessage , options . gitTagVersion ) ;
53
53
54
- const packagePath = await tmpName ( ) ;
55
- const packageResult = await pack ( { ...options , packagePath } ) ;
56
- await _publish ( packagePath , packageResult . manifest , options ) ;
54
+ if ( options . targets ) {
55
+ for ( const target of options . targets ) {
56
+ const packagePath = await tmpName ( ) ;
57
+ const packageResult = await pack ( { ...options , target, packagePath } ) ;
58
+ await _publish ( packagePath , packageResult . manifest , { ...options , target } ) ;
59
+ }
60
+ } else {
61
+ const packagePath = await tmpName ( ) ;
62
+ const packageResult = await pack ( { ...options , packagePath } ) ;
63
+ await _publish ( packagePath , packageResult . manifest , options ) ;
64
+ }
57
65
}
58
66
}
59
67
60
- async function _publish ( packagePath : string , manifest : Manifest , options : IPublishOptions ) {
68
+ export interface IInternalPublishOptions {
69
+ readonly target ?: string ;
70
+ readonly pat ?: string ;
71
+ readonly noVerify ?: boolean ;
72
+ }
73
+
74
+ async function _publish ( packagePath : string , manifest : Manifest , options : IInternalPublishOptions ) {
61
75
if ( ! options . noVerify && manifest . enableProposedApi ) {
62
76
throw new Error ( "Extensions using proposed API (enableProposedApi: true) can't be published to the Marketplace" ) ;
63
77
}
0 commit comments