-
Notifications
You must be signed in to change notification settings - Fork 405
Description
I am using Pattern Lab Node core v3.0.0-beta.1 & uikit-workshop v1.0.0-beta.0 on Linux, with Node v8.12.0, using a Custom Gulp Edition.
Expected Behavior
When I npm install @pattern-lab/uikit-workshop as a dependency in my project, it should only install its own dependencies that it needs at runtime, not things used for its development.
Actual Behavior
I noticed PhantomJS being downloaded during my project's npm install setup. It's not something I'm using myself and, considering it's a relatively hefty download (~22mb). That feels like it should be a dev dependency (as in, needed if you're contributing to uikit-workshop itself), but not a normal dependency that consumers would need.
Steps to Reproduce
- Make an empty directory
npm init -y(to make a dummypackage.json)npm install @pattern-lab/uikit-workshop
If you now look in node_modules, you'll see a lot of packages there - including phantomjs-prebuilt. Considering the the UI Kit is just meant to be pre-compiled HTML, CSS & JS assets that get copied / served up by Pattern Lab, I'm surprised there are any dependencies at all TBH.
Notes & suggested fix
I did a little digging and it's actually jshint that's at fault. Its current version (2.9.6) has a bug (which they have already fixed and, I assume, will be fixed in a future release). However considering that it's a linting tool I wouldn't expect uikit-workshop to list it as one of its non-dev dependencies.
If, in your package.json you move jshint to the devDependencies, then consumers like me will no longer install it and, by extension, also install PhantomJS. Only developers working directly on uikit-workshop would.
Looking at your package.json, I also noticed thatjshint is additionally listed as a peer dependency? Is this intentional?