Skip to content

Commit 93de3ba

Browse files
committed
Make additional updates
1 parent c741494 commit 93de3ba

File tree

1 file changed

+33
-42
lines changed

1 file changed

+33
-42
lines changed

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

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Publish your public-facing Fern Typescript SDK to the [npm registry](https://www
4949

5050
<Step title="Configure `output` location">
5151

52-
Next, change the output location in `generators.yml` from `local-file-system` (the default) to `npm`:
52+
Next, change the output location in `generators.yml` from `local-file-system` (the default) to `npm` to indicate that Fern should publish your package directly to the npm registry:
5353

5454
```yaml title="TypeScript" {6-7}
5555
groups:
@@ -65,7 +65,7 @@ Publish your public-facing Fern Typescript SDK to the [npm registry](https://www
6565

6666
<Step title="Add a unique package name">
6767

68-
Your package name must be unique in the npm repository, otherwise releasing your SDK to npm will fail. Update your package name if you haven't done so already:
68+
Your package name must be unique in the npm repository, otherwise publishing your SDK to npm will fail. Update your package name if you haven't done so already:
6969

7070

7171
```yaml title="TypeScript" {8}
@@ -102,19 +102,21 @@ ts-sdk:
102102
</Step>
103103
</Steps>
104104

105-
## Create an npm token
105+
## Set up npm publishing authentication
106106

107107
<Steps>
108108

109-
<Step title="Log In">
109+
<Step title="Log into npm">
110110

111111
Log into [npm](https://www.npmjs.com/) or create a new account.
112112

113113
</Step>
114114

115115
<Step title="Navigate to Access Tokens">
116116

117-
Click on your profile picture, select **Edit Profile**, and then select **Access Tokens**.
117+
1. Click on your profile picture.
118+
1. Select **Edit Profile**.
119+
1. Select **Access Tokens**.
118120

119121
</Step>
120122

@@ -129,7 +131,30 @@ ts-sdk:
129131
<img src="assets/npm-automation-token.png" alt="Creating NPM Automation Token" />
130132
</Frame>
131133

132-
<Warning>When you click **Generate Token**, you’ll be returned to the **Access Tokens** dashboard. A box on the top of the dashboard will confirm that you successfully created a new token and prompt you to copy your token id. Make sure you save this id, as you'll need to add it to your GitHub repository in the later on.</Warning>
134+
<Warning>When you click **Generate Token**, you’ll be returned to the **Access Tokens** dashboard. A box on the top of the dashboard will confirm that you successfully created a new token and prompt you to copy your token id. Make sure you save this id, as you'll need to add it to your GitHub repository and `generators.yml` later on.</Warning>
135+
136+
</Step>
137+
138+
<Step title="Add npm Token to your GitHub Repository">
139+
140+
<Info>
141+
Using GitLab? Follow [these steps](/learn/docs/developer-tools/gitlab#add-a-token-to-gitlab) instead.
142+
</Info>
143+
144+
1. Open your repository in GitHub.
145+
1. Click on the **Settings** tab in your repository.
146+
1. Under the **Security** section and **Secrets and variables** subsection, select **Actions**.
147+
148+
<Info>You can also use the url `https://github.com/<your-repo>/settings/secrets/actions`.</Info>
149+
150+
1. Select **New repository secret**.
151+
<Frame>
152+
<img src="assets/github-secret.png" alt="Adding GitHub Repository Secret" />
153+
</Frame>
154+
155+
1. Name your secret `NPM_TOKEN`.
156+
1. Add the corresponding token you generated in the [previous step](#generate-token).
157+
1. Click **Add secret**.
133158

134159
</Step>
135160

@@ -154,40 +179,6 @@ ts-sdk:
154179

155180
</Steps>
156181

157-
## Add npm Token to your GitHub Repository
158-
159-
<Info>
160-
Using GitLab? Follow [these steps](/learn/docs/developer-tools/gitlab#add-a-token-to-gitlab).
161-
</Info>
162-
163-
<Steps>
164-
165-
<Step title="Open Repository">
166-
167-
Open your repository in GitHub.
168-
169-
</Step>
170-
171-
<Step title="Add a Secret for your npm Token">
172-
173-
Click on the **Settings** tab in your repository. Then, under the **Security** section, open **Secrets and variables** > **Actions**.
174-
175-
<Frame>
176-
<img src="assets/github-secret.png" alt="Adding GitHub Repository Secret" />
177-
</Frame>
178-
179-
You can also use the url `https://github.com/<your-repo>/settings/secrets/actions`.
180-
181-
182-
1. Select **New repository secret**.
183-
1. Name your secret `NPM_TOKEN`.
184-
1. Add the corresponding token you generated above.
185-
1. Click **Add secret**.
186-
187-
</Step>
188-
189-
</Steps>
190-
191182
## Release your SDK to NPM
192183

193184
At this point, you're ready to generate a release for your SDK.
@@ -196,7 +187,7 @@ Using GitLab? Follow [these steps](/learn/docs/developer-tools/gitlab#add-a-toke
196187

197188
<Step title="Set npm environment variable">
198189

199-
Set the NPM_TOKEN environment variable on your local machine:
190+
Set the `NPM_TOKEN` environment variable on your local machine:
200191

201192
```bash
202193
export NPM_TOKEN=your-actual-npm-token
@@ -206,7 +197,7 @@ Using GitLab? Follow [these steps](/learn/docs/developer-tools/gitlab#add-a-toke
206197

207198
<Step title="Generate your release">
208199

209-
Run the following command to regenerate your SDK and publish it on npm:
200+
Regenerate your SDK and publish it on npm:
210201

211202
```bash
212203
fern generate --version <version>

0 commit comments

Comments
 (0)