Repository navigation
BREAKING: Generated Types and Schemas - #893
Merged
Merged
Conversation
Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>
bachmacintosh
marked this pull request as ready for review
October 12, 2026 19:15
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
Test the core helpers that were previously only exercised by the generator scripts, which aren't measured for coverage, along with error paths such as defineRevision() rejecting an invalid revision. Also remove an unreachable branch from referencesOf(), and move findCycle() into analysis.ts as an export so its handling of dependencies without their own entry can be tested directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Aliases of CollectionParameters (e.g. ResetParameters) are generated as their own type (and schema) declarations
instead of `export { ... as ... }` re-exports, which makes them easier to document. Valibot and Zod modules with
aliases disable unicorn/prefer-export-from accordingly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In this PR, we've used Claude to move the WaniKani API schema definitions into an internal package, and written a generator that can create the TypeScript types/constants, as well as schema definitions for various runtime libraries (currently valibot and Zod). Documentation on how to use the new generator is included in its package README file.
We left tests unchanged in the existing packages to make sure the generated code matched up with what we're currently expecting. One major improvement from generating the types/schemas on the fly, however, is that we're printing JSDoc on all types, constants, objects, properties, etc. without having to manually keep them all up to date. The generated documentation also removes some old
@seeblocks that were typedoc package links.There is a new check step in CI that makes sure the repo is clean after regenerating the types/schema so that nothing drifts away from the core schema definitions.
We also took the opportunity to update our vitest configuration to improve test bench performance, again with no actual changes to the tests themselves.
Nature of Pull Request
This Pull Request:
Its changes constitutes a:
Contribution Terms
I understand that by submitting this Pull Request: