@rushstack/heft-vscode-extension-plugin 0.2.2 → 0.2.4
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/heft-plugin.json +36 -2
- package/lib/VSCodeExtensionPublishPlugin.d.ts.map +1 -1
- package/lib/VSCodeExtensionPublishPlugin.js +49 -24
- package/lib/VSCodeExtensionVerifySignaturePlugin.d.ts +8 -0
- package/lib/VSCodeExtensionVerifySignaturePlugin.d.ts.map +1 -0
- package/lib/VSCodeExtensionVerifySignaturePlugin.js +78 -0
- package/package.json +5 -5
package/heft-plugin.json
CHANGED
|
@@ -6,6 +6,34 @@
|
|
|
6
6
|
"entryPoint": "./lib/VSCodeExtensionPackagePlugin.js",
|
|
7
7
|
"parameterScope": "package"
|
|
8
8
|
},
|
|
9
|
+
{
|
|
10
|
+
"pluginName": "vscode-extension-verify-signature-plugin",
|
|
11
|
+
"entryPoint": "./lib/VSCodeExtensionVerifySignaturePlugin.js",
|
|
12
|
+
"parameterScope": "verify-signature",
|
|
13
|
+
"parameters": [
|
|
14
|
+
{
|
|
15
|
+
"longName": "--vsix-path",
|
|
16
|
+
"parameterKind": "string",
|
|
17
|
+
"argumentName": "RELATIVE_PATH",
|
|
18
|
+
"description": "Use this parameter to control which VSIX file will be used for verifying signature.",
|
|
19
|
+
"required": true
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"longName": "--manifest-path",
|
|
23
|
+
"parameterKind": "string",
|
|
24
|
+
"argumentName": "RELATIVE_PATH",
|
|
25
|
+
"description": "Use this parameter to control which manifest file will be used for verifying signature.",
|
|
26
|
+
"required": true
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"longName": "--signature-path",
|
|
30
|
+
"parameterKind": "string",
|
|
31
|
+
"argumentName": "RELATIVE_PATH",
|
|
32
|
+
"description": "Use this parameter to control which signature file will be used for verifying signature.",
|
|
33
|
+
"required": true
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
9
37
|
{
|
|
10
38
|
"pluginName": "vscode-extension-publish-plugin",
|
|
11
39
|
"entryPoint": "./lib/VSCodeExtensionPublishPlugin.js",
|
|
@@ -23,14 +51,20 @@
|
|
|
23
51
|
"parameterKind": "string",
|
|
24
52
|
"argumentName": "RELATIVE_PATH",
|
|
25
53
|
"description": "Use this parameter to control which manifest file will be used for publishing.",
|
|
26
|
-
"required":
|
|
54
|
+
"required": false
|
|
27
55
|
},
|
|
28
56
|
{
|
|
29
57
|
"longName": "--signature-path",
|
|
30
58
|
"parameterKind": "string",
|
|
31
59
|
"argumentName": "RELATIVE_PATH",
|
|
32
60
|
"description": "Use this parameter to control which signature file will be used for publishing.",
|
|
33
|
-
"required":
|
|
61
|
+
"required": false
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"longName": "--publish-unsigned",
|
|
65
|
+
"parameterKind": "flag",
|
|
66
|
+
"description": "Use this parameter to control whether to publish unsigned.",
|
|
67
|
+
"required": false
|
|
34
68
|
}
|
|
35
69
|
]
|
|
36
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VSCodeExtensionPublishPlugin.d.ts","sourceRoot":"","sources":["../src/VSCodeExtensionPublishPlugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,gBAAgB,
|
|
1
|
+
{"version":3,"file":"VSCodeExtensionPublishPlugin.d.ts","sourceRoot":"","sources":["../src/VSCodeExtensionPublishPlugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAIjB,MAAM,iBAAiB,CAAC;AAKzB,UAAU,oCAAoC;CAAG;AASjD,MAAM,CAAC,OAAO,OAAO,4BACnB,YAAW,eAAe,CAAC,oCAAoC,CAAC;IAEzD,KAAK,CACV,eAAe,EAAE,gBAAgB,EACjC,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,oCAAoC,GAClD,IAAI;CA2FR"}
|
|
@@ -41,42 +41,67 @@ const PLUGIN_NAME = 'vscode-extension-publish-plugin';
|
|
|
41
41
|
const VSIX_PATH_PARAMETER_NAME = '--vsix-path';
|
|
42
42
|
const MANIFEST_PATH_PARAMETER_NAME = '--manifest-path';
|
|
43
43
|
const SIGNATURE_PATH_PARAMETER_NAME = '--signature-path';
|
|
44
|
+
const PUBLISH_UNSIGNED_PARAMETER_NAME = '--publish-unsigned';
|
|
44
45
|
class VSCodeExtensionPublishPlugin {
|
|
45
46
|
apply(heftTaskSession, heftConfiguration, pluginOptions) {
|
|
46
47
|
const vsixPathParameter = heftTaskSession.parameters.getStringParameter(VSIX_PATH_PARAMETER_NAME);
|
|
47
48
|
const manifestPathParameter = heftTaskSession.parameters.getStringParameter(MANIFEST_PATH_PARAMETER_NAME);
|
|
48
49
|
const signaturePathParameter = heftTaskSession.parameters.getStringParameter(SIGNATURE_PATH_PARAMETER_NAME);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (!manifestPathParameter.value) {
|
|
53
|
-
throw new Error(`The parameter "${MANIFEST_PATH_PARAMETER_NAME}" is required for the VSCodeExtensionPublishPlugin.`);
|
|
54
|
-
}
|
|
55
|
-
if (!signaturePathParameter.value) {
|
|
56
|
-
throw new Error(`The parameter "${SIGNATURE_PATH_PARAMETER_NAME}" is required for the VSCodeExtensionPublishPlugin.`);
|
|
57
|
-
}
|
|
50
|
+
const publishUnsignedParameter = heftTaskSession.parameters.getFlagParameter(PUBLISH_UNSIGNED_PARAMETER_NAME);
|
|
51
|
+
const { logger: { terminal } } = heftTaskSession;
|
|
52
|
+
// required parameters defined in heft-plugin.json
|
|
58
53
|
const vsixPath = vsixPathParameter.value;
|
|
54
|
+
// manifestPath and signaturePath are required if publishUnsigned is unset
|
|
59
55
|
const manifestPath = manifestPathParameter.value;
|
|
60
56
|
const signaturePath = signaturePathParameter.value;
|
|
57
|
+
const publishUnsigned = publishUnsignedParameter.value;
|
|
58
|
+
if (publishUnsigned) {
|
|
59
|
+
terminal.writeLine(`Publishing unsigned VSIX ${vsixPath}`);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
if (!manifestPath || !signaturePath) {
|
|
63
|
+
throw new Error(`The parameters "${MANIFEST_PATH_PARAMETER_NAME}" and "${SIGNATURE_PATH_PARAMETER_NAME}" are required for the VSCodeExtensionPublishPlugin.`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
61
66
|
heftTaskSession.hooks.run.tapPromise(PLUGIN_NAME, async (runOptions) => {
|
|
62
67
|
const { buildFolderPath } = heftConfiguration;
|
|
63
|
-
const { logger: { terminal } } = heftTaskSession;
|
|
64
68
|
terminal.writeLine(`Using VSCE script: ${util_1.vsceScriptPath}`);
|
|
65
69
|
terminal.writeLine(`Publishing VSIX ${vsixPath}`);
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
'
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
let publishResult;
|
|
71
|
+
if (publishUnsigned) {
|
|
72
|
+
publishResult = await (0, util_1.executeAndWaitAsync)(terminal, 'node', [
|
|
73
|
+
util_1.vsceScriptPath,
|
|
74
|
+
'publish',
|
|
75
|
+
'--no-dependencies',
|
|
76
|
+
'--azure-credential',
|
|
77
|
+
'--packagePath',
|
|
78
|
+
path.resolve(vsixPath)
|
|
79
|
+
], {
|
|
80
|
+
currentWorkingDirectory: path.resolve(buildFolderPath)
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
if (!manifestPath) {
|
|
85
|
+
throw new Error(`Missing manifest path for the VSCodeExtensionPublishPlugin.`);
|
|
86
|
+
}
|
|
87
|
+
if (!signaturePath) {
|
|
88
|
+
throw new Error(`Missing signature path for the VSCodeExtensionPublishPlugin.`);
|
|
89
|
+
}
|
|
90
|
+
publishResult = await (0, util_1.executeAndWaitAsync)(terminal, 'node', [
|
|
91
|
+
util_1.vsceScriptPath,
|
|
92
|
+
'publish',
|
|
93
|
+
'--no-dependencies',
|
|
94
|
+
'--azure-credential',
|
|
95
|
+
'--packagePath',
|
|
96
|
+
path.resolve(vsixPath),
|
|
97
|
+
'--manifestPath',
|
|
98
|
+
path.resolve(manifestPath),
|
|
99
|
+
'--signaturePath',
|
|
100
|
+
path.resolve(signaturePath)
|
|
101
|
+
], {
|
|
102
|
+
currentWorkingDirectory: path.resolve(buildFolderPath)
|
|
103
|
+
});
|
|
104
|
+
}
|
|
80
105
|
if (publishResult.exitCode !== 0) {
|
|
81
106
|
throw new Error(`VSIX publishing failed with exit code ${publishResult.exitCode}`);
|
|
82
107
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HeftConfiguration, IHeftTaskPlugin, IHeftTaskSession } from '@rushstack/heft';
|
|
2
|
+
interface IVSCodeExtensionVerifySignaturePluginOptions {
|
|
3
|
+
}
|
|
4
|
+
export default class VSCodeExtensionVerifySignaturePlugin implements IHeftTaskPlugin<IVSCodeExtensionVerifySignaturePluginOptions> {
|
|
5
|
+
apply(heftTaskSession: IHeftTaskSession, heftConfiguration: HeftConfiguration, pluginOptions: IVSCodeExtensionVerifySignaturePluginOptions): void;
|
|
6
|
+
}
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=VSCodeExtensionVerifySignaturePlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VSCodeExtensionVerifySignaturePlugin.d.ts","sourceRoot":"","sources":["../src/VSCodeExtensionVerifySignaturePlugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAGjB,MAAM,iBAAiB,CAAC;AAKzB,UAAU,4CAA4C;CAAG;AAQzD,MAAM,CAAC,OAAO,OAAO,oCACnB,YAAW,eAAe,CAAC,4CAA4C,CAAC;IAEjE,KAAK,CACV,eAAe,EAAE,gBAAgB,EACjC,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,4CAA4C,GAC1D,IAAI;CAiDR"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
3
|
+
// See LICENSE in the project root for license information.
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function(o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
21
|
+
var ownKeys = function(o) {
|
|
22
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
23
|
+
var ar = [];
|
|
24
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
25
|
+
return ar;
|
|
26
|
+
};
|
|
27
|
+
return ownKeys(o);
|
|
28
|
+
};
|
|
29
|
+
return function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
|
+
const util_1 = require("./util");
|
|
40
|
+
const PLUGIN_NAME = 'vscode-extension-verify-signature-plugin';
|
|
41
|
+
const VSIX_PATH_PARAMETER_NAME = '--vsix-path';
|
|
42
|
+
const MANIFEST_PATH_PARAMETER_NAME = '--manifest-path';
|
|
43
|
+
const SIGNATURE_PATH_PARAMETER_NAME = '--signature-path';
|
|
44
|
+
class VSCodeExtensionVerifySignaturePlugin {
|
|
45
|
+
apply(heftTaskSession, heftConfiguration, pluginOptions) {
|
|
46
|
+
const vsixPathParameter = heftTaskSession.parameters.getStringParameter(VSIX_PATH_PARAMETER_NAME);
|
|
47
|
+
const manifestPathParameter = heftTaskSession.parameters.getStringParameter(MANIFEST_PATH_PARAMETER_NAME);
|
|
48
|
+
const signaturePathParameter = heftTaskSession.parameters.getStringParameter(SIGNATURE_PATH_PARAMETER_NAME);
|
|
49
|
+
// required parameters defined in heft-plugin.json
|
|
50
|
+
const vsixPath = vsixPathParameter.value;
|
|
51
|
+
const manifestPath = manifestPathParameter.value;
|
|
52
|
+
const signaturePath = signaturePathParameter.value;
|
|
53
|
+
heftTaskSession.hooks.run.tapPromise(PLUGIN_NAME, async (runOptions) => {
|
|
54
|
+
const { buildFolderPath } = heftConfiguration;
|
|
55
|
+
const { logger: { terminal } } = heftTaskSession;
|
|
56
|
+
terminal.writeLine(`Using VSCE script: ${util_1.vsceScriptPath}`);
|
|
57
|
+
terminal.writeLine(`Verifying signature ${vsixPath}`);
|
|
58
|
+
const verifySignatureResult = await (0, util_1.executeAndWaitAsync)(terminal, 'node', [
|
|
59
|
+
util_1.vsceScriptPath,
|
|
60
|
+
'verify-signature',
|
|
61
|
+
'--packagePath',
|
|
62
|
+
path.resolve(vsixPath),
|
|
63
|
+
'--manifestPath',
|
|
64
|
+
path.resolve(manifestPath),
|
|
65
|
+
'--signaturePath',
|
|
66
|
+
path.resolve(signaturePath)
|
|
67
|
+
], {
|
|
68
|
+
currentWorkingDirectory: path.resolve(buildFolderPath)
|
|
69
|
+
});
|
|
70
|
+
if (verifySignatureResult.exitCode !== 0) {
|
|
71
|
+
throw new Error(`VSIX signature verification failed with exit code ${verifySignatureResult.exitCode}`);
|
|
72
|
+
}
|
|
73
|
+
terminal.writeLine('Successfully verified VSIX signature.');
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.default = VSCodeExtensionVerifySignaturePlugin;
|
|
78
|
+
//# sourceMappingURL=VSCodeExtensionVerifySignaturePlugin.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/heft-vscode-extension-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Heft plugin for building vscode extensions.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
"main": "lib/index.js",
|
|
13
13
|
"types": "lib/index.d.ts",
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@rushstack/heft": "^0.74.
|
|
15
|
+
"@rushstack/heft": "^0.74.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"eslint": "~9.25.1",
|
|
19
19
|
"@types/node": "20.17.19",
|
|
20
|
-
"@rushstack/heft": "
|
|
21
|
-
"@rushstack/heft
|
|
20
|
+
"@rushstack/heft-node-rig": "2.9.4",
|
|
21
|
+
"@rushstack/heft": "0.74.3"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@vscode/vsce": "3.
|
|
24
|
+
"@vscode/vsce": "3.2.1",
|
|
25
25
|
"@rushstack/node-core-library": "5.14.0",
|
|
26
26
|
"@rushstack/terminal": "0.15.4"
|
|
27
27
|
},
|