Skip to content

Commit 712274d

Browse files
committed
Groundwork for language support
- Implement the localization service. - Use the proper build process which generates the require JSON files. - Implement getting the locale and language configuration.
1 parent 60ed065 commit 712274d

14 files changed

Lines changed: 470 additions & 242 deletions

File tree

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ matrix:
1616
- os: osx
1717
env:
1818
- VSCODE_VERSION="1.36.1" MAJOR_VERSION="2" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER"
19+
before_install:
20+
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then export MINIFY="true"; fi
1921
script:
2022
- scripts/ci.bash
2123
before_deploy:

Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@ RUN npm install -g yarn@1.13
1313
WORKDIR /src
1414
COPY . .
1515

16-
17-
# In the future, we can use https://github.com/yarnpkg/rfcs/pull/53 to make
18-
# yarn use the node_modules directly which should be fast as it is slow because
19-
# it populates its own cache every time.
2016
RUN yarn \
21-
&& yarn build "${codeServerVersion}" "${vscodeVersion}" linux x64 \
22-
&& yarn binary "${codeServerVersion}" "${vscodeVersion}" linux x64 \
23-
&& mv "/src/build/code-server${codeServerVersion}-vsc${vscodeVersion}-linux-x64" /src/build/code-server
17+
&& yarn build "${vscodeVersion}" "${codeServerVersion}" \
18+
&& yarn binary "${vscodeVersion}" "${codeServerVersion}" \
19+
&& mv "/src/build/code-server${codeServerVersion}-vsc${vscodeVersion}-linux-x86_64-built/code-server${codeServerVersion}-vsc${vscodeVersion}-linux-x86_64" /src/build/code-server
2420

2521
# We deploy with ubuntu so that devs have a familiar environment.
2622
FROM ubuntu:18.04

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ arguments when launching code-server with Docker. See
4444
it will build in this directory which will cause issues because `yarn watch`
4545
will try to compile the build directory as well.
4646
- For now `@coder/nbin` is a global dependency.
47-
- Run `yarn build ${codeServerVersion} ${vscodeVersion} ${target} ${arch}` in
48-
this directory (for example: `yarn build development 1.36.0 linux x64`).
47+
- Run `yarn build ${vscodeVersion} ${codeServerVersion}` in this directory (for
48+
example: `yarn build 1.36.0 development`).
4949
- If you target the same VS Code version our Travis builds do everything will
5050
work but if you target some other version it might not (we have to do some
5151
patching to VS Code so different versions aren't always compatible).
@@ -93,6 +93,10 @@ yarn start
9393
# Visit http://localhost:8443
9494
```
9595

96+
If you run into issues about a different version of Node being used, try running
97+
`npm rebuild` in the VS Code directory and ignore the error at the end from
98+
`vscode-ripgrep`.
99+
96100
### Upgrading VS Code
97101
We have to patch VS Code to provide and fix some functionality. As the web
98102
portion of VS Code matures, we'll be able to shrink and maybe even entirely
@@ -121,6 +125,7 @@ Our changes include:
121125
- Get telemetry working by adding a channel for it.
122126
- Change a regular expression used for mnemonics so it works on Firefox.
123127
- Make it possible for us to load code on the client.
128+
- Modify the build process to include our code.
124129

125130
## License
126131
[MIT](LICENSE)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"watch": "yarn ensure-in-vscode && cd ../../../ && yarn watch",
99
"build": "bash ./scripts/tasks.bash build",
1010
"package": "bash ./scripts/tasks.bash package",
11-
"vstar": "bash ./scripts/tasks.bash vstar",
11+
"package-prebuilt": "bash ./scripts/tasks.bash package-prebuilt",
1212
"binary": "bash ./scripts/tasks.bash binary",
1313
"patch:generate": "yarn ensure-in-vscode && cd ../../../ && git diff --staged > ./src/vs/server/scripts/vscode.patch",
1414
"patch:apply": "yarn ensure-in-vscode && cd ../../../ && git apply ./src/vs/server/scripts/vscode.patch"

scripts/ci.bash

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function docker-build() {
2323

2424
function docker-exec() {
2525
local command="${1}" ; shift
26-
local args="'${codeServerVersion}' '${vscodeVersion}' '${target}' '${arch}'"
26+
local args="'${vscodeVersion}' '${codeServerVersion}'"
2727
docker exec "${containerId}" \
2828
bash -c "cd /src && CI=true yarn ${command} ${args}"
2929
}
@@ -41,8 +41,7 @@ function docker-build() {
4141
function local-build() {
4242
function local-exec() {
4343
local command="${1}" ; shift
44-
CI=true yarn "${command}" \
45-
"${codeServerVersion}" "${vscodeVersion}" "${target}" "${arch}"
44+
CI=true yarn "${command}" "${vscodeVersion}" "${codeServerVersion}"
4645
}
4746

4847
local-exec build
@@ -56,7 +55,6 @@ function main() {
5655
local vscodeVersion="${VSCODE_VERSION:-}"
5756
local ostype="${OSTYPE:-}"
5857
local target="${TARGET:-}"
59-
local arch=x64
6058

6159
if [[ -z "${codeServerVersion}" ]] ; then
6260
>&2 echo "Must set VERSION environment variable"; exit 1

scripts/nbin.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
/* global require, __dirname, process */
21
const { Binary } = require("@coder/nbin");
32
const fs = require("fs");
43
const path = require("path");
54

6-
const target = process.argv[2];
7-
const arch = process.argv[3];
8-
const source = process.argv[4];
5+
const source = process.argv[2];
6+
const target = process.argv[3];
7+
const binaryName = process.argv[4];
98

109
const bin = new Binary({
1110
mainFile: path.join(source, "out/vs/server/main.js"),
@@ -15,7 +14,7 @@ const bin = new Binary({
1514
bin.writeFiles(path.join(source, "**"));
1615

1716
bin.build().then((binaryData) => {
18-
const outputPath = path.join(source, "code-server");
17+
const outputPath = path.join(source, binaryName);
1918
fs.writeFileSync(outputPath, binaryData);
2019
fs.chmodSync(outputPath, "755");
2120
}).catch((ex) => {

0 commit comments

Comments
 (0)