@vscode/vsce 3.2.2-2 → 3.2.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/out/package.js +18 -9
- package/package.json +1 -1
package/out/package.js
CHANGED
|
@@ -300,16 +300,19 @@ class ManifestProcessor extends BaseProcessor {
|
|
|
300
300
|
const target = options.target;
|
|
301
301
|
const preRelease = options.preRelease;
|
|
302
302
|
if (target || preRelease) {
|
|
303
|
-
let
|
|
303
|
+
let engineSemver;
|
|
304
304
|
try {
|
|
305
|
-
|
|
306
|
-
engineVersion = engineSemver.version;
|
|
305
|
+
engineSemver = (0, parse_semver_1.default)(`vscode@${manifest.engines.vscode}`);
|
|
307
306
|
}
|
|
308
307
|
catch (err) {
|
|
309
308
|
throw new Error('Failed to parse semver of engines.vscode');
|
|
310
309
|
}
|
|
310
|
+
const minEngineVersion = semver.minVersion(engineSemver.range);
|
|
311
|
+
if (!minEngineVersion) {
|
|
312
|
+
throw new Error('Failed to get minVersion of engines.vscode');
|
|
313
|
+
}
|
|
311
314
|
if (target) {
|
|
312
|
-
if (
|
|
315
|
+
if (engineSemver.version !== 'latest' && !semver.satisfies(minEngineVersion, '>=1.61', { includePrerelease: true })) {
|
|
313
316
|
throw new Error(`Platform specific extension is supported by VS Code >=1.61. Current 'engines.vscode' is '${manifest.engines.vscode}'.`);
|
|
314
317
|
}
|
|
315
318
|
if (!exports.Targets.has(target)) {
|
|
@@ -317,7 +320,7 @@ class ManifestProcessor extends BaseProcessor {
|
|
|
317
320
|
}
|
|
318
321
|
}
|
|
319
322
|
if (preRelease) {
|
|
320
|
-
if (
|
|
323
|
+
if (engineSemver.version !== 'latest' && !semver.satisfies(minEngineVersion, '>=1.63', { includePrerelease: true })) {
|
|
321
324
|
throw new Error(`Pre-release versions are supported by VS Code >=1.63. Current 'engines.vscode' is '${manifest.engines.vscode}'.`);
|
|
322
325
|
}
|
|
323
326
|
}
|
|
@@ -1318,11 +1321,17 @@ function writeVsix(files, packagePath) {
|
|
|
1318
1321
|
.catch(err => (err.code !== 'ENOENT' ? Promise.reject(err) : Promise.resolve(null)))
|
|
1319
1322
|
.then(() => new Promise((c, e) => {
|
|
1320
1323
|
const zip = new yazl.ZipFile();
|
|
1324
|
+
const zipOptions = {};
|
|
1325
|
+
// reproducible zip files
|
|
1326
|
+
const sde = process.env.SOURCE_DATE_EPOCH;
|
|
1327
|
+
if (sde) {
|
|
1328
|
+
const epoch = parseInt(sde);
|
|
1329
|
+
zipOptions.mtime = new Date(epoch * 1000);
|
|
1330
|
+
files = files.sort((a, b) => a.path.localeCompare(b.path));
|
|
1331
|
+
}
|
|
1321
1332
|
files.forEach(f => isInMemoryFile(f)
|
|
1322
|
-
? zip.addBuffer(typeof f.contents === 'string' ? Buffer.from(f.contents, 'utf8') : f.contents, f.path, {
|
|
1323
|
-
|
|
1324
|
-
})
|
|
1325
|
-
: zip.addFile(f.localPath, f.path, { mode: f.mode }));
|
|
1333
|
+
? zip.addBuffer(typeof f.contents === 'string' ? Buffer.from(f.contents, 'utf8') : f.contents, f.path, { ...zipOptions, mode: f.mode })
|
|
1334
|
+
: zip.addFile(f.localPath, f.path, { ...zipOptions, mode: f.mode }));
|
|
1326
1335
|
zip.end();
|
|
1327
1336
|
const zipStream = fs.createWriteStream(packagePath);
|
|
1328
1337
|
zip.outputStream.pipe(zipStream);
|