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

Upcoming changes to npm / node-semver #1186

Closed
jamesplease opened this issue Jul 25, 2014 · 6 comments
Closed

Upcoming changes to npm / node-semver #1186

jamesplease opened this issue Jul 25, 2014 · 6 comments
Milestone

Comments

@jamesplease
Copy link
Member

There are two changes coming to npm that may require some changes in the way we specify grunt dependencies.

The first is the removal of peerDependencies. As you might already know, Grunt plugins typically specify their relationship to Grunt itself as a peerDep, so we'll need to figure out their new relationship.

The second change is an update to the behavior of the caret operator. Depending on our decision above we might also want to change this.

Regarding peerDependencies, we have at least three options:

  1. Remove grunt from the dependencies altogether.
  2. Add it to dependencies.
  3. Add it to devDepedencies.

I'm not entirely confident with my understanding of the consequences of each of these choices, so I'm can't offer my opinion on which of these I think would be best.

Regarding the caret change:

The new behavior locks ^0.4.0 into 0.4.0 only, whereas it used to be equal to 0.4.x. So, if we'd like to continue having that same functionality as before, then I'd suggest we use 0.4.x. A similar alternative is ~0.4.0, which differs in that it also pulls in prereleases.

@jamesplease jamesplease changed the title Upcoming changes to npm / semver Upcoming changes to npm / node-semver Jul 25, 2014
@cowboy
Copy link
Member

cowboy commented Jul 25, 2014

Note that http://gruntjs.com/plugins currently uses peerDependencies to be able to display the version of Grunt there.

Are we using it, internally, anywhere else?

@tkellen
Copy link
Member

tkellen commented Jul 25, 2014

We use it to display the expected grunt version when dynamically building READMEs.

@shama
Copy link
Member

shama commented Jul 25, 2014

I think we should either remove it from peerDependencies or keep it and write a script to notify users of incompatible versions (maybe even part of grunt-cli).

Since only 1 instance of Grunt runs per Gruntfile adding to dependencies or devDependencies won't help. The user must install only one version of Grunt per project.

Creating a script that each of the contrib plugins runs upon install to notify the user of a possible incompatibility seems like the best approach, IMO. I wrote a proof of concept here: https://github.com/shama/peerdep

@shama
Copy link
Member

shama commented Jul 27, 2014

As for the versioning, I think we should be super explicit and change ^0.5.0 to >=0.5.0 <0.6.0-0 to prevent future breaking changes. Here is library to help: https://github.com/rvagg/npm-explicit-deps

@vladikoff vladikoff modified the milestones: rc1, 0.4.6 Jan 19, 2016
@shama
Copy link
Member

shama commented Jan 20, 2016

Noting that the change in behavior of the caret operator was reverted: npm/node-semver@107ed7b

@shama
Copy link
Member

shama commented Jan 20, 2016

With that this can now be closed as we have an issue opened already for handling peer dependencies: #1116

@shama shama closed this as completed Jan 20, 2016
@vladikoff vladikoff removed the ready label Jan 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants