File tree 4 files changed +29
-0
lines changed 4 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ module.exports = function (argv: string[]): void {
102
102
. option ( '--no-gitHubIssueLinking' , 'Disable automatic expansion of GitHub-style issue syntax into links' )
103
103
. option ( '--no-gitLabIssueLinking' , 'Disable automatic expansion of GitLab-style issue syntax into links' )
104
104
. option ( '--no-dependencies' , 'Disable dependency detection via npm or yarn' )
105
+ . option ( '--pre-release' , 'Mark this package as a pre-release' )
105
106
. action (
106
107
(
107
108
version ,
@@ -121,6 +122,7 @@ module.exports = function (argv: string[]): void {
121
122
gitHubIssueLinking,
122
123
gitLabIssueLinking,
123
124
dependencies,
125
+ preRelease,
124
126
}
125
127
) =>
126
128
main (
@@ -141,6 +143,7 @@ module.exports = function (argv: string[]): void {
141
143
gitHubIssueLinking,
142
144
gitLabIssueLinking,
143
145
dependencies,
146
+ preRelease,
144
147
} )
145
148
)
146
149
) ;
@@ -176,6 +179,7 @@ module.exports = function (argv: string[]): void {
176
179
. option ( '--noVerify' )
177
180
. option ( '--ignoreFile <path>' , 'Indicate alternative .vscodeignore' )
178
181
. option ( '--no-dependencies' , 'Disable dependency detection via npm or yarn' )
182
+ . option ( '--pre-release' , 'Mark this package as a pre-release' )
179
183
. action (
180
184
(
181
185
version ,
@@ -194,6 +198,7 @@ module.exports = function (argv: string[]): void {
194
198
noVerify,
195
199
ignoreFile,
196
200
dependencies,
201
+ preRelease,
197
202
}
198
203
) =>
199
204
main (
@@ -213,6 +218,7 @@ module.exports = function (argv: string[]): void {
213
218
noVerify,
214
219
ignoreFile,
215
220
dependencies,
221
+ preRelease,
216
222
} )
217
223
)
218
224
) ;
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ export interface IPackageOptions {
85
85
readonly gitHubIssueLinking ?: boolean ;
86
86
readonly gitLabIssueLinking ?: boolean ;
87
87
readonly dependencies ?: boolean ;
88
+ readonly preRelease ?: boolean ;
88
89
}
89
90
90
91
export interface IProcessor {
@@ -124,6 +125,7 @@ export interface VSIX {
124
125
extensionPack : string ;
125
126
extensionKind : string ;
126
127
localizedLanguages : string ;
128
+ preRelease : boolean ;
127
129
}
128
130
129
131
export class BaseProcessor implements IProcessor {
@@ -438,6 +440,7 @@ export class ManifestProcessor extends BaseProcessor {
438
440
. map ( loc => loc . localizedLanguageName ?? loc . languageName ?? loc . languageId )
439
441
. join ( ',' )
440
442
: '' ,
443
+ preRelease : ! ! this . options . preRelease ,
441
444
} ;
442
445
443
446
if ( isGitHub ) {
@@ -1248,6 +1251,7 @@ export async function toVsixManifest(vsix: VSIX): Promise<string> {
1248
1251
<Property Id="Microsoft.VisualStudio.Code.ExtensionPack" Value="${ escape ( vsix . extensionPack ) } " />
1249
1252
<Property Id="Microsoft.VisualStudio.Code.ExtensionKind" Value="${ escape ( vsix . extensionKind ) } " />
1250
1253
<Property Id="Microsoft.VisualStudio.Code.LocalizedLanguages" Value="${ escape ( vsix . localizedLanguages ) } " />
1254
+ ${ vsix . preRelease ? `<Property Id="Microsoft.VisualStudio.Code.PreRelease" Value="${ escape ( vsix . preRelease ) } " />` : '' }
1251
1255
${
1252
1256
! vsix . links . repository
1253
1257
? ''
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ export interface IPublishOptions {
30
30
readonly pat ?: string ;
31
31
readonly noVerify ?: boolean ;
32
32
readonly dependencies ?: boolean ;
33
+ readonly preRelease ?: boolean ;
33
34
}
34
35
35
36
export async function publish ( options : IPublishOptions = { } ) : Promise < any > {
Original file line number Diff line number Diff line change @@ -1639,6 +1639,24 @@ describe('toVsixManifest', () => {
1639
1639
1640
1640
throw new Error ( 'Should not reach here' ) ;
1641
1641
} ) ;
1642
+
1643
+ it ( 'should add prerelease property when --pre-release flag is passed' , async ( ) => {
1644
+ const manifest = createManifest ( ) ;
1645
+
1646
+ const raw = await _toVsixManifest ( manifest , [ ] , { preRelease : true } ) ;
1647
+ const xmlManifest = await parseXmlManifest ( raw ) ;
1648
+
1649
+ assertProperty ( xmlManifest , 'Microsoft.VisualStudio.Code.PreRelease' , 'true' ) ;
1650
+ } ) ;
1651
+
1652
+ it ( 'should not add prerelease property when --pre-release flag is not passed' , async ( ) => {
1653
+ const manifest = createManifest ( ) ;
1654
+
1655
+ const raw = await _toVsixManifest ( manifest , [ ] ) ;
1656
+ const xmlManifest = await parseXmlManifest ( raw ) ;
1657
+
1658
+ assertMissingProperty ( xmlManifest , 'Microsoft.VisualStudio.Code.PreRelease' ) ;
1659
+ } ) ;
1642
1660
} ) ;
1643
1661
1644
1662
describe ( 'qna' , ( ) => {
You can’t perform that action at this time.
0 commit comments