Enable consolidateTypeFiles for the TypeScript SDK#589
Open
fern-support wants to merge 1 commit into
Open
Conversation
Collapses per-type source files into one types.ts per namespace, cutting the number of empty compiled runtime modules shipped in intercom-client. Addresses intercom/intercom-node#527. Verified against a local preview regen + build (CJS+ESM): - total published .js: 1095 -> 375 (-66%) - byte-identical empty modules: 591 -> 127 (-79%) Co-Authored-By: Claude <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Addresses intercom/intercom-node#527 —
intercom-clientships hundreds of byte-identical empty compiled modules (one per erased type file, doubled across the CJS + ESM builds).Root cause
With
noSerdeLayer: true, every type file is a pureinterface/typethattscerases to an empty.js/.mjs(just the"use strict"; __esModuleboilerplate). The TypeScript SDK generator emits one source file per declared type, so these empty runtime modules pile up.Fix
Set
consolidateTypeFiles: trueon thets-sdkgenerator. This collapses all types in a namespace into a singletypes.ts, cutting the number of files that erase to empty modules.Verification (same-spec, flag OFF vs ON)
Regenerated the
ts-sdkgroup from the current spec both ways and built each (CJS + ESM compile clean):.jsNon-breaking
Verified the public API surface is unchanged by the flag (same spec):
require): 6 → 6, identical.Intercom.*namespaces): 826 → 826, 0 added, 0 removed.It is purely an internal
dist/**file-layout change. The package'sexportsmap only exposes.and./package.json, so no deep-import path intodist/**is affected.