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

@charliec3/gh-actions-example

v3.10.2

Published

This repository serves as an example on: * How to configure a workflow which builds and publishes a Docker image, and automatically versions the repo * How to configure semantic versioning using [semantic-release](https://github.com/semantic-release/seman

Downloads

14

Readme

gh-actions-example

This repository serves as an example on:

  • How to configure a workflow which notifies Slack, builds and publishes a Docker image, and automatically versions the repo
  • How to configure semantic versioning using semantic-release, commitlint, and husky

How to Use This Repository

This repository can be used to experiment with the automated semantic versioning and get familiar with it. The repository MUST be returned back to a working state once done testing.

  1. Install dependencies

    # If you use yarn
    yarn
    
    # If you use npm
    npm i
  2. Make a minor change and commit it to this repo with a message which follows Conventional Commits. The commit message and TYPE can be whatever you'd like. Push to master when done.

  3. View the running action here.

  4. Generated release notes can be found here and here.

Configure a Repo with Automatic Semantic Versioning

In order to configure a Git repo with automatic semantic versioning, follow the steps below:

  1. Clone the project

  2. Create a package.json file

  3. Copy the commitlint, husky, and release configuration blocks found in the example package.json to the package.json in your project.

  4. Run the following to install the commitlint and husky packages locally and save them as development dependencies to the package.json

    • Only commitlint and husky need to be installed locally, semantic-release does not since it'll only be used by Github Actions.
    • Upon installation of husky, it will attempt to create a pre-commit hook in your git repo
    • If you see errors, resolve them then try re-installing.
    # If you use yarn
    yarn add --dev husky @commitlint/{config-conventional,cli} --force
    
    # If you use npm
    npm i --save-dev husky @commitlint/{config-conventional,cli}
  5. Activate hooks

    # If you use yarn
    yarn husky install
    
    # If you use npm
    npx husky install
  6. Add hook

    npx husky add .husky/commit-msg 'npx --no-install commitlint --edit'
  7. Optional: Add the following files/dirs to the .gitignore file:

    echo -e "**/node_modules" >> .gitignore
  8. Add a Github Actions workflow to .github/workflows/

  9. Commit all new files/modifications (except for anything being ignored)

    • Upon commit, you should see a pre-commit hook fire which runs commitlint and checks your commit message. Your message must conform to Conventional Commits, otherwise it will be denied by commitlint. If this does not happen or an error occurs, resolve the error then try again.

Going forward, anyone who wishes to commit to your repository will need to run the following command beforehand to install local dev dependencies. It should be quick and only take a few seconds:

    # If you use yarn
    yarn

    # If you use npm
    npm i