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

lvr

v2.1.0

Published

My own release cli tool.

Downloads

49

Readme

lvr

actions npm

Perform jobs related to the release flows, such as:

  1. Bump version.
  2. Generate CHANGELOG.md.
  3. Commit / Tag / Push.
  4. Create a release and publish node packages.

Features

  1. One brief script is good to go, may be a little opinionated by default options.
  2. Generate a tag-ranged CHANGELOG.md.
  3. Publish job supports sync to cnpm.

Usage

Perform Bump :point_right: CHANGELOG :point_right: Commit :point_right: Tag :point_right: Push in one script:

npx lvr

Use the dry run option to confirm what will be executed:

# npx lvr --dry-run
npx lvr -d

Install globally:

npm i lvr -g

More options detail:

lvr -h

Commands used separately.

Bump

Powered by conventional-recommended-bump and semver. Using Conventional Commits preset by default.

Bump package.json in the root:

# lvr bump
lvr b

In a detected monorepo, it would bump those changed packages by default.

options

In a detected monorepo, it would bump all packages whether they are changed. If the root package.json has the version field, packages would be bumped to the same version based on it.

lvr b --all

In a detected monorepo, --pkg helps to prompt which packages should be bumped:

lvr b --pkg

Bump to the specified semver increment level rather than depending on conventional-recommended-bump.

lvr b --major
lvr b --major --all
lvr b --major --pkg

Semver increment level support:

  • --major: bump as a semver-major version.
  • --minor: bump as a semver-minor version.
  • --patch: bump as a semver-patch version.
  • --premajor: bump as a semver-premajor version, can set id with string.
  • --preminor: bump as a semver-preminor version, can set id with string.
  • --prepatch: bump as a semver-prepatch version, can set id with string.
  • --prerelease: bump as a semver-prerelease version, can set id with string.

In a detected monorepo, when releasing only one package, it specifies the tag name as vx.x.x instead of [email protected]:

lvr b --main-pkg

Changelog

Powered by antfu/changelogithub and unjs/changelogen.

Generate CHANGELOG.md with all existing tags:

# lvr changelog
lvr c
options
# within a tag range.
lvr changelog --tag=v1.0.1...v2.1.3

# to last 2 tag.
lvr changelog --tag==2

# to a specified tag.
lvr changelog --tag=v0.0.2

It means that the CHANGELOG.md would contain more commits that were not be parsed by conventional commits. Disable by default.

lvr changelog --verbose

[!NOTE] About author

To be able to generate the format of @authorName for the interaction in the GitHub's release note, I need to fetch the GitHub Rest API. However, it occurred to me that the API has a rate limit for an IP.

So we have to pass a GitHub PAT by --token when encountering this situation 😔.

Alternatively, we can also create a .env.local file which should be included in the .gitignore .

# .env.local
GITHUB_TOKEN = your-github-pat

Commit / Tag / Push

Enable --commit --tag --push when execute the lvr script without other command. (opt-out like --no-push, etc.)

--no-changelog is considered to enable these git jobs in the same way, while --no-bump makes no sense to the further step.

Use Release {r} as the default commit message. The placeholder {r} will be replaced by the tag name from the bumped result. If multiple packages are released in the same commit, the human-id library is utilized to create words for the commit message and tag name:

lvr --commit="R: {r}"
# Use the tag name from bumped result from package.json by default:
lvr --tag=BatMan

# Push current branch and new tag by default.
lvr --push

# Push current branch only.
lvr --push=branch

# Push new tag only
lvr --push=tag

[!NOTE] It is not recommended to release more than one package at the same time in order to ensure a concise commit message and tag name.

Send a GitHub Release on CI

See yml.ts and modify on your own.

# Add a workflow file to `.github/workflows/lvr.yml`.
lvr yml

Publish on CI

See publish.ts.

Configuration

See src/config.ts.

Configuration is loaded by antfu/unconfig from cwd which has highest priority. You can use either lvr.json, lvr.{ts,js,mjs,cjs}, .lvrrc or use the lvr field in package.json.