Skip to content

Commit d7cba30

Browse files
Merge branch 'master' into feature/helm3
2 parents 30fafc8 + ec56409 commit d7cba30

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1057
-488
lines changed

.eslintrc.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ rules:
3030
eqeqeq: error
3131
import/order:
3232
[error, { alphabetize: { order: "asc" }, groups: [["builtin", "external", "internal"], "parent", "sibling"] }]
33+
no-async-promise-executor: off
3334

3435
settings:
3536
# Does not work with CommonJS unfortunately.

.github/ISSUE_TEMPLATE/doc.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: Documentation improvement
3+
about: Suggest a documentation improvement
4+
title: ""
5+
labels: "docs"
6+
assignees: ""
7+
---

.github/workflows/ci.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
steps:
99
- uses: actions/checkout@v1
1010
- name: Run ./ci/steps/fmt.sh
11-
uses: ./ci/images/debian8
11+
uses: ./ci/images/debian10
1212
with:
1313
args: ./ci/steps/fmt.sh
1414

@@ -17,7 +17,7 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v1
1919
- name: Run ./ci/steps/lint.sh
20-
uses: ./ci/images/debian8
20+
uses: ./ci/images/debian10
2121
with:
2222
args: ./ci/steps/lint.sh
2323

@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727
- uses: actions/checkout@v1
2828
- name: Run ./ci/steps/test.sh
29-
uses: ./ci/images/debian8
29+
uses: ./ci/images/debian10
3030
with:
3131
args: ./ci/steps/test.sh
3232

@@ -35,7 +35,7 @@ jobs:
3535
steps:
3636
- uses: actions/checkout@v1
3737
- name: Run ./ci/steps/release.sh
38-
uses: ./ci/images/debian8
38+
uses: ./ci/images/debian10
3939
with:
4040
args: ./ci/steps/release.sh
4141
- name: Upload npm package artifact
@@ -116,7 +116,7 @@ jobs:
116116
name: release-packages
117117
path: ./release-packages
118118
- name: Run ./ci/steps/build-docker-image.sh
119-
uses: ./ci/images/debian8
119+
uses: ./ci/images/debian10
120120
with:
121121
args: ./ci/steps/build-docker-image.sh
122122
- name: Upload release image

.github/workflows/publish.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v1
1212
- name: Run ./ci/steps/publish-npm.sh
13-
uses: ./ci/images/debian8
13+
uses: ./ci/images/debian10
1414
with:
1515
args: ./ci/steps/publish-npm.sh
1616
env:
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v1
2424
- name: Run ./ci/steps/push-docker-manifest.sh
25-
uses: ./ci/images/debian8
25+
uses: ./ci/images/debian10
2626
with:
2727
args: ./ci/steps/push-docker-manifest.sh
2828
env:

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ release-images/
1111
node_modules
1212
node-*
1313
/plugins
14+
/lib/coder-cloud-agent
15+
.home

.gitmodules

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[submodule "lib/vscode"]
22
path = lib/vscode
33
url = https://github.com/microsoft/vscode
4+
ignore = dirty

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# code-server
1+
# code-server · [!["GitHub Discussions"](https://img.shields.io/badge/%20GitHub-%20Discussions-gray.svg?longCache=true&logo=github&colorB=purple)](https://github.com/cdr/code-server/discussions) [!["Join us on Slack"](https://img.shields.io/badge/join-us%20on%20slack-gray.svg?longCache=true&logo=slack&colorB=brightgreen)](https://cdr.co/join-community) [![Twitter Follow](https://img.shields.io/twitter/follow/CoderHQ?label=%40CoderHQ&style=social)](https://twitter.com/coderhq)
22

