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

semantic-release-final

v1.1.0

Published

This is a minimal Node.js Express application with a single controller endpoint. The main purpose of this project is to demonstrate how easily semantic release can be set up using the semantic-release package and a GitHub Actions pipeline.

Downloads

5

Readme

📦 🚀 Semantic release

This is a minimal Node.js Express application with a single controller endpoint. The main purpose of this project is to demonstrate how easily semantic release can be set up using the semantic-release package and a GitHub Actions pipeline.

🛫 Getting Started

Follow these instructions to set up the project and configure semantic release.

Prerequisites

  • Node.js and npm installed on your machine.
  • A GitHub repository for your project.
  1. Clone the repository to your local machine:

    git clone https://github.com/lukasnerdware/semantic-release.git
    cd semantic-release
  2. Install project dependencies:

    npm install

    Usage

    npm start

    Your application will be available at http://localhost:3000.

👨🏼‍⚖️ Conventional Commits

Enforcing Conventional Commits with Husky and Commitlint

  1. Install Husky to enforce conventional commit messages and commitlint:

    npm install --save-dev @commitlint/{config-conventional,cli}
    npm install --save-dev husky
    npx husky install
    npx husky add .husky/commit-msg  'npx --no -- commitlint --edit ${1}'

    This will ensure that commit messages follow the conventional commit guideline.

  2. Create a commitlint.config.js file in your project root:

module.exports = { extends: ['@commitlint/config-conventional'] };

📓 Semantic Release Setup

  1. Install semantic-release and required plugins:
npm install --save-dev semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/github
  1. Create a release.config.js file in your project root:
module.exports = {
  branches: ['main'],
  plugins: [
    '@semantic-release/commit-analyzer',
    '@semantic-release/release-notes-generator',
    '@semantic-release/changelog',
    '@semantic-release/npm',
    '@semantic-release/github',
    '@semantic-release/git',
  ],
};
  1. Configure GitHub Actions for semantic release by creating a .github/workflows/release.yml file:
name: Semantic Release

on:
  push:
    branches:
      - main

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Setup Node.js
        uses: actions/setup-node@v2
        with:
          node-version: 18

      - name: Install dependencies
        run: npm install

      - name: Semantic Release
        run: npx semantic-release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
  1. Commit the changes and push to your GitHub repository.
  2. Ensure you give the Read and write permissions permision to your github workflow (Settings --> Actions --> General --> Workflow permissions)
  3. Add NPM_TOKEN as Github Secret
    1. GO to Settings
    2. Security --> Secrets and variables --> New Repository secret
    3. Create NPM_TOKEN secret (requires npm account)
  4. Now, whenever you merge changes into the main branch, the GitHub Actions pipeline will automatically trigger a semantic release based on your commit messages and versioning rules defined in release.config.js.