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
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,9 @@ 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,
8
+
you'll have a versioned package published on npm.
7
9
8
10
<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
11
@@ -21,17 +23,18 @@ Publish your public-facing Fern Typescript SDK to the [npm registry](https://www
21
23
22
24
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
25
24
-
In order to generate the SDK, add the generator to your `generators.yml` using the `fern <add>` command:
26
+
Add a new generator to your `generators.yml` using the `fern <add>` command:
25
27
26
28
27
29
```bash
28
30
fern add fern-typescript-node-sdk --group ts-sdk
29
31
```
30
32
31
33
Once the command completes, you'll see a new group created in your `generators.yml`:
32
-
34
+
33
35
```yaml {2-7}
34
-
groups:
36
+
groups:
37
+
local:
35
38
...
36
39
ts-sdk:
37
40
generators:
@@ -93,7 +96,7 @@ groups:
93
96
location: npm
94
97
package-name: your-package-name
95
98
config:
96
-
namespaceExport: your-client-name
99
+
namespaceExport: YourClientName # must be a valid JavaScript/TypeScript identifier
97
100
```
98
101
99
102
</Step>
@@ -216,7 +219,7 @@ ts-sdk:
216
219
Regenerate your SDK and publish it on npm:
217
220
218
221
```bash
219
-
fern generate --version <version>
222
+
fern generate --group ts-sdk --version <version>
220
223
```
221
224
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