Forger Help

Versions

Forger maintains one major line per supported TypeScript generation. Each line lives on its own branch in the repository.

Version matrix

Line

Branch

npm

TypeScript

Tooling

v2

v2

@artstesh/forger@^2

5.x (5.0.2+) and 6.x¹

ts-patch 3.x for TS 5, ts-patch 4.x for TS 6

v1

v1

@artstesh/forger@^1

4.x (4.3.5+)

ts-patch 2.x / ttypescript-era tooling

¹ TypeScript 6 support (peer range >=5.0.2 <7, the ts-jest emit fix, and the createWith settings merge) is implemented on the v2 branch and ships with the next 2.x release; verified on TypeScript 6.0 end to end.

The current documentation describes the v2 line.

2.x (current, branch v2)

  • Transformer-based architecture: type information is captured at compile time and injected into Forger.create/Forger.createWith call sites (see How it works).

  • Peer dependency: TypeScript ^5.0.2 (widening for TypeScript 6 is pending — see the backlog).

  • Integration through ts-jest (ts-patch/compiler), ts-patch CLI builds, and the shipped Angular webpack patch.

  • Full type support: primitives, dates, numeric enums, literal unions, unions, arrays, tuples, functions, interfaces, classes, generics, inheritance, intersections, and circular references with configurable depth.

  • Forger.createWith with the with()/result() chain.

1.x (branch v1)

  • The original generation for TypeScript 4.3+.

  • Use it in projects pinned to the TypeScript 4 line; it receives critical fixes only.

  • Install explicitly: npm install --save-dev @artstesh/forger@^1.

TypeScript compatibility

TypeScript 6 (6.0.x). TypeScript 6.0 remains API-compatible with 5.9 for compiler plugins, and Forger's transformer approach verified working on 6.0 end to end — both the ts-patch CLI build route and the ts-jest route. Three ecosystem notes apply:

  1. ts-patch changed majors: ts-patch 4.x supports TypeScript 6+ only, while TypeScript 5 projects stay on ts-patch 3.x. Both accept the same tsconfig.json plugins entry.

  2. ts-jest (29.4.x) accepts TypeScript >=4.3 <7.

  3. One library fix was required: in the ts-jest (language-service) emit path under TypeScript 6, Forger's use of node.getText() on a type node could throw when the node is detached from its source file. The fix — a checker.typeToString fallback — is on the v2 branch together with the widened peer range (>=5.0.2 <7) and a createWith settings-merge fix, and ships with the next 2.x release.

TypeScript 7 (tsgo). TypeScript 7 is the native (Go) compiler. It does not include the JavaScript Compiler API, so JS-based custom transformers — the very mechanism Forger is built on — cannot run under it, and ts-jest explicitly stops below 7 as well. There is no Forger line for TypeScript 7 yet; the strategy is tracked in the library backlog and depends on the plugin API that the TypeScript team plans for the 7.x line. Until then, projects on Forger should stay on the TypeScript 5–6 line.

Release notes

Detailed per-release notes live in the GitHub releases of the repository.

08 September 2026