Skip to content

Commit 786f087

Browse files
committed
docs(patches): add testing notes for node-version
1 parent 63dfa8d commit 786f087

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

patches/node-version.diff

+9-9
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ To test this:
88

99
1. build fresh Coder workspace
1010
2. clone code-server
11-
3. `yarn watch`
11+
3. `yarn build && yarn build:vscode && KEEP_MODULES=1 yarn release`
1212
4. test built-in terminal
1313

1414
Index: code-server/lib/vscode/build/gulpfile.reh.js
@@ -17,14 +17,14 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
1717
+++ code-server/lib/vscode/build/gulpfile.reh.js
1818
@@ -125,9 +125,7 @@ const serverWithWebEntryPoints = [
1919
];
20-
20+
2121
function getNodeVersion() {
2222
- const yarnrc = fs.readFileSync(path.join(REPO_ROOT, 'remote', '.yarnrc'), 'utf8');
2323
- const target = /^target "(.*)"$/m.exec(yarnrc)[1];
2424
- return target;
2525
+ return process.versions.node;
2626
}
27-
27+
2828
const nodeVersion = getNodeVersion();
2929
Index: code-server/lib/vscode/build/lib/node.js
3030
===================================================================
@@ -47,13 +47,13 @@ Index: code-server/lib/vscode/build/lib/node.ts
4747
+++ code-server/lib/vscode/build/lib/node.ts
4848
@@ -7,9 +7,7 @@ import * as path from 'path';
4949
import * as fs from 'fs';
50-
50+
5151
const root = path.dirname(path.dirname(__dirname));
5252
-const yarnrcPath = path.join(root, 'remote', '.yarnrc');
5353
-const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
5454
-const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)![1];
5555
+const version = process.versions.node;
56-
56+
5757
const platform = process.platform;
5858
const arch = process.arch;
5959
Index: code-server/lib/vscode/build/lib/util.js
@@ -75,16 +75,16 @@ Index: code-server/lib/vscode/build/lib/util.ts
7575
===================================================================
7676
--- code-server.orig/lib/vscode/build/lib/util.ts
7777
+++ code-server/lib/vscode/build/lib/util.ts
78-
@@ -371,9 +371,7 @@ export function streamToPromise(stream:
78+
@@ -371,9 +371,7 @@ export function streamToPromise(stream:
7979
}
80-
80+
8181
export function getElectronVersion(): string {
8282
- const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8');
8383
- const target = /^target "(.*)"$/m.exec(yarnrc)![1];
8484
- return target;
8585
+ return process.versions.node;
8686
}
87-
87+
8888
export function acquireWebNodePaths() {
8989
@@ -455,4 +453,3 @@ export function buildWebNodePaths(outDir
9090
result.taskName = 'build-web-node-paths';
@@ -98,7 +98,7 @@ Index: code-server/lib/vscode/build/npm/preinstall.js
9898
@@ -32,6 +32,13 @@ if (!/yarn[\w-.]*\.c?js$|yarnpkg$/.test(
9999
err = true;
100100
}
101-
101+
102102
+fs.rmSync(path.join(__dirname, '..', '..', '.yarnrc'), {
103103
+ force: true
104104
+});

0 commit comments

Comments
 (0)