From bb7be2fd48eee63e99c4423dada49c9ac9f9460c Mon Sep 17 00:00:00 2001 From: BeniBenj Date: Fri, 27 Sep 2024 17:09:03 +0200 Subject: [PATCH 1/2] Auto Assign Chat Participant Tag --- src/package.ts | 2 ++ src/test/package.test.ts | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/package.ts b/src/package.ts index 682deff3..d960f155 100644 --- a/src/package.ts +++ b/src/package.ts @@ -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( (r, l) => [...r, `lp-${l.languageId}`, ...toLanguagePackTags(l.translations, l.languageId)], @@ -710,6 +711,7 @@ export class TagsProcessor extends BaseProcessor { ...debuggers, ...json, ...remoteMenu, + ...chatParticipants, ...localizationContributions, ...languageContributions, ...languageActivations, diff --git a/src/test/package.test.ts b/src/test/package.test.ts index 11b4d444..f1cf1962 100644 --- a/src/test/package.test.ts +++ b/src/test/package.test.ts @@ -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', From 16888c8e3e2e2350d8d53f85f8d31b38f31f91a9 Mon Sep 17 00:00:00 2001 From: Damon Tivel Date: Fri, 27 Sep 2024 10:48:23 -0700 Subject: [PATCH 2/2] Quote filename --- src/publish.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/publish.ts b/src/publish.ts index 853371ef..318eb7d3 100644 --- a/src/publish.ts +++ b/src/publish.ts @@ -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')), {