chore(deps): bump typescript to 5.9.3 across the repo#231
Merged
jsteinich merged 4 commits intoJun 4, 2026
Conversation
jsteinich
approved these changes
Jun 4, 2026
so0k
added a commit
that referenced
this pull request
Jun 5, 2026
## 0.23.3 ### chore - chore(gha): run integration tests on Depot runners [\#238](#238) - chore(deps): bump typescript to 5.9.3 across the repo [\#231](#231) - chore: Upgrade jsii [\#223](#223) - chore: Revise README links to documentation and language support [\#221](#221) - chore: Pin node version to 22.22.2 via .nvmrc [\#212](#212) - chore: Add gradle cache to the examples and integration CI workflows [\#211](#211) - chore: Add PR workflow concurrency group and CI Label Filter job [\#204](#204) - chore(tests): add verdaccio to package.json [\#202](#202) - chore(tests): don't require other language builds [\#201](#201) - chore(tests): Ensure we terminate Verdaccio [\#199](#199) - chore: rewrite https://cdk.tf links [\#197](#197) - chore: Update examples help files [\#194](#194) ### feat - feat: faster JSON stringify [\#224](#224) - feat(lib): allow disabling creation stacks [\#215](#215) ### fix - fix(lib): surface stderr/stdout on exec() failures via toString() [\#207](#207) --------- Co-authored-by: so0k <vincent.drl@gmail.com> Co-authored-by: sakul-learning <lucas@sheesh.host>
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.
Description
Aligns every workspace package and example on TypeScript 5.9.3, and fixes the two
WebAssembly.instantiatecall sites (@cdktn/hcl-toolsand@cdktn/hcl2json) that fail to compile under newer TS.Why
The version was drifting.
@cdktn/hcl-toolsdeclared^5.7.3while the other 10 workspace packages were exact-pinned to5.4.5, and the 22 example projects were split between5.4.5and^5.7.3. Under yarn workspaces (hoisted node_modules) this drift was invisible — every package got whatever yarn happened to hoist at the root. Under the upcoming pnpm migration (strict, isolatednode_modules/.pnpm/layout) each package resolves its own range, sohcl-toolslands on TS 5.9.3 while everything else lands on 5.4.5 — and the build ofhcl-toolsfails because TS 5.9.3 resolvesWebAssembly.instantiate(buffer, …)differently. We hit this when reproducing the pnpm branch (see "Root cause" below).The structural problem is the drift itself — over thirty independent pins inviting future divergence. Two changes fix it together:
"typescript": "^5.0.0"resolutions:"**/typescript": "5.9.3"The root devDep keeps
typescriptbecause root-level tooling (tsc-files,typescript-eslint,@typescript-eslint/parser) declares it as a peer.Root cause of the
bridge.tsfailures:In TS 5.7+
Buffer<TArrayBuffer extends ArrayBufferLike = ArrayBuffer>andArrayBufferView<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike>became generic. In TS 5.9.3 the overload resolver no longer treatsBuffer<ArrayBufferLike>as assignable to DOM'sBufferSource = ArrayBufferView | ArrayBuffer, soWebAssembly.instantiate(buffer, importObject)falls through fromto the second overload
WebAssemblyInstantiatedSourcehas a.instanceproperty;Instancedoes not. Soresult.instanceerrors withTS2339. The same code is fine under TS 5.4.5/5.8.x because those versions matched the first overload. Bothpackages/@cdktn/hcl-tools/src/bridge.tsandpackages/@cdktn/hcl2json/src/bridge.tsuse the same pattern and need the same fix.This is a prerequisite for #170
Approach: four steps.
^5.0.0in all eleven workspaces (cdktn,cdktn-cli,@cdktn/cli-core,@cdktn/commons,@cdktn/hcl-tools,@cdktn/hcl2cdk,@cdktn/hcl2json,@cdktn/provider-generator,@cdktn/provider-schema,tools/generate-function-bindings, root) and across the 22examples/typescript/**projects. Honest declarations: each package is built and tested under whatever TS 5.x the root resolves.resolutions: add"**/typescript": "5.9.3"alongside the existing**/@types/reactand**/jsiiresolutions. Future bumps touch one line.bridge.tscall sites — wrap the Buffer innew Uint8Array(...)before passing it toWebAssembly.instantiateinpackages/@cdktn/hcl-tools/src/bridge.tsandpackages/@cdktn/hcl2json/src/bridge.ts. This pins the overload to theBufferSourceform regardless of how TS resolvesBuffer<ArrayBufferLike>againstBufferSourcein any future TS release.yarn install— refreshes lockfile; every requestedtypescriptrange now resolves to 5.9.3.The
bridge.tschanges are required for this bump — without them@cdktn/hcl-toolsand@cdktn/hcl2jsondo not compile under TS 5.9.3.One incidental fix —
examples/typescript/aws-multiple-stacksdeclared@types/node: 18.11.19while every other example declared20.17.51. TS 5.9.3 surfaces the staleness as a structural-typing error ("Interface 'Buffer' incorrectly extends interface 'Uint8Array'"). Bumped to20.17.51to match the rest.Checklist