You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Commits and commit history](#commits-and-commit-history)
9
+
-[Development workflow](#development-workflow)
10
+
-[Update VS Code](#update-vs-code)
11
+
-[Build](#build)
12
+
-[Test](#test)
13
+
-[Unit tests](#unit-tests)
14
+
-[Integration Tests](#integration-tests)
15
+
-[End-to-end tests](#end-to-end-tests)
16
+
-[Structure](#structure)
17
+
-[Modifying VS Code](#modifying-vs-code)
18
+
-[Currently Known Issues](#currently-known-issues)
19
19
20
20
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
21
21
22
22
-[Detailed CI and build process docs](../ci)
23
23
24
-
## Pull Requests
25
-
26
-
Please create a [GitHub Issue](https://github.com/cdr/code-server/issues) to address any issue. You can skip this if the proposed fix is minor.
27
-
28
-
In your Pull Requests (PR), link to the issue that the PR solves.
29
-
30
-
Please ensure that the base of your PR is the **main** branch.
31
-
32
-
### Commits
33
-
34
-
We prefer a clean commit history. This means you should squash all fixups and fixup-type commits before asking for review (cleanup, squash, force-push). If you need help with this, feel free to leave a comment in your PR and we'll guide you.
35
-
36
24
## Requirements
37
25
38
-
The prerequisites for contributing to code-server are almost the same as those for
or follow [this tutorial](https://joeprevite.com/verify-commits-on-github)
44
+
-`build-essential` (Linux only - used by VS Code)
45
+
- Get this by running `apt-get install -y build-essential`
55
46
-`rsync` and `unzip`
56
-
- used for code-server releases
47
+
- Used for code-server releases
48
+
49
+
## Creating pull requests
57
50
58
-
## Development Workflow
51
+
Please create a [GitHub Issue](https://github.com/cdr/code-server/issues) that
52
+
includes context for issues that you see. You can skip this if the proposed fix
53
+
is minor.
54
+
55
+
In your pull requests (PR), link to the issue that the PR solves.
56
+
57
+
Please ensure that the base of your PR is the **main** branch.
58
+
59
+
### Commits and commit history
60
+
61
+
We prefer a clean commit history. This means you should squash all fixups and
62
+
fixup-type commits before asking for a review (e.g., clean up, squash, then force
63
+
push). If you need help with this, feel free to leave a comment in your PR, and
64
+
we'll guide you.
65
+
66
+
## Development workflow
59
67
60
68
```shell
61
69
yarn
@@ -65,36 +73,39 @@ yarn watch
65
73
66
74
`yarn watch` will live reload changes to the source.
67
75
68
-
### Updating VS Code
76
+
### Update VS Code
69
77
70
-
Updating VS Code requires `git subtree`. On some rpm-based Linux distros, `git subtree` is not included by default, and needs to be installed separately.
71
-
To install, run `dnf install git-subtree` or `yum install git-subtree` as necessary.
78
+
Updating VS Code requires `git subtree`. On some RPM-based Linux distros, `git
79
+
subtree` is not included by default and needs to be installed separately. To
80
+
install, run `dnf install git-subtree` or `yum install git-subtree`.
72
81
73
-
To update VS Code, follow these steps:
82
+
To update VS Code:
74
83
75
84
1. Run `yarn update:vscode`.
76
-
2. Enter a version. Ex. 1.53
77
-
3. This will open a draft PR for you.
78
-
4. There will be merge conflicts. First commit them.
79
-
1. We do this because if we don't, it will be impossible to review your PR.
80
-
5.Once they're all fixed, test code-server locally and make sure it all works.
81
-
6. Check the version of Node.js that the version of Electron shipped with VSCode uses, and update the version of Node.js if necessary.
82
-
83
-
#### Notes about Changes
85
+
2. Enter a version (e.g., `1.53`)
86
+
3. This will open a draft pull request for you.
87
+
4. There will be merge conflicts. Commit them first, since it will be impossible
88
+
for us to review your PR if you don't.
89
+
5.Fix the conflicts. Then, test code-server locally to make sure everything
90
+
works.
91
+
6. Check the Node.js version that's used by Electron (which is shipped with VS
92
+
Code. If necessary, update your version of Node.js to match.
84
93
85
-
- watch out for updates to `lib/vscode/src/vs/code/browser/workbench/workbench.html`. You may need to make changes to `src/browser/pages/vscode.html`
94
+
> Watch for updates to
95
+
> `lib/vscode/src/vs/code/browser/workbench/workbench.html`. You may need to
96
+
> make changes to `src/browser/pages/vscode.html`.
NOTE: On Linux, the currently running distro will become the minimum supported version.
115
-
In our GitHub Actions CI, we use CentOS 7 for maximum compatibility.
116
-
If you need your builds to support older distros, run the build commands
117
-
inside a Docker container with all the build requirements installed.
125
+
>On Linux, the currently running distro will become the minimum supported
126
+
> version. In our GitHub Actions CI, we use CentOS 7 for maximum compatibility.
127
+
> If you need your builds to support older distros, run the build commands
128
+
> inside a Docker container with all the build requirements installed.
118
129
119
-
##Testing
130
+
### Test
120
131
121
132
There are three kinds of tests in code-server:
122
133
123
-
1.unit tests
124
-
2.integration tests
125
-
3.end-to-end tests
134
+
1.Unit tests
135
+
2.Integration tests
136
+
3.End-to-end tests
126
137
127
-
### Unit Tests
138
+
### Unit tests
128
139
129
-
Our unit tests are written in TypeScript and run using [Jest, the testing framework](https://jestjs.io/).
140
+
Our unit tests are written in TypeScript and run using
141
+
[Jest](https://jestjs.io/), the testing framework].
130
142
131
143
These live under [test/unit](../test/unit).
132
144
133
145
We use unit tests for functions and things that can be tested in isolation.
134
146
135
147
### Integration Tests
136
148
137
-
These are a work-in-progress. We build code-server and run a script called [test-standalone-release.sh`](../ci/build/test-standalone-release.sh)
138
-
which ensures that code-server's CLI is working.
149
+
These are a work in progress. We build code-server and run a script called
150
+
[test-standalone-release.sh](../ci/build/test-standalone-release.sh), which
151
+
ensures that code-server's CLI is working.
139
152
140
-
Integration for us means testing things that integrate and rely on each other. For instance, testing the CLI which requires that code-server be built and packaged.
153
+
Our integration tests look at components that rely on one another. For example,
154
+
testing the CLI requires us to build and package code-server.
141
155
142
-
### End-to-End Tests
156
+
### End-to-end tests
143
157
144
-
The end-to-end (e2e) are written in TypeScript and run using [Playwright](https://playwright.dev/).
158
+
The end-to-end (e2e) tests are written in TypeScript and run using
159
+
[Playwright](https://playwright.dev/).
145
160
146
161
These live under [test/e2e](../test/e2e).
147
162
148
-
Before the e2e tests run, we have a `globalSetup` that runs which makes it so you don't have to login before each test and can reuse the authentication state.
163
+
Before the e2e tests run, we run `globalSetup`, which eliminates the need to log
164
+
in before each test by preserving the authentication state.
149
165
150
-
Take a look at `codeServer.test.ts` to see how you use it (look at `test.use`).
166
+
Take a look at `codeServer.test.ts` to see how you would use it (see
167
+
`test.use`).
151
168
152
-
We also have a model where you can create helpers to use within tests. Take a look at [models/CodeServer.ts](../test/e2e/models/CodeServer.ts) to see an example.
169
+
We also have a model where you can create helpers to use within tests. See
170
+
[models/CodeServer.ts](../test/e2e/models/CodeServer.ts) for an example.
153
171
154
-
Generally speaking, e2e means testing code-server running in the browser, similar to how a user would interact with it. When running these tests with `yarn test:e2e`, you must have code-server running locally. In CI, this is taken care of for you.
172
+
Generally speaking, e2e means testing code-server while running in the browser
173
+
and interacting with it in a way that's similar to how a user would interact
174
+
with it. When running these tests with `yarn test:e2e`, you must have
175
+
code-server running locally. In CI, this is taken care of for you.
155
176
156
177
## Structure
157
178
158
-
The `code-server` script serves an HTTP API for login and starting a remote VS Code process.
179
+
The `code-server` script serves as an HTTP API for login and starting a remote VS
180
+
Code process.
159
181
160
-
The CLI code is in [src/node](../src/node) and the HTTP routes are implemented in
161
-
[src/node/routes](../src/node/routes).
182
+
The CLI code is in [src/node](../src/node) and the HTTP routes are implemented
183
+
in [src/node/routes](../src/node/routes).
162
184
163
-
Most of the meaty parts are in the VS Code portion of the codebase under [lib/vscode](../lib/vscode), which we described next.
185
+
Most of the meaty parts are in the VS Code portion of the codebase under
186
+
[lib/vscode](../lib/vscode), which we describe next.
164
187
165
-
### Modifications to VS Code
188
+
### Modifying VS Code
166
189
167
-
In v1 of code-server, we had a patch of VS Code that split the codebase into a front-end
168
-
and a server. The front-end consisted of all UI code, while the server ran the extensions
169
-
and exposed an API to the front-end for file access and all UI needs.
190
+
In v1 of code-server, we had a patch of VS Code that split the codebase into a
191
+
front-end and a server. The front-end consisted of the UI code, while the server
192
+
ran the extensions and exposed an API to the front-end for file access and all
193
+
UI needs.
170
194
171
-
Over time, Microsoft added support to VS Code to run it on the web. They have made
172
-
the front-end open source, but not the server. As such, code-server v2 (and later) uses
173
-
the VS Code front-end and implements the server. We do this by using a git subtree to fork and modify VS Code. This code lives under [lib/vscode](../lib/vscode).
195
+
Over time, Microsoft added support to VS Code to run it on the web. They have
196
+
made the front-end open source, but not the server. As such, code-server v2 (and
197
+
later) uses the VS Code front-end and implements the server. We do this by using
198
+
a Git subtree to fork and modify VS Code. This code lives under
199
+
[lib/vscode](../lib/vscode).
174
200
175
-
Some noteworthy changes in our version of VS Code:
201
+
Some noteworthy changes in our version of VS Code include:
176
202
177
203
- Adding our build file, which includes our code and VS Code's web code
178
204
- Allowing multiple extension directories (both user and built-in)
179
-
- Modifying the loader, websocket, webview, service worker, and asset requests to
180
-
use the URL of the page as a base (and TLS, if necessary for the websocket)
205
+
- Modifying the loader, WebSocket, webview, service worker, and asset requests to
206
+
use the URL of the page as a base (and TLS, if necessary for the WebSocket)
181
207
- Sending client-side telemetry through the server
182
208
- Allowing modification of the display language
183
209
- Making it possible for us to load code on the client
@@ -191,7 +217,7 @@ us to ensure that our changes are still applied and work as intended. In the fut
191
217
we'd like to run VS Code unit tests against our builds to ensure that features
192
218
work as expected.
193
219
194
-
**Note**: We have [extension docs](../ci/README.md) on the CI and build system.
220
+
>We have [extension docs](../ci/README.md) on the CI and build system.
195
221
196
222
If the functionality you're working on does NOT depend on code from VS Code, please
0 commit comments