folke / semantic-release-commit-filter

πŸ“¦πŸ•΅οΈβ€β™€οΈ Semantic-release plugin that filters git commits based on the current working directory

Home Page:https://www.npmjs.com/package/semantic-release-commit-filter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸš€ πŸ•΅οΈβ€β™€οΈ Semantic-Release Commit Filter

This package is a shareable configuration for semantic-release that:

  • configures tagFormat to use the package name from the current directory ${package.name}-v${version}
  • uses commits only applicable to the current directory

❓ Why

Suppose you have a monorepo with two packages:

$ tree -P "package.json|release.config.js" -I node_modules mono-semver
mono-semver
β”œβ”€β”€ package.json
β”œβ”€β”€ packages
β”‚   β”œβ”€β”€ pkg1
β”‚   β”‚   β”œβ”€β”€ package.json
β”‚   β”‚   └── release.config.js
β”‚   └── pkg2
β”‚       β”œβ”€β”€ package.json
β”‚       └── release.config.js
└── release.config.js

3 directories, 6 files

Now we can run semantic-release in any of the package directories and/or in the top-level directory.

CHANGELOG.md files and package.json versions will be maintained in every directory.

πŸ“¦ Installation

Make sure that if you have semantic-version installed globally, also install semantic-version-commit-filter globally. Same with local install.

$ npm install --dev semantic-version-commit-filter

$ yarn install --dev semantic-version-commit-filter

!! make sure you make semantic-release available in every package.json file. Additionally, every package directory needs its own semantic release configuration file.

βš™οΈ Configuration

You can either specify this packages in your release config file:

{
  "extends": ["semantic-release-commit-filter"]
}

or specify it as a paramater to the semantic-release cli

$ npx semantic-release -e semantic-release-commit-filter

About

πŸ“¦πŸ•΅οΈβ€β™€οΈ Semantic-release plugin that filters git commits based on the current working directory

https://www.npmjs.com/package/semantic-release-commit-filter


Languages

Language:JavaScript 68.9%Language:TypeScript 31.1%