Package version numbers highly confusing


#1

The Meteor documentation says:

In general, you must specify a package’s version (e.g., ‘accounts@1.0.0’ to use version 1.0.0 or a higher compatible version (ex: 1.0.1, 1.5.0, etc.) of the accounts package). If you are sourcing core packages from a Meteor release with versionsFrom, you may leave off version names for core packages. You may also specify constraints, such as my:forms@=1.0.0 (this package demands my:forms at 1.0.0 exactly), or my:forms@1.0.0 || =2.0.1 (my:forms at 1.x.y, or exactly 2.0.1).

So just to make sure I understand this:

  • package@1.0.0 matches 1.x.y (so e.g., 1.0.0 and 1.99.999 would both match)
  • package@1.2.0 matches 1.2.y (e.g. 1.2.0 and 1.2.85 match)
  • package@1.2.7 matches exactly version 1.2.7 only
  • package@=1.2.7 - same as above
  • package matches anything? (grabs latest version)

I think the documentation could be a little clearer here.


Would love to see Meteor's package solver given an overhaul
Public release candidate of Meteor 1.2
#2

Did some testing on my own, using aldeed:autoform. Here’s what I turned up:

  • Including the package without a version number installs the very first version (I expected 5.4.0, the latest)
  • Including version 5.0.0 installed 5.0.3 which is the last release before 5.1.x (I expected 5.4.0, the latest)
  • Including version 4.0.3 installed 4.2.2 which is the last release before 5.0.x (I expected 4.0.3)

So this is rather unpredictable IMO. According to the documentation, including version 1.0.0 should match 1.0.1 and 1.5.0, but in fact including version 5.0.0 in this case matches 5.0.x only. But then why would including version 4.0.3 install 4.2.2? If including 5.0.0 wouldn’t go past 5.0.x, why would including 4.0.3 jump all the way to 4.2.2? Including 4.0.0 also installs 4.2.2.

Highly confused. Can anyone shed light on this?


#3

Reviving this thread from the dead. :slight_smile: Anyone care to chime in? A colleague of mine just ran into some confusion with this as well. I really think it needs to be addressed, or at least clarified in the documentation.


#4

Yes, I would like to know. Have you read about Package Gravity ? I thought I knew how it worked at one point but now I’m not sure. And - if you raise the version number of one of your dependencies by a minor version- will it be pulled in if you only increment your version number by a patch release ? Would love a table laid out so dummies like me can understand :smiley: