@vscode/vsce 3.6.3-1 → 3.6.3-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/out/package.js +3 -0
- package/out/validation.js +30 -1
- package/package.json +1 -1
package/out/package.js
CHANGED
|
@@ -1027,6 +1027,9 @@ function validateManifestForPackaging(manifest) {
|
|
|
1027
1027
|
throw new Error(`Manifest contains invalid value '${manifest.sponsor.url}' in the 'sponsor' property. It must be a valid URL with a HTTP or HTTPS protocol.`);
|
|
1028
1028
|
}
|
|
1029
1029
|
}
|
|
1030
|
+
// Validate extension dependencies and extension pack use lowercase IDs
|
|
1031
|
+
(0, validation_1.validateExtensionDependencies)(manifest.extensionDependencies, 'extensionDependencies');
|
|
1032
|
+
(0, validation_1.validateExtensionDependencies)(manifest.extensionPack, 'extensionPack');
|
|
1030
1033
|
return {
|
|
1031
1034
|
...manifest,
|
|
1032
1035
|
name,
|
package/out/validation.js
CHANGED
|
@@ -26,9 +26,10 @@ 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.validateVSCodeTypesCompatibility = exports.validateEngineCompatibility = exports.validateVersion = exports.validateExtensionName = exports.validatePublisher = void 0;
|
|
29
|
+
exports.validateExtensionDependencies = exports.validateVSCodeTypesCompatibility = exports.validateEngineCompatibility = exports.validateVersion = exports.validateExtensionName = exports.validatePublisher = void 0;
|
|
30
30
|
const semver = __importStar(require("semver"));
|
|
31
31
|
const parse_semver_1 = __importDefault(require("parse-semver"));
|
|
32
|
+
const util_1 = require("./util");
|
|
32
33
|
const nameRegex = /^[a-z0-9][a-z0-9\-]*$/i;
|
|
33
34
|
function validatePublisher(publisher) {
|
|
34
35
|
if (!publisher) {
|
|
@@ -125,4 +126,32 @@ function validateVSCodeTypesCompatibility(engineVersion, typeVersion) {
|
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
exports.validateVSCodeTypesCompatibility = validateVSCodeTypesCompatibility;
|
|
129
|
+
/**
|
|
130
|
+
* Validates that extension IDs use only lowercase letters.
|
|
131
|
+
* This validation ensures compliance with VS Code extension marketplace requirements.
|
|
132
|
+
*
|
|
133
|
+
* Note: This only validates the case (lowercase). It does not validate the format
|
|
134
|
+
* or structure of extension IDs (e.g., presence of dot separator, valid characters).
|
|
135
|
+
*/
|
|
136
|
+
function validateExtensionDependencies(dependencies, fieldName) {
|
|
137
|
+
if (!dependencies || dependencies.length === 0) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const invalidDependencies = [];
|
|
141
|
+
for (const dep of dependencies) {
|
|
142
|
+
// Check if extension ID uses only lowercase letters
|
|
143
|
+
// Note: This does not validate the format of the extension ID itself
|
|
144
|
+
if (dep !== dep.toLowerCase()) {
|
|
145
|
+
invalidDependencies.push(dep);
|
|
146
|
+
}
|
|
147
|
+
if (dep === 'github.copilot') {
|
|
148
|
+
util_1.log.warn(`The "github.copilot" extension is being deprecated in favor of the "github.copilot-chat" extension. Please use "github.copilot-chat" in ${fieldName} instead.`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (invalidDependencies.length > 0) {
|
|
152
|
+
const depList = invalidDependencies.map(d => `"${d}"`).join(', ');
|
|
153
|
+
throw new Error(`The extension IDs in "${fieldName}" must use lowercase letters only. Invalid IDs: ${depList}.`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.validateExtensionDependencies = validateExtensionDependencies;
|
|
128
157
|
//# sourceMappingURL=validation.js.map
|