Giter Site home page Giter Site logo

folke / semantic-release-commit-filter Goto Github PK

View Code? Open in Web Editor NEW
27.0 2.0 5.0 196 KB

๐Ÿ“ฆ๐Ÿ•ต๏ธโ€โ™€๏ธ Semantic-release plugin that filters git commits based on the current working directory

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

JavaScript 68.94% TypeScript 31.06%
semantic-release semantic-release-config semantic-release-plugin

semantic-release-commit-filter's Introduction

๐Ÿš€ ๐Ÿ•ต๏ธโ€โ™€๏ธ 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

semantic-release-commit-filter's People

Contributors

dependabot[bot] avatar folke avatar renovate-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

semantic-release-commit-filter's Issues

why does this work? :)

Super curious - why does checking the require cache work for all file types? e.g. also changes on a readme.md gets picked up?
I thought this would do something like this under the hood:

git diff-tree --no-commit-id --name-only {hash-of-last-release-commit} -r

your approach is super interesting - and works for my first attempts :)

Invalid path to package.json resolving on windows

Trying to run in workspace root directory

posix.resolve(process.cwd(), "package.json")

Resolves to:

'/Dev/monorepo-playground/X:\\Dev\\monorepo-playground/package.json'

Next require fails with error Error: Cannot find module

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency @types/node to v13.9.8
  • chore(deps): update dependency eslint to v9
  • chore(deps): update dependency eslint-config-prettier to v9
  • chore(deps): update dependency eslint-plugin-jest to v28
  • chore(deps): update dependency eslint-plugin-prettier to v5
  • chore(deps): update dependency eslint-plugin-promise to v6
  • chore(deps): update dependency eslint-plugin-unicorn to v52
  • chore(deps): update dependency husky to v9
  • chore(deps): update dependency node to v20 (node, @types/node)
  • chore(deps): update dependency prettier to v3
  • chore(deps): update dependency rimraf to v5
  • chore(deps): update dependency ts-node to v10
  • chore(deps): update dependency typescript to v5
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • @types/jest 24.9.1
  • @types/node 13.9.4
  • @typescript-eslint/eslint-plugin 2.25.0
  • @typescript-eslint/parser 2.25.0
  • devmoji 2.1.7
  • eslint 6.8.0
  • eslint-config-prettier 6.10.1
  • eslint-plugin-import 2.20.1
  • eslint-plugin-jest 23.8.2
  • eslint-plugin-node 11.0.0
  • eslint-plugin-prettier 3.1.2
  • eslint-plugin-promise 4.2.1
  • eslint-plugin-unicorn 15.0.1
  • husky 4.2.3
  • jest 25.1.0
  • prettier 1.19.1
  • rimraf 3.0.2
  • ts-jest 25.2.1
  • ts-node 8.8.1
  • tslib 1.11.1
  • typescript 3.8.3
nvm
.nvmrc
  • node v13.11.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.