feat: apply patch after setting up subtree
This commit is contained in:
@ -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;
|
||||
|
@ -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/);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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');
|
||||
|
@ -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');
|
||||
|
Reference in New Issue
Block a user