understand categories. fixes #23
This commit is contained in:
parent
beda83957b
commit
d6f2afbc88
4 changed files with 21 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
|||
<DisplayName>${ displayName }</DisplayName>
|
||||
<Description xml:space="preserve">${ description }</Description>
|
||||
<Tags>${ tags }</Tags>
|
||||
<Categories>${ categories }</Categories>
|
||||
<GalleryFlags>Public</GalleryFlags>
|
||||
<Properties>
|
||||
<% if (links.repository) { %>
|
||||
|
|
|
@ -25,6 +25,7 @@ export interface Manifest {
|
|||
displayName?: string;
|
||||
description?: string;
|
||||
keywords?: string[];
|
||||
categories?: string[];
|
||||
homepage?: string;
|
||||
bugs?: string | { url?: string; email?: string };
|
||||
license?: string;
|
||||
|
|
|
@ -93,6 +93,7 @@ class MainProcessor extends BaseProcessor {
|
|||
publisher: manifest.publisher,
|
||||
description: manifest.description || '',
|
||||
tags: (manifest.keywords || []).concat('vscode').join(','),
|
||||
categories: (manifest.categories || []).join(','),
|
||||
links: {
|
||||
repository: getUrl(manifest.repository),
|
||||
bugs: getUrl(manifest.bugs),
|
||||
|
|
|
@ -298,6 +298,24 @@ describe('toVsixManifest', () => {
|
|||
assert.ok(properties.some(p => p.Id === 'Microsoft.VisualStudio.Services.Links.Learn' && p.Value === 'https://github.com/Microsoft/vscode-spell-check'));
|
||||
});
|
||||
});
|
||||
|
||||
it('should understand categories', () => {
|
||||
const manifest = {
|
||||
name: 'test',
|
||||
publisher: 'mocha',
|
||||
version: '0.0.1',
|
||||
engines: Object.create(null),
|
||||
categories: ['hello', 'world']
|
||||
};
|
||||
|
||||
return toVsixManifest(manifest, [])
|
||||
.then(xml => parseXml(xml))
|
||||
.then(result => {
|
||||
const categories = result.PackageManifest.Metadata[0].Categories[0].split(',');
|
||||
assert.ok(categories.some(c => c === 'hello'));
|
||||
assert.ok(categories.some(c => c === 'world'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('toContentTypes', () => {
|
||||
|
|
Loading…
Add table
Reference in a new issue