parent
ee9bd7e823
commit
7bf31e59b7
4 changed files with 25 additions and 1 deletions
|
@ -6,7 +6,7 @@
|
|||
<Description xml:space="preserve"><%- description %></Description>
|
||||
<Tags><%- tags %></Tags>
|
||||
<Categories><%- categories %></Categories>
|
||||
<GalleryFlags>Public</GalleryFlags>
|
||||
<GalleryFlags><%- flags %></GalleryFlags>
|
||||
<Properties>
|
||||
<% if (links.repository) { %>
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Source" Value="<%- links.repository %>" />
|
||||
|
|
|
@ -17,6 +17,7 @@ export interface Manifest {
|
|||
activationEvents?: string[];
|
||||
extensionDependencies?: string[];
|
||||
galleryBanner?: { color?: string; theme?: string; };
|
||||
preview?: boolean;
|
||||
_bundling?: { [name: string]: string; }[];
|
||||
_testing?: string;
|
||||
|
||||
|
|
|
@ -94,6 +94,12 @@ class MainProcessor extends BaseProcessor {
|
|||
constructor(manifest: Manifest) {
|
||||
super(manifest);
|
||||
|
||||
const flags = ['Public'];
|
||||
|
||||
if (manifest.preview) {
|
||||
flags.push('Preview');
|
||||
}
|
||||
|
||||
_.assign(this.vsix, {
|
||||
id: manifest.name,
|
||||
displayName: manifest.displayName || manifest.name,
|
||||
|
@ -102,6 +108,7 @@ class MainProcessor extends BaseProcessor {
|
|||
description: manifest.description || '',
|
||||
tags: (manifest.keywords || []).concat('vscode').join(','),
|
||||
categories: (manifest.categories || []).join(','),
|
||||
flags: flags.join(' '),
|
||||
links: {
|
||||
repository: getUrl(manifest.repository),
|
||||
bugs: getUrl(manifest.bugs),
|
||||
|
|
|
@ -411,6 +411,22 @@ describe('toVsixManifest', () => {
|
|||
assert.ok(categories.some(c => c === 'world'));
|
||||
});
|
||||
});
|
||||
|
||||
it('should respect preview flag', () => {
|
||||
const manifest = {
|
||||
name: 'test',
|
||||
publisher: 'mocha',
|
||||
version: '0.0.1',
|
||||
engines: Object.create(null),
|
||||
preview: true
|
||||
};
|
||||
|
||||
return _toVsixManifest(manifest, [])
|
||||
.then(xml => parseXml(xml))
|
||||
.then(result => {
|
||||
assert.deepEqual(result.PackageManifest.Metadata[0].GalleryFlags, ['Public Preview']);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('toContentTypes', () => {
|
||||
|
|
Loading…
Add table
Reference in a new issue