Skip to content

Commit 1e05632

Browse files
committed
Migrate to node module approach.
1 parent 3a30f05 commit 1e05632

28 files changed

+791
-135
lines changed

.github/codeql-config.yml

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
name: "code-server CodeQL config"
2-
3-
paths-ignore:
4-
- lib/vscode

.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 lib/vscode
127+
# Parse the hash of the latest commit inside node_modules/vscode
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 `lib/vscode`. If a commit changes any file in there,
130+
# that changed a file inside `node_modules/vscode`. 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 lib/vscode rev
134+
- name: Get latest node_modules/vscode rev
135135
id: vscode-rev
136-
run: echo "::set-output name=rev::$(git log -1 --format='%H' ./lib/vscode)"
136+
run: echo "::set-output name=rev::$(cat node_modules/vscode/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-
lib/vscode/.build
144-
lib/vscode/out-build
145-
lib/vscode/out-vscode
146-
lib/vscode/out-vscode-min
143+
node_modules/vscode/.build
144+
node_modules/vscode/out-build
145+
node_modules/vscode/out-vscode
146+
node_modules/vscode/out-vscode-min
147147
key: vscode-build-${{ steps.vscode-rev.outputs.rev }}
148148

149149
- name: Build vscode

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ release-packages/
88
release-gcp/
99
release-images/
1010
node_modules
11-
/lib/vscode/node_modules.asar
11+
/node_modules.asar
1212
node-*
1313
/plugins
1414
/lib/coder-cloud-agent

.gitmodules

-5
This file was deleted.

.tours/contributing.tour

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@
143143
"description": "Static images and the manifest live here in `src/browser/media` (see the explorer)."
144144
},
145145
{
146-
"directory": "lib/vscode",
146+
"directory": "node_modules/vscode",
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
}
150150
]
151-
}
151+
}

ci/build/build-release.sh

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ KEEP_MODULES="${KEEP_MODULES-0}"
1212

1313
main() {
1414
cd "$(dirname "${0}")/../.."
15-
git submodule update --init
1615

1716
source ./ci/lib.sh
1817

19-
VSCODE_SRC_PATH="lib/vscode"
20-
VSCODE_OUT_PATH="$RELEASE_PATH/lib/vscode"
18+
VSCODE_SRC_PATH="node_modules/vscode"
19+
VSCODE_OUT_PATH="$RELEASE_PATH/node_modules/vscode"
2120

2221
mkdir -p "$RELEASE_PATH"
2322

@@ -26,7 +25,7 @@ main() {
2625

2726
rsync ./docs/README.md "$RELEASE_PATH"
2827
rsync LICENSE.txt "$RELEASE_PATH"
29-
rsync ./lib/vscode/ThirdPartyNotices.txt "$RELEASE_PATH"
28+
rsync ./node_modules/vscode/ThirdPartyNotices.txt "$RELEASE_PATH"
3029
}
3130

3231
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/lib/vscode/extensions/node_modules/.bin"
36+
rm -fr "$RELEASE_PATH/node_modules/vscode/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 lib/vscode/out-vscode.
4+
# Builds vscode into node_modules/vscode/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 lib/vscode
12+
cd node_modules/vscode
1313

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

ci/build/clean.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ main() {
77

88
git clean -Xffd
99

10-
pushd lib/vscode
10+
pushd node_modules/vscode
1111
git clean -xffd
1212
popd
1313
}

ci/build/npm-postinstall.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ symlink_asar() {
8787
}
8888

8989
vscode_yarn() {
90-
cd lib/vscode
90+
cd node_modules
9191

9292
yarn --production --frozen-lockfile
9393

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 "lib/vscode" | grep -v 'helm-chart'
22+
git ls-files "${prettierExts[@]}" | grep -v "node_modules/vscode" | grep -v 'helm-chart'
2323
)
2424

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

ci/dev/lint.sh

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

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

15-
cd lib/vscode
15+
cd node_modules/vscode
1616
# Run this periodically in vanilla VS code to make sure we don't add any more warnings.
1717
yarn -s eslint --max-warnings=3
1818
cd "$OLDPWD"

ci/dev/postinstall.sh

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

7-
if [ -z "$(ls -A lib/vscode)" ]; then
8-
git submodule init
9-
else
10-
git submodule update
11-
fi
12-
137
source ./ci/lib.sh
148

15-
# This installs the dependencies needed for testing
9+
echo 'Installing code-server test dependencies...'
10+
1611
cd test
17-
yarn
12+
yarn install
1813
cd ..
1914

20-
cd lib/vscode
21-
yarn ${CI+--frozen-lockfile}
15+
echo 'Installing VS Code dependencies...'
16+
17+
cd node_modules/vscode
18+
# Freeze when in CI
19+
yarn install --frozen-lockfile
2220

2321
symlink_asar
2422
}

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/lib/vscode/out ]]; then
28+
if [[ ! -d $dir/node_modules/vscode/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, "lib/vscode")
19+
private readonly vscodeSourcePath = path.join(this.rootPath, "node_modules/vscode")
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 lib/vscode/package.json
17+
jq -r .version node_modules/vscode/package.json
1818
}
1919

2020
os() {

0 commit comments

Comments
 (0)