joist-orm icon indicating copy to clipboard operation
joist-orm copied to clipboard

Test `superstruct` against current major version

Open blimmer opened this issue 1 year ago • 1 comments

Today, the test suite runs against superstruct 0.15.x:

Screenshot 2024-11-20 at 11-29-39 Code search results

However, the current major version is 2.x. It would be nice to test against the current major version so people could be confident in updating.

Further, it's probably a good idea for joist's package.json to specify superstruct as an optional peer dependency, with the supported version(s). You can use the peerDependenciesMeta option to specify optional peerdeps.

blimmer avatar Nov 20 '24 18:11 blimmer

I tried bumping to 2.x and am getting errors that it is ESM-only, although afaict that's not intentional on their side:

https://github.com/ianstormtaylor/superstruct/issues/1287

A recent development in the runtime types space is:

https://standardschema.dev/

Which, if Joist supported, in theory we could remove superstruct & zod & ...specific lib support..., and instead generically support any runtime library that supported standardschema.

The biggest downside to us tactically is that superstruct doesn't support standardschema yet:

https://github.com/ianstormtaylor/superstruct/issues/1291

So we'd probably end up needing to move to zod or Arktype.

stephenh avatar Mar 05 '25 04:03 stephenh