Comments (7)
Hey
from node-calver.
Hey, sounds great 🙌🏼
Right, so this is probably a hybrid of some sort, between pre-release denotation and build-identifiers. I guess both could be implemented but perhaps start with build-ids.
I totally agree with keeping the the dep-free policy
I have just scrolled through the code briefly but as a first iteration the string could be passed as a config param, like you suggest.
In the meantime, I created this wrapper
https://github.com/busla/calver-ci
from node-calver.
Looking good!
Here is how it could work: An identifier
property could be specified under options argument. If I set it to true
, library generates the identifier. if i set it to a string, library directly chose that string as identifier by applying some validation like [a-z0-9A-Z_\-]
.
calver.inc(format, '2021.1.1.0', 'minor', { identifier: true })
// or
calver.inc(format, '2021.1.1.0', 'minor', { identifier: 'my-identifier' })
What do you think?
from node-calver.
That would fit the requirements. I guess the identifier would mostly be used as a passthrough from the build services but I'm sure that there are scenarios where you just want it to be generated.
Perhaps instead of boolean, a configuration object could be passed so the user can compose the identifer using known properties within the enviroment (e.g. git). That would also allow for other configs, like separator
.
Example:
const options = {
separator: '-',
attributes: [
{
commitSha: {
length: 7,
},
},
{
commitBranch: {
maxLength: 10,
},
},
{
commitAuthor: {
maxLength: 10,
},
},
{
random: {
maxLength: 15,
},
},
],
};
from node-calver.
a simpler approach would be to offer templates for common providers, e.g. Github, Gitlab, since we have access to loads env variables already in the pipelines.
from node-calver.
And those templates could be like { identifier: "[branch][hash:16]" }
because some of us are already familiar with this approach:
https://github.com/webpack/loader-utils#interpolatename
All of the above makes sense! I think we can start with { identifier: "my-identifier" }
(which I think is what you need primarily) and then expand it later to cover object type options. I would like to leave this issue open for future opinions. Send a PR please if you have time.
from node-calver.
ahh!
even better to use something conventional
will create a PR soon.
from node-calver.
Related Issues (9)
- separators and modifiers HOT 2
- Do you have a plan to support timezone? HOT 4
- Behaviour of the 'micro' inc function HOT 17
- Modifier gets set to -1 when bumping calendar and minor for a previous month version. HOT 1
- Level 2 semantic tags are incremented incorrectly for pre-releases
- Reset increments HOT 8
- inc behavior unclear HOT 6
- Semantic calendar bumps aren't working HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-calver.