Skip to content

Conversation

@ysknsid25
Copy link
Contributor

@ysknsid25 ysknsid25 commented Mar 24, 2025

attempts to resolve #228

Test Targets

  • Zod
  • Valibot
  • ArkType
  • Effect Schema
  • Arri Schema
  • Formgator
  • decoders
  • Sury
  • Skunkteam Types
  • DreamIt GraphQL-Std-Schema
  • ts.data.json
  • quartet
  • unhoax
  • protovalidate-es
  • remult
  • stnl
  • yup
  • joi
  • regle
  • jsonv-ts
  • Evolu
  • zeed

This is because they are clearly stated to conform to Standard Schema.

@pi0 pi0 changed the title feat(loader): implements validation by standard schema feat(loader): support validate with standard schema Mar 26, 2025
@ysknsid25 ysknsid25 requested a review from pi0 March 26, 2025 13:31
@pi0
Copy link
Member

pi0 commented Jul 30, 2025

@ysknsid25 i will put more time on this PR before releasing in next minor releases. It is a big feature!

await expect(
loadConfig({
configFile: "CUSTOM",
it("load fixture config with validate for zod - toThrow", async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have many new tests. As this feature is based on standard schema, validating against one of them is enough to make maintenance easier

package.json Outdated
"test:types": "tsc --noEmit"
},
"dependencies": {
"@standard-schema/spec": "^1.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can copy-paste types (as they suggest) to avoid extra dependency

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I fixed it 👍

src/types.ts Outdated
configFileRequired?: boolean;

schema?: S;
validate?: (schema: S, input: ResolvedConfig<T, MT>) => void;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking how we could make it simpler. Like setting a schema could be enough (to also cover validate + schema transform)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StandardSchema already has vendor and validate, so it looks like we can look at vendor and isolate the call to validate 👍

Give me more time 🙏

@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.74%. Comparing base (42d9697) to head (f1758fa).
⚠️ Report is 182 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #237      +/-   ##
==========================================
+ Coverage   76.92%   77.74%   +0.82%     
==========================================
  Files           7        5       -2     
  Lines         806      346     -460     
  Branches       80      147      +67     
==========================================
- Hits          620      269     -351     
+ Misses        184       64     -120     
- Partials        2       13      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ysknsid25 ysknsid25 force-pushed the feature/impl-standard-schema branch 2 times, most recently from 9b10eda to cfdf5fa Compare December 8, 2025 12:12
implement validate and transform

Signed-off-by: ysknsid25 <[email protected]>
@ysknsid25 ysknsid25 force-pushed the feature/impl-standard-schema branch from cfdf5fa to f1758fa Compare December 8, 2025 12:27
@ysknsid25
Copy link
Contributor Author

ysknsid25 commented Dec 8, 2025

Hello @pi0 . I have a consultation 🙇

Can you make feature branch for this issue?
I think I must writing test for all library complied Standard Schema, but there are 22 libraries.
In order to decrease your review workload, I think it would be better split sevral branch.

In this branch, write test for Zod and valibot and marge to new feature branch. remaning test code will be written another each branch.

How about? 👀

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.

Support validation

2 participants