Skip to content

Commit ba2db6d

Browse files
authored
Adjust/Add to Set Up Local Previews guide (#71)
1 parent 35c3dd0 commit ba2db6d

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

fern/products/sdks/guides/setup-local-sdk-previews.mdx

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
11
---
2-
title: Setup local SDK previews
3-
subtitle: Use Fern's CLI tool to preview your SDK locally.
2+
title: Set up local SDK previews
3+
description: Use Fern's CLI tool to preview your SDK locally.
44
---
55

6-
[Once you configure your SDK](/learn/sdks/getting-started/generate-your-first-sdk), you can preview the generated SDK code using Fern's CLI.
6+
Once you configure your SDK, you can use the `--preview` flag to test generated
7+
SDK code locally before publishing. This allows quick iteration on your Fern definition
8+
as you develop:
79

8-
Simply append the `--preview` flag to the command used to generate the SDK and you will see the generated code populated in a `.preview` folder within your `fern` folder.
10+
```bash
11+
# Preview all SDKs
12+
fern generate --preview
913

10-
<Tip title="Custom Code">
11-
[If you have added custom code to your SDK](/learn/sdks/capabilities/augment-with-custom-code), `--preview` will
12-
preserve those changes.
14+
# Preview SDK for a specific language
15+
fern generate --group <language>-sdk --preview
16+
17+
```
18+
19+
`--preview` generates your SDK code into a local `.preview/` folder within your
20+
`fern` folder. No changes are published to package managers or GitHub.
21+
22+
<Tip>
23+
`--preview` preserves any custom code you added to your SDK.
1324
</Tip>
1425

15-
Here's an example of how you can preview your SDK:
26+
## Example usage
27+
28+
Here's an example of how you can preview a Python SDK.
1629

1730
<Steps>
1831
### Generator configuration
19-
```yaml generators.yml
32+
```yaml title="generators.yml" {4}
2033
api:
2134
path: ./path/to/openapi.yml
2235
groups:
2336
python-sdk:
2437
generators:
2538
- name: fernapi/fern-python-sdk
26-
version: 3.0.0
39+
version: <Markdown src="/snippets/version-number.mdx"/>
2740
output:
2841
location: pypi
2942
package-name: imdb

0 commit comments

Comments
 (0)