From fb9170a7078a3b2be86c9e246a63e0591492978b Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Mon, 24 Aug 2020 16:35:44 +0200 Subject: [PATCH] check for supported web extensions also while packing --- src/main.ts | 4 ++-- src/package.ts | 8 ++++++++ src/publish.ts | 11 ++--------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/main.ts b/src/main.ts index 4f6233c..2a7cec9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -76,7 +76,7 @@ module.exports = function (argv: string[]): void { .option('--yarn', 'Use yarn instead of npm') .option('--ignoreFile [path]', 'Indicate alternative .vscodeignore') .option('--noGitHubIssueLinking', 'Prevent automatic expansion of GitHub-style issue syntax into links') - .option('--web', 'Experimental flag to enable packing web extension') + .option('--web', 'Experimental flag to enable packing web extensions. Note: This is supported only for selected extensions.') .action(({ out, githubBranch, baseContentUrl, baseImagesUrl, yarn, ignoreFile, noGitHubIssueLinking, web }) => main(packageCommand({ packagePath: out, githubBranch, baseContentUrl, baseImagesUrl, useYarn: yarn, ignoreFile, expandGitHubIssueLinks: noGitHubIssueLinking, web }))); program @@ -91,7 +91,7 @@ module.exports = function (argv: string[]): void { .option('--yarn', 'Use yarn instead of npm while packing extension files') .option('--noVerify') .option('--ignoreFile [path]', 'Indicate alternative .vscodeignore') - .option('--web', 'Experimental flag to enable publishing web extension. Note: This is supported only for selected extensions.') + .option('--web', 'Experimental flag to enable packing web extensions. Note: This is supported only for selected extensions.') .action((version, { pat, message, packagePath, githubBranch, baseContentUrl, baseImagesUrl, yarn, noVerify, ignoreFile, web }) => main(publish({ pat, commitMessage: message, version, packagePath, githubBranch, baseContentUrl, baseImagesUrl, useYarn: yarn, noVerify, ignoreFile, web }))); program diff --git a/src/package.ts b/src/package.ts index 42d701f..697a6ed 100644 --- a/src/package.ts +++ b/src/package.ts @@ -17,6 +17,7 @@ import * as urljoin from 'url-join'; import { validatePublisher, validateExtensionName, validateVersion, validateEngineCompatibility, validateVSCodeTypesCompatibility } from './validation'; import { getDependencies } from './npm'; import { IExtensionsReport } from './publicgalleryapi'; +import { getPublicGalleryAPI } from './util'; const readFile = denodeify(fs.readFile); const unlink = denodeify(fs.unlink as any); @@ -1060,6 +1061,13 @@ export async function pack(options: IPackageOptions = {}): Promise { throw new Error('Extensions using proposed API (enableProposedApi: true) can\'t be published to the Marketplace'); } - if (options.web && isWebKind(manifest)) { - const extensionsReport = await getPublicGalleryAPI().getExtensionsReport(); - if (!isSupportedWebExtension(manifest, extensionsReport)) { - throw new Error(`Unsupported web extensions can\'t be published to the Marketplace`); - } - } - const patPromise = options.pat ? Promise.resolve(options.pat) : getPublisher(manifest.publisher).then(p => p.pat);