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: Move mocha-chai-jest-snapshot to be a dev dependency #409

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

csandman
Copy link

@csandman csandman commented Jul 1, 2024

This is a small fix for an issue I've been having for a while installing this package as a dev dependency of my team's app. Every time I do a yarn install in my project, I get a warning about a missing peer dependency of one of this package's dependencies, mocha-chai-jest-snapshot. The fact that this is even considered a dependency and not a dev dependency doesn't really make sense, as it's just a testing library, and all packages that only have to do with testing should not be in the normal dependencies.

So this PR just moves it from being a dependency to a dev dependency. I thought about making an issue for this, but the fix was so straightforward, I figured I'd jus put up a PR instead. Let me know if this works for you!

Here's the actual warning by the way:

Screenshot 2024-07-01 at 2 14 05 PM
warning "@devcycle/cli > mocha-chai-jest-snapshot@1.1.4" has unmet peer dependency "chai@^4.3.6".

To be honest, there are probably a few more packages that should be moved to dev dependencies. Anything that isn't required for the end user to use the package should be in dev dependencies instead of normal dependencies. Otherwise, that's just extra work for the end user's package manager to reconcile package versions for packages they don't even need. For example, I can't imagine why you'd need @babel/parser in a final version. Any package that is only used during build steps should be in dev dependencies.

@@ -1,5 +1,5 @@
{
"version": "5.14.12",
"version": "5.14.13",
Copy link
Author

Choose a reason for hiding this comment

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

This was updated when I ran the build command. Not sure what oclif is used for tbh, but when I ran the tests after making my change, one of them failed because of this version, so I included this in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant