Skip to content

Remove subtree #4136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 0 additions & 3 deletions .github/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
name: "code-server CodeQL config"

paths-ignore:
- lib/vscode
16 changes: 8 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -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::$(cat vendor/modules/code-oss-dev/package.json | jq -r .version)"

- 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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -8,7 +8,8 @@ release-packages/
release-gcp/
release-images/
node_modules
/lib/vscode/node_modules.asar
vendor/modules
/node_modules.asar
node-*
/plugins
/lib/coder-cloud-agent
4 changes: 2 additions & 2 deletions .tours/contributing.tour
Original file line number Diff line number Diff line change
@@ -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."
}
]
}
}
11 changes: 4 additions & 7 deletions ci/build/build-release.sh
Original file line number Diff line number Diff line change
@@ -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() {
@@ -98,10 +99,6 @@ EOF
# yarn to fetch node_modules if necessary without build scripts running.
# We cannot use --no-scripts because we still want dependent package scripts to run.
jq 'del(.scripts)' < "$VSCODE_SRC_PATH/package.json" > "$VSCODE_OUT_PATH/package.json"

pushd "$VSCODE_OUT_PATH"
symlink_asar
popd
}

main "$@"
3 changes: 2 additions & 1 deletion ci/build/build-standalone-release.sh
Original file line number Diff line number Diff line change
@@ -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"
@@ -32,7 +33,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 "$@"
5 changes: 3 additions & 2 deletions ci/build/build-vscode.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions ci/build/clean.sh
Original file line number Diff line number Diff line change
@@ -6,10 +6,6 @@ main() {
source ./ci/lib.sh

git clean -Xffd

pushd lib/vscode
git clean -xffd
popd
}

main "$@"
15 changes: 2 additions & 13 deletions ci/build/npm-postinstall.sh
Original file line number Diff line number Diff line change
@@ -76,21 +76,10 @@ main() {
fi
}

# This is a copy of symlink_asar in ../lib.sh. Look there for details.
symlink_asar() {
rm -rf node_modules.asar
if [ "${WINDIR-}" ]; then
mklink /J node_modules.asar node_modules
else
ln -s node_modules node_modules.asar
fi
}

vscode_yarn() {
cd lib/vscode
yarn --production --frozen-lockfile
cd node_modules

symlink_asar
yarn --production --frozen-lockfile

cd extensions
yarn --production --frozen-lockfile
2 changes: 1 addition & 1 deletion ci/dev/fmt.sh
Original file line number Diff line number Diff line change
@@ -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 "vendor/modules/code-oss-dev" | grep -v 'helm-chart'
)

doctoc --title '# FAQ' docs/FAQ.md > /dev/null
9 changes: 3 additions & 6 deletions ci/dev/lint.sh
Original file line number Diff line number Diff line change
@@ -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")
stylelint $(git ls-files "*.css" | grep -v "vendor/modules")
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")
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"
}

14 changes: 8 additions & 6 deletions ci/dev/postinstall.sh
Original file line number Diff line number Diff line change
@@ -3,17 +3,19 @@ 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
# Ignore scripts to prevent partial install which omits development dependencies.
yarn install --modules-folder modules --ignore-scripts
yarn run postinstall
}

main "$@"
3 changes: 2 additions & 1 deletion ci/dev/test-e2e.sh
Original file line number Diff line number Diff line change
@@ -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
133 changes: 0 additions & 133 deletions ci/dev/update-vscode.sh

This file was deleted.

2 changes: 1 addition & 1 deletion ci/dev/watch.ts
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ async function main(): Promise<void> {

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)
Loading