-
Notifications
You must be signed in to change notification settings - Fork 4
Improve fern.config.json documentation #1548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
35736d6
Improve fern.config.json documentation
devin-ai-integration[bot] 228c9f9
Fix Vale style warnings
devin-ai-integration[bot] e1f6a4c
Make fern.config.json snippet more concise
devin-ai-integration[bot] 362eec8
fix link and adjust wording
devalog 7eff01c
nit
devalog 56230f3
finetune vale
devalog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| ## fern.config.json reference | ||
|
|
||
| Every `fern/` folder contains a single `fern.config.json` file at its root. This configuration file stores your organization name and the Fern CLI version used for your project. | ||
|
|
||
| ### Schema | ||
|
|
||
| The `fern.config.json` file has two required fields: | ||
|
|
||
| - **`organization`** (string): Your organization identifier. This is used by `fern token` to generate organization-specific authentication tokens and to scope CLI actions to your organization. You can view and manage your organization in the [Fern Dashboard](https://dashboard.buildwithfern.com/). | ||
|
|
||
| - **`version`** (string): The Fern CLI version to use. Accepts a pinned semantic version (e.g., `"0.94.1"`) or `"*"` to use your locally installed CLI version. | ||
|
|
||
| ### Examples | ||
|
|
||
| <Tabs> | ||
| <Tab title="Pinned version (recommended for CI)"> | ||
|
|
||
| ```json title="fern.config.json" | ||
| { | ||
| "organization": "plant-catalog", | ||
| "version": "<Markdown src="/snippets/version-number-cli.mdx"/>" | ||
| } | ||
| ``` | ||
|
|
||
| Pinning to a specific version ensures deterministic builds. Every time you run a Fern CLI command, the CLI downloads itself at the specified version. | ||
|
|
||
| </Tab> | ||
| <Tab title="Local development"> | ||
|
|
||
| ```json title="fern.config.json" | ||
| { | ||
| "organization": "plant-catalog", | ||
| "version": "*" | ||
| } | ||
| ``` | ||
|
|
||
| Using `"*"` tells Fern to use your locally installed CLI version. This is useful for local development when you've installed Fern as a project dependency. See [Install Fern CLI locally](/learn/cli-api/cli-reference/overview#install-fern-cli-locally) for details. | ||
|
|
||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| ### When to change these values | ||
|
|
||
| - **`organization`**: Only update this if your organization identifier changes in the Fern Dashboard. | ||
|
|
||
| - **`version`**: Use the `fern upgrade` command to update the CLI version. The command automatically updates this field in `fern.config.json` and upgrades generators in `generators.yml` to their minimum-compatible versions. | ||
|
|
||
| ### How the CLI uses this file | ||
|
|
||
| The following CLI commands read from `fern.config.json`: | ||
|
|
||
| - **`fern check`**: Validates the configuration file | ||
| - **`fern upgrade`**: Updates the `version` field to the current CLI version | ||
|
||
| - **`fern token`**: Uses the `organization` field to generate organization-specific tokens | ||
| - **`fern init`**: Creates this file when initializing a project | ||
|
|
||
| The version pinning ensures determinism across different environments. When you run any Fern CLI command, it automatically downloads and uses the specified CLI version, ensuring consistent behavior in local development, CI/CD pipelines, and across team members. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 [vale] reported by reviewdog 🐶
[FernStyles.Headings] 'fern.config.json reference' should use sentence-style capitalization.