Giter Club home page Giter Club logo

sync-pom-version's People

Contributors

alessandroguarascio avatar darrachequesne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sync-pom-version's Issues

Implement support for converting pom version to proper semantic versioning

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:

  1. remove all characters NOT matching reqular expression [0-9A-Za-z-._]

  2. change all characters "_" into dots "."

  3. remove any trailing zeroes immediately following a dot

  4. replace all occurences of multiple consecutive dots "." with a single dot

  5. remove trailing dot (if found)

  6. 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

Support conversion on three sequence numbers

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.