Skip to content
0

Upgrade to KatanaKit v5 ​

This guide migrates you from 4.x to 5.x.

bash
npm install katanakit-js@^5

Breaking changes ​

None. The 5.x series carries no Breaking entries in the changelog: 5.0.0 was a version-alignment release (GitHub tag only, superseded hours later by 5.0.1) and everything after it was additive.

Behaviour change worth knowing ​

WpEmbedded["wp:featuredmedia"] shape (5.1.0) — it is now a loose partial shape instead of WpMedia[]. Embedded media never nests its own _embedded, which broke the Zod schema cycle. source_url, id and title stay typed, but if you were reading a full media array out of _embedded you now get the partial.

If you only read post._embedded["wp:featuredmedia"][0].source_url, nothing changes.

Added in v5 ​

  • Zod validation across the library (5.1.0) — zod is a dependency and runtime schemas live behind the new katanakit-js/schemas subpath. src/types/ now infers via z.infer, so consumer imports do not change. New useValidate() returns a Safe Result instead of throwing.
  • InsForge adapter (5.1.0) — katanakit-js/adapters/insforge, an optional @insforge/sdk peer, with database, storage and edge-function helpers. Mass writes are refused (update/delete require a non-empty filter) and the whole surface returns Safe Results.
  • SmartVideo and YouTube services (5.1.0) — media parsing, embed building and quota-cheap channel listings with a keyless RSS fallback.
  • Filesystem service (5.1.1) — useReadFile, useWriteFile, useReadDir and friends for Node/Bun, every fallible call returning a Safe Result with the native errno code. Browsers and Workers get ERR_FS_UNAVAILABLE instead of a crash.
  • Faker service (5.1.1) — useFakeEmail, useFakeList, useFakeSeed and the rest. @faker-js/faker is an optional peer loaded through dynamic import(), so it never enters the initial bundle.
  • Safe Result helpers (5.2.0) — useAttempt(), useTryJsonParse() and useErrorNormalize() are now the recommended boundary helpers, and the ad-hoc try/catch blocks scattered through the library were collapsed into them. See the error handling guide.
  • Katana UI foundations (5.2.0) — @katanakit/ui, a private workspace with framework-agnostic useButton/useInput/useCard/useBadge/useAlert styled by katanakit-css. Not published to npm yet.
  • Docs moved to VitePress (5.2.0) — sources live in docs/ and are served at docs.senseikatana.com/*. Old /docs/* links redirect.

Migration checklist ​

  1. Install katanakit-js@^5.
  2. If you use the WordPress adapter, re-read anything that consumed _embedded["wp:featuredmedia"] as a full array.
  3. Run your test suite — the rest is additive.

Released under the MIT License.