@vscode/vsce
Advanced tools
Comparing version 3.0.0 to 3.0.1-0
@@ -80,3 +80,3 @@ "use strict"; | ||
} | ||
validateMarketplaceRequirements(vsix.manifest, options); | ||
const manifestValidated = validateManifestForPublishing(vsix.manifest, options); | ||
let sigzipPath; | ||
@@ -92,3 +92,3 @@ if (options.manifestPath?.[index] && options.signaturePath?.[index]) { | ||
} | ||
await _publish(packagePath, sigzipPath, vsix.manifest, { ...options, target }); | ||
await _publish(packagePath, sigzipPath, manifestValidated, { ...options, target }); | ||
} | ||
@@ -101,3 +101,3 @@ } | ||
// Validate marketplace requirements before prepublish to avoid unnecessary work | ||
validateMarketplaceRequirements(manifest, options); | ||
validateManifestForPublishing(manifest, options); | ||
await (0, package_1.prepublish)(cwd, manifest, options.useYarn); | ||
@@ -109,4 +109,5 @@ await (0, package_1.versionBump)(options); | ||
const packageResult = await (0, package_1.pack)({ ...options, target, packagePath }); | ||
const manifestValidated = validateManifestForPublishing(packageResult.manifest, options); | ||
const sigzipPath = options.signTool ? await (0, package_1.signPackage)(packagePath, options.signTool) : undefined; | ||
await _publish(packagePath, sigzipPath, packageResult.manifest, { ...options, target }); | ||
await _publish(packagePath, sigzipPath, manifestValidated, { ...options, target }); | ||
} | ||
@@ -117,4 +118,5 @@ } | ||
const packageResult = await (0, package_1.pack)({ ...options, packagePath }); | ||
const manifestValidated = validateManifestForPublishing(packageResult.manifest, options); | ||
const sigzipPath = options.signTool ? await (0, package_1.signPackage)(packagePath, options.signTool) : undefined; | ||
await _publish(packagePath, sigzipPath, packageResult.manifest, options); | ||
await _publish(packagePath, sigzipPath, manifestValidated, options); | ||
} | ||
@@ -227,3 +229,3 @@ } | ||
const manifest = await (0, package_1.readManifest)(options.cwd); | ||
publisher = manifest.publisher; | ||
publisher = (0, validation_1.validatePublisher)(manifest.publisher); | ||
name = manifest.name; | ||
@@ -244,4 +246,3 @@ } | ||
exports.unpublish = unpublish; | ||
function validateMarketplaceRequirements(manifest, options) { | ||
(0, validation_1.validatePublisher)(manifest.publisher); | ||
function validateManifestForPublishing(manifest, options) { | ||
if (manifest.enableProposedApi && !options.allowAllProposedApis && !options.noVerify) { | ||
@@ -256,2 +257,3 @@ throw new Error("Extensions using proposed API (enableProposedApi: true) can't be published to the Marketplace. Use --allow-all-proposed-apis to bypass. https://code.visualstudio.com/api/advanced-topics/using-proposed-api"); | ||
} | ||
return { ...manifest, publisher: (0, validation_1.validatePublisher)(manifest.publisher) }; | ||
} | ||
@@ -258,0 +260,0 @@ async function getPAT(publisher, options) { |
@@ -116,3 +116,3 @@ "use strict"; | ||
async function verifyPat(options) { | ||
const publisherName = options.publisherName ?? (await (0, package_1.readManifest)()).publisher; | ||
const publisherName = options.publisherName ?? (0, validation_1.validatePublisher)((await (0, package_1.readManifest)()).publisher); | ||
const pat = await (0, publish_1.getPAT)(publisherName, options); | ||
@@ -119,0 +119,0 @@ try { |
@@ -40,2 +40,3 @@ "use strict"; | ||
} | ||
return publisher; | ||
} | ||
@@ -50,2 +51,3 @@ exports.validatePublisher = validatePublisher; | ||
} | ||
return name; | ||
} | ||
@@ -60,2 +62,3 @@ exports.validateExtensionName = validateExtensionName; | ||
} | ||
return version; | ||
} | ||
@@ -70,2 +73,3 @@ exports.validateVersion = validateVersion; | ||
} | ||
return version; | ||
} | ||
@@ -72,0 +76,0 @@ exports.validateEngineCompatibility = validateEngineCompatibility; |
@@ -7,2 +7,3 @@ "use strict"; | ||
const util_1 = require("./util"); | ||
const package_1 = require("./package"); | ||
async function bufferStream(stream) { | ||
@@ -53,4 +54,12 @@ return await new Promise((c, e) => { | ||
} | ||
const manifest = JSON.parse(rawManifest.toString('utf8')); | ||
let manifestValidated; | ||
try { | ||
manifestValidated = (0, package_1.validateManifestForPackaging)(manifest); | ||
} | ||
catch (error) { | ||
throw new Error(`Invalid extension VSIX manifest: ${error}`); | ||
} | ||
return { | ||
manifest: JSON.parse(rawManifest.toString('utf8')), | ||
manifest: manifestValidated, | ||
xmlManifest: await (0, xml_1.parseXmlManifest)(rawXmlManifest.toString('utf8')), | ||
@@ -57,0 +66,0 @@ }; |
{ | ||
"name": "@vscode/vsce", | ||
"version": "3.0.0", | ||
"version": "3.0.1-0", | ||
"description": "VS Code Extensions Manager", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
181452
3642
1