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

Lines changed: 0 additions & 3 deletions
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

Lines changed: 8 additions & 8 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 5 deletions
This file was deleted.

.tours/contributing.tour

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)