darrachequesne / sync-pom-version Goto Github PK
View Code? Open in Web Editor NEWsync package.json and pom.xml versions
License: MIT License
sync package.json and pom.xml versions
License: MIT License
The version in a pom does not fully adhere to semantic versioning (https://semver.org/) which is required in package.json.
This means there are a lot of pom-versions for which a "trivial" sync between pom and package.json is not possible. The current sync-pom-version may in such cases break the npm build with error message
ERROR: Invalid version: xxxxxx
In general it seems that a valid pom-version is of the form /d+(./d*)?(./d*)?-qualifier, where "qualifier" actually is any valid string.
In order to make the "qualifier" acceptable to semver, I suggest that we apply the following procedure to it:
remove all characters NOT matching reqular expression [0-9A-Za-z-._]
change all characters "_" into dots "."
remove any trailing zeroes immediately following a dot
replace all occurences of multiple consecutive dots "." with a single dot
remove trailing dot (if found)
As a finalizing check for the resulting version, make sure to remove trailing "-" (if present)
example conversions:
1.44.1-SNAPSHOT_0001 converts to 1.44.1-SNAPSHOT.1
2.9-_0 converts to 2.9
A lot of maven projects follow the convention of marking their GA releases as something like "1.2.3.RELEASE". But since this doesn't match any formats specified by semver, it causes the npm build to fail.
Maven allows versioning on two sequence numbers (e.g. 1.1, 1.2 etc.) whereas NPM strictly requires three numbers (1.1.0, 1.2.0, etc.). In these cases, this tool should automatically convert the POM version, adding a ".0" as third sequence number.
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.