GithubHelp home page GithubHelp logo

kekavc24 / magical_version_bump Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 233 KB

Command-line tool that helps devs modify/change nodes in a yaml/json file.

Home Page: https://pub.dev/packages/magical_version_bump

License: BSD 3-Clause "New" or "Revised" License

Dart 100.00%
cli dart

magical_version_bump's People

Contributors

dependabot[bot] avatar kavisi-bot avatar kekavc24 avatar

Watchers

 avatar

magical_version_bump's Issues

feat: extend json and yaml support

Description

Partial support for JSON was added after #28 was closed. However, key differences and similarities exist in both, with each having its strengths. It would be great to extend and support that

Requirements

  {
      "key" : [ "normal", ["nested"] ]
  }
 {
      "key" : [  "normal value", {"nested" : "map"}, "another value" ]
  }

In Yaml, a nested list would need to be linked to another key. So any list would technically be incorporated to the nearest key.

key:
    - normal value
    
     # a nested map in list in yaml
    - nested: map
      another key: value

    - another value
    
    # a nested list linked to a key
    - nested-list:
        - nested value
        - another value

Preset only version

As I made changes that will reflect once #13 is merged, I was at a crossroad before settling on the default behavior. Currently (starting from v0.5.0 ), when you do:

mag modify --set-version=1.1.1 --set-prelease=foo --set-build=bar --bump --major

# Or

mag modify --preset --set-version=1.1.1 --set-prelease=foo --set-build=bar --bump --major

Results in the same behavior. This because --set-version defaults --preset to always true. Thus, version , prerelease and build if passed will be preset before version is bumped.

However, doing:

mag modify --set-prelease=foo --set-build=bar --bump --major

Only sets the prerelease and build after the current version 's major version in yaml has been bumped.

The crossroad then was:

  • preset should preset the value before bumping. Part of the default behavior.
  • set-version should only preset the version if preset is not specified. Thus:
mag modify --set-version=1.1.1 --set-prelease=foo --set-build=bar --bump --major

Only presets version and adds prelease and build metadata after the major version has been bumped up.

fix: never keeps custom build info by default

Description

Consider the version 2.3.4+myCustomBuild. If you were to do:

# -b is just shorthand for bump
mag modify -b major

The bumped version would be 3.0.0 and the build metadata would be removed since it doesn’t check.

Expected Behavior

The tool should keep the custom build metadata. Optionally, should warn if user is attempting to bump the build number of custom build metadata.

feat: add json support

Description

This implementation is fairly straightforward. Currently, tool does great as the file is read as a string.

The issue comes in when saving it back to the json file. The version is formatted by the yamEdit package I use to edit nodes.

feat: add support for calVer

Description

In addition to supporting semVer, it would be great to support calVer ?

Requirements

  • Add calVer support to modify command

Additional Context
Although semVer is great and recommended by Flutter/Dart team, it would be great to support calVer too. I noticed a vocal minority saying they love calVer too.

Plus it's awesome to include everyone 😃

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.