Skip to content

feat: rebuild the valimock entry on Valimock 1.7 - #3

Merged
Saeris merged 2 commits into
mainfrom
feat/valimock-1.7
Nov 4, 2026
Merged

Saeris merged 2 commits into
mainfrom
feat/valimock-1.7

Conversation

@Saeris

@Saeris Saeris commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

Rebuilds @saeris/valicon/valimock on the extension points that shipped in Valimock 1.7 (stringActions, stringFormats, the mock argument to customMocks, nested-pipe flattening, and once-per-call seeding).

  • lexiconMocks is now a set of Valimock options to spread into new Valimock(): new Valimock({ ...lexiconMocks, seed: 42 }).
  • stringActions maps every Lexicon format action (did, handle, nsid, tid, cid, at_uri, ...) plus accept and min/max_decoded_bytes to a format name, and reads knownValues from Lexicon metadata.
  • stringFormats generates realistic values for those formats; the individual generators (mockDid(), mockHandle(), ...) remain exported.
  • The lazy custom mock resolves Lexicon unions to one declared variant and stamps $type.
  • The hand-rolled pipe walker and per-schema seeding are removed.
  • The integration test mocks every compiled fixture definition three times and expects the schema to accept each result.

Requires Valimock 1.7.1

The app.bsky.feed.post#main mock 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.

`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.
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

bumpy-frog

The changes in this PR will be included in the next version bump.

minor Minor releases

  • @saeris/valicon 0.1.0 → 0.2.0

Bump files in this PR

Click here if you want to add another bump file to this PR


This comment is maintained by bumpy.

@Saeris
Saeris marked this pull request as ready for review November 4, 2026 22:37
@Saeris
Saeris merged commit da851f4 into main Nov 4, 2026
4 checks passed
@Saeris
Saeris deleted the feat/valimock-1.7 branch November 4, 2026 22:40
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