Skip to content

Commit

Permalink
chore: bump vscode to 1.93.1 (conwnet#588)
Browse files Browse the repository at this point in the history
* feat: update dev scripts

* chore: bump vscode to 1.93.1
  • Loading branch information
conwnet authored Sep 25, 2024
1 parent d5a45cd commit 34b41e7
Show file tree
Hide file tree
Showing 19 changed files with 579 additions and 566 deletions.
14 changes: 5 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,31 @@
"lib": "lib"
},
"devDependencies": {
"@github1s/vscode-web": "0.21.0",
"@github1s/vscode-web": "0.22.0",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.1",
"chokidar": "^3.5.3",
"clean-css": "^5.3.2",
"copy-webpack-plugin": "^11.0.0",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^6.7.3",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jsdoc": "^46.8.2",
"eslint-plugin-prettier": "^4.2.1",
"file-loader": "^6.2.0",
"fs-extra": "^10.1.0",
"generate-file-webpack-plugin": "^1.0.1",
"html-webpack-plugin": "^5.5.0",
"http-proxy": "^1.18.1",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"serve-handler": "^6.1.3",
"start-server-and-test": "^1.14.0",
"style-loader": "^3.3.1",
"ts-loader": "^9.4.2",
"typescript": "^4.7.3",
"uglify-js": "^3.17.4",
"webpack": "^5.75.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.2",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0",
"yalc": "^1.0.0-pre.53"
},
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions scripts/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const createExtensionsContent = (devVscode) => {
const createVSCodeUnpkgProxy = () => ({
changeOrigin: true,
target: 'vscode-unpkg.net',
context: '/api/vscode-unpkg/',
pathRewrite: (path) => path.replace(/^\/api\/vscode-unpkg\//, '/'),
router: (req) => {
const PATH_REGEXP = /^\/api\/vscode-unpkg\/([^/]+)\/(.*)/;
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ const resolvePlatformState = (): [Platform, string] => {
const [platform, repository] = resolvePlatformState();
const staticAssetsPath = '/static-' + STATIC_HASH;
const staticAssetsPrefix = window.location.origin + staticAssetsPath;
const nodeModulesPrefix = staticAssetsPrefix + '/node_modules';
const webPackagesPrefix = staticAssetsPrefix + '/web-packages';

Object.keys(window.webPackagePaths || {}).forEach((key) => {
self.webPackagePaths[key] = `${nodeModulesPrefix}/${key}/${self.webPackagePaths[key]}`;
self.webPackagePaths[key] = `${webPackagesPrefix}/${key}/${self.webPackagePaths[key]}`;
});
// config vscode loader
if (window.require && window.require.config) {
Expand Down
2 changes: 1 addition & 1 deletion vscode-web/.VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.92.1
1.93.1
21 changes: 4 additions & 17 deletions vscode-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@github1s/vscode-web",
"version": "0.21.0",
"version": "0.22.0",
"description": "VS Code web for GitHub1s",
"author": "github1s",
"license": "MIT",
Expand All @@ -12,6 +12,7 @@
"build:vscode": "./scripts/build-vscode.sh",
"copy:vscode": "./scripts/copy-vscode.sh",
"copy:extensions": "./scripts/copy-extensions.sh",
"copy:web-pkgs": "node ./scripts/copy-web-pkgs.js",
"watch": "run-s clone sync && run-p watch:*",
"watch:vscode": "cd lib/vscode && run-p watch watch-web",
"watch:src": "cd scripts/watch && node watch-src.js",
Expand All @@ -27,23 +28,9 @@
"vscode-web",
"github1s"
],
"dependencies": {
"@vscode/iconv-lite-umd": "0.7.0",
"@vscode/vscode-languagedetection": "1.0.21",
"@xterm/addon-canvas": "0.6.0-beta.31",
"@xterm/addon-image": "0.7.0-beta.29",
"@xterm/addon-search": "0.14.0-beta.31",
"@xterm/addon-serialize": "0.12.0-beta.31",
"@xterm/addon-unicode11": "0.7.0-beta.31",
"@xterm/addon-webgl": "0.17.0-beta.31",
"@xterm/xterm": "5.4.0-beta.31",
"jschardet": "3.0.0",
"tas-client-umd": "0.1.8",
"vscode-oniguruma": "1.7.0",
"vscode-textmate": "9.0.0"
},
"devDependencies": {
"@types/trusted-types": "^2.0.0",
"chokidar": "^4.0.1",
"fs-extra": "^11.2.0",
"npm-run-all": "^4.1.5"
}
}
6 changes: 3 additions & 3 deletions vscode-web/scripts/.patch
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"vs/code/browser/workbench/workbench.ts": "4d5caa66a9d8d5c862c4ee6a928c4e1cb7cc93fc481dc9c471245229be7323e1",
"vs/workbench/browser/parts/activitybar/activitybarPart.ts": "b07df66ce53deb7b5a27f7cb6ff0f538c9ea501feffd7d2088412b0cd5794d85",
"vs/workbench/browser/parts/titlebar/media/titlebarpart.css": "253c6b6b1212d0ca80e1969959d3d09d0c1040f3bea3ad076f2708783bd14544",
"vs/workbench/browser/web.main.ts": "1d2b5be2afca548654bfcfa7e340128e194c35dda0c63fc69dd7d48f8c7d5303",
"vs/workbench/browser/parts/titlebar/media/titlebarpart.css": "c9fea6e3292291df35888de13a9c2de6fd86ba85a74375401b73e7ecc1489524",
"vs/workbench/browser/web.main.ts": "1380a43fca18fb65ae0eacf86adcbdaa29b87275aea0a62351d15da683884c82",
"vs/workbench/contrib/files/browser/editors/fileEditorInput.ts": "86663454cc80d8fb63900ffd88f826ad971071976e54c2b9dfbbcab17bd6dc49",
"vs/workbench/contrib/webview/browser/pre/index.html": "1ed907f3e7e0dc14c9e0e45313b7edd5d4f80abb7d26607103ea1807aca0e0ff",
"vs/workbench/contrib/webview/browser/pre/index.html": "09664522d7c6b0fdb7728be06b1a1f6ec8bb82c4fd6f2d13a7e84a0fd7d667af",
"vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts": "8cbb23b36f1e35436c0cd53b10f6ba2d3a51c92cee297d1fd956b9dcd6e33b1a",
"vs/workbench/services/label/common/labelService.ts": "73237cce0f9496151ea8ae5079676bbdfa15ce49de9b05621d39fcd04e9c1f0d",
"vs/workbench/services/textfile/browser/textFileService.ts": "ce29c4161401a02203832bd95b673012c9a183b715e3d30b19fdb03a312df34e"
Expand Down
6 changes: 3 additions & 3 deletions vscode-web/scripts/build-vscode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
set -euo pipefail

cd "$(dirname "${0}")/.."
APP_ROOT=$(pwd)
echo $APP_ROOT
VSCODE_WEB_ROOT=$(pwd)
echo $VSCODE_WEB_ROOT

# build vscode source and vscode builtin extensions
function main() {
cd ${APP_ROOT}/lib/vscode
cd ${VSCODE_WEB_ROOT}/lib/vscode

yarn gulp vscode-web-min

Expand Down
8 changes: 4 additions & 4 deletions vscode-web/scripts/clone-vscode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
set -euo pipefail

cd "$(dirname "${0}")/.."
APP_ROOT=$(pwd)
VSCODE_WEB_ROOT=$(pwd)

function main() {
# clone vscode and install dependencies
cd ${APP_ROOT}
cd ${VSCODE_WEB_ROOT}
if [ -d "lib/vscode" ]; then
echo "./lib/vscode already exists, skip clone."
exit 0
fi
mkdir -p lib
cd lib
git clone --depth 1 -b `cat ${APP_ROOT}/.VERSION` https://github.com/microsoft/vscode.git vscode
node ${APP_ROOT}/scripts/patch.js
git clone --depth 1 -b `cat ${VSCODE_WEB_ROOT}/.VERSION` https://github.com/microsoft/vscode.git vscode
node ${VSCODE_WEB_ROOT}/scripts/patch.js
cd vscode
yarn --frozen-lockfile
}
Expand Down
8 changes: 4 additions & 4 deletions vscode-web/scripts/copy-extensions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
set -euo pipefail

cd "$(dirname "${0}")/.."
APP_ROOT=$(pwd)
VSCODE_WEB_ROOT=$(pwd)
function ensureBuiltinExtensitions() {
cd "${APP_ROOT}/lib/vscode"
cd "${VSCODE_WEB_ROOT}/lib/vscode"
EXTENSIONS_DIRTY=0 && git diff --exit-code --name-only extensions || EXTENSIONS_DIRTY=$?
if [ $EXTENSIONS_DIRTY != 0 ] || [ ! -e ".build/web/extensions" ]
then
Expand All @@ -17,9 +17,9 @@ function ensureBuiltinExtensitions() {

function main() {
ensureBuiltinExtensitions
cd ${APP_ROOT}
cd ${VSCODE_WEB_ROOT}
mkdir -p "dist/extensions"
cp -R ${APP_ROOT}/lib/vscode/.build/web/extensions/* ${APP_ROOT}/dist/extensions
cp -R ${VSCODE_WEB_ROOT}/lib/vscode/.build/web/extensions/* ${VSCODE_WEB_ROOT}/dist/extensions

echo "copy vscode builtin extensions done!"
}
Expand Down
4 changes: 2 additions & 2 deletions vscode-web/scripts/copy-vscode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
set -euo pipefail

cd "$(dirname "${0}")/.."
APP_ROOT=$(pwd)
VSCODE_WEB_ROOT=$(pwd)

function main() {
cd ${APP_ROOT}
cd ${VSCODE_WEB_ROOT}
TARGET="dist/vscode"
mkdir -p ${TARGET}
rsync -a --del lib/vscode/out-vscode-web-min/ "${TARGET}"
Expand Down
28 changes: 28 additions & 0 deletions vscode-web/scripts/copy-web-pkgs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env node

const path = require('path');
const fs = require('fs-extra');

const VSCODE_WEB_ROOT = path.join(__dirname, '..');
const VSCODE_ROOT = path.join(VSCODE_WEB_ROOT, 'lib/vscode');

const getWebPackagePaths = () => {
const webPkgPath = path.join(VSCODE_ROOT, 'remote/web/package.json');
return Object.keys(require(webPkgPath).dependencies).filter((pkg) => {
return !['@microsoft/1ds-core-js', '@microsoft/1ds-post-js'].includes(pkg);
});
};

const main = () => {
const webPkgPaths = getWebPackagePaths();
const webPkgsRoot = path.join(VSCODE_WEB_ROOT, 'dist/web-packages');
fs.ensureDirSync(webPkgsRoot);
webPkgPaths.forEach((pkg) => {
const src = path.join(VSCODE_ROOT, 'node_modules', pkg);
const dest = path.join(webPkgsRoot, pkg);
fs.copySync(src, dest);
});
console.log(`Copied ${webPkgPaths.length} web packages done!`);
};

main();
6 changes: 3 additions & 3 deletions vscode-web/scripts/patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const path = require('path');
const cp = require('child_process');
const fsPromise = require('fs/promises');

const APP_ROOT = path.join(__dirname, '..');
const VSCODE_WEB_ROOT = path.join(__dirname, '..');

const SRC_SOURCE = path.join(APP_ROOT, 'src');
const SRC_TARGET = path.join(APP_ROOT, 'lib/vscode/src');
const SRC_SOURCE = path.join(VSCODE_WEB_ROOT, 'src');
const SRC_TARGET = path.join(VSCODE_WEB_ROOT, 'lib/vscode/src');

let config = {};
let needUpdate = false;
Expand Down
6 changes: 3 additions & 3 deletions vscode-web/scripts/sync-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
set -euo pipefail

cd "$(dirname "${0}")/.."
APP_ROOT=$(pwd)
echo $APP_ROOT
VSCODE_WEB_ROOT=$(pwd)
echo $VSCODE_WEB_ROOT

# sync src/* to vscode
function main() {
cd ${APP_ROOT}
cd ${VSCODE_WEB_ROOT}
rsync -a src/ lib/vscode/src
if [ -e extensions ]; then
rsync -a extensions/ lib/vscode/extensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@
color: var(--vscode-titleBar-activeForeground);
}

.monaco-workbench .part.titlebar.inactive > .titlebar-container > .titlebar-center > .window-title > .command-center > .monaco-toolbar > .monaco-action-bar > .actions-container > .action-item > .action-label {
.monaco-workbench .part.titlebar.inactive > .titlebar-container > .titlebar-center > .window-title > .command-center > .monaco-toolbar > .monaco-action-bar > .actions-container > .action-item > .action-label {
color: var(--vscode-titleBar-inactiveForeground);
}

.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center > .monaco-toolbar > .monaco-action-bar > .actions-container > .action-item > .action-label {
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center > .monaco-toolbar > .monaco-action-bar > .actions-container > .action-item > .action-label {
color: inherit;
}

Expand Down Expand Up @@ -182,7 +182,7 @@
text-overflow: ellipsis;
}

.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center.multiple {
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center.multiple {
justify-content: flex-start;
padding: 0 12px;
}
Expand Down Expand Up @@ -280,7 +280,7 @@
border-left: 1px solid transparent;
}

/* Window Controls (Minimize, Max/Restore, Close) */
/* Window Controls Container */
.monaco-workbench .part.titlebar .window-controls-container {
display: flex;
flex-grow: 0;
Expand All @@ -292,7 +292,12 @@
height: 100%;
}

/* Web WCO Sizing/Ordering */
.monaco-workbench.fullscreen .part.titlebar .window-controls-container {
display: none;
background-color: transparent;
}

/* Window Controls Container Web: Apply WCO environment variables (https://developer.mozilla.org/en-US/docs/Web/CSS/env#titlebar-area-x) */
.monaco-workbench.web .part.titlebar .titlebar-right .window-controls-container {
width: calc(100vw - env(titlebar-area-width, 100vw) - env(titlebar-area-x, 0px));
height: env(titlebar-area-height, 35px);
Expand All @@ -311,29 +316,31 @@
order: 1;
}

/* Desktop Windows/Linux Window Controls*/
.monaco-workbench:not(.web):not(.mac) .part.titlebar .window-controls-container.primary {
/* Window Controls Container Desktop: apply zoom friendly size */
.monaco-workbench:not(.web):not(.mac) .part.titlebar .window-controls-container {
width: calc(138px / var(--zoom-factor, 1));
}

.monaco-workbench:not(.web):not(.mac) .part.titlebar .titlebar-container.counter-zoom .window-controls-container.primary {
.monaco-workbench:not(.web):not(.mac) .part.titlebar .titlebar-container.counter-zoom .window-controls-container {
width: 138px;
}

.monaco-workbench.linux:not(.web) .part.titlebar .window-controls-container.wco-enabled {
width: calc(var(--title-wco-width, 138px));
}

.monaco-workbench.linux:not(.web) .part.titlebar .titlebar-container.counter-zoom .window-controls-container.wco-enabled {
width: var(--title-wco-width, 138px);
}

.monaco-workbench:not(.web):not(.mac) .part.titlebar .titlebar-container:not(.counter-zoom) .window-controls-container * {
zoom: calc(1 / var(--zoom-factor, 1));
}

/* Desktop macOS Window Controls */
.monaco-workbench:not(.web).mac .part.titlebar .window-controls-container.primary {
.monaco-workbench:not(.web).mac .part.titlebar .window-controls-container {
width: 70px;
}

.monaco-workbench.fullscreen .part.titlebar .window-controls-container {
display: none;
background-color: transparent;
}

/* Window Control Icons */
.monaco-workbench .part.titlebar .window-controls-container > .window-icon {
display: flex;
Expand All @@ -342,6 +349,11 @@
height: 100%;
width: 46px;
font-size: 16px;
color: var(--vscode-titleBar-activeForeground);
}

.monaco-workbench .part.titlebar.inactive .window-controls-container > .window-icon {
color: var(--vscode-titleBar-inactiveForeground);
}

.monaco-workbench .part.titlebar .window-controls-container > .window-icon::before {
Expand Down Expand Up @@ -376,7 +388,6 @@
z-index: 2500;
-webkit-app-region: no-drag;
height: 100%;
min-width: 28px;
}

.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .action-toolbar-container {
Expand Down
9 changes: 5 additions & 4 deletions vscode-web/src/vs/workbench/browser/web.main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -588,13 +588,14 @@ export class BrowserMain extends Disposable {
}
}

private async getCurrentProfile(workspace: IAnyWorkspaceIdentifier, userDataProfilesService: BrowserUserDataProfilesService, environmentService: IBrowserWorkbenchEnvironmentService): Promise<IUserDataProfile> {
if (environmentService.options?.profile) {
const profile = userDataProfilesService.profiles.find(p => p.name === environmentService.options?.profile?.name);
private async getCurrentProfile(workspace: IAnyWorkspaceIdentifier, userDataProfilesService: BrowserUserDataProfilesService, environmentService: BrowserWorkbenchEnvironmentService): Promise<IUserDataProfile> {
const profileName = environmentService.options?.profile?.name ?? environmentService.profile;
if (profileName) {
const profile = userDataProfilesService.profiles.find(p => p.name === profileName);
if (profile) {
return profile;
}
return userDataProfilesService.createNamedProfile(environmentService.options?.profile?.name, undefined, workspace);
return userDataProfilesService.createNamedProfile(profileName, undefined, workspace);
}
return userDataProfilesService.getProfileForWorkspace(workspace) ?? userDataProfilesService.defaultProfile;
}
Expand Down
Loading

0 comments on commit 34b41e7

Please sign in to comment.