Skip to content

Commit 1947262

Browse files
committed
edit github structure page
1 parent c54c826 commit 1947262

File tree

3 files changed

+105
-73
lines changed

3 files changed

+105
-73
lines changed

fern/products/sdks/github-setup.mdx

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@ title: Set up your GitHub Structure
33
description: Set up GitHub repositories for your SDKs
44
---
55

6-
Before generating SDKs with Fern, you'll need to set up the proper GitHub repository structure to house your API definitions and SDK code.
6+
Before generating SDKs with Fern, you'll need to set up the proper GitHub
7+
repository structure to house your API definitions and SDK code so it's
8+
intuitive for you and your users to access, maintain, and update code.
79

8-
## Create or identify your GitHub repositories
10+
<Steps>
11+
## Structuring your top-level repository
912

10-
1. Identify or create a top-level GitHub repository where you want all of your SDK and API code to live.
11-
1. Create a new GitHub repository called `company-<language>` (or something similar) for each of your SDKs, if you haven't done so already.
12-
1. Install the [Fern GitHub App](https://github.com/apps/fern-api) on the top-level repository and all SDK repositories. Select **Configure**, then scroll down to **Repository Access**. Select **Only select repositories** and in the dropdown select the repository for your SDK. Click **Save**.
13-
14-
## Overall GitHub structure
15-
16-
Structure the top-level GitHub repository containing all of your SDKs and APIs
17-
so it's intuitive for you and your users to access, maintain, and update.
13+
1. Identify or create a top-level GitHub repository where you want all of your
14+
SDK and API code to live.
15+
1. Install the [Fern GitHub App](https://github.com/apps/fern-api) on the
16+
top-level repository and all SDK repositories. Select **Configure**, then
17+
scroll down to **Repository Access**. Select **Only select repositories** and
18+
in the dropdown select the repository for your SDK. Click **Save**.
1819

1920
For example, your basic GitHub file structure should look something like this:
2021

@@ -25,7 +26,7 @@ For example, your basic GitHub file structure should look something like this:
2526
├─ sdks/
2627
└── generators.yml # Contains settings for all SDKs
2728
```
28-
your `generators.yml` file will contain a group for each of your SDKs. Each group points
29+
Your `generators.yml` file will contain a group for each of your SDKs. Each group points
2930
to the GitHub repository for the relevant SDK.
3031

3132
For example, the `group` for a TypeScript SDK might look like this:
@@ -44,15 +45,21 @@ file](https://github.com/cohere-ai/cohere-developer-experience/blob/23d6c541a01e
4445
and Vapi's [`generators.yml`
4546
file](https://github.com/VapiAI/docs/blob/9c674c2b16ba03e864e26673c5290c88048c9a7a/fern/apis/api/generators.yml).
4647

47-
To get started configuring your SDK, see the Quickstart
48-
4948
<Info>You can also additionally configure the `github` section to whether Fern
5049
should commit and release, create a pull request, or push code to a branch when
5150
you make changes to your SDK code. See [GitHub
5251
Configuration](/sdks/reference/generators-yml#github-configuration) for more
5352
details. </Info>
5453

55-
### Structure a repository for a specific SDK
54+
## Structuring SDK-specific repositories
55+
56+
1. Create a new GitHub repository called `company-<language>` (or something
57+
similar) for each of your SDKs, if you haven't done so already.
58+
1. Install the [Fern GitHub App](https://github.com/apps/fern-api) on the
59+
top-level repository and all SDK repositories. Select **Configure**, then
60+
scroll down to **Repository Access**. Select **Only select repositories** and
61+
in the dropdown select the repository for your SDK. Click **Save**.
62+
5663

5764
The repository structure for a specific SDK should look similar to this:
5865

@@ -77,5 +84,26 @@ Fern generates most of the SDK files listed in this example repository (`scripts
7784

7885
For additional examples, see Cohere's [Python SDK repository](https://github.com/cohere-ai/cohere-python) and [Vapi's TypeScript SDK repository](https://github.com/VapiAI/server-sdk-typescript).
7986

80-
87+
## Generate an SDK in your desired language
88+
89+
Once you've set up your GitHub repository structure, you can proceed with generating SDKs in your desired languages.
90+
91+
<CardGroup cols={3}>
92+
<Card title="TypeScript" icon={<img src="./images/icons/ts-light.svg" alt="TypeScript logo" className="h-6 w-6" noZoom />} href="/sdks/generators/typescript/quickstart">
93+
</Card>
94+
<Card title="Python" icon={<img src="./images/icons/python-light.svg" className="h-6 w-6" noZoom />} href="/sdks/generators/python/quickstart">
95+
</Card>
96+
<Card title="Go" icon={<img src="./images/icons/go-light.svg" className="h-6 w-6" noZoom />} href="/sdks/generators/go/quickstart">
97+
</Card>
98+
<Card title="Java" icon={<img src="./images/icons/java-light.svg" className="h-6 w-6" noZoom />} href="/sdks/generators/java/quickstart">
99+
</Card>
100+
<Card title=".NET" icon={<img src="./images/icons/csharp-light.svg" className="h-6 w-6" noZoom />} href="/sdks/generators/csharp/quickstart">
101+
</Card>
102+
<Card title="PHP" icon={<img src="./images/icons/php-light.svg" className="h-6 w-6" noZoom />} href="/sdks/generators/php/quickstart">
103+
</Card>
104+
<Card title="Ruby" icon={<img src="./images/icons/ruby-light.svg" className="h-6 w-6" noZoom />} href="/sdks/generators/php/quickstart">
105+
</Card>
106+
</CardGroup>
107+
108+
</Steps>
81109

49.3 KB
Loading

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

Lines changed: 62 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,13 @@ Use [GitHub Actions](https://docs.github.com/en/actions/get-started/quickstart)
190190
1. Add the corresponding token you generated above.
191191
1. Click **Add secret**.
192192

193+
<Frame>
194+
<img src="assets/npm-token-secret.png" alt="NPM_TOKEN secret" />
195+
</Frame>
196+
193197
</Step>
194198

195-
<Step title="Update Workflow Action Settings">
199+
<Step title="Allow GitHub to run workflows">
196200

197201
Change your workflow permissions to allow GitHub to run workflows:
198202

@@ -211,63 +215,63 @@ Use [GitHub Actions](https://docs.github.com/en/actions/get-started/quickstart)
211215
Rename this file `ci.yml`. Your file should look like this:
212216

213217
```yaml title=".github/workflows/ci.yml" maxLines=0
214-
name: ci
215-
216-
on: [push]
217-
218-
jobs:
219-
compile:
220-
runs-on: ubuntu-latest
221-
222-
steps:
223-
- name: Checkout repo
224-
uses: actions/checkout@v4
225-
226-
- name: Set up node
227-
uses: actions/setup-node@v3
228-
229-
- name: Compile
230-
run: yarn && yarn build
231-
232-
test:
233-
runs-on: ubuntu-latest
234-
235-
steps:
236-
- name: Checkout repo
237-
uses: actions/checkout@v4
238-
239-
- name: Set up node
240-
uses: actions/setup-node@v3
241-
242-
- name: Compile
243-
run: yarn && yarn test
244-
245-
publish:
246-
needs: [ compile, test ]
247-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
248-
runs-on: ubuntu-latest
249-
steps:
250-
- name: Checkout repo
251-
uses: actions/checkout@v4
252-
- name: Set up node
253-
uses: actions/setup-node@v3
254-
- name: Install dependencies
255-
run: yarn install
256-
- name: Build
257-
run: yarn build
258-
259-
- name: Publish to npm
260-
run: |
261-
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
262-
if [[ ${GITHUB_REF} == *alpha* ]]; then
263-
npm publish --access public --tag alpha
264-
elif [[ ${GITHUB_REF} == *beta* ]]; then
265-
npm publish --access public --tag beta
266-
else
267-
npm publish --access public
268-
fi
269-
env:
270-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
218+
name: ci
219+
220+
on: [push]
221+
222+
jobs:
223+
compile:
224+
runs-on: ubuntu-latest
225+
226+
steps:
227+
- name: Checkout repo
228+
uses: actions/checkout@v4
229+
230+
- name: Set up node
231+
uses: actions/setup-node@v3
232+
233+
- name: Compile
234+
run: yarn && yarn build
235+
236+
test:
237+
runs-on: ubuntu-latest
238+
239+
steps:
240+
- name: Checkout repo
241+
uses: actions/checkout@v4
242+
243+
- name: Set up node
244+
uses: actions/setup-node@v3
245+
246+
- name: Compile
247+
run: yarn && yarn test
248+
249+
publish:
250+
needs: [ compile, test ]
251+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
252+
runs-on: ubuntu-latest
253+
steps:
254+
- name: Checkout repo
255+
uses: actions/checkout@v4
256+
- name: Set up node
257+
uses: actions/setup-node@v3
258+
- name: Install dependencies
259+
run: yarn install
260+
- name: Build
261+
run: yarn build
262+
263+
- name: Publish to npm
264+
run: |
265+
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
266+
if [[ ${GITHUB_REF} == *alpha* ]]; then
267+
npm publish --access public --tag alpha
268+
elif [[ ${GITHUB_REF} == *beta* ]]; then
269+
npm publish --access public --tag beta
270+
else
271+
npm publish --access public
272+
fi
273+
env:
274+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
271275
```
272276

273277
For another example, see Vapi's [npm publishing GitHub Action](https://github.com/VapiAI/server-sdk-typescript/blob/main/.github/workflows/ci.yml)

0 commit comments

Comments
 (0)