yuchi / java-npm-semver Goto Github PK
View Code? Open in Web Editor NEWImplementation of the SemVer Specification — strictly follows npm semantics
License: GNU Lesser General Public License v2.1
Implementation of the SemVer Specification — strictly follows npm semantics
License: GNU Lesser General Public License v2.1
It is not uncommon to attach timestamps to the "prerelease" part of package version strings. Here is an example -- https://registry.npmjs.org/puppeteer/1.3.0-next.1524774887046
The timestamp is in the unit of microsecond, and hence exceeds the boundary of Integer.MAX_VALUE
. Feeding the above example into Version.from()
results in this exception:
Caused by: java.lang.NumberFormatException: For input string: "1524774887046"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:583)
at java.lang.Integer.parseInt(Integer.java:615)
at com.github.yuchi.semver.Version.<init>(Version.java:81)
at com.github.yuchi.semver.Version.<init>(Version.java:32)
Using Long
may solve the issue. Or all numeric parts in a version string should stay in string data type.
Hi,
congrats, after trying various java implementations of semver (and even considering to implement it myself) I found your work. Its the best and most solid implementation by a margin !
I'd like to include this as a dependency with one of my OS work (kontraktor-http). This includes a NPM clone written in java (i'm doing bundling + minification + react-jsx transpilation completely in java, so I don't want force users to install node just to be able to have a ´npm i install react react-dom´).
However LGPL disallows bundling inside a single artifact, so I'd need a artifact on maven.org. I could do this however it would be listed as "de.ruedigermoeller" ..
Hello! I stumbled upon this great project today, and was wondering if functionality to increment the semantic version was planned? I understand this isn't a new project, but was just curious.
From npm-semver (commandline utility usage section):
https://docs.npmjs.com/misc/semver#usage
-i --increment [<level>]
Increment a version by the specified level. Level can
be one of: major, minor, patch, premajor, preminor,
prepatch, or prerelease. Default level is 'patch'.
Only one version may be specified.
--preid <identifier>
Identifier to be used to prefix premajor, preminor,
prepatch or prerelease version increments.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.