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

TypeScript typings not available in non-Windows dev environments #9

Closed
zenflow opened this issue Mar 31, 2021 · 5 comments
Closed

TypeScript typings not available in non-Windows dev environments #9

zenflow opened this issue Mar 31, 2021 · 5 comments

Comments

@zenflow
Copy link
Owner

zenflow commented Mar 31, 2021

@kazarmy brought this issue up in #8 (comment):

This pr removes the os constraint because the type definitions included in the package are needed for type checking on Linux of multi-platform scripts using it, and removing the os constraint allows installation of the package on Linux without have to use --force.

Maybe this is a situation where the type definitions are better placed on the DefinitelyTyped monorepo?

The reason for the "os" constraint is so that this package and it's dependencies (particularly the huge ffi-napi dependency) don't get installed in environments where they won't be used.

It is an optimization that I would like to keep, since otherwise, it becomes harder to justify using this package in cross-platform packages/programs due to the heavy cost to install size and complexity (ffi-napi is a native Node.js add-on with binaries) in environments that won't even benefit from it.

If we made the ffi-napi package an optional peer dependency, so you would optionally install it alongside this package, then we wouldn't need the "os" constraint, but I don't think that is the best way to go. See #6 (comment)

So yeah, I think DefinitelyTyped is the way to go to get the types available in non-Windows dev environments.

@kazarmy If you or anyone wants to add the type definitions there, that would be awesome

I guess then we could remove them from this package in a new major release

TBH I'm using this package in TS and developing on Linux and I just accepted that I don't have types for these functions. I'm only calling one of the functions, in one place, and not even looking at the result. 😄

@kazarmy
Copy link
Contributor

kazarmy commented Apr 2, 2021

@kazarmy If you or anyone wants to add the type definitions there, that would be awesome

See DefinitelyTyped/DefinitelyTyped#52149. I've put you as one of the co-maintainers.

I guess then we could remove them from this package in a new major release

If you do so, could you just do a point release? Otherwise I'd have to update the typings version on DefinitelyTyped.

zenflow added a commit that referenced this issue Apr 3, 2021
This reverts commit 6c701a2.

BREAKING CHANGE: TS type definitions have been removed

If you need TS types for this package, install the `@types/generate-ctrl-c-event` package.


Related issue: #9
zenflow added a commit that referenced this issue Apr 3, 2021
This reverts commit 6c701a2.

BREAKING CHANGE: TS type definitions have been removed

If you need TS types for this package, install the `@types/generate-ctrl-c-event` package.


Related issue: #9
github-actions bot pushed a commit that referenced this issue Apr 3, 2021
# [2.0.0](v1.2.1...v2.0.0) (2021-04-03)

### Features

* Remove TypeScript type definitions ([#10](#10)) ([0b95798](0b95798)), closes [#9](#9)

### BREAKING CHANGES

* TS type definitions have been removed

If you need TS types for this package, install the `@types/generate-ctrl-c-event` package.
@zenflow
Copy link
Owner Author

zenflow commented Apr 5, 2021

@kazarmy Type definitions have now been removed from this package and published in @types/generate-ctrl-c-event.
If you can confirm everything is now working as expected, we can close this issue.

@kazarmy
Copy link
Contributor

kazarmy commented Apr 6, 2021

Yes, everything works as expected. Thanks for the help!

@zenflow zenflow closed this as completed Apr 6, 2021
@zenflow
Copy link
Owner Author

zenflow commented Apr 6, 2021

@kazarmy No problem! Give the project a star if you like it ;D

@kazarmy
Copy link
Contributor

kazarmy commented Apr 6, 2021

Done! 😄

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

2 participants