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

@sofair-official/semantic-release-squash

v0.0.0-development

Published

Automated semver compliant package publishing working with squash-and-merge commits

Downloads

2

Readme

Semantic-release running with squashed commits

Original semantic-release is a very powerful tool to operate semantic release. It automates the whole package release workflow including: determining the next version number, generating the release notes, and publishing the package. This fork is largely based on the original project.

As we are using squash-and-merge strategy to keep a clean and lean history, we have to develop a tweak to read the message of squashed commits. Our strategy is as follows :

  • Creating a new branch to operate change. The branch name will be the message of the squashed commits.
  • Do some commits on this branch (named inner commit) with valid conventionnal commit message.
  • Create a pull request (PR) with a valid name like: Issue to solve (#3) where the number 3 is the number of the PR.
  • Squash-and-merge the PR with the valid name.

How it works

The GitHub API is used to retrieve the inner commit message and to proceed the versioning on.

The table below shows which commit message gets you which release type when semantic-release-squash runs (using our configuration):

| Commit message | Release type | | -------------------------------------------------------------------- | ------------ | | fix(pencil): stop graphite breaking when too much pressure applied | Patch | | feat(pencil): add 'graphiteWidth' option | Minor | | break(pencil): remove graphiteWidth option | Major |

View of a squashed PR with inner commits

Alt text

What has been modified

Some changes have been done in order to analyze inner commit's message. Here are the files that have been modified :

  • Create the new file lib/github.js to introduce getInnerSquashedCommits and getPullRequestNumber.
  • Modify the lib/get-commit.js to introduce an option in order to use getInnerSquashedCommits on demand.
  • Modify the cli.js to introduce the option with the flag -s or --squashMerge.
  • Create the new file test/github.test.js to proceed the test on the new part.
  • Create the new file test/helpers/github-utils.js to introduce cloneRemoteSquashMergeRepo.
  • update the package.json file.

How to use

The analyze of inner commit's message is done by passing the option -s or --squashMerge to semantic-release-squash :

for example ./semantic-release-squash --squashMerge --debug

The message of the squashed commits must be formed as :

Issue to solve (#3) with 3 the number of the PR.

And inner commit's message must be formed as :

feat(scope): inner commit's message or feat: inner commit's message To learn more about commit's message, the contributo's bible is here to help you.

If the message is malformed, even on the squashed or inner commit, the tool will ignored them.

Feel free to fork this repository and to submit issue.