Skip to content

Commit d7ef999

Browse files
committed
Restore yarnrc removal
I was getting module issues again. See #4 for details.
1 parent 02b01bd commit d7ef999

File tree

7 files changed

+13
-18
lines changed

7 files changed

+13
-18
lines changed

.yarnrc

-4
This file was deleted.

build/gulpfile.reh.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ const serverWithWebEntryPoints = [
134134
];
135135

136136
function getNodeVersion () {
137-
// NOTE@coder: Fix version due to .yarnrc removal.
137+
// NOTE@coder: Always use the current version to avoid native module errors.
138138
return process.versions.node;
139139

140140
const yarnrc = fs.readFileSync(path.join(REPO_ROOT, 'remote', '.yarnrc'), 'utf8');

build/lib/node.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
77
const path = require("path");
88
const fs = require("fs");
99
const root = path.dirname(path.dirname(__dirname));
10-
const yarnrcPath = path.join(root, 'remote', '.yarnrc');
11-
const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
12-
const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)[1];
10+
// NOTE@coder: Always use the current version to avoid native module errors.
11+
// const yarnrcPath = path.join(root, 'remote', '.yarnrc');
12+
// const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
13+
// const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)[1];
14+
const version = process.versions.node;
1315
const platform = process.platform;
1416
const arch = platform === 'darwin' ? 'x64' : process.arch;
1517
const node = platform === 'win32' ? 'node.exe' : 'node';

build/lib/node.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
import * as path from 'path';
77

88
const root = path.dirname(path.dirname(__dirname));
9-
10-
// NOTE@coder: Fix version due to .yarnrc removal.
9+
// NOTE@coder: Always use the current version to avoid native module errors.
10+
// const yarnrcPath = path.join(root, 'remote', '.yarnrc');
11+
// const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
12+
// const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)[1];
1113
const version = process.versions.node;
1214
const platform = process.platform;
1315
const arch = platform === 'darwin' ? 'x64' : process.arch;
14-
1516
const node = platform === 'win32' ? 'node.exe' : 'node';
1617
const nodePath = path.join(root, '.build', 'node', `v${version}`, `${platform}-${arch}`, node);
17-
1818
console.log(nodePath);

build/lib/util.js

+2
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: Always use the current version to avoid native module errors.
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;

build/lib/util.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,8 @@ export function streamToPromise(stream: NodeJS.ReadWriteStream): Promise<void> {
336336
}
337337

338338
export function getElectronVersion(): string {
339-
// NOTE@coder: Fix version due to .yarnrc removal.
339+
// NOTE@coder: Always use the current version to avoid native module errors.
340340
return process.versions.node;
341-
342341
const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8');
343342
const target = /^target "(.*)"$/m.exec(yarnrc)![1];
344343
return target;
@@ -406,4 +405,3 @@ export function buildWebNodePaths(outDir: string) {
406405
result.taskName = 'build-web-node-paths';
407406
return result;
408407
}
409-

remote/.yarnrc

-3
This file was deleted.

0 commit comments

Comments
 (0)