Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changelog/01.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
breaking
Fixes
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ jobs:
- uses: pnpm/action-setup@v4
- run: pnpm install --frozen-lockfile
- run: pnpm exec prettier --check .
- run: node bin/heeler.js check
4 changes: 3 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
exec < /dev/tty && node bin/heeler.js add && pnpm exec pretty-quick --staged
exec < /dev/tty
node bin/heeler.js add
pnpm exec pretty-quick --staged
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 1.0.0
## 1.0.0

- (feature): Initial implementatation, including prep command. (#3)
- (breaking): Initial implementatation, including prep command. (#3)
8 changes: 4 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ISC License
Copyright (c) 2025 Jolyn Denning

Copyright 2025 Jolyn Denning
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,11 @@ pnpm i --save-dev heeler husky

pnpm exec husky

echo "exec < /dev/tty && pnpm exec heeler add" > .husky/pre-commit
```

Then add `pnpm exec heeler check` to your CI/CD configuration, to ensure every pull request has added to the changelog

To work with Github's actions/checkout, add the following to your Github workflow:

```yml
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref }}
echo "pnpm exec heeler add" > .husky/pre-commit
```

## Usage

Whenever a user runs `git commit`, they will be prompted for whether the change is breaking, feature, or fix. A line is added to the CHANGELOG.md for all commits that are unpublished.

When publishing, run the `heeler prep` command to update the CHANGELOG.md to have the correct version number and messages.
When publishing, run the `heeler prep` command beforehand to update the CHANGELOG.md to have the correct version number and messages.
48 changes: 26 additions & 22 deletions bin/heeler.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
import inquirer from "inquirer";
import {
addToChangelog,
assertChangelogMostRecentCommit,
prepareRelease,
} from "../src/changelog-utils.js";
import { select } from "@inquirer/prompts";
import { addToChangelog, prepareRelease } from "../src/changelog-utils.js";

if (process.argv.length < 3) {
throw Error(`heeler requires one of the following commands: add, check`);
throw Error(`heeler requires one of the following commands: add, prep`);
}

const command = process.argv[2];

switch (command) {
case "add":
inquirer
.prompt([
const answer = await select({
message: "Is this a breaking change, new feature, or fix?",
choices: [
{
name: "changetype",
message: "Is this a breaking change, new feature, or fix?",
type: "list",
choices: ["breaking", "feature", "fix", "skip"],
name: "breaking",
value: "breaking",
},
])
.then((answers) => {
if (answers.changetype !== "skip") {
return addToChangelog(answers);
}
});
break;
case "check":
assertChangelogMostRecentCommit();
{
name: "feature",
value: "feature",
},
{
name: "fix",
value: "fix",
},
{
name: "skip",
value: "skip",
},
],
});

if (answer !== "skip") {
addToChangelog(answer);
}
break;
case "prep":
prepareRelease();
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
},
"keywords": [],
"author": "Jolyn Denning",
"license": "ISC",
"license": "MIT",
"packageManager": "pnpm@10.13.1",
"dependencies": {
"inquirer": "^12.8.2",
"@inquirer/prompts": "^7.8.0",
"simple-git": "^3.28.0"
},
"devDependencies": {
Expand Down
Loading