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

fix: remove TypeScript types from dependencies #439

Merged
merged 1 commit into from
Dec 18, 2019

Conversation

alexlafroscia
Copy link
Contributor

I noticed when installing @percy/agent that my yarn.lock suddenly had some TypeScript definitions in it, despite me not using TypeScript.

I believe that the @types/which package should actually be a devDependency, rather than a dependency. Otherwise, all of your users have to install these type definitions along with your package!

Copy link
Contributor

@Robdel12 Robdel12 left a comment

Choose a reason for hiding this comment

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

Thanks @alexlafroscia!

@Robdel12 Robdel12 merged commit 37bf691 into percy:master Dec 18, 2019
djones pushed a commit that referenced this pull request Dec 18, 2019
## [0.20.6](v0.20.5...v0.20.6) (2019-12-18)

### Bug Fixes

* remove TypeScript types from dependencies ([#439](#439)) ([37bf691](37bf691))
@taion
Copy link

taion commented Dec 19, 2019

TypeScript explicitly encourage listing type definitions for runtime dependencies under dependencies rather than devDependencies, BTW: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#dependencies

The reason being that otherwise consumers of your package who do use TypeScript don't get the type definitions installed, and won't be able to use any types from your dependencies that you expose.

The dependency is essentially "free" for people who don't use TypeScript, as the code ends up just sitting in node_modules not doing anything. It doesn't show up at runtime at all.

wwilsman pushed a commit that referenced this pull request Jan 21, 2020
## [0.20.6](v0.20.5...v0.20.6) (2019-12-18)

### Bug Fixes

* remove TypeScript types from dependencies ([#439](#439)) ([37bf691](37bf691))
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

3 participants