mirror of
https://github.com/coder/code-server.git
synced 2026-05-06 20:41:59 +02:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
072b5a8f92 | ||
|
|
a2e464d06d | ||
|
|
4ad763ad59 | ||
|
|
77c3cd3aa1 | ||
|
|
ff8ea36b27 | ||
|
|
f56ce5b66d | ||
|
|
2530a0d265 | ||
|
|
a432a0d697 | ||
|
|
505f07a9bc | ||
|
|
ee47293cf6 | ||
|
|
5c751f26ee | ||
|
|
7c0c0b0c29 | ||
|
|
649985af8e |
20
.github/workflows/publish.yaml
vendored
20
.github/workflows/publish.yaml
vendored
@@ -28,15 +28,13 @@ jobs:
|
|||||||
id: version
|
id: version
|
||||||
run: echo "::set-output name=version::$(jq -r .version package.json)"
|
run: echo "::set-output name=version::$(jq -r .version package.json)"
|
||||||
|
|
||||||
- name: Download artifact
|
- name: Download npm package from release artifacts
|
||||||
uses: dawidd6/action-download-artifact@v2
|
uses: robinraju/release-downloader@v1.5
|
||||||
id: download
|
|
||||||
with:
|
with:
|
||||||
branch: release/v${{ steps.version.outputs.version }}
|
repository: "coder/code-server"
|
||||||
workflow: build.yaml
|
tag: v${{ steps.version.outputs.version }}
|
||||||
workflow_conclusion: completed
|
fileName: "package.tar.gz"
|
||||||
name: "npm-package"
|
out-file-path: "release-npm-package"
|
||||||
path: release-npm-package
|
|
||||||
|
|
||||||
- name: Publish npm package and tag with "latest"
|
- name: Publish npm package and tag with "latest"
|
||||||
run: yarn publish:npm
|
run: yarn publish:npm
|
||||||
@@ -97,6 +95,12 @@ jobs:
|
|||||||
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||||
ref: "master"
|
ref: "master"
|
||||||
|
|
||||||
|
- name: Merge in master
|
||||||
|
run: |
|
||||||
|
git remote add upstream https://github.com/coder/code-server-aur.git
|
||||||
|
git fetch upstream
|
||||||
|
git merge upstream/master
|
||||||
|
|
||||||
- name: Configure git
|
- name: Configure git
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name cdrci
|
git config --global user.name cdrci
|
||||||
|
|||||||
21
.github/workflows/release.yaml
vendored
21
.github/workflows/release.yaml
vendored
@@ -249,3 +249,24 @@ jobs:
|
|||||||
draft: true
|
draft: true
|
||||||
discussion_category_name: "📣 Announcements"
|
discussion_category_name: "📣 Announcements"
|
||||||
files: ./release-packages/*
|
files: ./release-packages/*
|
||||||
|
|
||||||
|
npm-package:
|
||||||
|
name: Upload npm package
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 15
|
||||||
|
steps:
|
||||||
|
- name: Download artifacts
|
||||||
|
uses: dawidd6/action-download-artifact@v2
|
||||||
|
id: download
|
||||||
|
with:
|
||||||
|
branch: ${{ github.ref }}
|
||||||
|
workflow: build.yaml
|
||||||
|
workflow_conclusion: completed
|
||||||
|
check_artifacts: true
|
||||||
|
name: npm-package
|
||||||
|
|
||||||
|
- uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
draft: true
|
||||||
|
discussion_category_name: "📣 Announcements"
|
||||||
|
files: ./package.tar.gz
|
||||||
|
|||||||
20
CHANGELOG.md
20
CHANGELOG.md
@@ -20,6 +20,26 @@ Code v99.99.999
|
|||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
## [4.8.3](https://github.com/coder/code-server/releases/tag/v4.8.3) - 2022-11-07
|
||||||
|
|
||||||
|
Code v1.72.1
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Updated text in the Getting Started page.
|
||||||
|
|
||||||
|
## [4.8.2](https://github.com/coder/code-server/releases/tag/v4.8.2) - 2022-11-02
|
||||||
|
|
||||||
|
Code v1.72.1
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- New text in the Getting Started page with info about
|
||||||
|
`coder/coder`. This is enabled by default but can be disabled by passing the CLI
|
||||||
|
flag `--disable-getting-started-override` or setting
|
||||||
|
`CS_DISABLE_GETTING_STARTED_OVERRIDE=1` or
|
||||||
|
`CS_DISABLE_GETTING_STARTED_OVERRIDE=true`.
|
||||||
|
|
||||||
## [4.8.1](https://github.com/coder/code-server/releases/tag/v4.8.1) - 2022-10-28
|
## [4.8.1](https://github.com/coder/code-server/releases/tag/v4.8.1) - 2022-10-28
|
||||||
|
|
||||||
Code v1.72.1
|
Code v1.72.1
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ type: application
|
|||||||
# This is the chart version. This version number should be incremented each time you make changes
|
# 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.
|
# to the chart and its templates, including the app version.
|
||||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||||
version: 3.3.1
|
version: 3.3.3
|
||||||
|
|
||||||
# This is the version number of the application being deployed. This version number should be
|
# 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
|
# 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.
|
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||||
appVersion: 4.8.1
|
appVersion: 4.8.3
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ replicaCount: 1
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
repository: codercom/code-server
|
repository: codercom/code-server
|
||||||
tag: '4.8.1'
|
tag: '4.8.3'
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
|
|
||||||
# Specifies one or more secrets to be used when pulling images from a
|
# Specifies one or more secrets to be used when pulling images from a
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
- [Does code-server have any security login validation?](#does-code-server-have-any-security-login-validation)
|
- [Does code-server have any security login validation?](#does-code-server-have-any-security-login-validation)
|
||||||
- [Are there community projects involving code-server?](#are-there-community-projects-involving-code-server)
|
- [Are there community projects involving code-server?](#are-there-community-projects-involving-code-server)
|
||||||
- [How do I change the port?](#how-do-i-change-the-port)
|
- [How do I change the port?](#how-do-i-change-the-port)
|
||||||
|
- [How do I hide the coder/coder promotion in Help: Getting Started?](#how-do-i-hide-the-codercoder-promotion-in-help-getting-started)
|
||||||
|
|
||||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
<!-- prettier-ignore-end -->
|
<!-- prettier-ignore-end -->
|
||||||
@@ -418,3 +419,9 @@ There are two ways to change the port on which code-server runs:
|
|||||||
|
|
||||||
1. with an environment variable e.g. `PORT=3000 code-server`
|
1. with an environment variable e.g. `PORT=3000 code-server`
|
||||||
2. using the flag `--bind-addr` e.g. `code-server --bind-addr localhost:3000`
|
2. using the flag `--bind-addr` e.g. `code-server --bind-addr localhost:3000`
|
||||||
|
|
||||||
|
## How do I hide the coder/coder promotion in Help: Getting Started?
|
||||||
|
|
||||||
|
You can pass the flag `--disable-getting-started-override` to `code-server` or
|
||||||
|
you can set the environment variable `CS_DISABLE_GETTING_STARTED_OVERRIDE=1` or
|
||||||
|
`CS_DISABLE_GETTING_STARTED_OVERRIDE=true`.
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
- [Changelog](#changelog)
|
- [Changelog](#changelog)
|
||||||
- [Releases](#releases)
|
- [Releases](#releases)
|
||||||
- [Publishing a release](#publishing-a-release)
|
- [Publishing a release](#publishing-a-release)
|
||||||
|
- [Release Candidates](#release-candidates)
|
||||||
- [AUR](#aur)
|
- [AUR](#aur)
|
||||||
- [Docker](#docker)
|
- [Docker](#docker)
|
||||||
- [Homebrew](#homebrew)
|
- [Homebrew](#homebrew)
|
||||||
@@ -142,7 +143,6 @@ changelog](https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS).
|
|||||||
### Publishing a release
|
### Publishing a release
|
||||||
|
|
||||||
1. Create a new branch called `release/v0.0.0` (replace 0s with actual version aka v4.5.0)
|
1. Create a new branch called `release/v0.0.0` (replace 0s with actual version aka v4.5.0)
|
||||||
1. If you don't do this, the `npm-brew` GitHub workflow will fail. It looks for the release artifacts under the branch pattern.
|
|
||||||
1. Run `yarn release:prep`
|
1. Run `yarn release:prep`
|
||||||
1. Bump chart version in `Chart.yaml`.
|
1. Bump chart version in `Chart.yaml`.
|
||||||
1. Summarize the major changes in the `CHANGELOG.md`
|
1. Summarize the major changes in the `CHANGELOG.md`
|
||||||
@@ -153,6 +153,14 @@ changelog](https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS).
|
|||||||
artifacts, publish the NPM package from `npm-package`, and publish the Docker
|
artifacts, publish the NPM package from `npm-package`, and publish the Docker
|
||||||
Hub image from `release-images`.
|
Hub image from `release-images`.
|
||||||
|
|
||||||
|
#### Release Candidates
|
||||||
|
|
||||||
|
We prefer to do release candidates so the community can test things before a full-blown release. To do this follow the same steps as above but:
|
||||||
|
|
||||||
|
1. Only bump version in `package.json`
|
||||||
|
1. use `0.0.0-rc.0`
|
||||||
|
1. When you publish the release, select "pre-release"
|
||||||
|
|
||||||
#### AUR
|
#### AUR
|
||||||
|
|
||||||
We publish to AUR as a package [here](https://aur.archlinux.org/packages/code-server/). This process is manual and can be done by following the steps in [this repo](https://github.com/coder/code-server-aur).
|
We publish to AUR as a package [here](https://aur.archlinux.org/packages/code-server/). This process is manual and can be done by following the steps in [this repo](https://github.com/coder/code-server-aur).
|
||||||
|
|||||||
@@ -12,13 +12,13 @@
|
|||||||
in {
|
in {
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
nodejs yarn' python pkg-config git rsync jq moreutils
|
nodejs yarn' python pkg-config git rsync jq moreutils quilt bats
|
||||||
];
|
];
|
||||||
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret ]
|
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret ]
|
||||||
++ (with xorg; [ libX11 libxkbfile ])
|
++ (with xorg; [ libX11 libxkbfile ])
|
||||||
++ lib.optionals stdenv.isDarwin [
|
++ lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
|
||||||
AppKit Cocoa CoreServices Security cctools xcbuild
|
AppKit Cocoa CoreServices Security xcbuild
|
||||||
]);
|
]));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
12
install.sh
12
install.sh
@@ -131,6 +131,11 @@ Or, if you don't want/need a background service you can run:
|
|||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo_coder_postinstall() {
|
||||||
|
echoh
|
||||||
|
echoh "Deploy code-server for your team with Coder: https://github.com/coder/coder"
|
||||||
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
if [ "${TRACE-}" ]; then
|
if [ "${TRACE-}" ]; then
|
||||||
set -x
|
set -x
|
||||||
@@ -243,6 +248,7 @@ main() {
|
|||||||
if [ "$METHOD" = standalone ]; then
|
if [ "$METHOD" = standalone ]; then
|
||||||
if has_standalone; then
|
if has_standalone; then
|
||||||
install_standalone
|
install_standalone
|
||||||
|
echo_coder_postinstall
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echoerr "There are no standalone releases for $ARCH"
|
echoerr "There are no standalone releases for $ARCH"
|
||||||
@@ -286,6 +292,8 @@ main() {
|
|||||||
npm_fallback install_standalone
|
npm_fallback install_standalone
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
echo_coder_postinstall
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_arg() {
|
parse_arg() {
|
||||||
@@ -482,7 +490,7 @@ os() {
|
|||||||
# - amzn, centos, rhel, fedora, ... -> fedora
|
# - amzn, centos, rhel, fedora, ... -> fedora
|
||||||
# - opensuse-{leap,tumbleweed} -> opensuse
|
# - opensuse-{leap,tumbleweed} -> opensuse
|
||||||
# - alpine -> alpine
|
# - alpine -> alpine
|
||||||
# - arch -> arch
|
# - arch, manjaro, endeavouros, ... -> arch
|
||||||
#
|
#
|
||||||
# Inspired by https://github.com/docker/docker-install/blob/26ff363bcf3b3f5a00498ac43694bf1c7d9ce16c/install.sh#L111-L120.
|
# Inspired by https://github.com/docker/docker-install/blob/26ff363bcf3b3f5a00498ac43694bf1c7d9ce16c/install.sh#L111-L120.
|
||||||
distro() {
|
distro() {
|
||||||
@@ -496,7 +504,7 @@ distro() {
|
|||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
if [ "${ID_LIKE-}" ]; then
|
if [ "${ID_LIKE-}" ]; then
|
||||||
for id_like in $ID_LIKE; do
|
for id_like in $ID_LIKE; do
|
||||||
case "$id_like" in debian | fedora | opensuse)
|
case "$id_like" in debian | fedora | opensuse | arch)
|
||||||
echo "$id_like"
|
echo "$id_like"
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "code-server",
|
"name": "code-server",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "4.8.1",
|
"version": "4.8.3",
|
||||||
"description": "Run VS Code on a remote server.",
|
"description": "Run VS Code on a remote server.",
|
||||||
"homepage": "https://github.com/coder/code-server",
|
"homepage": "https://github.com/coder/code-server",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|||||||
252
patches/getting-started.diff
Normal file
252
patches/getting-started.diff
Normal file
@@ -0,0 +1,252 @@
|
|||||||
|
Modify Help: Getting Started
|
||||||
|
|
||||||
|
This modifies some text on the Getting Started page and adds text about using
|
||||||
|
code-server on a team.
|
||||||
|
|
||||||
|
It is enabled by default but can be overriden using the cli flag
|
||||||
|
`--disable-getting-started-override`.
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
|
||||||
|
@@ -62,7 +62,7 @@ import { GettingStartedIndexList } from
|
||||||
|
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||||
|
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||||
|
import { getTelemetryLevel } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||||
|
-import { WorkbenchStateContext } from 'vs/workbench/common/contextkeys';
|
||||||
|
+import { IsEnabledCoderGettingStarted, WorkbenchStateContext } from 'vs/workbench/common/contextkeys';
|
||||||
|
import { OpenFolderViaWorkspaceAction } from 'vs/workbench/browser/actions/workspaceActions';
|
||||||
|
import { OpenRecentAction } from 'vs/workbench/browser/actions/windowActions';
|
||||||
|
import { Toggle } from 'vs/base/browser/ui/toggle/toggle';
|
||||||
|
@@ -758,6 +758,72 @@ export class GettingStartedPage extends
|
||||||
|
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
|
||||||
|
);
|
||||||
|
|
||||||
|
+ let gettingStartedCoder: HTMLElement = $('.header', {});
|
||||||
|
+ if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) {
|
||||||
|
+ gettingStartedCoder = $('.gettingStartedCategory', {},
|
||||||
|
+ $('h2', {
|
||||||
|
+ style: 'margin-bottom: 12px',
|
||||||
|
+ }, 'Next Up'),
|
||||||
|
+ $('a', {
|
||||||
|
+ href: 'https://cdr.co/code-server-to-coder',
|
||||||
|
+ target: '_blank',
|
||||||
|
+ },
|
||||||
|
+ $('button', {
|
||||||
|
+ style: [
|
||||||
|
+ 'padding: 10px 16px ',
|
||||||
|
+ 'border-radius: 4px',
|
||||||
|
+ 'background: linear-gradient(94.04deg, #7934DA 0%, #4D52E0 101.2%)',
|
||||||
|
+ 'color: white',
|
||||||
|
+ 'overflow: hidden',
|
||||||
|
+ 'margin-right: 14px',
|
||||||
|
+ ].join(';'),
|
||||||
|
+ },
|
||||||
|
+ $('h3', {
|
||||||
|
+ style: [
|
||||||
|
+ 'margin: 0px 0px 6px',
|
||||||
|
+ 'font-weight: 500',
|
||||||
|
+ ].join(';'),
|
||||||
|
+ }, 'Deploy code-server for your team'),
|
||||||
|
+ $('p', {
|
||||||
|
+ style: [
|
||||||
|
+ 'margin: 0',
|
||||||
|
+ 'font-size: 13px',
|
||||||
|
+ 'color: #dcdee2',
|
||||||
|
+ ].join(';'),
|
||||||
|
+ }, 'Provision remote development environments on your infrastructure with Coder.'),
|
||||||
|
+ $('p', {
|
||||||
|
+ style: [
|
||||||
|
+ 'margin-top: 8px',
|
||||||
|
+ 'font-size: 13px',
|
||||||
|
+ 'color: #dcdee2',
|
||||||
|
+ ].join(';'),
|
||||||
|
+ }, 'Coder is a self-service portal which provisions via Terraform—Linux, macOS, Windows, x86, ARM, and, of course, Kubernetes based infrastructure.'),
|
||||||
|
+ $('p', {
|
||||||
|
+ style: [
|
||||||
|
+ 'margin: 0',
|
||||||
|
+ 'margin-top: 8px',
|
||||||
|
+ 'font-size: 13px',
|
||||||
|
+ 'display: flex',
|
||||||
|
+ 'align-items: center',
|
||||||
|
+ ].join(';'),
|
||||||
|
+ }, 'Get started ', $('span', {
|
||||||
|
+ class: Codicon.arrowRight.classNames,
|
||||||
|
+ style: [
|
||||||
|
+ 'color: white',
|
||||||
|
+ 'margin-left: 8px',
|
||||||
|
+ ].join(';'),
|
||||||
|
+ })),
|
||||||
|
+ $('img', {
|
||||||
|
+ src: './_static/src/browser/media/templates.png',
|
||||||
|
+ style: [
|
||||||
|
+ 'margin-bottom: -65px',
|
||||||
|
+ ].join(';'),
|
||||||
|
+ }),
|
||||||
|
+ ),
|
||||||
|
+ ),
|
||||||
|
+ );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
|
||||||
|
const leftColumn = $('.categories-column.categories-column-left', {},);
|
||||||
|
const rightColumn = $('.categories-column.categories-column-right', {},);
|
||||||
|
@@ -775,13 +841,23 @@ export class GettingStartedPage extends
|
||||||
|
const layoutLists = () => {
|
||||||
|
if (gettingStartedList.itemCount) {
|
||||||
|
this.container.classList.remove('noWalkthroughs');
|
||||||
|
- reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||||
|
- reset(rightColumn, gettingStartedList.getDomElement());
|
||||||
|
+ if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) {
|
||||||
|
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement(), gettingStartedList.getDomElement());
|
||||||
|
+ reset(rightColumn, gettingStartedCoder);
|
||||||
|
+ } else {
|
||||||
|
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||||
|
+ reset(rightColumn, gettingStartedList.getDomElement());
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
recentList.setLimit(5);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.container.classList.add('noWalkthroughs');
|
||||||
|
- reset(leftColumn, startList.getDomElement());
|
||||||
|
+ if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) {
|
||||||
|
+ reset(leftColumn, startList.getDomElement(), gettingStartedCoder);
|
||||||
|
+ } else {
|
||||||
|
+ reset(leftColumn, startList.getDomElement());
|
||||||
|
+ }
|
||||||
|
reset(rightColumn, recentList.getDomElement());
|
||||||
|
recentList.setLimit(10);
|
||||||
|
}
|
||||||
|
Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
|
||||||
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
|
||||||
|
@@ -60,6 +60,15 @@
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
+.monaco-workbench .part.editor > .content .gettingStartedContainer .coder {
|
||||||
|
+ margin-bottom: 0.2em;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+.monaco-workbench .part.editor>.content .gettingStartedContainer .coder-coder {
|
||||||
|
+ font-size: 1em;
|
||||||
|
+ margin-top: 0.2em;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
.monaco-workbench.hc-black .part.editor>.content .gettingStartedContainer .subtitle,
|
||||||
|
.monaco-workbench.hc-light .part.editor>.content .gettingStartedContainer .subtitle {
|
||||||
|
font-weight: 200;
|
||||||
|
Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
|
@@ -276,6 +276,11 @@ export interface IWorkbenchConstructionO
|
||||||
|
*/
|
||||||
|
readonly isEnabledFileDownloads?: boolean
|
||||||
|
|
||||||
|
+ /**
|
||||||
|
+ * Whether to use Coder's custom Getting Started text.
|
||||||
|
+ */
|
||||||
|
+ readonly isEnabledCoderGettingStarted?: boolean
|
||||||
|
+
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||||
|
@@ -36,6 +36,11 @@ export interface IBrowserWorkbenchEnviro
|
||||||
|
* Enable downloading files via menu actions.
|
||||||
|
*/
|
||||||
|
readonly isEnabledFileDownloads?: boolean;
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Enable Coder's custom getting started text.
|
||||||
|
+ */
|
||||||
|
+ readonly isEnabledCoderGettingStarted?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvironmentService {
|
||||||
|
@@ -74,6 +79,13 @@ export class BrowserWorkbenchEnvironment
|
||||||
|
return this.options.isEnabledFileDownloads;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ get isEnabledCoderGettingStarted(): boolean {
|
||||||
|
+ if (typeof this.options.isEnabledCoderGettingStarted === "undefined") {
|
||||||
|
+ throw new Error('isEnabledCoderGettingStarted was not provided to the browser');
|
||||||
|
+ }
|
||||||
|
+ return this.options.isEnabledCoderGettingStarted;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
@memoize
|
||||||
|
get argvResource(): URI { return joinPath(this.userRoamingDataHome, 'argv.json'); }
|
||||||
|
|
||||||
|
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
|
||||||
|
@@ -16,6 +16,7 @@ export const serverOptions: OptionDescri
|
||||||
|
'auth': { type: 'string' },
|
||||||
|
'disable-file-downloads': { type: 'boolean' },
|
||||||
|
'locale': { type: 'string' },
|
||||||
|
+ 'disable-getting-started-override': { type: 'boolean' },
|
||||||
|
|
||||||
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
|
@@ -98,6 +99,7 @@ export interface ServerParsedArgs {
|
||||||
|
'auth'?: string
|
||||||
|
'disable-file-downloads'?: boolean;
|
||||||
|
'locale'?: string
|
||||||
|
+ 'disable-getting-started-override'?: boolean;
|
||||||
|
|
||||||
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
|
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
|
||||||
|
@@ -308,6 +308,7 @@ export class WebClientServer {
|
||||||
|
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||||
|
userDataPath: this._environmentService.userDataPath,
|
||||||
|
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
||||||
|
+ isEnabledCoderGettingStarted: !this._environmentService.args['disable-getting-started-override'],
|
||||||
|
_wrapWebWorkerExtHostInIframe,
|
||||||
|
developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() },
|
||||||
|
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
||||||
|
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 } 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, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads } from 'vs/workbench/common/contextkeys';
|
||||||
|
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads, IsEnabledCoderGettingStarted } from 'vs/workbench/common/contextkeys';
|
||||||
|
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, DEFAULT_EDITOR_ASSOCIATION } from 'vs/workbench/common/editor';
|
||||||
|
import { trackFocus, addDisposableListener, EventType } from 'vs/base/browser/dom';
|
||||||
|
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||||
|
@@ -204,6 +204,7 @@ export class WorkbenchContextKeysHandler
|
||||||
|
|
||||||
|
// code-server
|
||||||
|
IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
|
||||||
|
+ IsEnabledCoderGettingStarted.bindTo(this.contextKeyService).set(this.environmentService.isEnabledCoderGettingStarted ?? true)
|
||||||
|
|
||||||
|
this.registerListeners();
|
||||||
|
}
|
||||||
|
Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
|
@@ -33,6 +33,7 @@ export const IsFullscreenContext = new R
|
||||||
|
export const HasWebFileSystemAccess = new RawContextKey<boolean>('hasWebFileSystemAccess', false, true); // Support for FileSystemAccess web APIs (https://wicg.github.io/file-system-access)
|
||||||
|
|
||||||
|
export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
||||||
|
+export const IsEnabledCoderGettingStarted = new RawContextKey<boolean>('isEnabledCoderGettingStarted', true, true);
|
||||||
|
|
||||||
|
//#endregion
|
||||||
|
|
||||||
@@ -19,3 +19,4 @@ telemetry.diff
|
|||||||
display-language.diff
|
display-language.diff
|
||||||
cli-window-open.diff
|
cli-window-open.diff
|
||||||
exec-argv.diff
|
exec-argv.diff
|
||||||
|
getting-started.diff
|
||||||
|
|||||||
BIN
src/browser/media/templates.png
Normal file
BIN
src/browser/media/templates.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
@@ -51,6 +51,7 @@ export interface UserProvidedCodeArgs {
|
|||||||
"disable-update-check"?: boolean
|
"disable-update-check"?: boolean
|
||||||
"disable-file-downloads"?: boolean
|
"disable-file-downloads"?: boolean
|
||||||
"disable-workspace-trust"?: boolean
|
"disable-workspace-trust"?: boolean
|
||||||
|
"disable-getting-started-override"?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -170,6 +171,10 @@ export const options: Options<Required<UserProvidedArgs>> = {
|
|||||||
type: "boolean",
|
type: "boolean",
|
||||||
description: "Disable Workspace Trust feature. This switch only affects the current session.",
|
description: "Disable Workspace Trust feature. This switch only affects the current session.",
|
||||||
},
|
},
|
||||||
|
"disable-getting-started-override": {
|
||||||
|
type: "boolean",
|
||||||
|
description: "Disable the coder/coder override in the Help: Getting Started page.",
|
||||||
|
},
|
||||||
// --enable can be used to enable experimental features. These features
|
// --enable can be used to enable experimental features. These features
|
||||||
// provide no guarantees.
|
// provide no guarantees.
|
||||||
enable: { type: "string[]" },
|
enable: { type: "string[]" },
|
||||||
@@ -563,6 +568,10 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config
|
|||||||
args["disable-file-downloads"] = true
|
args["disable-file-downloads"] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (process.env.CS_DISABLE_GETTING_STARTED_OVERRIDE?.match(/^(1|true)$/)) {
|
||||||
|
args["disable-getting-started-override"] = true
|
||||||
|
}
|
||||||
|
|
||||||
const usingEnvHashedPassword = !!process.env.HASHED_PASSWORD
|
const usingEnvHashedPassword = !!process.env.HASHED_PASSWORD
|
||||||
if (process.env.HASHED_PASSWORD) {
|
if (process.env.HASHED_PASSWORD) {
|
||||||
args["hashed-password"] = process.env.HASHED_PASSWORD
|
args["hashed-password"] = process.env.HASHED_PASSWORD
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ export class PluginAPI {
|
|||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
if (!semver.satisfies(version, packageJSON.engines["code-server"])) {
|
if (!semver.satisfies(version, packageJSON.engines["code-server"])) {
|
||||||
throw new Error(
|
this.logger.warn(
|
||||||
`plugin range ${q(packageJSON.engines["code-server"])} incompatible` + ` with code-server version ${version}`,
|
`plugin range ${q(packageJSON.engines["code-server"])} incompatible` + ` with code-server version ${version}`,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
28
test/e2e/webview.test.ts
Normal file
28
test/e2e/webview.test.ts
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import { promises as fs } from "fs"
|
||||||
|
import * as path from "path"
|
||||||
|
import { describe, test, expect } from "./baseFixture"
|
||||||
|
|
||||||
|
describe("Webviews", ["--disable-workspace-trust"], {}, () => {
|
||||||
|
test("should preview a Markdown file", async ({ codeServerPage }) => {
|
||||||
|
// Create Markdown file
|
||||||
|
const heading = "Hello world"
|
||||||
|
const dir = await codeServerPage.workspaceDir
|
||||||
|
const file = path.join(dir, "text.md")
|
||||||
|
await fs.writeFile(file, `# ${heading}`)
|
||||||
|
await codeServerPage.openFile(file)
|
||||||
|
|
||||||
|
// Open Preview
|
||||||
|
await codeServerPage.executeCommandViaMenus("Markdown: Open Preview to the Side")
|
||||||
|
// Wait for the iframe to open and load
|
||||||
|
await codeServerPage.waitForTab(`Preview ${file}`)
|
||||||
|
|
||||||
|
// 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
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -11,14 +11,14 @@ function should-use-deb() {
|
|||||||
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "${lines[1]}" = "Installing v$VERSION of the $2 deb package from GitHub." ]
|
[ "${lines[1]}" = "Installing v$VERSION of the $2 deb package from GitHub." ]
|
||||||
[ "${lines[-5]}" = "deb package has been installed." ]
|
[ "${lines[-6]}" = "deb package has been installed." ]
|
||||||
}
|
}
|
||||||
|
|
||||||
function should-use-rpm() {
|
function should-use-rpm() {
|
||||||
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "${lines[1]}" = "Installing v$VERSION of the $2 rpm package from GitHub." ]
|
[ "${lines[1]}" = "Installing v$VERSION of the $2 rpm package from GitHub." ]
|
||||||
[ "${lines[-5]}" = "rpm package has been installed." ]
|
[ "${lines[-6]}" = "rpm package has been installed." ]
|
||||||
}
|
}
|
||||||
|
|
||||||
function should-fallback-npm() {
|
function should-fallback-npm() {
|
||||||
@@ -27,21 +27,21 @@ function should-fallback-npm() {
|
|||||||
[ "${lines[1]}" = "No standalone releases for $2." ]
|
[ "${lines[1]}" = "No standalone releases for $2." ]
|
||||||
[ "${lines[2]}" = "Falling back to installation from npm." ]
|
[ "${lines[2]}" = "Falling back to installation from npm." ]
|
||||||
[ "${lines[3]}" = "Installing latest from npm." ]
|
[ "${lines[3]}" = "Installing latest from npm." ]
|
||||||
[ "${lines[-5]}" = "npm package has been installed." ]
|
[ "${lines[-6]}" = "npm package has been installed." ]
|
||||||
}
|
}
|
||||||
|
|
||||||
function should-use-npm() {
|
function should-use-npm() {
|
||||||
YARN_PATH=true DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
YARN_PATH=true DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "${lines[1]}" = "Installing latest from npm." ]
|
[ "${lines[1]}" = "Installing latest from npm." ]
|
||||||
[ "${lines[-5]}" = "npm package has been installed." ]
|
[ "${lines[-6]}" = "npm package has been installed." ]
|
||||||
}
|
}
|
||||||
|
|
||||||
function should-use-aur() {
|
function should-use-aur() {
|
||||||
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "${lines[1]}" = "Installing latest from the AUR." ]
|
[ "${lines[1]}" = "Installing latest from the AUR." ]
|
||||||
[ "${lines[-5]}" = "AUR package has been installed." ]
|
[ "${lines[-6]}" = "AUR package has been installed." ]
|
||||||
}
|
}
|
||||||
|
|
||||||
function should-fallback-npm-brew() {
|
function should-fallback-npm-brew() {
|
||||||
@@ -52,21 +52,21 @@ function should-fallback-npm-brew() {
|
|||||||
[ "${lines[3]}" = "No standalone releases for $1." ]
|
[ "${lines[3]}" = "No standalone releases for $1." ]
|
||||||
[ "${lines[4]}" = "Falling back to installation from npm." ]
|
[ "${lines[4]}" = "Falling back to installation from npm." ]
|
||||||
[ "${lines[5]}" = "Installing latest from npm." ]
|
[ "${lines[5]}" = "Installing latest from npm." ]
|
||||||
[ "${lines[-5]}" = "npm package has been installed." ]
|
[ "${lines[-6]}" = "npm package has been installed." ]
|
||||||
}
|
}
|
||||||
|
|
||||||
function should-use-brew() {
|
function should-use-brew() {
|
||||||
BREW_PATH=true OS=macos ARCH=$1 run "$SCRIPT" --dry-run
|
BREW_PATH=true OS=macos ARCH=$1 run "$SCRIPT" --dry-run
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "${lines[1]}" = "Installing latest from Homebrew." ]
|
[ "${lines[1]}" = "Installing latest from Homebrew." ]
|
||||||
[ "${lines[-3]}" = "Brew release has been installed." ]
|
[ "${lines[-4]}" = "Brew release has been installed." ]
|
||||||
}
|
}
|
||||||
|
|
||||||
function should-use-standalone() {
|
function should-use-standalone() {
|
||||||
DISTRO=$1 ARCH=$2 OS=$3 run "$SCRIPT" --method standalone --dry-run
|
DISTRO=$1 ARCH=$2 OS=$3 run "$SCRIPT" --method standalone --dry-run
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "${lines[1]}" = "Installing v$VERSION of the $2 release from GitHub." ]
|
[ "${lines[1]}" = "Installing v$VERSION of the $2 release from GitHub." ]
|
||||||
[[ "${lines[-5]}" = "Standalone release has been installed"* ]]
|
[[ "${lines[-6]}" = "Standalone release has been installed"* ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "$SCRIPT_NAME: usage with --help" {
|
@test "$SCRIPT_NAME: usage with --help" {
|
||||||
@@ -141,7 +141,7 @@ function should-use-standalone() {
|
|||||||
[ "${lines[1]}" = "Homebrew not installed." ]
|
[ "${lines[1]}" = "Homebrew not installed." ]
|
||||||
[ "${lines[2]}" = "Falling back to standalone installation." ]
|
[ "${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 amd64 release from GitHub." ]
|
||||||
[[ "${lines[-5]}" = "Standalone release has been installed"* ]]
|
[[ "${lines[-6]}" = "Standalone release has been installed"* ]]
|
||||||
}
|
}
|
||||||
@test "$SCRIPT_NAME: macos i386 (no brew)" {
|
@test "$SCRIPT_NAME: macos i386 (no brew)" {
|
||||||
should-fallback-npm-brew "i386"
|
should-fallback-npm-brew "i386"
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ describe("parser", () => {
|
|||||||
delete process.env.LOG_LEVEL
|
delete process.env.LOG_LEVEL
|
||||||
delete process.env.PASSWORD
|
delete process.env.PASSWORD
|
||||||
delete process.env.CS_DISABLE_FILE_DOWNLOADS
|
delete process.env.CS_DISABLE_FILE_DOWNLOADS
|
||||||
|
delete process.env.CS_DISABLE_GETTING_STARTED_OVERRIDE
|
||||||
console.log = jest.fn()
|
console.log = jest.fn()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -97,6 +98,8 @@ describe("parser", () => {
|
|||||||
|
|
||||||
"--disable-file-downloads",
|
"--disable-file-downloads",
|
||||||
|
|
||||||
|
"--disable-getting-started-override",
|
||||||
|
|
||||||
["--host", "0.0.0.0"],
|
["--host", "0.0.0.0"],
|
||||||
"4",
|
"4",
|
||||||
"--",
|
"--",
|
||||||
@@ -114,6 +117,7 @@ describe("parser", () => {
|
|||||||
value: path.resolve("path/to/cert"),
|
value: path.resolve("path/to/cert"),
|
||||||
},
|
},
|
||||||
"disable-file-downloads": true,
|
"disable-file-downloads": true,
|
||||||
|
"disable-getting-started-override": true,
|
||||||
enable: ["feature1", "feature2"],
|
enable: ["feature1", "feature2"],
|
||||||
help: true,
|
help: true,
|
||||||
host: "0.0.0.0",
|
host: "0.0.0.0",
|
||||||
@@ -378,6 +382,30 @@ describe("parser", () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("should use env var CS_DISABLE_GETTING_STARTED_OVERRIDE", async () => {
|
||||||
|
process.env.CS_DISABLE_GETTING_STARTED_OVERRIDE = "1"
|
||||||
|
const args = parse([])
|
||||||
|
expect(args).toEqual({})
|
||||||
|
|
||||||
|
const defaultArgs = await setDefaults(args)
|
||||||
|
expect(defaultArgs).toEqual({
|
||||||
|
...defaults,
|
||||||
|
"disable-getting-started-override": true,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should use env var CS_DISABLE_GETTING_STARTED_OVERRIDE set to true", async () => {
|
||||||
|
process.env.CS_DISABLE_GETTING_STARTED_OVERRIDE = "true"
|
||||||
|
const args = parse([])
|
||||||
|
expect(args).toEqual({})
|
||||||
|
|
||||||
|
const defaultArgs = await setDefaults(args)
|
||||||
|
expect(defaultArgs).toEqual({
|
||||||
|
...defaults,
|
||||||
|
"disable-getting-started-override": true,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
it("should error if password passed in", () => {
|
it("should error if password passed in", () => {
|
||||||
expect(() => parse(["--password", "supersecret123"])).toThrowError(
|
expect(() => parse(["--password", "supersecret123"])).toThrowError(
|
||||||
"--password can only be set in the config file or passed in via $PASSWORD",
|
"--password can only be set in the config file or passed in via $PASSWORD",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"name": "test-plugin",
|
"name": "test-plugin",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
"code-server": "^4.8.1"
|
"code-server": "*"
|
||||||
},
|
},
|
||||||
"main": "out/index.js",
|
"main": "out/index.js",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
Reference in New Issue
Block a user