fix: pin typescript to 5.x so the SDK codegen runs again - #36
Merged
Conversation
`pnpm run generate` has failed on every Generate SDK dispatch since
2026-08-29 (10 consecutive runs), freezing the published SDK at API
spec 1.109.0 while production reached 1.114.0:
TypeError: Cannot read properties of undefined (reading 'LineFeed')
at @hey-api/openapi-ts/dist/init-*.mjs
newLine: ts.NewLineKind.LineFeed
openapi-ts is built on the legacy TypeScript compiler API. TypeScript 7
(tsgo) exports only { version, versionMajorMinor } from its main entry
and moved that API behind `typescript/unstable/*`, so every `ts.*` read
is undefined. Measured: 0.99.0 fails identically on `ts.SyntaxKind`, so
upgrading the generator is not a fix. openapi-ts declares typescript as
a peer (">=5.5.3 || >=6.0.0"), which TS 7 satisfies numerically — pnpm
`overrides` and `packageExtensions` both lose to the peer, so scoping
the pin to the generator alone does not work either.
Revert the root devDependency to ^5.9.3. Nothing else in the repo needs
TS 7: the bundle is built by esbuild, and 5.9 covers `tsc --noEmit` and
the declaration emit. tsgo can come back once hey-api supports it.
Also add a `codegen` CI job. No job ran `pnpm run generate`, which is
why CI stayed green through ten failed dispatches; it now regenerates
from the committed spec and fails on drift.
Verified locally: generate reproduces src/client byte-identical from
the committed spec, and regenerating from the live 1.114.0 spec builds
and passes 44/44 tests.
Two factual errors on the npm landing page: - The Validation section promised that responses are validated by Zod. They are not: openapi-ts.config.ts sets responses: false (deliberately, for API/spec mismatches), and the generated sdk.gen.ts holds 142 requestValidator calls and 0 responseValidator calls. - abby.customerPortal was missing from the service list — 9 listed for 10 exposed by src/index.ts. It covers /v2/customer-portal/payments and the billing themes under /v2/billing/theme.
A local git worktree under .worktrees/ shows up as 15 untracked files in 'pnpm run format:check' (the .prettierignore 'src/client/' pattern does not match .worktrees/<name>/src/client/), turning the local format gate red for anyone who uses one.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #36 +/- ##
=======================================
Coverage 90.75% 90.75%
=======================================
Files 1 1
Lines 119 119
Branches 30 30
=======================================
Hits 108 108
Misses 11 11 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 44b4d6b. Configure here.
The codegen job was declared but absent from ci-success's needs: and from the results check it walks. ci-success runs under if: always() and inspects only that list, so codegen could fail while the aggregate printed 'All jobs passed' — the exact silent-pass the job exists to prevent. Verified: needs, the results[] list and the set of defined jobs now all coincide (7 each, no gap either way).
Contributor
Author
|
ask-approval |
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.



Problem
pnpm run generatehas failed on every Generate SDK dispatch since 2026-08-29 — 10 consecutive runs. The published SDK is therefore frozen at API spec 1.109.0 while production is at 1.114.0 (missing:GET /v2/e-invoicing/platform-choice, thePlatformTransferStatus/ReadMePlatformTransferDto/RegistrationStatusschemas, and changes toReadMeDto,ReadMeEInvoicingDto,PushNotificationPreferencesDto).Cause
openapi-ts is built on the legacy TypeScript compiler API. TypeScript 7 (tsgo) exports nothing of it from the main entry:
Everything moved behind
typescript/unstable/*, so everyts.*read isundefined. The breakage landed with 0443560 (chore: pnpm 11, TypeScript 7, oxlint, 2026-08-27 12:12) — 4 h after the last green generate.Two dead ends, measured, so nobody repeats them:
ts.SyntaxKind. (Dependabot build(deps): bump @hey-api/openapi-ts from 0.97.3 to 0.99.0 in the production-dependencies group across 1 directory #29 is therefore not a fix for this.)>=5.5.3 || >=6.0.0), which TS 7 satisfies numerically. Bothoverrides: '@hey-api/openapi-ts>typescript'andpackageExtensionslose to the peer — the link still resolves totypescript@7.0.2.Fix
Root
typescriptback to^5.9.3. Nothing here needs TS 7: the bundle comes out of esbuild, and 5.9 coverstsc --noEmitand the declaration emit. tsgo can return once hey-api supports it.Plus a
codegenCI job. No job ranpnpm run generate, which is exactly why CI stayed green through ten failed dispatches — the repo's core function was broken and nothing said so. It now regenerates from the committed spec and fails on drift.Two smaller items ride along:
openapi-ts.config.tssetsresponses: falsedeliberately, and the generated client holds 142requestValidatorcalls and 0responseValidator. Also addsabby.customerPortal, which was missing from the service list (9 documented for 10 exposed)..worktrees/ignored by git and prettier — a local worktree put 15 untracked files intopnpm run format:check.Verification
generatefrom the committed 1.109.0 specsrc/clientbyte-identical — same output as the last green runlint/format:check/typecheckbuild:onlytestgeneratefrom the live 1.114.0 spec, then build + testAfter merge
Publication will not restart on its own: the monorepo only dispatches on
promote-to-prodwhen the spec hashes differ. Trigger Generate SDK manually (workflow_dispatch, bumpminor) to get the 1.114.0 update PR and the release.Note
Medium Risk
Pins the build/codegen toolchain and adds a gate on generated client output; no runtime SDK logic changes in the diff, but incorrect drift checks could block merges until
src/clientis regenerated.Overview
Restores
pnpm run generateby pinning TypeScript to^5.9.3(from 7.x), because@hey-api/openapi-tsstill depends on the legacy compiler API that TS 7 no longer exposes from the main package.Adds a
codegenCI job that runspnpm run generateagainst the committed OpenAPI spec and fails ifsrc/clientdrifts, and wires that job intoci-successso broken codegen can’t stay green while release workflows fail.README now documents request-only Zod validation (responses are typed but not runtime-validated) and lists
abby.customerPortal..worktrees/is ignored for git and Prettier.Reviewed by Cursor Bugbot for commit c93ca89. Bugbot is set up for automated code reviews on this repo. Configure here.