feat: add helper to register TypeBox string formats#265
Conversation
9e77c88 to
6692ace
Compare
|
Hi @ilteoood, just a gentle ping on this since it's been a few weeks! As mentioned below, I had already addressed all your feedback. I just pushed a tiny commit today to fix a small typo in the tests (uri to url) and clean up a stray semicolon. Everything should be good to go now! Let me know if you need anything else. |
45c8ded to
5231040
Compare
|
Hi @ilteoood, just a quick update: I noticed the recent architectural changes for TS 5.9, so I went ahead and rebased this branch to resolve the merge conflicts. Everything is properly migrated to the new .ts setup and all tests are green again. Ready whenever you are! 🚀 |
Co-authored-by: Matteo Pietro Dazzi <matteopietro.dazzi@gmail.com> Signed-off-by: Andrew Gouvêa Gonçalves de Souza <103960552+drewnetic@users.noreply.github.com>
5231040 to
a3a2b08
Compare
|
Hi @ilteoood! Just a gentle ping on this since it's been a while. I've just rebased the branch to keep it fully up to date with the latest main. During the rebase, I took the opportunity to unify the formats helper directly inside index.ts instead of keeping it in a separate file. This simplifies the CJS/ESM post-build output, removes any extra export overhead, and keeps the package footprint minimal. All previous feedback has been addressed, and everything is green and ready for another look whenever you have some time. Thank you! |
|
CI is very red |
|
As a side note for the team: while testing locally on Windows (and also via WSL/Ubuntu),
I spent some time debugging this and the package output itself looks correct ( At the moment this seems to be related to Just leaving this note here in case someone else hits the same issue locally while reviewing/testing the PR. |
What’s changed
This PR adds an official helper to register common string formats
(
date,date-time,email,uuid, etc.) when usingTypeBoxValidatorCompiler.Why
Fastify’s default AJV setup enables
ajv-formatsout of the box,but TypeBox does not register formats automatically.
This helper avoids copy/paste workarounds and keeps behavior explicit,
without introducing breaking changes.
Notes
Closes #84
Checklist
npm run test && npm run benchmark --if-presentand the Code of conduct