@vscode/vsce 3.9.2-3 → 3.9.2
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/README.md +1 -1
- package/dist/vsce.d.ts +0 -2
- package/out/api.js +7 -7
- package/out/auth.js +1 -2
- package/out/main.js +17 -7
- package/out/nls.js +1 -2
- package/out/npm.js +20 -11
- package/out/package.js +39 -29
- package/out/publish.js +20 -11
- package/out/search.js +1 -2
- package/out/secretLint.js +5 -6
- package/out/show.js +1 -2
- package/out/store.js +33 -23
- package/out/typings/secret-lint-types.js +10 -10
- package/out/util.js +36 -26
- package/out/validation.js +23 -14
- package/out/viewutils.js +10 -10
- package/out/zip.js +2 -3
- package/package.json +5 -4
package/README.md
CHANGED
package/dist/vsce.d.ts
CHANGED
package/out/api.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.PackageManager = void 0;
|
|
4
|
+
exports.createVSIX = createVSIX;
|
|
5
|
+
exports.publish = publish;
|
|
6
|
+
exports.listFiles = listFiles;
|
|
7
|
+
exports.publishVSIX = publishVSIX;
|
|
8
|
+
exports.unpublishVSIX = unpublishVSIX;
|
|
4
9
|
const publish_1 = require("./publish");
|
|
5
10
|
const package_1 = require("./package");
|
|
6
11
|
/**
|
|
@@ -12,7 +17,7 @@ var PackageManager;
|
|
|
12
17
|
PackageManager[PackageManager["Npm"] = 0] = "Npm";
|
|
13
18
|
PackageManager[PackageManager["Yarn"] = 1] = "Yarn";
|
|
14
19
|
PackageManager[PackageManager["None"] = 2] = "None";
|
|
15
|
-
})(PackageManager
|
|
20
|
+
})(PackageManager || (exports.PackageManager = PackageManager = {}));
|
|
16
21
|
/**
|
|
17
22
|
* Creates a VSIX from the extension in the current working directory.
|
|
18
23
|
* @public
|
|
@@ -20,7 +25,6 @@ var PackageManager;
|
|
|
20
25
|
function createVSIX(options = {}) {
|
|
21
26
|
return (0, package_1.packageCommand)(options);
|
|
22
27
|
}
|
|
23
|
-
exports.createVSIX = createVSIX;
|
|
24
28
|
/**
|
|
25
29
|
* Publishes the extension in the current working directory.
|
|
26
30
|
* @public
|
|
@@ -28,7 +32,6 @@ exports.createVSIX = createVSIX;
|
|
|
28
32
|
function publish(options = {}) {
|
|
29
33
|
return (0, publish_1.publish)(options);
|
|
30
34
|
}
|
|
31
|
-
exports.publish = publish;
|
|
32
35
|
/**
|
|
33
36
|
* Lists the files included in the extension's package.
|
|
34
37
|
* @public
|
|
@@ -40,7 +43,6 @@ function listFiles(options = {}) {
|
|
|
40
43
|
dependencies: options.packageManager !== PackageManager.None,
|
|
41
44
|
});
|
|
42
45
|
}
|
|
43
|
-
exports.listFiles = listFiles;
|
|
44
46
|
/**
|
|
45
47
|
* Publishes a pre-build VSIX.
|
|
46
48
|
* @public
|
|
@@ -53,7 +55,6 @@ function publishVSIX(packagePath, options = {}) {
|
|
|
53
55
|
...{ target: undefined },
|
|
54
56
|
});
|
|
55
57
|
}
|
|
56
|
-
exports.publishVSIX = publishVSIX;
|
|
57
58
|
/**
|
|
58
59
|
* Deletes a specific extension from the marketplace.
|
|
59
60
|
* @public
|
|
@@ -61,5 +62,4 @@ exports.publishVSIX = publishVSIX;
|
|
|
61
62
|
function unpublishVSIX(options = {}) {
|
|
62
63
|
return (0, publish_1.unpublish)({ force: true, ...options });
|
|
63
64
|
}
|
|
64
|
-
exports.unpublishVSIX = unpublishVSIX;
|
|
65
65
|
//# sourceMappingURL=api.js.map
|
package/out/auth.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAzureCredentialAccessToken =
|
|
3
|
+
exports.getAzureCredentialAccessToken = getAzureCredentialAccessToken;
|
|
4
4
|
const identity_1 = require("@azure/identity");
|
|
5
5
|
function createChainedTokenCredential() {
|
|
6
6
|
return new identity_1.ChainedTokenCredential(new identity_1.EnvironmentCredential(), new identity_1.AzureCliCredential(), new identity_1.ManagedIdentityCredential({ clientId: process.env.AZURE_CLIENT_ID }), new identity_1.AzurePowerShellCredential({ tenantId: process.env.AZURE_TENANT_ID }), new identity_1.AzureDeveloperCliCredential({ tenantId: process.env.AZURE_TENANT_ID }));
|
|
@@ -17,5 +17,4 @@ async function getAzureCredentialAccessToken() {
|
|
|
17
17
|
throw new Error('Can not acquire a Microsoft Entra ID access token. Additional information:\n\n' + error);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
exports.getAzureCredentialAccessToken = getAzureCredentialAccessToken;
|
|
21
20
|
//# sourceMappingURL=auth.js.map
|
package/out/main.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
package/out/nls.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.patchNLS =
|
|
3
|
+
exports.patchNLS = patchNLS;
|
|
4
4
|
const regex = /^%([\w\d.]+)%$/i;
|
|
5
5
|
function createPatcher(translations) {
|
|
6
6
|
return (value) => {
|
|
@@ -22,5 +22,4 @@ function patchNLS(manifest, translations) {
|
|
|
22
22
|
const patcher = createPatcher(translations);
|
|
23
23
|
return JSON.parse(JSON.stringify(manifest, (_, value) => patcher(value)));
|
|
24
24
|
}
|
|
25
|
-
exports.patchNLS = patchNLS;
|
|
26
25
|
//# sourceMappingURL=nls.js.map
|
package/out/npm.js
CHANGED
|
@@ -15,18 +15,30 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
39
|
+
exports.detectYarn = detectYarn;
|
|
40
|
+
exports.getDependencies = getDependencies;
|
|
41
|
+
exports.getLatestVersion = getLatestVersion;
|
|
30
42
|
const path = __importStar(require("path"));
|
|
31
43
|
const fs = __importStar(require("fs"));
|
|
32
44
|
const cp = __importStar(require("child_process"));
|
|
@@ -172,7 +184,6 @@ async function detectYarn(cwd) {
|
|
|
172
184
|
}
|
|
173
185
|
return false;
|
|
174
186
|
}
|
|
175
|
-
exports.detectYarn = detectYarn;
|
|
176
187
|
async function getDependencies(cwd, dependencies, packagedDependencies) {
|
|
177
188
|
if (dependencies === 'none') {
|
|
178
189
|
return [cwd];
|
|
@@ -184,11 +195,9 @@ async function getDependencies(cwd, dependencies, packagedDependencies) {
|
|
|
184
195
|
return await getNpmDependencies(cwd);
|
|
185
196
|
}
|
|
186
197
|
}
|
|
187
|
-
exports.getDependencies = getDependencies;
|
|
188
198
|
function getLatestVersion(name, cancellationToken) {
|
|
189
199
|
return checkNPM(cancellationToken)
|
|
190
200
|
.then(() => exec(`npm show ${name} version`, {}, cancellationToken))
|
|
191
201
|
.then(parseStdout);
|
|
192
202
|
}
|
|
193
|
-
exports.getLatestVersion = getLatestVersion;
|
|
194
203
|
//# sourceMappingURL=npm.js.map
|
package/out/package.js
CHANGED
|
@@ -15,18 +15,49 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
39
|
+
exports.ValidationProcessor = exports.NLSProcessor = exports.LicenseProcessor = exports.ChangelogProcessor = exports.ReadmeProcessor = exports.MarkdownProcessor = exports.TagsProcessor = exports.ManifestProcessor = exports.Targets = exports.BaseProcessor = void 0;
|
|
40
|
+
exports.read = read;
|
|
41
|
+
exports.versionBump = versionBump;
|
|
42
|
+
exports.isWebKind = isWebKind;
|
|
43
|
+
exports.validateManifestForPackaging = validateManifestForPackaging;
|
|
44
|
+
exports.readManifest = readManifest;
|
|
45
|
+
exports.toVsixManifest = toVsixManifest;
|
|
46
|
+
exports.toContentTypes = toContentTypes;
|
|
47
|
+
exports.processFiles = processFiles;
|
|
48
|
+
exports.createDefaultProcessors = createDefaultProcessors;
|
|
49
|
+
exports.collect = collect;
|
|
50
|
+
exports.prepublish = prepublish;
|
|
51
|
+
exports.pack = pack;
|
|
52
|
+
exports.signPackage = signPackage;
|
|
53
|
+
exports.generateManifest = generateManifest;
|
|
54
|
+
exports.verifySignature = verifySignature;
|
|
55
|
+
exports.createSignatureArchive = createSignatureArchive;
|
|
56
|
+
exports.packageCommand = packageCommand;
|
|
57
|
+
exports.listFiles = listFiles;
|
|
58
|
+
exports.ls = ls;
|
|
59
|
+
exports.printAndValidatePackagedFiles = printAndValidatePackagedFiles;
|
|
60
|
+
exports.scanFilesForSecrets = scanFilesForSecrets;
|
|
30
61
|
const fs = __importStar(require("fs"));
|
|
31
62
|
const path = __importStar(require("path"));
|
|
32
63
|
const util_1 = require("util");
|
|
@@ -62,7 +93,6 @@ function read(file) {
|
|
|
62
93
|
return fs.promises.readFile(file.localPath, 'utf8');
|
|
63
94
|
}
|
|
64
95
|
}
|
|
65
|
-
exports.read = read;
|
|
66
96
|
class BaseProcessor {
|
|
67
97
|
constructor(manifest) {
|
|
68
98
|
this.manifest = manifest;
|
|
@@ -242,7 +272,6 @@ async function versionBump(options) {
|
|
|
242
272
|
process.stderr.write(stderr);
|
|
243
273
|
}
|
|
244
274
|
}
|
|
245
|
-
exports.versionBump = versionBump;
|
|
246
275
|
function sanitizeCommitMessage(message) {
|
|
247
276
|
if (!message) {
|
|
248
277
|
return undefined;
|
|
@@ -808,7 +837,6 @@ function isWebKind(manifest) {
|
|
|
808
837
|
const extensionKind = getExtensionKind(manifest);
|
|
809
838
|
return extensionKind.some(kind => kind === 'web');
|
|
810
839
|
}
|
|
811
|
-
exports.isWebKind = isWebKind;
|
|
812
840
|
const extensionPointExtensionKindsMap = new Map();
|
|
813
841
|
extensionPointExtensionKindsMap.set('jsonValidation', ['workspace', 'web']);
|
|
814
842
|
extensionPointExtensionKindsMap.set('localizations', ['ui', 'workspace']);
|
|
@@ -1037,7 +1065,6 @@ function validateManifestForPackaging(manifest) {
|
|
|
1037
1065
|
publisher,
|
|
1038
1066
|
};
|
|
1039
1067
|
}
|
|
1040
|
-
exports.validateManifestForPackaging = validateManifestForPackaging;
|
|
1041
1068
|
function readManifest(cwd = process.cwd(), nls = true) {
|
|
1042
1069
|
const manifestPath = path.join(cwd, 'package.json');
|
|
1043
1070
|
const manifestNLSPath = path.join(cwd, 'package.nls.json');
|
|
@@ -1079,7 +1106,6 @@ function readManifest(cwd = process.cwd(), nls = true) {
|
|
|
1079
1106
|
return (0, nls_1.patchNLS)(manifest, translations);
|
|
1080
1107
|
});
|
|
1081
1108
|
}
|
|
1082
|
-
exports.readManifest = readManifest;
|
|
1083
1109
|
const escapeChars = new Map([
|
|
1084
1110
|
["'", '''],
|
|
1085
1111
|
['"', '"'],
|
|
@@ -1161,7 +1187,6 @@ async function toVsixManifest(vsix) {
|
|
|
1161
1187
|
</Assets>
|
|
1162
1188
|
</PackageManifest>`;
|
|
1163
1189
|
}
|
|
1164
|
-
exports.toVsixManifest = toVsixManifest;
|
|
1165
1190
|
const defaultMimetypes = new Map([
|
|
1166
1191
|
['.json', 'application/json'],
|
|
1167
1192
|
['.vsixmanifest', 'text/xml'],
|
|
@@ -1189,7 +1214,6 @@ async function toContentTypes(files) {
|
|
|
1189
1214
|
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">${sortedContentTypes.join('')}</Types>
|
|
1190
1215
|
`;
|
|
1191
1216
|
}
|
|
1192
|
-
exports.toContentTypes = toContentTypes;
|
|
1193
1217
|
const defaultIgnore = [
|
|
1194
1218
|
'.vscodeignore',
|
|
1195
1219
|
'package-lock.json',
|
|
@@ -1306,7 +1330,6 @@ function processFiles(processors, files) {
|
|
|
1306
1330
|
});
|
|
1307
1331
|
});
|
|
1308
1332
|
}
|
|
1309
|
-
exports.processFiles = processFiles;
|
|
1310
1333
|
function createDefaultProcessors(manifest, options = {}) {
|
|
1311
1334
|
return [
|
|
1312
1335
|
new ManifestProcessor(manifest, options),
|
|
@@ -1320,7 +1343,6 @@ function createDefaultProcessors(manifest, options = {}) {
|
|
|
1320
1343
|
new ValidationProcessor(manifest),
|
|
1321
1344
|
];
|
|
1322
1345
|
}
|
|
1323
|
-
exports.createDefaultProcessors = createDefaultProcessors;
|
|
1324
1346
|
function collect(manifest, options = {}) {
|
|
1325
1347
|
const cwd = options.cwd || process.cwd();
|
|
1326
1348
|
const packagedDependencies = options.dependencyEntryPoints || undefined;
|
|
@@ -1331,7 +1353,6 @@ function collect(manifest, options = {}) {
|
|
|
1331
1353
|
return processFiles(processors, files);
|
|
1332
1354
|
});
|
|
1333
1355
|
}
|
|
1334
|
-
exports.collect = collect;
|
|
1335
1356
|
function writeVsix(files, packagePath) {
|
|
1336
1357
|
return fs.promises
|
|
1337
1358
|
.unlink(packagePath)
|
|
@@ -1384,7 +1405,6 @@ async function prepublish(cwd, manifest, useYarn) {
|
|
|
1384
1405
|
child.on('error', e);
|
|
1385
1406
|
});
|
|
1386
1407
|
}
|
|
1387
|
-
exports.prepublish = prepublish;
|
|
1388
1408
|
async function getPackagePath(cwd, manifest, options = {}) {
|
|
1389
1409
|
if (!options.packagePath) {
|
|
1390
1410
|
return path.join(cwd, getDefaultPackageName(manifest, options));
|
|
@@ -1414,7 +1434,6 @@ async function pack(options = {}) {
|
|
|
1414
1434
|
await writeVsix(files, path.resolve(packagePath));
|
|
1415
1435
|
return { manifest, packagePath, files };
|
|
1416
1436
|
}
|
|
1417
|
-
exports.pack = pack;
|
|
1418
1437
|
async function signPackage(packageFile, signTool) {
|
|
1419
1438
|
if (!fs.existsSync(packageFile)) {
|
|
1420
1439
|
throw new Error(`Package file not found: ${packageFile}`);
|
|
@@ -1432,7 +1451,6 @@ async function signPackage(packageFile, signTool) {
|
|
|
1432
1451
|
cp.execSync(`"${signTool}" "${manifestFile}" "${signatureFile}"`, { stdio: 'inherit' });
|
|
1433
1452
|
return createSignatureArchive(manifestFile, signatureFile, signatureZip);
|
|
1434
1453
|
}
|
|
1435
|
-
exports.signPackage = signPackage;
|
|
1436
1454
|
// Generate the signature manifest file
|
|
1437
1455
|
function generateManifest(packageFile, outputFile) {
|
|
1438
1456
|
if (!outputFile) {
|
|
@@ -1442,7 +1460,6 @@ function generateManifest(packageFile, outputFile) {
|
|
|
1442
1460
|
}
|
|
1443
1461
|
return vsceSign.generateManifest(packageFile, outputFile);
|
|
1444
1462
|
}
|
|
1445
|
-
exports.generateManifest = generateManifest;
|
|
1446
1463
|
async function verifySignature(packageFile, manifestFile, signatureFile) {
|
|
1447
1464
|
const sigzipPath = await createSignatureArchive(manifestFile, signatureFile);
|
|
1448
1465
|
try {
|
|
@@ -1459,12 +1476,10 @@ async function verifySignature(packageFile, manifestFile, signatureFile) {
|
|
|
1459
1476
|
await fs.promises.unlink(sigzipPath);
|
|
1460
1477
|
}
|
|
1461
1478
|
}
|
|
1462
|
-
exports.verifySignature = verifySignature;
|
|
1463
1479
|
// Create a signature zip file containing the manifest and signature file
|
|
1464
1480
|
async function createSignatureArchive(manifestFile, signatureFile, outputFile) {
|
|
1465
1481
|
return vsceSign.zip(manifestFile, signatureFile, outputFile);
|
|
1466
1482
|
}
|
|
1467
|
-
exports.createSignatureArchive = createSignatureArchive;
|
|
1468
1483
|
async function packageCommand(options = {}) {
|
|
1469
1484
|
const cwd = options.cwd || process.cwd();
|
|
1470
1485
|
const manifest = await readManifest(cwd);
|
|
@@ -1479,7 +1494,6 @@ async function packageCommand(options = {}) {
|
|
|
1479
1494
|
const packageSize = util.bytesToString(stats.size);
|
|
1480
1495
|
util.log.done(`Packaged: ${packagePath} ` + chalk_1.default.bold(`(${files.length} files, ${packageSize})`));
|
|
1481
1496
|
}
|
|
1482
|
-
exports.packageCommand = packageCommand;
|
|
1483
1497
|
/**
|
|
1484
1498
|
* Lists the files included in the extension's package.
|
|
1485
1499
|
*/
|
|
@@ -1491,7 +1505,6 @@ async function listFiles(options = {}) {
|
|
|
1491
1505
|
}
|
|
1492
1506
|
return await collectFiles(cwd, getDependenciesOption(options), options.packagedDependencies, options.ignoreFile, manifest.files, options.readmePath, options.followSymlinks);
|
|
1493
1507
|
}
|
|
1494
|
-
exports.listFiles = listFiles;
|
|
1495
1508
|
/**
|
|
1496
1509
|
* Lists the files included in the extension's package.
|
|
1497
1510
|
*/
|
|
@@ -1507,7 +1520,6 @@ async function ls(options = {}) {
|
|
|
1507
1520
|
console.log(files.join('\n'));
|
|
1508
1521
|
}
|
|
1509
1522
|
}
|
|
1510
|
-
exports.ls = ls;
|
|
1511
1523
|
/**
|
|
1512
1524
|
* Prints the packaged files of an extension. And ensures .vscodeignore and files property in package.json are used correctly.
|
|
1513
1525
|
*/
|
|
@@ -1589,7 +1601,6 @@ async function printAndValidatePackagedFiles(files, cwd, manifest, options) {
|
|
|
1589
1601
|
const fileExclusion = hasIgnoreFile ? FileExclusionType.VSCodeIgnore : manifest.files ? FileExclusionType.PackageFiles : FileExclusionType.None;
|
|
1590
1602
|
await scanFilesForSecrets(files, fileExclusion, options);
|
|
1591
1603
|
}
|
|
1592
|
-
exports.printAndValidatePackagedFiles = printAndValidatePackagedFiles;
|
|
1593
1604
|
var FileExclusionType;
|
|
1594
1605
|
(function (FileExclusionType) {
|
|
1595
1606
|
FileExclusionType["None"] = "none";
|
|
@@ -1648,5 +1659,4 @@ async function scanFilesForSecrets(files, fileExclusion, options) {
|
|
|
1648
1659
|
process.exit(1);
|
|
1649
1660
|
}
|
|
1650
1661
|
}
|
|
1651
|
-
exports.scanFilesForSecrets = scanFilesForSecrets;
|
|
1652
1662
|
//# sourceMappingURL=package.js.map
|
package/out/publish.js
CHANGED
|
@@ -15,18 +15,30 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
39
|
+
exports.publish = publish;
|
|
40
|
+
exports.unpublish = unpublish;
|
|
41
|
+
exports.getPAT = getPAT;
|
|
30
42
|
const fs = __importStar(require("fs"));
|
|
31
43
|
const util_1 = require("util");
|
|
32
44
|
const semver = __importStar(require("semver"));
|
|
@@ -117,7 +129,6 @@ async function publish(options = {}) {
|
|
|
117
129
|
}
|
|
118
130
|
}
|
|
119
131
|
}
|
|
120
|
-
exports.publish = publish;
|
|
121
132
|
async function _publish(packagePath, sigzipPath, manifest, options) {
|
|
122
133
|
const pat = await getPAT(manifest.publisher, options);
|
|
123
134
|
const api = await (0, util_2.getGalleryAPI)(pat);
|
|
@@ -236,7 +247,6 @@ async function unpublish(options = {}) {
|
|
|
236
247
|
await api.deleteExtension(publisher, name);
|
|
237
248
|
util_2.log.done(`Deleted extension: ${fullName}!`);
|
|
238
249
|
}
|
|
239
|
-
exports.unpublish = unpublish;
|
|
240
250
|
function validateManifestForPublishing(manifest, options) {
|
|
241
251
|
if (manifest.enableProposedApi && !options.allowAllProposedApis && !options.noVerify) {
|
|
242
252
|
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");
|
|
@@ -258,5 +268,4 @@ async function getPAT(publisher, options) {
|
|
|
258
268
|
}
|
|
259
269
|
return (await (0, store_1.getPublisher)(publisher)).pat;
|
|
260
270
|
}
|
|
261
|
-
exports.getPAT = getPAT;
|
|
262
271
|
//# sourceMappingURL=publish.js.map
|
package/out/search.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.search =
|
|
3
|
+
exports.search = search;
|
|
4
4
|
const util_1 = require("./util");
|
|
5
5
|
const GalleryInterfaces_1 = require("azure-devops-node-api/interfaces/GalleryInterfaces");
|
|
6
6
|
const viewutils_1 = require("./viewutils");
|
|
@@ -43,7 +43,6 @@ async function search(searchText, json = false, pageSize = 10, stats = false) {
|
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
exports.search = search;
|
|
47
46
|
function buildResultTableView(results, stats) {
|
|
48
47
|
const values = results.map(({ publisher, extensionName, displayName, shortDescription, statistics }) => [
|
|
49
48
|
publisher.publisherName + '.' + extensionName,
|
package/out/secretLint.js
CHANGED
|
@@ -3,7 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.lintFiles = lintFiles;
|
|
7
|
+
exports.lintText = lintText;
|
|
8
|
+
exports.getRuleNameFromRuleId = getRuleNameFromRuleId;
|
|
9
|
+
exports.prettyPrintLintResult = prettyPrintLintResult;
|
|
7
10
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
11
|
const secret_lint_types_1 = require("./typings/secret-lint-types");
|
|
9
12
|
const util_1 = require("./util");
|
|
@@ -56,7 +59,7 @@ async function getEngine(scanSecrets, scanDotEnv) {
|
|
|
56
59
|
}
|
|
57
60
|
const lintOptions = {
|
|
58
61
|
configFileJSON: { rules: rules },
|
|
59
|
-
formatter: "@secretlint/secretlint-formatter-sarif",
|
|
62
|
+
formatter: "@secretlint/secretlint-formatter-sarif", // checkstyle, compact, jslint-xml, junit, pretty-error, stylish, tap, unix, json, mask-result, table
|
|
60
63
|
color: true,
|
|
61
64
|
maskSecrets: false
|
|
62
65
|
};
|
|
@@ -77,7 +80,6 @@ async function lintFiles(filePaths, scanSecrets, scanDotEnv) {
|
|
|
77
80
|
}
|
|
78
81
|
return parseResult(engineResult);
|
|
79
82
|
}
|
|
80
|
-
exports.lintFiles = lintFiles;
|
|
81
83
|
async function lintText(content, fileName, scanSecrets, scanDotEnv) {
|
|
82
84
|
const engine = await getEngine(scanSecrets, scanDotEnv);
|
|
83
85
|
let engineResult;
|
|
@@ -93,7 +95,6 @@ async function lintText(content, fileName, scanSecrets, scanDotEnv) {
|
|
|
93
95
|
}
|
|
94
96
|
return parseResult(engineResult);
|
|
95
97
|
}
|
|
96
|
-
exports.lintText = lintText;
|
|
97
98
|
function parseResult(result) {
|
|
98
99
|
const output = secret_lint_types_1.Convert.toSecretLintOutput(result.output);
|
|
99
100
|
const results = output.runs.at(0)?.results ?? [];
|
|
@@ -103,7 +104,6 @@ function getRuleNameFromRuleId(ruleId) {
|
|
|
103
104
|
const parts = ruleId.split('-rule-');
|
|
104
105
|
return parts[parts.length - 1];
|
|
105
106
|
}
|
|
106
|
-
exports.getRuleNameFromRuleId = getRuleNameFromRuleId;
|
|
107
107
|
function prettyPrintLintResult(result) {
|
|
108
108
|
if (!result.message.text) {
|
|
109
109
|
return JSON.stringify(result);
|
|
@@ -120,7 +120,6 @@ function prettyPrintLintResult(result) {
|
|
|
120
120
|
}
|
|
121
121
|
return output;
|
|
122
122
|
}
|
|
123
|
-
exports.prettyPrintLintResult = prettyPrintLintResult;
|
|
124
123
|
function prettyPrintLocation(location) {
|
|
125
124
|
if (!location.physicalLocation) {
|
|
126
125
|
return JSON.stringify(location);
|
package/out/show.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.show =
|
|
3
|
+
exports.show = show;
|
|
4
4
|
const util_1 = require("./util");
|
|
5
5
|
const GalleryInterfaces_1 = require("azure-devops-node-api/interfaces/GalleryInterfaces");
|
|
6
6
|
const viewutils_1 = require("./viewutils");
|
|
@@ -30,7 +30,6 @@ function show(extensionId, json = false) {
|
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
exports.show = show;
|
|
34
33
|
function round(num) {
|
|
35
34
|
return Math.round(num * 100) / 100;
|
|
36
35
|
}
|
package/out/store.js
CHANGED
|
@@ -15,15 +15,31 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
36
|
+
exports.KeytarStore = exports.FileStore = void 0;
|
|
37
|
+
exports.verifyPat = verifyPat;
|
|
38
|
+
exports.getPublisher = getPublisher;
|
|
39
|
+
exports.loginPublisher = loginPublisher;
|
|
40
|
+
exports.logoutPublisher = logoutPublisher;
|
|
41
|
+
exports.deletePublisher = deletePublisher;
|
|
42
|
+
exports.listPublishers = listPublishers;
|
|
27
43
|
const fs = __importStar(require("fs"));
|
|
28
44
|
const path = __importStar(require("path"));
|
|
29
45
|
const os_1 = require("os");
|
|
@@ -33,10 +49,6 @@ const package_1 = require("./package");
|
|
|
33
49
|
const publish_1 = require("./publish");
|
|
34
50
|
;
|
|
35
51
|
class FileStore {
|
|
36
|
-
constructor(path, publishers) {
|
|
37
|
-
this.path = path;
|
|
38
|
-
this.publishers = publishers;
|
|
39
|
-
}
|
|
40
52
|
static async open(path = FileStore.DefaultPath) {
|
|
41
53
|
try {
|
|
42
54
|
const rawStore = await fs.promises.readFile(path, 'utf8');
|
|
@@ -55,6 +67,10 @@ class FileStore {
|
|
|
55
67
|
get size() {
|
|
56
68
|
return this.publishers.length;
|
|
57
69
|
}
|
|
70
|
+
constructor(path, publishers) {
|
|
71
|
+
this.path = path;
|
|
72
|
+
this.publishers = publishers;
|
|
73
|
+
}
|
|
58
74
|
async save() {
|
|
59
75
|
await fs.promises.writeFile(this.path, JSON.stringify({ publishers: this.publishers }), { mode: '0600' });
|
|
60
76
|
}
|
|
@@ -84,11 +100,6 @@ class FileStore {
|
|
|
84
100
|
exports.FileStore = FileStore;
|
|
85
101
|
FileStore.DefaultPath = path.join((0, os_1.homedir)(), '.vsce');
|
|
86
102
|
class KeytarStore {
|
|
87
|
-
constructor(keytar, serviceName, publishers) {
|
|
88
|
-
this.keytar = keytar;
|
|
89
|
-
this.serviceName = serviceName;
|
|
90
|
-
this.publishers = publishers;
|
|
91
|
-
}
|
|
92
103
|
static async open(serviceName = 'vscode-vsce') {
|
|
93
104
|
const keytar = await import('keytar').then(module => module.default);
|
|
94
105
|
const creds = await keytar.findCredentials(serviceName);
|
|
@@ -97,6 +108,11 @@ class KeytarStore {
|
|
|
97
108
|
get size() {
|
|
98
109
|
return this.publishers.length;
|
|
99
110
|
}
|
|
111
|
+
constructor(keytar, serviceName, publishers) {
|
|
112
|
+
this.keytar = keytar;
|
|
113
|
+
this.serviceName = serviceName;
|
|
114
|
+
this.publishers = publishers;
|
|
115
|
+
}
|
|
100
116
|
get(name) {
|
|
101
117
|
return this.publishers.filter(p => p.name === name)[0];
|
|
102
118
|
}
|
|
@@ -131,7 +147,6 @@ async function verifyPat(options) {
|
|
|
131
147
|
}
|
|
132
148
|
console.log(`The Personal Access Token verification succeeded for the publisher '${publisherName}'.`);
|
|
133
149
|
}
|
|
134
|
-
exports.verifyPat = verifyPat;
|
|
135
150
|
async function requestPAT(publisherName) {
|
|
136
151
|
console.log(`${(0, util_1.getMarketplaceUrl)()}/manage/publishers/`);
|
|
137
152
|
const pat = await (0, util_1.read)(`Personal Access Token for publisher '${publisherName}':`, { silent: true, replace: '*' });
|
|
@@ -174,7 +189,6 @@ async function getPublisher(publisherName) {
|
|
|
174
189
|
await store.add(publisher);
|
|
175
190
|
return publisher;
|
|
176
191
|
}
|
|
177
|
-
exports.getPublisher = getPublisher;
|
|
178
192
|
async function loginPublisher(publisherName) {
|
|
179
193
|
(0, validation_1.validatePublisher)(publisherName);
|
|
180
194
|
const store = await openDefaultStore();
|
|
@@ -191,7 +205,6 @@ async function loginPublisher(publisherName) {
|
|
|
191
205
|
await store.add(publisher);
|
|
192
206
|
return publisher;
|
|
193
207
|
}
|
|
194
|
-
exports.loginPublisher = loginPublisher;
|
|
195
208
|
async function logoutPublisher(publisherName) {
|
|
196
209
|
(0, validation_1.validatePublisher)(publisherName);
|
|
197
210
|
const store = await openDefaultStore();
|
|
@@ -201,7 +214,6 @@ async function logoutPublisher(publisherName) {
|
|
|
201
214
|
}
|
|
202
215
|
await store.delete(publisherName);
|
|
203
216
|
}
|
|
204
|
-
exports.logoutPublisher = logoutPublisher;
|
|
205
217
|
async function deletePublisher(publisherName) {
|
|
206
218
|
const publisher = await getPublisher(publisherName);
|
|
207
219
|
const answer = await (0, util_1.read)(`This will FOREVER delete '${publisherName}'! Are you sure? [y/N] `);
|
|
@@ -214,12 +226,10 @@ async function deletePublisher(publisherName) {
|
|
|
214
226
|
await store.delete(publisherName);
|
|
215
227
|
util_1.log.done(`Deleted publisher '${publisherName}'.`);
|
|
216
228
|
}
|
|
217
|
-
exports.deletePublisher = deletePublisher;
|
|
218
229
|
async function listPublishers() {
|
|
219
230
|
const store = await openDefaultStore();
|
|
220
231
|
for (const publisher of store) {
|
|
221
232
|
console.log(publisher.name);
|
|
222
233
|
}
|
|
223
234
|
}
|
|
224
|
-
exports.listPublishers = listPublishers;
|
|
225
235
|
//# sourceMappingURL=store.js.map
|
|
@@ -34,7 +34,7 @@ var Role;
|
|
|
34
34
|
Role["Uncontrolled"] = "uncontrolled";
|
|
35
35
|
Role["Unmodified"] = "unmodified";
|
|
36
36
|
Role["UserSpecifiedConfiguration"] = "userSpecifiedConfiguration";
|
|
37
|
-
})(Role
|
|
37
|
+
})(Role || (exports.Role = Role = {}));
|
|
38
38
|
/**
|
|
39
39
|
* Specifies the failure level for the report.
|
|
40
40
|
*
|
|
@@ -48,12 +48,12 @@ var Level;
|
|
|
48
48
|
Level["None"] = "none";
|
|
49
49
|
Level["Note"] = "note";
|
|
50
50
|
Level["Warning"] = "warning";
|
|
51
|
-
})(Level
|
|
51
|
+
})(Level || (exports.Level = Level = {}));
|
|
52
52
|
var Content;
|
|
53
53
|
(function (Content) {
|
|
54
54
|
Content["LocalizedData"] = "localizedData";
|
|
55
55
|
Content["NonLocalizedData"] = "nonLocalizedData";
|
|
56
|
-
})(Content
|
|
56
|
+
})(Content || (exports.Content = Content = {}));
|
|
57
57
|
/**
|
|
58
58
|
* The state of a result relative to a baseline of a previous run.
|
|
59
59
|
*/
|
|
@@ -63,7 +63,7 @@ var BaselineState;
|
|
|
63
63
|
BaselineState["New"] = "new";
|
|
64
64
|
BaselineState["Unchanged"] = "unchanged";
|
|
65
65
|
BaselineState["Updated"] = "updated";
|
|
66
|
-
})(BaselineState
|
|
66
|
+
})(BaselineState || (exports.BaselineState = BaselineState = {}));
|
|
67
67
|
/**
|
|
68
68
|
* Specifies the importance of this location in understanding the code flow in which it
|
|
69
69
|
* occurs. The order from most to least important is "essential", "important",
|
|
@@ -74,7 +74,7 @@ var Importance;
|
|
|
74
74
|
Importance["Essential"] = "essential";
|
|
75
75
|
Importance["Important"] = "important";
|
|
76
76
|
Importance["Unimportant"] = "unimportant";
|
|
77
|
-
})(Importance
|
|
77
|
+
})(Importance || (exports.Importance = Importance = {}));
|
|
78
78
|
/**
|
|
79
79
|
* A value that categorizes results by evaluation state.
|
|
80
80
|
*/
|
|
@@ -86,7 +86,7 @@ var ResultKind;
|
|
|
86
86
|
ResultKind["Open"] = "open";
|
|
87
87
|
ResultKind["Pass"] = "pass";
|
|
88
88
|
ResultKind["Review"] = "review";
|
|
89
|
-
})(ResultKind
|
|
89
|
+
})(ResultKind || (exports.ResultKind = ResultKind = {}));
|
|
90
90
|
/**
|
|
91
91
|
* A string that indicates where the suppression is persisted.
|
|
92
92
|
*/
|
|
@@ -94,7 +94,7 @@ var SuppressionKind;
|
|
|
94
94
|
(function (SuppressionKind) {
|
|
95
95
|
SuppressionKind["External"] = "external";
|
|
96
96
|
SuppressionKind["InSource"] = "inSource";
|
|
97
|
-
})(SuppressionKind
|
|
97
|
+
})(SuppressionKind || (exports.SuppressionKind = SuppressionKind = {}));
|
|
98
98
|
/**
|
|
99
99
|
* A string that indicates the review status of the suppression.
|
|
100
100
|
*/
|
|
@@ -103,7 +103,7 @@ var Status;
|
|
|
103
103
|
Status["Accepted"] = "accepted";
|
|
104
104
|
Status["Rejected"] = "rejected";
|
|
105
105
|
Status["UnderReview"] = "underReview";
|
|
106
|
-
})(Status
|
|
106
|
+
})(Status || (exports.Status = Status = {}));
|
|
107
107
|
/**
|
|
108
108
|
* The SARIF format version of this external properties object.
|
|
109
109
|
*
|
|
@@ -112,7 +112,7 @@ var Status;
|
|
|
112
112
|
var Version;
|
|
113
113
|
(function (Version) {
|
|
114
114
|
Version["The210"] = "2.1.0";
|
|
115
|
-
})(Version
|
|
115
|
+
})(Version || (exports.Version = Version = {}));
|
|
116
116
|
/**
|
|
117
117
|
* Specifies the unit in which the tool measures columns.
|
|
118
118
|
*/
|
|
@@ -120,7 +120,7 @@ var ColumnKind;
|
|
|
120
120
|
(function (ColumnKind) {
|
|
121
121
|
ColumnKind["UnicodeCodePoints"] = "unicodeCodePoints";
|
|
122
122
|
ColumnKind["Utf16CodeUnits"] = "utf16CodeUnits";
|
|
123
|
-
})(ColumnKind
|
|
123
|
+
})(ColumnKind || (exports.ColumnKind = ColumnKind = {}));
|
|
124
124
|
// Converts JSON strings to/from your types
|
|
125
125
|
// and asserts the results of JSON.parse at runtime
|
|
126
126
|
class Convert {
|
package/out/util.js
CHANGED
|
@@ -15,18 +15,46 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
39
|
+
exports.log = exports.CancellationToken = void 0;
|
|
40
|
+
exports.read = read;
|
|
41
|
+
exports.getPublishedUrl = getPublishedUrl;
|
|
42
|
+
exports.getMarketplaceUrl = getMarketplaceUrl;
|
|
43
|
+
exports.getHubUrl = getHubUrl;
|
|
44
|
+
exports.getGalleryAPI = getGalleryAPI;
|
|
45
|
+
exports.getSecurityRolesAPI = getSecurityRolesAPI;
|
|
46
|
+
exports.getPublicGalleryAPI = getPublicGalleryAPI;
|
|
47
|
+
exports.normalize = normalize;
|
|
48
|
+
exports.chain = chain;
|
|
49
|
+
exports.flatten = flatten;
|
|
50
|
+
exports.nonnull = nonnull;
|
|
51
|
+
exports.isCancelledError = isCancelledError;
|
|
52
|
+
exports.sequence = sequence;
|
|
53
|
+
exports.patchOptionsWithManifest = patchOptionsWithManifest;
|
|
54
|
+
exports.bytesToString = bytesToString;
|
|
55
|
+
exports.filePathToVsixPath = filePathToVsixPath;
|
|
56
|
+
exports.vsixPathToFilePath = vsixPathToFilePath;
|
|
57
|
+
exports.generateFileStructureTree = generateFileStructureTree;
|
|
30
58
|
const util_1 = require("util");
|
|
31
59
|
const fs = __importStar(require("fs"));
|
|
32
60
|
const read_1 = __importDefault(require("read"));
|
|
@@ -42,20 +70,16 @@ function read(prompt, options = {}) {
|
|
|
42
70
|
}
|
|
43
71
|
return __read({ prompt, ...options });
|
|
44
72
|
}
|
|
45
|
-
exports.read = read;
|
|
46
73
|
const marketplaceUrl = process.env['VSCE_MARKETPLACE_URL'] || 'https://marketplace.visualstudio.com';
|
|
47
74
|
function getPublishedUrl(extension) {
|
|
48
75
|
return `${marketplaceUrl}/items?itemName=${extension}`;
|
|
49
76
|
}
|
|
50
|
-
exports.getPublishedUrl = getPublishedUrl;
|
|
51
77
|
function getMarketplaceUrl() {
|
|
52
78
|
return marketplaceUrl;
|
|
53
79
|
}
|
|
54
|
-
exports.getMarketplaceUrl = getMarketplaceUrl;
|
|
55
80
|
function getHubUrl(publisher, name) {
|
|
56
81
|
return `${marketplaceUrl}/manage/publishers/${publisher}/extensions/${name}/hub`;
|
|
57
82
|
}
|
|
58
|
-
exports.getHubUrl = getHubUrl;
|
|
59
83
|
async function getGalleryAPI(pat) {
|
|
60
84
|
// from https://github.com/Microsoft/tfs-cli/blob/master/app/exec/extension/default.ts#L287-L292
|
|
61
85
|
const authHandler = (0, WebApi_1.getBasicHandler)('OAuth', pat);
|
|
@@ -63,21 +87,17 @@ async function getGalleryAPI(pat) {
|
|
|
63
87
|
// const vsoapi = new WebApi(marketplaceUrl, authHandler);
|
|
64
88
|
// return await vsoapi.getGalleryApi();
|
|
65
89
|
}
|
|
66
|
-
exports.getGalleryAPI = getGalleryAPI;
|
|
67
90
|
async function getSecurityRolesAPI(pat) {
|
|
68
91
|
const authHandler = (0, WebApi_1.getBasicHandler)('OAuth', pat);
|
|
69
92
|
const vsoapi = new WebApi_1.WebApi(marketplaceUrl, authHandler);
|
|
70
93
|
return await vsoapi.getSecurityRolesApi();
|
|
71
94
|
}
|
|
72
|
-
exports.getSecurityRolesAPI = getSecurityRolesAPI;
|
|
73
95
|
function getPublicGalleryAPI() {
|
|
74
96
|
return new publicgalleryapi_1.PublicGalleryAPI(marketplaceUrl, '3.0-preview.1');
|
|
75
97
|
}
|
|
76
|
-
exports.getPublicGalleryAPI = getPublicGalleryAPI;
|
|
77
98
|
function normalize(path) {
|
|
78
99
|
return path.replace(/\\/g, '/');
|
|
79
100
|
}
|
|
80
|
-
exports.normalize = normalize;
|
|
81
101
|
function chain2(a, b, fn, index = 0) {
|
|
82
102
|
if (index >= b.length) {
|
|
83
103
|
return Promise.resolve(a);
|
|
@@ -87,20 +107,16 @@ function chain2(a, b, fn, index = 0) {
|
|
|
87
107
|
function chain(initial, processors, process) {
|
|
88
108
|
return chain2(initial, processors, process);
|
|
89
109
|
}
|
|
90
|
-
exports.chain = chain;
|
|
91
110
|
function flatten(arr) {
|
|
92
111
|
return [].concat.apply([], arr);
|
|
93
112
|
}
|
|
94
|
-
exports.flatten = flatten;
|
|
95
113
|
function nonnull(arg) {
|
|
96
114
|
return !!arg;
|
|
97
115
|
}
|
|
98
|
-
exports.nonnull = nonnull;
|
|
99
116
|
const CancelledError = 'Cancelled';
|
|
100
117
|
function isCancelledError(error) {
|
|
101
118
|
return error === CancelledError;
|
|
102
119
|
}
|
|
103
|
-
exports.isCancelledError = isCancelledError;
|
|
104
120
|
class CancellationToken {
|
|
105
121
|
constructor() {
|
|
106
122
|
this.listeners = [];
|
|
@@ -133,7 +149,6 @@ async function sequence(promiseFactories) {
|
|
|
133
149
|
await factory();
|
|
134
150
|
}
|
|
135
151
|
}
|
|
136
|
-
exports.sequence = sequence;
|
|
137
152
|
var LogMessageType;
|
|
138
153
|
(function (LogMessageType) {
|
|
139
154
|
LogMessageType[LogMessageType["DONE"] = 0] = "DONE";
|
|
@@ -189,7 +204,6 @@ function patchOptionsWithManifest(options, manifest) {
|
|
|
189
204
|
}
|
|
190
205
|
}
|
|
191
206
|
}
|
|
192
|
-
exports.patchOptionsWithManifest = patchOptionsWithManifest;
|
|
193
207
|
function bytesToString(bytes) {
|
|
194
208
|
let size = 0;
|
|
195
209
|
let unit = '';
|
|
@@ -203,15 +217,12 @@ function bytesToString(bytes) {
|
|
|
203
217
|
}
|
|
204
218
|
return `${size} ${unit}`;
|
|
205
219
|
}
|
|
206
|
-
exports.bytesToString = bytesToString;
|
|
207
220
|
function filePathToVsixPath(originalFilePath) {
|
|
208
221
|
return `extension/${originalFilePath}`;
|
|
209
222
|
}
|
|
210
|
-
exports.filePathToVsixPath = filePathToVsixPath;
|
|
211
223
|
function vsixPathToFilePath(extensionFilePath) {
|
|
212
224
|
return extensionFilePath.startsWith('extension/') ? extensionFilePath.substring('extension/'.length) : extensionFilePath;
|
|
213
225
|
}
|
|
214
|
-
exports.vsixPathToFilePath = vsixPathToFilePath;
|
|
215
226
|
const FOLDER_SIZE_KEY = "/__FOlDER_SIZE__\\";
|
|
216
227
|
const FOLDER_FILES_TOTAL_KEY = "/__FOLDER_CHILDREN__\\";
|
|
217
228
|
const FILE_SIZE_WARNING_THRESHOLD = 0.85;
|
|
@@ -304,7 +315,6 @@ async function generateFileStructureTree(rootFolder, filePaths, printLinesLimit
|
|
|
304
315
|
}
|
|
305
316
|
return output;
|
|
306
317
|
}
|
|
307
|
-
exports.generateFileStructureTree = generateFileStructureTree;
|
|
308
318
|
function createTreeOutput(fileSystem, maxDepth, totalFileSizes) {
|
|
309
319
|
const getColorFromSize = (size) => {
|
|
310
320
|
if (size > FILE_SIZE_WARNING_THRESHOLD * totalFileSizes) {
|
package/out/validation.js
CHANGED
|
@@ -15,18 +15,33 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
39
|
+
exports.validatePublisher = validatePublisher;
|
|
40
|
+
exports.validateExtensionName = validateExtensionName;
|
|
41
|
+
exports.validateVersion = validateVersion;
|
|
42
|
+
exports.validateEngineCompatibility = validateEngineCompatibility;
|
|
43
|
+
exports.validateVSCodeTypesCompatibility = validateVSCodeTypesCompatibility;
|
|
44
|
+
exports.validateExtensionDependencies = validateExtensionDependencies;
|
|
30
45
|
const semver = __importStar(require("semver"));
|
|
31
46
|
const parse_semver_1 = __importDefault(require("parse-semver"));
|
|
32
47
|
const util_1 = require("./util");
|
|
@@ -40,7 +55,6 @@ function validatePublisher(publisher) {
|
|
|
40
55
|
}
|
|
41
56
|
return publisher;
|
|
42
57
|
}
|
|
43
|
-
exports.validatePublisher = validatePublisher;
|
|
44
58
|
function validateExtensionName(name) {
|
|
45
59
|
if (!name) {
|
|
46
60
|
throw new Error(`Missing extension "name": "<name>" in package.json. Learn more: https://code.visualstudio.com/api/references/extension-manifest`);
|
|
@@ -50,7 +64,6 @@ function validateExtensionName(name) {
|
|
|
50
64
|
}
|
|
51
65
|
return name;
|
|
52
66
|
}
|
|
53
|
-
exports.validateExtensionName = validateExtensionName;
|
|
54
67
|
function validateVersion(version) {
|
|
55
68
|
if (!version) {
|
|
56
69
|
throw new Error(`Missing extension "version": "<version>" in package.json. Learn more: https://code.visualstudio.com/api/references/extension-manifest`);
|
|
@@ -60,7 +73,6 @@ function validateVersion(version) {
|
|
|
60
73
|
}
|
|
61
74
|
return version;
|
|
62
75
|
}
|
|
63
|
-
exports.validateVersion = validateVersion;
|
|
64
76
|
function validateEngineCompatibility(version) {
|
|
65
77
|
if (!version) {
|
|
66
78
|
throw new Error(`Missing vscode engine compatibility version. ("engines": { "vscode": "<version>" } in package.json) Learn more: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#visual-studio-code-compatibility`);
|
|
@@ -70,7 +82,6 @@ function validateEngineCompatibility(version) {
|
|
|
70
82
|
}
|
|
71
83
|
return version;
|
|
72
84
|
}
|
|
73
|
-
exports.validateEngineCompatibility = validateEngineCompatibility;
|
|
74
85
|
/**
|
|
75
86
|
* User shouldn't use a newer version of @types/vscode than the one specified in engines.vscode
|
|
76
87
|
*
|
|
@@ -125,7 +136,6 @@ function validateVSCodeTypesCompatibility(engineVersion, typeVersion) {
|
|
|
125
136
|
throw error;
|
|
126
137
|
}
|
|
127
138
|
}
|
|
128
|
-
exports.validateVSCodeTypesCompatibility = validateVSCodeTypesCompatibility;
|
|
129
139
|
function validateExtensionDependencies(dependencies, fieldName) {
|
|
130
140
|
if (!dependencies || dependencies.length === 0) {
|
|
131
141
|
return;
|
|
@@ -136,5 +146,4 @@ function validateExtensionDependencies(dependencies, fieldName) {
|
|
|
136
146
|
}
|
|
137
147
|
}
|
|
138
148
|
}
|
|
139
|
-
exports.validateExtensionDependencies = validateExtensionDependencies;
|
|
140
149
|
//# sourceMappingURL=validation.js.map
|
package/out/viewutils.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.icons = void 0;
|
|
4
|
+
exports.formatDate = formatDate;
|
|
5
|
+
exports.formatTime = formatTime;
|
|
6
|
+
exports.formatDateTime = formatDateTime;
|
|
7
|
+
exports.repeatString = repeatString;
|
|
8
|
+
exports.ratingStars = ratingStars;
|
|
9
|
+
exports.tableView = tableView;
|
|
10
|
+
exports.wordWrap = wordWrap;
|
|
11
|
+
exports.indentRow = indentRow;
|
|
12
|
+
exports.wordTrim = wordTrim;
|
|
4
13
|
const fixedLocale = 'en-us';
|
|
5
14
|
const format = {
|
|
6
15
|
date: { month: 'long', day: 'numeric', year: 'numeric' },
|
|
@@ -16,15 +25,12 @@ exports.icons = useFallbackIcons
|
|
|
16
25
|
function formatDate(date) {
|
|
17
26
|
return date.toLocaleString(fixedLocale, format.date);
|
|
18
27
|
}
|
|
19
|
-
exports.formatDate = formatDate;
|
|
20
28
|
function formatTime(date) {
|
|
21
29
|
return date.toLocaleString(fixedLocale, format.time);
|
|
22
30
|
}
|
|
23
|
-
exports.formatTime = formatTime;
|
|
24
31
|
function formatDateTime(date) {
|
|
25
32
|
return date.toLocaleString(fixedLocale, { ...format.date, ...format.time });
|
|
26
33
|
}
|
|
27
|
-
exports.formatDateTime = formatDateTime;
|
|
28
34
|
function repeatString(text, count) {
|
|
29
35
|
let result = '';
|
|
30
36
|
for (let i = 0; i < count; i++) {
|
|
@@ -32,18 +38,15 @@ function repeatString(text, count) {
|
|
|
32
38
|
}
|
|
33
39
|
return result;
|
|
34
40
|
}
|
|
35
|
-
exports.repeatString = repeatString;
|
|
36
41
|
function ratingStars(rating, total = 5) {
|
|
37
42
|
const c = Math.min(Math.round(rating), total);
|
|
38
43
|
return `${repeatString(exports.icons.star + ' ', c)}${repeatString(exports.icons.emptyStar + ' ', total - c)}`;
|
|
39
44
|
}
|
|
40
|
-
exports.ratingStars = ratingStars;
|
|
41
45
|
function tableView(table, spacing = 2) {
|
|
42
46
|
const maxLen = {};
|
|
43
47
|
table.forEach(row => row.forEach((cell, i) => (maxLen[i] = Math.max(maxLen[i] || 0, cell.length))));
|
|
44
48
|
return table.map(row => row.map((cell, i) => `${cell}${repeatString(' ', maxLen[i] - cell.length + spacing)}`).join(''));
|
|
45
49
|
}
|
|
46
|
-
exports.tableView = tableView;
|
|
47
50
|
function wordWrap(text, width = columns) {
|
|
48
51
|
const [indent = ''] = text.match(/^\s+/) || [];
|
|
49
52
|
const maxWidth = width - indent.length;
|
|
@@ -58,16 +61,13 @@ function wordWrap(text, width = columns) {
|
|
|
58
61
|
.slice(0, 2)
|
|
59
62
|
.join('');
|
|
60
63
|
}
|
|
61
|
-
exports.wordWrap = wordWrap;
|
|
62
64
|
function indentRow(row) {
|
|
63
65
|
return ` ${row}`;
|
|
64
66
|
}
|
|
65
|
-
exports.indentRow = indentRow;
|
|
66
67
|
function wordTrim(text, width = columns, indicator = '...') {
|
|
67
68
|
if (text.length > width) {
|
|
68
69
|
return text.substr(0, width - indicator.length) + indicator;
|
|
69
70
|
}
|
|
70
71
|
return text;
|
|
71
72
|
}
|
|
72
|
-
exports.wordTrim = wordTrim;
|
|
73
73
|
//# sourceMappingURL=viewutils.js.map
|
package/out/zip.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.readZip = readZip;
|
|
4
|
+
exports.readVSIXPackage = readVSIXPackage;
|
|
4
5
|
const yauzl_1 = require("yauzl");
|
|
5
6
|
const xml_1 = require("./xml");
|
|
6
7
|
const util_1 = require("./util");
|
|
@@ -39,7 +40,6 @@ async function readZip(packagePath, filter) {
|
|
|
39
40
|
});
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
|
-
exports.readZip = readZip;
|
|
43
43
|
async function readVSIXPackage(packagePath) {
|
|
44
44
|
const map = await readZip(packagePath, name => /^extension\/package\.json$|^extension\.vsixmanifest$/i.test(name));
|
|
45
45
|
const rawManifest = map.get((0, util_1.filePathToVsixPath)('package.json'));
|
|
@@ -63,5 +63,4 @@ async function readVSIXPackage(packagePath) {
|
|
|
63
63
|
xmlManifest: await (0, xml_1.parseXmlManifest)(rawXmlManifest.toString('utf8')),
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
exports.readVSIXPackage = readVSIXPackage;
|
|
67
66
|
//# sourceMappingURL=zip.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vscode/vsce",
|
|
3
|
-
"version": "3.9.2
|
|
3
|
+
"version": "3.9.2",
|
|
4
4
|
"description": "VS Code Extensions Manager",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"cockatiel": "^3.1.2",
|
|
52
52
|
"commander": "^12.1.0",
|
|
53
53
|
"form-data": "^4.0.0",
|
|
54
|
-
"glob": "^
|
|
54
|
+
"glob": "^13.0.6",
|
|
55
55
|
"hosted-git-info": "^4.0.2",
|
|
56
56
|
"jsonc-parser": "^3.2.0",
|
|
57
57
|
"leven": "^3.1.0",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"mocha": "^11.1.0",
|
|
89
89
|
"source-map-support": "^0.4.2",
|
|
90
90
|
"ts-node": "^10.9.1",
|
|
91
|
-
"typescript": "
|
|
91
|
+
"typescript": "~5.9.0"
|
|
92
92
|
},
|
|
93
93
|
"optionalDependencies": {
|
|
94
94
|
"keytar": "^7.7.0"
|
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
"spec": "src/test/**/*.ts"
|
|
102
102
|
},
|
|
103
103
|
"overrides": {
|
|
104
|
-
"serialize-javascript": "7.x"
|
|
104
|
+
"serialize-javascript": "7.x",
|
|
105
|
+
"diff": "^9.0.0"
|
|
105
106
|
}
|
|
106
107
|
}
|