@vscode/vsce 3.0.1-1 → 3.0.1-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/main.js +7 -0
- package/out/package.js +16 -2
- package/package.json +1 -1
package/out/main.js
CHANGED
|
@@ -227,6 +227,13 @@ module.exports = function (argv) {
|
|
|
227
227
|
.requiredOption('-i, --packagePath <path>', 'Path to the VSIX package')
|
|
228
228
|
.option('-o, --out <path>', 'Output the extension manifest to <path> location (defaults to <packagename>.manifest)')
|
|
229
229
|
.action(({ packagePath, out }) => main((0, package_1.generateManifest)(packagePath, out)));
|
|
230
|
+
commander_1.default
|
|
231
|
+
.command('verify-signature')
|
|
232
|
+
.description('Verifies the provided signature file against the provided VSIX package and manifest.')
|
|
233
|
+
.requiredOption('-i, --packagePath <path>', 'Path to the VSIX package')
|
|
234
|
+
.requiredOption('-m, --manifestPath <path>', 'Path to the Manifest file')
|
|
235
|
+
.requiredOption('-s, --signaturePath <path>', 'Path to the Signature file')
|
|
236
|
+
.action(({ packagePath, manifestPath, signaturePath }) => main((0, package_1.verifySignature)(packagePath, manifestPath, signaturePath)));
|
|
230
237
|
commander_1.default
|
|
231
238
|
.command('ls-publishers')
|
|
232
239
|
.description('Lists all known publishers')
|
package/out/package.js
CHANGED
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.printAndValidatePackagedFiles = exports.ls = exports.listFiles = exports.packageCommand = exports.createSignatureArchive = exports.generateManifest = exports.signPackage = exports.pack = exports.prepublish = exports.collect = exports.createDefaultProcessors = exports.processFiles = exports.toContentTypes = exports.toVsixManifest = exports.readManifest = exports.validateManifestForPackaging = exports.ValidationProcessor = exports.NLSProcessor = exports.isWebKind = exports.LicenseProcessor = exports.ChangelogProcessor = exports.ReadmeProcessor = exports.MarkdownProcessor = exports.TagsProcessor = exports.ManifestProcessor = exports.Targets = exports.versionBump = exports.BaseProcessor = exports.read = void 0;
|
|
29
|
+
exports.printAndValidatePackagedFiles = exports.ls = exports.listFiles = exports.packageCommand = exports.createSignatureArchive = exports.verifySignature = exports.generateManifest = exports.signPackage = exports.pack = exports.prepublish = exports.collect = exports.createDefaultProcessors = exports.processFiles = exports.toContentTypes = exports.toVsixManifest = exports.readManifest = exports.validateManifestForPackaging = exports.ValidationProcessor = exports.NLSProcessor = exports.isWebKind = exports.LicenseProcessor = exports.ChangelogProcessor = exports.ReadmeProcessor = exports.MarkdownProcessor = exports.TagsProcessor = exports.ManifestProcessor = exports.Targets = exports.versionBump = exports.BaseProcessor = exports.read = void 0;
|
|
30
30
|
const fs = __importStar(require("fs"));
|
|
31
31
|
const path = __importStar(require("path"));
|
|
32
32
|
const util_1 = require("util");
|
|
@@ -1395,6 +1395,20 @@ function generateManifest(packageFile, outputFile) {
|
|
|
1395
1395
|
return vsceSign.generateManifest(packageFile, outputFile);
|
|
1396
1396
|
}
|
|
1397
1397
|
exports.generateManifest = generateManifest;
|
|
1398
|
+
async function verifySignature(packageFile, manifestFile, signatureFile) {
|
|
1399
|
+
const sigzipPath = await createSignatureArchive(manifestFile, signatureFile);
|
|
1400
|
+
try {
|
|
1401
|
+
const result = await vsceSign.verify(packageFile, sigzipPath, true);
|
|
1402
|
+
console.log(`Signature verification result: ${result.code}`);
|
|
1403
|
+
if (result.output) {
|
|
1404
|
+
console.log(result.output);
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
finally {
|
|
1408
|
+
await fs.promises.unlink(sigzipPath);
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
exports.verifySignature = verifySignature;
|
|
1398
1412
|
// Create a signature zip file containing the manifest and signature file
|
|
1399
1413
|
async function createSignatureArchive(manifestFile, signatureFile, outputFile) {
|
|
1400
1414
|
return vsceSign.zip(manifestFile, signatureFile, outputFile);
|
|
@@ -1485,7 +1499,7 @@ async function printAndValidatePackagedFiles(files, cwd, manifest, options) {
|
|
|
1485
1499
|
message += unusedIncludePatterns.map(p => ` - ${p}`).join('\n');
|
|
1486
1500
|
message += '\nRemove any include pattern which is not needed.\n';
|
|
1487
1501
|
message += `\n=> Run ${chalk_1.default.bold('vsce ls --tree')} to see all included files.\n`;
|
|
1488
|
-
message += `=> Use ${chalk_1.default.bold('--allow-unused-files-
|
|
1502
|
+
message += `=> Use ${chalk_1.default.bold('--allow-unused-files-pattern')} to skip this check`;
|
|
1489
1503
|
util.log.error(message);
|
|
1490
1504
|
process.exit(1);
|
|
1491
1505
|
}
|