Skip to content

Commit df6ea17

Browse files
authored
Move Fern Folder Initialization Instructions into Fern folder page (#96)
1 parent a239715 commit df6ea17

File tree

11 files changed

+55
-355
lines changed

11 files changed

+55
-355
lines changed

fern/products/sdks/fern-folder.mdx

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Overview of the Fern Folder
2+
title: Set up the Fern Folder
33
description: Describes the Fern folder structure
44
---
55

@@ -9,47 +9,39 @@ your API definitions, generators, and your CLI version.
99
After you configure your `fern` folder, you'll be ready to start generating SDKs
1010
in different languages.
1111

12-
## Directory structure
12+
## Set up the fern folder
1313

14-
You can initialize your Fern folder with either a Fern Definition or OpenAPI specification.
14+
<Steps>
1515

16-
<Info>
17-
You can always convert a Fern Definition to OpenAPI or OpenAPI to a Fern Definition later on.
18-
</Info>
16+
<Markdown src="/products/sdks/snippets/install-cli.mdx"/>
17+
18+
### Initialize the Fern Folder
19+
20+
<Markdown src="/products/sdks/snippets/initialize-fern-folder-intro.mdx"/>
21+
22+
<AccordionGroup>
23+
<Markdown src="/products/sdks/snippets/option-1-openapi.mdx"/>
1924

20-
The `fern` directory is initialized with:
25+
<Accordion title="Option 2: Fern Definition">
26+
27+
<Markdown src="/products/sdks/snippets/option-2-fern-def.mdx"/>
28+
</Accordion>
29+
30+
{/* <Markdown src="/products/sdks/snippets/option-3-asyncapi.mdx"/> */}
31+
32+
</AccordionGroup>
33+
</Steps>
34+
35+
## Learn more about the initialized files
36+
37+
Every initialized `fern` directory has:
2138
* A `fern.config.json` file
2239
* A `generators.yml` file
23-
* Either a `definition/` (for a Fern Definition spec) or `openapi/` (for an OpenAPI spec) directory that contains your API specification files.
24-
25-
<AccordionGroup>
26-
<Accordion title="Initializing with the Fern Definition">
27-
When you run `fern init`, your Fern folder will be initialized with the following files:
28-
```bash
29-
fern/
30-
├─ fern.config.json
31-
├─ generators.yml
32-
└─ definition/
33-
├─ api.yml
34-
└─ imdb.yml
35-
```
36-
</Accordion>
37-
<Accordion title="Initializing with OpenAPI">
38-
If you want to initialize Fern with an OpenAPI Specification, run `fern init --openapi path/to/openapi` instead.
39-
```yaml
40-
fern/
41-
├─ fern.config.json
42-
├─ generators.yml # required on Fern version 0.41.0 and above
43-
└─ openapi/
44-
├─ openapi.yml
45-
```
46-
</Accordion>
47-
</AccordionGroup>
4840

4941
### `fern.config.json`
5042

51-
Every fern folder has a single `fern.config.json` file. This file stores the organization and
52-
the version of the Fern CLI that you are using.
43+
This file stores the organization and the version of the Fern CLI that you are
44+
using.
5345

5446
```json
5547
{
@@ -70,9 +62,13 @@ API specification. For each generator, it specifies where the package is
7062
published and configures customizations like package metadata, output locations,
7163
and generation settings.
7264

73-
## Configuring Multiple APIs
65+
<Info>
66+
See the [`generators.yml` reference page](/learn/sdks/reference/generators-yml-reference) for more information.
67+
</Info>
68+
69+
## Configure Multiple APIs
7470

75-
The Fern folder can house multiple API definitions. Instead of placing your API
71+
The fern folder can house multiple API definitions. Instead of placing your API
7672
definitions at the top level, you can nest them within an `apis` folder. Be sure
7773
to include a `generators.yml` file within each API folder that specifies the
7874
location of the API definition.

fern/products/sdks/overview/dotnet/quickstart.mdx

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,11 @@ title: .NET Quickstart
33
description: Get started quickly with the Fern .NET SDK.
44
---
55

6-
<Markdown src="/products/sdks/snippets/demo-warning.mdx"/>
7-
86
Generate a C#/.NET SDK by following the instructions on this page.
97

10-
<Steps>
11-
<Markdown src="/products/sdks/snippets/install-cli.mdx"/>
12-
13-
### Initialize the Fern Folder
14-
15-
<Markdown src="/products/sdks/snippets/initialize-fern-folder-intro.mdx"/>
16-
17-
<AccordionGroup>
18-
<Markdown src="/products/sdks/snippets/option-1-openapi.mdx"/>
19-
20-
<Accordion title="Option 2: Fern Definition">
21-
22-
<Markdown src="/products/sdks/snippets/option-2-fern-def.mdx"/>
8+
<Markdown src="/products/sdks/snippets/quickstart-prereqs.mdx"/>
239

24-
2. Add the config option `outputSourceFiles: true` to
25-
`generators.yml`. This ensures your SDK contains source files in
26-
your preferred SDK language instead of compiled output.
27-
28-
```yaml {11-12}
29-
# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json
30-
default-group: local
31-
groups:
32-
local:
33-
generators:
34-
- name: fernapi/fern-typescript-sdk
35-
output:
36-
location: local-file-system
37-
path: ../sdks/typescript
38-
version: <Markdown src="/snippets/version-number.mdx"/>
39-
config:
40-
outputSourceFiles: true
41-
```
42-
43-
<Note>`fern init` creates a default configuration that includes the
44-
TypeScript SDK generator. The `local` group containing this
45-
generator only generates if you run fern generate without specifying a
46-
group, or if you explicitly target it with `fern generate --group
47-
local`. In subsequent steps, you'll add an additional generator for your
48-
preferred SDK language.</Note>
49-
</Accordion>
50-
51-
{/* <Markdown src="/products/sdks/snippets/option-3-asyncapi.mdx"/> */}
52-
53-
</AccordionGroup>
10+
<Steps>
5411

5512
<Markdown src="/products/sdks/snippets/pass-fern-check.mdx"/>
5613

fern/products/sdks/overview/go/quickstart.mdx

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,11 @@ title: Go Quickstart
33
description: Get started quickly with the Fern Go SDK.
44
---
55

6-
<Markdown src="/products/sdks/snippets/demo-warning.mdx"/>
7-
86
Generate a Go SDK by following the instructions on this page.
97

10-
<Steps>
11-
<Markdown src="/products/sdks/snippets/install-cli.mdx"/>
12-
13-
### Initialize the Fern Folder
14-
15-
<Markdown src="/products/sdks/snippets/initialize-fern-folder-intro.mdx"/>
16-
17-
<AccordionGroup>
18-
<Markdown src="/products/sdks/snippets/option-1-openapi.mdx"/>
19-
20-
<Accordion title="Option 2: Fern Definition">
21-
22-
<Markdown src="/products/sdks/snippets/option-2-fern-def.mdx"/>
8+
<Markdown src="/products/sdks/snippets/quickstart-prereqs.mdx"/>
239

24-
2. Add the config option `outputSourceFiles: true` to
25-
`generators.yml`. This ensures your SDK contains source files in
26-
your preferred SDK language instead of compiled output.
27-
28-
```yaml {11-12}
29-
# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json
30-
default-group: local
31-
groups:
32-
local:
33-
generators:
34-
- name: fernapi/fern-typescript-sdk
35-
output:
36-
location: local-file-system
37-
path: ../sdks/typescript
38-
version: <Markdown src="/snippets/version-number.mdx"/>
39-
config:
40-
outputSourceFiles: true
41-
```
42-
43-
<Note>`fern init` creates a default configuration that includes the
44-
TypeScript SDK generator. The `local` group containing this
45-
generator only generates if you run fern generate without specifying a
46-
group, or if you explicitly target it with `fern generate --group
47-
local`. In subsequent steps, you'll add an additional generator for your
48-
preferred SDK language.</Note>
49-
</Accordion>
50-
51-
{/* <Markdown src="/products/sdks/snippets/option-3-asyncapi.mdx"/> */}
52-
53-
</AccordionGroup>
10+
<Steps>
5411

5512
<Markdown src="/products/sdks/snippets/pass-fern-check.mdx"/>
5613

fern/products/sdks/overview/java/quickstart.mdx

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,11 @@ title: Java Quickstart
33
description: Get started quickly with the Fern Java SDK.
44
---
55

6-
<Markdown src="/products/sdks/snippets/demo-warning.mdx"/>
7-
86
Generate a Java SDK by following the instructions on this page.
97

10-
<Steps>
11-
<Markdown src="/products/sdks/snippets/install-cli.mdx"/>
12-
13-
### Initialize the Fern Folder
14-
15-
<Markdown src="/products/sdks/snippets/initialize-fern-folder-intro.mdx"/>
16-
17-
<AccordionGroup>
18-
<Markdown src="/products/sdks/snippets/option-1-openapi.mdx"/>
19-
20-
<Accordion title="Option 2: Fern Definition">
21-
22-
<Markdown src="/products/sdks/snippets/option-2-fern-def.mdx"/>
8+
<Markdown src="/products/sdks/snippets/quickstart-prereqs.mdx"/>
239

24-
2. Add the config option `outputSourceFiles: true` to
25-
`generators.yml`. This ensures your SDK contains source files in
26-
your preferred SDK language instead of compiled output.
27-
28-
```yaml {11-12}
29-
# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json
30-
default-group: local
31-
groups:
32-
local:
33-
generators:
34-
- name: fernapi/fern-typescript-sdk
35-
output:
36-
location: local-file-system
37-
path: ../sdks/typescript
38-
version: <Markdown src="/snippets/version-number.mdx"/>
39-
config:
40-
outputSourceFiles: true
41-
```
42-
43-
<Note>`fern init` creates a default configuration that includes the
44-
TypeScript SDK generator. The `local` group containing this
45-
generator only generates if you run fern generate without specifying a
46-
group, or if you explicitly target it with `fern generate --group
47-
local`. In subsequent steps, you'll add an additional generator for your
48-
preferred SDK language.</Note>
49-
</Accordion>
50-
51-
{/* <Markdown src="/products/sdks/snippets/option-3-asyncapi.mdx"/> */}
52-
53-
</AccordionGroup>
10+
<Steps>
5411

5512
<Markdown src="/products/sdks/snippets/pass-fern-check.mdx"/>
5613

fern/products/sdks/overview/php/quickstart.mdx

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,11 @@ title: PHP Quickstart
33
description: Get started quickly with the Fern PHP SDK.
44
---
55

6-
<Markdown src="/products/sdks/snippets/demo-warning.mdx"/>
7-
86
Generate a PHP SDK by following the instructions on this page.
97

10-
<Steps>
11-
<Markdown src="/products/sdks/snippets/install-cli.mdx"/>
12-
13-
### Initialize the Fern Folder
14-
15-
<Markdown src="/products/sdks/snippets/initialize-fern-folder-intro.mdx"/>
16-
17-
<AccordionGroup>
18-
<Markdown src="/products/sdks/snippets/option-1-openapi.mdx"/>
19-
20-
<Accordion title="Option 2: Fern Definition">
21-
22-
<Markdown src="/products/sdks/snippets/option-2-fern-def.mdx"/>
8+
<Markdown src="/products/sdks/snippets/quickstart-prereqs.mdx"/>
239

24-
2. Add the config option `outputSourceFiles: true` to
25-
`generators.yml`. This ensures your SDK contains source files in
26-
your preferred SDK language instead of compiled output.
27-
28-
```yaml {11-12}
29-
# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json
30-
default-group: local
31-
groups:
32-
local:
33-
generators:
34-
- name: fernapi/fern-typescript-sdk
35-
output:
36-
location: local-file-system
37-
path: ../sdks/typescript
38-
version: <Markdown src="/snippets/version-number.mdx"/>
39-
config:
40-
outputSourceFiles: true
41-
```
42-
43-
<Note>`fern init` creates a default configuration that includes the
44-
TypeScript SDK generator. The `local` group containing this
45-
generator only generates if you run fern generate without specifying a
46-
group, or if you explicitly target it with `fern generate --group
47-
local`. In subsequent steps, you'll add an additional generator for your
48-
preferred SDK language.</Note>
49-
</Accordion>
50-
51-
{/* <Markdown src="/products/sdks/snippets/option-3-asyncapi.mdx"/> */}
52-
53-
</AccordionGroup>
10+
<Steps>
5411

5512
<Markdown src="/products/sdks/snippets/pass-fern-check.mdx"/>
5613

fern/products/sdks/overview/python/quickstart.mdx

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,11 @@ title: Python Quickstart
33
description: Get started quickly with the Fern Python SDK.
44
---
55

6-
<Markdown src="/products/sdks/snippets/demo-warning.mdx"/>
7-
86
Generate a Python SDK by following the instructions on this page.
97

10-
<Steps>
11-
<Markdown src="/products/sdks/snippets/install-cli.mdx"/>
12-
13-
### Initialize the Fern Folder
14-
15-
<Markdown src="/products/sdks/snippets/initialize-fern-folder-intro.mdx"/>
16-
17-
<AccordionGroup>
18-
<Markdown src="/products/sdks/snippets/option-1-openapi.mdx"/>
19-
20-
<Accordion title="Option 2: Fern Definition">
21-
22-
<Markdown src="/products/sdks/snippets/option-2-fern-def.mdx"/>
23-
24-
2. Add the config option `outputSourceFiles: true` to
25-
`generators.yml`. This ensures your SDK contains source files in
26-
your preferred SDK language instead of compiled output.
27-
28-
```yaml {11-12}
29-
# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json
30-
default-group: local
31-
groups:
32-
local:
33-
generators:
34-
- name: fernapi/fern-typescript-sdk
35-
output:
36-
location: local-file-system
37-
path: ../sdks/typescript
38-
version: <Markdown src="/snippets/version-number.mdx"/>
39-
config:
40-
outputSourceFiles: true
41-
```
42-
43-
<Note>`fern init` creates a default configuration that includes the
44-
TypeScript SDK generator. The `local` group containing this
45-
generator only generates if you run fern generate without specifying a
46-
group, or if you explicitly target it with `fern generate --group
47-
local`. In subsequent steps, you'll add an additional generator for your
48-
preferred SDK language.</Note>
49-
</Accordion>
50-
51-
{/* <Markdown src="/products/sdks/snippets/option-3-asyncapi.mdx"/> */}
52-
53-
</AccordionGroup>
8+
<Markdown src="/products/sdks/snippets/quickstart-prereqs.mdx"/>
549

10+
<Steps>
5511
<Markdown src="/products/sdks/snippets/pass-fern-check.mdx"/>
5612

5713
### Add the SDK generator

0 commit comments

Comments
 (0)