Skip to content

Improve getting started Coder CTA #5752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
in {
devShells.default = pkgs.mkShell {
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 ]
++ (with xorg; [ libX11 libxkbfile ])
++ lib.optionals stdenv.isDarwin [
AppKit Cocoa CoreServices Security cctools xcbuild
]);
++ lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
AppKit Cocoa CoreServices Security xcbuild
]));
};
}
);
Expand Down
8 changes: 8 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ Or, if you don't want/need a background service you can run:
EOF
}

echo_coder_postinstall() {
echoh
echoh "Deploy code-server for your team with Coder: https://github.com/coder/coder"
}

main() {
if [ "${TRACE-}" ]; then
set -x
Expand Down Expand Up @@ -243,6 +248,7 @@ main() {
if [ "$METHOD" = standalone ]; then
if has_standalone; then
install_standalone
echo_coder_postinstall
exit 0
else
echoerr "There are no standalone releases for $ARCH"
Expand Down Expand Up @@ -286,6 +292,8 @@ main() {
npm_fallback install_standalone
;;
esac

echo_coder_postinstall
}

parse_arg() {
Expand Down
93 changes: 75 additions & 18 deletions patches/getting-started.diff
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
===================================================================
--- 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
@@ -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';
Expand All @@ -19,32 +19,89 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
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';
@@ -753,11 +753,24 @@ export class GettingStartedPage extends
onShowOnStartupChanged();
}));

- const header = $('.header', {},
+ let header = $('.header', {},
$('h1.product-name.caption', {}, this.productService.nameLong),
@@ -758,6 +758,65 @@ 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)) {
+ header = $('.header', {},
+ $('h1.product-name.caption', {}, this.productService.nameLong),
+ $('p.subtitle.description.coder', {},
+ "Using code-server on a team?",
+ ),
+ $('p.subtitle.description.coder-coder', {},
+ "Check out: ",
+ $('a', { href: "https://github.com/coder/coder" }, "coder/coder")
+ ),
+ );
+ 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: #B3BFD7',
+ ].join(';'),
+ }, 'Provision remote development environments on your infrastructure with Coder.'),
+ $('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 +834,13 @@ export class GettingStartedPage extends
const layoutLists = () => {
if (gettingStartedList.itemCount) {
this.container.classList.remove('noWalkthroughs');
- reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
- reset(rightColumn, gettingStartedList.getDomElement());
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement(), gettingStartedList.getDomElement());
+ reset(rightColumn, gettingStartedCoder);
recentList.setLimit(5);
}
else {
this.container.classList.add('noWalkthroughs');
- reset(leftColumn, startList.getDomElement());
+ reset(leftColumn, startList.getDomElement(), gettingStartedCoder);
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
Expand Down
Binary file added src/browser/media/templates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions test/scripts/install.bats
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ function should-use-deb() {
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
[ "$status" -eq 0 ]
[ "${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() {
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
[ "$status" -eq 0 ]
[ "${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() {
Expand All @@ -27,21 +27,21 @@ function should-fallback-npm() {
[ "${lines[1]}" = "No standalone releases for $2." ]
[ "${lines[2]}" = "Falling back to installation 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() {
YARN_PATH=true DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
[ "$status" -eq 0 ]
[ "${lines[1]}" = "Installing latest from npm." ]
[ "${lines[-5]}" = "npm package has been installed." ]
[ "${lines[-6]}" = "npm package has been installed." ]
}

function should-use-aur() {
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
[ "$status" -eq 0 ]
[ "${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() {
Expand All @@ -52,21 +52,21 @@ function should-fallback-npm-brew() {
[ "${lines[3]}" = "No standalone releases for $1." ]
[ "${lines[4]}" = "Falling back to installation 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() {
BREW_PATH=true OS=macos ARCH=$1 run "$SCRIPT" --dry-run
[ "$status" -eq 0 ]
[ "${lines[1]}" = "Installing latest from Homebrew." ]
[ "${lines[-3]}" = "Brew release has been installed." ]
[ "${lines[-4]}" = "Brew release has been installed." ]
}

function should-use-standalone() {
DISTRO=$1 ARCH=$2 OS=$3 run "$SCRIPT" --method standalone --dry-run
[ "$status" -eq 0 ]
[ "${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" {
Expand Down Expand Up @@ -141,7 +141,7 @@ function should-use-standalone() {
[ "${lines[1]}" = "Homebrew not installed." ]
[ "${lines[2]}" = "Falling back to standalone installation." ]
[ "${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)" {
should-fallback-npm-brew "i386"
Expand Down