-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 "grunt-cli" package to "devDependencies" at package.json #2950
Conversation
…ve to install grunt globally to run tests
I feel like it also allows us to remove this line: https://github.com/less/less.js/blob/3.x/.travis.yml#L22 |
grunt-cli is meant to be installed globally. From my understanding: What grunt-cli does is add a grunt wrapper executable to the PATH. but this executable is just a wrapper, which seeks the specific executable for the specific project. This means you can have many versions of grunt in different projects on the same machine So if my understand is correct, adding the wrapper to a specific project (not globally) makes little sense. as if it is not installed globally it won't be added to the global PATH. |
@bd82 There are two ways you can think about it:
My point is that it's not really kind to make your contributors install any global packages in order to make contributions. Should agree It's not that bad with |
This Does not work for me. Afaik you must have the command you are trying to run listed in the package.json under the scripts section for npm run, which makes this a lot less convenient. Anyway, I just checked and realized that But to make it more useful I think the common development workflow items will have to be wrapped in npm scripts currently I only see an npm test script. in the package.json or does "npm test" cover most development workflows for Less.js? |
You can checkout my repo, run
We can always provide an NPM-way to run local
Then run
Well, I don't think I can answer this question precisely right now. However, as far as I understand, you don't always need to run the whole Anyway, applying this changes would satisfy both those who don't care about installing global modules and those who really do (like me). Even after these changes nothing stops you from using your own globally installed |
The trick with wrapping grunt in an npm script and passing additional argument looks nice. I will try it out later. |
I decided to make that alias as well. |
@bd82 Any updates on this. What do core guys think? @matthew-dean |
Hmm... Maybe it's alright to have as a devDependency, but then you'd need to update Contributing docs to make sure it's clear how to run all the grunt tasks when Which ALSO means that we have to maintain both the Grunt task list and make sure those are all mirrored in the NPM "scripts" key. So.... I dunno.... Seems like it could cause an additional maintenance burden, while running Grunt and Gulp as globals is pretty standard practice. I agree it's nice if packages don't require global modules, but in this case there's a lot more work that you probably haven't factored in than simply adding a devDependency. Such as: many of the Grunt tasks are actually added programmatically. You can't add NPM script tasks programmatically (and I don't know that you can send parameters to them?), so I don't even think parity with the current Gruntfile is even possible. |
@matthew-dean Thanks for your thoughts. It seems to me that you could get my proposal all wrong.
I addressed this above, such as here: #2950 (comment). I'm totally not suggesting maintaining both Grunt and NPM scripts. It would indeed be a burden. No, Grunt is the king here and NPM would be just a "proxy". I just wanted to elaborate on the fact that, when you have Thus, you don't need to replicate all the Grunt commands in the Moreover, you still can run |
@kirillrogovoy Okay, I didn't know you could send params to NPM scripts. Can you open a PR for updating the Contributing in Less docs that reflects these changes? When that's done I'll merge both. |
Done. Updated |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Please, don't! Merciless can. |
Sorry, I missed this. |
So contibutors don't have to install grunt globally to run tests which is a good tone.