diff --git a/.changelog/01.txt b/.changelog/01.txt new file mode 100644 index 0000000..c45b344 --- /dev/null +++ b/.changelog/01.txt @@ -0,0 +1,2 @@ +breaking +Fixes \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c1f0626..5a4c41f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.husky/pre-commit b/.husky/pre-commit index db39a89..22e5adf 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 970b2a0..8c4a005 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 1.0.0 +## 1.0.0 - (feature): Initial implementatation, including prep command. (#3) - (breaking): Initial implementatation, including prep command. (#3) diff --git a/LICENSE b/LICENSE index 0818e41..fab8946 100644 --- a/LICENSE +++ b/LICENSE @@ -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. diff --git a/README.md b/README.md index 9e83d09..581a0cf 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/bin/heeler.js b/bin/heeler.js index a6a4488..6abd766 100644 --- a/bin/heeler.js +++ b/bin/heeler.js @@ -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(); diff --git a/package.json b/package.json index 219643b..ff9f12b 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 026f316..4bb7def 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,9 +7,9 @@ settings: importers: .: dependencies: - inquirer: - specifier: ^12.8.2 - version: 12.8.2(@types/node@24.1.0) + "@inquirer/prompts": + specifier: ^7.8.0 + version: 7.8.0 simple-git: specifier: ^3.28.0 version: 3.28.0 @@ -131,10 +131,10 @@ packages: "@types/node": optional: true - "@inquirer/prompts@7.7.1": + "@inquirer/prompts@7.8.0": resolution: { - integrity: sha512-XDxPrEWeWUBy8scAXzXuFY45r/q49R0g72bUzgQXZ1DY/xEFX+ESDMkTQolcb5jRBzaNJX2W8XQl6krMNDTjaA==, + integrity: sha512-JHwGbQ6wjf1dxxnalDYpZwZxUEosT+6CPGD9Zh4sm9WXdtUp9XODCQD3NjSTmu+0OAyxWXNOqf0spjIymJa2Tw==, } engines: { node: ">=18" } peerDependencies: @@ -155,10 +155,10 @@ packages: "@types/node": optional: true - "@inquirer/search@3.0.17": + "@inquirer/search@3.1.0": resolution: { - integrity: sha512-CuBU4BAGFqRYors4TNCYzy9X3DpKtgIW4Boi0WNkm4Ei1hvY9acxKdBdyqzqBCEe4YxSdaQQsasJlFlUJNgojw==, + integrity: sha512-PMk1+O/WBcYJDq2H7foV0aAZSmDdkzZB9Mw2v/DmONRJopwA/128cS9M/TXWLKKdEQKZnKwBzqu2G4x/2Nqx8Q==, } engines: { node: ">=18" } peerDependencies: @@ -210,12 +210,6 @@ packages: } engines: { node: ^12.20.0 || ^14.18.0 || >=16.0.0 } - "@types/node@24.1.0": - resolution: - { - integrity: sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==, - } - ansi-escapes@4.3.2: resolution: { @@ -310,18 +304,6 @@ packages: } engines: { node: ">= 4" } - inquirer@12.8.2: - resolution: - { - integrity: sha512-oBDL9f4+cDambZVJdfJu2M5JQfvaug9lbo6fKDlFV40i8t3FGA1Db67ov5Hp5DInG4zmXhHWTSnlXBntnJ7GMA==, - } - engines: { node: ">=18" } - peerDependencies: - "@types/node": ">=18" - peerDependenciesMeta: - "@types/node": - optional: true - is-fullwidth-code-point@3.0.0: resolution: { @@ -387,19 +369,6 @@ packages: peerDependencies: prettier: ^3.0.0 - run-async@4.0.5: - resolution: - { - integrity: sha512-oN9GTgxUNDBumHTTDmQ8dep6VIJbgj9S3dPP+9XylVLIK4xB9XTXtKWROd5pnhdXR9k0EgO1JRcNh0T+Ny2FsA==, - } - engines: { node: ">=0.12.0" } - - rxjs@7.8.2: - resolution: - { - integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==, - } - safer-buffer@2.1.2: resolution: { @@ -467,12 +436,6 @@ packages: } engines: { node: ">=10" } - undici-types@7.8.0: - resolution: - { - integrity: sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==, - } - wrap-ansi@6.2.0: resolution: { @@ -488,121 +451,95 @@ packages: engines: { node: ">=18" } snapshots: - "@inquirer/checkbox@4.2.0(@types/node@24.1.0)": + "@inquirer/checkbox@4.2.0": dependencies: - "@inquirer/core": 10.1.15(@types/node@24.1.0) + "@inquirer/core": 10.1.15 "@inquirer/figures": 1.0.13 - "@inquirer/type": 3.0.8(@types/node@24.1.0) + "@inquirer/type": 3.0.8 ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 - optionalDependencies: - "@types/node": 24.1.0 - "@inquirer/confirm@5.1.14(@types/node@24.1.0)": + "@inquirer/confirm@5.1.14": dependencies: - "@inquirer/core": 10.1.15(@types/node@24.1.0) - "@inquirer/type": 3.0.8(@types/node@24.1.0) - optionalDependencies: - "@types/node": 24.1.0 + "@inquirer/core": 10.1.15 + "@inquirer/type": 3.0.8 - "@inquirer/core@10.1.15(@types/node@24.1.0)": + "@inquirer/core@10.1.15": dependencies: "@inquirer/figures": 1.0.13 - "@inquirer/type": 3.0.8(@types/node@24.1.0) + "@inquirer/type": 3.0.8 ansi-escapes: 4.3.2 cli-width: 4.1.0 mute-stream: 2.0.0 signal-exit: 4.1.0 wrap-ansi: 6.2.0 yoctocolors-cjs: 2.1.2 - optionalDependencies: - "@types/node": 24.1.0 - "@inquirer/editor@4.2.15(@types/node@24.1.0)": + "@inquirer/editor@4.2.15": dependencies: - "@inquirer/core": 10.1.15(@types/node@24.1.0) - "@inquirer/type": 3.0.8(@types/node@24.1.0) + "@inquirer/core": 10.1.15 + "@inquirer/type": 3.0.8 external-editor: 3.1.0 - optionalDependencies: - "@types/node": 24.1.0 - "@inquirer/expand@4.0.17(@types/node@24.1.0)": + "@inquirer/expand@4.0.17": dependencies: - "@inquirer/core": 10.1.15(@types/node@24.1.0) - "@inquirer/type": 3.0.8(@types/node@24.1.0) + "@inquirer/core": 10.1.15 + "@inquirer/type": 3.0.8 yoctocolors-cjs: 2.1.2 - optionalDependencies: - "@types/node": 24.1.0 "@inquirer/figures@1.0.13": {} - "@inquirer/input@4.2.1(@types/node@24.1.0)": + "@inquirer/input@4.2.1": dependencies: - "@inquirer/core": 10.1.15(@types/node@24.1.0) - "@inquirer/type": 3.0.8(@types/node@24.1.0) - optionalDependencies: - "@types/node": 24.1.0 + "@inquirer/core": 10.1.15 + "@inquirer/type": 3.0.8 - "@inquirer/number@3.0.17(@types/node@24.1.0)": + "@inquirer/number@3.0.17": dependencies: - "@inquirer/core": 10.1.15(@types/node@24.1.0) - "@inquirer/type": 3.0.8(@types/node@24.1.0) - optionalDependencies: - "@types/node": 24.1.0 + "@inquirer/core": 10.1.15 + "@inquirer/type": 3.0.8 - "@inquirer/password@4.0.17(@types/node@24.1.0)": + "@inquirer/password@4.0.17": dependencies: - "@inquirer/core": 10.1.15(@types/node@24.1.0) - "@inquirer/type": 3.0.8(@types/node@24.1.0) + "@inquirer/core": 10.1.15 + "@inquirer/type": 3.0.8 ansi-escapes: 4.3.2 - optionalDependencies: - "@types/node": 24.1.0 - "@inquirer/prompts@7.7.1(@types/node@24.1.0)": + "@inquirer/prompts@7.8.0": dependencies: - "@inquirer/checkbox": 4.2.0(@types/node@24.1.0) - "@inquirer/confirm": 5.1.14(@types/node@24.1.0) - "@inquirer/editor": 4.2.15(@types/node@24.1.0) - "@inquirer/expand": 4.0.17(@types/node@24.1.0) - "@inquirer/input": 4.2.1(@types/node@24.1.0) - "@inquirer/number": 3.0.17(@types/node@24.1.0) - "@inquirer/password": 4.0.17(@types/node@24.1.0) - "@inquirer/rawlist": 4.1.5(@types/node@24.1.0) - "@inquirer/search": 3.0.17(@types/node@24.1.0) - "@inquirer/select": 4.3.1(@types/node@24.1.0) - optionalDependencies: - "@types/node": 24.1.0 - - "@inquirer/rawlist@4.1.5(@types/node@24.1.0)": + "@inquirer/checkbox": 4.2.0 + "@inquirer/confirm": 5.1.14 + "@inquirer/editor": 4.2.15 + "@inquirer/expand": 4.0.17 + "@inquirer/input": 4.2.1 + "@inquirer/number": 3.0.17 + "@inquirer/password": 4.0.17 + "@inquirer/rawlist": 4.1.5 + "@inquirer/search": 3.1.0 + "@inquirer/select": 4.3.1 + + "@inquirer/rawlist@4.1.5": dependencies: - "@inquirer/core": 10.1.15(@types/node@24.1.0) - "@inquirer/type": 3.0.8(@types/node@24.1.0) + "@inquirer/core": 10.1.15 + "@inquirer/type": 3.0.8 yoctocolors-cjs: 2.1.2 - optionalDependencies: - "@types/node": 24.1.0 - "@inquirer/search@3.0.17(@types/node@24.1.0)": + "@inquirer/search@3.1.0": dependencies: - "@inquirer/core": 10.1.15(@types/node@24.1.0) + "@inquirer/core": 10.1.15 "@inquirer/figures": 1.0.13 - "@inquirer/type": 3.0.8(@types/node@24.1.0) + "@inquirer/type": 3.0.8 yoctocolors-cjs: 2.1.2 - optionalDependencies: - "@types/node": 24.1.0 - "@inquirer/select@4.3.1(@types/node@24.1.0)": + "@inquirer/select@4.3.1": dependencies: - "@inquirer/core": 10.1.15(@types/node@24.1.0) + "@inquirer/core": 10.1.15 "@inquirer/figures": 1.0.13 - "@inquirer/type": 3.0.8(@types/node@24.1.0) + "@inquirer/type": 3.0.8 ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 - optionalDependencies: - "@types/node": 24.1.0 - "@inquirer/type@3.0.8(@types/node@24.1.0)": - optionalDependencies: - "@types/node": 24.1.0 + "@inquirer/type@3.0.8": {} "@kwsites/file-exists@1.1.1": dependencies: @@ -614,11 +551,6 @@ snapshots: "@pkgr/core@0.2.9": {} - "@types/node@24.1.0": - dependencies: - undici-types: 7.8.0 - optional: true - ansi-escapes@4.3.2: dependencies: type-fest: 0.21.3 @@ -659,18 +591,6 @@ snapshots: ignore@7.0.5: {} - inquirer@12.8.2(@types/node@24.1.0): - dependencies: - "@inquirer/core": 10.1.15(@types/node@24.1.0) - "@inquirer/prompts": 7.7.1(@types/node@24.1.0) - "@inquirer/type": 3.0.8(@types/node@24.1.0) - ansi-escapes: 4.3.2 - mute-stream: 2.0.0 - run-async: 4.0.5 - rxjs: 7.8.2 - optionalDependencies: - "@types/node": 24.1.0 - is-fullwidth-code-point@3.0.0: {} mri@1.2.0: {} @@ -698,12 +618,6 @@ snapshots: tinyexec: 0.3.2 tslib: 2.8.1 - run-async@4.0.5: {} - - rxjs@7.8.2: - dependencies: - tslib: 2.8.1 - safer-buffer@2.1.2: {} semver@7.7.2: {} @@ -738,9 +652,6 @@ snapshots: type-fest@0.21.3: {} - undici-types@7.8.0: - optional: true - wrap-ansi@6.2.0: dependencies: ansi-styles: 4.3.0 diff --git a/src/changelog-utils.js b/src/changelog-utils.js index 9c39177..c3def2d 100644 --- a/src/changelog-utils.js +++ b/src/changelog-utils.js @@ -1,121 +1,94 @@ import fs from "node:fs"; -import path from "path"; -import simpleGit from "simple-git"; +import path from "node:path"; import semver from "semver"; -import childProcess from "child_process"; - -export function addToChangelog(answers) { - const packageJson = fs.readFileSync( - path.resolve(process.cwd(), "package.json"), - "utf-8", - ); - const changelogPath = path.resolve(process.cwd(), "CHANGELOG.md"); - if (!fs.existsSync(changelogPath)) { - fs.writeFileSync(changelogPath, "", "utf-8"); - } - - const changelog = fs.readFileSync(changelogPath, "utf-8"); +import simpleGit from "simple-git"; - const startStr = "# Unpublished\n\n"; - let sliceIndex; +export async function addToChangelog(changeType) { + const changelogPath = path.resolve(process.cwd(), "./.changelog"); + let existingFiles; - if (changelog.startsWith(startStr)) { - sliceIndex = startStr.length; - } else { - sliceIndex = 0; + try { + existingFiles = fs.readdirSync(changelogPath); + } catch (err) { + fs.mkdirSync(changelogPath); + existingFiles = []; } - const newEntry = `- (${answers.changetype}): COMMITMSG\n`; - - const completeFile = startStr + newEntry + changelog.slice(sliceIndex); - - fs.writeFileSync("CHANGELOG.md", completeFile, "utf-8"); - - return simpleGit().add("CHANGELOG.md"); -} - -export async function assertChangelogMostRecentCommit() { const git = simpleGit(); const mostRecentLog = await git.log({ maxCount: 1 }); - const blame = await git.raw(["blame", "CHANGELOG.md"]); - const blameLines = blame.split("\n"); - if (!blameLines[0].endsWith("# Unpublished")) { - throw Error(`heeler: CHANGELOG.md doesn't have any unpublished changelogs`); - } - - const firstChangelogEntry = blameLines.slice(1).find((line) => { - return /.+ \- \(.+\):/g.test(line); - }); - - const blameHash = firstChangelogEntry - .slice(0, firstChangelogEntry.indexOf(" ")) - .replace(/^\^/, ""); - if (!mostRecentLog.latest.hash.startsWith(blameHash)) { - throw Error( - `heeler: no changelog for most recent commit: CHANGELOG.md's most recent unpublished changelog commit hash starts with ${blameHash}, but most recent commit hash is ${mostRecentLog.latest.hash}`, - ); - } + fs.writeFileSync( + path.resolve( + process.cwd(), + `./.changelog/${existingFiles.length < 10 ? "0" : ""}${existingFiles.length + 1}.txt`, + ), + `${changeType}\n${mostRecentLog.latest.message}`, + "utf-8", + ); - console.log("Changelog for most recent commit was found!"); + git.add(".changelog"); } export async function prepareRelease() { const changelogPath = path.resolve(process.cwd(), "CHANGELOG.md"); const packageJsonPath = path.resolve(process.cwd(), "package.json"); const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8")); - const originalChangelogLines = fs - .readFileSync(changelogPath, "utf-8") - .split("\n"); - if (!originalChangelogLines[0].startsWith("# Unpublished")) { - throw Error(`heeler: CHANGELOG.md doesn't have any unpublished changelogs`); + const changelogLines = fs.readFileSync(changelogPath, "utf-8").split("\n"); + + if (changelogLines[0] !== `# ${packageJson.name}`) { + changelogLines.unshift(`# ${packageJson.name}`); + changelogLines.unshift(""); } - const git = simpleGit(); - const logs = await git.log({ maxCount: 40 }); - - const blame = await git.raw(["blame", changelogPath]); - const blameLines = blame.split("\n"); - - let unpublishedLines = true, - i = 1, - versionBump = "", - changelogLines = []; - - while (unpublishedLines && i < blameLines.length) { - const regexResult = /(.+) \(.+\) (.+)/g.exec(blameLines[i++]); - if (regexResult) { - const [_, commitHash, message] = regexResult; - if (message.startsWith("#")) { - unpublishedLines = false; - } else { - const gitLog = logs.all.find((log) => log.hash.startsWith(commitHash)); - if (!gitLog) { - throw Error( - `Could not find git log for changelog entry: "${message}"`, - ); - } - const [_, changeType] = /\- \((.+)\)/g.exec(message); - if (changeType === "breaking") { - versionBump = "major"; - } else if (changeType === "feature" && versionBump !== "major") { - versionBump = "minor"; - } else if (!versionBump) { - versionBump = "patch"; - } - changelogLines.push(message.replace("COMMITMSG", gitLog.message)); - } + let existingFiles; + try { + existingFiles = fs.readdirSync(path.resolve(process.cwd(), "./.changelog")); + } catch (err) { + existingFiles = []; + } + + if (existingFiles.length === 0) { + throw Error(`No new changelogs found`); + } + + existingFiles.sort(); + + let versionBump = ""; + const newChangelogLines = [""]; + + console.log(changelogLines); + + for (let existingFile of existingFiles) { + const contents = fs.readFileSync( + path.resolve(process.cwd(), ".changelog", existingFile), + "utf-8", + ); + console.log("contents", contents); + const [changeType, message] = contents.split("\n"); + + if (changeType === "breaking") { + versionBump = "major"; + } else if (changeType === "feature" && versionBump !== "major") { + versionBump = "minor"; + } else if ( + changeType === "fix" && + !["major", "minor"].includes(versionBump) + ) { + versionBump = "fix"; } + + newChangelogLines.push(` * ${changeType}: ${message}`); } const s = semver.parse(packageJson.version); const newVersion = s.inc(versionBump); - const unalteredLines = originalChangelogLines.slice(i); - fs.writeFileSync( - changelogPath, - `# ${newVersion.version}\n\n${changelogLines.join("\n")}\n${unalteredLines}`, - ); + newChangelogLines.push(`## ${newVersion}`); + newChangelogLines.reverse(); + + changelogLines.splice(2, 0, ...newChangelogLines); + + fs.writeFileSync(changelogPath, changelogLines.join("\n"), "utf-8"); console.log("CHANGELOG.md updated and is ready for release"); packageJson.version = newVersion.version; @@ -127,4 +100,11 @@ export async function prepareRelease() { ); console.log("package.json version updated"); + + fs.rmSync(path.resolve(process.cwd(), "./changelog"), { + recursive: true, + force: true, + }); + + console.log("changelog folder deleted"); }