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

Add TypeScript types to release #218

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

Juice10
Copy link

@Juice10 Juice10 commented Jan 4, 2022

Adds typescript types to the release to make it much easier for people to use Spector.js with typescript

Docs on the subject:
https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html

@Juice10 Juice10 changed the title Add typescript types to release Add TypeScript types to release Jan 4, 2022
@Juice10
Copy link
Author

Juice10 commented Jan 4, 2022

Looks like we need to do one more step to get this working correctly.

Currently I'm getting the following error when importing this project into a typescript file:
File '.../node_modules/spectorjs/dist/spector.d.ts' is not a module

@RaananW
Copy link
Member

RaananW commented Jan 5, 2022

That's because the declaration file is namespace-based and not module-based. It needs to be changed (regenerated) to support modules

@wdanilo
Copy link

wdanilo commented Jan 23, 2023

FYI, you can use tsup to generate type declarations for a bundle.

@sebavan sebavan marked this pull request as draft August 30, 2023 21:49
@nerdError
Copy link

Any updates?

@sebavan
Copy link
Member

sebavan commented Oct 5, 2023

last I tried tsup was not generating the bundled typings correctly :-( Would really appreciate a contrib on this subject

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.

None yet

5 participants