Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlayer authored Sep 30, 2024
2 parents 99c79b6 + ba070b6 commit fded553
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ export class TagsProcessor extends BaseProcessor {
const debuggers = doesContribute('debuggers') ? ['debuggers'] : [];
const json = doesContribute('jsonValidation') ? ['json'] : [];
const remoteMenu = doesContribute('menus', 'statusBar/remoteIndicator') ? ['remote-menu'] : [];
const chatParticipants = doesContribute('chatParticipants') ? ['chat-participant'] : [];

const localizationContributions = ((contributes && contributes['localizations']) ?? []).reduce<string[]>(
(r, l) => [...r, `lp-${l.languageId}`, ...toLanguagePackTags(l.translations, l.languageId)],
Expand Down Expand Up @@ -710,6 +711,7 @@ export class TagsProcessor extends BaseProcessor {
...debuggers,
...json,
...remoteMenu,
...chatParticipants,
...localizationContributions,
...languageContributions,
...languageActivations,
Expand Down
4 changes: 2 additions & 2 deletions src/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,10 @@ async function _publishSignedPackage(api: GalleryApi, packageName: string, packa
const lineBreak = '\r\n';
form.setBoundary('0f411892-ef48-488f-89d3-4f0546e84723');
form.append('vsix', packageStream, {
header: `--${form.getBoundary()}${lineBreak}Content-Disposition: attachment; name=vsix; filename=${packageName}${lineBreak}Content-Type: application/octet-stream${lineBreak}${lineBreak}`
header: `--${form.getBoundary()}${lineBreak}Content-Disposition: attachment; name=vsix; filename=\"${packageName}\"${lineBreak}Content-Type: application/octet-stream${lineBreak}${lineBreak}`
});
form.append('sigzip', sigzipStream, {
header: `--${form.getBoundary()}${lineBreak}Content-Disposition: attachment; name=sigzip; filename=${sigzipName}${lineBreak}Content-Type: application/octet-stream${lineBreak}${lineBreak}`
header: `--${form.getBoundary()}${lineBreak}Content-Disposition: attachment; name=sigzip; filename=\"${sigzipName}\"${lineBreak}Content-Type: application/octet-stream${lineBreak}${lineBreak}`
});

const publishWithRetry = retry(handleWhen(err => err.message.includes('timeout')), {
Expand Down
16 changes: 16 additions & 0 deletions src/test/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,22 @@ describe('toVsixManifest', () => {
.then(result => assert.deepEqual(result.PackageManifest.Metadata[0].Tags[0], 'snippet,__web_extension'));
});

it('should automatically add chatParticipant tag', () => {
const manifest = {
name: 'test',
publisher: 'mocha',
version: '0.0.1',
engines: Object.create(null),
contributes: {
chatParticipants: [{ name: 'test', id: 'test' }],
},
};

return _toVsixManifest(manifest, [])
.then(parseXmlManifest)
.then(result => assert.deepEqual(result.PackageManifest.Metadata[0].Tags[0], 'chat-participant,__web_extension'));
});

it('should remove duplicate tags', () => {
const manifest = {
name: 'test',
Expand Down

0 comments on commit fded553

Please sign in to comment.