Skip to content

Commit 976a09d

Browse files
committed
misc updates to npm guide, add image
1 parent cee068e commit 976a09d

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed
293 KB
Loading

fern/products/sdks/overview/typescript/publishing-to-npm.mdx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ title: Publishing to NPM
33
description: How to publish the Fern Typescript SDK to npm.
44
---
55

6-
Publish your public-facing Fern Typescript SDK to the [npm registry](https://www.npmjs.com/). Once you've followed the steps on this page to connect your npm account to your SDK, Fern will automatically publish the latest version of your SDK.
6+
Publish your public-facing Fern Typescript SDK to the [npm
7+
registry](https://www.npmjs.com/). After following the steps on this page,
8+
you'll have a versioned package published on npm.
9+
10+
<Frame>
11+
<img src="assets/npm-packages.png" alt="Creating NPM Automation Token" />
12+
</Frame>
713

814
<Info>This guide assumes that you already have an initialized `fern` folder on your local machine. If you don’t, run `fern init`. See [TypeScript Quickstart](quickstart.mdx) for more details.</Info>
915

@@ -21,17 +27,18 @@ Publish your public-facing Fern Typescript SDK to the [npm registry](https://www
2127

2228
Navigate to your `generators.yml` on your local machine. Your `generators.yml` lives inside of your `fern` folder and contains all the configuration for your Fern generators.
2329

24-
In order to generate the SDK, add the generator to your `generators.yml` using the `fern <add>` command:
30+
Add a new generator to `generators.yml`:
2531

2632

2733
```bash
2834
fern add fern-typescript-node-sdk --group ts-sdk
2935
```
3036

3137
Once the command completes, you'll see a new group created in your `generators.yml`:
32-
38+
3339
```yaml {2-7}
34-
groups:
40+
groups:
41+
local:
3542
...
3643
ts-sdk:
3744
generators:
@@ -93,7 +100,7 @@ groups:
93100
location: npm
94101
package-name: your-package-name
95102
config:
96-
namespaceExport: your-client-name
103+
namespaceExport: YourClientName # must be a valid JavaScript/TypeScript identifier
97104
```
98105
99106
</Step>
@@ -216,7 +223,7 @@ ts-sdk:
216223
Regenerate your SDK and publish it on npm:
217224

218225
```bash
219-
fern generate --version <version>
226+
fern generate --group ts-sdk --version <version>
220227
```
221228
Local machine output will verify that the release is pushed to your repository and tagged with the version you specified. You'll receive an email from npm notifying you that a new version of your package has been successfully published!
222229

0 commit comments

Comments
 (0)