Archived
1
0

feat: apply patch after setting up subtree

This commit is contained in:
Joe Previte
2020-12-15 15:53:52 -07:00
parent 41bee49d07
commit 51a2a2ad2d
84 changed files with 3360 additions and 191 deletions

View File

@ -44,6 +44,7 @@ BUILD_TARGETS.forEach(({ platform, arch }) => {
});
function getNodeVersion() {
return process.versions.node;
const yarnrc = fs.readFileSync(path.join(REPO_ROOT, 'remote', '.yarnrc'), 'utf8');
const target = /^target "(.*)"$/m.exec(yarnrc)[1];
return target;

View File

@ -70,7 +70,7 @@ function fromLocal(extensionPath: string, forWeb: boolean): Stream {
if (isWebPacked) {
input = updateExtensionPackageJSON(input, (data: any) => {
delete data.scripts;
delete data.dependencies;
// https://github.com/cdr/code-server/pull/2041#issuecomment-685910322
delete data.devDependencies;
if (data.main) {
data.main = data.main.replace('/out/', /dist/);

View File

@ -4,13 +4,10 @@
*--------------------------------------------------------------------------------------------*/
import * as path from 'path';
import * as fs from 'fs';
const root = path.dirname(path.dirname(__dirname));
const yarnrcPath = path.join(root, 'remote', '.yarnrc');
const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)![1];
const version = process.versions.node;
const node = process.platform === 'win32' ? 'node.exe' : 'node';
const nodePath = path.join(root, '.build', 'node', `v${version}`, `${process.platform}-${process.arch}`, node);
console.log(nodePath);
console.log(nodePath);

View File

@ -336,6 +336,7 @@ export function streamToPromise(stream: NodeJS.ReadWriteStream): Promise<void> {
}
export function getElectronVersion(): string {
return process.versions.node;
const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8');
const target = /^target "(.*)"$/m.exec(yarnrc)![1];
return target;

View File

@ -33,10 +33,11 @@ function yarnInstall(location, opts) {
yarnInstall('extensions'); // node modules shared by all extensions
if (!(process.platform === 'win32' && (process.arch === 'arm64' || process.env['npm_config_arch'] === 'arm64'))) {
yarnInstall('remote'); // node modules used by vscode server
yarnInstall('remote/web'); // node modules used by vscode web
}
// NOTE@coder: Skip these dependencies since we don't use them.
// if (!(process.platform === 'win32' && (process.arch === 'arm64' || process.env['npm_config_arch'] === 'arm64'))) {
// yarnInstall('remote'); // node modules used by vscode server
// yarnInstall('remote/web'); // node modules used by vscode web
// }
const allExtensionFolders = fs.readdirSync('extensions');
const extensions = allExtensionFolders.filter(e => {
@ -69,9 +70,9 @@ runtime "${runtime}"`;
}
yarnInstall(`build`); // node modules required for build
yarnInstall('test/automation'); // node modules required for smoketest
yarnInstall('test/smoke'); // node modules required for smoketest
yarnInstall('test/integration/browser'); // node modules required for integration
// yarnInstall('test/automation'); // node modules required for smoketest
// yarnInstall('test/smoke'); // node modules required for smoketest
// yarnInstall('test/integration/browser'); // node modules required for integration
yarnInstallBuildDependencies(); // node modules for watching, specific to host node version, not electron
cp.execSync('git config pull.rebase true');

View File

@ -8,8 +8,9 @@ let err = false;
const majorNodeVersion = parseInt(/^(\d+)\./.exec(process.versions.node)[1]);
if (majorNodeVersion < 10 || majorNodeVersion >= 13) {
console.error('\033[1;31m*** Please use node >=10 and <=12.\033[0;0m');
err = true;
// We are ok building above Node 12.
// console.error('\033[1;31m*** Please use node >=10 and <=12.\033[0;0m');
// err = true;
}
const cp = require('child_process');