|
1 | 1 | # Raven API
|
2 | 2 |
|
3 |
| -Tagging a release on this repository will generate and release new SDKs. Currently included SDKs: |
| 3 | +Tagging a release on this repository will update the: |
4 | 4 |
|
5 |
| -- JavaScript/TypeScript SDK: https://github.com/ravenappdev/raven-node |
6 |
| - |
7 |
| -## [tl;dr] How does it work? |
8 |
| - |
9 |
| -1. When you tag a release, Fern generates SDKs based on the Fern API Definition in this repo. |
10 |
| -1. Each generated SDK is pushed to its own GitHub repo. |
11 |
| -1. Each SDK's repo has GitHub actions that compile the code and publish the package to its respective registry. |
| 5 | +- [TypeScript SDK Github Repo](https://github.com/ravenappdev/raven-node) |
| 6 | +- [Java SDK Github Repo](https://github.com/ravenappdev/raven-java) |
| 7 | +- _More SDKs to come..._ |
12 | 8 |
|
13 | 9 | ## What is in this repository?
|
14 | 10 |
|
15 | 11 | This repository contains
|
16 | 12 |
|
17 |
| -- Raven's [Fern API Definition](./fern/api/definition/) |
18 |
| -- Enabled generators ([generators.yml](./fern/api/generators.yml)) |
| 13 | +- Raven's Fern API Definition which lives in the [definition](./fern/api/definition/) folder |
| 14 | +- Generators (see [generators.yml](./fern/api/generators.yml)) |
19 | 15 |
|
20 | 16 | ## What is in the API Definition?
|
21 | 17 |
|
22 |
| -The API Definition contains information about what endpoints, types, and errors are used in the API. The definition is broken into smaller files such as [device.yml](fern/api/definition/device.yml) and [event.yml](fern/api/definition/event.yml). |
| 18 | +The API Definition contains information about what endpoints, types, and errors are used in the API. The definition is broken into smaller files such as [device.yml](fern/api/definition/device.yml). |
23 | 19 |
|
24 | 20 | In order to make sure that the definition is valid, you can use the Fern CLI.
|
25 | 21 |
|
26 | 22 | ```bash
|
27 |
| -npm install -g fern-api |
28 |
| -fern check |
| 23 | +npm install -g fern-api # Installs CLI |
| 24 | +fern check # Checks if the definition is valid |
29 | 25 | ```
|
30 | 26 |
|
31 | 27 | ## What are Generators?
|
32 | 28 |
|
33 |
| -A generator reads in your API Definition and outputs files. The generated files are then pushed to a GitHub repo. |
34 |
| - |
35 |
| -The list of enabled generators is in [generators.yml](./fern/api/generators.yml). |
36 |
| - |
37 |
| -For example, the TypeScript generator creates the TypeScript SDK. Fern pushes the generated files to [raven-node](https://github.com/ravenappdev/raven-node) and tags a release on that repo. This triggers a GitHub action on the [raven-node](https://github.com/ravenappdev/raven-node) repo, which compiles and publishes the package to npm. |
| 29 | +Generators read in your API Definition and output files or code (i.e. the TypeScript SDK Generator) and are tracked in [generators.yml](./fern/api/generators.yml). |
38 | 30 |
|
39 |
| -The generators are invoked by running `fern release`. When you tag a release on this repo, there's a [GitHub action](.github/workflows/ci.yml#L31) that runs `fern release`. |
40 |
| - |
41 |
| -## How do I make changes to the API? |
42 |
| - |
43 |
| -1. Clone this repo |
44 |
| -1. Install fern: `npm install -g fern-api` |
45 |
| -1. Edit the [API Definition](fern/api/definition) |
46 |
| -1. You can run `fern check` to check for issues |
47 |
| -1. Make a PR to this repo |
48 |
| -1. If checks pass, merge the PR in |
49 |
| -1. When you're ready to release new versions of your SDKs, just tag a release on this repo |
| 31 | +To trigger the generators run: |
50 | 32 |
|
| 33 | +```bash |
| 34 | +fern release <version> |
| 35 | +``` |
51 | 36 |
|
| 37 | +This command currently runs in a GitHub workflow (see [ci.yml](.github/workflows/ci.yml#L32)) |
0 commit comments