Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

@fast-check/vitest cannot be imported in TS node16/nodenext resolution #3718

Closed
jakebailey opened this issue Apr 3, 2023 · 4 comments 路 Fixed by #3721
Closed

@fast-check/vitest cannot be imported in TS node16/nodenext resolution #3718

jakebailey opened this issue Apr 3, 2023 · 4 comments 路 Fixed by #3721

Comments

@jakebailey
Copy link

馃悰 Bug Report

Clear and concise description of the bug.

The lack of types mappings for the ESM exports prevents TS from resolving the package, giving:

Could not find a declaration file for module '@fast-check/vitest'. '.../node_modules/@fast-check/vitest/lib/esm/vitest-fast-check.js' implicitly has an 'any' type.
There are types at '.../node_modules/@fast-check/vitest/lib/vitest-fast-check.d.ts', but this result could not be resolved when respecting package.json "exports". The '@fast-check/vitest' library may need to update its package.json or typings.ts(7016)

To Reproduce

Steps to reproduce:

Create a TS project and set module=node16 in tsconfig. Try to import @fast-check/vitest.

See also: https://arethetypeswrong.github.io/?p=%40fast-check%2Fvitest%400.0.3 and https://publint.dev/@fast-check/vitest@0.0.3

These tools can help to determine if a package is properly typed / configured.

Expected behavior

No error.

Likely, you need types entries for the export maps, as well as d.ts emit for the ESM code (right now it's js emit only?)

Your environment

Packages / Softwares Version(s)
fast-check -
node 19.8.1
TypeScript* 5.0.0

*Only for TypeScript's users

@dubzzz
Copy link
Owner

dubzzz commented Apr 3, 2023

Oups good catch, sorry for the inconvenience. I'll try to send a fix later today.

dubzzz added a commit that referenced this issue Apr 3, 2023
Make sure our packages will be properly published by checking them against publint.

Related to #3718
dubzzz added a commit that referenced this issue Apr 3, 2023
Properly define typings of vitest package.

Fixes #3718
dubzzz added a commit that referenced this issue Apr 3, 2023
* 馃悰(vitest) Proper type declaration

Properly define typings of vitest package.

Fixes #3718

* versions
@dubzzz
Copy link
Owner

dubzzz commented Apr 3, 2023

Version should be released pretty soon on npm. Just waiting GitHub actions to go back to normal.

Job started: https://github.com/dubzzz/fast-check/actions/runs/4600172058

@dubzzz
Copy link
Owner

dubzzz commented Apr 3, 2023

Version published 馃殌

@jakebailey
Copy link
Author

Thanks!

dubzzz added a commit that referenced this issue Apr 4, 2023
* 馃敤 Ensure proper package definition

Make sure our packages will be properly published by checking them against publint.

Related to #3718

* Update package.json

* add back error

* attemp to detect issues

* Update package.json

* Update packages/vitest/package.json

* Update packages/vitest/package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants