@vscode/vsce 2.26.2-5 → 2.27.1-0
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/dist/vsce.d.ts +2 -0
- package/out/main.js +11 -1
- package/out/package.js +19 -6
- package/out/publish.js +12 -1
- package/package.json +1 -1
package/dist/vsce.d.ts
CHANGED
|
@@ -175,6 +175,8 @@ export declare interface IPublishOptions {
|
|
|
175
175
|
readonly skipDuplicate?: boolean;
|
|
176
176
|
readonly skipLicense?: boolean;
|
|
177
177
|
readonly sigzipPath?: string[];
|
|
178
|
+
readonly manifestPath?: string[];
|
|
179
|
+
readonly signaturePath?: string[];
|
|
178
180
|
readonly signTool?: string;
|
|
179
181
|
}
|
|
180
182
|
|
package/out/main.js
CHANGED
|
@@ -154,6 +154,8 @@ module.exports = function (argv) {
|
|
|
154
154
|
.option('--no-git-tag-version', 'Do not create a version commit and tag when calling `npm version`. Valid only when [version] is provided.')
|
|
155
155
|
.option('--no-update-package-json', 'Do not update `package.json`. Valid only when [version] is provided.')
|
|
156
156
|
.option('-i, --packagePath <paths...>', 'Publish the provided VSIX packages.')
|
|
157
|
+
.option('--manifestPath <paths...>', 'Manifest files to publish alongside the VSIX packages.')
|
|
158
|
+
.option('--signaturePath <paths...>', 'Signature files to publish alongside the VSIX packages.')
|
|
157
159
|
.option('--sigzipPath <paths...>', 'Signature archives to publish alongside the VSIX packages.')
|
|
158
160
|
.option('--sign-tool <path>', 'Path to the VSIX signing tool. Will be invoked with two arguments: `SIGNTOOL <path/to/extension.signature.manifest> <path/to/extension.signature.p7s>`. This will be ignored if --sigzipPath is provided.')
|
|
159
161
|
.option('--githubBranch <branch>', 'The GitHub branch used to infer relative links in README.md. Can be overridden by --baseContentUrl and --baseImagesUrl.')
|
|
@@ -174,7 +176,7 @@ module.exports = function (argv) {
|
|
|
174
176
|
.option('--allow-missing-repository', 'Allow missing a repository URL in package.json')
|
|
175
177
|
.option('--skip-duplicate', 'Fail silently if version already exists on the marketplace')
|
|
176
178
|
.option('--skip-license', 'Allow publishing without license file')
|
|
177
|
-
.action((version, { pat, azureCredential, target, ignoreOtherTargetFolders, readmePath, changelogPath, message, gitTagVersion, updatePackageJson, packagePath, sigzipPath, githubBranch, gitlabBranch, baseContentUrl, baseImagesUrl, yarn, noVerify, allowProposedApis, allowAllProposedApis, ignoreFile, dependencies, preRelease, allowStarActivation, allowMissingRepository, skipDuplicate, skipLicense, signTool, }) => main((0, publish_1.publish)({
|
|
179
|
+
.action((version, { pat, azureCredential, target, ignoreOtherTargetFolders, readmePath, changelogPath, message, gitTagVersion, updatePackageJson, packagePath, manifestPath, signaturePath, sigzipPath, githubBranch, gitlabBranch, baseContentUrl, baseImagesUrl, yarn, noVerify, allowProposedApis, allowAllProposedApis, ignoreFile, dependencies, preRelease, allowStarActivation, allowMissingRepository, skipDuplicate, skipLicense, signTool, }) => main((0, publish_1.publish)({
|
|
178
180
|
pat,
|
|
179
181
|
azureCredential,
|
|
180
182
|
version,
|
|
@@ -186,6 +188,8 @@ module.exports = function (argv) {
|
|
|
186
188
|
gitTagVersion,
|
|
187
189
|
updatePackageJson,
|
|
188
190
|
packagePath,
|
|
191
|
+
manifestPath,
|
|
192
|
+
signaturePath,
|
|
189
193
|
sigzipPath,
|
|
190
194
|
githubBranch,
|
|
191
195
|
gitlabBranch,
|
|
@@ -211,6 +215,12 @@ module.exports = function (argv) {
|
|
|
211
215
|
.option('--azure-credential', 'Use Microsoft Entra ID for authentication')
|
|
212
216
|
.option('-f, --force', 'Skip confirmation prompt when unpublishing an extension')
|
|
213
217
|
.action((id, { pat, azureCredential, force }) => main((0, publish_1.unpublish)({ id, pat, azureCredential, force })));
|
|
218
|
+
commander_1.default
|
|
219
|
+
.command('generate-manifest')
|
|
220
|
+
.description('Generates the extension manifest from the provided VSIX package.')
|
|
221
|
+
.requiredOption('-i, --packagePath <path>', 'Path to the VSIX package')
|
|
222
|
+
.option('-o, --out <path>', 'Output the extension manifest to <path> location (defaults to <packagename>.manifest)')
|
|
223
|
+
.action((packagePath, out) => main((0, package_1.generateManifest)(packagePath, out)));
|
|
214
224
|
commander_1.default
|
|
215
225
|
.command('ls-publishers')
|
|
216
226
|
.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.ls = exports.listFiles = exports.packageCommand = exports.signPackage = exports.pack = exports.prepublish = exports.collect = exports.createDefaultProcessors = exports.processFiles = exports.toContentTypes = exports.toVsixManifest = exports.readManifest = exports.validateManifest = 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.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.validateManifest = 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");
|
|
@@ -47,7 +47,7 @@ const npm_1 = require("./npm");
|
|
|
47
47
|
const GitHost = __importStar(require("hosted-git-info"));
|
|
48
48
|
const parse_semver_1 = __importDefault(require("parse-semver"));
|
|
49
49
|
const jsonc = __importStar(require("jsonc-parser"));
|
|
50
|
-
const
|
|
50
|
+
const vsceSign = __importStar(require("@vscode/vsce-sign"));
|
|
51
51
|
const MinimatchOptions = { dot: true };
|
|
52
52
|
function isInMemoryFile(file) {
|
|
53
53
|
return !!file.contents;
|
|
@@ -1356,14 +1356,27 @@ async function signPackage(packageFile, signTool) {
|
|
|
1356
1356
|
const manifestFile = path.join(packageFolder, `${packageName}.signature.manifest`);
|
|
1357
1357
|
const signatureFile = path.join(packageFolder, `${packageName}.signature.p7s`);
|
|
1358
1358
|
const signatureZip = path.join(packageFolder, `${packageName}.signature.zip`);
|
|
1359
|
-
|
|
1360
|
-
await (0, vsce_sign_1.generateManifest)(packageFile, manifestFile);
|
|
1359
|
+
await generateManifest(packageFile, manifestFile);
|
|
1361
1360
|
// Sign the manifest file to generate the signature file
|
|
1362
1361
|
cp.execSync(`${signTool} "${manifestFile}" "${signatureFile}"`, { stdio: 'inherit' });
|
|
1363
|
-
|
|
1364
|
-
return (0, vsce_sign_1.zip)(manifestFile, signatureFile, signatureZip);
|
|
1362
|
+
return createSignatureArchive(manifestFile, signatureFile, signatureZip);
|
|
1365
1363
|
}
|
|
1366
1364
|
exports.signPackage = signPackage;
|
|
1365
|
+
// Generate the signature manifest file
|
|
1366
|
+
function generateManifest(packageFile, outputFile) {
|
|
1367
|
+
if (!outputFile) {
|
|
1368
|
+
const packageFolder = path.dirname(packageFile);
|
|
1369
|
+
const packageName = path.basename(packageFile, '.vsix');
|
|
1370
|
+
outputFile = path.join(packageFolder, `${packageName}.manifest`);
|
|
1371
|
+
}
|
|
1372
|
+
return vsceSign.generateManifest(packageFile, outputFile);
|
|
1373
|
+
}
|
|
1374
|
+
exports.generateManifest = generateManifest;
|
|
1375
|
+
// Create a signature zip file containing the manifest and signature file
|
|
1376
|
+
async function createSignatureArchive(manifestFile, signatureFile, outputFile) {
|
|
1377
|
+
return vsceSign.zip(manifestFile, signatureFile, outputFile);
|
|
1378
|
+
}
|
|
1379
|
+
exports.createSignatureArchive = createSignatureArchive;
|
|
1367
1380
|
async function packageCommand(options = {}) {
|
|
1368
1381
|
const cwd = options.cwd || process.cwd();
|
|
1369
1382
|
const manifest = await readManifest(cwd);
|
package/out/publish.js
CHANGED
|
@@ -49,6 +49,11 @@ async function publish(options = {}) {
|
|
|
49
49
|
else if (options.targets) {
|
|
50
50
|
throw new Error(`Both options not supported simultaneously: 'packagePath' and 'target'. Use 'vsce package --target <target>' to first create a platform specific package, then use 'vsce publish --packagePath <path>' to publish it.`);
|
|
51
51
|
}
|
|
52
|
+
if (options.manifestPath || options.signaturePath) {
|
|
53
|
+
if (options.packagePath.length !== options.manifestPath?.length || options.packagePath.length !== options.signaturePath?.length) {
|
|
54
|
+
throw new Error(`Either all packages must be signed or none of them.`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
52
57
|
for (let index = 0; index < options.packagePath.length; index++) {
|
|
53
58
|
const packagePath = options.packagePath[index];
|
|
54
59
|
const vsix = await (0, zip_1.readVSIXPackage)(packagePath);
|
|
@@ -72,7 +77,13 @@ async function publish(options = {}) {
|
|
|
72
77
|
}
|
|
73
78
|
}
|
|
74
79
|
validateMarketplaceRequirements(vsix.manifest, options);
|
|
75
|
-
let sigzipPath
|
|
80
|
+
let sigzipPath;
|
|
81
|
+
if (options.manifestPath?.[index] && options.signaturePath?.[index]) {
|
|
82
|
+
sigzipPath = await (0, package_1.createSignatureArchive)(options.manifestPath[index], options.signaturePath[index]);
|
|
83
|
+
}
|
|
84
|
+
if (!sigzipPath) {
|
|
85
|
+
sigzipPath = options.sigzipPath?.[index];
|
|
86
|
+
}
|
|
76
87
|
if (!sigzipPath && options.signTool) {
|
|
77
88
|
sigzipPath = await (0, package_1.signPackage)(packagePath, options.signTool);
|
|
78
89
|
}
|