Skip to content

Commit

Permalink
upgrade 1.92.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Felx-B committed Aug 4, 2024
1 parent 1c80e8e commit 994ef83
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 26 deletions.
59 changes: 36 additions & 23 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ const { version } = require("./package.json");
const vscodeVersion = version.split("-")[0];

function error(msg) {
console.info("\x1b[31merror %s\x1b[0m", msg)
console.info("\x1b[31merror %s\x1b[0m", msg);
}
function ok(msg) {
console.info("\x1b[32m%s\x1b[0m", msg)
console.info("\x1b[32m%s\x1b[0m", msg);
}
function note(msg) {
console.info("\x1b[90m%s\x1b[0m", msg)
console.info("\x1b[90m%s\x1b[0m", msg);
}
function exec(cmd, opts) {
console.info("\x1b[36m%s\x1b[0m", cmd)
console.info("\x1b[36m%s\x1b[0m", cmd);
return child_process.execSync(cmd, opts);
}

const requiredTools = ["node", "yarn", "git", "python"];
note(`required tools ${JSON.stringify(requiredTools)}`)
note(`required tools ${JSON.stringify(requiredTools)}`);
for (const tool of requiredTools) {
try {
child_process.execSync(`${tool} --version`, { stdio: "ignore" });
Expand All @@ -30,51 +30,64 @@ for (const tool of requiredTools) {
process.exit(1);
}
}
ok("required tools installed")
ok("required tools installed");

const node_version_out = child_process.execSync(`node -v`);
const node_version = node_version_out.toString().trim()
const node_version = node_version_out.toString().trim();
if (node_version < "v20.0") {
error(`Want node > 20. Got "${node_version}"`);
process.exit(1);
}

if (!fs.existsSync("vscode")) {
note("cloning vscode")
exec(`git clone --depth 1 https://github.com/microsoft/vscode.git -b ${vscodeVersion}`, {
stdio: "inherit",
});
note("cloning vscode");
exec(
`git clone --depth 1 https://github.com/microsoft/vscode.git -b ${vscodeVersion}`,
{
stdio: "inherit",
}
);
} else {
ok("vscode already installed")
note("delete vscode folder to clone again")
ok("vscode already installed");
note("delete vscode folder to clone again");
}

note("changing directory to vscode")
note("changing directory to vscode");
process.chdir("vscode");

if (!fs.existsSync("node_modules")) {
exec("yarn", { stdio: "inherit" });
exec("yarn", {
stdio: "inherit",
env: {
...process.env,
ELECTRON_SKIP_BINARY_DOWNLOAD: 1,
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1,
},
});
} else {
ok("node_modules exists. Skipping yarn")
ok("node_modules exists. Skipping yarn");
}

// Use simple workbench
note("copying workbench file")
fs.copyFileSync("../workbench.ts", "src/vs/code/browser/workbench/workbench.ts");
note("copying workbench file");
fs.copyFileSync(
"../workbench.ts",
"src/vs/code/browser/workbench/workbench.ts"
);

// Compile
note("starting compile")
note("starting compile");
exec("yarn gulp vscode-web-min", { stdio: "inherit" });
ok("compile completed")
ok("compile completed");

// Extract compiled files
if (fs.existsSync("../dist")) {
note("cleaning ../dist")
note("cleaning ../dist");
fs.rmdirSync("../dist", { recursive: true });
} else {
ok("../dist did not exist. No need to clean")
ok("../dist did not exist. No need to clean");
}

fs.mkdirSync("../dist");
fse.copySync("../vscode-web", "../dist");
ok("copied ../vscode-web to ../dist")
ok("copied ../vscode-web to ../dist");
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"name": "vscode-web",
"version": "1.91.1",
"version": "1.92.0",
"description": "Visual Studio Code for browser",
"files": ["dist"],
"files": [
"dist"
],
"scripts": {
"build": "node build.js",
"prepare-demo": "node prepare-demo.js",
Expand All @@ -22,5 +24,6 @@
"express": "^4.17.1",
"fs-extra": "^9.0.1"
},
"dependencies": {}
"dependencies": {},
"packageManager": "[email protected]+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
}

0 comments on commit 994ef83

Please sign in to comment.