Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@MattIPv4
Copy link
Member

@MattIPv4 MattIPv4 commented Jun 6, 2025

Resolves #158

@github-actions
Copy link

github-actions bot commented Jun 6, 2025

Version published 🚀

npm install @alveusgg/[email protected]
pnpm add @alveusgg/[email protected]

@MattIPv4 MattIPv4 marked this pull request as ready for review June 17, 2025 01:16
Copilot AI review requested due to automatic review settings June 17, 2025 01:16
@MattIPv4 MattIPv4 requested a review from a team as a code owner June 17, 2025 01:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the codebase to use Zod version 4, refactoring various schemas and validators accordingly to align with the new API.

  • Update imports from "zod" to "zod/v4".
  • Replace custom validations with Zod's custom schemas for partial date strings, IUCN statuses, enclosure keys, species keys, positions, and classifications.
  • Bump the package version and update the Zod peer dependency.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/types.ts Introduces partialDateStringSchema using z.custom
src/iucn.ts Adds iucnStatusSchema with enhanced error messaging
src/enclosures.ts Exports enclosureKeySchema for validating keys
src/ambassadors/species.ts Replaces string refinements with schema references; renames isSpecies to isSpeciesKey and adds speciesKeySchema
src/ambassadors/images.ts Refactors image schema to use a custom position schema
src/ambassadors/core.ts Updates ambassadorSchema to use new schema references
src/ambassadors/classification.ts Introduces classSchema using z.custom
package.json Bumps version and updates the Zod dependency
Comments suppressed due to low confidence (1)

src/iucn.ts:42

  • The error message references 'iucnFlags', but there is no indication that 'iucnFlags' is defined or imported. Please ensure that 'iucnFlags' is declared or imported where needed.
  `must be a valid IUCN status (${Object.keys(iucnStatuses).join(", ")} [optionally suffixed with /${Object.keys(iucnFlags).join(", /")])`,

pjeweb
pjeweb previously approved these changes Jun 19, 2025
@MattIPv4 MattIPv4 requested a review from pjeweb June 19, 2025 22:15
@MattIPv4 MattIPv4 merged commit 40e5247 into main Jun 22, 2025
9 checks passed
@MattIPv4 MattIPv4 deleted the MattIPv4/zod-4 branch June 22, 2025 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update to Zod 4

3 participants