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-npm-workspaces-monorepo

v2.2.3

Published

Help you use semantic-release with npm workspaces

Downloads

330

Readme

Semantic Release with NPM Workspaces

Simplify the process of releasing a monorepo with npm workspaces.

Work with:

  • Npm workspaces
  • Bun workspaces
  • Yarn workspaces
  • Pnpm workspaces

Only publish packages that changed.

Installation

npm install --save-dev semantic-release-npm-workspaces-monorepo

Usage

Add this to your package.json of your workspace root:

{
  "workspaceRelease": {
    "npmRelease": true,
    "release": {
      // semantic-release configuration
    }
  },
  "scripts": {
    "release": "semantic-release-npm-workspaces-monorepo"
  }
}

The default configuration of this package is:

settings = {
    versionTemplate: '^${version}',
    registry: 'https://registry.npmjs.org',
    workspace: path.join(process.cwd(), 'packages'),
    tagFormat: '${name}@${version}',
    release: {
        extends: 'semantic-release-commit-filter',
        ci: true,
        branches: [
            "main", "master"
        ],
        plugins: [...]
    },
    semanticReleaseBin: 'semantic-release',
    semanticReleaseBinArgs: [],

    // semantic-release pre-configured plugins
    changelogCommit: true, // create & update CHANGELOG.md
    npmRelease: false, // use NPM_TOKEN to publish packages
    extendsReleaseRules: [], // extend defaults release rules
    extendsNoteGeneratorTypes: [], // extend defaults note generator types
    extendsDefaultPlugins: [], // add custom plugins additonally to the pre-configured plugins
}

How it works

  • It will update all the workspace (local dependencies) to the latest from the registry before running semantic release.
  • It will do it by the dependency graph, meaning that it will update the packages in the correct order.
  • Use semantic-release-commit-filter to filter the commits to only publish packages that changed.

Pre-configured plugins

If you do not specify the plugins property in the release object, it will use the following plugins:

  • @semantic-release/commit-analyzer
  • @semantic-release/release-notes-generator
  • @semantic-release/changelog (if changelogCommit is set true)
  • @semantic-release/npm (if npmRelease is set true)
  • @semantic-release/github (if changelogCommit is set true)
  • @semantic-release/git (if changelogCommit is set true)

The plugins configure with recommended settings. Checkout settings.ts for more information.

Examples

Some examples of how to use this package:

How to "Breaking Changes"?

The release of breaking changes can be confusing sometimes.

You need to write a commit message with BREAKING CHANGE in the footer of the commit to trigger a major release.

(You cannot use BREAKING CHANGE as the type)

git commit -m "feat: add new feature
BREAKING CHANGE: this is a breaking change"

To ease the process, you can use the breaking type in the commit message to trigger a major release in one line.

git commit -m "breaking: this is a breaking change"