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 |
|
| 5.x (5.0.2+) and 6.x¹ | ts-patch 3.x for TS 5, ts-patch 4.x for TS 6 |
v1 |
|
| 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.createWithcall 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-patchCLI 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.createWithwith thewith()/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:
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.jsonpluginsentry.ts-jest (29.4.x) accepts TypeScript
>=4.3 <7.One library fix was required: in the
ts-jest(language-service) emit path under TypeScript 6,Forger's use ofnode.getText()on a type node could throw when the node is detached from its source file. The fix — achecker.typeToStringfallback — is on thev2branch together with the widened peer range (>=5.0.2 <7) and acreateWithsettings-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.