Repository navigation
feat: rebuild the valimock entry on Valimock 1.7 - #3
Merged
Merged
Conversation
`lexiconMocks` is now a set of Valimock options to spread into `new Valimock()`: `stringActions` route each Lexicon format action to a format name, `stringFormats` generate realistic values for those formats, and a `lazy` custom mock resolves unions to one of their declared variants and stamps `$type`. The hand-rolled pipe walker and per-schema seeding are gone since Valimock 1.7 flattens nested pipes and seeds once per top-level call. The integration test mocks every compiled fixture definition and parses the result back through the schema.
|
The changes in this PR will be included in the next version bump.
|
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.


Summary
Rebuilds
@saeris/valicon/valimockon the extension points that shipped in Valimock 1.7 (stringActions,stringFormats, themockargument tocustomMocks, nested-pipe flattening, and once-per-call seeding).lexiconMocksis now a set of Valimock options to spread intonew Valimock():new Valimock({ ...lexiconMocks, seed: 42 }).stringActionsmaps every Lexicon format action (did,handle,nsid,tid,cid,at_uri, ...) plusacceptandmin/max_decoded_bytesto a format name, and readsknownValuesfrom Lexicon metadata.stringFormatsgenerates realistic values for those formats; the individual generators (mockDid(),mockHandle(), ...) remain exported.lazycustom mock resolves Lexicon unions to one declared variant and stamps$type.Requires Valimock 1.7.1
The
app.bsky.feed.post#mainmock exposed a Valimock bug where the string fast path skipped the length bound (Saeris/valimock#82, released as 1.7.1). The dev dependency and peer range now require 1.7.1. All 722 tests pass against it.