This release introduces direct access to the latest entity schema and includes development tooling improvements.
The new latestSchema getter property allows you to access the Zod schema of the latest version of an entity directly. This is useful when you need to work with the raw Zod schema in existing validation workflows:
const Environment = createVersionedEntity({
latestVersion: 2,
versionMap: { /* ... */ },
getVersion: (data) => data.v
})
// Access the latest schema directly
const latestSchema = Environment.latestSchema // Returns the z.object() schema for version 2
// Use it with existing Zod workflows
const result = latestSchema.safeParse(someData)What's Changed
- feat: ability to get the zod schema of latest version of an entity by @AndrewBastin in 5716ec9
- feat: add nix tooling by @AndrewBastin in 09b9dfa
- fix: vitest should only check against tests in src folder by @AndrewBastin in 16325b9
- chore: enable typecheck on tests by @AndrewBastin in 5963ae7
- chore: bump and pin dev dependencies by @AndrewBastin in dfa3b05
Contributors
Full Changelog: v0.3.0...v0.4.0