You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/products/sdks/overview/typescript/publishing-to-npm.mdx
+13-6Lines changed: 13 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,13 @@ title: Publishing to NPM
3
3
description: How to publish the Fern Typescript SDK to npm.
4
4
---
5
5
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,
<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>
9
15
@@ -21,17 +27,18 @@ Publish your public-facing Fern Typescript SDK to the [npm registry](https://www
21
27
22
28
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.
23
29
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`:
25
31
26
32
27
33
```bash
28
34
fern add fern-typescript-node-sdk --group ts-sdk
29
35
```
30
36
31
37
Once the command completes, you'll see a new group created in your `generators.yml`:
32
-
38
+
33
39
```yaml {2-7}
34
-
groups:
40
+
groups:
41
+
local:
35
42
...
36
43
ts-sdk:
37
44
generators:
@@ -93,7 +100,7 @@ groups:
93
100
location: npm
94
101
package-name: your-package-name
95
102
config:
96
-
namespaceExport: your-client-name
103
+
namespaceExport: YourClientName # must be a valid JavaScript/TypeScript identifier
97
104
```
98
105
99
106
</Step>
@@ -216,7 +223,7 @@ ts-sdk:
216
223
Regenerate your SDK and publish it on npm:
217
224
218
225
```bash
219
-
fern generate --version <version>
226
+
fern generate --group ts-sdk --version <version>
220
227
```
221
228
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!
0 commit comments