Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Commit 40dd6d9

Browse files
committed
feat: add groups to install onboarding
1 parent 9f9c4fd commit 40dd6d9

8 files changed

+59
-9
lines changed

apps/hub/src/components/get-started.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@ import {
2727
} from "@rivet-gg/icons";
2828
import { motion, useMotionValueEvent, useScroll } from "framer-motion";
2929
import { type ComponentProps, useState } from "react";
30-
import installCli, {
31-
source as installCliSource,
32-
} from "./onboarding/initial-setup-install-rivet-cli.sh?shiki&lang=bash";
3330
import setupCli, {
3431
source as setupCliSource,
3532
} from "./onboarding/initial-setup-setup-rivet-cli.sh?shiki&lang=bash";
3633
import testCli, {
3734
source as testCliSource,
3835
} from "./onboarding/initial-setup-test-rivet-cli.sh?shiki&lang=bash";
36+
import { InstallCli } from "./onboarding/install-cli";
3937

4038
const containerVariants = {
4139
hidden: {
@@ -88,9 +86,7 @@ export function GetStarted() {
8886
<CardContent>
8987
<div>
9088
<h3 className="font-semibold">1. Install</h3>
91-
<CodeFrame code={installCliSource} language="bash">
92-
<CodeSource>{installCli}</CodeSource>
93-
</CodeFrame>
89+
<InstallCli />
9490
</div>
9591
<div>
9692
<h3 className="font-semibold">2. Setup</h3>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
powershell -Command "iwr https://releases.rivet.gg/rivet/latest/install.ps1 -useb | iex"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
iwr https://releases.rivet.gg/rivet/latest/install.ps1 -useb | iex
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
git clone https://github.com/rivet-gg/rivet
2+
cargo build --bin rivet
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
curl -fsSL https://releases.rivet.gg/rivet/latest/install.sh | sh

apps/hub/src/components/onboarding/initial-setup-install-rivet-cli.sh

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { CodeFrame, CodeGroup, CodeSource } from "@rivet-gg/components";
2+
import installCliCmd, {
3+
source as installCliCmdSource,
4+
} from "./initial-setup-install-rivet-cli-cmd.sh?shiki&lang=bash";
5+
import installCliPowerShell, {
6+
source as installCliPowerShellSource,
7+
} from "./initial-setup-install-rivet-cli-powershell.sh?shiki&lang=bash";
8+
import installCliSource, {
9+
source as installCliSourceSource,
10+
} from "./initial-setup-install-rivet-cli-source.sh?shiki&lang=bash";
11+
import installCliUnix, {
12+
source as installCliUnixSource,
13+
} from "./initial-setup-install-rivet-cli-unix.sh?shiki&lang=bash";
14+
15+
export function InstallCli() {
16+
return (
17+
<CodeGroup>
18+
<CodeFrame
19+
title="macOS & Linux & WSL"
20+
code={installCliUnixSource}
21+
language="bash"
22+
>
23+
<CodeSource>{installCliUnix}</CodeSource>
24+
</CodeFrame>
25+
<CodeFrame
26+
title="Windows (cmd)"
27+
code={installCliCmdSource}
28+
language="ps1"
29+
>
30+
<CodeSource>{installCliCmd}</CodeSource>
31+
</CodeFrame>
32+
<CodeFrame
33+
title="Windows (PowerShell)"
34+
code={installCliPowerShellSource}
35+
language="powershell"
36+
>
37+
<CodeSource>{installCliPowerShell}</CodeSource>
38+
</CodeFrame>
39+
<CodeFrame
40+
title="Build from source"
41+
code={installCliSourceSource}
42+
language="bash"
43+
>
44+
<CodeSource>{installCliSource}</CodeSource>
45+
</CodeFrame>
46+
</CodeGroup>
47+
);
48+
}

packages/components/src/code.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { javascript } from "@codemirror/lang-javascript";
22
import { json, jsonParseLinter } from "@codemirror/lang-json";
33
import { linter } from "@codemirror/lint";
44
import { EditorView } from "@codemirror/view";
5-
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@radix-ui/react-tabs";
65
import { Icon, faCopy, faFile } from "@rivet-gg/icons";
76
import { githubDark } from "@uiw/codemirror-theme-github";
87
import ReactCodeMirror, {
@@ -15,6 +14,7 @@ import { cn } from "./lib/utils";
1514
import { Badge } from "./ui/badge";
1615
import { Button } from "./ui/button";
1716
import { ScrollArea } from "./ui/scroll-area";
17+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./ui/tabs";
1818
import { WithTooltip } from "./ui/tooltip";
1919

2020
interface JsonCodeProps extends ReactCodeMirrorProps {}
@@ -151,7 +151,9 @@ export const CodeFrame = ({
151151
<Icon icon={faFile} className="block" />
152152
<span>{file}</span>
153153
</>
154-
) : isInGroup ? null : (
154+
) : isInGroup ? (
155+
<Badge variant="outline">{languageNames[language]}</Badge>
156+
) : (
155157
<Badge variant="outline">{title || languageNames[language]}</Badge>
156158
)}
157159
</div>

0 commit comments

Comments
 (0)