Skip to content

Commit d823571

Browse files
author
Teffen Ellis
authored
Merge 44a4ae5 into 8e08775
2 parents 8e08775 + 44a4ae5 commit d823571

34 files changed

+1575
-265
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: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -108,42 +108,46 @@ jobs:
108108
with:
109109
node-version: "14"
110110

111-
- name: Fetch dependencies from cache
112-
id: cache-yarn
113-
uses: actions/cache@v2
114-
with:
115-
path: "**/node_modules"
116-
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
117-
restore-keys: |
118-
yarn-build-
111+
# TODO@Teffen investigate why this omits code-oss-dev/node_modules
112+
# - name: Fetch dependencies from cache
113+
# id: cache-yarn
114+
# uses: actions/cache@v2
115+
# with:
116+
# path: |
117+
# "**/node_modules"
118+
# "**/vendor/modules"
119+
# "**/vendor/modules/code-oss-dev/node_modules"
120+
# key: yarn-build-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/vendor/yarn.lock') }}
121+
# restore-keys: |
122+
# yarn-build-
119123

120124
- name: Install dependencies
121-
if: steps.cache-yarn.outputs.cache-hit != 'true'
125+
# if: steps.cache-yarn.outputs.cache-hit != 'true'
122126
run: yarn --frozen-lockfile
123127

124128
- name: Build code-server
125129
run: yarn build
126130

127-
# Parse the hash of the latest commit inside lib/vscode
131+
# Parse the hash of the latest commit inside vendor/modules/code-oss-dev
128132
# use this to avoid rebuilding it if nothing changed
129133
# 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,
134+
# that changed a file inside `vendor/modules/code-oss-dev`. If a commit changes any file in there,
131135
# the hash returned will change, and we rebuild vscode. If the hash did not change,
132136
# (for example, a change to `src/` or `docs/`), we reuse the same build as last time.
133137
# 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
138+
- name: Get latest vendor/modules/code-oss-dev rev
135139
id: vscode-rev
136-
run: echo "::set-output name=rev::$(git log -1 --format='%H' ./lib/vscode)"
140+
run: echo "::set-output name=rev::$(jq -r '.devDependencies["code-oss-dev"]' vendor/package.json | sed -r 's|.*#(.*)$|\1|')"
137141

138142
- name: Attempt to fetch vscode build from cache
139143
id: cache-vscode
140144
uses: actions/cache@v2
141145
with:
142146
path: |
143-
lib/vscode/.build
144-
lib/vscode/out-build
145-
lib/vscode/out-vscode
146-
lib/vscode/out-vscode-min
147+
vendor/modules/code-oss-dev/.build
148+
vendor/modules/code-oss-dev/out-build
149+
vendor/modules/code-oss-dev/out-vscode
150+
vendor/modules/code-oss-dev/out-vscode-min
147151
key: vscode-build-${{ steps.vscode-rev.outputs.rev }}
148152

149153
- 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+
vendor/modules
1212
node-*
1313
/plugins
1414
/lib/coder-cloud-agent

.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": "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
}
150150
]
151-
}
151+
}

ci/build/build-release.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ KEEP_MODULES="${KEEP_MODULES-0}"
1212

1313
main() {
1414
cd "$(dirname "${0}")/../.."
15+
1516
source ./ci/lib.sh
1617

17-
VSCODE_SRC_PATH="lib/vscode"
18-
VSCODE_OUT_PATH="$RELEASE_PATH/lib/vscode"
18+
VSCODE_SRC_PATH="vendor/modules/code-oss-dev"
19+
VSCODE_OUT_PATH="$RELEASE_PATH/vendor/modules/code-oss-dev"
1920

2021
mkdir -p "$RELEASE_PATH"
2122

@@ -24,7 +25,7 @@ main() {
2425

2526
rsync ./docs/README.md "$RELEASE_PATH"
2627
rsync LICENSE.txt "$RELEASE_PATH"
27-
rsync ./lib/vscode/ThirdPartyNotices.txt "$RELEASE_PATH"
28+
rsync ./vendor/modules/code-oss-dev/ThirdPartyNotices.txt "$RELEASE_PATH"
2829
}
2930

3031
bundle_code_server() {

ci/build/build-standalone-release.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export npm_config_build_from_source=true
77

88
main() {
99
cd "$(dirname "${0}")/../.."
10+
1011
source ./ci/lib.sh
1112

1213
rsync "$RELEASE_PATH/" "$RELEASE_PATH-standalone"
@@ -19,6 +20,7 @@ main() {
1920
node_path="$(yarn -s node <<< 'console.info(process.execPath)')"
2021

2122
mkdir -p "$RELEASE_PATH/bin"
23+
mkdir -p "$RELEASE_PATH/lib"
2224
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
2325
rsync "$node_path" "$RELEASE_PATH/lib/node"
2426

@@ -32,7 +34,7 @@ main() {
3234
# leaves a few stray symlinks. Clean them up so nfpm does not fail.
3335
# Remove this line when its no longer needed.
3436

35-
rm -fr "$RELEASE_PATH/lib/vscode/extensions/node_modules/.bin"
37+
rm -fr "$RELEASE_PATH/vendor/modules/code-oss-dev/extensions/node_modules/.bin"
3638
}
3739

3840
main "$@"

ci/build/build-vscode.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
# Builds vscode into lib/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}")/../.."
11-
cd lib/vscode
11+
12+
cd vendor/modules/code-oss-dev
1213

1314
yarn gulp compile-build compile-extensions-build compile-extension-media
1415
yarn gulp optimize --gulpfile ./coder.js

ci/build/clean.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ main() {
66
source ./ci/lib.sh
77

88
git clean -Xffd
9-
10-
pushd lib/vscode
11-
git clean -xffd
12-
popd
139
}
1410

1511
main "$@"

ci/build/npm-postinstall.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,15 @@ symlink_asar() {
8787
}
8888

8989
vscode_yarn() {
90-
cd lib/vscode
90+
echo 'Installing vendor dependencies...'
91+
cd vendor/modules/code-oss-dev
9192
yarn --production --frozen-lockfile
9293

9394
symlink_asar
9495

9596
cd extensions
9697
yarn --production --frozen-lockfile
98+
9799
for ext in */; do
98100
ext="${ext%/}"
99101
echo "extensions/$ext: installing dependencies"

ci/dev/fmt.sh

Lines changed: 2 additions & 1 deletion
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 "lib/vscode" | grep -v "vendor/modules/code-oss-dev" | grep -v 'helm-chart'
2323
)
2424

2525
doctoc --title '# FAQ' docs/FAQ.md > /dev/null
@@ -32,6 +32,7 @@ main() {
3232
doctoc --title '# iPad' docs/ipad.md > /dev/null
3333
doctoc --title '# Termux' docs/termux.md > /dev/null
3434

35+
# TODO: replace with a method that generates fewer false positives.
3536
if [[ ${CI-} && $(git ls-files --other --modified --exclude-standard) ]]; then
3637
echo "Files need generation or are formatted incorrectly:"
3738
git -c color.ui=always status | grep --color=no '\[31m'

0 commit comments

Comments
 (0)