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

@henriquehbr/tagit

v0.6.0

Published

A git tag bumper that strictly follows semver

Downloads

34

Readme

tagit

A git tag bumper that strictly follows semver

Summary

Installation

You can use your package manager of choice (npm, yarn or pnpm), but in this example i'll be using pnpm:

pnpm i -g @henriquehbr/tagit

Usage

Usage: tagit [options] <version>
A git tag bumper that strictly follows semver

Options:
-p <alpha|beta|rc|stable>
        Create a pre-release using any of the valid identifiers
        (note: "stable" is used when leaving from pre-release versions to a official release)
-f, --force-version <version>
        Use the specified version on the release
-v, --version
        Displays the current version of tagit
-h
        Displays help about using this command

Using tagit through Docker

In order to make a release on your project, run:

docker run \
    --rm \
    -t \
    -v $(PWD):/repo \
    -e GIT_NAME="$(git config user.name)" \
	-e GIT_EMAIL="$(git config user.email)" \
    henriquehbr/tagit:latest

Your Git name and email are required in order to make the release commit

Passing arguments to tagit

When using this method, the positional parameters passed at the end of the docker run command will be received by the release script inside the container, in order to pass parameters directly to the tagit CLI, you must assign them to the TAGIT_FLAGS environment variable, like on the example below:

docker run \
    --rm \
    -t \
    -v $(PWD):/repo \
    -e GIT_NAME="$(git config user.name)" \
	-e GIT_EMAIL="$(git config user.email)" \
    -e TAGIT_FLAGS="-p beta" \
    henriquehbr/tagit:latest

The command above simply instructs tagit to use beta as it's pre-release identifier

Using callback scripts

If your project requires an extra action before the release, for example, bumping the version on a version.txt file, you can create a callback script for that, example below:

#!/bin/sh

version=$1

echo "$version" > version.txt

The new version is passed as the first parameter to the script ($1)

After that, remember to mark the callback script as executable, and specify it as a parameter when running the tagit container:

docker run \
    --rm \
    -t \
    -v $(PWD):/repo \
    -e GIT_NAME="$(git config user.name)" \
    -e GIT_EMAIL="$(git config user.email)" \
    henriquehbr/tagit:latest \
    ./before-release

If the callback script is not available on your repository like on the example above, you can make it available through Docker mounted volumes

Customizing Docker image

By default, the henriquehbr/tagit Docker image available on Docker Hub only comes with a bare minimum set of tools required to make a release, those being:

  • nodejs - to run tagit
  • git - to make the release commits
  • git-cliff - to generate changelogs

That means if you need anything else like npm for bumping the version field of package.json on your callback release script (assuming you're working on a Node.js project, for example) you'll need to extend the Docker image to include the packages and binaries for your specific use case

The example below shows a Dockerfile that extends henriquehbr/tagit and installs npm over it:

FROM henriquehbr/tagit:latest

USER root

RUN apk add --no-cache npm

USER tagit

Remember that it's strongly recommended to switch back to the tagit user after performing operations that requires superuser permissions

And build it with the command below:

docker build --build-arg HOST_USER_UID=$(id -u) -t release .

The host user id is required to give permission to the container user over the repository files

Customized containers can be launched using the exact same parameters of the default henriquehbr/tagit container