@vscode/vsce 3.4.3-1 → 3.4.3-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/package.js CHANGED
@@ -1167,8 +1167,15 @@ async function toContentTypes(files) {
1167
1167
  for (const [extension, contentType] of mimetypes) {
1168
1168
  contentTypes.push(`<Default Extension="${extension}" ContentType="${contentType}"/>`);
1169
1169
  }
1170
+ // The files array passed into this function has non-deterministic order
1171
+ // depending on filesystem directory traversal. This leads to the order of
1172
+ // the "Default" elements changing from build to build, which prevents
1173
+ // reproducible vsix files. To fix this, this sorts the contentTypes array
1174
+ // to ensure they are listed in the same order regardless of the order of
1175
+ // the files array.
1176
+ const sortedContentTypes = contentTypes.sort();
1170
1177
  return `<?xml version="1.0" encoding="utf-8"?>
1171
- <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">${contentTypes.join('')}</Types>
1178
+ <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">${sortedContentTypes.join('')}</Types>
1172
1179
  `;
1173
1180
  }
1174
1181
  exports.toContentTypes = toContentTypes;
package/out/validation.js CHANGED
@@ -32,40 +32,40 @@ const parse_semver_1 = __importDefault(require("parse-semver"));
32
32
  const nameRegex = /^[a-z0-9][a-z0-9\-]*$/i;
33
33
  function validatePublisher(publisher) {
34
34
  if (!publisher) {
35
- throw new Error(`Missing publisher name. Learn more: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#publishing-extensions`);
35
+ throw new Error(`Missing extension "publisher": "<ID>" in package.json. Learn more: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#create-a-publisher`);
36
36
  }
37
37
  if (!nameRegex.test(publisher)) {
38
- throw new Error(`Invalid publisher name '${publisher}'. Expected the identifier of a publisher, not its human-friendly name. Learn more: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#publishing-extensions`);
38
+ throw new Error(`Invalid extension "publisher": "${publisher}" in package.json. Expected the identifier of a publisher, not its human-friendly name. Learn more: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#create-a-publisher`);
39
39
  }
40
40
  return publisher;
41
41
  }
42
42
  exports.validatePublisher = validatePublisher;
43
43
  function validateExtensionName(name) {
44
44
  if (!name) {
45
- throw new Error(`Missing extension name`);
45
+ throw new Error(`Missing extension "name": "<name>" in package.json. Learn more: https://code.visualstudio.com/api/references/extension-manifest`);
46
46
  }
47
47
  if (!nameRegex.test(name)) {
48
- throw new Error(`Invalid extension name '${name}'`);
48
+ throw new Error(`Invalid extension "name": "${name}" in package.json. Learn more: https://code.visualstudio.com/api/references/extension-manifest`);
49
49
  }
50
50
  return name;
51
51
  }
52
52
  exports.validateExtensionName = validateExtensionName;
53
53
  function validateVersion(version) {
54
54
  if (!version) {
55
- throw new Error(`Missing extension version`);
55
+ throw new Error(`Missing extension "version": "<version>" in package.json. Learn more: https://code.visualstudio.com/api/references/extension-manifest`);
56
56
  }
57
57
  if (!semver.valid(version)) {
58
- throw new Error(`Invalid extension version '${version}'`);
58
+ throw new Error(`Invalid extension "version": "${version}" in package.json. Learn more: https://code.visualstudio.com/api/references/extension-manifest`);
59
59
  }
60
60
  return version;
61
61
  }
62
62
  exports.validateVersion = validateVersion;
63
63
  function validateEngineCompatibility(version) {
64
64
  if (!version) {
65
- throw new Error(`Missing vscode engine compatibility version`);
65
+ 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`);
66
66
  }
67
67
  if (!/^\*$|^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/.test(version)) {
68
- throw new Error(`Invalid vscode engine compatibility version '${version}'`);
68
+ throw new Error(`Invalid vscode engine compatibility version '${version}'. ("engines": { "vscode": "${version}" } in package.json) Learn more: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#visual-studio-code-compatibility`);
69
69
  }
70
70
  return version;
71
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vscode/vsce",
3
- "version": "3.4.3-1",
3
+ "version": "3.4.3-3",
4
4
  "description": "VS Code Extensions Manager",
5
5
  "repository": {
6
6
  "type": "git",