Skip to content

Commit 377e99e

Browse files
committed
add manual setup instructions for grpc and openrpc
1 parent c840c49 commit 377e99e

File tree

3 files changed

+109
-22
lines changed

3 files changed

+109
-22
lines changed

fern/products/api-def/asyncapi-pages/overview.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ fern/
132132
└─ asyncapi.yml
133133
```
134134
</Step>
135-
<Step title="Create a fern.config.json file">
135+
<Step title="Create a `fern.config.json` file">
136136
Add a `fern.config.json` file in your fern directory that lists your organization and the current version of the Fern CLI:
137137
138138
```json title="fern.config.json"
139139
{
140140
"organization": "your-organization",
141-
"version": "0.77.2"
141+
"version": "<Markdown src="/snippets/version-number-cli.mdx" />"
142142
}
143143
```
144144

@@ -149,7 +149,7 @@ fern/
149149
└─ asyncapi.yml
150150
```
151151
</Step>
152-
<Step title="Create a generators.yml file">
152+
<Step title="Create a `generators.yml` file">
153153
Create a `generators.yml` file in your fern directory and add a reference to your AsyncAPI spec:
154154

155155
```yaml title="generators.yml"

fern/products/api-def/grpc-pages/overview.mdx

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,23 +162,69 @@ enum ChatMessageType {
162162
<Info> Need help getting started with gRPC and Fern? Get live support [here](https://fern-community.slack.com/join/shared_invite/zt-2dpftfmif-MuAegl8AfP_PK8s2tx350Q%EF%BB%BF#/shared-invite/email) </Info>
163163

164164

165-
Start by initializing your fern folder with a gRPC service
166165

167-
<CodeGroup>
168-
```sh protobuf
169-
fern init --proto ./path/to/service.proto
166+
<Steps>
167+
<Step title="Create your fern directory">
168+
Create a `fern/` folder in your project root.
169+
170+
```
171+
fern/
172+
```
173+
</Step>
174+
<Step title="Add your gRPC service">
175+
Add your gRPC files to the fern directory. You can place it in a subfolder called `proto` or directly in the fern directory.
176+
177+
```
178+
fern/
179+
└─ proto/
180+
├─ user_service.proto
181+
└─ common.proto
170182
```
171-
```sh directory
172-
fern init --proto-directory ./path/to/proto/files
183+
</Step>
184+
<Step title="Create a `fern.config.json` file">
185+
Add a `fern.config.json` file in your fern directory that lists your organization and the current version of the Fern CLI:
186+
187+
```json title="fern.config.json"
188+
{
189+
"organization": "your-organization",
190+
"version": "<Markdown src="/snippets/version-number-cli.mdx" />"
191+
}
173192
```
174-
</CodeGroup>
175193

176-
This will initialize a directory like the following
194+
```
195+
fern/
196+
├─ fern.config.json
197+
└─ proto/
198+
├─ user_service.proto
199+
└─ common.proto
200+
```
201+
</Step>
202+
<Step title="Create a `generators.yml` file">
203+
Create a `generators.yml` file in your fern directory and add a reference to your gRPC proto files:
204+
205+
```yaml title="generators.yml"
206+
# Your API definition
207+
api:
208+
specs:
209+
- proto:
210+
root: ./proto
211+
target: ./proto/user_service.proto
212+
213+
groups:
214+
external:
215+
generators:
216+
# Your generator configurations here
217+
```
218+
219+
Your final directory structure:
220+
177221
```
178222
fern/
179223
├─ fern.config.json
180224
├─ generators.yml
181225
└─ proto/
182226
├─ user_service.proto
183227
└─ common.proto
184-
```
228+
```
229+
</Step>
230+
</Steps>

fern/products/api-def/openrpc-pages/overview.mdx

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,22 +146,63 @@ components:
146146
147147
<Info> Considering options to generate an OpenRPC spec? Get live support [here](https://fern-community.slack.com/join/shared_invite/zt-2dpftfmif-MuAegl8AfP_PK8s2tx350Q%EF%BB%BF#/shared-invite/email) </Info>
148148
149-
Start by initializing your fern folder with an OpenRPC spec
149+
<Steps>
150+
<Step title="Create your fern directory">
151+
Create a `fern/` folder in your project root.
150152

151-
<CodeGroup>
152-
```sh file
153-
fern init --openrpc ./path/to/openrpc
154153
```
155-
```sh url
156-
fern init --openrpc https://host/path/to/openrpc
154+
fern/
155+
```
156+
</Step>
157+
<Step title="Add your OpenRPC specification">
158+
Add your OpenRPC spec to the fern directory. You can place it in a subfolder called `openrpc` or directly in the fern directory.
159+
160+
```
161+
fern/
162+
└─ openrpc/
163+
└─ openrpc.yml
164+
```
165+
</Step>
166+
<Step title="Create a `fern.config.json` file">
167+
Add a `fern.config.json` file in your fern directory that lists your organization and the current version of the Fern CLI:
168+
169+
```json title="fern.config.json"
170+
{
171+
"organization": "your-organization",
172+
"version": "<Markdown src="/snippets/version-number-cli.mdx" />"
173+
}
157174
```
158-
</CodeGroup>
159175

160-
This will initialize a directory like the following
176+
```
177+
fern/
178+
├─ fern.config.json
179+
└─ openrpc/
180+
└─ openrpc.yml
181+
```
182+
</Step>
183+
<Step title="Create a `generators.yml` file">
184+
Create a `generators.yml` file in your fern directory and add a reference to your OpenRPC spec:
185+
186+
```yaml title="generators.yml"
187+
# Your API definition
188+
api:
189+
specs:
190+
- openrpc: ./openrpc/openrpc.yml
191+
192+
groups:
193+
external:
194+
generators:
195+
# Your generator configurations here
196+
```
197+
198+
Your final directory structure:
199+
161200
```
162201
fern/
163202
├─ fern.config.json
164203
├─ generators.yml
165204
└─ openrpc/
166-
├─ openrpc.yml
167-
```
205+
└─ openrpc.yml
206+
```
207+
</Step>
208+
</Steps>

0 commit comments

Comments
 (0)