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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The type definition index.d.ts does not exist. Create one and try again. #135

Open
iccicci opened this issue Dec 14, 2021 · 6 comments
Open

Comments

@iccicci
Copy link

iccicci commented Dec 14, 2021

Hi all,

my package is written in TypeScript and I create the index.d.ts file only before publishing the package.
It seems that to run tsd I'm forced to run tsc at every change.

Is there a way to test types in index.ts file directly without the need to run tsc before tsd?

Thank you

@hisuwh
Copy link

hisuwh commented Feb 23, 2022

I'm mid installing tsd right now but need this feature so might have to uninstall...

@iccicci
Copy link
Author

iccicci commented Feb 23, 2022

Hi @hisuwh ,

I can suggest you the solution I adopted here:
https://github.com/iccicci/sedentary/blob/master/test/98types.ts

Hope this helps

@thewilkybarkid
Copy link

Related to #132.

@novemberborn
Copy link

TypeScript 4.7 supports export maps, so a type definition no longer has to exist at index.d.ts at all.

@tommy-mitchell
Copy link
Contributor

See #196 for discussion on this.

@ddeltree
Copy link

Same here. Whenever I run npx tsd --files src/**/*.test-d.ts, to run the test files I won't include in the dist folder, I get:

The type definition `./dist/index.d.ts` does not exist at `[...]/dist/index.d.ts`. Is the path correct? Create one and try again.

One workaround is to just create an empty file in dist/index.d.ts:

if [ ! -d dist ]; then mkdir dist; fi && touch dist/index.d.ts && tsd --files src/**/*.test-d.ts

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

No branches or pull requests

6 participants