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

gh-actions-publish-test-abc-123

v2.0.0

Published

## Summary

Downloads

1

Readme

Tag, release & publish automation

Summary

This project demonstrates the setup required for tag, release & publish automation.

Development process

  1. Develop on feature branches
  2. Merge to main
  3. Release PR is created automatically and updated as more commits are made on main
  4. Manually merge the PR, which automatically creates the tag and release notes
  5. New version of the package is automatically published to NPM

Solution

Summary

  • All commits on main adhere to Conventional Commits
  • On every push to main GitHub Actions workflows parse those commits then tag, release and publish the package as required

Details

  • Configure a pre-commit hook to enforce commit message syntax

    • https://github.com/conventional-changelog/commitlint
    • Enforce on the main branch only
    • Not required if main is protected but good to be safe
  • Configure GitHub to enforce PR title syntax

    • https://github.com/marketplace/actions/semantic-pull-request
    • Enforce for PRs on the main branch only
  • Create a workflow to automatically create a release PR on push to main

    • https://github.com/google-github-actions/release-please-action

    • Leverages the PR title syntax described above

    • Note: a release PR will only be created for releasable units, which are commits pre-fixed with:

      # minor
      feat:
      
      # patch
      fix:
      perf:
      refactor:

      or breaking changes, which include a !:

      # major
      refactor!:
      fix!:
      # etc.
  • Extend the workflow to publish to NPM after the release PR has been merged

    • Create a separate action to run npm publish
    • Call this action when the release_created output from release-please-action is true

GitHub settings

  • Give GitHub Actions write access
    • Settings > Actions > General > Workflow permissions
    • Select "Read and write permissions"
    • Select "Allow GitHub Actions to create and approve pull requests"
  • Enforce squashed merges
    • Settings > General > Pull Requests
    • De-select "Allow merge commits"
  • Add branch protection to main
    • Require a pull request before merging
    • Require status checks to pass before merging
      • Search for and select the action associated to the required status
    • Require branches to be up to date before merging
    • Require linear history