fern-api / fern

Input OpenAPI. Output SDKs and Docs.
https://buildwithfern.com
Apache License 2.0
2.6k stars 139 forks source link

(fix, ts): Add environment property to snippets #3850

Closed amckinney closed 3 months ago

amckinney commented 3 months ago

This fixes a few bugs that impacted TypeScript's generated snippets (and therefore the generated README.md):

  1. If the environment variable is required, it's included in the generated snippet. If an environment is defined, the first one is used, otherwise the YOUR_BASE_URL string is included.
  2. The README.md import paths now exclusively use double quotes (i.e. "").
  3. When an NPM package name is not available, the namespace export is used.