Files
meteor/packages/package-version-parser/package.js
David Greenspan 259f90bc5a Make PVP able to parse a version (and work on client)
Despite the name “package-version-parser,” PVP didn’t really provide a way to parse a package version.  With this change, if you want to get the minor version of “1.2.3_4”, for example, you can just write `PV.parse(“1.2.3_4”).minor`.  This simplifies the internals of PVP as well.

When you parse a version, you now get an instance of PackageVersion with a documented set of fields.

Also, make PVP work on the client.  When called directly from the tool, semver is loaded the same way as before.  When PVP is used as a package, it uses a copy of semver v4.1.0 kept inside the package.

This change is intended to be 100% behavior-preserving.
2015-01-07 15:17:30 -08:00

18 lines
422 B
JavaScript

Package.describe({
summary: "Parses Meteor Smart Package version strings",
version: "2.0.3"
});
Package.onUse(function (api) {
api.export('PackageVersion');
api.use('underscore');
api.addFiles(['semver410.js',
'package-version-parser.js']);
});
Package.onTest(function (api) {
api.use('package-version-parser');
api.use(['tinytest']);
api.addFiles('package-version-parser-tests.js');
});