npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

entro-version

v3.0.0

Published

A CLI to help with git-flow releases and other version related functions

Downloads

292

Readme

entro-version

oclif Version Downloads/week License

It's a bit annoying when you use git-flow and commit-and-tag-version in the same project because you want to know the version before you create the release branch. So you need to run commit-and-tag-version as a dry run to get that to make the release. You also need to ensure that the release itself has the correct changes and tag so that the changelog gets generated correctly.

This CLI was made with the intention to combine them both together so that you can have proper git-flow releases while using commit-and-tag-version to generate the version and changelog. You can use it in it's simplest form by running entro-version on the develop branch, or you can make it more complicated by adding release hooks. For instance, if you need to generate some .yaml files with the new version number or something like that, then you'd run a post-hook where it'll create the .yaml files and commit them before completing the release. I'm using this CLI to run releases for this CLI :P So check after v1.2.11 in the changelog for a working example... It took me that long to get this working :P!

Each time I make a change and I'm ready for a release, I run npm run release which in turn runs:

./bin/run --during-release-post-hook="npm publish && git commit -am 'Updated the readme'"

Installation Instructions

The easiest way to use this is to include it as a dev dependency or to install it globally. Assuming you've installed it globally:

npm install -g entro-version

You would now be able to use it in a git-flow context. So you can cd into your repo and simply run entro-version to release a new version. To get some examples of how the CLI can be used, run:

entro-version help

The default command that runs is:

entro-version release

But there are other commands to help with versioning that you'll see when you run help. The --help command will show help for the release command because that's the default.

Some Handy Examples

Below are a few real world examples that may help you determine how to use this in your project.

Handlebars Templates

Let's assume you use entro-ci which allows you to compile Handlebars templates using the version of the repo. In this case, you could trigger the creation of the templates within the git-flow release using the following in your package.json:

{
  "scripts": {
    "release": "entro-version --during-release-post-hook=\"entro-ci templates:update && git commit -am 'Updated the templates'\""
  }
}

NPM Package Publishing

Maybe, like this package, you want to publish this to https://npmjs.com. In that case, you could trigger the publish during the release by adding the following to your package.json:

{
  "scripts": {
    "release": "entro-version --during-release-post-hook=\"npm publish && git commit -am 'Updated the readme'\""
  }
}

Usage

$ npm install -g entro-version
$ entro-version COMMAND
running command...
$ entro-version (--version)
entro-version/3.0.0 linux-x64 node-v16.15.0
$ entro-version --help [COMMAND]
USAGE
  $ entro-version COMMAND
...

Commands

entro-version help [COMMAND]

Display help for entro-version.

USAGE
  $ entro-version help [COMMAND] [-n]

ARGUMENTS
  COMMAND  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for entro-version.

See code: @oclif/plugin-help

entro-version release

Creates a release using git-flow

USAGE
  $ entro-version release [-p <value>] [-P <value>] [-s] [-f <value>] [-M <value>] [-d <value>] [-p] [-m
    <value>] [-b <value>] [-B]

FLAGS
  -B, --skip-base-branch-merge-to-develop       If the --base-branch option is specified, it will automatically merge
                                                into develop after the release is completed. If you would like to skip
                                                this merge then use this flag. This might be useful if you want to
                                                create a release on a staging branch or something to that effect.
  -M, --main-branch-name=<value>                [default: master] The name of the master branch
  -P, --during-release-post-hook=<value>        Any commands to run during the release, after standard-version
  -b, --base-branch=<value>                     If the release must be generated from any branch other than develop (eg.
                                                master) then you would specify this base branch. Leave this empty if
                                                there it is not required.
  -d, --develop-branch-name=<value>             [default: develop] The name of the develop branch
  -f, --commit-and-tag-version-flag=<value>...  [default: ] Flags to add to the commit-and-tag-version command
  -m, --release-message=<value>                 [default: Merging release] The description that you would like to give
                                                your release (this shows up on the releases page in Github). This also
                                                replaces {{version}} with the newly created version if you want to
                                                include that in your message.
  -p, --during-release-pre-hook=<value>         Any commands to run during the release, before standard-version
  -p, --no-push                                 Do not push the develop and master branches (with --follow-tags) during
                                                the release
  -s, --no-sign                                 Do not sign during the release using your GPG key

DESCRIPTION
  Creates a release using git-flow

EXAMPLES
  $ entro-version release

  $ entro-version release --during-release-post-hook="npm run publish && git commit -am 'Updated the readme'"

  $ entro-version release --commit-and-tag-version-flag="--prerelease='alpha'"

  $ entro-version release --commit-and-tag-version-flag="--release-as=major"

See code: dist/commands/release.ts

entro-version version:get

Retrieves the current version of the project

USAGE
  $ entro-version version:get [-i <value>] [-k <value>] [-P <value>]

FLAGS
  -P, --prefix=<value>  The version prefix to add (eg. "v")
  -i, --input=<value>   [default: ./package.json] The path to the JSON file to use to retrieve the version
  -k, --key=<value>     [default: version] The key in the JSON file that holds the version

DESCRIPTION
  Retrieves the current version of the project

EXAMPLES
  $ entro-version version:get

  $ entro-version version:get --input="./src/my-proj/package.json"

  $ entro-version version:get --input="./src/version.json" --key="ver"

  $ entro-version version:get --prefix="v"

  $ entro-version version:get --prefix="staging-v"

See code: dist/commands/version/get.ts

entro-version version:next

Returns what the next version would be

USAGE
  $ entro-version version:next [-f <value>] [-P <value>]

FLAGS
  -P, --prefix=<value>                          The version prefix to add (eg. "v")
  -f, --commit-and-tag-version-flag=<value>...  [default: ] Flags to add to the commit-and-tag-version command

DESCRIPTION
  Returns what the next version would be

EXAMPLES
  $ entro-version version:next

  $ entro-version version:next --commit-and-tag-version-flag="--release-as=major"

  $ entro-version version:next --prefix=v

See code: dist/commands/version/next.ts