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

monorel

v0.5.0

Published

`monorel` is an opinionated publishing tool for pnpm-based monorepos. Unlike peer projects — [changesets](https://github.com/changesets/changesets) or [auto](https://github.com/intuit/auto) `monorel` is designed to be as simple as possible.

Downloads

383

Readme

Monorel

monorel is an opinionated publishing tool for pnpm-based monorepos. Unlike peer projects — changesets or auto monorel is designed to be as simple as possible.

monorel:

  • Works only for pnpm based monorepos
  • Non-intrusive. The only change it makes is git tags. Monorel never changes version in your code
  • Do not requires configuration file. All options are exposed as cli parameters
  • Stable releases are manual, canary releases are automatic

Installation

pnpm add -Dw monorel

Run this command in the workspace root

Usage

Add following scripts to your root package.json:

{
  "scripts": {
    "release": "monorel --npm-tag latest --filter './packages/a'  --filter './packages/b'",
    "canary:publish": "monorel --filter './packages/a'  --filter './packages/b' --version '2.0.0-alpha.{rev}' --npm-tag canary --publish"
  }
}

Run pnpm release --version X.Y.Z to dry run publishing of release version X.Y.Z. If it looks good run pnpm release:publish --version X.Y.Z --publish to make a push to an npm

Run pnpm canary:publish to publish a canary release. The release version will be 2.0.0.alpha.${sequentialNumber}. The version will be tagged with canary tag

Authorization best practices

monorel relies on NPM registry authorization in current shell. It will fail if authorization is absent

You can check if you're authorized by running pnpm whoami in the same shell where you plan to run monorel.

There two ways to authorize yourself:

  • Run pnpm login. This method will work if you're making releases manually, but for running automatic releases throuh CI you will need a different method
  • Create .npmrc, add //registry.npmjs.org/:_authToken=${NPM_TOKEN} to the beginning and get a NPM token. Later you could supply NPM_TOKEN to your CI tool for automated releases. But if you do that, NPM will always look for NPM_TOKEN. All commands (including pnpm whoami) will if NPM_TOKEN is undefined or invalid, even you successfully logger in with pnpm login before

If you're doing only manual releases, pnpm login will work just fine. But universal solution will be adding an auth instruction to .npmrc, and defining NPM_TOKEN locally (example )

Parameters reference

--version VERSION_PATTERN

Version pattern. The end version will be a result of replacements of placeholders in VERSION_PATTERN. Placeholder expressions:

  • {rev} — sequiential revision numver
  • {time} — time as 20220601234501

--npm-tag TAG

NPM registry tag. Usually either canary or latest

--git-tag TAG

Git tag pattern. By default it's v{version}.

--push-tag

If Git tag should be pushed to origin (default is false)

--publish

Unless specified, monorel will do a dry run (meaning no actual publishing is done)

--filter

Specify a list of packages to apply publishing. Should follow pnpm filtering syntax