Skip to content

Commit f457327

Browse files
committed
Use yarn for vscode vendoring.
1 parent 8ccf9a0 commit f457327

28 files changed

+1536
-778
lines changed

.github/workflows/ci.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -124,26 +124,26 @@ jobs:
124124
- name: Build code-server
125125
run: yarn build
126126

127-
# Parse the hash of the latest commit inside node_modules/vscode
127+
# Parse the hash of the latest commit inside vendor/modules/code-oss-dev
128128
# use this to avoid rebuilding it if nothing changed
129129
# How it works: the `git log` command fetches the hash of the last commit
130-
# that changed a file inside `node_modules/vscode`. If a commit changes any file in there,
130+
# that changed a file inside `vendor/modules/code-oss-dev`. If a commit changes any file in there,
131131
# the hash returned will change, and we rebuild vscode. If the hash did not change,
132132
# (for example, a change to `src/` or `docs/`), we reuse the same build as last time.
133133
# This saves a lot of time in CI, as compiling VSCode can take anywhere from 5-10 minutes.
134-
- name: Get latest node_modules/vscode rev
134+
- name: Get latest vendor/modules/code-oss-dev rev
135135
id: vscode-rev
136-
run: echo "::set-output name=rev::$(cat node_modules/vscode/package.json | jq -r .version)"
136+
run: echo "::set-output name=rev::$(cat vendor/modules/code-oss-dev/package.json | jq -r .version)"
137137

138138
- name: Attempt to fetch vscode build from cache
139139
id: cache-vscode
140140
uses: actions/cache@v2
141141
with:
142142
path: |
143-
node_modules/vscode/.build
144-
node_modules/vscode/out-build
145-
node_modules/vscode/out-vscode
146-
node_modules/vscode/out-vscode-min
143+
vendor/modules/code-oss-dev/.build
144+
vendor/modules/code-oss-dev/out-build
145+
vendor/modules/code-oss-dev/out-vscode
146+
vendor/modules/code-oss-dev/out-vscode-min
147147
key: vscode-build-${{ steps.vscode-rev.outputs.rev }}
148148

149149
- name: Build vscode

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ release-packages/
88
release-gcp/
99
release-images/
1010
node_modules
11+
vendor/modules
1112
/node_modules.asar
1213
node-*
1314
/plugins

.tours/contributing.tour

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
"description": "Static images and the manifest live here in `src/browser/media` (see the explorer)."
144144
},
145145
{
146-
"directory": "node_modules/vscode",
146+
"directory": "vendor/modules/code-oss-dev",
147147
"line": 1,
148148
"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."
149149
}

