-
Notifications
You must be signed in to change notification settings - Fork 3
Add TypeScript configuration options #8
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
Conversation
|
🌿 Preview your docs: https://fernv2-preview-083eee84-3167-4012-91e1-fd5141a9000c.docs.buildwithfern.com |
|
🌿 Preview your docs: https://fernv2-preview-cfc0655c-7a2a-4731-9958-a3e80745ab86.docs.buildwithfern.com |
|
🌿 Preview your docs: https://fernv2-preview-41192b95-0e75-4986-8cde-da92e34ff21b.docs.buildwithfern.com |
| <ParamField path="shouldGenerateWebsocketClients" type="boolean"> | ||
| </ParamField> | ||
|
|
||
| <ParamField path="defaultTimeoutInSeconds" type="number | 'infinity'"> |
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.
Am I understanding the TS SDK generator correct here?
If infinity, it'll use the timeout provided by the request options; otherwise, it'll fall back to 60000ms.
infinity seems kind of misleading here.
@dsinghvi
The default timeout for HTTP requests in seconds. Users can change the timeout during SDK initialization and for individual HTTP requests.
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.
That's right, i think its okay to ignore documenting RequestOptions since we already make it clear in the TS readme that it is to override the default timeout.
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.
My understanding based on your comments is that I don't need to make any changes to this. Let me know if that's wrong though!
| jest: "29.0.7" | ||
| ``` | ||
|
|
||
| <Note>Only applies when publishing to Github.</Note> |
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.
Is the note accurate for this option?
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.
It isn't, @devalog lets go ahead and delete
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.
I copied over this note from the readme's entry for extraDevDependencies: https://github.com/fern-api/fern/tree/main/generators/typescript. @Swimburger @dsinghvi let me know if that's not right though!
| ``` | ||
| </ParamField> | ||
|
|
||
| <ParamField path="tolerateRepublish" type="boolean"> |
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.
The tolerateRepublish flag allows npm to overwrite an already-published package version, bypassing npm's default protection against republishing the same version number.
I don't know anyone using this flag, we may want to not document it, or put it at the bottom. Not sure how we're currently sorting the flags on this page.
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.
I added this description. The page is sorted by the order of the options in the config file (with deprecated/not relevant options removed entirely). If you don't think the flag is relevant, maybe removing is the best option? Can always add back in later if needed.
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.
@dsinghvi I do think this is so uncommonly used, we could omit it to make the flag list smaller.
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.
I just removed this flag for now!
Added all options from here using
ParamFieldformatting. Filled in definitions and examples for some options per readme. Many options don't have definitions and examples, and need to be filled in at a later date.Other modifications I made:
-Converted the Zod types to TypeScript types (
z.boolean()toboolean)-Added
deprecated={true}attribute for the deprecated optionsOrganized options into sections per config schema
-Handled union formatting (
z.union([z.literal("infinity"), z.number()])tonumber | 'infinity')-Converted enum types to literal unions (
z.enum(["wrapper", "web"])→'wrapper' | 'web')-Lightly edited/reorganized some of the definitions and examples
-Added highlighting to some examples