Skip to content

refactor(types): migrate from tsd to tstyche#294

Merged
Tony133 merged 7 commits into
fastify:mainfrom
Puppo:chore/tstyche-migration
May 7, 2026
Merged

refactor(types): migrate from tsd to tstyche#294
Tony133 merged 7 commits into
fastify:mainfrom
Puppo:chore/tstyche-migration

Conversation

@Puppo
Copy link
Copy Markdown
Contributor

@Puppo Puppo commented May 6, 2026

  • Replace tsd dependency with tstyche
  • Create tsconfig.json with node16 module resolution
  • Rename type test file from .test-d.ts to .tst.ts
  • Add explicit tstyche type assertions

PR of Reference:

Checklist

Puppo added 4 commits May 6, 2026 17:29
- Replace tsd dependency with tstyche
- Create tsconfig.json with node16 module resolution
- Rename type test file from .test-d.ts to .tst.ts
- Add explicit tstyche type assertions
- Add 82 type assertions covering all schema types
- Test BaseSchema properties: id, title, description, required, isFluentSchema, etc.
- Test StringSchema methods: minLength, maxLength, format, pattern, etc.
- Test NumberSchema/IntegerSchema methods: minimum, maximum, multipleOf, etc.
- Test ArraySchema methods: items, contains, uniqueItems, minItems, etc.
- Test ObjectSchema methods: prop, definition, extend, only, without, etc.
- Test FORMATS enum values
- Test FluentSchemaError type
- Test MixedSchema combined types
- Migrate from tsd to tstyche
- Add 42 type assertions to existing code examples
- Verify methods exist on schema objects using toHaveProperty
- Test FluentSchemaError instanceof type
@Puppo Puppo marked this pull request as ready for review May 6, 2026 18:01
@Fdawgs Fdawgs changed the title chore: migrate from tsd to tstyche refactor(types): migrate from tsd to tstyche May 6, 2026
@Fdawgs Fdawgs requested a review from Tony133 May 6, 2026 18:22
Comment thread package.json Outdated
- Update tstyche from 1.0.0 to 7.1.0
- Update assertions to use toBe instead of toEqual
Copy link
Copy Markdown
Member

@Tony133 Tony133 left a comment

Choose a reason for hiding this comment

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

My only doubt is the console.log() statements in the FluentJSONSchema.tst.ts file: maybe we could remove them. I'm waiting for the final review from @mrazauskas. Otherwise, LGTM! 🔥 🚀

@Tony133 Tony133 requested a review from mrazauskas May 6, 2026 20:37
@Puppo
Copy link
Copy Markdown
Contributor Author

Puppo commented May 7, 2026

My only doubt is the console.log() statements in the FluentJSONSchema.tst.ts file: maybe we could remove them. I'm waiting for the final review from @mrazauskas. Otherwise, LGTM! 🔥 🚀

I had the same doubt! But I preferred to take them just so as not to change the file too much.

Comment thread types/FluentJSONSchema.tst.ts Outdated
Comment thread types/FluentJSONSchema.tst.ts Outdated
Comment thread tsconfig.json Outdated
@Puppo Puppo requested review from Tony133 and mrazauskas May 7, 2026 11:37
@mrazauskas
Copy link
Copy Markdown

lgtm

@Tony133 Tony133 merged commit 7871bb8 into fastify:main May 7, 2026
14 checks passed
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.

3 participants