ci/build/build-release.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ main() {
1515

1616
source ./ci/lib.sh
1717

18-
VSCODE_SRC_PATH="node_modules/vscode"
19-
VSCODE_OUT_PATH="$RELEASE_PATH/node_modules/vscode"
18+
VSCODE_SRC_PATH="vendor/modules/code-oss-dev"
19+
VSCODE_OUT_PATH="$RELEASE_PATH/vendor/modules/code-oss-dev"
2020

2121
mkdir -p "$RELEASE_PATH"
2222

@@ -25,7 +25,7 @@ main() {
2525

2626
rsync ./docs/README.md "$RELEASE_PATH"
2727
rsync LICENSE.txt "$RELEASE_PATH"
28-
rsync ./node_modules/vscode/ThirdPartyNotices.txt "$RELEASE_PATH"
28+
rsync ./vendor/modules/code-oss-dev/ThirdPartyNotices.txt "$RELEASE_PATH"
2929
}
3030

3131
bundle_code_server() {

ci/build/build-standalone-release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ main() {
3333
# leaves a few stray symlinks. Clean them up so nfpm does not fail.
3434
# Remove this line when its no longer needed.
3535

36-
rm -fr "$RELEASE_PATH/node_modules/vscode/extensions/node_modules/.bin"
36+
rm -fr "$RELEASE_PATH/vendor/modules/code-oss-dev/extensions/node_modules/.bin"
3737
}
3838

3939
main "$@"

ci/build/build-vscode.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
# Builds vscode into node_modules/vscode/out-vscode.
4+
# Builds vscode into vendor/modules/code-oss-dev/out-vscode.
55

66
# MINIFY controls whether a minified version of vscode is built.
77
MINIFY=${MINIFY-true}
88

99
main() {
1010
cd "$(dirname "${0}")/../.."
1111

12-
cd node_modules/vscode
12+
cd vendor/modules/code-oss-dev
1313

1414
yarn gulp compile-build compile-extensions-build compile-extension-media
1515
yarn gulp optimize --gulpfile ./coder.js

ci/dev/fmt.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ main() {
1919
"*.sh"
2020
)
2121
prettier --write --loglevel=warn $(
22-
git ls-files "${prettierExts[@]}" | grep -v "node_modules/vscode" | grep -v 'helm-chart'
22+
git ls-files "${prettierExts[@]}" | grep -v "vendor/modules/code-oss-dev" | grep -v 'helm-chart'
2323
)
2424

2525
doctoc --title '# FAQ' docs/FAQ.md > /dev/null

ci/dev/lint.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ set -euo pipefail
44
main() {
55
cd "$(dirname "$0")/../.."
66

7-
eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js" | grep -v "node_modules/vscode")
8-
stylelint $(git ls-files "*.css" | grep -v "node_modules/vscode")
7+
eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js" | grep -v "vendor/modules")
8+
stylelint $(git ls-files "*.css" | grep -v "vendor/modules")
99
tsc --noEmit --skipLibCheck
10-
shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files "*.sh" | grep -v "node_modules/vscode")
10+
shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files "*.sh" | grep -v "vendor/modules")
1111
if command -v helm && helm kubeval --help > /dev/null; then
1212
helm kubeval ci/helm-chart
1313
fi

ci/dev/postinstall.sh

+5-6
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@ set -euo pipefail
44
main() {
55
cd "$(dirname "$0")/../.."
66

7-
source ./ci/lib.sh
8-
97
echo 'Installing code-server test dependencies...'
108

119
cd test
1210
yarn install
1311
cd ..
1412

15-
echo 'Installing VS Code dependencies...'
13+
cd vendor
14+
echo 'Installing vendor dependencies...'
1615

17-
cd node_modules/vscode
18-
# Freeze when in CI
19-
yarn install --frozen-lockfile
16+
# Ignore scripts to prevent partial install which omits development dependencies.
17+
yarn install --modules-folder modules --ignore-scripts
18+
yarn run postinstall
2019
}
2120

2221
main "$@"

ci/dev/test-e2e.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ main() {
2525
exit 1
2626
fi
2727

28-
if [[ ! -d $dir/node_modules/vscode/out ]]; then
28+
if [[ ! -d $dir/vendor/modules/code-oss-dev/out ]]; then
2929
echo >&2 "No VS Code build detected"
3030
echo >&2 "You can build it with 'yarn build:vscode' or 'yarn watch'"
3131
exit 1

ci/dev/watch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ async function main(): Promise<void> {
1616

1717
class Watcher {
1818
private readonly rootPath = path.resolve(__dirname, "../..")
19-
private readonly vscodeSourcePath = path.join(this.rootPath, "node_modules/vscode")
19+
private readonly vscodeSourcePath = path.join(this.rootPath, "vendor/modules/code-oss-dev")
2020

2121
private static log(message: string, skipNewline = false): void {
2222
process.stdout.write(message)

ci/lib.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pkg_json_version() {
1414
}
1515

1616
vscode_version() {
17-
jq -r .version node_modules/vscode/package.json
17+
jq -r .version vendor/modules/code-oss-dev/package.json
1818
}
1919

2020
os() {

0 commit comments

Comments
 (0)