Skip to content
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

feat: add groups to install onboarding #452

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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: 2 additions & 6 deletions apps/hub/src/components/get-started.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@ import {
} from "@rivet-gg/icons";
import { motion, useMotionValueEvent, useScroll } from "framer-motion";
import { type ComponentProps, useState } from "react";
import installCli, {
source as installCliSource,
} from "./onboarding/initial-setup-install-rivet-cli.sh?shiki&lang=bash";
import setupCli, {
source as setupCliSource,
} from "./onboarding/initial-setup-setup-rivet-cli.sh?shiki&lang=bash";
import testCli, {
source as testCliSource,
} from "./onboarding/initial-setup-test-rivet-cli.sh?shiki&lang=bash";
import { InstallCli } from "./onboarding/install-cli";

const containerVariants = {
hidden: {
Expand Down Expand Up @@ -88,9 +86,7 @@ export function GetStarted() {
<CardContent>
<div>
<h3 className="font-semibold">1. Install</h3>
<CodeFrame code={installCliSource} language="bash">
<CodeSource>{installCli}</CodeSource>
</CodeFrame>
<InstallCli />
</div>
<div>
<h3 className="font-semibold">2. Setup</h3>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
powershell -Command "iwr https://releases.rivet.gg/rivet/latest/install.ps1 -useb | iex"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
iwr https://releases.rivet.gg/rivet/latest/install.ps1 -useb | iex
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
git clone https://github.com/rivet-gg/rivet
cargo build --bin rivet
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl -fsSL https://releases.rivet.gg/rivet/latest/install.sh | sh

This file was deleted.

48 changes: 48 additions & 0 deletions apps/hub/src/components/onboarding/install-cli.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { CodeFrame, CodeGroup, CodeSource } from "@rivet-gg/components";
import installCliCmd, {
source as installCliCmdSource,
} from "./initial-setup-install-rivet-cli-cmd.sh?shiki&lang=bash";
import installCliPowerShell, {
source as installCliPowerShellSource,
} from "./initial-setup-install-rivet-cli-powershell.sh?shiki&lang=bash";
import installCliSource, {
source as installCliSourceSource,
} from "./initial-setup-install-rivet-cli-source.sh?shiki&lang=bash";
import installCliUnix, {
source as installCliUnixSource,
} from "./initial-setup-install-rivet-cli-unix.sh?shiki&lang=bash";

export function InstallCli() {
return (
<CodeGroup>
<CodeFrame
title="macOS & Linux & WSL"
code={installCliUnixSource}
language="bash"
>
<CodeSource>{installCliUnix}</CodeSource>
</CodeFrame>
<CodeFrame
title="Windows (cmd)"
code={installCliCmdSource}
language="ps1"
>
<CodeSource>{installCliCmd}</CodeSource>
</CodeFrame>
<CodeFrame
title="Windows (PowerShell)"
code={installCliPowerShellSource}
language="powershell"
>
<CodeSource>{installCliPowerShell}</CodeSource>
</CodeFrame>
<CodeFrame
title="Build from source"
code={installCliSourceSource}
language="bash"
>
<CodeSource>{installCliSource}</CodeSource>
</CodeFrame>
</CodeGroup>
);
}
6 changes: 4 additions & 2 deletions packages/components/src/code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { javascript } from "@codemirror/lang-javascript";
import { json, jsonParseLinter } from "@codemirror/lang-json";
import { linter } from "@codemirror/lint";
import { EditorView } from "@codemirror/view";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@radix-ui/react-tabs";
import { Icon, faCopy, faFile } from "@rivet-gg/icons";
import { githubDark } from "@uiw/codemirror-theme-github";
import ReactCodeMirror, {
Expand All @@ -15,6 +14,7 @@ import { cn } from "./lib/utils";
import { Badge } from "./ui/badge";
import { Button } from "./ui/button";
import { ScrollArea } from "./ui/scroll-area";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./ui/tabs";
import { WithTooltip } from "./ui/tooltip";

interface JsonCodeProps extends ReactCodeMirrorProps {}
Expand Down Expand Up @@ -151,7 +151,9 @@ export const CodeFrame = ({
<Icon icon={faFile} className="block" />
<span>{file}</span>
</>
) : isInGroup ? null : (
) : isInGroup ? (
<Badge variant="outline">{languageNames[language]}</Badge>
) : (
<Badge variant="outline">{title || languageNames[language]}</Badge>
)}
</div>
Expand Down
Loading