🌿 ✨ [Scheduled] Upgrade Fern TypeScript SDK Generator #36
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.
Upgrading from
3.4.0to3.31.1- Changelog3.31.1fix:Fix generator to not generate CONTRIBUTING.md file if config.whitelabel is true.3.31.0feat:AddgenerateSubpackageExportsconfiguration option to enable direct imports of subpackage clients.This allows JavaScript bundlers to tree-shake and include only the imported subpackage code, resulting in much smaller bundle sizes.
Example:
To enable this feature, add the following configuration to your generators.yml file:
3.30.0feat:AddoffsetSemanticsflag, which changes how thestepattribute inx-fern-paginationis interpreted.When
offsetSemanticsisitem-index(the default), offset is understood as an item index that increases by the number of entities fetched.When
offsetSemanticsispage-index, offset is understood as a page index that increases by 1 each time.3.29.2fix:Improve SDK generation performance.3.29.1fix:When generatinghasNextPage, useMath.Floorto ensure an integer comparison against the number of entities.50 additional updates, see more
3.29.0feat:AddparameterNamingconfiguration option to control how parameter names are generated in the SDK.The available options are:
originalName: Use the original name from the OpenAPI spec.wireValue: Use the wire value from the OpenAPI spec, falling back to the original name if not present.camelCase: Convert the name to camelCase.snakeCase: Convert the name to snake_case.default: Use the default naming strategy.3.28.12fix:Include more files and folders in .npmignore:fix:Only generate .npmignore whenuseLegacyExports: true.When
useLegacyExports: false, we generate a package.json with"files"field which makes .npmignore redundant.3.28.11fix:Do not generate a snippet-templates.json file in the generated TypeScript SDK.3.28.10fix:SetAcceptheader for JSON (application/json), text (text/plain), and other (*/*) response types.This ensures that the
Acceptheader is set consistently across runtimes.Unlike all other runtimes, Cloudflare Workers and Vercel Edge Runtime do not set a default
Acceptheader in theirfetchimplementations.3.28.9fix:FixError._visitto pass the correct type (core.Fetcher.Error) to the_othercallback.3.28.8fix:Clean up imports for requestWithRetries.test.ts.3.28.7fix:Fix circular type alias errors (TS2456) in undiscriminated unions containing self-recursive Record types where the value is a union of itself with null and/or undefined.3.28.6fix:Fix circular type alias errors (TS2456) in undiscriminated unions containing self-recursive Record types.3.28.5fix:Fix issue where logs were logged even when the respective log level was disabled.chore:Add tests for logging and the fetcher's redaction functionality.chore:Improve unit test performance and refactor code to reduce duplication.3.28.4fix:Fix a compilation error when a websocket channel has no send or receive messages.3.28.3fix:Fix local GitHub generation to match remote generation.3.28.2fix:Fix inconsistent path parameter casing in the WebSocket connect options.The casing now follows the same rules as other HTTP path parameters:
retainOriginalCasing: true: use the original casing from the OpenAPI spec, regardless of thenoSerdeLayersetting.noSerdeLayer: true: use the original casing from the OpenAPI spec.noSerdeLayer: false: use camelCase for path parameters.3.28.1fix:Always use vitest.config.mts for consistency across all generated SDKs. This ensures Vitest v3 can load the config as ESM in both CommonJS and ESM packages.3.28.0feat:Added Generation Metadata file to output.3.27.0feat:Add support for variables in wire tests.3.26.0feat:Include"dependencies": {}in package.json when generating a TypeScript SDK without dependencies.3.25.0feat:Add support for logging to the generated SDK.Users can configure the logger by passing in a
loggingobject to the client options.The
loggingobject can have the following properties:level: The log level to use. Defaults tologging.LogLevel.Info.logger: The logger to use. Defaults tologging.ConsoleLogger.silent: Whether to silence the logger. Defaults totrue.The
levelproperty can be one of the following values:logging.LogLevel.Debuglogging.LogLevel.Infologging.LogLevel.Warnlogging.LogLevel.ErrorTo provide a custom logger, users can pass in a custom logger implementation that implements the
logging.ILoggerinterface.3.24.0feat:Add support for forward-compatible enums.To enable forward-compatible enums, add the following configuration to your generators.yml file:
3.23.0feat:Add support for bytes download responses.3.22.0feat:Add support for oxfmt as the formatter.This is a beta feature and not officially supported yet.
3.21.0feat:Add support for oxlint as the linter.This is a beta feature and not officially supported yet.
3.20.0feat:Implement base and extend properties in discriminated union examples.3.19.1fix:mergeHeaders()andmergeOnlyDefinedHeaders()are now case-insensitive.3.19.0feat:Add support for application/x-www-form-urlencoded request bodies.3.18.0feat:Users can now pass in a customfetchfunction to the client options.3.17.1fix:hasNextPage()now factors inoffset.stepif provided for offset-based paginationsuch that
hasNextPagenow returnsfalseif the returned page was not as large as requested.3.17.0feat:AddPageto the top-levelexports.tsfiles, which allows forimport { Page } from '...';to work.Remove
Pageable, and use onlycore.Pagefor pagination everywhere.3.16.0feat:Generate a CONTRIBUTING.md file.3.15.0feat:Export types forReconnectingWebSocket,ReconnectingWebSocket.Event,ReconnectingWebSocket.CloseEvent, andReconnectingWebSocket.ErrorEvent.3.14.0feat:Expose the underlying response on thePagetype.3.13.0feat:Improve pnpm and yarn caching in generator Docker images.3.12.3fix:Fix.github/workflows/ci.ymlfile when using OIDC for npm publishing.3.12.2fix:Add streaming tests; fix custom message terminators in streams; fix multi-byte character handling across chunk breaks in streams.3.12.1chore:Update Biome to 2.3.13.12.0feat:Add support for publishing to npmjs.org using OIDC from GitHub Actions.To use OIDC for publishing to npmjs.org, you need to follow two steps:
Follow the instructions in "Step 1: Add a trusted publisher on npmjs.com".
Set the
output.tokenfield toOIDCin generators.yml to enable this feature:This will take care of "Step 2: Configure your CI/CD workflow".
For local generation, you'll need Fern CLI version 0.94.0 or later.
feat:Update GitHub Actionssetup-nodeaction to v4 in the generated CI workflow.3.11.1fix:Generate streaming response section in README.md for streaming response endpoints.3.11.0feat:Addlinterandformatterconfiguration options to configure code linters and formatters for the generated SDK.linter:biome: Use Biome as the code linter. This is the default.none: Do not include a code linter.formatter:biome: Use Biome as the code formatter. This is the default.prettier: Use Prettier as the code formatter.For consistency, the package.json scripts will always include the following scripts:
lint: Run the configured linter.lint:fix: Run the configured linter with auto-fix.format: Run the configured formatter.format:check: Run the configured formatter in check mode.check: Run both the linter and formatter in check mode.check:fix: Run both the linter and formatter with auto-fix.When the
linteris set tonone,lintandlint:fixscripts will echo a message indicating that no linter is configured.3.10.0feat:Generate file upload section in README.md for multipart-form file uploads.3.9.3fix:Fix a compilation error when a path parameter is nullable or optional.3.9.2fix:Match the logic in wire test generation where the static example generation omits the request parameter for empty objects when optional.This fixes some wire tests that were failing due to mismatched request bodies.
fix:Returnundefinedwhen passing inundefinedtotoJsonwhenuseBigIntis enabled.3.9.1fix:Improve the performance of JSON serialization and parsing whenuseBigIntis enabled.3.9.0feat:Add support for theUploadable.FromPathandUploadable.WithMetadatatypes to upload files with metadata to multipart-form endpoints.Users can configure metadata when uploading a file to a multipart-form upload endpoint using the
Uploadable.WithMetadatatype:The
filename,contentType, andcontentLengthproperties are optional.Alternatively, users can use the
Uploadable.FromPathtype to upload directly from a file path:The metadata is used to set the
Content-TypeandContent-Dispositionheaders. If not provided, the client will attempt to determine them automatically.