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
- 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
31
37
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.
36
40
37
41
## Development Workflow
38
42
39
43
```shell
40
44
yarn
41
45
yarn vscode
42
46
yarn watch
43
-
# Visit http://localhost:8080 once the build completed.
47
+
# Visit http://localhost:8080 once the build is completed.
44
48
```
45
49
46
-
To develop inside of an isolated docker container:
50
+
To develop inside an isolated Docker container:
47
51
48
52
```shell
49
53
./ci/dev/image/run.sh yarn
@@ -53,35 +57,35 @@ To develop inside of an isolated docker container:
53
57
54
58
`yarn watch` will live reload changes to the source.
55
59
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`.
58
62
59
63
## Build
60
64
61
-
You can build with:
65
+
You can build using:
62
66
63
67
```shell
64
68
./ci/dev/image/run.sh ./ci/steps/release.sh
65
69
```
66
70
67
71
Run your build with:
68
72
69
-
```
73
+
```shell
70
74
cd release
71
75
yarn --production
72
76
# Runs the built JavaScript with Node.
73
77
node .
74
78
```
75
79
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):
# The standalone release is in ./release-standalone
81
85
# .deb, .rpm and the standalone archive are in ./release-packages
82
86
```
83
87
84
-
The `release.sh` script is the equivalent of:
88
+
The `release.sh` script is equal to running:
85
89
86
90
```shell
87
91
yarn
@@ -91,73 +95,67 @@ yarn build:vscode
91
95
yarn release
92
96
```
93
97
94
-
And `release-packages.sh` is:
98
+
And `release-packages.sh` is equal to:
95
99
96
-
```
100
+
```shell
97
101
yarn release:standalone
98
102
yarn test:standalone-release
99
103
yarn package
100
104
```
101
105
102
-
For a faster release build you can also run:
106
+
For a faster release build, you can run instead:
103
107
104
-
```
108
+
```shell
105
109
KEEP_MODULES=1 ./ci/steps/release.sh
106
110
node ./release
107
111
```
108
112
109
113
## Structure
110
114
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.
112
116
113
117
The CLI code is in [./src/node](./src/node) and the HTTP routes are implemented in
114
118
[./src/node/app](./src/node/app).
115
119
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.
117
121
118
122
### VS Code Patch
119
123
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.
124
127
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
130
131
[./ci/dev/vscode.patch](../ci/dev/vscode.patch) under the path `src/vs/server`.
131
132
132
133
Other notable changes in our patch include:
133
134
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
147
146
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.
150
150
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`
154
152
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.
156
154
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.
158
157
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
161
159
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