Upgrade to KatanaKit v5
This guide migrates you from 4.x to 5.x.
bash
npm install katanakit-js@^5Breaking 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) —
zodis a dependency and runtime schemas live behind the newkatanakit-js/schemassubpath.src/types/now infers viaz.infer, so consumer imports do not change. NewuseValidate()returns a Safe Result instead of throwing. - InsForge adapter (5.1.0) —
katanakit-js/adapters/insforge, an optional@insforge/sdkpeer, 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,useReadDirand friends for Node/Bun, every fallible call returning a Safe Result with the native errnocode. Browsers and Workers getERR_FS_UNAVAILABLEinstead of a crash. - Faker service (5.1.1) —
useFakeEmail,useFakeList,useFakeSeedand the rest.@faker-js/fakeris an optional peer loaded through dynamicimport(), so it never enters the initial bundle. - Safe Result helpers (5.2.0) —
useAttempt(),useTryJsonParse()anduseErrorNormalize()are now the recommended boundary helpers, and the ad-hoctry/catchblocks 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-agnosticuseButton/useInput/useCard/useBadge/useAlertstyled bykatanakit-css. Not published to npm yet. - Docs moved to VitePress (5.2.0) — sources live in
docs/and are served atdocs.senseikatana.com/*. Old/docs/*links redirect.
Migration checklist
- Install
katanakit-js@^5. - If you use the WordPress adapter, re-read anything that consumed
_embedded["wp:featuredmedia"]as a full array. - Run your test suite — the rest is additive.