Giter Site home page Giter Site logo

Grunt 0.4 Release about grunt-exec HOT 12 CLOSED

jharding avatar jharding commented on July 20, 2024
Grunt 0.4 Release

from grunt-exec.

Comments (12)

jharding avatar jharding commented on July 20, 2024

Is it recommended that Grunt plugins should add grunt to their peerDependencies?

from grunt-exec.

tkellen avatar tkellen commented on July 20, 2024

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.

jharding avatar jharding commented on July 20, 2024

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.

tkellen avatar tkellen commented on July 20, 2024

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.

cowboy avatar cowboy commented on July 20, 2024

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.

jharding avatar jharding commented on July 20, 2024

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.

domenic avatar domenic commented on July 20, 2024

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.

cowboy avatar cowboy commented on July 20, 2024

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.

domenic avatar domenic commented on July 20, 2024

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.

cowboy avatar cowboy commented on July 20, 2024

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.

domenic avatar domenic commented on July 20, 2024

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.

tkellen avatar tkellen commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.