Dependencies: component.json and package.json appear to conflict

Dependencies: component.json and package.json appear to conflict

qdwqdw Posts: 2Questions: 0Answers: 0
edited July 2013 in Bug reports
I think I've found a bug in the declaration of dependencies.

In the DataTables-1.9.4.zip distribution, component.json reads

"dependencies": {
"jquery": "~1.8.0"
}

which means you must use 1.8.x (see the spec at http://plugins.jquery.com/docs/package-manifest/ and search for "Tilde Version Ranges").

However, package.json reads

"dependencies": {
"jquery": "1.4 - 1.8"
},

which allows a much wider range of jQuery versions.

Is this indeed a bug? If so, which dependency spec is the correct one?

Thanks!

Replies

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    I think they are both wrong actually... In the 1.10 wip branch ( https://github.com/DataTables/DataTables/tree/1_10_wip ) I've used:`"jquery": ">=1.7"` which I think is more correct (although please correct me if I'm wrong!).

    I've also renamed component.json to bower.json which uses that versioning as well.

    Regards,
    Allan.
  • qdwqdw Posts: 2Questions: 0Answers: 0
    Excellent! Thanks for the info.

    If you want to say "1.8 and up," I think the best way to do it is "jquery": ">=1.8.0". I'm not sure whether "query": ">=1.7" means "1.7.0 and up" or "major versions greater than 1.7" (i.e., 1.8 and up). The spec at http://plugins.jquery.com/docs/package-manifest/ seems ambiguous on that point, and I don't see anything at http://semver.org/ that makes it clear. In any case, I think "jquery": ">=1.8.0" is clearer to a human reader.

    Does that make sense? I'm not an expert; I'm just going by what that spec says.

    Thanks,
    Quinn
  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    I've got to confess that I've found a number of the manifest specs that I've read (if they even exist!) either ambiguous or confusing. I would suspect that 1.8 will match 1.8.0 etc just fine (my own version matching functions do), but I don't see any hard in adding the `.0` . I'll get that done.

    Allan
This discussion has been closed.