Skip to content

Commit f8f1615

Browse files
Improve fern.config.json documentation (#1548)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Devin Logan <[email protected]>
1 parent b0737f8 commit f8f1615

File tree

9 files changed

+29
-43
lines changed

9 files changed

+29
-43
lines changed

.vale/styles/FernStyles/Current.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ message: "Avoid time-relative terms like '%s' that become outdated"
33
level: warning
44
ignorecase: true
55
tokens:
6-
- current
76
- currently
87
- presently
98
- as of now
109
- at this time
11-
- present
1210
- in the future
1311
- future
1412
- now

.vale/styles/FernStyles/Headings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,4 @@ exceptions:
113113
- Proto
114114
- RBAC
115115
- YAML
116+
- fern.config.json

fern/products/api-def/pages/project-structure.mdx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,9 @@ fern/
2626
Beyond the core files, you can optionally use an overrides file to customize your API definition without modifying the original spec. See [Overrides](/api-definitions/overview/overrides) for instructions.
2727
</Note>
2828

29-
### `fern.config.json file`
29+
### `fern.config.json`
3030

31-
Every fern folder has a single `fern.config.json` file. This file stores the organization and
32-
the version of the Fern CLI that you are using.
33-
34-
```json title="fern.config.json"
35-
{
36-
"organization": "your-organization",
37-
"version": "0.31.2"
38-
}
39-
```
40-
41-
Every time you run a fern CLI command, the CLI downloads itself at the correct version to ensure
42-
determinism.
31+
<Markdown src="/snippets/fern-config-json-reference.mdx" />
4332

4433
### `generators.yml`
4534

@@ -196,4 +185,4 @@ groups:
196185
```
197186

198187
</Accordion>
199-
</AccordionGroup>
188+
</AccordionGroup>

fern/products/cli-api-reference/pages/cli-get-started.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ In your `fern.config.json`, set the version to `*` to use your locally installed
3939
}
4040
```
4141

42+
See the [fern.config.json reference](/learn/sdks/overview/project-structure#fernconfigjson) for more details.
43+
4244
</Step>
4345

4446
<Step title="Run via package manager">

fern/products/cli-api-reference/pages/commands.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ hideOnThisPage: true
221221

222222
<Accordion title="fern check">
223223

224-
Use `fern check` to validate your API definition and Fern configuration: `fern.config.json`, `generators.yml`, and `docs.yml`.
224+
Use `fern check` to validate your API definition and Fern configuration: [`fern.config.json`](/learn/sdks/overview/project-structure#fernconfigjson), `generators.yml`, and `docs.yml`.
225225

226226
When successfully executed, this command will not produce any output.
227227

@@ -336,7 +336,7 @@ hideOnThisPage: true
336336

337337
<Accordion title="fern upgrade">
338338

339-
Use `fern upgrade` to upgrade your compiler version in `fern.config.json` to the
339+
Use `fern upgrade` to upgrade your compiler version in [`fern.config.json`](/learn/sdks/overview/project-structure#fernconfigjson) to the
340340
latest version. It will also upgrade generators in `generators.yml` to their minimum-compatible versions.
341341

342342
<CodeBlock title="terminal">
@@ -389,8 +389,8 @@ hideOnThisPage: true
389389

390390
<Accordion title="fern token">
391391

392-
Use `fern token `to generate a `FERN_TOKEN` specific to your organization defined
393-
in `fern.config.json`. Use the token to authenticate with the API in CI. Tokens do not expire.
392+
Use `fern token` to generate a `FERN_TOKEN` specific to your organization defined
393+
in [`fern.config.json`](/learn/sdks/overview/project-structure#fernconfigjson). Use the token to authenticate with the API in CI. Tokens do not expire.
394394

395395
<CodeBlock title="terminal">
396396
```bash

fern/products/docs/pages/getting-started/project-structure.mdx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,6 @@ title: Fern's Documentation
180180

181181
## `fern.config.json`
182182

183-
The `fern.config.json` file specifies your organization name and the version of the Fern CLI used to generate the documentation. You can customize this file to reflect your organization's details.
184-
185-
<CodeBlock title="fern/fern.config.json">
186-
```json
187-
{
188-
"organization": "my-organization",
189-
"version": "<Markdown src="/snippets/version-number-cli.mdx"/>"
190-
}
191-
```
192-
</CodeBlock>
183+
<Markdown src="/snippets/fern-config-json-reference.mdx" />
193184

194185

fern/products/docs/pages/getting-started/quickstart.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ In this guide, we'll show you how to get started with Fern in under 5 minutes.
2929
Next, please update the template settings to use your organization.
3030

3131
<Warning title="Edit template settings">
32-
Please edit the details `fern.config.json` and `docs.yml` with your organization
32+
Edit the details in `fern.config.json` and `docs.yml` with your organization
3333
name.
3434

3535
<CodeBlocks>
3636
<CodeBlock title="fern.config.json">
3737
```json {2}
3838
{
3939
"organization": "{{YOUR_ORGANIZATION}}",
40-
"version": "0.x.x"
40+
"version": "<Markdown src="/snippets/version-number-cli.mdx"/>"
4141
}
4242
```
4343
</CodeBlock>
@@ -48,6 +48,8 @@ In this guide, we'll show you how to get started with Fern in under 5 minutes.
4848
```
4949
</CodeBlock>
5050
</CodeBlocks>
51+
52+
See the [fern.config.json reference](/learn/sdks/overview/project-structure#fernconfigjson) for more details.
5153
</Warning>
5254
Finally, navigate to the docs directory (where the `fern` folder is located) and execute the following command to generate your documentation:
5355

fern/products/sdks/project-structure.mdx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,7 @@ The source repository contains a `fern/` folder that is initialized with your A
4343

4444
### `fern.config.json`
4545

46-
Every fern folder has a single `fern.config.json` file. This file stores the organization name and the version of the Fern CLI that you are using:
47-
48-
```json
49-
{
50-
"organization": "your-organization",
51-
"version": "<Markdown src="/snippets/version-number-cli.mdx"/>"
52-
}
53-
```
54-
55-
Every time you run a fern CLI command, the CLI downloads itself at the correct version to ensure determinism.
46+
<Markdown src="/snippets/fern-config-json-reference.mdx" />
5647

5748
### `generators.yml`
5849

@@ -72,4 +63,4 @@ See [Project structure (API Definitions)](/api-definitions/overview/project-stru
7263

7364
1. **Create repositories**: Set up your source repository, plus one repository for each SDK
7465
2. **Install Fern GitHub App**: Install the [Fern GitHub App](https://github.com/apps/fern-api) on all repositories
75-
3. **Configure `generators.yml`**: In your `generators.yml`, add a reference to each SDK repository.
66+
3. **Configure `generators.yml`**: In your `generators.yml`, add a reference to each SDK repository.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
The `fern.config.json` file stores your organization name and the Fern CLI version. Pinning the version provides deterministic builds.
2+
3+
```json title="fern.config.json"
4+
{
5+
"organization": "plant-catalog",
6+
"version": "<Markdown src="/snippets/version-number-cli.mdx"/>"
7+
}
8+
```
9+
10+
<Info>
11+
When working with a locally installed CLI, set `version` to `"*"`. See [Install Fern CLI locally](/cli-api-reference/cli-reference/overview#install-fern-cli-locally) for details.
12+
</Info>

0 commit comments

Comments
 (0)