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

generator-release

v2.6.1

Published

A release generator for Yeoman

Downloads

4

Readme

generator-release

Yeoman generator for handling Bower/NPM releases.

Installation

npm install -g yo generator-release

A config file, ~/.config/generator-release, needs to be created. This is standard CommonJS module exporting github authentication options. The easiest way to configure the authentication is to go to the GitHub admin panel and create a Personal Access Token, then set it as the token in your config.

Optionally the module may export a linkFilter method that allows for parsing of links included in the body of notes issues and pull requests.

Example

module.exports = {
  auth: 'oauth',
  token: 'GitHub OAuth token',

  linkFilter: function(link) {
    return /atlassian\.net/.test(link.url);
  }
};

Enterprise hosts

generator-release can work against GitHub enterprise hosts when defined in the hosts key.

module.exports = {
  auth: 'oauth',
  token: 'GitHub OAuth token',

  hosts: {
    'my.host': {
      token: 'Enterprise GitHub OAuth token',
      apiUrl: 'https://my.host/api/v3'
    }
  }
};

When operating against a matching host, the entire object will be used to extend the base config object, allowing for any config object to be overridden per host. In the example above this is akin to _.extend(module.exports, module.exports.hosts['my.host']).

Usage

Generating release notes

yo release:notes

Will generate a template for the release notes including:

  • Github issues closed since the last release
  • Gitub pull requests closed since the last release
  • Commits not associated with pull requests

This should be manually edited to ensure that only relevant content is display and any additional gotchas and upgrade concerns noted. If the $EDITOR environment variable is setup the generator will automate the checkin of the updated notes.

Additional options:

  • --dry-run — finds the changes that will be recorded and log to the console rather than disk.
  • --rebuild - specifes that we want to create notes for the existing version

Releasing

yo release:release [major|minor|patch|prerelease]

Will increment the release version per the semver action passed in and tag and pushes to the upstream repository.

If publishing to npm the npm publish command is still required.

The increment parameter is optional and not recommended if the release notes were just updated for the project.

Additional options:

  • --skip-tests — skips tests (this is not recommended but can be used to work around environmental issues)

Single Command Release

yo release

Shorthand for the tasks above. Will execute both the notes and release tasks via a single command. Note that the $EDITOR environment variable must be set to a supporting editor to use this mode.

Comparing NPM and Bower collections

npm

yo release:collect-versions npm > oldVersion.json
yo release:diff oldVersion.json npm

bower

yo release:collect-versions bower > oldVersion.json
yo release:diff oldVersion.json bower

Generates a report of the versions that have changed for all packages. Includes release notes for packages that include them.

Note that the arguments to release:diff may be any combination of files or npm/bower meta commands.

Publishing

yo release:publish [cdnjs|components] projectName sourceDir

Pushes a particular directory of artifacts to cdnjs or the github components project, optionally creating pull requests if the executing user does not have adequate permissions to directly push.

Note that at this time only frontend publishing is possible. NPM publishing should still be done directly through the npm publish command.

Enterprise hosts may be published to using the --host=$server option.