Skip to content

Conversation

@gnidan
Copy link
Member

@gnidan gnidan commented Feb 5, 2025

This PR adds types and type predicates for schemas in the following ethdebug/format namespaces:

  • materials
  • data
  • types
  • programs

These new implementations follow the convention previously established by @ethdebug/pointers, to use the official schema examples as the test cases for the new type predicates.

Going a step further, this PR also moves the existing pointer types/type predicates from its home in @ethdebug/pointers into @ethdebug/format.

As a consequence of this new code centralization, this PR also moves the jest custom matchers stuff out of the repo root (where I just put it), since it's easier and makes more sense now to include this in the only package that will be doing this kind of automated predicate testing.

Besides all this, this PR also has some various required configuration changes, including tweaks to the website's implementation guide stuff (since there's been a change to a referenced code location)

@gnidan gnidan force-pushed the packages branch 2 times, most recently from b92bb58 to eb71979 Compare February 5, 2025 21:09
@gnidan gnidan force-pushed the packages branch 2 times, most recently from 7329bee to 80a037d Compare February 7, 2025 00:35
@gnidan gnidan changed the title Define TypeScript types and type predicate functions for various schemas Use @ethdebug/format as home package for TypeScript types and type predicates Feb 7, 2025
- Setup jest in @ethdebug/format
- Centralize all the schema types and type predicates into a src/types
  directory
- Turn on strict optional property business even though it makes
  describeSchema a bit uglier
- Don't stare too long at describeSchema right now even though you want
  to fix it
- Move jest stuff back from the root into @ethdebug/format's directory
- Get rid of the `/// <reference` garbage, yay
- Downgrade chalk to avoid turning @ethdebug/format into ESM
- Fix implementation guide code listing for Pointer, which was just
  removed from @ethdebug/pointers
  - Add @ethdebug/format to CodeListing's internal package awareness
  - Define new `includePackageNameInTitle?: boolean` property on
    CodeListing, so that the implementation guide can be explicit on
    that page.
  - Fix some wording
@gnidan gnidan marked this pull request as ready for review February 7, 2025 00:48
@gnidan gnidan merged commit 3ec6768 into main Feb 7, 2025
3 checks passed
@gnidan gnidan deleted the packages branch February 7, 2025 00:54
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.

2 participants