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

workspace-release

v0.5.1

Published

A simple script which makes it easier to publish npm packages from yarn workspace based projects via Travis.

Downloads

16

Readme

workspace-release 🚚

A simple script which makes it easier to publish npm packages from yarn workspace based projects via Travis.

Disclaimer: Don't expect this package to be full featured and super well maintained. At least for now it was mainly a proof-of-concept for myself.

You'd probably want to install this package as a dev depenendency in your workspace root:

$ yarn add -D workspace-release -W

This package comes with two scripts:

  • workspace-version: You call this one locally in your project to set new versions for your packages. Just run $ yarn workspace-version.
  • workspace-publish: This script will be called by Travis on tag. In simple cases you can just add if [ -n "$TRAVIS_TAG" ]; then node node_modules/.bin/workspace-publish; fi in the scripts section of your .travis.yml for this (see this example). If you have a matrix build (e.g. because you test your package against multiple Node versions) you probably want to create a deploy stage, so that the package will only be deployed, if all tests were successful (see this example). If you need to build you project before publishing make sure to either do it manually before calling workspace-publish or do it in your preversion lifecycle for example.

I expect a global environment variable called NPM_TOKEN being available for publishing. You can either add this in the repo configs inside the Travis GUI or you can store it in a secure way with the Travis terminal client (either by following these instructions or by running $ brew install travis on a Mac). Now run $ travis encrypt NPM_TOKEN={YOUR-TOKEN} --add env.global where {YOUR-TOKEN} is this authToken you see in in your .npmrc after you logged into npm at least once. (I also assume that you already created a .travis.yml.) The Travis GUI is my prefered way, so I can update the token without creating new commits. Using the .travis.yml is needed, if you want to use different tokens in different branches.

To change the registry, tag or access use publishConfig in your package.json. If tag is not set, if will be automatically set to 'next' for prereleases (versions containing a '-') and to 'latest' for everything else.

You can look into a basic example here and a more complex example here.

Lifecycle events for $ npm version and $ npm publish are run as usual - but only on Travis' side and not locally.

(Note: This project itself is currently released without workspace-release. It uses plain old $ npm version patch && git push && npm publish.)