Highlights
- Migrated most helpers to TypeScript
- Improved compatibility with Sanity v5 (
defineType,defineField,defineArrayMember) - Added URL validation utilities (
validateUrlValue,requiredUrlValidator,optionalUrlValidator) - Added
startCaseandisCamelCaseutilities - Removed the lodash dependency
- Improved package tree-shaking and modernized distribution/output setup for both ESM and CommonJS consumers
- Upgraded the toolchain (tsup, Vitest, ESLint flat config, pnpm)
Fixes
decodeAssetIdnow has safer parsing and clearer error behavior for invalid IDs- Validation logic for image and URL helpers was tightened for edge cases and type safety
blockPreviewand block validator internals were refactored and typed for more predictable behaviorblockPreviewnow returns an empty string for empty/undefined input (previouslynull)
Dependency and Maintenance Updates
- Security/dependency updates across the range, including minimatch, json5, semver, @babel/traverse, and follow-
redirects. - Removed obsolete build scripts and refreshed lint/test/build workflows.
Full Changelog: v1.13.0...v2.1.0