ianstormtaylor / superstruct

A simple and composable way to validate data in JavaScript (and TypeScript).
https://docs.superstructjs.org
MIT License
6.95k stars 224 forks source link

Remove "is-email" from testing suite #1247

Closed yeoffrey closed 2 months ago

yeoffrey commented 2 months ago

Removing is-email from the testing suite. Its used as a dev dependency only when testing refine, and it creates some complexity because we need to type that function. Not worth it in my opinion!

Related: #1244

arturmuller commented 2 months ago

Removing the is-email package probably makes sense, just to make it less confusing. I tripped over it a couple of times myself!

All the modules under typings are a DIY way of testing TypeScript type signatures (run via the npm run test:types command). We definitely don't want to remove them, but it would probably make a lot of sense to instead use Vitest's type testing features as they are more robust in my experience.

Using Vitest would also makes it a lot clearer what is actually happening with all those files -- a major plus in my book!

yeoffrey commented 2 months ago

Removing the is-email package probably makes sense, just to make it less confusing. I tripped over it a couple of times myself!

All the modules under typings are a DIY way of testing TypeScript type signatures (run via the npm run test:types command). We definitely don't want to remove them, but it would probably make a lot of sense to instead use Vitest's type testing features as they are more robust in my experience.

Using Vitest would also makes it a lot clearer what is actually happening with all those files -- a major plus in my book!

Cool! Will keep those then. I've refactored this PR to just contain the changes for is-email.

arturmuller commented 2 months ago

@yeoffrey FYI: I noticed that the is-email was used in the examples dir, along with some other similar helper packages. I added a small README and a custom package.json to that dir so that we can remove all of these from the root.

yeoffrey commented 2 months ago

@yeoffrey FYI: I noticed that the is-email was used in the examples dir, along with some other similar helper packages. I added a small README and a custom package.json to that dir so that we can remove all of these from the root.

No worries at all. Thanks for doing that!