mirchow / release-version Goto Github PK
View Code? Open in Web Editor NEWAppend pre-release build number to version in node.js package.json projects
License: MIT License
Append pre-release build number to version in node.js package.json projects
License: MIT License
I am using semver-utils in my project and it parses the release name from the semver using -[release] before +[build] which is apparently how the semver spec calls for providing meta information in the version string. See spec item #9 and spec item #10
For example: to have version 2.1.0 have release name "alpha" and build "1337" you would do release-version -b 1337 -r alpha -pre 'build'
which would produce 2.1.0-alpha+build.1337. the semver-utils
parse() method when ran against 2.1.0-alpha+build.1337
would produce
{
semver: '2.1.0-alpha+build.1337'
, version: '2.1.0'
, major: '2'
, minor: '1'
, patch: '0'
, release: 'alpha'
, build: 'build.1337'
}
so essentially, just asking for -r [release name]
option
In my app, I want the build number in the semver format to be just a simple integer, because its being parsed and written as version codes in cordova.
I would love to use your package for managing the build number on TeamCity, however, its forcing me to prefix the build with a '.' character. I am suggesting that if you specify --pre '' (empty string) that it would not add the . separator.
For example:
package.json has 2.1.5, if i run release-version -b 100 --pre ''
I would like to get 2.1.5-100
If passing an empty value to --pre is not favorable, then we could instead do something like --no-prefix as a flag that will not prefix the build number at all.
Let me know what you think, I dont mind submitting a PR as well if its something you want to support.
It seems like the pre/prefix option should be to prefix the pre-release version.
For example, you initially wrote this script so that -b 2 --pre rc would produce x.x.x-rc.2, and now we made it so -r is the option for pre-release version and -b is left for build metadata. The --pre option is still modifying the build meta data, when I think you want it to be for the pre-release version name.
This would mean you would do -r 2 --pre rc to produce x.x.x-rc.2, and additionally, passing -b option would add build meta data as per spec item 10, so that would add +(build) after the -rc.2.
Let me know if you are ok with this and I can submit another PR.
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.