Skip to content

Conversation

max-programming
Copy link
Owner

This pull request adds support for ArkType validation to the typed-id library, allowing users to generate type-safe, prefixed IDs and validate them using ArkType schemas. The changes update documentation, package dependencies, and introduce new implementation and tests for ArkType integration.

ArkType Integration:

  • Added ArkType as an optional dependency in package.json, including it in both devDependencies and peerDependencies, and marked it as optional in peerDependenciesMeta. [1] [2]
  • Implemented the createArkTypeIdSchema function in src/validators/arktype.ts to generate ArkType validation schemas for custom ID helpers.
  • Exported ArkType validator from src/validators/index.ts for public use.
  • Added comprehensive tests for ArkType ID validation in tests/validators/arktype.test.ts, covering default and custom options.

Documentation Updates:

  • Updated the README.md to announce ArkType integration, provide installation instructions, and add usage examples for ArkType validation, including custom configuration and validation scenarios. [1] [2] [3] [4] [5]
  • Reorganized the integrations section in the documentation to group Zod, Valibot, and ArkType together, and removed redundant installation instructions from the main section.

These changes make it easier for users to validate IDs with ArkType, alongside existing support for Zod and Valibot, and ensure the library remains well-documented and tested.

Copy link

@Copilot 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 integrates ArkType validation support into the typed-id library, expanding validation options alongside existing Zod and Valibot integrations. The implementation provides type-safe ID validation through ArkType schemas.

  • Added ArkType as an optional peer dependency with implementation and comprehensive test coverage
  • Created createArkTypeIdSchema function that generates ArkType validation schemas for ID helpers
  • Updated documentation to include ArkType installation instructions, usage examples, and custom validation scenarios

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
package.json Added ArkType as optional peer dependency and dev dependency
src/validators/arktype.ts Implemented ArkType schema creation function using regex validation
src/validators/index.ts Exported ArkType validator for public API
tests/validators/arktype.test.ts Added comprehensive test suite for ArkType integration
README.md Updated documentation with ArkType integration guide and examples

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

1 participant