Releases: mathematic-inc/ts-japi
Release list
v1.12.6
v1.12.5
v1.12.4
ts-japi v1.12.4 🎉
This release removes a compatibility barrier for anyone still running Node.js 20 in production — ts-japi now officially supports it again, so you can keep serializing beautifully spec-compliant JSON:API responses no matter which supported Node.js runtime your infrastructure is pinned to. No API changes, no migration steps — just drop in the update and go.
🐛 Bug Fixes
-
Support Node.js 20 runtimes (#128) — the published
enginesfloor is lowered back from Node.js 24 to Node.js 20, and CI now exercises the full build, typecheck, and test suite (105 tests, with coverage) against Node.js 20.0.0 in addition to the repository's Node.js 24 toolchain. If your deployment target is Node 20 LTS, ts-japi is fully verified and ready for you again:// package.json { "engines": { "node": ">=20" } }
import { Serializer } from "ts-japi"; interface Book { id: string; title: string; } const bookSerializer = new Serializer<Book>("books"); // Works the same whether you're on Node 20 or Node 24 const document = await bookSerializer.serialize({ id: "1", title: "JSON:API in Action", });
⚡ Improvements
- Refreshed the Node.js development toolchain to 24.20.0 and updated
@types/node, keeping the project's own build/test pipeline current while the published package stays compatible with older runtimes.
Install
npm install ts-japipnpm add ts-japiv1.12.3
ts-japi v1.12.3
ts-japi v1.12.3 ships a long-awaited correctness fix that brings the library into full compliance with the JSON:API spec — relator fields no longer leak into attributes — plus a Node.js 24 LTS upgrade that keeps the project on the latest and greatest runtime. It's a focused, high-quality release that makes your JSON:API responses cleaner with zero extra effort on your part.
🐛 Bug Fixes
Relator fields are now automatically excluded from attributes (#114, closes #77)
The JSON:API specification is clear: a field that is expressed as a relationship must not also appear as an attribute. Previously, if you defined a Relator for a field (e.g. articles on a User), that raw field value would still show up in the serialized attributes object — producing invalid output and causing headaches with compliant clients.
Starting in v1.12.3, ts-japi automatically excludes any field covered by a Relator from the default null projection. No configuration changes needed — it just works.
Before (broken output):
{
"data": {
"id": "1",
"type": "User",
"attributes": {
"name": "Foo",
"articles": [{ "id": "1", "title": "Article 1" }]
},
"relationships": {
"Article": { "data": [{ "id": "1", "type": "Article" }] }
}
}
}After (correct output):
{
"data": {
"id": "1",
"type": "User",
"attributes": {
"name": "Foo"
},
"relationships": {
"Article": { "data": [{ "id": "1", "type": "Article" }] }
}
}
}Example — nothing to change, the fix is automatic:
import { Relator, Serializer } from "ts-japi";
interface Article { id: string; title: string; }
interface User { id: string; name: string; articles: Article[]; }
const ArticleSerializer = new Serializer<Article>("Article");
const UserArticleRelator = new Relator<User, Article>(
async (user) => user.articles,
ArticleSerializer,
);
const UserSerializer = new Serializer<User>("User", {
relators: [UserArticleRelator],
});
const doc = await UserSerializer.serialize({
id: "1",
name: "Foo",
articles: [{ id: "1", title: "Article 1" }],
});
// doc.data.attributes → { name: "Foo" } ✅ no `articles` field
// doc.data.relationships → { Article: { ... } } ✅ relationship present⚡ Improvements
Node.js 24 LTS + dependency updates (#112)
The project's CI and engine target have been bumped to Node.js 24 LTS, ensuring ts-japi is tested and verified against the latest stable runtime. All dependencies have been refreshed to their newest compatible versions as well.
Installation
# npm
npm install ts-japi
# pnpm
pnpm add ts-japiFull changelog: v1.12.2...v1.12.3
v1.12.2
ts-japi v1.12.2
We're shipping a focused tooling overhaul that makes contributing to ts-japi faster, leaner, and more consistent than ever before. While the public API is completely unchanged, this release replaces the entire developer toolchain under the hood — swapping out slower, heavier tools for a modern, blazing-fast stack — so every contributor gets a snappier experience from first clone to merged PR.
⚡ Improvements
Modern toolchain: Biome + pnpm + Lefthook
The dev toolchain has been fully modernized:
| Before | After |
|---|---|
| ESLint + Prettier | Biome (via Ultracite) |
| Yarn | pnpm |
| Husky | Lefthook |
Biome replaces both ESLint and Prettier with a single, Rust-powered tool that lints and formats in milliseconds. It's configured in biome.json and exposed through two simple scripts:
pnpm lint # check for issues
pnpm format # fix issues automaticallypnpm replaces Yarn for dependency management, bringing faster installs, a content-addressable store, and a pnpm-lock.yaml that is far easier for tools and humans to read.
Lefthook replaces Husky for Git hooks — it's faster, zero-dependency, and skips hook installation automatically in CI environments (test -n "$CI" || lefthook install).
Refreshed CI/CD pipelines
The GitHub Actions workflows have been rebuilt from scratch:
- CI (
ci.yml) — streamlined lint → build → test pipeline with pnpm caching and concurrency cancellation on re-push. - Release (
release.yml) — end-to-end release automation: build, pack, artifact upload, attestation, npm publish, and GitHub Release creation, all triggered by a version tag. - Release Notes (
release-notes.yml) — automated release body generation wired into the release flow.
Updated dependencies
All dev dependencies have been bumped to their latest major versions, including Babel, Jest, TypeScript, and the full @microsoft/api-extractor toolchain.
License updated to Apache-2.0
The project license has been updated from MIT to Apache-2.0, and the author field updated to Mathematic Inc.
No breaking changes
The public API — Serializer, ErrorSerializer, Relator, Linker, Paginator, Metaizer, Cache, PolymorphicSerializer, and all exported types — is completely unchanged. Drop in this update with confidence.
Get it now
# npm
npm install ts-japi@1.12.2
# pnpm
pnpm add ts-japi@1.12.2
# yarn
yarn add ts-japi@1.12.2Full changelog: v1.12.1...v1.12.2