Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ce363da

Browse files
committedOct 27, 2020
Edit CONTRIBUTING
1 parent 056e669 commit ce363da

File tree

1 file changed

+64
-66
lines changed

1 file changed

+64
-66
lines changed
 

‎doc/CONTRIBUTING.md

Lines changed: 64 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,52 @@
22
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
33
# Contributing
44

5-
- [Pull Requests](#pull-requests)
6-
- [Requirements](#requirements)
7-
- [Development Workflow](#development-workflow)
8-
- [Build](#build)
9-
- [Structure](#structure)
10-
- [VS Code Patch](#vs-code-patch)
5+
- [Contributing](#contributing)
6+
- [Pull Requests](#pull-requests)
7+
- [Requirements](#requirements)
8+
- [Development Workflow](#development-workflow)
9+
- [Build](#build)
10+
- [Structure](#structure)
11+
- [VS Code Patch](#vs-code-patch)
12+
- [Currently Known Issues](#currently-known-issues)
1113

1214
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1315

1416
- [Detailed CI and build process docs](../ci)
1517

1618
## Pull Requests
1719

18-
Please link to the issue each PR solves.
19-
If there is no existing issue, please first create one unless the fix is minor.
20+
Please create a [GitHub Issue](https://github.com/cdr/code-server/issues) for each issue
21+
you'd like to address unless the proposed fix is minor.
2022

21-
Please make sure the base of your PR is the master branch. We keep the GitHub
22-
default branch the latest release branch to avoid confusion as the
23-
documentation is on GitHub and we don't want users to see docs on unreleased
24-
features.
23+
In your Pull Requests (PR), link to the issue that the PR solves.
24+
25+
Please ensure that the base of your PR is the **master** branch. (Note: The default
26+
GitHub branch is the latest release branch, though you should point all of your changes to be merged into
27+
master).
2528

2629
## Requirements
2730

28-
Please refer to [VS Code's prerequisites](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
31+
The prerequisites for contributing to code-server are almost the same as those for
32+
[VS Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
33+
There are several differences, however. You must:
2934

30-
Differences:
35+
- Use Node.js version 12.x (or greater)
36+
- Have [nfpm](https://github.com/goreleaser/nfpm) (which is used to build `.deb` and `.rpm` packages and [jq](https://stedolan.github.io/jq/) (used to build code-server releases) installed
3137

32-
- We require a minimum of node v12 but later versions should work.
33-
- We use [nfpm](https://github.com/goreleaser/nfpm) to build `.deb` and `.rpm` packages.
34-
- We use [jq](https://stedolan.github.io/jq/) to build code-server releases.
35-
- The [CI container](../ci/images/debian10/Dockerfile) is a useful reference for all our dependencies.
38+
The [CI container](../ci/images/debian8/Dockerfile) is a useful reference for all
39+
of the dependencies code-server uses.
3640

3741
## Development Workflow
3842

3943
```shell
4044
yarn
4145
yarn vscode
4246
yarn watch
43-
# Visit http://localhost:8080 once the build completed.
47+
# Visit http://localhost:8080 once the build is completed.
4448
```
4549

46-
To develop inside of an isolated docker container:
50+
To develop inside an isolated Docker container:
4751

4852
```shell
4953
./ci/dev/image/run.sh yarn
@@ -53,35 +57,35 @@ To develop inside of an isolated docker container:
5357

5458
`yarn watch` will live reload changes to the source.
5559

56-
If changes are made to the patch and you've built previously you must manually
57-
reset VS Code then run `yarn vscode:patch`.
60+
If you introduce changes to the patch and you've previously built, you
61+
must (1) manually reset VS Code and (2) run `yarn vscode:patch`.
5862

5963
## Build
6064

61-
You can build with:
65+
You can build using:
6266

6367
```shell
6468
./ci/dev/image/run.sh ./ci/steps/release.sh
6569
```
6670

6771
Run your build with:
6872

69-
```
73+
```shell
7074
cd release
7175
yarn --production
7276
# Runs the built JavaScript with Node.
7377
node .
7478
```
7579

76-
Build release packages (make sure you run `./ci/steps/release.sh` first):
80+
Build the release packages (make sure that you run `./ci/steps/release.sh` first):
7781

78-
```
82+
```shell
7983
IMAGE=centos7 ./ci/dev/image/run.sh ./ci/steps/release-packages.sh
8084
# The standalone release is in ./release-standalone
8185
# .deb, .rpm and the standalone archive are in ./release-packages
8286
```
8387

84-
The `release.sh` script is the equivalent of:
88+
The `release.sh` script is equal to running:
8589

8690
```shell
8791
yarn
@@ -91,73 +95,67 @@ yarn build:vscode
9195
yarn release
9296
```
9397

94-
And `release-packages.sh` is:
98+
And `release-packages.sh` is equal to:
9599

96-
```
100+
```shell
97101
yarn release:standalone
98102
yarn test:standalone-release
99103
yarn package
100104
```
101105

102-
For a faster release build you can also run:
106+
For a faster release build, you can run instead:
103107

104-
```
108+
```shell
105109
KEEP_MODULES=1 ./ci/steps/release.sh
106110
node ./release
107111
```
108112

109113
## Structure
110114

111-
The `code-server` script serves an HTTP API to login and start a remote VS Code process.
115+
The `code-server` script serves an HTTP API for login and starting a remote VS Code process.
112116

113117
The CLI code is in [./src/node](./src/node) and the HTTP routes are implemented in
114118
[./src/node/app](./src/node/app).
115119

116-
Most of the meaty parts are in our VS Code patch which is described next.
120+
Most of the meaty parts are in the VS Code patch, which we described next.
117121

118122
### VS Code Patch
119123

120-
Back in v1 of code-server, we had an extensive patch of VS Code that split the codebase
121-
into a frontend and server. The frontend consisted of all UI code and the server ran
122-
the extensions and exposed an API to the frontend for file access and everything else
123-
that the UI needed.
124+
In v1 of code-server, we had a patch of VS Code that split the codebase into a front-end
125+
and a server. The front-end consisted of all UI code, while the server ran the extensions
126+
and exposed an API to the front-end for file access and all UI needs.
124127

125-
This worked but eventually Microsoft added support to VS Code to run it in the web.
126-
They have open sourced the frontend but have kept the server closed source.
127-
128-
So in interest of piggy backing off their work, v2 and beyond use the VS Code
129-
web frontend and fill in the server. This is contained in our
128+
Over time, Microsoft added support to VS Code to run it on the web. They have made
129+
the front-end open source, but not the server. As such, code-server v2 (and later) uses
130+
the VS Code front-end and fills in with the server. You can find this in
130131
[./ci/dev/vscode.patch](../ci/dev/vscode.patch) under the path `src/vs/server`.
131132

132133
Other notable changes in our patch include:
133134

134-
- Add our own build file which includes our code and VS Code's web code.
135-
- Allow multiple extension directories (both user and built-in).
136-
- Modify the loader, websocket, webview, service worker, and asset requests to
137-
use the URL of the page as a base (and TLS if necessary for the websocket).
138-
- Send client-side telemetry through the server.
139-
- Allow modification of the display language.
140-
- Make it possible for us to load code on the client.
141-
- Make extensions work in the browser.
142-
- Make it possible to install extensions of any kind.
143-
- Fix getting permanently disconnected when you sleep or hibernate for a while.
144-
- Add connection type to web socket query parameters.
145-
146-
Some known issues presently:
135+
- Adding our build file, which includes our code and VS Code's web code
136+
- Allowing multiple extension directories (both user and built-in)
137+
- Modifying the loader, websocket, webview, service worker, and asset requests to
138+
use the URL of the page as a base (and TLS, if necessary for the websocket)
139+
- Sending client-side telemetry through the server
140+
- Allowing modification of the display language
141+
- Making it possible for us to load code on the client
142+
- Making extensions work in the browser
143+
- Making it possible to install extensions of any kind
144+
- Fixing issue with getting disconnected when your machine sleeps or hibernates
145+
- Adding connection type to web socket query parameters
147146

148-
- Creating custom VS Code extensions and debugging them doesn't work.
149-
- Extension profiling and tips are currently disabled.
147+
As the web portion of VS Code matures, we'll be able to shrink and possibly
148+
eliminate our patch. In the meantime, upgrading the VS Code version requires us to ensure that the patch is applied and works as intended. In the future, we'd like to run VS
149+
Code unit tests against our builds to ensure that features work as expected.
150150

151-
As the web portion of VS Code matures, we'll be able to shrink and maybe even entirely
152-
eliminate our patch. In the meantime, however, upgrading the VS Code version requires
153-
ensuring that the patch still applies and has the intended effects.
151+
To generate a new patch, run `yarn vscode:diff`
154152

155-
To generate a new patch run `yarn vscode:diff`.
153+
**Note**: We have [extension docs](../ci/README.md) on the CI and build system.
156154

157-
**note**: We have extension docs on the CI and build system at [./ci/README.md](../ci/README.md)
155+
If the functionality you're working on does NOT depend on code from VS Code, please
156+
move it out and into code-server.
158157

159-
If functionality doesn't depend on code from VS Code then it should be moved
160-
into code-server otherwise it should be in the patch.
158+
### Currently Known Issues
161159

162-
In the future we'd like to run VS Code unit tests against our builds to ensure features
163-
work as expected.
160+
- Creating custom VS Code extensions and debugging them doesn't work
161+
- Extension profiling and tips are currently disabled

0 commit comments

Comments
 (0)
Please sign in to comment.