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

Commit 423ee5d

Browse files
committed
new tabs component and refactor of install nitric
1 parent ea75f71 commit 423ee5d

File tree

13 files changed

+303
-167
lines changed

13 files changed

+303
-167
lines changed

docs/get-started/installation.mdx

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,44 +22,68 @@ Please follow these links to the official installation steps for each.
2222

2323
## Installing the Nitric CLI
2424

25-
<InstallNitric>
25+
<InstallNitricTabs>
2626

27-
```bash !!tabs macOS
27+
<TabItem label="macOS">
28+
29+
```bash
2830
brew install nitrictech/tap/nitric
2931
```
3032

31-
```bash !!tabs Windows
33+
</TabItem>
34+
35+
<TabItem label="Windows">
36+
37+
```bash
3238
scoop bucket add nitric https://github.com/nitrictech/scoop-bucket.git
3339
scoop install nitric
3440
```
3541

36-
```bash !!tabs Linux
42+
</TabItem>
43+
44+
<TabItem label="Linux">
45+
46+
```bash
3747
curl -L "https://nitric.io/install?version=latest" | bash
3848
```
3949

40-
</InstallNitric>
50+
</TabItem>
51+
52+
</InstallNitricTabs>
4153

4254
### Manual Install
4355

4456
Alternatively, you can download pre-compiled binaries from the [releases](https://github.com/nitrictech/cli/releases) page and install them manually.
4557

4658
## Update to the latest version
4759

48-
<InstallNitric>
60+
<InstallNitricTabs>
4961

50-
```bash !!tabs macOS
62+
<TabItem label="macOS">
63+
64+
```bash
5165
brew upgrade nitric
5266
```
5367

54-
```bash !!tabs Windows
68+
</TabItem>
69+
70+
<TabItem label="Windows">
71+
72+
```bash
5573
scoop update nitric
5674
```
5775

58-
```bash !!tabs Linux
76+
</TabItem>
77+
78+
<TabItem label="Linux">
79+
80+
```bash
5981
curl -L "https://nitric.io/install?version=latest" | bash
6082
```
6183

62-
</InstallNitric>
84+
</TabItem>
85+
86+
</InstallNitricTabs>
6387

6488
You can easily check which version you're on by running `nitric version`.
6589

docs/get-started/quickstart.mdx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,34 @@ description: 'Getting started guide for an initial Nitric project'
66

77
Before you begin, you'll need to install the Nitric CLI.
88

9-
<InstallNitric>
9+
<InstallNitricTabs>
1010

11-
```bash !!tabs macOS
11+
<TabItem label="macOS">
12+
13+
```bash
1214
brew install nitrictech/tap/nitric
1315
```
1416

15-
```bash !!tabs Windows
17+
</TabItem>
18+
19+
<TabItem label="Windows">
20+
21+
```bash
1622
scoop bucket add nitric https://github.com/nitrictech/scoop-bucket.git
1723
scoop install nitric
1824
```
1925

20-
```bash !!tabs Linux
26+
</TabItem>
27+
28+
<TabItem label="Linux">
29+
30+
```bash
2131
curl -L "https://nitric.io/install?version=latest" | bash
2232
```
2333

24-
</InstallNitric>
34+
</TabItem>
35+
36+
</InstallNitricTabs>
2537

2638
<Note>
2739
For more installation options and dependency information review the full

docs/index.mdx

Lines changed: 88 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -100,39 +100,63 @@ Are the differences between a bucket on AWS and a bucket on Azure important to m
100100

101101
Nitric abstracts away API layer differences, so you can focus on your app. The part that makes that possible is a plugin, we call a **Provider**.
102102

103-
<CodeWithTabs>
103+
<Tabs syncKey="providers">
104104

105-
```yaml !!tabs AWS Pulumi file:nitric.prod.yaml
105+
<TabItem label="AWS Pulumi">
106+
107+
```yaml file:nitric.prod.yaml
106108
provider: nitric/[email protected]
107109
region: us-east-1
108110
```
109111
110-
```yaml !!tabs Azure Pulumi file:nitric.prod.yaml
112+
</TabItem>
113+
114+
<TabItem label="Azure Pulumi">
115+
116+
```yaml file:nitric.prod.yaml
111117
provider: nitric/[email protected]
112118
region: East US
113119
```
114120
115-
```yaml !!tabs Google Pulumi file:nitric.prod.yaml
121+
</TabItem>
122+
123+
<TabItem label="Google Pulumi">
124+
125+
```yaml file:nitric.prod.yaml
116126
provider: nitric/[email protected]
117127
region: us-east1
118128
```
119129
120-
```yaml !!tabs AWS Terraform file:nitric.prod.yaml
130+
</TabItem>
131+
132+
<TabItem label="AWS Terraform">
133+
134+
```yaml file:nitric.prod.yaml
121135
provider: nitric/[email protected]
122136
region: us-east-1
123137
```
124138
125-
```yaml !!tabs Google Terraform file:nitric.prod.yaml
139+
</TabItem>
140+
141+
<TabItem label="Google Terraform">
142+
143+
```yaml file:nitric.prod.yaml
126144
provider: nitric/[email protected]
127145
region: us-east1
128146
```
129147
130-
```yaml !!tabs Custom file:nitric.prod.yaml
148+
</TabItem>
149+
150+
<TabItem label="Custom">
151+
152+
```yaml file:nitric.prod.yaml
131153
# Build your own provider to deploy anywhere you like.
132154
provider: custom/[email protected]
133155
```
134156
135-
</CodeWithTabs>
157+
</TabItem>
158+
159+
</Tabs>
136160
137161
We have several providers built-in with IaC from [Pulumi](https://www.pulumi.com/) or [Terraform](https://www.terraform.io/), but you can build your own with any tools you prefer and **deploy anywhere**.
138162
@@ -153,9 +177,11 @@ Nitric uses this to find your services, then it turns each service into a contai
153177

154178
So, a project structure might look something like this:
155179

156-
<CodeWithTabs>
180+
<Tabs>
181+
182+
<TabItem label="JavaScript">
157183

158-
```bash !!tabs JavaScript
184+
```bash
159185
example/
160186
├── nitric.yaml
161187
├── services/
@@ -164,7 +190,11 @@ example/
164190
└── package.json
165191
```
166192

