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
3. Apply the patches one at a time (`quilt push`). If the application succeeds
102
+
but the lines changed, update the patch with `quilt refresh`. If there are
103
+
conflicts, then force apply with `quilt push -f`, manually add back the
104
+
rejected code, then run `quilt refresh`.
105
+
4. From the code-server **project root**, run `yarn install`.
106
+
5. Check the Node.js version that's used by Electron (which is shipped with VS
107
+
Code. If necessary, update our version of Node.js to match.
125
108
126
109
### Patching Code
127
110
128
-
0. You can go through the patch stack with `quilt push` and `quilt pop`.
129
-
1. Create a new patch (`quilt new {name}.diff`) or use an existing patch.
130
-
1. Add the file(s) you are patching (`quilt add [-P patch] {file}`). A file
111
+
1. You can go through the patch stack with `quilt push` and `quilt pop`.
112
+
2. Create a new patch (`quilt new {name}.diff`) or use an existing patch.
113
+
3. Add the file(s) you are patching (`quilt add [-P patch] {file}`). A file
131
114
**must** be added before you make changes to it.
132
-
1. Make your changes. Patches do not need to be independent of each other but
115
+
4. Make your changes. Patches do not need to be independent of each other but
133
116
each patch must result in a working code-server without any broken in-between
134
117
states otherwise they are difficult to test and modify.
135
-
1. Add your changes to the patch (`quilt refresh`)
136
-
1. Add a comment in the patch about the reason for the patch and how to
118
+
5. Add your changes to the patch (`quilt refresh`)
119
+
6. Add a comment in the patch about the reason for the patch and how to
137
120
reproduce the behavior it fixes or adds. Every patch should have an e2e test
138
121
as well.
139
122
140
123
### Build
141
124
142
-
You can build as follows:
125
+
You can build a full production as follows:
143
126
144
127
```shell
128
+
git submodule update --init
129
+
quilt push -a
130
+
yarn install
145
131
yarn build
146
-
yarn build:vscode
132
+
VERSION=0.0.0 yarn build:vscode
147
133
yarn release
148
134
```
149
135
150
-
_NOTE: this does not keep `node_modules`. If you want them to be kept, use `KEEP_MODULES=1 yarn release` (if you're testing in Coder, you'll want to do this)_
136
+
This does not keep `node_modules`. If you want them to be kept, use
137
+
`KEEP_MODULES=1 yarn release`
151
138
152
139
Run your build:
153
140
@@ -158,7 +145,7 @@ npm install --omit=dev # Skip if you used KEEP_MODULES=1
158
145
node .
159
146
```
160
147
161
-
Build the release packages (make sure that you run `yarn release` first):
148
+
Then, to build the release package:
162
149
163
150
```shell
164
151
yarn release:standalone
@@ -167,7 +154,7 @@ yarn package
167
154
```
168
155
169
156
> On Linux, the currently running distro will become the minimum supported
170
-
> version. In our GitHub Actions CI, we use CentOS 7 for maximum compatibility.
157
+
> version. In our GitHub Actions CI, we use CentOS 8 for maximum compatibility.
171
158
> If you need your builds to support older distros, run the build commands
172
159
> inside a Docker container with all the build requirements installed.
173
160
@@ -181,27 +168,32 @@ writing, we do this for the following platforms/architectures:
181
168
- Linux arm7l (.tar.gz)
182
169
- Linux armhf.deb
183
170
- Linux armhf.rpm
184
-
- macOS amd64 (Intel-based)
171
+
- macOS arm64.tar.gz
185
172
186
-
Currently, these are compiled in CI using the `yarn release-standalone` command
173
+
Currently, these are compiled in CI using the `yarn release:standalone` command
187
174
in the `release.yaml` workflow. We then upload them to the draft release and
188
175
distribute via GitHub Releases.
189
176
190
177
### Troubleshooting
191
178
192
179
#### I see "Forbidden access" when I load code-server in the browser
193
180
194
-
This means your patches didn't apply correctly. We have a patch to remove the auth from vanilla Code because we use our own.
181
+
This means your patches didn't apply correctly. We have a patch to remove the
182
+
auth from vanilla Code because we use our own.
195
183
196
-
Try popping off the patches with `quilt pop -a` and reapplying with `quilt push -a`.
184
+
Try popping off the patches with `quilt pop -a` and reapplying with `quilt push
185
+
-a`.
197
186
198
187
#### "Can only have one anonymous define call per script"
199
188
200
-
Code might be trying to use a dev or prod HTML in the wrong context. You can try re-running code-server and setting `VSCODE_DEV=1`.
189
+
Code might be trying to use a dev or prod HTML in the wrong context. You can try
190
+
re-running code-server and setting `VSCODE_DEV=1`.
201
191
202
192
### Help
203
193
204
-
If you get stuck or need help, you can always start a new GitHub Discussion [here](https://github.com/coder/code-server/discussions). One of the maintainers will respond and help you out.
194
+
If you get stuck or need help, you can always start a new GitHub Discussion
195
+
[here](https://github.com/coder/code-server/discussions). One of the maintainers
196
+
will respond and help you out.
205
197
206
198
## Test
207
199
@@ -219,20 +211,24 @@ Our unit tests are written in TypeScript and run using
219
211
220
212
These live under [test/unit](../test/unit).
221
213
222
-
We use unit tests for functions and things that can be tested in isolation. The file structure is modeled closely after `/src` so it's easy for people to know where test files should live.
214
+
We use unit tests for functions and things that can be tested in isolation. The
215
+
file structure is modeled closely after `/src` so it's easy for people to know
216
+
where test files should live.
223
217
224
218
### Script tests
225
219
226
220
Our script tests are written in bash and run using [bats](https://github.com/bats-core/bats-core).
227
221
228
222
These tests live under `test/scripts`.
229
223
230
-
We use these to test anything related to our scripts (most of which live under `ci`).
224
+
We use these to test anything related to our scripts (most of which live under
225
+
`ci`).
231
226
232
227
### Integration tests
233
228
234
-
These are a work in progress. We build code-server and run tests with `yarn test:integration`, which ensures that code-server builds work on their respective
235
-
platforms.
229
+
These are a work in progress. We build code-server and run tests with `yarn
230
+
test:integration`, which ensures that code-server builds work on their
231
+
respective platforms.
236
232
237
233
Our integration tests look at components that rely on one another. For example,
238
234
testing the CLI requires us to build and package code-server.
@@ -253,15 +249,10 @@ Take a look at `codeServer.test.ts` to see how you would use it (see
253
249
We also have a model where you can create helpers to use within tests. See
254
250
[models/CodeServer.ts](../test/e2e/models/CodeServer.ts) for an example.
255
251
256
-
Generally speaking, e2e means testing code-server while running in the browser
257
-
and interacting with it in a way that's similar to how a user would interact
258
-
with it. When running these tests with `yarn test:e2e`, you must have
259
-
code-server running locally. In CI, this is taken care of for you.
260
-
261
252
## Structure
262
253
263
-
The `code-server` script serves as an HTTP API for login and starting a remote
264
-
Code process.
254
+
code-server essentially serves as an HTTP API for logging in and starting a
255
+
remote Code process.
265
256
266
257
The CLI code is in [src/node](../src/node) and the HTTP routes are implemented
0 commit comments