mirror of
https://github.com/coder/code-server.git
synced 2026-04-13 21:32:52 -05:00
Compare commits
78 Commits
v4.89.0-rc
...
v4.95.1-rc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
344df3875f | ||
|
|
952523f288 | ||
|
|
8789dec68b | ||
|
|
b7398bad11 | ||
|
|
8194dbf5bc | ||
|
|
2ade2afdc7 | ||
|
|
494a3e0c2b | ||
|
|
dd2e9fce27 | ||
|
|
bea906f90b | ||
|
|
15752526bd | ||
|
|
7c298653f1 | ||
|
|
fc6064dcd3 | ||
|
|
6b4b3e0c89 | ||
|
|
13d4cd6489 | ||
|
|
a0c2780c50 | ||
|
|
aea7ba2a51 | ||
|
|
69df01185c | ||
|
|
3542bd157b | ||
|
|
50c6abf3a8 | ||
|
|
9286e0002d | ||
|
|
90f8135c68 | ||
|
|
8dbfe2273b | ||
|
|
e05a3f4ce2 | ||
|
|
e05d88007f | ||
|
|
534a1866e5 | ||
|
|
907e583309 | ||
|
|
639a005867 | ||
|
|
4a703893b0 | ||
|
|
39ce82a44d | ||
|
|
7f893234ab | ||
|
|
de65bfc947 | ||
|
|
34c6751bf8 | ||
|
|
461d4cba59 | ||
|
|
31bc0c6b1a | ||
|
|
0f9436e7b9 | ||
|
|
1962f48b7f | ||
|
|
6467c60166 | ||
|
|
d9812a5970 | ||
|
|
f2c326147d | ||
|
|
37a72ce63b | ||
|
|
6a14070664 | ||
|
|
a9eb923790 | ||
|
|
2b33ca8a3f | ||
|
|
8accfcc8ec | ||
|
|
2e098a2b90 | ||
|
|
97bcc3b934 | ||
|
|
c86c4e8bb6 | ||
|
|
3031f8599c | ||
|
|
d83ba4b46f | ||
|
|
fb3e3e1546 | ||
|
|
901191e0f9 | ||
|
|
dd79446b00 | ||
|
|
090e0fad76 | ||
|
|
6514ba4bf3 | ||
|
|
250281d071 | ||
|
|
93f31e6a74 | ||
|
|
603e467f38 | ||
|
|
c7d88abf9f | ||
|
|
26c763485b | ||
|
|
d431c9cd9d | ||
|
|
c26ac35b25 | ||
|
|
d449729e18 | ||
|
|
ed069310a4 | ||
|
|
dce1d6e172 | ||
|
|
a73549539b | ||
|
|
e7ca9cd6ac | ||
|
|
9da9f2029c | ||
|
|
0c802ba165 | ||
|
|
1bd2b9cf08 | ||
|
|
3b467dec95 | ||
|
|
6d9530aa6b | ||
|
|
fc47b4f1c5 | ||
|
|
479eb5bfa5 | ||
|
|
095c072a43 | ||
|
|
4ff509d8db | ||
|
|
efc6edf536 | ||
|
|
3b6ad479a6 | ||
|
|
effc6e95b4 |
@@ -1,43 +0,0 @@
|
||||
parser: "@typescript-eslint/parser"
|
||||
env:
|
||||
browser: true
|
||||
es6: true # Map, etc.
|
||||
jest: true
|
||||
node: true
|
||||
|
||||
parserOptions:
|
||||
ecmaVersion: 2018
|
||||
sourceType: module
|
||||
|
||||
extends:
|
||||
- eslint:recommended
|
||||
- plugin:@typescript-eslint/recommended
|
||||
- plugin:import/recommended
|
||||
- plugin:import/typescript
|
||||
- plugin:prettier/recommended
|
||||
# Prettier should always be last
|
||||
# Removes eslint rules that conflict with prettier.
|
||||
- prettier
|
||||
|
||||
rules:
|
||||
# Sometimes you need to add args to implement a function signature even
|
||||
# if they are unused.
|
||||
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }]
|
||||
# For overloads.
|
||||
no-dupe-class-members: off
|
||||
"@typescript-eslint/no-use-before-define": off
|
||||
"@typescript-eslint/no-non-null-assertion": off
|
||||
"@typescript-eslint/ban-types": off
|
||||
"@typescript-eslint/no-var-requires": off
|
||||
"@typescript-eslint/explicit-module-boundary-types": off
|
||||
"@typescript-eslint/no-explicit-any": off
|
||||
"@typescript-eslint/no-extra-semi": off
|
||||
eqeqeq: error
|
||||
import/order:
|
||||
[error, { alphabetize: { order: "asc" }, groups: [["builtin", "external", "internal"], "parent", "sibling"] }]
|
||||
no-async-promise-executor: off
|
||||
|
||||
settings:
|
||||
import/resolver:
|
||||
typescript:
|
||||
alwaysTryTypes: true
|
||||
2
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
@@ -62,7 +62,7 @@ body:
|
||||
id: logs
|
||||
attributes:
|
||||
label: Logs
|
||||
description: Run code-server with the --verbose flag and then paste any relevant logs from the server, from the browser console and/or the browser network tab. For issues with installation, include installation logs (i.e. output of `yarn global add code-server`).
|
||||
description: Run code-server with the --verbose flag and then paste any relevant logs from the server, from the browser console and/or the browser network tab. For issues with installation, include installation logs (i.e. output of `npm install -g code-server`).
|
||||
render: shell
|
||||
|
||||
- type: textarea
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
<!-- Note: this variable $CODE_SERVER_VERSION_TO_UPDATE will be set when you run the release-prep.sh script with `yarn release:prep` -->
|
||||
|
||||
This PR is to generate a new release of `code-server` at `$CODE_SERVER_VERSION_TO_UPDATE`
|
||||
|
||||
## Screenshot
|
||||
|
||||
TODO
|
||||
|
||||
## TODOs
|
||||
|
||||
Follow "Publishing a release" steps in `ci/README.md`
|
||||
|
||||
<!-- Note some of these steps below are redundant since they're listed in the "Publishing a release" docs -->
|
||||
|
||||
- [ ] update `CHANGELOG.md`
|
||||
- [ ] manually run "Draft release" workflow after merging this PR
|
||||
- [ ] merge PR opened in [code-server-aur](https://github.com/coder/code-server-aur)
|
||||
29
.github/ranger.yml
vendored
29
.github/ranger.yml
vendored
@@ -1,29 +0,0 @@
|
||||
# Configuration for the repo ranger bot
|
||||
# See docs: https://www.notion.so/Documentation-8d7627bb1f3c42b7b1820e8d6f157a57#9879d1374fab4d1f9c607c230fd5123d
|
||||
default:
|
||||
close:
|
||||
# Default time to wait before closing the label. Can either be a number in milliseconds
|
||||
# or a string specified by the `ms` package (https://www.npmjs.com/package/ms)
|
||||
delay: "2 days"
|
||||
|
||||
# Default comment to post when an issue is first marked with a closing label
|
||||
comment: "⚠️ This issue has been marked $LABEL and will be closed in $DELAY."
|
||||
|
||||
labels:
|
||||
duplicate: close
|
||||
wontfix: close
|
||||
"squash when passing": merge
|
||||
"rebase when passing": merge
|
||||
"merge when passing": merge
|
||||
"new contributor":
|
||||
action: comment
|
||||
delay: 5s
|
||||
message: "Thanks for making your first contribution! :slightly_smiling_face:"
|
||||
"upstream:vscode":
|
||||
action: close
|
||||
delay: 5s
|
||||
comment: >
|
||||
This issue has been marked as 'upstream:vscode'.
|
||||
Please file this upstream: [link to open issue](https://github.com/microsoft/vscode/issues/new/choose)
|
||||
|
||||
This issue will automatically close in $DELAY.
|
||||
199
.github/workflows/build.yaml
vendored
199
.github/workflows/build.yaml
vendored
@@ -19,12 +19,12 @@ concurrency:
|
||||
# this ensures that it only executes if all previous jobs succeeded.
|
||||
|
||||
# if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
||||
# will skip running `yarn install` if it successfully fetched from cache
|
||||
# will skip running `npm install` if it successfully fetched from cache
|
||||
|
||||
jobs:
|
||||
prettier:
|
||||
name: Format with Prettier
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
@@ -33,11 +33,11 @@ jobs:
|
||||
- name: Run prettier with actionsx/prettier
|
||||
uses: actionsx/prettier@v3
|
||||
with:
|
||||
args: --check --loglevel=warn .
|
||||
args: --check --log-level=warn .
|
||||
|
||||
doctoc:
|
||||
name: Doctoc markdown files
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v44
|
||||
uses: tj-actions/changed-files@v45
|
||||
with:
|
||||
files: |
|
||||
docs/**
|
||||
@@ -55,18 +55,20 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: "yarn"
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
|
||||
- name: Install doctoc
|
||||
run: yarn global add doctoc@2.2.1
|
||||
- if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
|
||||
- name: Run doctoc
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: yarn doctoc
|
||||
- if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: npm run doctoc
|
||||
|
||||
lint-helm:
|
||||
name: Lint Helm chart
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
@@ -76,7 +78,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v44
|
||||
uses: tj-actions/changed-files@v45
|
||||
with:
|
||||
files: |
|
||||
ci/helm-chart/**
|
||||
@@ -87,17 +89,15 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install helm kubeval plugin
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
- if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: helm plugin install https://github.com/instrumenta/helm-kubeval
|
||||
|
||||
- name: Lint Helm chart
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
- if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: helm kubeval ci/helm-chart
|
||||
|
||||
lint-ts:
|
||||
name: Lint TypeScript files
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
@@ -107,7 +107,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v44
|
||||
uses: tj-actions/changed-files@v45
|
||||
with:
|
||||
files: |
|
||||
**/*.ts
|
||||
@@ -120,24 +120,17 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
|
||||
- name: Fetch dependencies from cache
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
id: cache-node-modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
yarn-build-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.changed-files.outputs.any_changed == 'true' && steps.cache-node-modules.outputs.cache-hit != 'true'
|
||||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
||||
- if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
|
||||
- name: Lint TypeScript files
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: yarn lint:ts
|
||||
run: npm run lint:ts
|
||||
|
||||
lint-actions:
|
||||
name: Lint GitHub Actions
|
||||
@@ -147,13 +140,13 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
- name: Check workflow files
|
||||
run: |
|
||||
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/7fdc9630cc360ea1a469eed64ac6d78caeda1234/scripts/download-actionlint.bash)
|
||||
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.1
|
||||
./actionlint -color -shellcheck= -ignore "set-output"
|
||||
shell: bash
|
||||
|
||||
test-unit:
|
||||
name: Run unit tests
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
@@ -163,7 +156,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v44
|
||||
uses: tj-actions/changed-files@v45
|
||||
with:
|
||||
files: |
|
||||
**/*.ts
|
||||
@@ -175,24 +168,16 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
|
||||
- name: Fetch dependencies from cache
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
id: cache-node-modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
yarn-build-
|
||||
- if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.changed-files.outputs.any_changed == 'true' && steps.cache-node-modules.outputs.cache-hit != 'true'
|
||||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
||||
|
||||
- name: Run unit tests
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: yarn test:unit
|
||||
- if: steps.changed-files.outputs.any_changed == 'true'
|
||||
run: npm run test:unit
|
||||
|
||||
- name: Upload coverage report to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
@@ -202,10 +187,11 @@ jobs:
|
||||
|
||||
build:
|
||||
name: Build code-server
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
DISABLE_V8_COMPILE_CACHE: 1
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
@@ -228,29 +214,16 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
|
||||
# node-gyp is missing in (at least) npm 9.8.1.
|
||||
# TODO: Remove once we update to npm>=10?
|
||||
- name: Install node-gyp
|
||||
run: npm install -g node-gyp
|
||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
|
||||
- name: Fetch dependencies from cache
|
||||
id: cache-node-modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: yarn-build-code-server-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
yarn-build-code-server-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
||||
run: yarn --frozen-lockfile
|
||||
|
||||
- name: Build code-server
|
||||
env:
|
||||
- env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: yarn build
|
||||
run: npm run build
|
||||
|
||||
# Get Code's git hash. When this changes it means the content is
|
||||
# different and we need to rebuild.
|
||||
@@ -273,17 +246,19 @@ jobs:
|
||||
env:
|
||||
VERSION: "0.0.0"
|
||||
if: steps.cache-vscode.outputs.cache-hit != 'true'
|
||||
run: yarn build:vscode
|
||||
run: |
|
||||
pushd lib/vscode
|
||||
npm ci
|
||||
popd
|
||||
npm run build:vscode
|
||||
|
||||
# The release package does not contain any native modules
|
||||
# and is neutral to architecture/os/libc version.
|
||||
- name: Create release package
|
||||
run: yarn release
|
||||
- run: npm run release
|
||||
if: success()
|
||||
|
||||
# https://github.com/actions/upload-artifact/issues/38
|
||||
- name: Compress release package
|
||||
run: tar -czf package.tar.gz release
|
||||
- run: tar -czf package.tar.gz release
|
||||
|
||||
- name: Upload npm package artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -294,7 +269,7 @@ jobs:
|
||||
test-e2e:
|
||||
name: Run e2e tests
|
||||
needs: build
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 25
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
@@ -307,38 +282,28 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
|
||||
- name: Fetch dependencies from cache
|
||||
id: cache-node-modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
yarn-build-
|
||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
|
||||
- name: Download npm package
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: npm-package
|
||||
|
||||
- name: Decompress npm package
|
||||
run: tar -xzf package.tar.gz
|
||||
- run: tar -xzf package.tar.gz
|
||||
|
||||
- name: Install release package dependencies
|
||||
run: cd release && npm install --unsafe-perm --omit=dev
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
||||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
||||
- run: cd release && npm install --unsafe-perm --omit=dev
|
||||
|
||||
- name: Install Playwright OS dependencies
|
||||
run: |
|
||||
./test/node_modules/.bin/playwright install-deps
|
||||
./test/node_modules/.bin/playwright install
|
||||
|
||||
- name: Run end-to-end tests
|
||||
run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e
|
||||
- run: CODE_SERVER_TEST_ENTRY=./release npm run test:e2e
|
||||
|
||||
- name: Upload test artifacts
|
||||
if: always()
|
||||
@@ -353,7 +318,7 @@ jobs:
|
||||
test-e2e-proxy:
|
||||
name: Run e2e tests behind proxy
|
||||
needs: build
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 25
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
@@ -366,30 +331,21 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
|
||||
- name: Fetch dependencies from cache
|
||||
id: cache-node-modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
yarn-build-
|
||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
|
||||
- name: Download npm package
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: npm-package
|
||||
|
||||
- name: Decompress npm package
|
||||
run: tar -xzf package.tar.gz
|
||||
- run: tar -xzf package.tar.gz
|
||||
|
||||
- name: Install release package dependencies
|
||||
run: cd release && npm install --unsafe-perm --omit=dev
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
||||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
||||
- run: cd release && npm install --unsafe-perm --omit=dev
|
||||
|
||||
- name: Install Playwright OS dependencies
|
||||
run: |
|
||||
@@ -413,22 +369,15 @@ jobs:
|
||||
mkdir -p ~/.cache/caddy
|
||||
tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
|
||||
|
||||
- name: Start Caddy
|
||||
run: sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
|
||||
- run: sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
|
||||
|
||||
- name: Run end-to-end tests
|
||||
run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e:proxy --global-timeout 840000
|
||||
- run: CODE_SERVER_TEST_ENTRY=./release npm run test:e2e:proxy
|
||||
|
||||
- name: Stop Caddy
|
||||
if: always()
|
||||
- if: always()
|
||||
run: sudo ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
|
||||
|
||||
- name: Upload test artifacts
|
||||
if: always()
|
||||
- if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: failed-test-videos-proxy
|
||||
path: ./test/test-results
|
||||
|
||||
- name: Remove release packages and test artifacts
|
||||
run: rm -rf ./release ./test/test-results
|
||||
|
||||
25
.github/workflows/publish.yaml
vendored
25
.github/workflows/publish.yaml
vendored
@@ -21,8 +21,6 @@ concurrency:
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
# NOTE: this job requires curl, jq and yarn
|
||||
# All of them are included in ubuntu-latest.
|
||||
npm:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@@ -33,25 +31,22 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: "yarn"
|
||||
|
||||
- name: Download npm package from release artifacts
|
||||
uses: robinraju/release-downloader@v1.10
|
||||
uses: robinraju/release-downloader@v1.11
|
||||
with:
|
||||
repository: "coder/code-server"
|
||||
tag: ${{ github.event.inputs.version || github.ref_name }}
|
||||
fileName: "package.tar.gz"
|
||||
out-file-path: "release-npm-package"
|
||||
|
||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
||||
# i.e. v4.9.1 -> 4.9.1
|
||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||
- name: Get and set VERSION
|
||||
run: |
|
||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Publish npm package and tag with "latest"
|
||||
run: yarn publish:npm
|
||||
- run: npm run publish:npm
|
||||
env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -77,8 +72,7 @@ jobs:
|
||||
git config --global user.name cdrci
|
||||
git config --global user.email opensource@coder.com
|
||||
|
||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
||||
# i.e. v4.9.1 -> 4.9.1
|
||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||
- name: Get and set VERSION
|
||||
run: |
|
||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
||||
@@ -124,8 +118,7 @@ jobs:
|
||||
git config --global user.name cdrci
|
||||
git config --global user.email opensource@coder.com
|
||||
|
||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
||||
# i.e. v4.9.1 -> 4.9.1
|
||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||
- name: Get and set VERSION
|
||||
run: |
|
||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
||||
@@ -151,6 +144,7 @@ jobs:
|
||||
git commit -m "chore: updating version to ${{ env.VERSION }}"
|
||||
git push -u origin $(git branch --show)
|
||||
gh pr create --repo coder/code-server-aur --title "chore: bump version to ${{ env.VERSION }}" --body "PR opened by @$GITHUB_ACTOR" --assignee $GITHUB_ACTOR
|
||||
|
||||
docker:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
@@ -176,15 +170,14 @@ jobs:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
||||
# i.e. v4.9.1 -> 4.9.1
|
||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||
- name: Get and set VERSION
|
||||
run: |
|
||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Download deb artifacts
|
||||
uses: robinraju/release-downloader@v1.10
|
||||
uses: robinraju/release-downloader@v1.11
|
||||
with:
|
||||
repository: "coder/code-server"
|
||||
tag: v${{ env.VERSION }}
|
||||
@@ -192,7 +185,7 @@ jobs:
|
||||
out-file-path: "release-packages"
|
||||
|
||||
- name: Download rpm artifacts
|
||||
uses: robinraju/release-downloader@v1.10
|
||||
uses: robinraju/release-downloader@v1.11
|
||||
with:
|
||||
repository: "coder/code-server"
|
||||
tag: v${{ env.VERSION }}
|
||||
|
||||
101
.github/workflows/release.yaml
vendored
101
.github/workflows/release.yaml
vendored
@@ -19,9 +19,6 @@ concurrency:
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
# TODO: cache building yarn --production
|
||||
# possibly 2m30s of savings(?)
|
||||
# this requires refactoring our release scripts
|
||||
package-linux-amd64:
|
||||
name: x86-64 Linux build
|
||||
runs-on: ubuntu-latest
|
||||
@@ -39,6 +36,12 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
|
||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
|
||||
- name: Install development tools
|
||||
run: |
|
||||
@@ -56,25 +59,16 @@ jobs:
|
||||
mv envsubst ~/.local/bin
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Install yarn
|
||||
run: npm install -g yarn
|
||||
|
||||
- name: Download npm package
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: npm-release-package
|
||||
|
||||
- name: Decompress npm package
|
||||
run: tar -xzf package.tar.gz
|
||||
- run: tar -xzf package.tar.gz
|
||||
|
||||
- name: Build standalone release
|
||||
run: npm run release:standalone
|
||||
- run: npm run release:standalone
|
||||
|
||||
- name: Install test dependencies
|
||||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
||||
|
||||
- name: Run integration tests on standalone release
|
||||
run: yarn test:integration
|
||||
- run: npm run test:integration
|
||||
|
||||
- name: Upload coverage report to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
@@ -83,19 +77,17 @@ jobs:
|
||||
if: success()
|
||||
continue-on-error: true
|
||||
|
||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
||||
# i.e. v4.9.1 -> 4.9.1
|
||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||
- name: Get and set VERSION
|
||||
run: |
|
||||
TAG="${{ inputs.version || github.ref_name }}"
|
||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build packages with nfpm
|
||||
env:
|
||||
- env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
run: yarn package
|
||||
run: npm run package
|
||||
|
||||
- uses: softprops/action-gh-release@v2
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
discussion_category_name: "📣 Announcements"
|
||||
@@ -141,6 +133,10 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
|
||||
- name: Install cross-compiler and system dependencies
|
||||
run: |
|
||||
@@ -153,7 +149,10 @@ jobs:
|
||||
libsecret-1-dev:$TARGET_ARCH \
|
||||
libkrb5-dev:$TARGET_ARCH \
|
||||
ca-certificates \
|
||||
curl wget rsync gettext-base
|
||||
curl wget rsync gettext-base \
|
||||
python3
|
||||
|
||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
|
||||
- name: Install nfpm
|
||||
run: |
|
||||
@@ -166,11 +165,8 @@ jobs:
|
||||
with:
|
||||
name: npm-release-package
|
||||
|
||||
- name: Decompress npm package
|
||||
run: tar -xzf package.tar.gz
|
||||
|
||||
- name: Build standalone release
|
||||
run: npm run release:standalone
|
||||
- run: tar -xzf package.tar.gz
|
||||
- run: npm run release:standalone
|
||||
|
||||
- name: Replace node with cross-compile equivalent
|
||||
run: |
|
||||
@@ -179,19 +175,17 @@ jobs:
|
||||
tar -xf node-${node_version}-linux-${npm_config_arch}.tar.xz node-${node_version}-linux-${npm_config_arch}/bin/node --strip-components=2
|
||||
mv ./node ./release-standalone/lib/node
|
||||
|
||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
||||
# i.e. v4.9.1 -> 4.9.1
|
||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||
- name: Get and set VERSION
|
||||
run: |
|
||||
TAG="${{ inputs.version || github.ref_name }}"
|
||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build packages with nfpm
|
||||
env:
|
||||
- env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
run: npm run package ${npm_config_arch}
|
||||
|
||||
- uses: softprops/action-gh-release@v2
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
discussion_category_name: "📣 Announcements"
|
||||
@@ -210,6 +204,12 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
|
||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
|
||||
- name: Install nfpm
|
||||
run: |
|
||||
@@ -221,28 +221,18 @@ jobs:
|
||||
# in Python 3.12. It seems to be fixed in the latest node-gyp so when we
|
||||
# next update Node we can probably remove this. For now, install
|
||||
# setuptools since it contains distutils.
|
||||
- name: Install Python utilities
|
||||
run: brew install python-setuptools
|
||||
- run: brew install python-setuptools
|
||||
|
||||
- name: Download npm package
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: npm-release-package
|
||||
|
||||
- name: Decompress npm package
|
||||
run: tar -xzf package.tar.gz
|
||||
- run: tar -xzf package.tar.gz
|
||||
- run: npm run release:standalone
|
||||
- run: npm run test:native
|
||||
|
||||
- name: Build standalone release
|
||||
run: npm run release:standalone
|
||||
|
||||
- name: Install test dependencies
|
||||
run: SKIP_SUBMODULE_DEPS=1 yarn install
|
||||
|
||||
- name: Run native module tests on standalone release
|
||||
run: yarn test:native
|
||||
|
||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
||||
# i.e. v4.9.1 -> 4.9.1
|
||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||
- name: Get and set VERSION
|
||||
run: |
|
||||
TAG="${{ inputs.version || github.ref_name }}"
|
||||
@@ -251,9 +241,9 @@ jobs:
|
||||
- name: Build packages with nfpm
|
||||
env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
run: yarn package
|
||||
run: npm run package
|
||||
|
||||
- uses: softprops/action-gh-release@v2
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
discussion_category_name: "📣 Announcements"
|
||||
@@ -270,7 +260,7 @@ jobs:
|
||||
with:
|
||||
name: npm-release-package
|
||||
|
||||
- uses: softprops/action-gh-release@v2
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
discussion_category_name: "📣 Announcements"
|
||||
@@ -282,7 +272,7 @@ jobs:
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: dawidd6/action-download-artifact@v3
|
||||
uses: dawidd6/action-download-artifact@v6
|
||||
id: download
|
||||
with:
|
||||
branch: ${{ github.ref }}
|
||||
@@ -292,11 +282,9 @@ jobs:
|
||||
check_artifacts: false
|
||||
if_no_artifact_found: fail
|
||||
|
||||
- name: Decompress npm package
|
||||
run: tar -xzf package.tar.gz
|
||||
- run: tar -xzf package.tar.gz
|
||||
|
||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
||||
# i.e. v4.9.1 -> 4.9.1
|
||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||
- name: Get and set VERSION
|
||||
run: |
|
||||
TAG="${{ inputs.version || github.ref_name }}"
|
||||
@@ -315,8 +303,7 @@ jobs:
|
||||
# Ensure it has the same permissions as before
|
||||
chmod 644 release/lib/vscode/product.json
|
||||
|
||||
- name: Compress release package
|
||||
run: tar -czf package.tar.gz release
|
||||
- run: tar -czf package.tar.gz release
|
||||
|
||||
- name: Upload npm package artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
|
||||
10
.github/workflows/security.yaml
vendored
10
.github/workflows/security.yaml
vendored
@@ -19,7 +19,7 @@ concurrency:
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
audit-ci:
|
||||
audit:
|
||||
name: Audit node modules
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
@@ -34,12 +34,8 @@ jobs:
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
|
||||
- name: Audit yarn for vulnerabilities
|
||||
run: yarn audit
|
||||
if: success()
|
||||
|
||||
- name: Audit npm for vulnerabilities
|
||||
run: npm shrinkwrap && npm audit
|
||||
run: npm audit
|
||||
if: success()
|
||||
|
||||
trivy-scan-repo:
|
||||
@@ -55,7 +51,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Run Trivy vulnerability scanner in repo mode
|
||||
uses: aquasecurity/trivy-action@d710430a6722f083d3b36b8339ff66b32f22ee55
|
||||
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8
|
||||
with:
|
||||
scan-type: "fs"
|
||||
scan-ref: "."
|
||||
|
||||
2
.github/workflows/trivy-docker.yaml
vendored
2
.github/workflows/trivy-docker.yaml
vendored
@@ -51,7 +51,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run Trivy vulnerability scanner in image mode
|
||||
uses: aquasecurity/trivy-action@d710430a6722f083d3b36b8339ff66b32f22ee55
|
||||
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8
|
||||
with:
|
||||
image-ref: "docker.io/codercom/code-server:latest"
|
||||
ignore-unfixed: true
|
||||
|
||||
@@ -1 +1 @@
|
||||
18.18.2
|
||||
20.18.0
|
||||
|
||||
@@ -7,3 +7,4 @@ helm-chart
|
||||
test/scripts
|
||||
test/e2e/extensions/test-extension
|
||||
.pc
|
||||
package-lock.json
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{
|
||||
"file": "package.json",
|
||||
"line": 31,
|
||||
"description": "## Commands\n\nTo start developing, make sure you have Node 16+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> yarn\n\n3. Start development mode (and watch for changes):\n>> yarn watch"
|
||||
"description": "## Commands\n\nTo start developing, make sure you have Node 16+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> npm\n\n3. Start development mode (and watch for changes):\n>> npm run watch"
|
||||
},
|
||||
{
|
||||
"file": "src/node/app.ts",
|
||||
@@ -20,7 +20,7 @@
|
||||
{
|
||||
"file": "src/node/app.ts",
|
||||
"line": 62,
|
||||
"description": "## That's it!\n\n\nThat's all there is to it! When this tour ends, your terminal session may stop, but just use `yarn watch` to start developing from here on out!\n\n\nIf you haven't already, be sure to check out these resources:\n- [Tour: Contributing](command:codetour.startTourByTitle?[\"Contributing\"])\n- [Docs: FAQ.md](https://github.com/coder/code-server/blob/main/docs/FAQ.md)\n- [Docs: CONTRIBUTING.md](https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md)\n- [Community: GitHub Discussions](https://github.com/coder/code-server/discussions)\n- [Community: Slack](https://community.coder.com)"
|
||||
"description": "## That's it!\n\n\nThat's all there is to it! When this tour ends, your terminal session may stop, but just use `npm run watch` to start developing from here on out!\n\n\nIf you haven't already, be sure to check out these resources:\n- [Tour: Contributing](command:codetour.startTourByTitle?[\"Contributing\"])\n- [Docs: FAQ.md](https://github.com/coder/code-server/blob/main/docs/FAQ.md)\n- [Docs: CONTRIBUTING.md](https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md)\n- [Community: GitHub Discussions](https://github.com/coder/code-server/discussions)\n- [Community: Slack](https://community.coder.com)"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
132
CHANGELOG.md
132
CHANGELOG.md
@@ -22,11 +22,121 @@ Code v99.99.999
|
||||
|
||||
## Unreleased
|
||||
|
||||
Code v1.95.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.95.1.
|
||||
|
||||
## [4.93.1](https://github.com/coder/code-server/releases/tag/v4.93.1) - 2024-09-23
|
||||
|
||||
Code v1.93.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.93.1.
|
||||
|
||||
### Added
|
||||
|
||||
- Added `--abs-proxy-base-path` flag for when code-server is not at the root.
|
||||
|
||||
## [4.92.2](https://github.com/coder/code-server/releases/tag/v4.92.2) - 2024-08-19
|
||||
|
||||
Code v1.92.2
|
||||
|
||||
### Breaking changes
|
||||
|
||||
- Dropped a patch that changed the compile target from es2022 to es2020 because
|
||||
it no longer works with the way VS Code uses static properties. This may break
|
||||
older browsers, so those browsers will either have to be updated or use an
|
||||
older version of code-server.
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.92.2.
|
||||
|
||||
## [4.91.0](https://github.com/coder/code-server/releases/tag/v4.91.0) - 2024-07-10
|
||||
|
||||
Code v1.91.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.91.0.
|
||||
|
||||
## [4.90.3](https://github.com/coder/code-server/releases/tag/v4.90.3) - 2024-06-21
|
||||
|
||||
Code v1.90.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.90.2.
|
||||
|
||||
### Fixed
|
||||
|
||||
- When the log gets rotated it will no longer incorrectly be moved to a new
|
||||
directory created in the current working directory named with a date.
|
||||
Instead, the file itself is prepended with the date and kept in the same
|
||||
directory, as originally intended.
|
||||
|
||||
## [4.90.2](https://github.com/coder/code-server/releases/tag/v4.90.2) - 2024-06-14
|
||||
|
||||
Code v1.90.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.90.1.
|
||||
|
||||
## [4.90.1](https://github.com/coder/code-server/releases/tag/v4.90.1) - 2024-06-12
|
||||
|
||||
Code v1.90.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- Cache a call to get CPU information used in telemetry that could result in a
|
||||
lack responsiveness if it was particularly slow.
|
||||
|
||||
## [4.90.0](https://github.com/coder/code-server/releases/tag/v4.90.0) - 2024-06-11
|
||||
|
||||
Code v1.90.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.90.0.
|
||||
- Updated Node to 20.11.1.
|
||||
|
||||
### Added
|
||||
|
||||
- Send contents to the clipboard in the integrated terminal by piping to
|
||||
`code-server --stdin-to-clipboard` or `code-server -c`.
|
||||
|
||||
You may want to make this an alias:
|
||||
|
||||
```
|
||||
alias xclip="code-server --stdin-to-clipboard"
|
||||
echo -n "hello world" | xclip
|
||||
```
|
||||
|
||||
## [4.89.1](https://github.com/coder/code-server/releases/tag/v4.89.1) - 2024-04-14
|
||||
|
||||
Code v1.89.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.89.1.
|
||||
|
||||
## [4.89.0](https://github.com/coder/code-server/releases/tag/v4.89.0) - 2024-04-08
|
||||
|
||||
Code v1.89.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.89.0.
|
||||
|
||||
## [4.23.1](https://github.com/coder/code-server/releases/tag/v4.23.1) - 2024-04-15
|
||||
|
||||
Code v1.88.1
|
||||
|
||||
## Changed
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.88.1.
|
||||
|
||||
@@ -34,12 +144,12 @@ Code v1.88.1
|
||||
|
||||
Code v1.88.0
|
||||
|
||||
## Changed
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.88.0.
|
||||
- Updated Node to 18.18.2.
|
||||
|
||||
## Fixed
|
||||
### Fixed
|
||||
|
||||
- Fix masking the exit code when failing to install extensions on the command
|
||||
line outside the integrated terminal. Installing extensions inside the
|
||||
@@ -49,7 +159,7 @@ Code v1.88.0
|
||||
|
||||
Code v1.87.2
|
||||
|
||||
## Changed
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.87.2.
|
||||
- Enable keep-alive for proxy agent.
|
||||
@@ -58,7 +168,7 @@ Code v1.87.2
|
||||
|
||||
Code v1.87.0
|
||||
|
||||
## Changed
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.87.0.
|
||||
|
||||
@@ -66,7 +176,7 @@ Code v1.87.0
|
||||
|
||||
Code v1.86.2
|
||||
|
||||
## Changed
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.86.2.
|
||||
|
||||
@@ -74,12 +184,12 @@ Code v1.86.2
|
||||
|
||||
Code v1.86.1
|
||||
|
||||
## Changed
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.86.1.
|
||||
- Updated to Node 18.17.1.
|
||||
|
||||
## Added
|
||||
### Added
|
||||
|
||||
- Docker images for Fedora and openSUSE.
|
||||
|
||||
@@ -87,7 +197,7 @@ Code v1.86.1
|
||||
|
||||
Code v1.86.0
|
||||
|
||||
## Changed
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.86.0.
|
||||
|
||||
@@ -95,11 +205,11 @@ Code v1.86.0
|
||||
|
||||
Code v1.85.2
|
||||
|
||||
## Changed
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.85.2.
|
||||
|
||||
## Fixed
|
||||
### Fixed
|
||||
|
||||
- Query variables are no longer double-encoded when going over the path proxy.
|
||||
|
||||
|
||||
42
ci/README.md
42
ci/README.md
@@ -16,20 +16,18 @@ This directory contains scripts used for the development of code-server.
|
||||
|
||||
- [./ci/dev/image](./dev/image)
|
||||
- See [./docs/CONTRIBUTING.md](../docs/CONTRIBUTING.md) for docs on the development container.
|
||||
- [./ci/dev/fmt.sh](./dev/fmt.sh) (`yarn fmt`)
|
||||
- [./ci/dev/fmt.sh](./dev/fmt.sh) (`npm run fmt`)
|
||||
- Runs formatters.
|
||||
- [./ci/dev/lint.sh](./dev/lint.sh) (`yarn lint`)
|
||||
- [./ci/dev/lint.sh](./dev/lint.sh) (`npm run lint`)
|
||||
- Runs linters.
|
||||
- [./ci/dev/test-unit.sh](./dev/test-unit.sh) (`yarn test:unit`)
|
||||
- [./ci/dev/test-unit.sh](./dev/test-unit.sh) (`npm run test:unit`)
|
||||
- Runs unit tests.
|
||||
- [./ci/dev/test-e2e.sh](./dev/test-e2e.sh) (`yarn test:e2e`)
|
||||
- [./ci/dev/test-e2e.sh](./dev/test-e2e.sh) (`npm run test:e2e`)
|
||||
- Runs end-to-end tests.
|
||||
- [./ci/dev/ci.sh](./dev/ci.sh) (`yarn ci`)
|
||||
- Runs `yarn fmt`, `yarn lint` and `yarn test`.
|
||||
- [./ci/dev/watch.ts](./dev/watch.ts) (`yarn watch`)
|
||||
- [./ci/dev/watch.ts](./dev/watch.ts) (`npm run watch`)
|
||||
- Starts a process to build and launch code-server and restart on any code changes.
|
||||
- Example usage in [./docs/CONTRIBUTING.md](../docs/CONTRIBUTING.md).
|
||||
- [./ci/dev/gen_icons.sh](./dev/gen_icons.sh) (`yarn icons`)
|
||||
- [./ci/dev/gen_icons.sh](./dev/gen_icons.sh) (`npm run icons`)
|
||||
- Generates the various icons from a single `.svg` favicon in
|
||||
`src/browser/media/favicon.svg`.
|
||||
- Requires [imagemagick](https://imagemagick.org/index.php)
|
||||
@@ -39,20 +37,20 @@ This directory contains scripts used for the development of code-server.
|
||||
This directory contains the scripts used to build and release code-server.
|
||||
You can disable minification by setting `MINIFY=`.
|
||||
|
||||
- [./ci/build/build-code-server.sh](./build/build-code-server.sh) (`yarn build`)
|
||||
- [./ci/build/build-code-server.sh](./build/build-code-server.sh) (`npm run build`)
|
||||
- Builds code-server into `./out` and bundles the frontend into `./dist`.
|
||||
- [./ci/build/build-vscode.sh](./build/build-vscode.sh) (`yarn build:vscode`)
|
||||
- [./ci/build/build-vscode.sh](./build/build-vscode.sh) (`npm run build:vscode`)
|
||||
- Builds vscode into `./lib/vscode/out-vscode`.
|
||||
- [./ci/build/build-release.sh](./build/build-release.sh) (`yarn release`)
|
||||
- [./ci/build/build-release.sh](./build/build-release.sh) (`npm run release`)
|
||||
- Bundles the output of the above two scripts into a single node module at `./release`.
|
||||
- [./ci/build/clean.sh](./build/clean.sh) (`yarn clean`)
|
||||
- [./ci/build/clean.sh](./build/clean.sh) (`npm run clean`)
|
||||
- Removes all build artifacts.
|
||||
- Useful to do a clean build.
|
||||
- [./ci/build/code-server.sh](./build/code-server.sh)
|
||||
- Copied into standalone releases to run code-server with the bundled node binary.
|
||||
- [./ci/build/test-standalone-release.sh](./build/test-standalone-release.sh) (`yarn test:standalone-release`)
|
||||
- [./ci/build/test-standalone-release.sh](./build/test-standalone-release.sh) (`npm run test:standalone-release`)
|
||||
- Ensures code-server in the `./release-standalone` directory works by installing an extension.
|
||||
- [./ci/build/build-packages.sh](./build/build-packages.sh) (`yarn package`)
|
||||
- [./ci/build/build-packages.sh](./build/build-packages.sh) (`npm run package`)
|
||||
- Packages `./release-standalone` into a `.tar.gz` archive in `./release-packages`.
|
||||
- If on linux, [nfpm](https://github.com/goreleaser/nfpm) is used to generate `.deb` and `.rpm`.
|
||||
- [./ci/build/nfpm.yaml](./build/nfpm.yaml)
|
||||
@@ -61,15 +59,15 @@ You can disable minification by setting `MINIFY=`.
|
||||
- Entrypoint script for code-server for `.deb` and `.rpm`.
|
||||
- [./ci/build/code-server.service](./build/code-server.service)
|
||||
- systemd user service packaged into the `.deb` and `.rpm`.
|
||||
- [./ci/build/release-github-draft.sh](./build/release-github-draft.sh) (`yarn release:github-draft`)
|
||||
- [./ci/build/release-github-draft.sh](./build/release-github-draft.sh) (`npm run release:github-draft`)
|
||||
- Uses [gh](https://github.com/cli/cli) to create a draft release with a template description.
|
||||
- [./ci/build/release-github-assets.sh](./build/release-github-assets.sh) (`yarn release:github-assets`)
|
||||
- [./ci/build/release-github-assets.sh](./build/release-github-assets.sh) (`npm run release:github-assets`)
|
||||
- Downloads the release-package artifacts for the current commit from CI.
|
||||
- Uses [gh](https://github.com/cli/cli) to upload the artifacts to the release
|
||||
specified in `package.json`.
|
||||
- [./ci/build/npm-postinstall.sh](./build/npm-postinstall.sh)
|
||||
- Post install script for the npm package.
|
||||
- Bundled by`yarn release`.
|
||||
- Bundled by`npm run release`.
|
||||
|
||||
## release-image
|
||||
|
||||
@@ -89,15 +87,15 @@ This directory contains the scripts used in CI.
|
||||
Helps avoid clobbering the CI configuration.
|
||||
|
||||
- [./steps/fmt.sh](./steps/fmt.sh)
|
||||
- Runs `yarn fmt`.
|
||||
- Runs `npm run fmt`.
|
||||
- [./steps/lint.sh](./steps/lint.sh)
|
||||
- Runs `yarn lint`.
|
||||
- Runs `npm run lint`.
|
||||
- [./steps/test-unit.sh](./steps/test-unit.sh)
|
||||
- Runs `yarn test:unit`.
|
||||
- Runs `npm run test:unit`.
|
||||
- [./steps/test-integration.sh](./steps/test-integration.sh)
|
||||
- Runs `yarn test:integration`.
|
||||
- Runs `npm run test:integration`.
|
||||
- [./steps/test-e2e.sh](./steps/test-e2e.sh)
|
||||
- Runs `yarn test:e2e`.
|
||||
- Runs `npm run test:e2e`.
|
||||
- [./steps/release.sh](./steps/release.sh)
|
||||
- Runs the release process.
|
||||
- Generates the npm package at `./release`.
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Packages code-server for the current OS and architecture into ./release-packages.
|
||||
# This script assumes that a standalone release is built already into ./release-standalone
|
||||
# Given a platform-specific release found in ./release-standalone, generate an
|
||||
# compressed archives and bundles (as appropriate for the platform) named after
|
||||
# the platform's architecture and OS and place them in ./release-packages and
|
||||
# ./release-gcp.
|
||||
|
||||
main() {
|
||||
cd "$(dirname "${0}")/../.."
|
||||
@@ -50,11 +52,6 @@ release_nfpm() {
|
||||
|
||||
export NFPM_ARCH
|
||||
|
||||
# Code deletes some files from the extension node_modules directory which
|
||||
# leaves broken symlinks in the corresponding .bin directory. nfpm will fail
|
||||
# on these broken symlinks so clean them up.
|
||||
rm -fr "./release-standalone/lib/vscode/extensions/node_modules/.bin"
|
||||
|
||||
PKG_FORMAT="deb"
|
||||
NFPM_ARCH="$(get_nfpm_arch $PKG_FORMAT "$ARCH")"
|
||||
nfpm_config="$(envsubst < ./ci/build/nfpm.yaml)"
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# This script requires vscode to be built with matching MINIFY.
|
||||
# Once both code-server and VS Code have been built, use this script to copy
|
||||
# them into a single directory (./release), prepare the package.json and
|
||||
# product.json, and add shrinkwraps. This results in a generic NPM package that
|
||||
# we published to NPM and also use to compile platform-specific packages.
|
||||
|
||||
# MINIFY controls whether minified vscode is bundled.
|
||||
# MINIFY controls whether minified VS Code is bundled. It must match the value
|
||||
# used when VS Code was built.
|
||||
MINIFY="${MINIFY-true}"
|
||||
|
||||
# KEEP_MODULES controls whether the script cleans all node_modules requiring a yarn install
|
||||
# to run first.
|
||||
# node_modules are not copied by default. Set KEEP_MODULES=1 to copy them.
|
||||
KEEP_MODULES="${KEEP_MODULES-0}"
|
||||
|
||||
main() {
|
||||
@@ -46,7 +49,7 @@ bundle_code_server() {
|
||||
rsync typings/pluginapi.d.ts "$RELEASE_PATH/typings"
|
||||
|
||||
# Adds the commit to package.json
|
||||
jq --slurp '.[0] * .[1]' package.json <(
|
||||
jq --slurp '(.[0] | del(.scripts,.jest,.devDependencies)) * .[1]' package.json <(
|
||||
cat << EOF
|
||||
{
|
||||
"commit": "$(git rev-parse HEAD)",
|
||||
@@ -88,49 +91,50 @@ bundle_vscode() {
|
||||
|
||||
rsync "${rsync_opts[@]}" ./lib/vscode-reh-web-*/ "$VSCODE_OUT_PATH"
|
||||
|
||||
# Use the package.json for the web/remote server. It does not have the right
|
||||
# version though so pull that from the main package.json.
|
||||
jq --slurp '.[0] * {version: .[1].version}' \
|
||||
# Merge the package.json for the web/remote server so we can include
|
||||
# dependencies, since we want to ship this via NPM.
|
||||
jq --slurp '.[0] * .[1]' \
|
||||
"$VSCODE_SRC_PATH/remote/package.json" \
|
||||
"$VSCODE_SRC_PATH/package.json" > "$VSCODE_OUT_PATH/package.json"
|
||||
|
||||
mv "$VSCODE_SRC_PATH/remote/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/npm-shrinkwrap.json"
|
||||
"$VSCODE_OUT_PATH/package.json" > "$VSCODE_OUT_PATH/package.json.merged"
|
||||
mv "$VSCODE_OUT_PATH/package.json.merged" "$VSCODE_OUT_PATH/package.json"
|
||||
cp "$VSCODE_SRC_PATH/remote/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/npm-shrinkwrap.json"
|
||||
|
||||
# Include global extension dependencies as well.
|
||||
rsync "$VSCODE_SRC_PATH/extensions/package.json" "$VSCODE_OUT_PATH/extensions/package.json"
|
||||
mv "$VSCODE_SRC_PATH/extensions/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/extensions/npm-shrinkwrap.json"
|
||||
cp "$VSCODE_SRC_PATH/extensions/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/extensions/npm-shrinkwrap.json"
|
||||
rsync "$VSCODE_SRC_PATH/extensions/postinstall.mjs" "$VSCODE_OUT_PATH/extensions/postinstall.mjs"
|
||||
}
|
||||
|
||||
create_shrinkwraps() {
|
||||
# yarn.lock or package-lock.json files (used to ensure deterministic versions of dependencies) are
|
||||
# not packaged when publishing to the NPM registry.
|
||||
# To ensure deterministic dependency versions (even when code-server is installed with NPM), we create
|
||||
# an npm-shrinkwrap.json file from the currently installed node_modules. This ensures the versions used
|
||||
# from development (that the yarn.lock guarantees) are also the ones installed by end-users.
|
||||
# These will include devDependencies, but those will be ignored when installing globally (for code-server), and
|
||||
# because we use --omit=dev when installing vscode.
|
||||
# package-lock.json files (used to ensure deterministic versions of
|
||||
# dependencies) are not packaged when publishing to the NPM registry.
|
||||
#
|
||||
# To ensure deterministic dependency versions (even when code-server is
|
||||
# installed with NPM), we create an npm-shrinkwrap.json file from the
|
||||
# currently installed node_modules. This ensures the versions used from
|
||||
# development (that the package-lock.json guarantees) are also the ones
|
||||
# installed by end-users. These will include devDependencies, but those will
|
||||
# be ignored when installing globally (for code-server), and because we use
|
||||
# --omit=dev (for VS Code).
|
||||
|
||||
# We first generate the shrinkwrap file for code-server itself - which is the current directory
|
||||
create_shrinkwrap_keeping_yarn_lock
|
||||
# We first generate the shrinkwrap file for code-server itself - which is the
|
||||
# current directory.
|
||||
cp package-lock.json package-lock.json.temp
|
||||
npm shrinkwrap
|
||||
mv package-lock.json.temp package-lock.json
|
||||
|
||||
# Then the shrinkwrap files for the bundled VSCode
|
||||
# Then the shrinkwrap files for the bundled VS Code.
|
||||
pushd "$VSCODE_SRC_PATH/remote/"
|
||||
create_shrinkwrap_keeping_yarn_lock
|
||||
cp package-lock.json package-lock.json.temp
|
||||
npm shrinkwrap
|
||||
mv package-lock.json.temp package-lock.json
|
||||
popd
|
||||
|
||||
pushd "$VSCODE_SRC_PATH/extensions/"
|
||||
create_shrinkwrap_keeping_yarn_lock
|
||||
cp package-lock.json package-lock.json.temp
|
||||
npm shrinkwrap
|
||||
mv package-lock.json.temp package-lock.json
|
||||
popd
|
||||
}
|
||||
|
||||
create_shrinkwrap_keeping_yarn_lock() {
|
||||
# HACK@edvincent: Generating a shrinkwrap alters the yarn.lock which we don't want (with NPM URLs rather than the Yarn URLs)
|
||||
# But to generate a valid shrinkwrap, it has to exist... So we copy it to then restore it
|
||||
cp yarn.lock yarn.lock.temp
|
||||
npm shrinkwrap
|
||||
cp yarn.lock.temp yarn.lock
|
||||
rm yarn.lock.temp
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Once we have an NPM package, use this script to copy it to a separate
|
||||
# directory (./release-standalone) and install the dependencies. This new
|
||||
# directory can then be packaged as a platform-specific release.
|
||||
|
||||
main() {
|
||||
cd "$(dirname "${0}")/../.."
|
||||
|
||||
@@ -9,9 +13,8 @@ main() {
|
||||
rsync "$RELEASE_PATH/" "$RELEASE_PATH-standalone"
|
||||
RELEASE_PATH+=-standalone
|
||||
|
||||
# We cannot get the path to Node from $PATH (for example via `which node`)
|
||||
# because Yarn shims a script called `node` and we would end up just copying
|
||||
# that script. Instead we run Node and have it print its actual path.
|
||||
# Package managers may shim their own "node" wrapper into the PATH, so run
|
||||
# node and ask it for its true path.
|
||||
local node_path
|
||||
node_path="$(node <<< 'console.info(process.execPath)')"
|
||||
|
||||
@@ -24,6 +27,10 @@ main() {
|
||||
|
||||
pushd "$RELEASE_PATH"
|
||||
npm install --unsafe-perm --omit=dev
|
||||
# Code deletes some files from the extension node_modules directory which
|
||||
# leaves broken symlinks in the corresponding .bin directory. nfpm will fail
|
||||
# on these broken symlinks so clean them up.
|
||||
rm -fr "./lib/vscode/extensions/node_modules/.bin"
|
||||
popd
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ main() {
|
||||
|
||||
if [[ ! ${VERSION-} ]]; then
|
||||
echo "VERSION not set. Please set before running this script:"
|
||||
echo "VERSION='0.0.0' yarn build:vscode"
|
||||
echo "VERSION='0.0.0' npm run build:vscode"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -112,7 +112,7 @@ EOF
|
||||
# this because we have an NPM package that could be installed on any platform.
|
||||
# The correct platform dependencies and scripts will be installed as part of
|
||||
# the post-install during `npm install` or when building a standalone release.
|
||||
yarn gulp "vscode-reh-web-linux-x64${MINIFY:+-min}"
|
||||
npm run gulp "vscode-reh-web-linux-x64${MINIFY:+-min}"
|
||||
|
||||
# Reset so if you develop after building you will not be stuck with the wrong
|
||||
# commit (the dev client will use `oss-dev` but the dev server will still use
|
||||
|
||||
@@ -76,8 +76,8 @@ main() {
|
||||
echo "USE AT YOUR OWN RISK!"
|
||||
fi
|
||||
|
||||
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-18}" ]; then
|
||||
echo "ERROR: code-server currently requires node v18."
|
||||
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-20}" ]; then
|
||||
echo "ERROR: code-server currently requires node v20."
|
||||
if [ -n "$FORCE_NODE_VERSION" ]; then
|
||||
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
|
||||
fi
|
||||
@@ -117,14 +117,11 @@ main() {
|
||||
|
||||
install_with_yarn_or_npm() {
|
||||
echo "User agent: ${npm_config_user_agent-none}"
|
||||
# NOTE@edvincent: We want to keep using the package manager that the end-user was using to install the package.
|
||||
# This also ensures that when *we* run `yarn` in the development process, the yarn.lock file is used.
|
||||
# For development we enforce npm, but for installing the package as an
|
||||
# end-user we want to keep using whatever package manager is in use.
|
||||
case "${npm_config_user_agent-}" in
|
||||
npm*)
|
||||
# HACK: NPM's use of semver doesn't like resolving some peerDependencies that vscode (upstream) brings in the form of pre-releases.
|
||||
# The legacy behavior doesn't complain about pre-releases being used, falling back to that for now.
|
||||
# See https://github.com//pull/5071
|
||||
if ! npm install --unsafe-perm --legacy-peer-deps --omit=dev; then
|
||||
if ! npm install --unsafe-perm --omit=dev; then
|
||||
return 1
|
||||
fi
|
||||
;;
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
|
||||
# Prevents integration with moderate or higher vulnerabilities
|
||||
# Docs: https://github.com/IBM/audit-ci#options
|
||||
yarn audit-ci --moderate
|
||||
}
|
||||
|
||||
main "$@"
|
||||
13
ci/dev/ci.sh
13
ci/dev/ci.sh
@@ -1,13 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
|
||||
yarn fmt
|
||||
yarn lint
|
||||
yarn _audit
|
||||
yarn test:unit
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -18,7 +18,7 @@ main() {
|
||||
echo "Files need generation or are formatted incorrectly:"
|
||||
git -c color.ui=always status | grep --color=no '\[31m'
|
||||
echo "Please run the following locally:"
|
||||
echo " yarn doctoc"
|
||||
echo " npm run doctoc"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -3,14 +3,13 @@ set -euo pipefail
|
||||
|
||||
# Install dependencies in $1.
|
||||
install-deps() {
|
||||
local args=(install)
|
||||
local args=()
|
||||
if [[ ${CI-} ]]; then
|
||||
args+=(--frozen-lockfile)
|
||||
args+=(ci)
|
||||
else
|
||||
args+=(install)
|
||||
fi
|
||||
if [[ "$1" == "lib/vscode" ]]; then
|
||||
args+=(--no-default-rc)
|
||||
fi
|
||||
# If there is no package.json then yarn will look upward and end up installing
|
||||
# If there is no package.json then npm will look upward and end up installing
|
||||
# from the root resulting in an infinite loop (this can happen if you have not
|
||||
# checked out the submodule yet for example).
|
||||
if [[ ! -f "$1/package.json" ]]; then
|
||||
@@ -19,7 +18,7 @@ install-deps() {
|
||||
fi
|
||||
pushd "$1"
|
||||
echo "Installing dependencies for $PWD"
|
||||
yarn "${args[@]}"
|
||||
npm "${args[@]}"
|
||||
popd
|
||||
}
|
||||
|
||||
|
||||
3
ci/dev/preinstall.js
Normal file
3
ci/dev/preinstall.js
Normal file
@@ -0,0 +1,3 @@
|
||||
if (process.env.npm_execpath.includes("yarn")) {
|
||||
throw new Error("`yarn` is no longer supported; please use `npm install` instead")
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
set -euo pipefail
|
||||
|
||||
help() {
|
||||
echo >&2 " You can build with 'yarn watch' or you can build a release"
|
||||
echo >&2 " For example: 'yarn build && yarn build:vscode && KEEP_MODULES=1 yarn release'"
|
||||
echo >&2 " Then 'CODE_SERVER_TEST_ENTRY=./release yarn test:e2e'"
|
||||
echo >&2 " You can build with 'npm run watch' or you can build a release"
|
||||
echo >&2 " For example: 'npm run build && npm run build:vscode && KEEP_MODULES=1 npm run release'"
|
||||
echo >&2 " Then 'CODE_SERVER_TEST_ENTRY=./release npm run test:e2e'"
|
||||
echo >&2 " You can manually run that release with 'node ./release'"
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ main() {
|
||||
|
||||
pushd test/e2e/extensions/test-extension
|
||||
echo "Building test extension"
|
||||
yarn build
|
||||
npm run build
|
||||
popd
|
||||
|
||||
local dir="$PWD"
|
||||
@@ -44,7 +44,7 @@ main() {
|
||||
fi
|
||||
|
||||
cd test
|
||||
yarn playwright test "$@"
|
||||
./node_modules/.bin/playwright test "$@"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
set -euo pipefail
|
||||
|
||||
help() {
|
||||
echo >&2 " You can build the standalone release with 'yarn release:standalone'"
|
||||
echo >&2 " You can build the standalone release with 'npm run release:standalone'"
|
||||
echo >&2 " Or you can pass in a custom path."
|
||||
echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' yarn test:integration"
|
||||
echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' npm run test:integration"
|
||||
}
|
||||
|
||||
# Make sure a code-server release works. You can pass in the path otherwise it
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
set -euo pipefail
|
||||
|
||||
help() {
|
||||
echo >&2 " You can build the standalone release with 'yarn release:standalone'"
|
||||
echo >&2 " You can build the standalone release with 'npm run release:standalone'"
|
||||
echo >&2 " Or you can pass in a custom path."
|
||||
echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' yarn test:integration"
|
||||
echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' npm run test:integration"
|
||||
}
|
||||
|
||||
# Make sure a code-server release works. You can pass in the path otherwise it
|
||||
|
||||
@@ -45,9 +45,11 @@ class Watcher {
|
||||
|
||||
private readonly compilers: DevelopmentCompilers = {
|
||||
codeServer: spawn("tsc", ["--watch", "--pretty", "--preserveWatchOutput"], { cwd: this.rootPath }),
|
||||
vscode: spawn("yarn", ["watch"], { cwd: this.paths.vscodeDir }),
|
||||
vscodeWebExtensions: spawn("yarn", ["watch-web"], { cwd: this.paths.vscodeDir }),
|
||||
plugins: this.paths.pluginDir ? spawn("yarn", ["build", "--watch"], { cwd: this.paths.pluginDir }) : undefined,
|
||||
vscode: spawn("npm", ["run", "watch"], { cwd: this.paths.vscodeDir }),
|
||||
vscodeWebExtensions: spawn("npm", ["run", "watch-web"], { cwd: this.paths.vscodeDir }),
|
||||
plugins: this.paths.pluginDir
|
||||
? spawn("npm", ["run", "build", "--watch"], { cwd: this.paths.pluginDir })
|
||||
: undefined,
|
||||
}
|
||||
|
||||
public async initialize(): Promise<void> {
|
||||
|
||||
@@ -15,9 +15,9 @@ type: application
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 3.19.1
|
||||
version: 3.24.0
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
appVersion: 4.23.1
|
||||
appVersion: 4.93.1
|
||||
|
||||
@@ -177,9 +177,12 @@ spec:
|
||||
{{- if .existingClaim }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .existingClaim }}
|
||||
{{- else }}
|
||||
{{- else if .hostPath }}
|
||||
hostPath:
|
||||
path: {{ .hostPath }}
|
||||
type: Directory
|
||||
{{- else }}
|
||||
emptyDir:
|
||||
{{- toYaml .emptyDir | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -6,7 +6,7 @@ replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: codercom/code-server
|
||||
tag: '4.23.1'
|
||||
tag: '4.93.1'
|
||||
pullPolicy: Always
|
||||
|
||||
# Specifies one or more secrets to be used when pulling images from a
|
||||
@@ -190,6 +190,7 @@ extraVolumeMounts: []
|
||||
# readOnly: true
|
||||
# existingClaim: volume-claim
|
||||
# hostPath: ""
|
||||
# emptyDir: {}
|
||||
|
||||
extraConfigmapMounts: []
|
||||
# - name: certs-configmap
|
||||
|
||||
@@ -18,6 +18,7 @@ group "default" {
|
||||
targets = [
|
||||
"code-server-debian-12",
|
||||
"code-server-ubuntu-focal",
|
||||
"code-server-ubuntu-noble",
|
||||
"code-server-fedora-39",
|
||||
"code-server-opensuse-tumbleweed",
|
||||
]
|
||||
@@ -69,6 +70,17 @@ target "code-server-ubuntu-focal" {
|
||||
platforms = ["linux/amd64", "linux/arm64"]
|
||||
}
|
||||
|
||||
target "code-server-ubuntu-noble" {
|
||||
dockerfile = "ci/release-image/Dockerfile"
|
||||
tags = concat(
|
||||
gen_tags_for_docker_and_ghcr("noble"),
|
||||
)
|
||||
args = {
|
||||
BASE = "ubuntu:noble"
|
||||
}
|
||||
platforms = ["linux/amd64", "linux/arm64"]
|
||||
}
|
||||
|
||||
target "code-server-fedora-39" {
|
||||
dockerfile = "ci/release-image/Dockerfile.fedora"
|
||||
tags = concat(
|
||||
|
||||
@@ -7,7 +7,7 @@ eval "$(fixuid -q)"
|
||||
|
||||
if [ "${DOCKER_USER-}" ]; then
|
||||
USER="$DOCKER_USER"
|
||||
if [ "$DOCKER_USER" != "$(whoami)" ]; then
|
||||
if [ -z "$(id -u "$DOCKER_USER" 2>/dev/null)" ]; then
|
||||
echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null
|
||||
# Unfortunately we cannot change $HOME as we cannot move any bind mounts
|
||||
# nor can we bind mount $HOME into a new home as that requires a privileged container.
|
||||
|
||||
@@ -53,11 +53,11 @@ main() {
|
||||
# This string is used to determine how we should tag the npm release.
|
||||
# Environment can be one of three choices:
|
||||
# "development" - this means we tag with the PR number, allowing
|
||||
# a developer to install this version with `yarn add code-server@<pr-number>`
|
||||
# a developer to install this version with `npm install code-server@<pr-number>`
|
||||
# "staging" - this means we tag with `beta`, allowing
|
||||
# a developer to install this version with `yarn add code-server@beta`
|
||||
# a developer to install this version with `npm install code-server@beta`
|
||||
# "production" - this means we tag with `latest` (default), allowing
|
||||
# a developer to install this version with `yarn add code-server@latest`
|
||||
# a developer to install this version with `npm install code-server@latest`
|
||||
if ! is_env_var_set "NPM_ENVIRONMENT"; then
|
||||
echo "NPM_ENVIRONMENT is not set."
|
||||
echo "Determining in script based on GITHUB environment variables."
|
||||
@@ -86,7 +86,7 @@ main() {
|
||||
if [[ "$NPM_ENVIRONMENT" == "production" ]]; then
|
||||
NPM_VERSION="$VERSION"
|
||||
# This means the npm version will be published as "stable"
|
||||
# and installed when a user runs `yarn install code-server`
|
||||
# and installed when a user runs `npm install code-server`
|
||||
NPM_TAG="latest"
|
||||
else
|
||||
COMMIT_SHA="$GITHUB_SHA"
|
||||
@@ -94,7 +94,7 @@ main() {
|
||||
if [[ "$NPM_ENVIRONMENT" == "staging" ]]; then
|
||||
NPM_VERSION="$VERSION-beta-$COMMIT_SHA"
|
||||
# This means the npm version will be tagged with "beta"
|
||||
# and installed when a user runs `yarn install code-server@beta`
|
||||
# and installed when a user runs `npm install code-server@beta`
|
||||
NPM_TAG="beta"
|
||||
PACKAGE_NAME="@coder/code-server-pr"
|
||||
fi
|
||||
@@ -105,7 +105,7 @@ main() {
|
||||
NPM_VERSION="$VERSION-$PR_NUMBER-$COMMIT_SHA"
|
||||
PACKAGE_NAME="@coder/code-server-pr"
|
||||
# This means the npm version will be tagged with "<pr number>"
|
||||
# and installed when a user runs `yarn install code-server@<pr number>`
|
||||
# and installed when a user runs `npm install code-server@<pr number>`
|
||||
NPM_TAG="$PR_NUMBER"
|
||||
fi
|
||||
|
||||
@@ -120,10 +120,7 @@ main() {
|
||||
# Example: "version": "4.0.1-4769-ad7b23cfe6ffd72914e34781ef7721b129a23040"
|
||||
# Example: "version": "4.0.1-beta-ad7b23cfe6ffd72914e34781ef7721b129a23040"
|
||||
pushd release
|
||||
# NOTE@jsjoeio
|
||||
# I originally tried to use `yarn version` but ran into issues and abandoned it.
|
||||
npm version "$NPM_VERSION"
|
||||
# NOTE@jsjoeio
|
||||
# Use the development package name
|
||||
# This is so we don't clutter the code-server versions on npm
|
||||
# with development versions.
|
||||
@@ -134,7 +131,6 @@ main() {
|
||||
popd
|
||||
fi
|
||||
|
||||
# NOTE@jsjoeio
|
||||
# We need to make sure we haven't already published the version.
|
||||
# If we get error, continue with script because we want to publish
|
||||
# If version is valid, we check if we're publishing the same one
|
||||
@@ -144,10 +140,9 @@ main() {
|
||||
return
|
||||
fi
|
||||
|
||||
# NOTE@jsjoeio
|
||||
# Since the dev builds are scoped to @coder
|
||||
# We pass --access public to ensure npm knows it's not private.
|
||||
yarn publish --non-interactive release --tag "$NPM_TAG" --access public
|
||||
npm publish --non-interactive release --tag "$NPM_TAG" --access public
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
|
||||
- [Requirements](#requirements)
|
||||
- [Linux-specific requirements](#linux-specific-requirements)
|
||||
- [Creating pull requests](#creating-pull-requests)
|
||||
- [Commits and commit history](#commits-and-commit-history)
|
||||
- [Development workflow](#development-workflow)
|
||||
- [Version updates to Code](#version-updates-to-code)
|
||||
- [Patching Code](#patching-code)
|
||||
@@ -28,19 +26,16 @@
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
- [Detailed CI and build process docs](../ci)
|
||||
|
||||
## Requirements
|
||||
|
||||
The prerequisites for contributing to code-server are almost the same as those
|
||||
for [VS
|
||||
Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||
for [VS Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||
Here is what is needed:
|
||||
|
||||
- `node` v18.x
|
||||
- `node` v20.x
|
||||
- `git` v2.x or greater
|
||||
- [`git-lfs`](https://git-lfs.github.com)
|
||||
- [`yarn`](https://classic.yarnpkg.com/en/)
|
||||
- [`npm`](https://www.npmjs.com/)
|
||||
- Used to install JS packages and run scripts
|
||||
- [`nfpm`](https://nfpm.goreleaser.com/)
|
||||
- Used to build `.deb` and `.rpm` packages
|
||||
@@ -60,38 +55,23 @@ Here is what is needed:
|
||||
|
||||
### Linux-specific requirements
|
||||
|
||||
If you're developing code-server on Linux, make sure you have installed or install the following dependencies:
|
||||
If you're developing code-server on Linux, make sure you have installed or
|
||||
install the following dependencies:
|
||||
|
||||
```shell
|
||||
sudo apt-get install build-essential g++ libx11-dev libxkbfile-dev libsecret-1-dev libkrb5-dev python-is-python3
|
||||
```
|
||||
|
||||
These are required by Code. See [their Wiki](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites) for more information.
|
||||
|
||||
## Creating pull requests
|
||||
|
||||
Please create a [GitHub Issue](https://github.com/coder/code-server/issues) that
|
||||
includes context for issues that you see. You can skip this if the proposed fix
|
||||
is minor.
|
||||
|
||||
In your pull requests (PR), link to the issue that the PR solves.
|
||||
|
||||
Please ensure that the base of your PR is the **main** branch.
|
||||
|
||||
### Commits and commit history
|
||||
|
||||
We prefer a clean commit history. This means you should squash all fixups and
|
||||
fixup-type commits before asking for a review (e.g., clean up, squash, then force
|
||||
push). If you need help with this, feel free to leave a comment in your PR, and
|
||||
we'll guide you.
|
||||
These are required by Code. See [their Wiki](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites)
|
||||
for more information.
|
||||
|
||||
## Development workflow
|
||||
|
||||
1. `git clone https://github.com/coder/code-server.git` - Clone `code-server`
|
||||
2. `git submodule update --init` - Clone `vscode` submodule
|
||||
3. `quilt push -a` - Apply patches to the `vscode` submodule.
|
||||
4. `yarn` - Install dependencies
|
||||
5. `yarn watch` - Launch code-server localhost:8080. code-server will be live
|
||||
4. `npm install` - Install dependencies
|
||||
5. `npm run watch` - Launch code-server localhost:8080. code-server will be live
|
||||
reloaded when changes are made; the browser needs to be refreshed manually.
|
||||
|
||||
When pulling down changes that include modifications to the patches you will
|
||||
@@ -99,55 +79,62 @@ need to apply them with `quilt`. If you pull down changes that update the
|
||||
`vscode` submodule you will need to run `git submodule update --init` and
|
||||
re-apply the patches.
|
||||
|
||||
When you make a change that affects people deploying the marketplace please
|
||||
update the changelog as part of your PR.
|
||||
|
||||
Note that building code-server takes a very, very long time, and loading it in
|
||||
the browser in development mode also takes a very, very long time.
|
||||
|
||||
Display language (Spanish, etc) support only works in a full build; it will not
|
||||
work in development mode.
|
||||
|
||||
Generally we prefer that PRs be squashed into `main` but you can rebase or merge
|
||||
if it is important to keep the individual commits (make sure to clean up the
|
||||
commits first if you are doing this).
|
||||
|
||||
### Version updates to Code
|
||||
|
||||
1. Update the `lib/vscode` submodule to the desired upstream version branch.
|
||||
1. Remove any patches with `quilt pop -a`.
|
||||
2. Update the `lib/vscode` submodule to the desired upstream version branch.
|
||||
1. `cd lib/vscode && git checkout release/1.66 && cd ../..`
|
||||
2. `git add lib && git commit -m "chore: update Code"`
|
||||
2. Apply the patches (`quilt push -a`) or restore your stashed changes. At this
|
||||
stage you may need to resolve conflicts. For example use `quilt push -f`,
|
||||
manually apply the rejected portions, then `quilt refresh`.
|
||||
3. From the code-server **project root**, run `yarn install`.
|
||||
4. Test code-server locally to make sure everything works.
|
||||
2. `git add lib && git commit -m "chore: update to Code <version>"`
|
||||
3. Apply the patches one at a time (`quilt push`). If the application succeeds
|
||||
but the lines changed, update the patch with `quilt refresh`. If there are
|
||||
conflicts, then force apply with `quilt push -f`, manually add back the
|
||||
rejected code, then run `quilt refresh`.
|
||||
4. From the code-server **project root**, run `npm install`.
|
||||
5. Check the Node.js version that's used by Electron (which is shipped with VS
|
||||
Code. If necessary, update your version of Node.js to match.
|
||||
6. Commit the updated submodule and patches to `code-server`.
|
||||
7. Open a PR.
|
||||
|
||||
Tip: if you're certain all patches are applied correctly and you simply need to
|
||||
refresh, you can use this trick:
|
||||
|
||||
```shell
|
||||
while quilt push; do quilt refresh; done
|
||||
```
|
||||
|
||||
[Source](https://raphaelhertzog.com/2012/08/08/how-to-use-quilt-to-manage-patches-in-debian-packages/)
|
||||
Code. If necessary, update our version of Node.js to match.
|
||||
|
||||
### Patching Code
|
||||
|
||||
0. You can go through the patch stack with `quilt push` and `quilt pop`.
|
||||
1. Create a new patch (`quilt new {name}.diff`) or use an existing patch.
|
||||
1. Add the file(s) you are patching (`quilt add [-P patch] {file}`). A file
|
||||
1. You can go through the patch stack with `quilt push` and `quilt pop`.
|
||||
2. Create a new patch (`quilt new {name}.diff`) or use an existing patch.
|
||||
3. Add the file(s) you are patching (`quilt add [-P patch] {file}`). A file
|
||||
**must** be added before you make changes to it.
|
||||
1. Make your changes. Patches do not need to be independent of each other but
|
||||
4. Make your changes. Patches do not need to be independent of each other but
|
||||
each patch must result in a working code-server without any broken in-between
|
||||
states otherwise they are difficult to test and modify.
|
||||
1. Add your changes to the patch (`quilt refresh`)
|
||||
1. Add a comment in the patch about the reason for the patch and how to
|
||||
5. Add your changes to the patch (`quilt refresh`)
|
||||
6. Add a comment in the patch about the reason for the patch and how to
|
||||
reproduce the behavior it fixes or adds. Every patch should have an e2e test
|
||||
as well.
|
||||
|
||||
### Build
|
||||
|
||||
You can build as follows:
|
||||
You can build a full production as follows:
|
||||
|
||||
```shell
|
||||
yarn build
|
||||
yarn build:vscode
|
||||
yarn release
|
||||
git submodule update --init
|
||||
quilt push -a
|
||||
npm install
|
||||
npm run build
|
||||
VERSION=0.0.0 npm run build:vscode
|
||||
npm run release
|
||||
```
|
||||
|
||||
_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)_
|
||||
This does not keep `node_modules`. If you want them to be kept, use
|
||||
`KEEP_MODULES=1 npm run release`
|
||||
|
||||
Run your build:
|
||||
|
||||
@@ -158,16 +145,16 @@ npm install --omit=dev # Skip if you used KEEP_MODULES=1
|
||||
node .
|
||||
```
|
||||
|
||||
Build the release packages (make sure that you run `yarn release` first):
|
||||
Then, to build the release package:
|
||||
|
||||
```shell
|
||||
yarn release:standalone
|
||||
yarn test:integration
|
||||
yarn package
|
||||
npm run release:standalone
|
||||
npm run test:integration
|
||||
npm run package
|
||||
```
|
||||
|
||||
> On Linux, the currently running distro will become the minimum supported
|
||||
> version. In our GitHub Actions CI, we use CentOS 7 for maximum compatibility.
|
||||
> version. In our GitHub Actions CI, we use CentOS 8 for maximum compatibility.
|
||||
> If you need your builds to support older distros, run the build commands
|
||||
> inside a Docker container with all the build requirements installed.
|
||||
|
||||
@@ -181,27 +168,32 @@ writing, we do this for the following platforms/architectures:
|
||||
- Linux arm7l (.tar.gz)
|
||||
- Linux armhf.deb
|
||||
- Linux armhf.rpm
|
||||
- macOS amd64 (Intel-based)
|
||||
- macOS arm64.tar.gz
|
||||
|
||||
Currently, these are compiled in CI using the `yarn release-standalone` command
|
||||
in the `release.yaml` workflow. We then upload them to the draft release and
|
||||
distribute via GitHub Releases.
|
||||
Currently, these are compiled in CI using the `npm run release:standalone`
|
||||
command in the `release.yaml` workflow. We then upload them to the draft release
|
||||
and distribute via GitHub Releases.
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
#### I see "Forbidden access" when I load code-server in the browser
|
||||
|
||||
This means your patches didn't apply correctly. We have a patch to remove the auth from vanilla Code because we use our own.
|
||||
This means your patches didn't apply correctly. We have a patch to remove the
|
||||
auth from vanilla Code because we use our own.
|
||||
|
||||
Try popping off the patches with `quilt pop -a` and reapplying with `quilt push -a`.
|
||||
Try popping off the patches with `quilt pop -a` and reapplying with `quilt push
|
||||
-a`.
|
||||
|
||||
#### "Can only have one anonymous define call per script"
|
||||
|
||||
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`.
|
||||
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`.
|
||||
|
||||
### Help
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
## Test
|
||||
|
||||
@@ -219,7 +211,9 @@ Our unit tests are written in TypeScript and run using
|
||||
|
||||
These live under [test/unit](../test/unit).
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
### Script tests
|
||||
|
||||
@@ -227,12 +221,14 @@ Our script tests are written in bash and run using [bats](https://github.com/bat
|
||||
|
||||
These tests live under `test/scripts`.
|
||||
|
||||
We use these to test anything related to our scripts (most of which live under `ci`).
|
||||
We use these to test anything related to our scripts (most of which live under
|
||||
`ci`).
|
||||
|
||||
### Integration tests
|
||||
|
||||
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
|
||||
platforms.
|
||||
These are a work in progress. We build code-server and run tests with `npm run
|
||||
test:integration`, which ensures that code-server builds work on their
|
||||
respective platforms.
|
||||
|
||||
Our integration tests look at components that rely on one another. For example,
|
||||
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
|
||||
We also have a model where you can create helpers to use within tests. See
|
||||
[models/CodeServer.ts](../test/e2e/models/CodeServer.ts) for an example.
|
||||
|
||||
Generally speaking, e2e means testing code-server while running in the browser
|
||||
and interacting with it in a way that's 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.
|
||||
|
||||
## Structure
|
||||
|
||||
The `code-server` script serves as an HTTP API for login and starting a remote
|
||||
Code process.
|
||||
code-server essentially serves as an HTTP API for logging in and starting a
|
||||
remote Code process.
|
||||
|
||||
The CLI code is in [src/node](../src/node) and the HTTP routes are implemented
|
||||
in [src/node/routes](../src/node/routes).
|
||||
|
||||
20
docs/FAQ.md
20
docs/FAQ.md
@@ -37,6 +37,7 @@
|
||||
- [How do I hide the coder/coder promotion in Help: Getting Started?](#how-do-i-hide-the-codercoder-promotion-in-help-getting-started)
|
||||
- [How do I disable the proxy?](#how-do-i-disable-the-proxy)
|
||||
- [How do I disable file download?](#how-do-i-disable-file-download)
|
||||
- [Why do web views not work?](#why-do-web-views-not-work)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- prettier-ignore-end -->
|
||||
@@ -487,3 +488,22 @@ when using the option.
|
||||
## How do I disable file download?
|
||||
|
||||
You can pass the flag `--disable-file-downloads` to `code-server`
|
||||
|
||||
## Why do web views not work?
|
||||
|
||||
Web views rely on service workers, and service workers are only available in a
|
||||
secure context, so most likely the answer is that you are using an insecure
|
||||
context (for example an IP address).
|
||||
|
||||
If this happens, in the browser log you will see something like:
|
||||
|
||||
> Error loading webview: Error: Could not register service workers: SecurityError: Failed to register a ServiceWorker for scope with script: An SSL certificate error occurred when fetching the script..
|
||||
|
||||
To fix this, you must either:
|
||||
|
||||
- Access over localhost/127.0.0.1 which is always considered secure.
|
||||
- Use a domain with a real certificate (for example with Let's Encrypt).
|
||||
- Use a trusted self-signed certificate with [mkcert](https://mkcert.dev) (or
|
||||
create and trust a certificate manually).
|
||||
- Disable security if your browser allows it. For example, in Chromium see
|
||||
`chrome://flags/#unsafely-treat-insecure-origin-as-secure`
|
||||
|
||||
@@ -3,24 +3,13 @@
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# Maintaining
|
||||
|
||||
- [Team](#team)
|
||||
- [Onboarding](#onboarding)
|
||||
- [Offboarding](#offboarding)
|
||||
- [Workflow](#workflow)
|
||||
- [Milestones](#milestones)
|
||||
- [Triage](#triage)
|
||||
- [Versioning](#versioning)
|
||||
- [Pull requests](#pull-requests)
|
||||
- [Merge strategies](#merge-strategies)
|
||||
- [Changelog](#changelog)
|
||||
- [Releases](#releases)
|
||||
- [Publishing a release](#publishing-a-release)
|
||||
- [Releasing](#releasing)
|
||||
- [Release Candidates](#release-candidates)
|
||||
- [AUR](#aur)
|
||||
- [Docker](#docker)
|
||||
- [Homebrew](#homebrew)
|
||||
- [nixpkgs](#nixpkgs)
|
||||
- [npm](#npm)
|
||||
- [Syncing with upstream Code](#syncing-with-upstream-code)
|
||||
- [Testing](#testing)
|
||||
- [Documentation](#documentation)
|
||||
- [Troubleshooting](#troubleshooting)
|
||||
@@ -28,131 +17,30 @@
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
This document is meant to serve current and future maintainers of code-server,
|
||||
as well as share our workflow for maintaining the project.
|
||||
We keep code-server up to date with VS Code releases (there are usually two or
|
||||
three a month) but we are not generally actively developing code-server aside
|
||||
from fixing regressions.
|
||||
|
||||
## Team
|
||||
Most of the work is keeping on top of issues and discussions.
|
||||
|
||||
Current maintainers:
|
||||
## Releasing
|
||||
|
||||
- @code-asher
|
||||
- @jsjoeio
|
||||
|
||||
Occasionally, other Coder employees may step in time to time to assist with code-server.
|
||||
|
||||
### Onboarding
|
||||
|
||||
To onboard a new maintainer to the project, please make sure to do the following:
|
||||
|
||||
- [ ] Add to [coder/code-server](https://github.com/orgs/coder/teams/code-server)
|
||||
- [ ] Add as Admin under [Repository Settings > Access](https://github.com/coder/code-server/settings/access)
|
||||
- [ ] Add to [npm Coder org](https://www.npmjs.com/org/coder)
|
||||
- [ ] Add as [AUR maintainer](https://aur.archlinux.org/packages/code-server/) (talk to Colin)
|
||||
- [ ] Introduce to community via Discussion (see [example](https://github.com/coder/code-server/discussions/3955))
|
||||
|
||||
### Offboarding
|
||||
|
||||
Very similar to Onboarding but Remove maintainer from all teams and revoke access. Please also do the following:
|
||||
|
||||
- [ ] Write farewell post via Discussion (see [example](https://github.com/coder/code-server/discussions/3933))
|
||||
|
||||
## Workflow
|
||||
|
||||
The workflow used by code-server maintainers aims to be easy to understood by
|
||||
the community and easy enough for new maintainers to jump in and start
|
||||
contributing on day one.
|
||||
|
||||
### Milestones
|
||||
|
||||
We operate mainly using
|
||||
[milestones](https://github.com/coder/code-server/milestones). This was heavily
|
||||
inspired by our friends over at [vscode](https://github.com/microsoft/vscode).
|
||||
|
||||
Here are the milestones we use and how we use them:
|
||||
|
||||
- "Backlog" -> Work not yet planned for a specific release.
|
||||
- "On Deck" -> Work under consideration for upcoming milestones.
|
||||
- "Backlog Candidates" -> Work that is not yet accepted for the backlog. We wait
|
||||
for the community to weigh in.
|
||||
- "<Month>" -> Work to be done for said month.
|
||||
|
||||
With this flow, any un-assigned issues are essentially in triage state. Once
|
||||
triaged, issues are either "Backlog" or "Backlog Candidates". They will
|
||||
eventually move to "On Deck" (or be closed). Lastly, they will end up on a
|
||||
version milestone where they will be worked on.
|
||||
|
||||
### Triage
|
||||
|
||||
We use the following process for triaging GitHub issues:
|
||||
|
||||
1. Create an issue
|
||||
1. Add appropriate labels to the issue (including "needs-investigation" if we
|
||||
should look into it further)
|
||||
1. Add the issue to a milestone
|
||||
1. If it should be fixed soon, add to version milestone or "On Deck"
|
||||
2. If not urgent, add to "Backlog"
|
||||
3. Otherwise, add to "Backlog Candidate" for future consideration
|
||||
|
||||
## Versioning
|
||||
|
||||
`<major.minor.patch>`
|
||||
|
||||
The code-server project follows traditional [semantic
|
||||
versioning](https://semver.org/), with the objective of minimizing major changes
|
||||
that break backward compatibility. We increment the patch level for all
|
||||
releases, except when the upstream Visual Studio Code project increments its
|
||||
minor version or we change the plugin API in a backward-compatible manner. In
|
||||
those cases, we increment the minor version rather than the patch level.
|
||||
|
||||
## Pull requests
|
||||
|
||||
Ideally, every PR should fix an issue. If it doesn't, make sure it's associated
|
||||
with a version milestone.
|
||||
|
||||
If a PR does fix an issue, don't add it to the version milestone. Otherwise, the
|
||||
version milestone will have duplicate information: the issue and the PR fixing
|
||||
the issue.
|
||||
|
||||
### Merge strategies
|
||||
|
||||
For most things, we recommend the **squash and merge** strategy. There
|
||||
may be times where **creating a merge commit** makes sense as well. Use your
|
||||
best judgment. If you're unsure, you can always discuss in the PR with the team.
|
||||
|
||||
### Changelog
|
||||
|
||||
To save time when creating a new release for code-server, we keep a running
|
||||
changelog at `CHANGELOG.md`.
|
||||
|
||||
If either the author or reviewer of a PR believes the change should be mentioned
|
||||
in the changelog, then it should be added.
|
||||
|
||||
If there is not a **Next Version** when you modify `CHANGELOG.md`, please add it
|
||||
using the template you see near the top of the changelog.
|
||||
|
||||
When writing your changelog item, ask yourself:
|
||||
|
||||
1. How do these changes affect code-server users?
|
||||
2. What actions do they need to take (if any)?
|
||||
|
||||
If you need inspiration, we suggest looking at the [Emacs
|
||||
changelog](https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS).
|
||||
|
||||
## Releases
|
||||
|
||||
### Publishing a release
|
||||
|
||||
1. Go to GitHub Actions > Draft release > Run workflow on the commit you want to
|
||||
1. Check that the changelog lists all the important changes.
|
||||
2. Make sure the changelog entry lists the current version of VS Code.
|
||||
3. Update the changelog with the release date.
|
||||
4. Go to GitHub Actions > Draft release > Run workflow on the commit you want to
|
||||
release. Make sure CI has finished the build workflow on that commit or this
|
||||
will fail.
|
||||
2. CI will automatically grab the build artifact on that commit, inject the
|
||||
version into the `package.json`, put together platform-specific packages, and
|
||||
upload those packages to a draft release.
|
||||
3. Summarize the major changes in the `CHANGELOG.md`.
|
||||
4. Copy the relevant changelog section to the release then publish it.
|
||||
5. CI will automatically publish the NPM package, Docker image, and update
|
||||
Homebrew using the published release assets.
|
||||
6. Bump the chart version in `Chart.yaml` and merge in the changelog updates.
|
||||
will fail. For the version we match VS Code's minor and patch version. The
|
||||
patch number may become temporarily out of sync if we need to put out a
|
||||
patch, but if we make our own minor change then we will not release it until
|
||||
the next minor VS Code release.
|
||||
5. CI will automatically grab the build artifact on that commit (which is why CI
|
||||
has to have completed), inject the provided version into the `package.json`,
|
||||
put together platform-specific packages, and upload those packages to a draft
|
||||
release.
|
||||
6. Update the resulting draft release with the changelog contents.
|
||||
7. Publish the draft release after validating it.
|
||||
8. Bump the Helm chart version once the Docker images have published.
|
||||
|
||||
#### Release Candidates
|
||||
|
||||
@@ -186,37 +74,44 @@ This is currently automated with the release process (but may fail occasionally)
|
||||
brew bump-formula-pr --version="${VERSION}" code-server --no-browse --no-audit
|
||||
```
|
||||
|
||||
#### nixpkgs
|
||||
|
||||
We publish code-server in nixpkgs but it must be updated manually.
|
||||
|
||||
#### npm
|
||||
|
||||
We publish code-server as a npm package [here](https://www.npmjs.com/package/code-server/v/latest).
|
||||
|
||||
This is currently automated with the release process.
|
||||
|
||||
## Syncing with upstream Code
|
||||
|
||||
Refer to the [contributing docs](https://coder.com/docs/code-server/latest/CONTRIBUTING#version-updates-to-code) for information on how to update Code within code-server.
|
||||
|
||||
## Testing
|
||||
|
||||
Our testing structure is laid out under our [Contributing docs](https://coder.com/docs/code-server/latest/CONTRIBUTING#test).
|
||||
|
||||
We hope to eventually hit 100% test coverage with our unit tests, and maybe one day our scripts (coverage not tracked currently).
|
||||
|
||||
If you're ever looking to add more tests, here are a few ways to get started:
|
||||
|
||||
- run `yarn test:unit` and look at the coverage chart. You'll see all the uncovered lines. This is a good place to start.
|
||||
- look at `test/scripts` to see which scripts are tested. We can always use more tests there.
|
||||
- run `npm run test:unit` and look at the coverage chart. You'll see all the
|
||||
uncovered lines. This is a good place to start.
|
||||
- look at `test/scripts` to see which scripts are tested. We can always use more
|
||||
tests there.
|
||||
- look at `test/e2e`. We can always use more end-to-end tests.
|
||||
|
||||
Otherwise, talk to a current maintainer and ask which part of the codebase is lacking most when it comes to tests.
|
||||
Otherwise, talk to a current maintainer and ask which part of the codebase is
|
||||
lacking most when it comes to tests.
|
||||
|
||||
## Documentation
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
Our docs are hosted on [Vercel](https://vercel.com/). Vercel only shows logs in realtime, which means you need to have the logs open in one tab and reproduce your error in another tab. Since our logs are private to Coder the organization, you can only follow these steps if you're a Coder employee. Ask a maintainer for help if you need it.
|
||||
Our docs are hosted on [Vercel](https://vercel.com/). Vercel only shows logs in
|
||||
realtime, which means you need to have the logs open in one tab and reproduce
|
||||
your error in another tab. Since our logs are private to Coder the organization,
|
||||
you can only follow these steps if you're a Coder employee. Ask a maintainer for
|
||||
help if you need it.
|
||||
|
||||
Taking a real scenario, let's say you wanted to troubleshoot [this docs change](https://github.com/coder/code-server/pull/4042). Here is how you would do it:
|
||||
Taking a real scenario, let's say you wanted to troubleshoot [this docs
|
||||
change](https://github.com/coder/code-server/pull/4042). Here is how you would
|
||||
do it:
|
||||
|
||||
1. Go to https://vercel.com/codercom/codercom
|
||||
2. Click "View Function Logs"
|
||||
|
||||
@@ -17,10 +17,8 @@ We use the following tools to help us stay on top of vulnerability mitigation.
|
||||
- Comprehensive vulnerability scanner that runs on PRs into the default
|
||||
branch and scans both our container image and repository code (see
|
||||
`trivy-scan-repo` and `trivy-scan-image` jobs in `build.yaml`)
|
||||
- [`audit-ci`](https://github.com/IBM/audit-ci)
|
||||
- Audits npm and Yarn dependencies in CI (see `Audit for vulnerabilities` step
|
||||
in `build.yaml`) on PRs into the default branch and fails CI if moderate or
|
||||
higher vulnerabilities (see the `audit.sh` script) are present.
|
||||
- `npm audit`
|
||||
- Audits NPM dependencies.
|
||||
|
||||
## Supported Versions
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
|
||||
```
|
||||
|
||||
6. Exit the terminal using `exit` and then reopen the terminal
|
||||
7. Install and use Node.js 18:
|
||||
7. Install and use Node.js 20:
|
||||
|
||||
```shell
|
||||
nvm install 18
|
||||
|
||||
@@ -20,9 +20,7 @@
|
||||
- [Proxying to a Vue app](#proxying-to-a-vue-app)
|
||||
- [Proxying to an Angular app](#proxying-to-an-angular-app)
|
||||
- [Proxying to a Svelte app](#proxying-to-a-svelte-app)
|
||||
- [SSH into code-server on VS Code](#ssh-into-code-server-on-vs-code)
|
||||
- [Option 1: cloudflared tunnel](#option-1-cloudflared-tunnel)
|
||||
- [Option 2: ngrok tunnel](#option-2-ngrok-tunnel)
|
||||
- [Prefixing `/absproxy/<port>` with a path](#prefixing-absproxyport-with-a-path)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- prettier-ignore-end -->
|
||||
@@ -436,92 +434,11 @@ const config = {
|
||||
|
||||
For additional context, see [this Github Issue](https://github.com/sveltejs/kit/issues/2958)
|
||||
|
||||
## SSH into code-server on VS Code
|
||||
### Prefixing `/absproxy/<port>` with a path
|
||||
|
||||
[](https://ohmyz.sh/) [](https://img.shields.io/badge/Terminal-2E2E2E?style=for-the-badge&logo=Windows+Terminal&logoColor=ffffff) [](vscode:extension/ms-vscode-remote.remote-ssh)
|
||||
This is a case where you need to serve an application via `absproxy` as explained above while serving `codeserver` itself from a path other than the root in your domain.
|
||||
|
||||
Follow these steps where code-server is running:
|
||||
For example: `http://my-code-server.com/user/123/workspace/my-app`. To achieve this result:
|
||||
|
||||
1. Install `openssh-server`, `wget`, and `unzip`.
|
||||
|
||||
```bash
|
||||
# example for Debian and Ubuntu operating systems
|
||||
sudo apt update
|
||||
sudo apt install wget unzip openssh-server
|
||||
```
|
||||
|
||||
2. Start the SSH server and set the password for your user, if you haven't already. If you use [deploy-code-server](https://github.com/coder/deploy-code-server),
|
||||
|
||||
```bash
|
||||
sudo service ssh start
|
||||
sudo passwd {user} # replace user with your code-server user
|
||||
```
|
||||
|
||||
### Option 1: cloudflared tunnel
|
||||
|
||||
[](https://github.com/cloudflare/cloudflared)
|
||||
|
||||
1. Install [cloudflared](https://github.com/cloudflare/cloudflared#installing-cloudflared) on your local computer and remote server
|
||||
2. Then go to `~/.ssh/config` and add the following on your local computer:
|
||||
|
||||
```shell
|
||||
Host *.trycloudflare.com
|
||||
HostName %h
|
||||
User user
|
||||
Port 22
|
||||
ProxyCommand "cloudflared location" access ssh --hostname %h
|
||||
```
|
||||
|
||||
3. Run `cloudflared tunnel --url ssh://localhost:22` on the remote server
|
||||
|
||||
4. Finally on VS Code or any IDE that supports SSH, run `ssh user@https://your-link.trycloudflare.com` or `ssh user@your-link.trycloudflare.com`
|
||||
|
||||
### Option 2: ngrok tunnel
|
||||
|
||||
[](https://ngrok.com/)
|
||||
|
||||
1. Make a new account for ngrok [here](https://dashboard.ngrok.com/login)
|
||||
|
||||
2. Now, get the ngrok binary with `wget` and unzip it with `unzip`:
|
||||
|
||||
```bash
|
||||
wget "https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip"
|
||||
unzip "ngrok-stable-linux-amd64.zip"
|
||||
```
|
||||
|
||||
5. Then, go to [dashboard.ngrok.com](https://dashboard.ngrok.com) and go to the `Your Authtoken` section.
|
||||
6. Copy the Authtoken shown there.
|
||||
7. Now, go to the folder where you unzipped ngrok and store the Authtoken from the ngrok Dashboard.
|
||||
|
||||
```bash
|
||||
./ngrok authtoken YOUR_AUTHTOKEN # replace YOUR_AUTHTOKEN with the ngrok authtoken.
|
||||
```
|
||||
|
||||
8. Now, forward port 22, which is the SSH port with this command:
|
||||
|
||||
```bash
|
||||
./ngrok tcp 22
|
||||
```
|
||||
|
||||
Now, you get a screen in the terminal like this:
|
||||
|
||||
```console
|
||||
ngrok by @inconshreveable(Ctrl+C to quit)
|
||||
|
||||
Session Status online
|
||||
Account {Your name} (Plan: Free)
|
||||
Version 2.3.40
|
||||
Region United States (us)
|
||||
Web Interface http://127.0.0.1:4040
|
||||
Forwarding tcp://0.tcp.ngrok.io:19028 -> localhost:22
|
||||
```
|
||||
|
||||
In this case, copy the forwarded link `0.tcp.ngrok.io` and remember the port number `19028`. Type this on your local Visual Studio Code:
|
||||
|
||||
```bash
|
||||
ssh user@0.tcp.ngrok.io -p 19028
|
||||
```
|
||||
|
||||
The port redirects you to the default SSH port 22, and you can then successfully connect to code-server by entering the password you set for the user.
|
||||
|
||||
Note: the port and the url provided by ngrok will change each time you run it so modify as needed.
|
||||
1. Start code server with the switch `--abs-proxy-base-path=/user/123/workspace`
|
||||
2. Follow one of the instructions above for your framework.
|
||||
|
||||
@@ -30,7 +30,7 @@ includes installing instructions based on your operating system.
|
||||
## Node.js version
|
||||
|
||||
We use the same major version of Node.js shipped with Code's remote, which is
|
||||
currently `18.x`. VS Code also [lists Node.js
|
||||
currently `20.x`. VS Code also [lists Node.js
|
||||
requirements](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||
|
||||
Using other versions of Node.js [may lead to unexpected
|
||||
@@ -79,7 +79,7 @@ Proceed to [installing](#installing)
|
||||
## FreeBSD
|
||||
|
||||
```sh
|
||||
pkg install -y git python npm-node18 pkgconf
|
||||
pkg install -y git python npm-node20 pkgconf
|
||||
pkg install -y libinotify
|
||||
```
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ npm config set python python3
|
||||
node -v
|
||||
```
|
||||
|
||||
you will get Node version `v18`
|
||||
you will get Node version `v20`
|
||||
|
||||
5. Now install code-server following our guide on [installing with npm](./npm.md)
|
||||
|
||||
|
||||
84
eslint.config.mjs
Normal file
84
eslint.config.mjs
Normal file
@@ -0,0 +1,84 @@
|
||||
import { fixupConfigRules } from "@eslint/compat"
|
||||
import globals from "globals"
|
||||
import tsParser from "@typescript-eslint/parser"
|
||||
import path from "node:path"
|
||||
import { fileURLToPath } from "node:url"
|
||||
import js from "@eslint/js"
|
||||
import { FlatCompat } from "@eslint/eslintrc"
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all,
|
||||
})
|
||||
|
||||
export default [
|
||||
...fixupConfigRules(
|
||||
compat.extends(
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:import/recommended",
|
||||
"plugin:import/typescript",
|
||||
"plugin:prettier/recommended",
|
||||
"prettier",
|
||||
),
|
||||
),
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.jest,
|
||||
...globals.node,
|
||||
},
|
||||
|
||||
parser: tsParser,
|
||||
ecmaVersion: 2018,
|
||||
sourceType: "module",
|
||||
},
|
||||
|
||||
settings: {
|
||||
"import/resolver": {
|
||||
typescript: {
|
||||
alwaysTryTypes: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
rules: {
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
args: "none",
|
||||
},
|
||||
],
|
||||
|
||||
"no-dupe-class-members": "off",
|
||||
"@typescript-eslint/no-use-before-define": "off",
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
"@typescript-eslint/ban-types": "off",
|
||||
"@typescript-eslint/no-var-requires": "off",
|
||||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-extra-semi": "off",
|
||||
"@typescript-eslint/no-require-imports": "off",
|
||||
"@typescript-eslint/no-unused-vars": "off", // TODO: Fix these.
|
||||
"@typescript-eslint/no-empty-object-type": "off",
|
||||
eqeqeq: "error",
|
||||
|
||||
"import/order": [
|
||||
"error",
|
||||
{
|
||||
alphabetize: {
|
||||
order: "asc",
|
||||
},
|
||||
|
||||
groups: [["builtin", "external", "internal"], "parent", "sibling"],
|
||||
},
|
||||
],
|
||||
|
||||
"no-async-promise-executor": "off",
|
||||
},
|
||||
},
|
||||
]
|
||||
20
flake.lock
generated
20
flake.lock
generated
@@ -5,11 +5,11 @@
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1681202837,
|
||||
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||
"lastModified": 1726560853,
|
||||
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -20,16 +20,18 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1683594133,
|
||||
"narHash": "sha256-iUhLhEAgOCnexSGDsYT2ouydis09uDoNzM7UC685XGE=",
|
||||
"owner": "NixOS",
|
||||
"lastModified": 1730359060,
|
||||
"narHash": "sha256-Hkk0mf4pgvX9Ut0YA397nsFqMLhzFVBdFHc4PhBrxYE=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8d447c5626cfefb9b129d5b30103344377fe09bc",
|
||||
"rev": "e19cfce6f3f08d07653157d8826f5c920c770d7b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable-small",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
|
||||
19
flake.nix
19
flake.nix
@@ -1,18 +1,29 @@
|
||||
{
|
||||
description = "code-server";
|
||||
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem
|
||||
(system:
|
||||
let pkgs = nixpkgs.legacyPackages.${system};
|
||||
nodejs = pkgs.nodejs-18_x;
|
||||
yarn' = pkgs.yarn.override { inherit nodejs; };
|
||||
nodejs = pkgs.nodejs_20;
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
nodejs yarn' python3 pkg-config git rsync jq moreutils quilt bats openssl
|
||||
nodejs
|
||||
python3
|
||||
pkg-config
|
||||
git
|
||||
rsync
|
||||
jq
|
||||
moreutils
|
||||
quilt
|
||||
bats
|
||||
openssl
|
||||
];
|
||||
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret libkrb5 ]
|
||||
++ (with xorg; [ libX11 libxkbfile ])
|
||||
|
||||
12
install.sh
12
install.sh
@@ -424,7 +424,7 @@ install_standalone() {
|
||||
}
|
||||
|
||||
install_npm() {
|
||||
echoh "Installing latest from npm."
|
||||
echoh "Installing v$VERSION from npm."
|
||||
echoh
|
||||
|
||||
NPM_PATH="${YARN_PATH-npm}"
|
||||
@@ -436,12 +436,12 @@ install_npm() {
|
||||
fi
|
||||
echoh "Installing with npm."
|
||||
echoh
|
||||
"$sh_c" "$NPM_PATH" install -g code-server --unsafe-perm
|
||||
"$sh_c" "$NPM_PATH" install -g "code-server@$VERSION" --unsafe-perm
|
||||
NPM_BIN_DIR="\$($NPM_PATH bin -g)" echo_npm_postinstall
|
||||
return
|
||||
fi
|
||||
echoerr "Please install npm to install code-server!"
|
||||
echoerr "You will need at least node v18 and a few C dependencies."
|
||||
echoerr "You will need at least node v20 and a few C dependencies."
|
||||
echoerr "See the docs https://coder.com/docs/code-server/latest/install#npm"
|
||||
|
||||
exit 1
|
||||
@@ -461,9 +461,9 @@ npm_fallback() {
|
||||
# Determine if we have standalone releases on GitHub for the system's arch.
|
||||
has_standalone() {
|
||||
case $ARCH in
|
||||
amd64) return 0 ;;
|
||||
# We only have amd64 for macOS.
|
||||
arm64)
|
||||
arm64) return 0 ;;
|
||||
# We only have arm64 for macOS.
|
||||
amd64)
|
||||
[ "$(distro)" != macos ]
|
||||
return
|
||||
;;
|
||||
|
||||
Submodule lib/vscode updated: b58957e67e...65edc49398
6158
package-lock.json
generated
Normal file
6158
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
32
package.json
32
package.json
@@ -23,47 +23,49 @@
|
||||
"test:native": "./ci/dev/test-native.sh",
|
||||
"test:scripts": "./ci/dev/test-scripts.sh",
|
||||
"package": "./ci/build/build-packages.sh",
|
||||
"prettier": "prettier --write --loglevel=warn --cache .",
|
||||
"prettier": "prettier --write --log-level=warn --cache .",
|
||||
"preinstall": "node ./ci/dev/preinstall.js",
|
||||
"postinstall": "./ci/dev/postinstall.sh",
|
||||
"publish:npm": "./ci/steps/publish-npm.sh",
|
||||
"publish:docker": "./ci/steps/docker-buildx-push.sh",
|
||||
"_audit": "./ci/dev/audit.sh",
|
||||
"fmt": "yarn prettier && ./ci/dev/doctoc.sh",
|
||||
"fmt": "npm run prettier && ./ci/dev/doctoc.sh",
|
||||
"lint:scripts": "./ci/dev/lint-scripts.sh",
|
||||
"lint:ts": "eslint --max-warnings=0 --fix $(git ls-files '*.ts' '*.js' | grep -v 'lib/vscode')",
|
||||
"test": "echo 'Run yarn test:unit or yarn test:e2e' && exit 1",
|
||||
"ci": "./ci/dev/ci.sh",
|
||||
"lint:ts": "eslint --max-warnings=0 --fix $(git ls-files '*.ts' '*.js' | grep -v 'lib/vscode' | grep -v test-plugin)",
|
||||
"test": "echo 'Run npm run test:unit or npm run test:e2e' && exit 1",
|
||||
"watch": "VSCODE_DEV=1 VSCODE_IPC_HOOK_CLI= NODE_OPTIONS='--max_old_space_size=32384 --trace-warnings' ts-node ./ci/dev/watch.ts",
|
||||
"icons": "./ci/dev/gen_icons.sh"
|
||||
},
|
||||
"main": "out/node/entry.js",
|
||||
"devDependencies": {
|
||||
"@eslint/compat": "^1.2.0",
|
||||
"@eslint/eslintrc": "^3.1.0",
|
||||
"@eslint/js": "^9.12.0",
|
||||
"@schemastore/package": "^0.0.10",
|
||||
"@types/compression": "^1.7.3",
|
||||
"@types/cookie-parser": "^1.4.4",
|
||||
"@types/eslint__js": "^8.42.3",
|
||||
"@types/express": "^4.17.17",
|
||||
"@types/http-proxy": "1.17.7",
|
||||
"@types/js-yaml": "^4.0.6",
|
||||
"@types/node": "^18.0.0",
|
||||
"@types/node": "20.x",
|
||||
"@types/pem": "^1.14.1",
|
||||
"@types/proxy-from-env": "^1.0.1",
|
||||
"@types/safe-compare": "^1.1.0",
|
||||
"@types/semver": "^7.5.2",
|
||||
"@types/trusted-types": "^2.0.4",
|
||||
"@types/ws": "^8.5.5",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
||||
"@typescript-eslint/parser": "^6.7.2",
|
||||
"audit-ci": "^6.6.1",
|
||||
"doctoc": "^2.2.1",
|
||||
"eslint": "^8.49.0",
|
||||
"eslint": "^9.12.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-import-resolver-typescript": "^3.6.0",
|
||||
"eslint-plugin-import": "^2.28.1",
|
||||
"eslint-plugin-prettier": "^5.0.0",
|
||||
"globals": "^15.10.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier-plugin-sh": "^0.14.0",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.2.2"
|
||||
"typescript": "^5.6.2",
|
||||
"typescript-eslint": "^8.8.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@coder/logger": "^3.0.1",
|
||||
@@ -79,7 +81,7 @@
|
||||
"limiter": "^2.1.0",
|
||||
"pem": "^1.14.8",
|
||||
"proxy-agent": "^6.3.1",
|
||||
"qs": "6.12.1",
|
||||
"qs": "6.13.0",
|
||||
"rotating-file-stream": "^3.1.1",
|
||||
"safe-buffer": "^5.2.1",
|
||||
"safe-compare": "^1.1.4",
|
||||
@@ -88,7 +90,7 @@
|
||||
"xdg-basedir": "^4.0.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"@types/node": "^18.0.0"
|
||||
"@types/node": "20.x"
|
||||
},
|
||||
"bin": {
|
||||
"code-server": "out/node/entry.js"
|
||||
@@ -103,7 +105,7 @@
|
||||
"remote-development"
|
||||
],
|
||||
"engines": {
|
||||
"node": "18"
|
||||
"node": "20"
|
||||
},
|
||||
"jest": {
|
||||
"transform": {
|
||||
|
||||
@@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/base/common/network.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/network.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/network.ts
|
||||
@@ -205,7 +205,9 @@ class RemoteAuthoritiesImpl {
|
||||
@@ -220,7 +220,9 @@ class RemoteAuthoritiesImpl {
|
||||
return URI.from({
|
||||
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
|
||||
authority: `${host}:${port}`,
|
||||
@@ -46,18 +46,18 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
|
||||
+ <link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
|
||||
</head>
|
||||
<style id="vscode-css-modules" type="text/css" media="screen"></style>
|
||||
|
||||
<body aria-label="">
|
||||
</head>
|
||||
@@ -39,7 +39,7 @@
|
||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/loader.js"></script>
|
||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/webPackagePaths.js"></script>
|
||||
|
||||
<!-- Startup (do not modify order of script tags!) -->
|
||||
<script>
|
||||
- const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();
|
||||
+ const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location).toString();
|
||||
Object.keys(self.webPackagePaths).map(function (key, index) {
|
||||
self.webPackagePaths[key] = `${baseUrl}/remote/web/node_modules/${key}/${self.webPackagePaths[key]}`;
|
||||
});
|
||||
globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/';
|
||||
</script>
|
||||
<script>
|
||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
@@ -83,18 +83,18 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
+ <link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
|
||||
<link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.css">
|
||||
<link rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.css">
|
||||
|
||||
</head>
|
||||
@@ -38,7 +38,7 @@
|
||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/loader.js"></script>
|
||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/webPackagePaths.js"></script>
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
<!-- Startup (do not modify order of script tags!) -->
|
||||
<script>
|
||||
- const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();
|
||||
+ const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location).toString();
|
||||
Object.keys(self.webPackagePaths).map(function (key, index) {
|
||||
self.webPackagePaths[key] = `${baseUrl}/node_modules/${key}/${self.webPackagePaths[key]}`;
|
||||
});
|
||||
globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/';
|
||||
</script>
|
||||
<script>
|
||||
Index: code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
|
||||
@@ -111,7 +111,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -270,16 +270,15 @@ export class WebClientServer {
|
||||
@@ -271,16 +271,15 @@ export class WebClientServer {
|
||||
return void res.end();
|
||||
}
|
||||
|
||||
@@ -133,42 +133,52 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
);
|
||||
if (!remoteAuthority) {
|
||||
return serveError(req, res, 400, `Bad request.`);
|
||||
@@ -306,8 +305,12 @@ export class WebClientServer {
|
||||
@@ -307,8 +306,12 @@ export class WebClientServer {
|
||||
scopes: [['user:email'], ['repo']]
|
||||
} : undefined;
|
||||
|
||||
+ const base = relativeRoot(getOriginalUrl(req))
|
||||
+ const vscodeBase = relativePath(getOriginalUrl(req))
|
||||
+
|
||||
const productConfiguration = <Partial<IProductConfiguration>>{
|
||||
const productConfiguration = {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
+ rootEndpoint: base,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
||||
...this._productService.extensionsGallery,
|
||||
@@ -343,8 +346,10 @@ export class WebClientServer {
|
||||
@@ -337,7 +340,7 @@ export class WebClientServer {
|
||||
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
|
||||
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
|
||||
productConfiguration,
|
||||
- callbackRoute: this._callbackRoute
|
||||
+ callbackRoute: vscodeBase + this._callbackRoute
|
||||
};
|
||||
|
||||
const cookies = cookie.parse(req.headers.cookie || '');
|
||||
@@ -354,9 +357,11 @@ export class WebClientServer {
|
||||
const values: { [key: string]: string } = {
|
||||
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
||||
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
|
||||
- WORKBENCH_WEB_BASE_URL: this._staticRoute,
|
||||
- WORKBENCH_NLS_BASE_URL: nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : '',
|
||||
+ WORKBENCH_WEB_BASE_URL: vscodeBase + this._staticRoute,
|
||||
+ WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : ''),
|
||||
WORKBENCH_NLS_URL,
|
||||
- WORKBENCH_NLS_FALLBACK_URL: `${this._staticRoute}/out/nls.messages.js`
|
||||
+ WORKBENCH_NLS_FALLBACK_URL: `${vscodeBase}${this._staticRoute}/out/nls.messages.js`,
|
||||
+ BASE: base,
|
||||
+ VS_BASE: vscodeBase,
|
||||
};
|
||||
|
||||
if (useTestResolver) {
|
||||
@@ -371,7 +376,7 @@ export class WebClientServer {
|
||||
// DEV ---------------------------------------------------------------------------------------
|
||||
@@ -393,7 +398,7 @@ export class WebClientServer {
|
||||
'default-src \'self\';',
|
||||
'img-src \'self\' https: data: blob:;',
|
||||
'media-src \'self\';',
|
||||
- `script-src 'self' 'unsafe-eval' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' ${useTestResolver ? '' : `http://${remoteAuthority}`};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
||||
+ `script-src 'self' 'unsafe-eval' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' ${useTestResolver ? '' : ''};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
||||
- `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} blob: 'nonce-1nline-m4p' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' 'sha256-/r7rqQ+yrxt57sxLuQ6AMYcy/lUpvAIzHjIJt/OeLWU=' ${useTestResolver ? '' : `http://${remoteAuthority}`};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
||||
+ `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} blob: 'nonce-1nline-m4p' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' 'sha256-/r7rqQ+yrxt57sxLuQ6AMYcy/lUpvAIzHjIJt/OeLWU=' ${useTestResolver ? '' : ``};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
||||
'child-src \'self\';',
|
||||
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
||||
'worker-src \'self\' data: blob:;',
|
||||
@@ -444,3 +449,70 @@ export class WebClientServer {
|
||||
@@ -466,3 +471,70 @@ export class WebClientServer {
|
||||
return void res.end(data);
|
||||
}
|
||||
}
|
||||
@@ -255,7 +265,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
@@ -304,7 +304,8 @@ class LocalStorageURLCallbackProvider ex
|
||||
@@ -317,7 +317,8 @@ class LocalStorageURLCallbackProvider ex
|
||||
this.startListening();
|
||||
}
|
||||
|
||||
@@ -265,7 +275,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
}
|
||||
|
||||
private startListening(): void {
|
||||
@@ -550,17 +551,6 @@ class WorkspaceProvider implements IWork
|
||||
@@ -563,17 +564,6 @@ class WorkspaceProvider implements IWork
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,7 +293,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
(function () {
|
||||
|
||||
// Find config by checking for DOM
|
||||
@@ -569,8 +559,8 @@ function readCookie(name: string): strin
|
||||
@@ -582,8 +572,8 @@ function readCookie(name: string): strin
|
||||
if (!configElement || !configElementAttribute) {
|
||||
throw new Error('Missing web configuration element');
|
||||
}
|
||||
@@ -298,15 +308,7 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
@@ -16,7 +16,6 @@ import { getServiceMachineId } from 'vs/
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
-import { RemoteAuthorities } from 'vs/base/common/network';
|
||||
import { TargetPlatform } from 'vs/platform/extensions/common/extensions';
|
||||
|
||||
const WEB_EXTENSION_RESOURCE_END_POINT_SEGMENT = '/web-extension-resource/';
|
||||
@@ -99,7 +98,7 @@ export abstract class AbstractExtensionR
|
||||
@@ -98,7 +98,7 @@ export abstract class AbstractExtensionR
|
||||
: version,
|
||||
path: 'extension'
|
||||
}));
|
||||
|
||||
135
patches/clipboard.diff
Normal file
135
patches/clipboard.diff
Normal file
@@ -0,0 +1,135 @@
|
||||
Index: code-server/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.ts
|
||||
@@ -8,6 +8,7 @@ import { isWeb } from '../../../base/com
|
||||
import { isString } from '../../../base/common/types.js';
|
||||
import { URI, UriComponents } from '../../../base/common/uri.js';
|
||||
import { localize } from '../../../nls.js';
|
||||
+import { IClipboardService } from '../../../platform/clipboard/common/clipboardService.js';
|
||||
import { CommandsRegistry, ICommandService } from '../../../platform/commands/common/commands.js';
|
||||
import { IExtensionGalleryService, IExtensionManagementService } from '../../../platform/extensionManagement/common/extensionManagement.js';
|
||||
import { ExtensionManagementCLI } from '../../../platform/extensionManagement/common/extensionManagementCLI.js';
|
||||
@@ -95,6 +96,11 @@ CommandsRegistry.registerCommand('_remot
|
||||
|
||||
});
|
||||
|
||||
+CommandsRegistry.registerCommand('_remoteCLI.setClipboard', function (accessor: ServicesAccessor, content: string) {
|
||||
+ const clipboardService = accessor.get(IClipboardService);
|
||||
+ clipboardService.writeText(content);
|
||||
+})
|
||||
+
|
||||
class RemoteExtensionManagementCLI extends ExtensionManagementCLI {
|
||||
|
||||
private _location: string | undefined;
|
||||
Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
||||
@@ -43,7 +43,12 @@ export interface ExtensionManagementPipe
|
||||
force?: boolean;
|
||||
}
|
||||
|
||||
-export type PipeCommand = OpenCommandPipeArgs | StatusPipeArgs | OpenExternalCommandPipeArgs | ExtensionManagementPipeArgs;
|
||||
+export interface ClipboardPipeArgs {
|
||||
+ type: 'clipboard';
|
||||
+ content: string;
|
||||
+}
|
||||
+
|
||||
+export type PipeCommand = OpenCommandPipeArgs | StatusPipeArgs | OpenExternalCommandPipeArgs | ExtensionManagementPipeArgs | ClipboardPipeArgs;
|
||||
|
||||
export interface ICommandsExecuter {
|
||||
executeCommand<T>(id: string, ...args: any[]): Promise<T>;
|
||||
@@ -105,6 +110,9 @@ export class CLIServerBase {
|
||||
case 'extensionManagement':
|
||||
returnObj = await this.manageExtensions(data);
|
||||
break;
|
||||
+ case 'clipboard':
|
||||
+ returnObj = await this.clipboard(data);
|
||||
+ break;
|
||||
default:
|
||||
sendResponse(404, `Unknown message type: ${data.type}`);
|
||||
break;
|
||||
@@ -172,6 +180,10 @@ export class CLIServerBase {
|
||||
return await this._commands.executeCommand<string | undefined>('_remoteCLI.getSystemStatus');
|
||||
}
|
||||
|
||||
+ private async clipboard(data: ClipboardPipeArgs): Promise<undefined> {
|
||||
+ return await this._commands.executeCommand('_remoteCLI.setClipboard', data.content);
|
||||
+ }
|
||||
+
|
||||
dispose(): void {
|
||||
this._server.close();
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||
@@ -97,7 +97,7 @@ class RemoteTerminalBackend extends Base
|
||||
}
|
||||
});
|
||||
|
||||
- const allowedCommands = ['_remoteCLI.openExternal', '_remoteCLI.windowOpen', '_remoteCLI.getSystemStatus', '_remoteCLI.manageExtensions'];
|
||||
+ const allowedCommands = ['_remoteCLI.openExternal', '_remoteCLI.windowOpen', '_remoteCLI.getSystemStatus', '_remoteCLI.manageExtensions', '_remoteCLI.setClipboard'];
|
||||
this._remoteTerminalChannel.onExecuteCommand(async e => {
|
||||
// Ensure this request for for this window
|
||||
const pty = this._ptys.get(e.persistentProcessId);
|
||||
Index: code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||
@@ -119,6 +119,7 @@ export interface NativeParsedArgs {
|
||||
sandbox?: boolean;
|
||||
|
||||
'enable-coi'?: boolean;
|
||||
+ 'stdin-to-clipboard'?: boolean;
|
||||
|
||||
// chromium command line args: https://electronjs.org/docs/all#supported-chrome-command-line-switches
|
||||
'no-proxy-server'?: boolean;
|
||||
Index: code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/node/argv.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
|
||||
@@ -90,6 +90,7 @@ export const OPTIONS: OptionDescriptions
|
||||
'user-data-dir': { type: 'string', cat: 'o', args: 'dir', description: localize('userDataDir', "Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.") },
|
||||
'profile': { type: 'string', 'cat': 'o', args: 'profileName', description: localize('profileName', "Opens the provided folder or workspace with the given profile and associates the profile with the workspace. If the profile does not exist, a new empty one is created.") },
|
||||
'help': { type: 'boolean', cat: 'o', alias: 'h', description: localize('help', "Print usage.") },
|
||||
+ 'stdin-to-clipboard': { type: 'boolean', cat: 'o', alias: 'c', description: localize('clipboard', "copies the STDIN to the clipboard") },
|
||||
|
||||
'extensions-dir': { type: 'string', deprecates: ['extensionHomePath'], cat: 'e', args: 'dir', description: localize('extensionHomePath', "Set the root path for extensions.") },
|
||||
'extensions-download-dir': { type: 'string' },
|
||||
Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/server.cli.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/server.cli.ts
|
||||
@@ -76,6 +76,7 @@ const isSupportedForPipe = (optionId: ke
|
||||
case 'verbose':
|
||||
case 'remote':
|
||||
case 'locate-shell-integration-path':
|
||||
+ case 'stdin-to-clipboard':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@@ -293,6 +294,22 @@ export async function main(desc: Product
|
||||
}
|
||||
}
|
||||
} else {
|
||||
+ if (parsedArgs['stdin-to-clipboard']) {
|
||||
+ if(!hasStdinWithoutTty()) {
|
||||
+ console.error("stdin has a tty.");
|
||||
+ return;
|
||||
+ }
|
||||
+ const stdinBuffer = fs.readFileSync(0); // STDIN_FILENO = 0
|
||||
+ const clipboardContent = stdinBuffer.toString();
|
||||
+ sendToPipe({
|
||||
+ type: 'clipboard',
|
||||
+ content: clipboardContent
|
||||
+ }, verbose).catch(e => {
|
||||
+ console.error('Error when requesting status:', e);
|
||||
+ });
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (parsedArgs.status) {
|
||||
sendToPipe({
|
||||
type: 'status'
|
||||
@@ -7,7 +7,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||
@@ -284,6 +284,10 @@ export class Extension implements IExten
|
||||
@@ -315,6 +315,10 @@ export class Extension implements IExten
|
||||
if (this.type === ExtensionType.System && this.productService.quality === 'stable') {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,36 +1,24 @@
|
||||
Add display language support
|
||||
|
||||
We can remove this once upstream supports all language packs.
|
||||
|
||||
1. Proxies language packs to the service on the backend.
|
||||
2. NLS configuration is embedded into the HTML for the browser to pick up. This
|
||||
code to generate this configuration is copied from the native portion.
|
||||
3. Remove configuredLocale since we have our own thing.
|
||||
4. Move the argv.json file to the server instead of in-browser storage. This is
|
||||
where the current locale is stored and currently the server needs to be able
|
||||
to read it.
|
||||
5. Add the locale flag.
|
||||
6. Remove the redundant locale verification. It does the same as the existing
|
||||
one but is worse because it does not handle non-existent or empty files.
|
||||
7. Replace some caching and Node requires because code-server does not restart
|
||||
when changing the language unlike native Code.
|
||||
8. Make language extensions installable like normal rather than using the
|
||||
special set/clear language actions.
|
||||
VS Code web appears to implement language support by setting a cookie and
|
||||
downloading language packs from a URL configured in the product.json. This patch
|
||||
supports language pack extensions and uses files on the remote to set the
|
||||
language instead, so it works like the desktop version.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
@@ -11,7 +11,7 @@ import * as path from 'vs/base/common/pa
|
||||
import { IURITransformer } from 'vs/base/common/uriIpc';
|
||||
import { getMachineId, getSqmMachineId } from 'vs/base/node/id';
|
||||
import { Promises } from 'vs/base/node/pfs';
|
||||
-import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, StaticRouter } from 'vs/base/parts/ipc/common/ipc';
|
||||
+import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, ProxyChannel, StaticRouter } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { ProtocolConstants } from 'vs/base/parts/ipc/common/ipc.net';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ConfigurationService } from 'vs/platform/configuration/common/configurationService';
|
||||
@@ -240,6 +240,9 @@ export async function setupServerService
|
||||
@@ -12,7 +12,7 @@ import * as path from '../../base/common
|
||||
import { IURITransformer } from '../../base/common/uriIpc.js';
|
||||
import { getMachineId, getSqmMachineId, getdevDeviceId } from '../../base/node/id.js';
|
||||
import { Promises } from '../../base/node/pfs.js';
|
||||
-import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, StaticRouter } from '../../base/parts/ipc/common/ipc.js';
|
||||
+import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, ProxyChannel, StaticRouter } from '../../base/parts/ipc/common/ipc.js';
|
||||
import { ProtocolConstants } from '../../base/parts/ipc/common/ipc.net.js';
|
||||
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
||||
import { ConfigurationService } from '../../platform/configuration/common/configurationService.js';
|
||||
@@ -243,6 +243,9 @@ export async function setupServerService
|
||||
const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority));
|
||||
socketServer.registerChannel('extensions', channel);
|
||||
|
||||
@@ -40,100 +28,6 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
// clean up extensions folder
|
||||
remoteExtensionsScanner.whenExtensionsReady().then(() => extensionManagementService.cleanUp());
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/base/common/platform.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/platform.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/platform.ts
|
||||
@@ -2,8 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
-import * as nls from 'vs/nls';
|
||||
-
|
||||
export const LANGUAGE_DEFAULT = 'en';
|
||||
|
||||
let _isWindows = false;
|
||||
@@ -112,17 +110,21 @@ else if (typeof navigator === 'object' &
|
||||
_isMobile = _userAgent?.indexOf('Mobi') >= 0;
|
||||
_isWeb = true;
|
||||
|
||||
- const configuredLocale = nls.getConfiguredDefaultLocale(
|
||||
- // This call _must_ be done in the file that calls `nls.getConfiguredDefaultLocale`
|
||||
- // to ensure that the NLS AMD Loader plugin has been loaded and configured.
|
||||
- // This is because the loader plugin decides what the default locale is based on
|
||||
- // how it's able to resolve the strings.
|
||||
- nls.localize({ key: 'ensureLoaderPluginIsLoaded', comment: ['{Locked}'] }, '_')
|
||||
- );
|
||||
-
|
||||
- _locale = configuredLocale || LANGUAGE_DEFAULT;
|
||||
+ _locale = LANGUAGE_DEFAULT;
|
||||
_language = _locale;
|
||||
_platformLocale = navigator.language;
|
||||
+ const el = typeof document !== 'undefined' && document.getElementById('vscode-remote-nls-configuration');
|
||||
+ const rawNlsConfig = el && el.getAttribute('data-settings');
|
||||
+ if (rawNlsConfig) {
|
||||
+ try {
|
||||
+ const nlsConfig: NLSConfig = JSON.parse(rawNlsConfig);
|
||||
+ const resolved = nlsConfig.availableLanguages['*'];
|
||||
+ _locale = nlsConfig.locale;
|
||||
+ _platformLocale = nlsConfig.osLocale;
|
||||
+ _language = resolved ? resolved : LANGUAGE_DEFAULT;
|
||||
+ _translationsConfigFile = nlsConfig._translationsConfigFile;
|
||||
+ } catch (error) { /* Oh well. */ }
|
||||
+ }
|
||||
}
|
||||
|
||||
// Unknown environment
|
||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
@@ -23,6 +23,9 @@
|
||||
<!-- Workbench Auth Session -->
|
||||
<meta id="vscode-workbench-auth-session" data-settings="{{WORKBENCH_AUTH_SESSION}}">
|
||||
|
||||
+ <!-- NLS Configuration -->
|
||||
+ <meta id="vscode-remote-nls-configuration" data-settings="{{NLS_CONFIGURATION}}">
|
||||
+
|
||||
<!-- Workbench Icon/Manifest/CSS -->
|
||||
<link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
<link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
@@ -48,15 +51,27 @@
|
||||
// Normalize locale to lowercase because translationServiceUrl is case-sensitive.
|
||||
// ref: https://github.com/microsoft/vscode/issues/187795
|
||||
const locale = localStorage.getItem('vscode.nls.locale') || navigator.language.toLowerCase();
|
||||
- if (!locale.startsWith('en')) {
|
||||
- nlsConfig['vs/nls'] = {
|
||||
- availableLanguages: {
|
||||
- '*': locale
|
||||
- },
|
||||
- translationServiceUrl: '{{WORKBENCH_NLS_BASE_URL}}'
|
||||
- };
|
||||
- }
|
||||
|
||||
+ try {
|
||||
+ nlsConfig['vs/nls'] = JSON.parse(document.getElementById("vscode-remote-nls-configuration").getAttribute("data-settings"))
|
||||
+ if (nlsConfig['vs/nls']._resolvedLanguagePackCoreLocation) {
|
||||
+ const bundles = Object.create(null)
|
||||
+ nlsConfig['vs/nls'].loadBundle = (bundle, _language, cb) => {
|
||||
+ const result = bundles[bundle]
|
||||
+ if (result) {
|
||||
+ return cb(undefined, result)
|
||||
+ }
|
||||
+ const path = nlsConfig['vs/nls']._resolvedLanguagePackCoreLocation + "/" + bundle.replace(/\//g, "!") + ".nls.json"
|
||||
+ fetch(`{{WORKBENCH_WEB_BASE_URL}}/../vscode-remote-resource?path=${encodeURIComponent(path)}`)
|
||||
+ .then((response) => response.json())
|
||||
+ .then((json) => {
|
||||
+ bundles[bundle] = json
|
||||
+ cb(undefined, json)
|
||||
+ })
|
||||
+ .catch(cb)
|
||||
+ }
|
||||
+ }
|
||||
+ } catch (error) { /* Probably fine. */ }
|
||||
require.config({
|
||||
baseUrl: `${baseUrl}/out`,
|
||||
recordStats: true,
|
||||
Index: code-server/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
||||
@@ -151,31 +45,37 @@ Index: code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
||||
@@ -32,6 +32,12 @@ export function getNLSConfiguration(lang
|
||||
if (InternalNLSConfiguration.is(value)) {
|
||||
value._languagePackSupport = true;
|
||||
}
|
||||
+ // If the configuration has no results keep trying since code-server
|
||||
+ // doesn't restart when a language is installed so this result would
|
||||
+ // persist (the plugin might not be installed yet for example).
|
||||
+ if (value.locale !== 'en' && value.locale !== 'en-us' && Object.keys(value.availableLanguages).length === 0) {
|
||||
+ _cache.delete(key);
|
||||
+ }
|
||||
return value;
|
||||
});
|
||||
_cache.set(key, result);
|
||||
@@ -46,3 +52,43 @@ export namespace InternalNLSConfiguratio
|
||||
return candidate && typeof candidate._languagePackId === 'string';
|
||||
@@ -3,6 +3,8 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
+import { promises as fs } from 'fs';
|
||||
+import * as path from 'path';
|
||||
import { FileAccess } from '../../base/common/network.js';
|
||||
import { join } from '../../base/common/path.js';
|
||||
import type { INLSConfiguration } from '../../nls.js';
|
||||
@@ -33,7 +35,94 @@ export async function getNLSConfiguratio
|
||||
if (!result) {
|
||||
result = resolveNLSConfiguration({ userLocale: language, osLocale: language, commit: product.commit, userDataPath, nlsMetadataPath });
|
||||
nlsConfigurationCache.set(cacheKey, result);
|
||||
+ // If the language pack does not yet exist, it defaults to English, which is
|
||||
+ // then cached and you have to restart even if you then install the pack.
|
||||
+ result.then((r) => {
|
||||
+ if (!language.startsWith('en') && r.resolvedLanguage.startsWith('en')) {
|
||||
+ nlsConfigurationCache.delete(cacheKey);
|
||||
+ }
|
||||
+ })
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
+
|
||||
+/**
|
||||
+ * The code below is copied from from src/main.js.
|
||||
+ * Copied from from src/main.js.
|
||||
+ */
|
||||
+
|
||||
+export const getLocaleFromConfig = async (argvResource: string): Promise<string> => {
|
||||
+ try {
|
||||
+ const content = stripComments(await fs.promises.readFile(argvResource, 'utf8'));
|
||||
+ const content = stripComments(await fs.readFile(argvResource, 'utf8'));
|
||||
+ return JSON.parse(content).locale;
|
||||
+ } catch (error) {
|
||||
+ if (error.code !== "ENOENT") {
|
||||
@@ -185,6 +85,9 @@ Index: code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+/**
|
||||
+ * Copied from from src/main.js.
|
||||
+ */
|
||||
+const stripComments = (content: string): string => {
|
||||
+ const regexp = /('(?:[^\\']*(?:\\.)?)*')|('(?:[^\\']*(?:\\.)?)*')|(\/\*(?:\r?\n|.)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))/g;
|
||||
+
|
||||
@@ -208,95 +111,132 @@ Index: code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
||||
+ }
|
||||
+ });
|
||||
+};
|
||||
+
|
||||
+/**
|
||||
+ * Generate translations then return a path to a JavaScript file that sets the
|
||||
+ * translations into global variables. This file is loaded by the browser to
|
||||
+ * set global variables that the loader uses when looking for translations.
|
||||
+ *
|
||||
+ * Normally, VS Code pulls these files from a CDN but we want them to be local.
|
||||
+ */
|
||||
+export async function getBrowserNLSConfiguration(locale: string, userDataPath: string): Promise<string> {
|
||||
+ if (locale.startsWith('en')) {
|
||||
+ return ''; // Use fallback translations.
|
||||
+ }
|
||||
+
|
||||
+ const nlsConfig = await getNLSConfiguration(locale, userDataPath);
|
||||
+ const messagesFile = nlsConfig?.languagePack?.messagesFile;
|
||||
+ const resolvedLanguage = nlsConfig?.resolvedLanguage;
|
||||
+ if (!messagesFile || !resolvedLanguage) {
|
||||
+ return ''; // Use fallback translations.
|
||||
+ }
|
||||
+
|
||||
+ const nlsFile = path.join(path.dirname(messagesFile), "nls.messages.js");
|
||||
+ try {
|
||||
+ await fs.stat(nlsFile);
|
||||
+ return nlsFile; // We already generated the file.
|
||||
+ } catch (error) {
|
||||
+ // ENOENT is fine, that just means we need to generate the file.
|
||||
+ if (error.code !== 'ENOENT') {
|
||||
+ throw error;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ const messages = (await fs.readFile(messagesFile)).toString();
|
||||
+ const content = `globalThis._VSCODE_NLS_MESSAGES=${messages};
|
||||
+globalThis._VSCODE_NLS_LANGUAGE=${JSON.stringify(resolvedLanguage)};`
|
||||
+ await fs.writeFile(nlsFile, content, "utf-8");
|
||||
+
|
||||
+ return nlsFile;
|
||||
+}
|
||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -27,6 +27,7 @@ import { URI } from 'vs/base/common/uri'
|
||||
import { streamToBuffer } from 'vs/base/common/buffer';
|
||||
import { IProductConfiguration } from 'vs/base/common/product';
|
||||
import { isString } from 'vs/base/common/types';
|
||||
+import { getLocaleFromConfig, getNLSConfiguration } from 'vs/server/node/remoteLanguagePacks';
|
||||
import { CharCode } from 'vs/base/common/charCode';
|
||||
import { IExtensionManifest } from 'vs/platform/extensions/common/extensions';
|
||||
@@ -26,6 +26,7 @@ import { URI } from '../../base/common/u
|
||||
import { streamToBuffer } from '../../base/common/buffer.js';
|
||||
import { IProductConfiguration } from '../../base/common/product.js';
|
||||
import { isString } from '../../base/common/types.js';
|
||||
+import { getLocaleFromConfig, getBrowserNLSConfiguration } from './remoteLanguagePacks.js';
|
||||
import { CharCode } from '../../base/common/charCode.js';
|
||||
import { IExtensionManifest } from '../../platform/extensions/common/extensions.js';
|
||||
import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js';
|
||||
@@ -98,6 +99,7 @@ export class WebClientServer {
|
||||
private readonly _webExtensionResourceUrlTemplate: URI | undefined;
|
||||
|
||||
@@ -348,6 +349,8 @@ export class WebClientServer {
|
||||
callbackRoute: this._callbackRoute
|
||||
private readonly _staticRoute: string;
|
||||
+ private readonly _serverRoot: string;
|
||||
private readonly _callbackRoute: string;
|
||||
private readonly _webExtensionRoute: string;
|
||||
|
||||
@@ -113,6 +115,7 @@ export class WebClientServer {
|
||||
) {
|
||||
this._webExtensionResourceUrlTemplate = this._productService.extensionsGallery?.resourceUrlTemplate ? URI.parse(this._productService.extensionsGallery.resourceUrlTemplate) : undefined;
|
||||
|
||||
+ this._serverRoot = serverRootPath;
|
||||
this._staticRoute = `${serverRootPath}/static`;
|
||||
this._callbackRoute = `${serverRootPath}/callback`;
|
||||
this._webExtensionRoute = `/web-extension-resource`;
|
||||
@@ -351,14 +354,22 @@ export class WebClientServer {
|
||||
};
|
||||
|
||||
+ const locale = this._environmentService.args.locale || await getLocaleFromConfig(this._environmentService.argvResource.fsPath);
|
||||
+ const nlsConfiguration = await getNLSConfiguration(locale, this._environmentService.userDataPath)
|
||||
const nlsBaseUrl = this._productService.extensionsGallery?.nlsBaseUrl;
|
||||
const cookies = cookie.parse(req.headers.cookie || '');
|
||||
- const locale = cookies['vscode.nls.locale'] || req.headers['accept-language']?.split(',')[0]?.toLowerCase() || 'en';
|
||||
+ const locale = this._environmentService.args.locale || await getLocaleFromConfig(this._environmentService.argvResource.fsPath) || cookies['vscode.nls.locale'] || req.headers['accept-language']?.split(',')[0]?.toLowerCase() || 'en';
|
||||
let WORKBENCH_NLS_BASE_URL: string | undefined;
|
||||
let WORKBENCH_NLS_URL: string;
|
||||
if (!locale.startsWith('en') && this._productService.nlsCoreBaseUrl) {
|
||||
WORKBENCH_NLS_BASE_URL = this._productService.nlsCoreBaseUrl;
|
||||
WORKBENCH_NLS_URL = `${WORKBENCH_NLS_BASE_URL}${this._productService.commit}/${this._productService.version}/${locale}/nls.messages.js`;
|
||||
} else {
|
||||
- WORKBENCH_NLS_URL = ''; // fallback will apply
|
||||
+ try {
|
||||
+ const nlsFile = await getBrowserNLSConfiguration(locale, this._environmentService.userDataPath);
|
||||
+ WORKBENCH_NLS_URL = nlsFile
|
||||
+ ? `${vscodeBase}${this._serverRoot}/vscode-remote-resource?path=${encodeURIComponent(nlsFile)}`
|
||||
+ : '';
|
||||
+ } catch (error) {
|
||||
+ console.error("Failed to generate translations", error);
|
||||
+ WORKBENCH_NLS_URL = '';
|
||||
+ }
|
||||
}
|
||||
|
||||
const values: { [key: string]: string } = {
|
||||
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
||||
@@ -356,6 +359,7 @@ export class WebClientServer {
|
||||
WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : ''),
|
||||
BASE: base,
|
||||
VS_BASE: vscodeBase,
|
||||
+ NLS_CONFIGURATION: asJSON(nlsConfiguration),
|
||||
};
|
||||
|
||||
if (useTestResolver) {
|
||||
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
@@ -18,6 +18,7 @@ export const serverOptions: OptionDescri
|
||||
'auth': { type: 'string' },
|
||||
@@ -19,6 +19,7 @@ export const serverOptions: OptionDescri
|
||||
'disable-file-downloads': { type: 'boolean' },
|
||||
'disable-file-uploads': { type: 'boolean' },
|
||||
'disable-getting-started-override': { type: 'boolean' },
|
||||
+ 'locale': { type: 'string' },
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -103,6 +104,7 @@ export interface ServerParsedArgs {
|
||||
'auth'?: string;
|
||||
@@ -105,6 +106,7 @@ export interface ServerParsedArgs {
|
||||
'disable-file-downloads'?: boolean;
|
||||
'disable-file-uploads'?: boolean;
|
||||
'disable-getting-started-override'?: boolean,
|
||||
+ 'locale'?: string
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||
@@ -52,7 +52,7 @@ import 'vs/workbench/services/dialogs/br
|
||||
import 'vs/workbench/services/host/browser/browserHostService';
|
||||
import 'vs/workbench/services/lifecycle/browser/lifecycleService';
|
||||
import 'vs/workbench/services/clipboard/browser/clipboardService';
|
||||
-import 'vs/workbench/services/localization/browser/localeService';
|
||||
+import 'vs/workbench/services/localization/electron-sandbox/localeService';
|
||||
import 'vs/workbench/services/path/browser/pathService';
|
||||
import 'vs/workbench/services/themes/browser/browserHostColorSchemeService';
|
||||
import 'vs/workbench/services/encryption/browser/encryptionService';
|
||||
@@ -118,8 +118,9 @@ registerSingleton(ILanguagePackService,
|
||||
// Logs
|
||||
import 'vs/workbench/contrib/logs/browser/logs.contribution';
|
||||
|
||||
-// Localization
|
||||
-import 'vs/workbench/contrib/localization/browser/localization.contribution';
|
||||
+// Localization. This does not actually import anything specific to Electron so
|
||||
+// it should be safe.
|
||||
+import 'vs/workbench/contrib/localization/electron-sandbox/localization.contribution';
|
||||
|
||||
// Performance
|
||||
import 'vs/workbench/contrib/performance/browser/performance.web.contribution';
|
||||
Index: code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||
@@ -5,18 +5,24 @@
|
||||
|
||||
import { CancellationTokenSource } from 'vs/base/common/cancellation';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
+import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { IExtensionResourceLoaderService } from 'vs/platform/extensionResourceLoader/common/extensionResourceLoader';
|
||||
-import { ILanguagePackItem, LanguagePackBaseService } from 'vs/platform/languagePacks/common/languagePacks';
|
||||
+import { ILanguagePackItem, ILanguagePackService, LanguagePackBaseService } from 'vs/platform/languagePacks/common/languagePacks';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
+import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
||||
import { CancellationTokenSource } from '../../../base/common/cancellation.js';
|
||||
import { URI } from '../../../base/common/uri.js';
|
||||
+import { ProxyChannel } from '../../../base/parts/ipc/common/ipc.js';
|
||||
import { IExtensionGalleryService } from '../../extensionManagement/common/extensionManagement.js';
|
||||
import { IExtensionResourceLoaderService } from '../../extensionResourceLoader/common/extensionResourceLoader.js';
|
||||
-import { ILanguagePackItem, LanguagePackBaseService } from '../common/languagePacks.js';
|
||||
+import { ILanguagePackItem, ILanguagePackService, LanguagePackBaseService } from '../common/languagePacks.js';
|
||||
import { ILogService } from '../../log/common/log.js';
|
||||
+import { IRemoteAgentService } from '../../../workbench/services/remote/common/remoteAgentService.js';
|
||||
|
||||
export class WebLanguagePacksService extends LanguagePackBaseService {
|
||||
+ private readonly languagePackService: ILanguagePackService;
|
||||
@@ -348,17 +288,17 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||
@@ -342,9 +342,6 @@ export class InstallAction extends Exten
|
||||
@@ -433,9 +433,6 @@ export class InstallAction extends Exten
|
||||
if (this.extension.isBuiltin) {
|
||||
return;
|
||||
}
|
||||
- if (this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
|
||||
- return;
|
||||
- }
|
||||
if (this.extension.state === ExtensionState.Uninstalled && await this.extensionsWorkbenchService.canInstall(this.extension)) {
|
||||
this.enabled = this.options.installPreReleaseVersion ? this.extension.hasPreReleaseVersion : this.extension.hasReleaseVersion;
|
||||
this.updateLabel();
|
||||
@@ -615,7 +612,7 @@ export abstract class InstallInOtherServ
|
||||
if (this.extension.state !== ExtensionState.Uninstalled) {
|
||||
return;
|
||||
}
|
||||
@@ -740,7 +737,7 @@ export abstract class InstallInOtherServ
|
||||
}
|
||||
|
||||
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
||||
@@ -367,7 +307,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||
}
|
||||
|
||||
// Prefers to run on UI
|
||||
@@ -1843,17 +1840,6 @@ export class SetLanguageAction extends E
|
||||
@@ -2001,17 +1998,6 @@ export class SetLanguageAction extends E
|
||||
update(): void {
|
||||
this.enabled = false;
|
||||
this.class = SetLanguageAction.DisabledClass;
|
||||
@@ -385,15 +325,15 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||
}
|
||||
|
||||
override async run(): Promise<any> {
|
||||
@@ -1870,7 +1856,6 @@ export class ClearLanguageAction extends
|
||||
private static readonly DisabledClass = `${ClearLanguageAction.EnabledClass} disabled`;
|
||||
@@ -2028,7 +2014,6 @@ export class ClearLanguageAction extends
|
||||
private static readonly DisabledClass = `${this.EnabledClass} disabled`;
|
||||
|
||||
constructor(
|
||||
- @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
|
||||
@ILocaleService private readonly localeService: ILocaleService,
|
||||
) {
|
||||
super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false);
|
||||
@@ -1880,17 +1865,6 @@ export class ClearLanguageAction extends
|
||||
@@ -2038,17 +2023,6 @@ export class ClearLanguageAction extends
|
||||
update(): void {
|
||||
this.enabled = false;
|
||||
this.class = ClearLanguageAction.DisabledClass;
|
||||
@@ -411,3 +351,28 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||
}
|
||||
|
||||
override async run(): Promise<any> {
|
||||
Index: code-server/lib/vscode/build/gulpfile.reh.js
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
|
||||
+++ code-server/lib/vscode/build/gulpfile.reh.js
|
||||
@@ -58,6 +58,7 @@ const serverResourceIncludes = [
|
||||
|
||||
// NLS
|
||||
'out-build/nls.messages.json',
|
||||
+ 'out-build/nls.keys.json', // Required to generate translations.
|
||||
|
||||
// Process monitor
|
||||
'out-build/vs/base/node/cpuUsage.sh',
|
||||
Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
|
||||
@@ -52,7 +52,7 @@ import './services/dialogs/browser/fileD
|
||||
import './services/host/browser/browserHostService.js';
|
||||
import './services/lifecycle/browser/lifecycleService.js';
|
||||
import './services/clipboard/browser/clipboardService.js';
|
||||
-import './services/localization/browser/localeService.js';
|
||||
+import './services/localization/electron-sandbox/localeService.js';
|
||||
import './services/path/browser/pathService.js';
|
||||
import './services/themes/browser/browserHostColorSchemeService.js';
|
||||
import './services/encryption/browser/encryptionService.js';
|
||||
|
||||
@@ -112,7 +112,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -334,6 +334,8 @@ export class WebClientServer {
|
||||
@@ -335,6 +335,8 @@ export class WebClientServer {
|
||||
serverBasePath: this._basePath,
|
||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
userDataPath: this._environmentService.userDataPath,
|
||||
@@ -125,31 +125,30 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
@@ -7,12 +7,12 @@ import { Event } from 'vs/base/common/ev
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||
-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, MainEditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds, TitleBarVisibleContext, TitleBarStyleContext, MultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext, ActiveCompareEditorCanSwapContext } from 'vs/workbench/common/contextkeys';
|
||||
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, MainEditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds, TitleBarVisibleContext, TitleBarStyleContext, MultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext, ActiveCompareEditorCanSwapContext, IsEnabledFileDownloads, IsEnabledFileUploads } from 'vs/workbench/common/contextkeys';
|
||||
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow } from 'vs/base/browser/dom';
|
||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
-import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
+import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { WorkbenchState, IWorkspaceContextService, isTemporaryWorkspace } from 'vs/platform/workspace/common/workspace';
|
||||
import { IWorkbenchLayoutService, Parts, positionToString } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
@@ -88,7 +88,7 @@ export class WorkbenchContextKeysHandler
|
||||
@@ -7,11 +7,11 @@ import { Event } from '../../base/common
|
||||
import { Disposable } from '../../base/common/lifecycle.js';
|
||||
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js';
|
||||
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../platform/contextkey/common/contextkeys.js';
|
||||
-import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext } from '../common/contextkeys.js';
|
||||
+import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, IsEnabledFileDownloads, IsEnabledFileUploads } from '../common/contextkeys.js';
|
||||
import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow, isEditableElement } from '../../base/browser/dom.js';
|
||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js';
|
||||
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
||||
-import { IWorkbenchEnvironmentService } from '../services/environment/common/environmentService.js';
|
||||
+import { IBrowserWorkbenchEnvironmentService } from '../services/environment/browser/environmentService.js';
|
||||
import { WorkbenchState, IWorkspaceContextService, isTemporaryWorkspace } from '../../platform/workspace/common/workspace.js';
|
||||
import { IWorkbenchLayoutService, Parts, positionToString } from '../services/layout/browser/layoutService.js';
|
||||
import { getRemoteName } from '../../platform/remote/common/remoteHosts.js';
|
||||
@@ -70,7 +70,7 @@ export class WorkbenchContextKeysHandler
|
||||
@IContextKeyService private readonly contextKeyService: IContextKeyService,
|
||||
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
- @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
|
||||
+ @IBrowserWorkbenchEnvironmentService private readonly environmentService: IBrowserWorkbenchEnvironmentService,
|
||||
@IProductService private readonly productService: IProductService,
|
||||
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService,
|
||||
@IEditorService private readonly editorService: IEditorService,
|
||||
@IEditorResolverService private readonly editorResolverService: IEditorResolverService,
|
||||
@@ -225,6 +225,10 @@ export class WorkbenchContextKeysHandler
|
||||
@@ -197,6 +197,10 @@ export class WorkbenchContextKeysHandler
|
||||
this.auxiliaryBarVisibleContext = AuxiliaryBarVisibleContext.bindTo(this.contextKeyService);
|
||||
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART));
|
||||
|
||||
@@ -165,15 +164,15 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
|
||||
@@ -20,7 +20,7 @@ import { CLOSE_SAVED_EDITORS_COMMAND_ID,
|
||||
import { AutoSaveAfterShortDelayContext } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
||||
import { WorkbenchListDoubleSelection } from 'vs/platform/list/browser/listService';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
-import { DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext } from 'vs/workbench/common/contextkeys';
|
||||
+import { DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, IsEnabledFileDownloads, IsEnabledFileUploads } from 'vs/workbench/common/contextkeys';
|
||||
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ThemeIcon } from 'vs/base/common/themables';
|
||||
@@ -553,13 +553,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||
import { AutoSaveAfterShortDelayContext } from '../../../services/filesConfiguration/common/filesConfigurationService.js';
|
||||
import { WorkbenchListDoubleSelection, WorkbenchTreeFindOpen } from '../../../../platform/list/browser/listService.js';
|
||||
import { Schemas } from '../../../../base/common/network.js';
|
||||
-import { DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, MultipleEditorsSelectedInGroupContext, TwoEditorsSelectedInGroupContext, SelectedEditorsInGroupFileOrUntitledResourceContextKey } from '../../../common/contextkeys.js';
|
||||
+import { IsEnabledFileDownloads, IsEnabledFileUploads, DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, MultipleEditorsSelectedInGroupContext, TwoEditorsSelectedInGroupContext, SelectedEditorsInGroupFileOrUntitledResourceContextKey } from '../../../common/contextkeys.js';
|
||||
import { IsWebContext } from '../../../../platform/contextkey/common/contextkeys.js';
|
||||
import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js';
|
||||
import { ThemeIcon } from '../../../../base/common/themables.js';
|
||||
@@ -572,13 +572,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||
id: DOWNLOAD_COMMAND_ID,
|
||||
title: DOWNLOAD_LABEL
|
||||
},
|
||||
@@ -197,7 +196,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions
|
||||
)
|
||||
}));
|
||||
|
||||
@@ -571,6 +574,7 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||
@@ -590,6 +593,7 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||
title: UPLOAD_LABEL,
|
||||
},
|
||||
when: ContextKeyExpr.and(
|
||||
@@ -223,16 +222,16 @@ Index: code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFi
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts
|
||||
@@ -18,7 +18,7 @@ import { IModelService } from 'vs/editor
|
||||
import { ILanguageService } from 'vs/editor/common/languages/language';
|
||||
import { getIconClasses } from 'vs/editor/common/services/getIconClasses';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
-import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
+import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
|
||||
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
||||
import { IContextKeyService, IContextKey, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { equalsIgnoreCase, format, startsWithIgnoreCase } from 'vs/base/common/strings';
|
||||
@@ -143,7 +143,7 @@ export class SimpleFileDialog implements
|
||||
@@ -18,7 +18,7 @@ import { IModelService } from '../../../
|
||||
import { ILanguageService } from '../../../../editor/common/languages/language.js';
|
||||
import { getIconClasses } from '../../../../editor/common/services/getIconClasses.js';
|
||||
import { Schemas } from '../../../../base/common/network.js';
|
||||
-import { IWorkbenchEnvironmentService } from '../../environment/common/environmentService.js';
|
||||
+import { IBrowserWorkbenchEnvironmentService } from '../../environment/browser/environmentService.js';
|
||||
import { IRemoteAgentService } from '../../remote/common/remoteAgentService.js';
|
||||
import { IContextKeyService, IContextKey, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
|
||||
import { equalsIgnoreCase, format, startsWithIgnoreCase } from '../../../../base/common/strings.js';
|
||||
@@ -139,7 +139,7 @@ export class SimpleFileDialog extends Di
|
||||
@IFileDialogService private readonly fileDialogService: IFileDialogService,
|
||||
@IModelService private readonly modelService: IModelService,
|
||||
@ILanguageService private readonly languageService: ILanguageService,
|
||||
@@ -241,7 +240,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFi
|
||||
@IRemoteAgentService private readonly remoteAgentService: IRemoteAgentService,
|
||||
@IPathService protected readonly pathService: IPathService,
|
||||
@IKeybindingService private readonly keybindingService: IKeybindingService,
|
||||
@@ -286,20 +286,22 @@ export class SimpleFileDialog implements
|
||||
@@ -283,20 +283,22 @@ export class SimpleFileDialog extends Di
|
||||
this.filePickBox.sortByLabel = false;
|
||||
this.filePickBox.ignoreFocusOut = true;
|
||||
this.filePickBox.ok = true;
|
||||
@@ -282,15 +281,15 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/views/explo
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts
|
||||
@@ -68,6 +68,7 @@ import { HoverPosition } from 'vs/base/b
|
||||
import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
||||
import { mainWindow } from 'vs/base/browser/window';
|
||||
import { IExplorerFileContribution, explorerFileContribRegistry } from 'vs/workbench/contrib/files/browser/explorerFileContrib';
|
||||
+import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
|
||||
import type { IHoverWidget } from 'vs/base/browser/ui/hover/hover';
|
||||
@@ -65,6 +65,7 @@ import { timeout } from '../../../../../
|
||||
import { IFilesConfigurationService } from '../../../../services/filesConfiguration/common/filesConfigurationService.js';
|
||||
import { mainWindow } from '../../../../../base/browser/window.js';
|
||||
import { IExplorerFileContribution, explorerFileContribRegistry } from '../explorerFileContrib.js';
|
||||
+import { IBrowserWorkbenchEnvironmentService } from '../../../../services/environment/browser/environmentService.js';
|
||||
|
||||
export class ExplorerDelegate implements IListVirtualDelegate<ExplorerItem> {
|
||||
@@ -1080,7 +1081,8 @@ export class FileDragAndDrop implements
|
||||
|
||||
@@ -1030,7 +1031,8 @@ export class FileDragAndDrop implements
|
||||
@IConfigurationService private configurationService: IConfigurationService,
|
||||
@IInstantiationService private instantiationService: IInstantiationService,
|
||||
@IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService,
|
||||
@@ -300,7 +299,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/views/explo
|
||||
) {
|
||||
const updateDropEnablement = (e: IConfigurationChangeEvent | undefined) => {
|
||||
if (!e || e.affectsConfiguration('explorer.enableDragAndDrop')) {
|
||||
@@ -1305,15 +1307,17 @@ export class FileDragAndDrop implements
|
||||
@@ -1255,15 +1257,17 @@ export class FileDragAndDrop implements
|
||||
|
||||
// External file DND (Import/Upload file)
|
||||
if (data instanceof NativeDragAndDropData) {
|
||||
|
||||
@@ -14,21 +14,21 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
-import { $, Dimension, addDisposableListener, append, clearNode, reset } from 'vs/base/browser/dom';
|
||||
+import { $, Dimension, addDisposableListener, append, clearNode, reset, prepend } from 'vs/base/browser/dom';
|
||||
import { renderFormattedText } from 'vs/base/browser/formattedTextRenderer';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { Button } from 'vs/base/browser/ui/button/button';
|
||||
-import { $, Dimension, addDisposableListener, append, clearNode, reset } from '../../../../base/browser/dom.js';
|
||||
+import { $, Dimension, addDisposableListener, append, clearNode, reset, prepend } from '../../../../base/browser/dom.js';
|
||||
import { renderFormattedText } from '../../../../base/browser/formattedTextRenderer.js';
|
||||
import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js';
|
||||
import { Button } from '../../../../base/browser/ui/button/button.js';
|
||||
@@ -54,7 +54,7 @@ import { IRecentFolder, IRecentWorkspace
|
||||
import { OpenRecentAction } from 'vs/workbench/browser/actions/windowActions';
|
||||
import { OpenFileFolderAction, OpenFolderAction, OpenFolderViaWorkspaceAction } from 'vs/workbench/browser/actions/workspaceActions';
|
||||
import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane';
|
||||
-import { WorkbenchStateContext } from 'vs/workbench/common/contextkeys';
|
||||
+import { IsEnabledCoderGettingStarted, WorkbenchStateContext } from 'vs/workbench/common/contextkeys';
|
||||
import { IEditorOpenContext, IEditorSerializer } from 'vs/workbench/common/editor';
|
||||
import { IWebviewElement, IWebviewService } from 'vs/workbench/contrib/webview/browser/webview';
|
||||
import 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedColors';
|
||||
@@ -816,6 +816,72 @@ export class GettingStartedPage extends
|
||||
import { OpenRecentAction } from '../../../browser/actions/windowActions.js';
|
||||
import { OpenFileFolderAction, OpenFolderAction, OpenFolderViaWorkspaceAction } from '../../../browser/actions/workspaceActions.js';
|
||||
import { EditorPane } from '../../../browser/parts/editor/editorPane.js';
|
||||
-import { WorkbenchStateContext } from '../../../common/contextkeys.js';
|
||||
+import { IsEnabledCoderGettingStarted, WorkbenchStateContext } from '../../../common/contextkeys.js';
|
||||
import { IEditorOpenContext, IEditorSerializer } from '../../../common/editor.js';
|
||||
import { IWebviewElement, IWebviewService } from '../../webview/browser/webview.js';
|
||||
import './gettingStartedColors.js';
|
||||
@@ -826,6 +826,72 @@ export class GettingStartedPage extends
|
||||
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
|
||||
);
|
||||
|
||||
@@ -101,7 +101,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
||||
const leftColumn = $('.categories-column.categories-column-left', {},);
|
||||
const rightColumn = $('.categories-column.categories-column-right', {},);
|
||||
|
||||
@@ -887,6 +953,9 @@ export class GettingStartedPage extends
|
||||
@@ -861,6 +927,9 @@ export class GettingStartedPage extends
|
||||
recentList.setLimit(5);
|
||||
reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||
}
|
||||
@@ -181,18 +181,18 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
@@ -19,6 +19,7 @@ export const serverOptions: OptionDescri
|
||||
@@ -18,6 +18,7 @@ export const serverOptions: OptionDescri
|
||||
'auth': { type: 'string' },
|
||||
'disable-file-downloads': { type: 'boolean' },
|
||||
'disable-file-uploads': { type: 'boolean' },
|
||||
'locale': { type: 'string' },
|
||||
+ 'disable-getting-started-override': { type: 'boolean' },
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -105,6 +106,7 @@ export interface ServerParsedArgs {
|
||||
@@ -103,6 +104,7 @@ export interface ServerParsedArgs {
|
||||
'auth'?: string;
|
||||
'disable-file-downloads'?: boolean;
|
||||
'disable-file-uploads'?: boolean;
|
||||
'locale'?: string
|
||||
+ 'disable-getting-started-override'?: boolean,
|
||||
|
||||
/* ----- server setup ----- */
|
||||
@@ -213,16 +213,16 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
@@ -7,7 +7,7 @@ import { Event } from 'vs/base/common/ev
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||
-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, MainEditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds, TitleBarVisibleContext, TitleBarStyleContext, MultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext, ActiveCompareEditorCanSwapContext, IsEnabledFileDownloads, IsEnabledFileUploads } from 'vs/workbench/common/contextkeys';
|
||||
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, MainEditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds, TitleBarVisibleContext, TitleBarStyleContext, MultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext, ActiveCompareEditorCanSwapContext, IsEnabledFileDownloads, IsEnabledFileUploads, IsEnabledCoderGettingStarted, } from 'vs/workbench/common/contextkeys';
|
||||
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow } from 'vs/base/browser/dom';
|
||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
@@ -228,6 +228,7 @@ export class WorkbenchContextKeysHandler
|
||||
@@ -7,7 +7,7 @@ import { Event } from '../../base/common
|
||||
import { Disposable } from '../../base/common/lifecycle.js';
|
||||
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js';
|
||||
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../platform/contextkey/common/contextkeys.js';
|
||||
-import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, IsEnabledFileDownloads, IsEnabledFileUploads } from '../common/contextkeys.js';
|
||||
+import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, IsEnabledFileDownloads, IsEnabledFileUploads, IsEnabledCoderGettingStarted, } from '../common/contextkeys.js';
|
||||
import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow, isEditableElement } from '../../base/browser/dom.js';
|
||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js';
|
||||
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
||||
@@ -200,6 +200,7 @@ export class WorkbenchContextKeysHandler
|
||||
// code-server
|
||||
IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
|
||||
IsEnabledFileUploads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileUploads ?? true)
|
||||
|
||||
@@ -17,9 +17,9 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
@@ -1,7 +1,10 @@
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
+import { localize } from 'vs/nls';
|
||||
+import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||
import { Disposable } from "../../base/common/lifecycle.js";
|
||||
+import { localize } from '../../nls.js';
|
||||
+import { INotificationService, Severity } from '../../platform/notification/common/notification.js';
|
||||
|
||||
export class CodeServerClient extends Disposable {
|
||||
constructor (
|
||||
|
||||
@@ -3,26 +3,28 @@ Prepare Code for integration with code-server
|
||||
1. We already have the arguments so allow passing them in. There is also a
|
||||
slight change in a few directories to preserve the directory structure we
|
||||
have been using and to not override passed-in arguments.
|
||||
2. Modify the terminal environment to filter out code-server environment variables.
|
||||
3. Add the code-server version to the help dialog.
|
||||
4. Add ready events for use in an iframe.
|
||||
5. Add our icons.
|
||||
6. Use our own manifest.
|
||||
2. Modify the entry point to allow importing the code, instead of just running
|
||||
the server immediately.
|
||||
3. Modify the terminal environment to filter out code-server environment variables.
|
||||
4. Add the code-server version to the help dialog.
|
||||
5. Add ready events for use in an iframe.
|
||||
6. Add our icons and remove the existing ones.
|
||||
7. Use our own manifest.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/server.main.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/server.main.ts
|
||||
@@ -12,7 +12,7 @@ import { createServer as doCreateServer,
|
||||
import { parseArgs, ErrorReporter } from 'vs/platform/environment/node/argv';
|
||||
import { join, dirname } from 'vs/base/common/path';
|
||||
import { parseArgs, ErrorReporter } from '../../platform/environment/node/argv.js';
|
||||
import { join, dirname } from '../../base/common/path.js';
|
||||
import { performance } from 'perf_hooks';
|
||||
-import { serverOptions } from 'vs/server/node/serverEnvironmentService';
|
||||
+import { serverOptions, ServerParsedArgs } from 'vs/server/node/serverEnvironmentService';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import * as perf from 'vs/base/common/performance';
|
||||
-import { serverOptions } from './serverEnvironmentService.js';
|
||||
+import { serverOptions, ServerParsedArgs } from './serverEnvironmentService.js';
|
||||
import product from '../../platform/product/common/product.js';
|
||||
import * as perf from '../../base/common/performance.js';
|
||||
|
||||
@@ -34,38 +34,43 @@ const errorReporter: ErrorReporter = {
|
||||
@@ -34,38 +34,47 @@ const errorReporter: ErrorReporter = {
|
||||
}
|
||||
};
|
||||
|
||||
@@ -78,7 +80,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
||||
*/
|
||||
-export function spawnCli() {
|
||||
- runCli(args, REMOTE_DATA_FOLDER, serverOptions);
|
||||
+export function spawnCli(args = parse()): Promise<void> {
|
||||
+function spawnCli(args = parse()): Promise<void> {
|
||||
+ return runCli(args, createDirs(args), serverOptions);
|
||||
}
|
||||
|
||||
@@ -87,9 +89,13 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
||||
*/
|
||||
-export function createServer(address: string | net.AddressInfo | null): Promise<IServerAPI> {
|
||||
- return doCreateServer(address, args, REMOTE_DATA_FOLDER);
|
||||
+export function createServer(address: string | net.AddressInfo | null, args = parse()): Promise<IServerAPI> {
|
||||
+function createServer(address: string | net.AddressInfo | null, args = parse()): Promise<IServerAPI> {
|
||||
+ return doCreateServer(address, args, createDirs(args));
|
||||
}
|
||||
+
|
||||
+// The aliases prevent the names getting mangled during minification which would
|
||||
+// make it difficult to import.
|
||||
+export { spawnCli as spawnCli, createServer as createServer };
|
||||
Index: code-server/lib/vscode/src/vs/base/common/processes.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/processes.ts
|
||||
@@ -126,7 +132,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
--- /dev/null
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
@@ -0,0 +1,46 @@
|
||||
+import { Disposable } from 'vs/base/common/lifecycle';
|
||||
+import { Disposable } from "../../base/common/lifecycle.js";
|
||||
+
|
||||
+export class CodeServerClient extends Disposable {
|
||||
+ constructor (
|
||||
@@ -176,14 +182,14 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
@@ -64,6 +64,7 @@ import { IOpenerService } from 'vs/platf
|
||||
import { mixin, safeStringify } from 'vs/base/common/objects';
|
||||
import { IndexedDB } from 'vs/base/browser/indexedDB';
|
||||
import { WebFileSystemAccess } from 'vs/platform/files/browser/webFileSystemAccess';
|
||||
+import { CodeServerClient } from 'vs/workbench/browser/client';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IProgressService } from 'vs/platform/progress/common/progress';
|
||||
import { DelayedLogChannel } from 'vs/workbench/services/output/common/delayedLogChannel';
|
||||
@@ -64,6 +64,7 @@ import { IOpenerService } from '../../pl
|
||||
import { mixin, safeStringify } from '../../base/common/objects.js';
|
||||
import { IndexedDB } from '../../base/browser/indexedDB.js';
|
||||
import { WebFileSystemAccess } from '../../platform/files/browser/webFileSystemAccess.js';
|
||||
+import { CodeServerClient } from '../../workbench/browser/client.js';
|
||||
import { ITelemetryService } from '../../platform/telemetry/common/telemetry.js';
|
||||
import { IProgressService } from '../../platform/progress/common/progress.js';
|
||||
import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js';
|
||||
@@ -131,6 +132,9 @@ export class BrowserMain extends Disposa
|
||||
// Startup
|
||||
const instantiationService = workbench.startup();
|
||||
@@ -221,19 +227,18 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
|
||||
|
||||
<!-- Disable pinch zooming -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||
@@ -26,9 +27,9 @@
|
||||
@@ -26,8 +27,9 @@
|
||||
<meta id="vscode-workbench-builtin-extensions" data-settings="{{WORKBENCH_BUILTIN_EXTENSIONS}}">
|
||||
|
||||
<!-- Workbench Icon/Manifest/CSS -->
|
||||
- <link rel="icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/favicon.ico" type="image/x-icon" />
|
||||
- <link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/manifest.json" crossorigin="use-credentials" />
|
||||
-
|
||||
+ <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
+ <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
+ <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||
</head>
|
||||
<style id="vscode-css-modules" type="text/css" media="screen"></style>
|
||||
|
||||
<body aria-label="">
|
||||
</head>
|
||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
@@ -257,18 +262,63 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
+ <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
+ <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
+ <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||
<link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.css">
|
||||
<link rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.css">
|
||||
|
||||
</head>
|
||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -307,6 +307,7 @@ export class WebClientServer {
|
||||
@@ -308,6 +308,7 @@ export class WebClientServer {
|
||||
} : undefined;
|
||||
|
||||
const productConfiguration = <Partial<IProductConfiguration>>{
|
||||
const productConfiguration = {
|
||||
+ codeServerVersion: this._productService.codeServerVersion,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
||||
...this._productService.extensionsGallery,
|
||||
Index: code-server/lib/vscode/src/server-main.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/server-main.ts
|
||||
+++ code-server/lib/vscode/src/server-main.ts
|
||||
@@ -25,6 +25,9 @@ const __dirname = path.dirname(fileURLTo
|
||||
perf.mark('code/server/start');
|
||||
(globalThis as any).vscodeServerStartTime = performance.now();
|
||||
|
||||
+// This is not indented to make the diff less noisy. We need to move this out
|
||||
+// of the top-level so it will not run immediately and we can control the start.
|
||||
+async function start() {
|
||||
// Do a quick parse to determine if a server or the cli needs to be started
|
||||
const parsedArgs = minimist(process.argv.slice(2), {
|
||||
boolean: ['start-server', 'list-extensions', 'print-ip-address', 'help', 'version', 'accept-server-license-terms', 'update-extensions'],
|
||||
@@ -153,6 +156,7 @@ if (shouldSpawnCli) {
|
||||
}
|
||||
});
|
||||
}
|
||||
+}
|
||||
|
||||
function sanitizeStringArg(val: any): string | undefined {
|
||||
if (Array.isArray(val)) { // if an argument is passed multiple times, minimist creates an array
|
||||
@@ -283,3 +287,22 @@ function prompt(question: string): Promi
|
||||
});
|
||||
});
|
||||
}
|
||||
+
|
||||
+async function loadCodeWithNls() {
|
||||
+ const nlsConfiguration = await resolveNLSConfiguration({
|
||||
+ userLocale: 'en',
|
||||
+ osLocale: 'en',
|
||||
+ commit: product.commit,
|
||||
+ userDataPath: '',
|
||||
+ nlsMetadataPath: __dirname,
|
||||
+ });
|
||||
+ return loadCode(nlsConfiguration);
|
||||
+}
|
||||
+
|
||||
+// This alias prevents the name getting mangled during minification which would
|
||||
+// make it difficult to import.
|
||||
+export { loadCodeWithNls as loadCodeWithNls };
|
||||
+
|
||||
+if (!process.env.CODE_SERVER_PARENT_PID) {
|
||||
+ start();
|
||||
+}
|
||||
|
||||
@@ -12,4 +12,4 @@ Index: code-server/lib/vscode/src/vs/platform/request/node/proxy.ts
|
||||
+ keepAlive: true,
|
||||
};
|
||||
|
||||
return requestURL.protocol === 'http:'
|
||||
if (requestURL.protocol === 'http:') {
|
||||
|
||||
@@ -18,7 +18,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -329,6 +329,7 @@ export class WebClientServer {
|
||||
@@ -330,6 +330,7 @@ export class WebClientServer {
|
||||
remoteAuthority,
|
||||
serverBasePath: this._basePath,
|
||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
|
||||
@@ -20,7 +20,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
@@ -15,6 +15,7 @@ import { URI } from 'vs/base/common/uri'
|
||||
@@ -15,6 +15,7 @@ import { URI } from '../../base/common/u
|
||||
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
|
||||
/* ----- code-server ----- */
|
||||
'disable-update-check': { type: 'boolean' },
|
||||
@@ -40,27 +40,27 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -312,6 +312,7 @@ export class WebClientServer {
|
||||
@@ -313,6 +313,7 @@ export class WebClientServer {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
rootEndpoint: base,
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
+ logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
};
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
@@ -1,11 +1,15 @@
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { localize } from 'vs/nls';
|
||||
+import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';
|
||||
+import { CommandsRegistry } from 'vs/platform/commands/common/commands';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
|
||||
import { Disposable } from "../../base/common/lifecycle.js";
|
||||
import { localize } from '../../nls.js';
|
||||
+import { MenuId, MenuRegistry } from '../../platform/actions/common/actions.js';
|
||||
+import { CommandsRegistry } from '../../platform/commands/common/commands.js';
|
||||
import { ILogService } from '../../platform/log/common/log.js';
|
||||
import { INotificationService, Severity } from '../../platform/notification/common/notification.js';
|
||||
import { IProductService } from '../../platform/product/common/productService.js';
|
||||
import { IStorageService, StorageScope, StorageTarget } from '../../platform/storage/common/storage.js';
|
||||
|
||||
export class CodeServerClient extends Disposable {
|
||||
+ static LOGOUT_COMMAND_ID = 'code-server.logout';
|
||||
|
||||
@@ -40,7 +40,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -114,7 +114,7 @@ export class WebClientServer {
|
||||
@@ -115,7 +115,7 @@ export class WebClientServer {
|
||||
|
||||
this._staticRoute = `${serverRootPath}/static`;
|
||||
this._callbackRoute = `${serverRootPath}/callback`;
|
||||
@@ -49,27 +49,35 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -312,14 +312,7 @@ export class WebClientServer {
|
||||
@@ -313,14 +313,7 @@ export class WebClientServer {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
rootEndpoint: base,
|
||||
embedderIdentifier: 'server-distro',
|
||||
- extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||
- extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
||||
- ...this._productService.extensionsGallery,
|
||||
- 'resourceUrlTemplate': this._webExtensionResourceUrlTemplate.with({
|
||||
- resourceUrlTemplate: this._webExtensionResourceUrlTemplate.with({
|
||||
- scheme: 'http',
|
||||
- authority: remoteAuthority,
|
||||
- path: `${this._webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
|
||||
- }).toString(true)
|
||||
- } : undefined
|
||||
+ extensionsGallery: this._productService.extensionsGallery,
|
||||
};
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
|
||||
if (!this._environmentService.isBuilt) {
|
||||
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
@@ -140,9 +140,9 @@ export abstract class AbstractExtensionR
|
||||
@@ -15,7 +15,6 @@ import { getServiceMachineId } from '../
|
||||
import { IStorageService } from '../../storage/common/storage.js';
|
||||
import { TelemetryLevel } from '../../telemetry/common/telemetry.js';
|
||||
import { getTelemetryLevel, supportsTelemetry } from '../../telemetry/common/telemetryUtils.js';
|
||||
-import { RemoteAuthorities } from '../../../base/common/network.js';
|
||||
import { TargetPlatform } from '../../extensions/common/extensions.js';
|
||||
|
||||
const WEB_EXTENSION_RESOURCE_END_POINT_SEGMENT = '/web-extension-resource/';
|
||||
@@ -140,9 +139,9 @@ export abstract class AbstractExtensionR
|
||||
}
|
||||
|
||||
protected _isWebExtensionResourceEndPoint(uri: URI): boolean {
|
||||
|
||||
@@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extens
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
||||
@@ -312,10 +312,7 @@ function extensionDescriptionArrayToMap(
|
||||
@@ -313,10 +313,7 @@ function extensionDescriptionArrayToMap(
|
||||
}
|
||||
|
||||
export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {
|
||||
@@ -26,7 +26,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extens
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts
|
||||
@@ -24,7 +24,7 @@ export class ExtensionsProposedApi {
|
||||
@@ -31,7 +31,7 @@ export class ExtensionsProposedApi {
|
||||
|
||||
this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id)));
|
||||
|
||||
|
||||
@@ -71,14 +71,14 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -313,6 +313,7 @@ export class WebClientServer {
|
||||
@@ -314,6 +314,7 @@ export class WebClientServer {
|
||||
rootEndpoint: base,
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
||||
+ proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? base + '/proxy/{{port}}/',
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
};
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||
@@ -97,14 +97,14 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
@@ -19,6 +19,7 @@ import { ISecretStorageProvider } from '
|
||||
import { isFolderToOpen, isWorkspaceToOpen } from 'vs/platform/window/common/window';
|
||||
import type { IWorkbenchConstructionOptions, IWorkspace, IWorkspaceProvider } from 'vs/workbench/browser/web.api';
|
||||
import { AuthenticationSessionInfo } from 'vs/workbench/services/authentication/browser/authenticationService';
|
||||
+import { extractLocalHostUriMetaDataForPortMapping, TunnelOptions, TunnelCreationOptions } from 'vs/platform/tunnel/common/tunnel';
|
||||
import type { IURLCallbackProvider } from 'vs/workbench/services/url/browser/urlService';
|
||||
import { create } from 'vs/workbench/workbench.web.main';
|
||||
import { isFolderToOpen, isWorkspaceToOpen } from '../../../platform/window/common/window.js';
|
||||
import type { IWorkbenchConstructionOptions, IWorkspace, IWorkspaceProvider } from '../../../workbench/browser/web.api.js';
|
||||
import { AuthenticationSessionInfo } from '../../../workbench/services/authentication/browser/authenticationService.js';
|
||||
+import { extractLocalHostUriMetaDataForPortMapping, TunnelOptions, TunnelCreationOptions } from '../../../platform/tunnel/common/tunnel.js';
|
||||
import type { IURLCallbackProvider } from '../../../workbench/services/url/browser/urlService.js';
|
||||
import { create } from '../../../workbench/workbench.web.main.internal.js';
|
||||
|
||||
@@ -571,6 +572,39 @@ class WorkspaceProvider implements IWork
|
||||
@@ -584,6 +585,39 @@ class WorkspaceProvider implements IWork
|
||||
settingsSyncOptions: config.settingsSyncOptions ? { enabled: config.settingsSyncOptions.enabled, } : undefined,
|
||||
workspaceProvider: WorkspaceProvider.create(config),
|
||||
urlCallbackProvider: new LocalStorageURLCallbackProvider(config.callbackRoute),
|
||||
@@ -148,12 +148,14 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExpl
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
|
||||
@@ -77,7 +77,7 @@ export class ForwardedPortsView extends
|
||||
private async enableForwardedPortsView() {
|
||||
@@ -77,8 +77,8 @@ export class ForwardedPortsView extends
|
||||
private async enableForwardedPortsFeatures() {
|
||||
this.contextKeyListener.clear();
|
||||
|
||||
- const featuresEnabled: boolean = !!forwardedPortsFeaturesEnabled.getValue(this.contextKeyService);
|
||||
- const viewEnabled: boolean = !!forwardedPortsViewEnabled.getValue(this.contextKeyService);
|
||||
+ const featuresEnabled: boolean = true;
|
||||
+ const viewEnabled: boolean = true;
|
||||
|
||||
if (viewEnabled) {
|
||||
const viewContainer = await this.getViewContainer();
|
||||
if (featuresEnabled || viewEnabled) {
|
||||
// Also enable the view if it isn't already.
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
Revert back to es2020
|
||||
|
||||
es2022 outputs static blocks when using static properties that are not
|
||||
compatible with Safari, or at least not older versions of Safari.
|
||||
|
||||
Index: code-server/lib/vscode/src/tsconfig.base.json
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/tsconfig.base.json
|
||||
+++ code-server/lib/vscode/src/tsconfig.base.json
|
||||
@@ -17,9 +17,30 @@
|
||||
"./vs/*"
|
||||
]
|
||||
},
|
||||
- "target": "es2022",
|
||||
- "useDefineForClassFields": false,
|
||||
+ "target": "es2020",
|
||||
"lib": [
|
||||
+ "ES2016",
|
||||
+ "ES2017.Object",
|
||||
+ "ES2017.String",
|
||||
+ "ES2017.Intl",
|
||||
+ "ES2017.TypedArrays",
|
||||
+ "ES2018.AsyncIterable",
|
||||
+ "ES2018.AsyncGenerator",
|
||||
+ "ES2018.Promise",
|
||||
+ "ES2018.Regexp",
|
||||
+ "ES2018.Intl",
|
||||
+ "ES2019.Array",
|
||||
+ "ES2019.Object",
|
||||
+ "ES2019.String",
|
||||
+ "ES2019.Symbol",
|
||||
+ "ES2020.BigInt",
|
||||
+ "ES2020.Promise",
|
||||
+ "ES2020.String",
|
||||
+ "ES2020.Symbol.WellKnown",
|
||||
+ "ES2020.Intl",
|
||||
+ "ES2021.Promise",
|
||||
+ "ES2021.String",
|
||||
+ "ES2021.WeakRef",
|
||||
"ES2022",
|
||||
"DOM",
|
||||
"DOM.Iterable",
|
||||
Index: code-server/lib/vscode/build/lib/tsb/transpiler.js
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/build/lib/tsb/transpiler.js
|
||||
+++ code-server/lib/vscode/build/lib/tsb/transpiler.js
|
||||
@@ -293,7 +293,7 @@ class SwcTranspiler {
|
||||
tsx: false,
|
||||
decorators: true
|
||||
},
|
||||
- target: 'es2022',
|
||||
+ target: 'es2020',
|
||||
loose: false,
|
||||
minify: {
|
||||
compress: false,
|
||||
Index: code-server/lib/vscode/build/lib/tsb/transpiler.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/build/lib/tsb/transpiler.ts
|
||||
+++ code-server/lib/vscode/build/lib/tsb/transpiler.ts
|
||||
@@ -376,7 +376,7 @@ export class SwcTranspiler implements IT
|
||||
tsx: false,
|
||||
decorators: true
|
||||
},
|
||||
- target: 'es2022',
|
||||
+ target: 'es2020',
|
||||
loose: false,
|
||||
minify: {
|
||||
compress: false,
|
||||
@@ -15,8 +15,8 @@ service-worker.diff
|
||||
sourcemaps.diff
|
||||
external-file-actions.diff
|
||||
telemetry.diff
|
||||
display-language.diff
|
||||
cli-window-open.diff
|
||||
getting-started.diff
|
||||
safari.diff
|
||||
keepalive.diff
|
||||
clipboard.diff
|
||||
display-language.diff
|
||||
|
||||
@@ -54,7 +54,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -314,6 +314,10 @@ export class WebClientServer {
|
||||
@@ -315,6 +315,10 @@ export class WebClientServer {
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
||||
proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? base + '/proxy/{{port}}/',
|
||||
@@ -64,4 +64,4 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+ },
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
};
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
|
||||
@@ -10,7 +10,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
|
||||
+++ code-server/lib/vscode/build/gulpfile.reh.js
|
||||
@@ -236,8 +236,7 @@ function packageTask(type, platform, arc
|
||||
@@ -253,8 +253,7 @@ function packageTask(type, platform, arc
|
||||
|
||||
const src = gulp.src(sourceFolderName + '/**', { base: '.' })
|
||||
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + sourceFolderName), 'out'); }))
|
||||
@@ -20,7 +20,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
||||
|
||||
const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
|
||||
const isUIExtension = (manifest) => {
|
||||
@@ -276,9 +275,9 @@ function packageTask(type, platform, arc
|
||||
@@ -293,9 +292,9 @@ function packageTask(type, platform, arc
|
||||
.map(name => `.build/extensions/${name}/**`);
|
||||
|
||||
const extensions = gulp.src(extensionPaths, { base: '.build', dot: true });
|
||||
@@ -32,11 +32,11 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
||||
|
||||
let version = packageJson.version;
|
||||
const quality = product.quality;
|
||||
@@ -439,7 +438,7 @@ function tweakProductForServerWeb(produc
|
||||
@@ -454,7 +453,7 @@ function tweakProductForServerWeb(produc
|
||||
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
|
||||
optimizeTask,
|
||||
bundleTask,
|
||||
util.rimraf(`out-vscode-${type}-min`),
|
||||
- optimize.minifyTask(`out-vscode-${type}`, `https://ticino.blob.core.windows.net/sourcemaps/${commit}/core`)
|
||||
- optimize.minifyTask(`out-vscode-${type}`, `https://main.vscode-cdn.net/sourcemaps/${commit}/core`)
|
||||
+ optimize.minifyTask(`out-vscode-${type}`, ``)
|
||||
));
|
||||
gulp.task(minifyTask);
|
||||
|
||||
@@ -15,24 +15,23 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.ts
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
@@ -3,6 +3,7 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
-
|
||||
+import * as _http from 'http';
|
||||
import * as performance from 'vs/base/common/performance';
|
||||
import { createApiFactoryAndRegisterActors } from 'vs/workbench/api/common/extHost.api.impl';
|
||||
import { RequireInterceptor } from 'vs/workbench/api/common/extHostRequireInterceptor';
|
||||
@@ -17,6 +17,7 @@ import { ExtensionRuntime } from 'vs/wor
|
||||
import { CLIServer } from 'vs/workbench/api/node/extHostCLIServer';
|
||||
import { realpathSync } from 'vs/base/node/extpath';
|
||||
import { ExtHostConsoleForwarder } from 'vs/workbench/api/node/extHostConsoleForwarder';
|
||||
+import { IExtHostWorkspace } from '../common/extHostWorkspace';
|
||||
import { ExtHostDiskFileSystemProvider } from 'vs/workbench/api/node/extHostDiskFileSystemProvider';
|
||||
|
||||
class NodeModuleRequireInterceptor extends RequireInterceptor {
|
||||
@@ -83,6 +84,52 @@ export class ExtHostExtensionService ext
|
||||
+import * as _http from 'http';
|
||||
import * as performance from '../../../base/common/performance.js';
|
||||
import { createApiFactoryAndRegisterActors } from '../common/extHost.api.impl.js';
|
||||
import { RequireInterceptor } from '../common/extHostRequireInterceptor.js';
|
||||
@@ -17,6 +18,7 @@ import { ExtensionRuntime } from '../com
|
||||
import { CLIServer } from './extHostCLIServer.js';
|
||||
import { realpathSync } from '../../../base/node/extpath.js';
|
||||
import { ExtHostConsoleForwarder } from './extHostConsoleForwarder.js';
|
||||
+import { IExtHostWorkspace } from '../common/extHostWorkspace.js';
|
||||
import { ExtHostDiskFileSystemProvider } from './extHostDiskFileSystemProvider.js';
|
||||
import { createRequire } from 'node:module';
|
||||
const require = createRequire(import.meta.url);
|
||||
@@ -97,6 +99,52 @@ export class ExtHostExtensionService ext
|
||||
await interceptor.install();
|
||||
performance.mark('code/extHost/didInitAPI');
|
||||
|
||||
@@ -84,7 +83,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.
|
||||
+
|
||||
// Do this when extension service exists, but extensions are not being activated yet.
|
||||
const configProvider = await this._extHostConfiguration.getConfigProvider();
|
||||
await connectProxyResolver(this._extHostWorkspace, configProvider, this, this._logService, this._mainThreadTelemetryProxy, this._initData);
|
||||
await connectProxyResolver(this._extHostWorkspace, configProvider, this, this._logService, this._mainThreadTelemetryProxy, this._initData, this._store);
|
||||
Index: code-server/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
|
||||
@@ -94,10 +93,10 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
+import * as _http from 'http';
|
||||
import minimist from 'minimist';
|
||||
import * as nativeWatchdog from 'native-watchdog';
|
||||
import * as net from 'net';
|
||||
import * as minimist from 'minimist';
|
||||
@@ -418,7 +419,28 @@ async function startExtensionHostProcess
|
||||
@@ -422,7 +423,28 @@ async function startExtensionHostProcess
|
||||
);
|
||||
|
||||
// rewrite onTerminate-function to be a proper shutdown
|
||||
|
||||
@@ -12,26 +12,34 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
@@ -65,6 +65,7 @@ import { IExtensionsScannerService } fro
|
||||
import { ExtensionsScannerService } from 'vs/server/node/extensionsScannerService';
|
||||
import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService';
|
||||
import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile';
|
||||
+import { TelemetryClient } from 'vs/server/node/telemetryClient';
|
||||
import { NullPolicyService } from 'vs/platform/policy/common/policy';
|
||||
import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender';
|
||||
import { LoggerService } from 'vs/platform/log/node/loggerService';
|
||||
@@ -146,11 +147,23 @@ export async function setupServerService
|
||||
const requestService = new RequestService(configurationService, environmentService, logService, loggerService);
|
||||
@@ -4,6 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { hostname, release } from 'os';
|
||||
+import { promises as fs } from 'fs';
|
||||
import { Emitter, Event } from '../../base/common/event.js';
|
||||
import { DisposableStore, toDisposable } from '../../base/common/lifecycle.js';
|
||||
import { Schemas } from '../../base/common/network.js';
|
||||
@@ -65,6 +66,7 @@ import { IExtensionsScannerService } fro
|
||||
import { ExtensionsScannerService } from './extensionsScannerService.js';
|
||||
import { IExtensionsProfileScannerService } from '../../platform/extensionManagement/common/extensionsProfileScannerService.js';
|
||||
import { IUserDataProfilesService } from '../../platform/userDataProfile/common/userDataProfile.js';
|
||||
+import { TelemetryClient } from './telemetryClient.js';
|
||||
import { NullPolicyService } from '../../platform/policy/common/policy.js';
|
||||
import { OneDataSystemAppender } from '../../platform/telemetry/node/1dsAppender.js';
|
||||
import { LoggerService } from '../../platform/log/node/loggerService.js';
|
||||
@@ -151,11 +153,23 @@ export async function setupServerService
|
||||
const requestService = new RequestService(configurationService, environmentService, logService);
|
||||
services.set(IRequestService, requestService);
|
||||
|
||||
+ let isContainer = undefined;
|
||||
+ try {
|
||||
+ await Promises.stat('/run/.containerenv');
|
||||
+ await fs.stat('/run/.containerenv');
|
||||
+ isContainer = true;
|
||||
+ } catch (error) { /* Does not exist, probably. */ }
|
||||
+ if (!isContainer) {
|
||||
+ try {
|
||||
+ const content = await Promises.readFile('/proc/self/cgroup', 'utf8')
|
||||
+ const content = await fs.readFile('/proc/self/cgroup', 'utf8')
|
||||
+ isContainer = content.includes('docker');
|
||||
+ } catch (error) { /* Permission denied, probably. */ }
|
||||
+ }
|
||||
@@ -50,50 +58,66 @@ Index: code-server/lib/vscode/src/vs/server/node/telemetryClient.ts
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ code-server/lib/vscode/src/vs/server/node/telemetryClient.ts
|
||||
@@ -0,0 +1,55 @@
|
||||
@@ -0,0 +1,71 @@
|
||||
+import { AppInsightsCore, IExtendedTelemetryItem, ITelemetryItem } from '@microsoft/1ds-core-js';
|
||||
+import * as https from 'https';
|
||||
+import * as http from 'http';
|
||||
+import * as os from 'os';
|
||||
+
|
||||
+interface SystemInfo {
|
||||
+ measurements: Record<string, number | undefined>;
|
||||
+ properties: Record<string, string | boolean | null | undefined>;
|
||||
+}
|
||||
+
|
||||
+export class TelemetryClient extends AppInsightsCore {
|
||||
+ private readonly systemInfo: SystemInfo = {
|
||||
+ measurements: {},
|
||||
+ properties: {},
|
||||
+ };
|
||||
+
|
||||
+ public constructor(
|
||||
+ private readonly endpoint: string,
|
||||
+ private readonly machineId: string,
|
||||
+ private readonly isContainer: Boolean | undefined) {
|
||||
+ machineId: string,
|
||||
+ isContainer: boolean | undefined) {
|
||||
+ super();
|
||||
+
|
||||
+ // os.cpus() can take a very long time sometimes (personally I see 1-2
|
||||
+ // seconds in a Coder workspace). This adds up significantly, especially
|
||||
+ // when many telemetry requests are sent during startup, which can cause
|
||||
+ // connection timeouts. Try to cache as much as we can.
|
||||
+ try {
|
||||
+ const cpus = os.cpus();
|
||||
+ this.systemInfo.measurements.cores = cpus.length;
|
||||
+ this.systemInfo.properties['common.cpuModel'] = cpus[0].model;
|
||||
+ } catch (error) {}
|
||||
+
|
||||
+ try {
|
||||
+ this.systemInfo.properties['common.shell'] = os.userInfo().shell;
|
||||
+ this.systemInfo.properties['common.release'] = os.release();
|
||||
+ this.systemInfo.properties['common.arch'] = os.arch();
|
||||
+ } catch (error) {}
|
||||
+
|
||||
+ this.systemInfo.properties['common.remoteMachineId'] = machineId;
|
||||
+ this.systemInfo.properties['common.isContainer'] = isContainer;
|
||||
+ }
|
||||
+
|
||||
+ public override track(item: IExtendedTelemetryItem | ITelemetryItem): void {
|
||||
+ const options = item.baseData || {}
|
||||
+ if (!options.properties) {
|
||||
+ options.properties = {};
|
||||
+ options.measurements = {
|
||||
+ ...(options.measurements || {}),
|
||||
+ ...this.systemInfo.measurements,
|
||||
+ }
|
||||
+ if (!options.measurements) {
|
||||
+ options.measurements = {};
|
||||
+ options.properties = {
|
||||
+ ...(options.properties || {}),
|
||||
+ ...this.systemInfo.properties,
|
||||
+ }
|
||||
+
|
||||
+ try {
|
||||
+ const cpus = os.cpus();
|
||||
+ options.measurements.cores = cpus.length;
|
||||
+ options.properties['common.cpuModel'] = cpus[0].model;
|
||||
+ } catch (error) {}
|
||||
+
|
||||
+ try {
|
||||
+ options.measurements.memoryFree = os.freemem();
|
||||
+ options.measurements.memoryTotal = os.totalmem();
|
||||
+ } catch (error) {}
|
||||
+
|
||||
+ try {
|
||||
+ options.properties['common.shell'] = os.userInfo().shell;
|
||||
+ options.properties['common.release'] = os.release();
|
||||
+ options.properties['common.arch'] = os.arch();
|
||||
+ } catch (error) {}
|
||||
+
|
||||
+ options.properties['common.remoteMachineId'] = this.machineId;
|
||||
+ options.properties['common.isContainer'] = this.isContainer;
|
||||
+
|
||||
+ try {
|
||||
+ const request = (/^http:/.test(this.endpoint) ? http : https).request(this.endpoint, {
|
||||
+ method: 'POST',
|
||||
+ headers: {
|
||||
@@ -110,7 +134,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -318,6 +318,8 @@ export class WebClientServer {
|
||||
@@ -319,6 +319,8 @@ export class WebClientServer {
|
||||
scope: vscodeBase + '/',
|
||||
path: base + '/_static/out/browser/serviceWorker.js',
|
||||
},
|
||||
@@ -118,7 +142,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+ telemetryEndpoint: this._productService.telemetryEndpoint,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
};
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||
|
||||
@@ -14,10 +14,10 @@ Index: code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageS
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts
|
||||
@@ -18,6 +18,7 @@ import { AbstractStorageService, isProfi
|
||||
import { isUserDataProfile, IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile';
|
||||
import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace';
|
||||
import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile';
|
||||
+import { hash } from 'vs/base/common/hash';
|
||||
import { isUserDataProfile, IUserDataProfile } from '../../../../platform/userDataProfile/common/userDataProfile.js';
|
||||
import { IAnyWorkspaceIdentifier } from '../../../../platform/workspace/common/workspace.js';
|
||||
import { IUserDataProfileService } from '../../userDataProfile/common/userDataProfile.js';
|
||||
+import { hash } from '../../../../base/common/hash.js';
|
||||
|
||||
export class BrowserStorageService extends AbstractStorageService {
|
||||
|
||||
|
||||
@@ -13,12 +13,12 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
@@ -1,10 +1,16 @@
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { localize } from 'vs/nls';
|
||||
+import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||
+import { IProductService } from 'vs/platform/product/common/productService';
|
||||
+import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
|
||||
import { Disposable } from "../../base/common/lifecycle.js";
|
||||
import { localize } from '../../nls.js';
|
||||
+import { ILogService } from '../../platform/log/common/log.js';
|
||||
import { INotificationService, Severity } from '../../platform/notification/common/notification.js';
|
||||
+import { IProductService } from '../../platform/product/common/productService.js';
|
||||
+import { IStorageService, StorageScope, StorageTarget } from '../../platform/storage/common/storage.js';
|
||||
|
||||
export class CodeServerClient extends Disposable {
|
||||
constructor (
|
||||
@@ -105,20 +105,20 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -311,6 +311,7 @@ export class WebClientServer {
|
||||
const productConfiguration = <Partial<IProductConfiguration>>{
|
||||
@@ -312,6 +312,7 @@ export class WebClientServer {
|
||||
const productConfiguration = {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
rootEndpoint: base,
|
||||
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
};
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
@@ -13,6 +13,8 @@ import { memoize } from 'vs/base/common/
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
@@ -13,6 +13,8 @@ import { memoize } from '../../base/comm
|
||||
import { URI } from '../../base/common/uri.js';
|
||||
|
||||
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
|
||||
+ /* ----- code-server ----- */
|
||||
|
||||
@@ -54,7 +54,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -325,6 +325,7 @@ export class WebClientServer {
|
||||
@@ -326,6 +326,7 @@ export class WebClientServer {
|
||||
const workbenchWebConfiguration = {
|
||||
remoteAuthority,
|
||||
serverBasePath: this._basePath,
|
||||
@@ -70,12 +70,12 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<meta http-equiv="Content-Security-Policy"
|
||||
- content="default-src 'none'; script-src 'sha256-bQPwjO6bLiyf6v9eDVtAI67LrfonA1w49aFkRXBy4/g=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
+ content="default-src 'none'; script-src 'sha256-R3BsSkqy7qFbvWSmwr7WqT1eg6Sq4zSe0uIlrUQ4EKE=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
- content="default-src 'none'; script-src 'sha256-DXeP32g8BdMsVuVabYTmznoTH59F7M7UtV0vXemEFqc=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
+ content="default-src 'none'; script-src 'sha256-z5v/0xE4zQPgV1fazhHB/UlsTzdm39hRMk3V8Av0HI4=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
|
||||
|
||||
<!-- Disable pinch zooming -->
|
||||
<meta name="viewport"
|
||||
@@ -344,6 +344,12 @@
|
||||
@@ -349,6 +349,12 @@
|
||||
|
||||
const hostname = location.hostname;
|
||||
|
||||
@@ -113,8 +113,8 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/worker/webWor
|
||||
<meta http-equiv="Content-Security-Policy" content="
|
||||
default-src 'none';
|
||||
child-src 'self' data: blob:;
|
||||
- script-src 'self' 'unsafe-eval' 'sha256-75NYUUvf+5++1WbfCZOV3PSWxBhONpaxwx+mkOFRv/Y=' https:;
|
||||
+ script-src 'self' 'unsafe-eval' 'sha256-c7vPrYRaSLDtFSrI4CuHYgBQ3a4c4x2LSm/LefSZADQ=' https:;
|
||||
- script-src 'self' 'unsafe-eval' 'sha256-xM2KVDKIoeb8vVxk4ezEUsxdTZh5wFnKO3YmFhy9tkk=' https: http://localhost:* blob:;
|
||||
+ script-src 'self' 'unsafe-eval' 'sha256-6eZXxikxkENULU0EOkVQSd4hglGixLg3Aow9psZ6u2Y=' https: http://localhost:* blob:;
|
||||
connect-src 'self' https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
self.addEventListener("install", () => {
|
||||
console.debug("[Service Worker] installed")
|
||||
})
|
||||
|
||||
@@ -53,6 +53,7 @@ export interface UserProvidedCodeArgs {
|
||||
"disable-getting-started-override"?: boolean
|
||||
"disable-proxy"?: boolean
|
||||
"session-socket"?: string
|
||||
"abs-proxy-base-path"?: string
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -279,6 +280,10 @@ export const options: Options<Required<UserProvidedArgs>> = {
|
||||
short: "w",
|
||||
description: "Text to show on login page",
|
||||
},
|
||||
"abs-proxy-base-path": {
|
||||
type: "string",
|
||||
description: "The base path to prefix to all absproxy requests",
|
||||
},
|
||||
}
|
||||
|
||||
export const optionDescriptions = (opts: Partial<Options<Required<UserProvidedArgs>>> = options): string[] => {
|
||||
@@ -837,11 +842,6 @@ export interface CodeArgs extends UserProvidedCodeArgs {
|
||||
log?: string[]
|
||||
}
|
||||
|
||||
/**
|
||||
* Types for ../../lib/vscode/src/vs/server/node/server.main.ts:65.
|
||||
*/
|
||||
export type SpawnCodeCli = (args: CodeArgs) => Promise<void>
|
||||
|
||||
/**
|
||||
* Convert our arguments to equivalent VS Code server arguments.
|
||||
* Does not add any extra arguments.
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { field, logger } from "@coder/logger"
|
||||
import http from "http"
|
||||
import * as path from "path"
|
||||
import { Disposable } from "../common/emitter"
|
||||
import { plural } from "../common/util"
|
||||
import { createApp, ensureAddress } from "./app"
|
||||
import { AuthType, DefaultedArgs, Feature, SpawnCodeCli, toCodeArgs, UserProvidedArgs } from "./cli"
|
||||
import { commit, version } from "./constants"
|
||||
import { AuthType, DefaultedArgs, Feature, toCodeArgs, UserProvidedArgs } from "./cli"
|
||||
import { commit, version, vsRootPath } from "./constants"
|
||||
import { register } from "./routes"
|
||||
import { isDirectory, loadAMDModule, open } from "./util"
|
||||
import { VSCodeModule } from "./routes/vscode"
|
||||
import { isDirectory, open } from "./util"
|
||||
|
||||
/**
|
||||
* Return true if the user passed an extension-related VS Code flag.
|
||||
@@ -46,12 +48,13 @@ export interface OpenCommandPipeArgs {
|
||||
*/
|
||||
export const runCodeCli = async (args: DefaultedArgs): Promise<void> => {
|
||||
logger.debug("Running Code CLI")
|
||||
|
||||
// See ../../lib/vscode/src/vs/server/node/server.main.ts:65.
|
||||
const spawnCli = await loadAMDModule<SpawnCodeCli>("vs/server/node/server.main", "spawnCli")
|
||||
|
||||
try {
|
||||
await spawnCli(await toCodeArgs(args))
|
||||
// See vscode.loadVSCode for more on this jank.
|
||||
process.env.CODE_SERVER_PARENT_PID = process.pid.toString()
|
||||
const modPath = path.join(vsRootPath, "out/server-main.js")
|
||||
const mod = (await eval(`import("${modPath}")`)) as VSCodeModule
|
||||
const serverModule = await mod.loadCodeWithNls()
|
||||
await serverModule.spawnCli(await toCodeArgs(args))
|
||||
// Rather than have the caller handle errors and exit, spawnCli will exit
|
||||
// itself. Additionally, it does this on a timeout set to 0. So, try
|
||||
// waiting for VS Code to exit before giving up and doing it ourselves.
|
||||
@@ -164,6 +167,11 @@ export const runCodeServer = async (
|
||||
logger.info(`Session server listening on ${sessionServerAddress.toString()}`)
|
||||
}
|
||||
|
||||
if (process.env.EXTENSIONS_GALLERY) {
|
||||
logger.info("Using custom extensions gallery")
|
||||
logger.debug(` - ${process.env.EXTENSIONS_GALLERY}`)
|
||||
}
|
||||
|
||||
if (args.enable && args.enable.length > 0) {
|
||||
logger.info("Enabling the following experimental features:")
|
||||
args.enable.forEach((feature) => {
|
||||
|
||||
@@ -65,7 +65,7 @@ router.all(/.*/, async (req, res, next) => {
|
||||
const isAuthenticated = await authenticated(req)
|
||||
if (!isAuthenticated) {
|
||||
// Let the assets through since they're used on the login page.
|
||||
if (req.path.startsWith("/static/") && req.method === "GET") {
|
||||
if (req.path.startsWith("/_static/") && req.method === "GET") {
|
||||
return next()
|
||||
}
|
||||
|
||||
|
||||
@@ -121,11 +121,13 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
|
||||
app.router.all("/absproxy/:port/:path(.*)?", async (req, res) => {
|
||||
await pathProxy.proxy(req, res, {
|
||||
passthroughPath: true,
|
||||
proxyBasePath: args["abs-proxy-base-path"],
|
||||
})
|
||||
})
|
||||
app.wsRouter.get("/absproxy/:port/:path(.*)?", async (req) => {
|
||||
await pathProxy.wsProxy(req as pluginapi.WebsocketRequest, {
|
||||
passthroughPath: true,
|
||||
proxyBasePath: args["abs-proxy-base-path"],
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -5,10 +5,15 @@ import { HttpCode, HttpError } from "../../common/http"
|
||||
import { ensureProxyEnabled, authenticated, ensureAuthenticated, ensureOrigin, redirect, self } from "../http"
|
||||
import { proxy as _proxy } from "../proxy"
|
||||
|
||||
const getProxyTarget = (req: Request): string => {
|
||||
const getProxyTarget = (
|
||||
req: Request,
|
||||
opts?: {
|
||||
proxyBasePath?: string
|
||||
},
|
||||
): string => {
|
||||
// If there is a base path, strip it out.
|
||||
const base = (req as any).base || ""
|
||||
return `http://0.0.0.0:${req.params.port}/${req.originalUrl.slice(base.length)}`
|
||||
return `http://0.0.0.0:${req.params.port}${opts?.proxyBasePath || ""}/${req.originalUrl.slice(base.length)}`
|
||||
}
|
||||
|
||||
export async function proxy(
|
||||
@@ -16,6 +21,7 @@ export async function proxy(
|
||||
res: Response,
|
||||
opts?: {
|
||||
passthroughPath?: boolean
|
||||
proxyBasePath?: string
|
||||
},
|
||||
): Promise<void> {
|
||||
ensureProxyEnabled(req)
|
||||
@@ -38,7 +44,7 @@ export async function proxy(
|
||||
|
||||
_proxy.web(req, res, {
|
||||
ignorePath: true,
|
||||
target: getProxyTarget(req),
|
||||
target: getProxyTarget(req, opts),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -46,6 +52,7 @@ export async function wsProxy(
|
||||
req: pluginapi.WebsocketRequest,
|
||||
opts?: {
|
||||
passthroughPath?: boolean
|
||||
proxyBasePath?: string
|
||||
},
|
||||
): Promise<void> {
|
||||
ensureProxyEnabled(req)
|
||||
@@ -59,6 +66,6 @@ export async function wsProxy(
|
||||
|
||||
_proxy.ws(req, req.ws, req.head, {
|
||||
ignorePath: true,
|
||||
target: getProxyTarget(req),
|
||||
target: getProxyTarget(req, opts),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ import * as path from "path"
|
||||
import { WebsocketRequest } from "../../../typings/pluginapi"
|
||||
import { logError } from "../../common/util"
|
||||
import { CodeArgs, toCodeArgs } from "../cli"
|
||||
import { isDevMode } from "../constants"
|
||||
import { isDevMode, vsRootPath } from "../constants"
|
||||
import { authenticated, ensureAuthenticated, ensureOrigin, redirect, replaceTemplates, self } from "../http"
|
||||
import { SocketProxyProvider } from "../socket"
|
||||
import { isFile, loadAMDModule } from "../util"
|
||||
import { isFile } from "../util"
|
||||
import { Router as WsRouter } from "../wsRouter"
|
||||
|
||||
export const router = express.Router()
|
||||
@@ -31,11 +31,52 @@ export interface IVSCodeServerAPI {
|
||||
dispose(): void
|
||||
}
|
||||
|
||||
// See ../../../lib/vscode/src/vs/server/node/server.main.ts:72.
|
||||
export type CreateServer = (address: string | net.AddressInfo | null, args: CodeArgs) => Promise<IVSCodeServerAPI>
|
||||
/**
|
||||
* VS Code's CLI entrypoint (../../../lib/vscode/src/server-main.js).
|
||||
*
|
||||
* Normally VS Code will run `node server-main.js` which starts either the web
|
||||
* server or the CLI (for installing extensions, etc) but we patch it so we can
|
||||
* `require` it and call its functions directly in order to integrate with our
|
||||
* web server.
|
||||
*/
|
||||
export type VSCodeModule = {
|
||||
// See ../../../lib/vscode/src/server-main.js:339.
|
||||
loadCodeWithNls(): Promise<{
|
||||
// See ../../../lib/vscode/src/vs/server/node/server.main.ts:72.
|
||||
createServer(address: string | net.AddressInfo | null, args: CodeArgs): Promise<IVSCodeServerAPI>
|
||||
// See ../../../lib/vscode/src/vs/server/node/server.main.ts:65.
|
||||
spawnCli(args: CodeArgs): Promise<void>
|
||||
}>
|
||||
}
|
||||
|
||||
// The VS Code server is dynamically loaded in when a request is made to this
|
||||
// router by `ensureCodeServerLoaded`.
|
||||
/**
|
||||
* Load then create the VS Code server.
|
||||
*/
|
||||
async function loadVSCode(req: express.Request): Promise<IVSCodeServerAPI> {
|
||||
// Since server-main.js is an ES module, we have to use `import`. However,
|
||||
// tsc will transpile this to `require` unless we change our module type,
|
||||
// which will also require that we switch to ESM, since a hybrid approach
|
||||
// breaks importing `rotating-file-stream` for some reason. To work around
|
||||
// this, use `eval` for now, but we should consider switching to ESM.
|
||||
const modPath = path.join(vsRootPath, "out/server-main.js")
|
||||
const mod = (await eval(`import("${modPath}")`)) as VSCodeModule
|
||||
const serverModule = await mod.loadCodeWithNls()
|
||||
return serverModule.createServer(null, {
|
||||
...(await toCodeArgs(req.args)),
|
||||
"accept-server-license-terms": true,
|
||||
// This seems to be used to make the connection token flags optional (when
|
||||
// set to 1.63) but we have always included them.
|
||||
compatibility: "1.64",
|
||||
"without-connection-token": true,
|
||||
})
|
||||
}
|
||||
|
||||
// To prevent loading the module more than once at a time. We also have the
|
||||
// resolved value so you do not need to `await` everywhere.
|
||||
let vscodeServerPromise: Promise<IVSCodeServerAPI> | undefined
|
||||
|
||||
// The resolved value from the dynamically loaded VS Code server. Do not use
|
||||
// without first calling and awaiting `ensureCodeServerLoaded`.
|
||||
let vscodeServer: IVSCodeServerAPI | undefined
|
||||
|
||||
/**
|
||||
@@ -49,21 +90,21 @@ export const ensureVSCodeLoaded = async (
|
||||
if (vscodeServer) {
|
||||
return next()
|
||||
}
|
||||
// See ../../../lib/vscode/src/vs/server/node/server.main.ts:72.
|
||||
const createVSServer = await loadAMDModule<CreateServer>("vs/server/node/server.main", "createServer")
|
||||
if (!vscodeServerPromise) {
|
||||
vscodeServerPromise = loadVSCode(req)
|
||||
}
|
||||
try {
|
||||
vscodeServer = await createVSServer(null, {
|
||||
...(await toCodeArgs(req.args)),
|
||||
"accept-server-license-terms": true,
|
||||
// This seems to be used to make the connection token flags optional (when
|
||||
// set to 1.63) but we have always included them.
|
||||
compatibility: "1.64",
|
||||
"without-connection-token": true,
|
||||
})
|
||||
vscodeServer = await vscodeServerPromise
|
||||
} catch (error) {
|
||||
vscodeServerPromise = undefined // Unset so we can try again.
|
||||
logError(logger, "CodeServerRouteWrapper", error)
|
||||
if (isDevMode) {
|
||||
return next(new Error((error instanceof Error ? error.message : error) + " (VS Code may still be compiling)"))
|
||||
return next(
|
||||
new Error(
|
||||
(error instanceof Error ? error.message : error) +
|
||||
" (Have you applied the patches? If so, VS Code may still be compiling)",
|
||||
),
|
||||
)
|
||||
}
|
||||
return next(error)
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ export class SocketProxyProvider {
|
||||
proxy.once("connect", () => proxy.write(id))
|
||||
|
||||
const timeout = setTimeout(() => {
|
||||
listener.dispose() // eslint-disable-line @typescript-eslint/no-use-before-define
|
||||
listener.dispose()
|
||||
socket.destroy()
|
||||
proxy.destroy()
|
||||
reject(new Error("TLS socket proxy timed out"))
|
||||
|
||||
@@ -9,7 +9,6 @@ import * as path from "path"
|
||||
import safeCompare from "safe-compare"
|
||||
import * as util from "util"
|
||||
import xdgBasedir from "xdg-basedir"
|
||||
import { vsRootPath } from "./constants"
|
||||
|
||||
export interface Paths {
|
||||
data: string
|
||||
@@ -503,31 +502,6 @@ export function isNodeJSErrnoException(error: unknown): error is NodeJS.ErrnoExc
|
||||
// TODO: Replace with proper templating system.
|
||||
export const escapeJSON = (value: cp.Serializable) => JSON.stringify(value).replace(/"/g, """)
|
||||
|
||||
type AMDModule<T> = { [exportName: string]: T }
|
||||
|
||||
/**
|
||||
* Loads AMD module, typically from a compiled VSCode bundle.
|
||||
*
|
||||
* @deprecated This should be gradually phased out as code-server migrates to lib/vscode
|
||||
* @param amdPath Path to module relative to lib/vscode
|
||||
* @param exportName Given name of export in the file
|
||||
*/
|
||||
export const loadAMDModule = async <T>(amdPath: string, exportName: string): Promise<T> => {
|
||||
// Set default remote native node modules path, if unset
|
||||
process.env["VSCODE_INJECT_NODE_MODULE_LOOKUP_PATH"] =
|
||||
process.env["VSCODE_INJECT_NODE_MODULE_LOOKUP_PATH"] || path.join(vsRootPath, "remote", "node_modules")
|
||||
|
||||
require(path.join(vsRootPath, "out/bootstrap-node")).injectNodeModuleLookupPath(
|
||||
process.env["VSCODE_INJECT_NODE_MODULE_LOOKUP_PATH"],
|
||||
)
|
||||
|
||||
const module = await new Promise<AMDModule<T>>((resolve, reject) => {
|
||||
require(path.join(vsRootPath, "out/bootstrap-amd")).load(amdPath, resolve, reject)
|
||||
})
|
||||
|
||||
return module[exportName] as T
|
||||
}
|
||||
|
||||
/**
|
||||
* Split a string on the first equals. The result will always be an array with
|
||||
* two items regardless of how many equals there are. The second item will be
|
||||
|
||||
@@ -37,7 +37,6 @@ export async function makeEditorSessionManagerServer(
|
||||
): Promise<http.Server> {
|
||||
const router = express()
|
||||
|
||||
// eslint-disable-next-line import/no-named-as-default-member
|
||||
router.use(express.json())
|
||||
|
||||
router.get<{}, GetSessionResponse | string | unknown, undefined, { filePath?: string }>(
|
||||
|
||||
@@ -248,9 +248,10 @@ export class ParentProcess extends Process {
|
||||
const opts = {
|
||||
size: "10M",
|
||||
maxFiles: 10,
|
||||
path: path.join(paths.data, "coder-logs"),
|
||||
}
|
||||
this.logStdoutStream = rfs.createStream(path.join(paths.data, "coder-logs", "code-server-stdout.log"), opts)
|
||||
this.logStderrStream = rfs.createStream(path.join(paths.data, "coder-logs", "code-server-stderr.log"), opts)
|
||||
this.logStdoutStream = rfs.createStream("code-server-stdout.log", opts)
|
||||
this.logStderrStream = rfs.createStream("code-server-stderr.log", opts)
|
||||
|
||||
this.onDispose(() => this.disposeChild())
|
||||
|
||||
|
||||
@@ -54,5 +54,4 @@ export function Router(): WebsocketRouter {
|
||||
return new WebsocketRouter()
|
||||
}
|
||||
|
||||
// eslint-disable-next-line import/no-named-as-default-member -- the typings are not updated correctly
|
||||
export const wss = new Websocket.Server({ noServer: true })
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
import * as path from "path"
|
||||
import { describe, test, expect } from "./baseFixture"
|
||||
|
||||
// Given a code-server environment with Spanish Language Pack extension installed
|
||||
// and a languagepacks.json in the data-dir
|
||||
describe(
|
||||
"--locale es",
|
||||
["--disable-workspace-trust", "--extensions-dir", path.join(__dirname, "./extensions"), "--locale", "es"],
|
||||
{},
|
||||
() => {
|
||||
test("should load code-server in Spanish", async ({ codeServerPage }) => {
|
||||
// When
|
||||
const visible = await codeServerPage.page.isVisible("text=Explorador")
|
||||
|
||||
// Then
|
||||
expect(visible).toBe(true)
|
||||
})
|
||||
},
|
||||
)
|
||||
@@ -16,10 +16,7 @@ describe("Downloads (enabled)", ["--disable-workspace-trust"], {}, async () => {
|
||||
await fs.writeFile(tmpFilePath, "hello world")
|
||||
|
||||
// Action
|
||||
const fileInExplorer = await codeServerPage.page.waitForSelector("text=unique-file.txt")
|
||||
await fileInExplorer.click({
|
||||
button: "right",
|
||||
})
|
||||
await codeServerPage.openContextMenu("text=unique-file.txt")
|
||||
|
||||
expect(await codeServerPage.page.isVisible("text=Download...")).toBe(true)
|
||||
})
|
||||
@@ -73,10 +70,7 @@ describe("Downloads (disabled)", ["--disable-workspace-trust", "--disable-file-d
|
||||
await fs.writeFile(tmpFilePath, "Hello World")
|
||||
|
||||
// Action
|
||||
const fileInExplorer = await codeServerPage.page.waitForSelector("text=unique-file.txt")
|
||||
await fileInExplorer.click({
|
||||
button: "right",
|
||||
})
|
||||
await codeServerPage.openContextMenu("text=unique-file.txt")
|
||||
|
||||
expect(await codeServerPage.page.isVisible("text=Download...")).toBe(false)
|
||||
})
|
||||
|
||||
@@ -11,11 +11,9 @@ function runTestExtensionTests() {
|
||||
await codeServerPage.waitForTestExtensionLoaded()
|
||||
await codeServerPage.executeCommandViaMenus("code-server: Get proxy URI")
|
||||
|
||||
await codeServerPage.page.waitForSelector("text=proxyUri", { timeout: 3000 })
|
||||
const text = await codeServerPage.page.locator("text=proxyUri").first().textContent()
|
||||
// Remove end slash in address
|
||||
// Remove end slash in address.
|
||||
const normalizedAddress = address.replace(/\/+$/, "")
|
||||
expect(text).toBe(`Info: proxyUri: ${normalizedAddress}/proxy/{{port}}/`)
|
||||
await codeServerPage.page.getByText(`Info: proxyUri: ${normalizedAddress}/proxy/{{port}}/`)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
{
|
||||
"name": "vscode-language-pack-es",
|
||||
"displayName": "Spanish Language Pack for Visual Studio Code",
|
||||
"description": "Language pack extension for Spanish",
|
||||
"version": "1.70.0",
|
||||
"publisher": "MS-CEINTL",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Microsoft/vscode-loc"
|
||||
},
|
||||
"engines": {
|
||||
"vscode": "^1.70.0"
|
||||
},
|
||||
"categories": [
|
||||
"Language Packs"
|
||||
],
|
||||
"contributes": {
|
||||
"localizations": [
|
||||
{
|
||||
"languageId": "es",
|
||||
"languageName": "Spanish",
|
||||
"localizedLanguageName": "español",
|
||||
"translations": [
|
||||
{
|
||||
"id": "vscode",
|
||||
"path": "./translations/main.i18n.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"__metadata": {
|
||||
"id": "47e020a1-33db-4cc0-a1b4-42f97781749a",
|
||||
"publisherDisplayName": "MS-CEINTL",
|
||||
"publisherId": "0b0882c3-aee3-4d7c-b5f9-872f9be0a115",
|
||||
"isPreReleaseVersion": false
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"version": "1.0.0",
|
||||
"contents": {
|
||||
"vs/workbench/contrib/files/browser/explorerViewlet": {
|
||||
"explore": "Explorador"
|
||||
}
|
||||
}
|
||||
}
|
||||
41
test/e2e/extensions/test-extension/package-lock.json
generated
Normal file
41
test/e2e/extensions/test-extension/package-lock.json
generated
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "code-server-extension",
|
||||
"version": "0.0.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "code-server-extension",
|
||||
"version": "0.0.1",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/vscode": "^1.56.0",
|
||||
"typescript": "^5.6.2"
|
||||
},
|
||||
"engines": {
|
||||
"vscode": "^1.56.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/vscode": {
|
||||
"version": "1.94.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.94.0.tgz",
|
||||
"integrity": "sha512-UyQOIUT0pb14XSqJskYnRwD2aG0QrPVefIfrW1djR+/J4KeFQ0i1+hjZoaAmeNf3Z2jleK+R2hv+EboG/m8ruw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz",
|
||||
"integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.17"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/vscode": "^1.56.0",
|
||||
"typescript": "^4.0.5"
|
||||
"typescript": "^5.6.2"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc"
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@types/vscode@^1.56.0":
|
||||
version "1.57.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.57.0.tgz#cc648e0573b92f725cd1baf2621f8da9f8bc689f"
|
||||
integrity sha512-FeznBFtIDCWRluojTsi9c3LLcCHOXP5etQfBK42+ixo1CoEAchkw39tuui9zomjZuKfUVL33KZUDIwHZ/xvOkQ==
|
||||
|
||||
typescript@^4.0.5:
|
||||
version "4.3.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805"
|
||||
integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==
|
||||
@@ -302,7 +302,7 @@ export class CodeServerPage {
|
||||
const to = new URL(noramlizedUrl)
|
||||
|
||||
this.codeServer.logger.info(`navigating to ${to}`)
|
||||
await this.page.goto(to.toString(), { waitUntil: "networkidle" })
|
||||
await this.page.goto(to.toString())
|
||||
|
||||
// Only reload editor if auth is not enabled. Otherwise we'll get stuck
|
||||
// reloading the login page.
|
||||
@@ -555,6 +555,15 @@ export class CodeServerPage {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Open context menu on the specified selector.
|
||||
*/
|
||||
async openContextMenu(selector: string): Promise<void> {
|
||||
const el = await this.page.waitForSelector(selector)
|
||||
await el.click({ button: "right" })
|
||||
await this.page.waitForSelector(".context-view-block")
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a command in the root of the instance's workspace directory.
|
||||
*/
|
||||
|
||||
@@ -16,10 +16,8 @@ describe("Uploads (enabled)", ["--disable-workspace-trust"], {}, () => {
|
||||
await fs.mkdir(tmpDirPath)
|
||||
|
||||
// Action
|
||||
const fileInExplorer = await codeServerPage.page.waitForSelector('span:has-text("test-directory")')
|
||||
await fileInExplorer.click({
|
||||
button: "right",
|
||||
})
|
||||
await codeServerPage.openContextMenu('span:has-text("test-directory")')
|
||||
|
||||
expect(await codeServerPage.page.isVisible("text=Upload...")).toBe(true)
|
||||
})
|
||||
|
||||
@@ -44,10 +42,7 @@ describe("Uploads (disabled)", ["--disable-workspace-trust", "--disable-file-upl
|
||||
await fs.mkdir(tmpDirPath)
|
||||
|
||||
// Action
|
||||
const fileInExplorer = await codeServerPage.page.waitForSelector('span:has-text("test-directory")')
|
||||
await fileInExplorer.click({
|
||||
button: "right",
|
||||
})
|
||||
await codeServerPage.openContextMenu('span:has-text("test-directory")')
|
||||
|
||||
expect(await codeServerPage.page.isVisible("text=Upload...")).toBe(false)
|
||||
})
|
||||
|
||||
@@ -18,11 +18,8 @@ describe("Webviews", ["--disable-workspace-trust"], {}, () => {
|
||||
|
||||
// It's an iframe within an iframe
|
||||
// so we have to do .frameLocator twice
|
||||
const renderedText = await codeServerPage.page
|
||||
.frameLocator("iframe.webview.ready")
|
||||
.frameLocator("#active-frame")
|
||||
.locator("text=Hello world")
|
||||
|
||||
expect(renderedText).toBeVisible
|
||||
await expect(
|
||||
codeServerPage.page.frameLocator("iframe.webview.ready").frameLocator("#active-frame").getByText("Hello world"),
|
||||
).toBeVisible()
|
||||
})
|
||||
})
|
||||
|
||||
5569
test/package-lock.json
generated
Normal file
5569
test/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
||||
"#": "We must put jest in a sub-directory otherwise VS Code somehow picks up the types and generates conflicts with mocha.",
|
||||
"devDependencies": {
|
||||
"@jest-mock/express": "^1.4.5",
|
||||
"@playwright/test": "^1.16.3",
|
||||
"@playwright/test": "^1.46.0",
|
||||
"@types/jest": "^27.0.2",
|
||||
"@types/jsdom": "^16.2.13",
|
||||
"@types/node-fetch": "^2.5.8",
|
||||
@@ -15,7 +15,7 @@
|
||||
"jest-fetch-mock": "^3.0.3",
|
||||
"jsdom": "^16.4.0",
|
||||
"node-fetch": "^2.6.7",
|
||||
"playwright": "^1.16.3",
|
||||
"playwright": "^1.46.0",
|
||||
"supertest": "^6.1.6",
|
||||
"ts-jest": "^27.0.7",
|
||||
"wtfnode": "^0.9.1"
|
||||
|
||||
@@ -3,12 +3,12 @@ import { PlaywrightTestConfig } from "@playwright/test"
|
||||
import path from "path"
|
||||
|
||||
// The default configuration runs all tests in three browsers with workers equal
|
||||
// to half the available threads. See 'yarn test:e2e --help' to customize from
|
||||
// the command line. For example:
|
||||
// yarn test:e2e --workers 1 # Run with one worker
|
||||
// yarn test:e2e --project Chromium # Only run on Chromium
|
||||
// yarn test:e2e --grep login # Run tests matching "login"
|
||||
// PWDEBUG=1 yarn test:e2e # Run Playwright inspector
|
||||
// to half the available threads. See 'npm run test:e2e --help' to customize
|
||||
// from the command line. For example:
|
||||
// npm run test:e2e --workers 1 # Run with one worker
|
||||
// npm run test:e2e --project Chromium # Only run on Chromium
|
||||
// npm run test:e2e --grep login # Run tests matching "login"
|
||||
// PWDEBUG=1 npm run test:e2e # Run Playwright inspector
|
||||
const config: PlaywrightTestConfig = {
|
||||
testDir: path.join(__dirname, "e2e"), // Search for tests in this directory.
|
||||
timeout: 60000, // Each test is given 60 seconds.
|
||||
@@ -28,10 +28,11 @@ const config: PlaywrightTestConfig = {
|
||||
name: "Chromium",
|
||||
use: { browserName: "chromium" },
|
||||
},
|
||||
{
|
||||
name: "Firefox",
|
||||
use: { browserName: "firefox" },
|
||||
},
|
||||
// Firefox seems to have bugs with opening context menus in the file tree.
|
||||
// {
|
||||
// name: "Firefox",
|
||||
// use: { browserName: "firefox" },
|
||||
// },
|
||||
{
|
||||
name: "WebKit",
|
||||
use: { browserName: "webkit" },
|
||||
|
||||
@@ -26,14 +26,14 @@ function should-fallback-npm() {
|
||||
[ "$status" -eq 0 ]
|
||||
[ "${lines[1]}" = "No standalone releases for $2." ]
|
||||
[ "${lines[2]}" = "Falling back to installation from npm." ]
|
||||
[ "${lines[3]}" = "Installing latest from npm." ]
|
||||
[ "${lines[3]}" = "Installing v$VERSION from npm." ]
|
||||
[ "${lines[-6]}" = "npm package has been installed." ]
|
||||
}
|
||||
|
||||
function should-use-npm() {
|
||||
YARN_PATH=true DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
||||
[ "$status" -eq 0 ]
|
||||
[ "${lines[1]}" = "Installing latest from npm." ]
|
||||
[ "${lines[1]}" = "Installing v$VERSION from npm." ]
|
||||
[ "${lines[-6]}" = "npm package has been installed." ]
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ function should-fallback-npm-brew() {
|
||||
[ "${lines[2]}" = "Falling back to standalone installation." ]
|
||||
[ "${lines[3]}" = "No standalone releases for $1." ]
|
||||
[ "${lines[4]}" = "Falling back to installation from npm." ]
|
||||
[ "${lines[5]}" = "Installing latest from npm." ]
|
||||
[ "${lines[5]}" = "Installing v$VERSION from npm." ]
|
||||
[ "${lines[-6]}" = "npm package has been installed." ]
|
||||
}
|
||||
|
||||
@@ -132,15 +132,15 @@ function should-use-standalone() {
|
||||
|
||||
# macOS use homebrew but falls back to standalone when brew is unavailable then
|
||||
# to npm for unsupported architectures.
|
||||
@test "$SCRIPT_NAME: macos arm64 (no brew)" {
|
||||
should-fallback-npm-brew "arm64"
|
||||
}
|
||||
@test "$SCRIPT_NAME: macos amd64 (no brew)" {
|
||||
BREW_PATH= OS=macos ARCH=amd64 run "$SCRIPT" --dry-run
|
||||
should-fallback-npm-brew "amd64"
|
||||
}
|
||||
@test "$SCRIPT_NAME: macos arm64 (no brew)" {
|
||||
BREW_PATH= OS=macos ARCH=arm64 run "$SCRIPT" --dry-run
|
||||
[ "$status" -eq 0 ]
|
||||
[ "${lines[1]}" = "Homebrew not installed." ]
|
||||
[ "${lines[2]}" = "Falling back to standalone installation." ]
|
||||
[ "${lines[3]}" = "Installing v$VERSION of the amd64 release from GitHub." ]
|
||||
[ "${lines[3]}" = "Installing v$VERSION of the arm64 release from GitHub." ]
|
||||
[[ "${lines[-6]}" = "Standalone release has been installed"* ]]
|
||||
}
|
||||
@test "$SCRIPT_NAME: macos i386 (no brew)" {
|
||||
|
||||
@@ -106,6 +106,8 @@ describe("parser", () => {
|
||||
|
||||
"--disable-proxy",
|
||||
|
||||
["--abs-proxy-base-path", "/codeserver/app1"],
|
||||
|
||||
["--session-socket", "/tmp/override-code-server-ipc-socket"],
|
||||
|
||||
["--host", "0.0.0.0"],
|
||||
@@ -143,6 +145,7 @@ describe("parser", () => {
|
||||
version: true,
|
||||
"bind-addr": "192.169.0.1:8080",
|
||||
"session-socket": "/tmp/override-code-server-ipc-socket",
|
||||
"abs-proxy-base-path": "/codeserver/app1",
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user