167-
```bash !!tabs Python
193+
</TabItem>
194+
195+
<TabItem label="Python">
196+
197+
```bash
168198
example/
169199
├── nitric.yaml
170200
├── services/
@@ -173,7 +203,11 @@ example/
173203
└── Pipfile
174204
```
175205

176-
```bash !!tabs Go
206+
</TabItem>
207+
208+
<TabItem label="Go">
209+
210+
```bash
177211
example/
178212
├── nitric.yaml
179213
├── services/
@@ -185,7 +219,11 @@ example/
185219
└── go.mod
186220
```
187221

188-
```bash !!tabs Dart
222+
</TabItem>
223+
224+
<TabItem label="Dart">
225+
226+
```bash
189227
example/
190228
├── nitric.yaml
191229
├── services/
@@ -194,30 +232,44 @@ example/
194232
└── pubspec.yaml
195233
```
196234

197-
</CodeWithTabs>
235+
</TabItem>
236+
237+
</Tabs>
198238

199239
---
200240

201241
## CLI
202242

203243
Nitric has a CLI to help you create, manage, run and deploy your projects. We recommend installing it with a package manager:
204244

205-
<InstallNitric>
245+
<InstallNitricTabs>
206246

207-
```bash !!tabs macOS
247+
<TabItem label="macOS">
248+
249+
```bash
208250
brew install nitrictech/tap/nitric
209251
```
210252

211-
```bash !!tabs Windows
253+
</TabItem>
254+
255+
<TabItem label="Windows">
256+
257+
```bash
212258
scoop bucket add nitric https://github.com/nitrictech/scoop-bucket.git
213259
scoop install nitric
214260
```
215261

216-
```bash !!tabs Linux
262+
</TabItem>
263+
264+
<TabItem label="Linux">
265+
266+
```bash
217267
curl -L "https://nitric.io/install?version=latest" | bash
218268
```
219269

220-
</InstallNitric>
270+
</TabItem>
271+
272+
</InstallNitricTabs>
221273

222274
<Note>
223275
Nitric has a few dependencies, like Docker, which you can read about in the
@@ -361,21 +413,33 @@ Alternatively, you can download pre-compiled binaries from the [releases](https:
361413

362414
## Update to the latest version
363415

364-
<InstallNitric>
416+
<InstallNitricTabs>
417+
418+
<TabItem label="macOS">
365419

366-
```bash !!tabs macOS
420+
```bash
367421
brew upgrade nitric
368422
```
369423

370-
```bash !!tabs Windows
424+
</TabItem>
425+
426+
<TabItem label="Windows">
427+
428+
```bash
371429
scoop update nitric
372430
```
373431

374-
```bash !!tabs Linux
432+
</TabItem>
433+
434+
<TabItem label="Linux">
435+
436+
```bash
375437
curl -L "https://nitric.io/install?version=latest" | bash
376438
```
377439

378-
</InstallNitric>
440+
</TabItem>
441+
442+
</InstallNitricTabs>
379443

380444
You can easily check which version you're on by running `nitric version`.
381445

docs/support/upgrade/index.mdx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,34 @@ Nitric v1.x introduces a number of breaking changes from v0.x. However, in most
1212

1313
The first step in upgrading your project is to upgrade the Nitric CLI. You can do this by running the following command:
1414

15-
<InstallNitric>
15+
<InstallNitricTabs>
1616

17-
```bash !!tabs macOS
17+
<TabItem label="macOS">
18+
19+
```bash
1820
brew install nitrictech/tap/nitric
1921
```
2022

21-
```bash !!tabs Windows
23+
</TabItem>
24+
25+
<TabItem label="Windows">
26+
27+
```bash
2228
scoop bucket add nitric https://github.com/nitrictech/scoop-bucket.git
2329
scoop install nitric
2430
```
2531

26-
```bash !!tabs Linux
32+
</TabItem>
33+
34+
<TabItem label="Linux">
35+
36+
```bash
2737
curl -L "https://nitric.io/install?version=latest" | bash
2838
```
2939

30-
</InstallNitric>
40+
</TabItem>
41+
42+
</InstallNitricTabs>
3143

3244
## Upgrading Nitric Projects
3345

src/app/providers.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useEffect } from 'react'
44
import { ThemeProvider, useTheme } from 'next-themes'
5-
import { OSProvider } from '@/components/InstallNitric/OSContext'
5+
import { TabsProvider } from '@/components/tabs/TabsContext'
66

77
function ThemeWatcher() {
88
let { resolvedTheme, setTheme } = useTheme()
@@ -32,7 +32,7 @@ export function Providers({ children }: { children: React.ReactNode }) {
3232
return (
3333
<ThemeProvider attribute="class" disableTransitionOnChange>
3434
<ThemeWatcher />
35-
<OSProvider>{children}</OSProvider>
35+
<TabsProvider>{children}</TabsProvider>
3636
</ThemeProvider>
3737
)
3838
}

0 commit comments

Comments
 (0)