Back to Explore

dsherret/ts-morph

GitHub
1 updates · last 90 days1 watchersOpen source

Last release: 1 month ago

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

  • The repository appears actively maintained, with the most recent upstream push on 2026-04-12 and a new version (28.0.0) published on 2026-04-12.
  • Update cadence looks moderately frequent, with 27.0.1 in 2025-09-17, 27.0.2 in 2025-10-12 (about 3-4 weeks later), and 28.0.0 in 2026-04-12 (about 6 months later).

AI summary generated Today

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • 28.0.0

    1 month ago

    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.

    BreakingFeatures
  • 27.0.2

    7 months ago

    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

    8 months ago

    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

    9 months ago

    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.

    Features
  • 26.0.0

    5/19/2025

    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.

    Features
  • 25.0.1

    2/5/2025

    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

    12/30/2024

    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.

    Features
  • 24.0.0

    10/6/2024

    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).

    Breaking
  • 23.0.0

    6/23/2024

    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.

    Features
  • 22.0.0

    3/10/2024

    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