Skip to content

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

Merged
simoneb merged 9 commits into
nearform:masterfrom
Puppo:refactor/migrate-tsd-to-tstyche
May 18, 2026
Merged

refactor(types): migrate from tsd to tstyche#473
simoneb merged 9 commits into
nearform:masterfrom
Puppo:refactor/migrate-tsd-to-tstyche

Conversation

@Puppo

@Puppo Puppo commented May 14, 2026

Copy link
Copy Markdown
Contributor
  • Replace tsd with tstyche for type testing
  • Update test:types script to use tstyche
  • Convert initialization.test-d.ts to initialization.tst.ts
  • Update index.d.ts to use ES module export syntax

PR of Reference:

@github-actions

Copy link
Copy Markdown

No linked issues found. Please add the corresponding issues in the pull request description.
Use GitHub automation to close the issue when a PR is merged

@Puppo Puppo marked this pull request as ready for review May 15, 2026 05:38
Comment thread test/types/initialization.tst.ts Outdated
Comment thread test/types/initialization.tst.ts Outdated
@Puppo Puppo requested a review from mrazauskas May 15, 2026 07:13
Comment thread test/types/initialization.tst.ts Outdated
Comment thread test/types/initialization.tst.ts Outdated
@Puppo Puppo requested a review from mrazauskas May 15, 2026 08:25
@mrazauskas

Copy link
Copy Markdown
Contributor

lgtm

Comment thread package.json Outdated
"lint": "eslint .",
"test": "c8 node --test && npm run test:types",
"test:types": "tsd",
"test": "c8 node --test test/index.test.js && npm run test:types",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I reviewed it. But it is required; otherwise, the test runner also runs the .tst.ts file.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

oh but is it a problem with the test runner or with our file naming then? I think we should try to leverage as much as possible what comes with Node's test runner, and adapt the rest of our code accordingly, assuming there's a cleaner way to do this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@simoneb I aligned the types with the other Fastify plugin.
fastify-jwt
fast-json-stringify-compiler

Now the types and their tests are inside the types folder.
By doing so, the test runner works again without options

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like this solution better 👌

@Puppo Puppo force-pushed the refactor/migrate-tsd-to-tstyche branch from cc886a6 to 8e83eda Compare May 18, 2026 15:56
@Puppo Puppo requested a review from simoneb May 18, 2026 16:17
@Puppo Puppo force-pushed the refactor/migrate-tsd-to-tstyche branch from 0a41bcf to 6da51bb Compare May 18, 2026 19:00
Puppo and others added 8 commits May 18, 2026 21:01
- Replace tsd with tstyche for type testing
- Update test:types script to use tstyche
- Convert initialization.test-d.ts to initialization.tst.ts
- Update index.d.ts to use ES module export syntax

PR of Reference:
  - fastify/fastify#6532
  - fastify/fastify#6525
Co-authored-by: Tom Mrazauskas <tom@mrazauskas.de>
Co-authored-by: Tom Mrazauskas <tom@mrazauskas.de>
@Puppo Puppo force-pushed the refactor/migrate-tsd-to-tstyche branch from 6da51bb to 3bae89a Compare May 18, 2026 19:02
@Puppo Puppo force-pushed the refactor/migrate-tsd-to-tstyche branch from 3bae89a to 9892727 Compare May 18, 2026 19:03
@simoneb simoneb merged commit 78cbbe5 into nearform:master May 18, 2026
4 of 5 checks passed
@simoneb simoneb deployed to production May 18, 2026 21:24 — with GitHub Actions Active
@github-actions github-actions Bot mentioned this pull request May 19, 2026
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