33
Run [VS Code](https://github.com/Microsoft/vscode) on any machine anywhere and access it in the browser.
44

@@ -11,7 +11,7 @@ Run [VS Code](https://github.com/Microsoft/vscode) on any machine anywhere and a
1111
- Develop on a Linux machine and pick up from any device with a web browser.
1212
- **Server-powered**
1313
- Take advantage of large cloud servers to speed up tests, compilations, downloads, and more.
14-
- Preserve battery life when you're on the go as all intensive tasks runs on your server.
14+
- Preserve battery life when you're on the go as all intensive tasks run on your server.
1515
- Make use of a spare computer you have lying around and turn it into a full development environment.
1616

1717
## Getting Started
@@ -52,7 +52,7 @@ See [./doc/CONTRIBUTING.md](./doc/CONTRIBUTING.md).
5252

5353
## Hiring
5454

55-
We ([@cdr](https://github.com/cdr)) are looking for a engineers to help maintain
55+
We ([@cdr](https://github.com/cdr)) are looking for engineers to help maintain
5656
code-server, innovate on open source and streamline dev workflows.
5757

5858
Our main office is in Austin, Texas. Remote is ok as long as

ci/build/build-code-server.sh

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ main() {
1818
chmod +x out/node/entry.js
1919
fi
2020

21+
if ! [ -f ./lib/coder-cloud-agent ]; then
22+
OS="$(uname | tr '[:upper:]' '[:lower:]')"
23+
curl -fsSL "https://storage.googleapis.com/coder-cloud-releases/agent/latest/$OS/cloud-agent" -o ./lib/coder-cloud-agent
24+
chmod +x ./lib/coder-cloud-agent
25+
fi
26+
2127
parcel build \
2228
--public-url "." \
2329
--out-dir dist \

ci/build/build-packages.sh

-15
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@ main() {
1111
mkdir -p release-packages
1212

1313
release_archive
14-
# Will stop the auto update issues and allow people to upgrade their scripts
15-
# for the new release structure.
16-
if [[ $ARCH == "amd64" ]]; then
17-
if [[ $OS == "linux" ]]; then
18-
ARCH=x86_64 release_archive
19-
elif [[ $OS == "macos" ]]; then
20-
OS=darwin ARCH=x86_64 release_archive
21-
fi
22-
fi
2314

2415
if [[ $OS == "linux" ]]; then
2516
release_nfpm
@@ -30,12 +21,6 @@ release_archive() {
3021
local release_name="code-server-$VERSION-$OS-$ARCH"
3122
if [[ $OS == "linux" ]]; then
3223
tar -czf "release-packages/$release_name.tar.gz" --transform "s/^\.\/release-standalone/$release_name/" ./release-standalone
33-
elif [[ $OS == "darwin" && $ARCH == "x86_64" ]]; then
34-
# Just exists to make autoupdating from 3.2.0 work again.
35-
mv ./release-standalone "./$release_name"
36-
zip -r "release-packages/$release_name.zip" "./$release_name"
37-
mv "./$release_name" ./release-standalone
38-
return
3924
else
4025
tar -czf "release-packages/$release_name.tar.gz" -s "/^release-standalone/$release_name/" release-standalone
4126
fi

ci/build/build-release.sh

+16-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ set -euo pipefail
66
# MINIFY controls whether minified vscode is bundled.
77
MINIFY="${MINIFY-true}"
88

9+
# KEEP_MODULES controls whether the script cleans all node_modules requiring a yarn install
10+
# to run first.
11+
KEEP_MODULES="${KEEP_MODULES-0}"
12+
913
main() {
1014
cd "$(dirname "${0}")/../.."
1115
source ./ci/lib.sh
@@ -37,6 +41,7 @@ bundle_code_server() {
3741
rsync src/browser/media/ "$RELEASE_PATH/src/browser/media"
3842
mkdir -p "$RELEASE_PATH/src/browser/pages"
3943
rsync src/browser/pages/*.html "$RELEASE_PATH/src/browser/pages"
44+
rsync src/browser/robots.txt "$RELEASE_PATH/src/browser"
4045

4146
# Adds the commit to package.json
4247
jq --slurp '.[0] * .[1]' package.json <(
@@ -51,6 +56,12 @@ EOF
5156
) > "$RELEASE_PATH/package.json"
5257
rsync yarn.lock "$RELEASE_PATH"
5358
rsync ci/build/npm-postinstall.sh "$RELEASE_PATH/postinstall.sh"
59+
60+
if [ "$KEEP_MODULES" = 1 ]; then
61+
rsync node_modules/ "$RELEASE_PATH/node_modules"
62+
mkdir -p "$RELEASE_PATH/lib"
63+
rsync ./lib/coder-cloud-agent "$RELEASE_PATH/lib"
64+
fi
5465
}
5566

5667
bundle_vscode() {
@@ -59,7 +70,11 @@ bundle_vscode() {
5970
rsync "$VSCODE_SRC_PATH/out-vscode${MINIFY+-min}/" "$VSCODE_OUT_PATH/out"
6071

6172
rsync "$VSCODE_SRC_PATH/.build/extensions/" "$VSCODE_OUT_PATH/extensions"
62-
rm -Rf "$VSCODE_OUT_PATH/extensions/node_modules"
73+
if [ "$KEEP_MODULES" = 0 ]; then
74+
rm -Rf "$VSCODE_OUT_PATH/extensions/node_modules"
75+
else
76+
rsync "$VSCODE_SRC_PATH/node_modules/" "$VSCODE_OUT_PATH/node_modules"
77+
fi
6378
rsync "$VSCODE_SRC_PATH/extensions/package.json" "$VSCODE_OUT_PATH/extensions"
6479
rsync "$VSCODE_SRC_PATH/extensions/yarn.lock" "$VSCODE_OUT_PATH/extensions"
6580
rsync "$VSCODE_SRC_PATH/extensions/postinstall.js" "$VSCODE_OUT_PATH/extensions"

ci/build/clean.sh

+1-10
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,7 @@ main() {
55
cd "$(dirname "${0}")/../.."
66
source ./ci/lib.sh
77

8-
rm -rf \
9-
out \
10-
release \
11-
release-standalone \
12-
release-packages \
13-
release-gcp \
14-
release-images \
15-
dist \
16-
.cache \
17-
node-*
8+
git clean -Xffd
189

1910
pushd lib/vscode
2011
git clean -xffd

ci/build/npm-postinstall.sh

+11
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ main() {
2424
;;
2525
esac
2626

27+
OS="$(uname | tr '[:upper:]' '[:lower:]')"
28+
curl -fsSL "https://storage.googleapis.com/coder-cloud-releases/agent/latest/$OS/cloud-agent" -o ./lib/coder-cloud-agent
29+
chmod +x ./lib/coder-cloud-agent
30+
2731
if ! vscode_yarn; then
2832
echo "You may not have the required dependencies to build the native modules."
2933
echo "Please see https://github.com/cdr/code-server/blob/master/doc/npm.md"
@@ -36,6 +40,13 @@ vscode_yarn() {
3640
yarn --production --frozen-lockfile
3741
cd extensions
3842
yarn --production --frozen-lockfile
43+
for ext in */; do
44+
ext="${ext%/}"
45+
echo "extensions/$ext: installing dependencies"
46+
cd "$ext"
47+
yarn --production --frozen-lockfile
48+
cd "$OLDPWD"
49+
done
3950
}
4051

4152
main "$@"

ci/build/release-github-assets.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ main() {
1111
source ./ci/lib.sh
1212

1313
download_artifact release-packages ./release-packages
14-
local assets=(./release-packages/code-server*"$VERSION"*{.tar.gz,.zip,.deb,.rpm})
14+
local assets=(./release-packages/code-server*"$VERSION"*{.tar.gz,.deb,.rpm})
1515
for i in "${!assets[@]}"; do
1616
assets[$i]="--attach=${assets[$i]}"
1717
done

ci/build/test-standalone-release.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ main() {
1515
./release-standalone/bin/code-server --extensions-dir "$EXTENSIONS_DIR" --install-extension ms-python.python
1616
local installed_extensions
1717
installed_extensions="$(./release-standalone/bin/code-server --extensions-dir "$EXTENSIONS_DIR" --list-extensions 2>&1)"
18-
if [[ $installed_extensions != *"info Using config file ~/.config/code-server/config.yaml
19-
ms-python.python" ]]; then
18+
if [[ $installed_extensions != "ms-python.python" ]]; then
2019
echo "Unexpected output from listing extensions:"
2120
echo "$installed_extensions"
2221
exit 1

ci/dev/diff-vscode.sh

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

77
cd ./lib/vscode
88
git add -A
9-
git diff HEAD > ../../ci/dev/vscode.patch
9+
git diff HEAD --full-index > ../../ci/dev/vscode.patch
1010
}
1111

1212
main "$@"

ci/dev/image/run.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,22 @@ set -euo pipefail
44
main() {
55
cd "$(dirname "$0")/../../.."
66
source ./ci/lib.sh
7+
mkdir -p .home
78

89
docker run \
910
-it \
1011
--rm \
1112
-v "$PWD:/src" \
13+
-e HOME="/src/.home" \
14+
-e USER="coder" \
15+
-e GITHUB_TOKEN \
16+
-e KEEP_MODULES \
17+
-e MINIFY \
1218
-w /src \
1319
-p 127.0.0.1:8080:8080 \
1420
-u "$(id -u):$(id -g)" \
1521
-e CI \
16-
"$(docker_build ./ci/images/debian8)" \
22+
"$(docker_build ./ci/images/"${IMAGE-debian10}")" \
1723
"$@"
1824
}
1925

ci/dev/lint.sh

+1-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ main() {
77
eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js")
88
stylelint $(git ls-files "*.css")
99
tsc --noEmit
10-
# See comment in ./ci/image/debian8
11-
if [[ ! ${CI-} ]]; then
12-
shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files "*.sh")
13-
fi
10+
shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files "*.sh")
1411
}
1512

1613
main "$@"

0 commit comments

Comments
 (0)