ts-morph is a TypeScript Compiler API wrapper that helps you programmatically navigate and manipulate TypeScript and JavaScript code. It is useful for static analysis, AST inspection, and code generation or other automated code changes.
Project status
- Actively maintained: GitHub “last upstream push” was 2026-04-12, and there is a recent 28.0.0 update on 2026-04-12, about two months before today (2026-06-11).
- Updates cadence: Frequent minor/patch and TS-alignment releases in 2025 (for example, 27.0.0 (Sep 7, 2025), 27.0.1 (Sep 17, 2025), 27.0.2 (Oct 12, 2025)), then a new major 28.0.0 in 2026. Overall, the cadence looks active, with bursts around TypeScript version upgrades.
AI summary generated
Recent updates
28.0.0
Release 28.0.0 upgrades the project to TypeScript 6.0 (noted as breaking), adds a new standalone printStructure API for turning ts-morph structures into formatted code strings, and includes a fix for addTypeArgument crashing in certain cases. The code diff also shows multiple behavior shifts driven by the TypeScript version bump, including changes to emitted JavaScript output.
BreakingFeatures27.0.2
Release 27.0.2 is primarily described as an npm publish fix to ensure prior fixes from 27.0.1 are properly published. The code diff shows changes focused on the CI publish workflow and small internal version bumps for the monorepo packages.
27.0.1
Release 27.0.1 focuses on restoring browser compatibility for ts-morph packaging. It adjusts the package.json "browser" export mapping so bundlers correctly treat additional Node built-ins as unavailable in browser builds.
27.0.0
ts-morph 27.0.0 adds new TypeScript wrapper capabilities, including TypeChecker.getAwaitedType, OptionalTypeNode, and JSDocImportTag, plus import defer support in import clauses/declarations. It also bumps the bundled TypeScript typings to 5.9 and improves performance by switching Node globbing from fast-glob to tinyglobby.
Features26.0.0
Release 26.0.0 updates ts-morph to TypeScript 5.8, adjusts comma insertion logic to better handle nested template literals, and improves publish behavior (ignoring dist-deno and adding npm provenance). The diff also reveals additional typing and API-shape changes not mentioned in the release notes.
Features25.0.1
Release 25.0.1 is a small maintenance update. It bumps the TypeScript dev dependency from 5.7.2 to 5.7.3 and updates the package browser field configuration to include fs/promises.
25.0.0
This release updates ts-morph to align with TypeScript 5.7.2 and includes several stability and correctness fixes around import/export manipulation, async keyword insertion, and variable statement generation. It also switches back to using fast-glob for improved globbing stability.
Features24.0.0
ts-morph 24.0.0 upgrades to TypeScript 5.6 and includes targeted fixes for getDerivedClasses() and getBodyText(). The release also focuses on performance by removing mkdirp and switching filesystem globbing to tinyglobby. The code diff shows additional behavior and type changes around import/export specifier handling (not mentioned in the release notes).
Breaking23.0.0
Release 23.0.0 updates ts-morph to support TypeScript 5.5, adds BigInt type helper methods on `Type`, and fixes handling of removing default imports for type-only imports. The notes also indicate Deno availability via JSR.
Features22.0.0
ts-morph 22.0.0 adds new type/introspection helpers (Type.isAssignableTo, TypeChecker.resolveName), and introduces ClassDeclarationStructure.staticBlocks support. It also upgrades the bundled TypeScript typings to TypeScript 5.4 and includes a breaking change where Node.forgetDescendants() no longer returns this for chaining.
BreakingFeatures