From f885b2967510c45e06a1acb06f5eb86933c75345 Mon Sep 17 00:00:00 2001 From: Teffen Ellis Date: Wed, 8 Sep 2021 15:05:49 -0400 Subject: [PATCH] Add vscode via vendor package. - Use yarn for vscode vendoring. - Grab hash from package. --- .github/codeql-config.yml | 3 - .github/workflows/ci.yaml | 16 +- .gitignore | 2 +- .tours/contributing.tour | 4 +- ci/build/build-release.sh | 7 +- ci/build/build-standalone-release.sh | 4 +- ci/build/build-vscode.sh | 5 +- ci/build/clean.sh | 4 - ci/build/npm-postinstall.sh | 4 +- ci/dev/fmt.sh | 3 +- ci/dev/lint.sh | 9 +- ci/dev/postinstall.sh | 23 +- ci/dev/test-e2e.sh | 3 +- ci/dev/update-vscode.sh | 133 --- ci/dev/watch.ts | 2 +- ci/lib.sh | 2 +- docs/CONTRIBUTING.md | 113 +- docs/termux.md | 2 +- package.json | 4 +- renovate.json | 4 - src/browser/pages/vscode.html | 8 +- src/browser/pages/vscode.ts | 2 +- src/node/entry.ts | 2 +- src/node/main.ts | 2 +- src/node/routes/vscode.ts | 2 +- src/node/vscode.ts | 2 +- test/unit/browser/pages/vscode.test.ts | 2 +- test/unit/node/proxy.test.ts | 4 +- test/utils/helpers.ts | 2 +- vendor/package.json | 12 + vendor/postinstall.sh | 10 + vendor/yarn.lock | 1400 ++++++++++++++++++++++++ 32 files changed, 1544 insertions(+), 251 deletions(-) delete mode 100755 ci/dev/update-vscode.sh create mode 100644 vendor/package.json create mode 100755 vendor/postinstall.sh create mode 100644 vendor/yarn.lock diff --git a/.github/codeql-config.yml b/.github/codeql-config.yml index 690b8e5a..9f98cc2a 100644 --- a/.github/codeql-config.yml +++ b/.github/codeql-config.yml @@ -1,4 +1 @@ name: "code-server CodeQL config" - -paths-ignore: - - lib/vscode diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e08c5eab..ad2dbb0a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -124,26 +124,26 @@ jobs: - name: Build code-server run: yarn build - # Parse the hash of the latest commit inside lib/vscode + # Parse the hash of the latest commit inside vendor/modules/code-oss-dev # use this to avoid rebuilding it if nothing changed # How it works: the `git log` command fetches the hash of the last commit - # that changed a file inside `lib/vscode`. If a commit changes any file in there, + # that changed a file inside `vendor/modules/code-oss-dev`. If a commit changes any file in there, # the hash returned will change, and we rebuild vscode. If the hash did not change, # (for example, a change to `src/` or `docs/`), we reuse the same build as last time. # This saves a lot of time in CI, as compiling VSCode can take anywhere from 5-10 minutes. - - name: Get latest lib/vscode rev + - name: Get latest vendor/modules/code-oss-dev rev id: vscode-rev - run: echo "::set-output name=rev::$(git log -1 --format='%H' ./lib/vscode)" + run: echo "::set-output name=rev::$(jq -r '.devDependencies["code-oss-dev"]' vendor/package.json | sed -r 's|.*#(.*)$|\1|')" - name: Attempt to fetch vscode build from cache id: cache-vscode uses: actions/cache@v2 with: path: | - lib/vscode/.build - lib/vscode/out-build - lib/vscode/out-vscode - lib/vscode/out-vscode-min + vendor/modules/code-oss-dev/.build + vendor/modules/code-oss-dev/out-build + vendor/modules/code-oss-dev/out-vscode + vendor/modules/code-oss-dev/out-vscode-min key: vscode-build-${{ steps.vscode-rev.outputs.rev }} - name: Build vscode diff --git a/.gitignore b/.gitignore index 8ac56410..3cc6e31d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ release-packages/ release-gcp/ release-images/ node_modules -/lib/vscode/node_modules.asar +vendor/modules node-* /plugins /lib/coder-cloud-agent diff --git a/.tours/contributing.tour b/.tours/contributing.tour index 1dd8e6b2..53befe20 100644 --- a/.tours/contributing.tour +++ b/.tours/contributing.tour @@ -143,9 +143,9 @@ "description": "Static images and the manifest live here in `src/browser/media` (see the explorer)." }, { - "directory": "lib/vscode", + "directory": "vendor/modules/code-oss-dev", "line": 1, "description": "code-server makes use of VS Code's frontend web/remote support. Most of the modifications implement the remote server since that portion of the code is closed source and not released with VS Code.\n\nWe also have a few bug fixes and have added some features (like client-side extensions). See [https://github.com/cdr/code-server/blob/master/docs/CONTRIBUTING.md#modifications-to-vs-code](https://github.com/cdr/code-server/blob/master/docs/CONTRIBUTING.md#modifications-to-vs-code) for a list.\n\nWe make an effort to keep the modifications as few as possible." } ] -} \ No newline at end of file +} diff --git a/ci/build/build-release.sh b/ci/build/build-release.sh index 838c6551..c5c28e81 100755 --- a/ci/build/build-release.sh +++ b/ci/build/build-release.sh @@ -12,10 +12,11 @@ KEEP_MODULES="${KEEP_MODULES-0}" main() { cd "$(dirname "${0}")/../.." + source ./ci/lib.sh - VSCODE_SRC_PATH="lib/vscode" - VSCODE_OUT_PATH="$RELEASE_PATH/lib/vscode" + VSCODE_SRC_PATH="vendor/modules/code-oss-dev" + VSCODE_OUT_PATH="$RELEASE_PATH/vendor/modules/code-oss-dev" mkdir -p "$RELEASE_PATH" @@ -24,7 +25,7 @@ main() { rsync ./docs/README.md "$RELEASE_PATH" rsync LICENSE.txt "$RELEASE_PATH" - rsync ./lib/vscode/ThirdPartyNotices.txt "$RELEASE_PATH" + rsync ./vendor/modules/code-oss-dev/ThirdPartyNotices.txt "$RELEASE_PATH" } bundle_code_server() { diff --git a/ci/build/build-standalone-release.sh b/ci/build/build-standalone-release.sh index f12f240d..481110b4 100755 --- a/ci/build/build-standalone-release.sh +++ b/ci/build/build-standalone-release.sh @@ -7,6 +7,7 @@ export npm_config_build_from_source=true main() { cd "$(dirname "${0}")/../.." + source ./ci/lib.sh rsync "$RELEASE_PATH/" "$RELEASE_PATH-standalone" @@ -19,6 +20,7 @@ main() { node_path="$(yarn -s node <<< 'console.info(process.execPath)')" mkdir -p "$RELEASE_PATH/bin" + mkdir -p "$RELEASE_PATH/lib" rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server" rsync "$node_path" "$RELEASE_PATH/lib/node" @@ -32,7 +34,7 @@ main() { # leaves a few stray symlinks. Clean them up so nfpm does not fail. # Remove this line when its no longer needed. - rm -fr "$RELEASE_PATH/lib/vscode/extensions/node_modules/.bin" + rm -fr "$RELEASE_PATH/vendor/modules/code-oss-dev/extensions/node_modules/.bin" } main "$@" diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh index d2f10d2a..ca35d4f3 100755 --- a/ci/build/build-vscode.sh +++ b/ci/build/build-vscode.sh @@ -1,14 +1,15 @@ #!/usr/bin/env bash set -euo pipefail -# Builds vscode into lib/vscode/out-vscode. +# Builds vscode into vendor/modules/code-oss-dev/out-vscode. # MINIFY controls whether a minified version of vscode is built. MINIFY=${MINIFY-true} main() { cd "$(dirname "${0}")/../.." - cd lib/vscode + + cd vendor/modules/code-oss-dev yarn gulp compile-build compile-extensions-build compile-extension-media yarn gulp optimize --gulpfile ./coder.js diff --git a/ci/build/clean.sh b/ci/build/clean.sh index a3180215..9d90836a 100755 --- a/ci/build/clean.sh +++ b/ci/build/clean.sh @@ -6,10 +6,6 @@ main() { source ./ci/lib.sh git clean -Xffd - - pushd lib/vscode - git clean -xffd - popd } main "$@" diff --git a/ci/build/npm-postinstall.sh b/ci/build/npm-postinstall.sh index a1110ccd..76c558d1 100755 --- a/ci/build/npm-postinstall.sh +++ b/ci/build/npm-postinstall.sh @@ -87,13 +87,15 @@ symlink_asar() { } vscode_yarn() { - cd lib/vscode + echo 'Installing vendor dependencies...' + cd vendor/modules/code-oss-dev yarn --production --frozen-lockfile symlink_asar cd extensions yarn --production --frozen-lockfile + for ext in */; do ext="${ext%/}" echo "extensions/$ext: installing dependencies" diff --git a/ci/dev/fmt.sh b/ci/dev/fmt.sh index 3d389aa1..d5d7ffee 100755 --- a/ci/dev/fmt.sh +++ b/ci/dev/fmt.sh @@ -19,7 +19,7 @@ main() { "*.sh" ) prettier --write --loglevel=warn $( - git ls-files "${prettierExts[@]}" | grep -v "lib/vscode" | grep -v 'helm-chart' + git ls-files "${prettierExts[@]}" | grep -v "lib/vscode" | grep -v "vendor/modules/code-oss-dev" | grep -v 'helm-chart' ) doctoc --title '# FAQ' docs/FAQ.md > /dev/null @@ -32,6 +32,7 @@ main() { doctoc --title '# iPad' docs/ipad.md > /dev/null doctoc --title '# Termux' docs/termux.md > /dev/null + # TODO: replace with a method that generates fewer false positives. if [[ ${CI-} && $(git ls-files --other --modified --exclude-standard) ]]; then echo "Files need generation or are formatted incorrectly:" git -c color.ui=always status | grep --color=no '\[31m' diff --git a/ci/dev/lint.sh b/ci/dev/lint.sh index 9ba576e0..34b2e8f7 100755 --- a/ci/dev/lint.sh +++ b/ci/dev/lint.sh @@ -4,17 +4,14 @@ set -euo pipefail main() { cd "$(dirname "$0")/../.." - eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js" | grep -v "lib/vscode") - stylelint $(git ls-files "*.css" | grep -v "lib/vscode") + eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js" | grep -v "vendor/modules/code-oss-dev" | grep -v "lib/vscode") + stylelint $(git ls-files "*.css" | grep -v "vendor/modules/code-oss-dev" | grep -v "lib/vscode") tsc --noEmit --skipLibCheck - shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files "*.sh" | grep -v "lib/vscode") + shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files "*.sh" | grep -v "vendor/modules/code-oss-dev" | grep -v "lib/vscode") if command -v helm && helm kubeval --help > /dev/null; then helm kubeval ci/helm-chart fi - cd lib/vscode - # Run this periodically in vanilla VS code to make sure we don't add any more warnings. - yarn -s eslint --max-warnings=3 cd "$OLDPWD" } diff --git a/ci/dev/postinstall.sh b/ci/dev/postinstall.sh index 0ffa772f..d3b7c255 100755 --- a/ci/dev/postinstall.sh +++ b/ci/dev/postinstall.sh @@ -3,17 +3,28 @@ set -euo pipefail main() { cd "$(dirname "$0")/../.." - source ./ci/lib.sh - # This installs the dependencies needed for testing + echo 'Installing code-server test dependencies...' + cd test - yarn + yarn install cd .. - cd lib/vscode - yarn ${CI+--frozen-lockfile} + cd vendor + echo 'Installing vendor dependencies...' - symlink_asar + # * We install in 'modules' instead of 'node_modules' because VS Code's extensions + # use a webpack config which cannot differentiate between its own node_modules + # and itself being in a directory with the same name. + # + # * We ignore scripts because NPM/Yarn's default behavior is to assume that + # devDependencies are not needed, and that even git repo based packages are + # assumed to be compiled. Because the default behavior for VS Code's `postinstall` + # assumes we're also compiled, this needs to be ignored. + yarn install --modules-folder modules --ignore-scripts --frozen-lockfile + + # Finally, run the vendor `postinstall` + yarn run postinstall } main "$@" diff --git a/ci/dev/test-e2e.sh b/ci/dev/test-e2e.sh index 47c01cda..f42deb83 100755 --- a/ci/dev/test-e2e.sh +++ b/ci/dev/test-e2e.sh @@ -3,6 +3,7 @@ set -euo pipefail main() { cd "$(dirname "$0")/../.." + source ./ci/lib.sh local dir="$PWD" @@ -24,7 +25,7 @@ main() { exit 1 fi - if [[ ! -d $dir/lib/vscode/out ]]; then + if [[ ! -d $dir/vendor/modules/code-oss-dev/out ]]; then echo >&2 "No VS Code build detected" echo >&2 "You can build it with 'yarn build:vscode' or 'yarn watch'" exit 1 diff --git a/ci/dev/update-vscode.sh b/ci/dev/update-vscode.sh deleted file mode 100755 index 84c9e83c..00000000 --- a/ci/dev/update-vscode.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env bash -# Description: This is a script to make the process of updating vscode versions easier -# Run it with `yarn update:vscode` and it will do the following: -# 1. Check that you have a remote called `vscode` -# 2. Ask you which version you want to upgrade to -# 3. Grab the exact version from the package.json i.e. 1.53.2 -# 4. Fetch the vscode remote branches to run the subtree update -# 5. Run the subtree update and pull in the vscode update -# 6. Commit the changes (including merge conflicts) -# 7. Open a draft PR - -set -euo pipefail - -# This function expects two arguments -# 1. the vscode version we're updating to -# 2. the list of merge conflict files -make_pr_body() { - local BODY="This PR updates vscode to $1 - -## TODOS - -- [ ] test editor locally -- [ ] test terminal locally -- [ ] make notes about any significant changes in docs/CONTRIBUTING.md#notes-about-changes - -## Files with conflicts (fix these) -$2" - echo "$BODY" -} - -main() { - cd "$(dirname "$0")/../.." - - # Check if the remote exists - # if it doesn't, we add it - if ! git config remote.vscode.url > /dev/null; then - echo "Could not find 'vscode' as a remote" - echo "Adding with: git remote add vscode https://github.com/microsoft/vscode.git" - git remote add vscode https://github.com/microsoft/vscode.git - fi - - # Ask which version we should update to - # In the future, we'll automate this and grab the latest version automatically - read -r -p "What version of VSCode would you like to update to? (i.e. 1.52) " VSCODE_VERSION_TO_UPDATE - - # Check that this version exists - if [[ -z $(git ls-remote --heads vscode release/"$VSCODE_VERSION_TO_UPDATE") ]]; then - echo "Oops, that doesn't look like a valid version." - echo "You entered: $VSCODE_VERSION_TO_UPDATE" - echo "Verify that this branches exists here: https://github.com/microsoft/vscode/branches/all?query=release%2F$VSCODE_VERSION_TO_UPDATE" - exit 1 - fi - - # Check that they have jq installed - if ! command -v jq &> /dev/null; then - echo "jq could not be found." - echo "We use this when looking up the exact version to update to in the package.json in VS Code." - echo -e "See docs here: https://stedolan.github.io/jq/download/" - exit 1 - fi - - # Note: `git subtree` returns 129 when installed, and prints help; - # but when uninstalled, returns 1. - set +e - git subtree &> /dev/null - if [ $? -ne 129 ]; then - echo "git-subtree could not be found." - echo "We use this to fetch and update the lib/vscode subtree." - echo -e "Please install git subtree." - exit 1 - fi - set -e - - # Grab the exact version from package.json - VSCODE_EXACT_VERSION=$(curl -s "https://raw.githubusercontent.com/microsoft/vscode/release/$VSCODE_VERSION_TO_UPDATE/package.json" | jq -r ".version") - - echo -e "Great! We'll prep a PR for updating to $VSCODE_EXACT_VERSION\n" - - # For some reason the subtree update doesn't work - # unless we fetch all the branches - echo -e "Fetching vscode branches..." - echo -e "Note: this might take a while" - git fetch vscode - - # Check if GitHub CLI is installed - if ! command -v gh &> /dev/null; then - echo "GitHub CLI could not be found." - echo "If you install it before you run this script next time, we'll open a draft PR for you!" - echo -e "See docs here: https://github.com/cli/cli#installation\n" - exit - fi - - # Push branch to remote if not already pushed - # If we don't do this, the opening a draft PR step won't work - # because it will stop and ask where you want to push the branch - CURRENT_BRANCH=$(git branch | grep '\*' | cut -d' ' -f2-) - if [[ -z $(git config "branch.${CURRENT_BRANCH}.remote") ]]; then - echo "Doesn't look like you've pushed this branch to remote" - echo -e "Pushing now using: git push origin $CURRENT_BRANCH\n" - # Note: we need to set upstream as well or the gh pr create step will fail - # See: https://github.com/cli/cli/issues/575 - echo "Please set the upstream and re-run the script" - exit 1 - fi - - echo "Going to try to update vscode for you..." - echo -e "Running: git subtree pull --prefix lib/vscode vscode release/${VSCODE_VERSION_TO_UPDATE} --squash\n" - # Try to run subtree update command - # Note: we add `|| true` because we want the script to keep running even if the squash fails - # We know the squash fails everytime because there will always be merge conflicts - git subtree pull --prefix lib/vscode vscode release/"${VSCODE_VERSION_TO_UPDATE}" --squash || true - - # Get the files with conflicts before we commit them - # so we can list them in the PR body as todo items - CONFLICTS=$(git diff --name-only --diff-filter=U | while read -r line; do echo "- [ ] $line"; done) - PR_BODY=$(make_pr_body "$VSCODE_EXACT_VERSION" "$CONFLICTS") - - echo -e "\nForcing a commit with conflicts" - echo "Note: this is intentional" - echo "If we don't do this, code review is impossible." - echo -e "For more info, see docs: docs/CONTRIBUTING.md#updating-vs-code\n" - # We need --no-verify to skip the husky pre-commit hook - # which fails because of the merge conflicts - git add . && git commit -am "chore(vscode): update to $VSCODE_EXACT_VERSION" --no-verify - - # Note: we can't open a draft PR unless their are changes. - # Hence why we do this after the subtree update. - echo "Opening a draft PR on GitHub" - # To read about these flags, visit the docs: https://cli.github.com/manual/gh_pr_create - gh pr create --base main --title "feat(vscode): update to version $VSCODE_EXACT_VERSION" --body "$PR_BODY" --reviewer @cdr/code-server-reviewers --repo cdr/code-server --draft -} - -main "$@" diff --git a/ci/dev/watch.ts b/ci/dev/watch.ts index 1503256c..a0c116ec 100644 --- a/ci/dev/watch.ts +++ b/ci/dev/watch.ts @@ -16,7 +16,7 @@ async function main(): Promise { class Watcher { private readonly rootPath = path.resolve(__dirname, "../..") - private readonly vscodeSourcePath = path.join(this.rootPath, "lib/vscode") + private readonly vscodeSourcePath = path.join(this.rootPath, "vendor/modules/code-oss-dev") private static log(message: string, skipNewline = false): void { process.stdout.write(message) diff --git a/ci/lib.sh b/ci/lib.sh index c7b5a420..0e357986 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -14,7 +14,7 @@ pkg_json_version() { } vscode_version() { - jq -r .version lib/vscode/package.json + jq -r .version vendor/modules/code-oss-dev/package.json } os() { diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 32c9e777..684bc16f 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -77,23 +77,24 @@ yarn watch ### Updates to VS Code -Updating VS Code requires `git subtree`. On some RPM-based Linux distros, `git subtree` is not included by default and needs to be installed separately. To -install, run `dnf install git-subtree` or `yum install git-subtree`. +1. Update the package tag listed in `vendor/package.json`: -To update VS Code: +```json +{ + "devDependencies": { + "vscode": "cdr/vscode#X.XX.X-code-server" + } +} +``` -1. Run `yarn update:vscode`. -2. Enter a version (e.g., `1.53`) -3. This will open a draft pull request for you. -4. There will be merge conflicts. Commit them first, since it will be impossible - for us to review your PR if you don't. -5. Fix the conflicts. Then, test code-server locally to make sure everything - works. -6. Check the Node.js version that's used by Electron (which is shipped with VS +2. From the code-server **project root**, run `yarn install`. + Then, test code-server locally to make sure everything works. +1. Check the Node.js version that's used by Electron (which is shipped with VS Code. If necessary, update your version of Node.js to match. +1. Open a PR > Watch for updates to -> `lib/vscode/src/vs/code/browser/workbench/workbench.html`. You may need to +> `vendor/modules/code-oss-dev/src/vs/code/browser/workbench/workbench.html`. You may need to > make changes to `src/browser/pages/vscode.html`. ### Build @@ -184,7 +185,7 @@ The CLI code is in [src/node](../src/node) and the HTTP routes are implemented in [src/node/routes](../src/node/routes). Most of the meaty parts are in the VS Code portion of the codebase under -[lib/vscode](../lib/vscode), which we describe next. +[vendor/modules/code-oss-dev](../vendor/modules/code-oss-dev), which we describe next. ### Modifications to VS Code @@ -197,66 +198,66 @@ Over time, Microsoft added support to VS Code to run it on the web. They have made the front-end open source, but not the server. As such, code-server v2 (and later) uses the VS Code front-end and implements the server. We do this by using a Git subtree to fork and modify VS Code. This code lives under -[lib/vscode](../lib/vscode). +[vendor/modules/code-oss-dev](../vendor/modules/code-oss-dev). Some noteworthy changes in our version of VS Code include: -- Adding our build file, [`lib/vscode/coder.js`](../lib/vscode/coder.js), which includes build steps specific to code-server -- Node.js version detection changes in [`build/lib/node.ts`](../lib/vscode/build/lib/node.ts) and [`build/lib/util.ts`](../lib/vscode/build/lib/util.ts) +- Adding our build file, [`vendor/modules/code-oss-dev/coder.js`](../vendor/modules/code-oss-dev/coder.js), which includes build steps specific to code-server +- Node.js version detection changes in [`build/lib/node.ts`](../vendor/modules/code-oss-dev/build/lib/node.ts) and [`build/lib/util.ts`](../vendor/modules/code-oss-dev/build/lib/util.ts) - Allowing extra extension directories - - Added extra arguments to [`src/vs/platform/environment/common/argv.ts`](../lib/vscode/src/vs/platform/environment/common/argv.ts) and to [`src/vs/platform/environment/node/argv.ts`](../lib/vscode/src/vs/platform/environment/node/argv.ts) - - Added extra environment state to [`src/vs/platform/environment/common/environment.ts`](../lib/vscode/src/vs/platform/environment/common/environment.ts); - - Added extra getters to [`src/vs/platform/environment/common/environmentService.ts`](../lib/vscode/src/vs/platform/environment/common/environmentService.ts) - - Added extra scanning paths to [`src/vs/platform/extensionManagement/node/extensionsScanner.ts`](../lib/vscode/src/vs/platform/extensionManagement/node/extensionsScanner.ts) -- Additions/removals from [`package.json`](../lib/vscode/package.json): + - Added extra arguments to [`src/vs/platform/environment/common/argv.ts`](../vendor/modules/code-oss-dev/src/vs/platform/environment/common/argv.ts) and to [`src/vs/platform/environment/node/argv.ts`](../vendor/modules/code-oss-dev/src/vs/platform/environment/node/argv.ts) + - Added extra environment state to [`src/vs/platform/environment/common/environment.ts`](../vendor/modules/code-oss-dev/src/vs/platform/environment/common/environment.ts); + - Added extra getters to [`src/vs/platform/environment/common/environmentService.ts`](../vendor/modules/code-oss-dev/src/vs/platform/environment/common/environmentService.ts) + - Added extra scanning paths to [`src/vs/platform/extensionManagement/node/extensionsScanner.ts`](../vendor/modules/code-oss-dev/src/vs/platform/extensionManagement/node/extensionsScanner.ts) +- Additions/removals from [`package.json`](../vendor/modules/code-oss-dev/package.json): - Removing `electron`, `keytar` and `native-keymap` to avoid pulling in desktop dependencies during build on Linux - Removing `gulp-azure-storage` and `gulp-tar` (unsued in our build process, may pull in outdated dependencies) - Adding `proxy-agent`, `proxy-from-env` (for proxying) and `rimraf` (used during build/install steps) - Adding our branding/custom URLs/version: - - [`product.json`](../lib/vscode/product.json) - - [`src/vs/base/common/product.ts`](../lib/vscode/src/vs/base/common/product.ts) - - [`src/vs/workbench/browser/parts/dialogs/dialogHandler.ts`](../lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts) - - [`src/vs/workbench/contrib/welcome/page/browser/vs_code_welcome_page.ts`](../lib/vscode/src/vs/workbench/contrib/welcome/page/browser/vs_code_welcome_page.ts) - - [`src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts`](../lib/vscode/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts) -- Removing azure/macOS signing related dependencies from [`build/package.json`](../lib/vscode/build/package.json) + - [`product.json`](../vendor/modules/code-oss-dev/product.json) + - [`src/vs/base/common/product.ts`](../vendor/modules/code-oss-dev/src/vs/base/common/product.ts) + - [`src/vs/workbench/browser/parts/dialogs/dialogHandler.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts) + - [`src/vs/workbench/contrib/welcome/page/browser/vs_code_welcome_page.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/contrib/welcome/page/browser/vs_code_welcome_page.ts) + - [`src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts) +- Removing azure/macOS signing related dependencies from [`build/package.json`](../vendor/modules/code-oss-dev/build/package.json) - Modifying `.gitignore` to allow us to add files to `src/vs/server` and modifying `.eslintignore` to ignore lint on the shared files below (we use different formatter settings than VS Code). - Sharing some files with our codebase via symlinks: - - [`src/vs/base/common/ipc.d.ts`](../lib/vscode/src/vs/base/common/ipc.d.ts) points to [`typings/ipc.d.ts`](../typings/ipc.d.ts) - - [`src/vs/base/common/util.ts`](../lib/vscode/src/vs/base/common/util.ts) points to [`src/common/util.ts`](../src/common/util.ts) - - [`src/vs/base/node/proxy_agent.ts`](../lib/vscode/src/vs/base/node/proxy_agent.ts) points to [`src/node/proxy_agent.ts`](../src/node/proxy_agent.ts) -- Allowing socket changes by adding `setSocket` in [`src/vs/base/parts/ipc/common/ipc.net.ts`](../lib/vscode/src/vs/base/parts/ipc/common/ipc.net.ts) + - [`src/vs/base/common/ipc.d.ts`](../vendor/modules/code-oss-dev/src/vs/base/common/ipc.d.ts) points to [`typings/ipc.d.ts`](../typings/ipc.d.ts) + - [`src/vs/base/common/util.ts`](../vendor/modules/code-oss-dev/src/vs/base/common/util.ts) points to [`src/common/util.ts`](../src/common/util.ts) + - [`src/vs/base/node/proxy_agent.ts`](../vendor/modules/code-oss-dev/src/vs/base/node/proxy_agent.ts) points to [`src/node/proxy_agent.ts`](../src/node/proxy_agent.ts) +- Allowing socket changes by adding `setSocket` in [`src/vs/base/parts/ipc/common/ipc.net.ts`](../vendor/modules/code-oss-dev/src/vs/base/parts/ipc/common/ipc.net.ts) - We use this for connection persistence in our server-side code. - Added our server-side Node.JS code to `src/vs/server`. - This code includes the logic to spawn the various services (extension host, terminal, etc.) and some glue -- Added [`src/vs/workbench/browser/client.ts`](../lib/vscode/src/vs/workbench/browser/client.ts) to hold some server customizations. +- Added [`src/vs/workbench/browser/client.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/browser/client.ts) to hold some server customizations. - Includes the functionality for the Log Out command and menu item - - Also, imported and called `initialize` from the main web file, [`src/vs/workbench/browser/web.main.ts`](../lib/vscode/src/vs/workbench/browser/web.main.ts) -- Added a (hopefully temporary) hotfix to [`src/vs/workbench/common/resources.ts`](../lib/vscode/src/vs/workbench/common/resources.ts) to get context menu actions working for the Git integration. -- Added connection type to WebSocket query parameters in [`src/vs/platform/remote/common/remoteAgentConnection.ts`](../lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts) -- Added `CODE_SERVER*` variables to the sanitization list in [`src/vs/base/common/processes.ts`](../lib/vscode/src/vs/base/common/processes.ts) + - Also, imported and called `initialize` from the main web file, [`src/vs/workbench/browser/web.main.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/browser/web.main.ts) +- Added a (hopefully temporary) hotfix to [`src/vs/workbench/common/resources.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/common/resources.ts) to get context menu actions working for the Git integration. +- Added connection type to WebSocket query parameters in [`src/vs/platform/remote/common/remoteAgentConnection.ts`](../vendor/modules/code-oss-dev/src/vs/platform/remote/common/remoteAgentConnection.ts) +- Added `CODE_SERVER*` variables to the sanitization list in [`src/vs/base/common/processes.ts`](../vendor/modules/code-oss-dev/src/vs/base/common/processes.ts) - Fix localization support: - - Added file [`src/vs/workbench/services/localizations/browser/localizationsService.ts`](../lib/vscode/src/vs/workbench/services/localizations/browser/localizationsService.ts). - - Modified file [`src/vs/base/common/platform.ts`](../lib/vscode/src/vs/base/common/platform.ts) - - Modified file [`src/vs/base/node/languagePacks.js`](../lib/vscode/src/vs/base/node/languagePacks.js) -- Added code to allow server to inject settings to [`src/vs/platform/product/common/product.ts`](../lib/vscode/src/vs/platform/product/common/product.ts) + - Added file [`src/vs/workbench/services/localizations/browser/localizationsService.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/services/localizations/browser/localizationsService.ts). + - Modified file [`src/vs/base/common/platform.ts`](../vendor/modules/code-oss-dev/src/vs/base/common/platform.ts) + - Modified file [`src/vs/base/node/languagePacks.js`](../vendor/modules/code-oss-dev/src/vs/base/node/languagePacks.js) +- Added code to allow server to inject settings to [`src/vs/platform/product/common/product.ts`](../vendor/modules/code-oss-dev/src/vs/platform/product/common/product.ts) - Extension fixes: - - Avoid disabling extensions by extensionKind in [`src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts`](../lib/vscode/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts) (Needed for vscode-icons) - - Remove broken symlinks in [`extensions/postinstall.js`](../lib/vscode/extensions/postinstall.js) - - Add tip about extension gallery in [`src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts`](../lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts) - - Use our own server for GitHub authentication in [`extensions/github-authentication/src/githubServer.ts`](../lib/vscode/extensions/github-authentication/src/githubServer.ts) - - Settings persistence on the server in [`src/vs/workbench/services/environment/browser/environmentService.ts`](../lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts) - - Add extension install fallback in [`src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts`](../lib/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts) - - Add proxy-agent monkeypatch and keep extension host indefinitely running in [`src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts`](../lib/vscode/src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts) - - Patch build system to avoid removing extension dependencies for `yarn global add` users in [`build/lib/extensions.ts`](../lib/vscode/build/lib/extensions.ts) - - Allow all extensions to use proposed APIs in [`src/vs/workbench/services/environment/browser/environmentService.ts`](../lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts) - - Make storage writes async to allow extensions to wait for them to complete in [`src/vs/platform/storage/common/storage.ts`](../lib/vscode/src/vs/platform/storage/common/storage.ts) -- Specify webview path in [`src/vs/code/browser/workbench/workbench.ts`](../lib/vscode/src/vs/code/browser/workbench/workbench.ts) -- URL readability improvements for folder/workspace in [`src/vs/code/browser/workbench/workbench.ts`](../lib/vscode/src/vs/code/browser/workbench/workbench.ts) + - Avoid disabling extensions by extensionKind in [`src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts) (Needed for vscode-icons) + - Remove broken symlinks in [`extensions/postinstall.js`](../vendor/modules/code-oss-dev/extensions/postinstall.js) + - Add tip about extension gallery in [`src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts) + - Use our own server for GitHub authentication in [`extensions/github-authentication/src/githubServer.ts`](../vendor/modules/code-oss-dev/extensions/github-authentication/src/githubServer.ts) + - Settings persistence on the server in [`src/vs/workbench/services/environment/browser/environmentService.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/services/environment/browser/environmentService.ts) + - Add extension install fallback in [`src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts) + - Add proxy-agent monkeypatch and keep extension host indefinitely running in [`src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts) + - Patch build system to avoid removing extension dependencies for `yarn global add` users in [`build/lib/extensions.ts`](../vendor/modules/code-oss-dev/build/lib/extensions.ts) + - Allow all extensions to use proposed APIs in [`src/vs/workbench/services/environment/browser/environmentService.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/services/environment/browser/environmentService.ts) + - Make storage writes async to allow extensions to wait for them to complete in [`src/vs/platform/storage/common/storage.ts`](../vendor/modules/code-oss-dev/src/vs/platform/storage/common/storage.ts) +- Specify webview path in [`src/vs/code/browser/workbench/workbench.ts`](../vendor/modules/code-oss-dev/src/vs/code/browser/workbench/workbench.ts) +- URL readability improvements for folder/workspace in [`src/vs/code/browser/workbench/workbench.ts`](../vendor/modules/code-oss-dev/src/vs/code/browser/workbench/workbench.ts) - Socket/Authority-related fixes (for remote proxying etc.): - - [`src/vs/code/browser/workbench/workbench.ts`](../lib/vscode/src/vs/code/browser/workbench/workbench.ts) - - [`src/vs/platform/remote/browser/browserSocketFactory.ts`](../lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts) - - [`src/vs/base/common/network.ts`](../lib/vscode/src/vs/base/common/network.ts) -- Added code to write out IPC path in [`src/vs/workbench/api/node/extHostCLIServer.ts`](../lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts) + - [`src/vs/code/browser/workbench/workbench.ts`](../vendor/modules/code-oss-dev/src/vs/code/browser/workbench/workbench.ts) + - [`src/vs/platform/remote/browser/browserSocketFactory.ts`](../vendor/modules/code-oss-dev/src/vs/platform/remote/browser/browserSocketFactory.ts) + - [`src/vs/base/common/network.ts`](../vendor/modules/code-oss-dev/src/vs/base/common/network.ts) +- Added code to write out IPC path in [`src/vs/workbench/api/node/extHostCLIServer.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/api/node/extHostCLIServer.ts) As the web portion of VS Code matures, we'll be able to shrink and possibly eliminate our modifications. In the meantime, upgrading the VS Code version requires diff --git a/docs/termux.md b/docs/termux.md index db350cd9..454b585e 100644 --- a/docs/termux.md +++ b/docs/termux.md @@ -45,7 +45,7 @@ There is a known issue with search not working on Android because it's missing ```sh # run this command inside the code-server directory - ln -s $PREFIX/bin/rg ./lib/vscode/node_modules/vscode-ripgrep/bin/rg + ln -s $PREFIX/bin/rg ./vendor/modules/code-oss-dev/vscode-ripgrep/bin/rg ``` ### Backspace doesn't work diff --git a/package.json b/package.json index 6c70ada9..97beec9f 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,6 @@ "test:scripts": "./ci/dev/test-scripts.sh", "package": "./ci/build/build-packages.sh", "postinstall": "./ci/dev/postinstall.sh", - "update:vscode": "./ci/dev/update-vscode.sh", - "_____": "", "_audit": "./ci/dev/audit.sh", "fmt": "./ci/dev/fmt.sh", "lint": "./ci/dev/lint.sh", @@ -130,6 +128,7 @@ "testEnvironment": "node", "testPathIgnorePatterns": [ "/node_modules/", + "/vendor/", "/lib/", "/out/", "test/e2e" @@ -154,7 +153,6 @@ } }, "modulePathIgnorePatterns": [ - "/lib/vscode", "/release-packages", "/release", "/release-standalone", diff --git a/renovate.json b/renovate.json index 6572813a..f3a95642 100644 --- a/renovate.json +++ b/renovate.json @@ -6,10 +6,6 @@ "matchUpdateTypes": ["minor", "patch", "digest"], "automerge": true, "groupName": "Minor dependency updates" - }, - { - "matchPaths": ["lib/vscode/"], - "enabled": false } ], "vulnerabilityAlerts": { diff --git a/src/browser/pages/vscode.html b/src/browser/pages/vscode.html index aaae0f69..a01223ce 100644 --- a/src/browser/pages/vscode.html +++ b/src/browser/pages/vscode.html @@ -27,7 +27,7 @@ @@ -40,13 +40,13 @@ - +