Comments (12)
Is it recommended that Grunt plugins should add grunt
to their peerDependencies
?
from grunt-exec.
No. The version of Grunt calling the task is passed directly into the exported module function so it wouldn't work anyway :(. We're addressing our dependency nightmare with node-task.
from grunt-exec.
If a project's package.json contained:
"devDependencies": {
"grunt": "0.3",
"grunt-exec": "0.4"
}
and the package.json for grunt-exec contained:
"peerDependencies": {
"grunt": "0.4"
}
it's my understanding that npm would throw an error based on this post. This behavior wouldn't be a silver bullet for dealing with the "dependency nightmare", but it'd help.
from grunt-exec.
Ah of course. You're right. I suppose it can't hurt to do this, but we haven't recommended it (yet). @cowboy, what do you think?
from grunt-exec.
I'm hesitant to make a change like this literally 2 days before a major release. I need to be convinced that this is going to work and it's going to need to be thoroughly tested before we can go with it. Especially because I don't quite understand the implications of this change.
from grunt-exec.
Not sure if you saw this tweet from @domenic, but he championed peerDependencies
and I'm sure he could help answer any questions you have about it.
from grunt-exec.
It should probably also be in devDependencies, assuming you run your tests using a real version of grunt instead of a stub. But yes, only peerDependencies will give you the error message you'd want for incompatible versions.
from grunt-exec.
What's the error message we'd want? Can you give me an example of incompatible versions?
I read the post but unfortunately it didn't quite click in my brain.
from grunt-exec.
If you had [email protected]
+ an incompatible [email protected]
in your package.json, t'd be something like:
npm ERR! peerinvalid The package grunt does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants [email protected]
or if there were two conflicting requirements,
npm ERR! peerinvalid The package grunt does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants [email protected]
npm ERR! peerinvalid Peer [email protected] wants [email protected]
from grunt-exec.
So this wouldn't help users of already-published 0.3 plugins and grunt 0.4, but it would help users of newly-published plugins that specify "peerDependencies: {"grunt": "~0.4.0"}
with grunt versions other than 0.4.x?
from grunt-exec.
Yeah, pretty much. I guess if there were 0.3 plugin authors who had no intention of ever moving to 0.4, they could publish an new version indicating that (with "peerDependencies": { "grunt": "~0.3.0"}
).
"peerDependencies": { "grunt": "~0.4.0" }
would have two benefits:
- Prevent installation next to grunt 0.3, as a way of signaling usage of new grunt 0.4 features
- Prevent installation next to grunt 0.5 (etc.), since they probably haven't tested against that.
Furthermore, if you add more features in the 0.4.x timeframe, e.g. you add a new grunt.doAwesomeStuff
in 0.4.2, then people could do "peerDependencies": { "grunt": "~0.4.2" }
to indicate they use grunt.doAwesomeStuff
and thus work well with grunt 0.4.2, 0.4.3, etc. but not 0.4.0 or 0.4.1.
from grunt-exec.
Just FYI, we added peerDependencies on all of the grunt-contrib plugins, and we'll be recommending it officially soon. Thanks for bringing it up Jake!
from grunt-exec.
Related Issues (20)
- exec failed to execute rpmbuild but the commands succeeds if run directly HOT 3
- Use a function to set the cwd HOT 2
- Do not execute Multiple cmd HOT 6
- If child is killed, task output should show the kill signal, not 'exited with 0' HOT 1
- Command working on shell but not with grunt-exec HOT 2
- Update Grunt dependency HOT 14
- Better error message when exceeding maxBuffer size HOT 5
- Document how to run multiple commands
- Support an array of commands to execute HOT 1
- Success after maxBuffer size is reached HOT 1
- Allow to pass function for cwd parameter HOT 1
- Unix combine commands with && does not work HOT 4
- What is detached mode? HOT 5
- WINDOWS REGRESSION: command with double-quotes cannot be executed HOT 6
- Redirecting command output to a file does not work ( using >> or > ) HOT 1
- Provide a changelog for 2.0.0 HOT 4
- Cannot perform command with quotes HOT 5
- stdin not work with inquirer HOT 1
- rsync with sshpass HOT 1
- $PATH with grunt exec HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-exec.