Skip to content

Commit b0e9eff

Browse files
code-asherAkash Satheesan
authored andcommitted
Restore .yarnrc patch
Delete .yarnrc and update the build process where that file is read since it no longer exists. This should resolve the issues we keep having with mismatched Node versions. This can be consistently replicated by spinning up a new environment (no previous modules or cache), running yarn, then running yarn watch. Also use process.versions.node instead of process.version as the latter has an extra v at the beginning.
1 parent 3c95888 commit b0e9eff

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

lib/vscode/.yarnrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/vscode/build/gulpfile.reh.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ BUILD_TARGETS.forEach(({ platform, arch }) => {
4242
});
4343

4444
function getNodeVersion() {
45+
// NOTE@coder: Fix version due to .yarnrc removal.
46+
return process.versions.node;
4547
const yarnrc = fs.readFileSync(path.join(REPO_ROOT, 'remote', '.yarnrc'), 'utf8');
4648
const target = /^target "(.*)"$/m.exec(yarnrc)[1];
4749
return target;

lib/vscode/build/lib/node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const path = require("path");
88
const fs = require("fs");
99
const root = path.dirname(path.dirname(__dirname));
1010
const yarnrcPath = path.join(root, 'remote', '.yarnrc');
11-
const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
12-
const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)[1];
11+
// NOTE@coder: Fix version due to .yarnrc removal.
12+
const version = process.versions.node;
1313
const platform = process.platform;
1414
const arch = platform === 'darwin' ? 'x64' : process.arch;
1515
const node = platform === 'win32' ? 'node.exe' : 'node';

lib/vscode/build/lib/node.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import * as path from 'path';
77

88
const root = path.dirname(path.dirname(__dirname));
99

10-
// NOTE@coder: patch version detection
11-
const version = process.version;
10+
// NOTE@coder: Fix version due to .yarnrc removal.
11+
const version = process.versions.node;
1212
const platform = process.platform;
1313
const arch = platform === 'darwin' ? 'x64' : process.arch;
1414

lib/vscode/build/lib/util.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ function streamToPromise(stream) {
269269
}
270270
exports.streamToPromise = streamToPromise;
271271
function getElectronVersion() {
272+
// NOTE@coder: Fix version due to .yarnrc removal.
273+
return process.versions.node;
272274
const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8');
273275
const target = /^target "(.*)"$/m.exec(yarnrc)[1];
274276
return target;

lib/vscode/build/lib/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,6 @@ export function streamToPromise(stream: NodeJS.ReadWriteStream): Promise<void> {
336336
}
337337

338338
export function getElectronVersion(): string {
339-
// NOTE@coder: patch version detection
340-
return process.version;
339+
// NOTE@coder: Fix version due to .yarnrc removal.
340+
return process.versions.node;
341341
}

0 commit comments

Comments
 (0)