From b3dc12bbd4dbff6ecbd5ae71ffdda0a53f8a604c Mon Sep 17 00:00:00 2001 From: Ardalan Amini Date: Mon, 28 Feb 2022 21:48:20 +0330 Subject: [PATCH] refactor: Improve changelog output order Closes #8 --- README.md | 16 +++++++++------- src/changelog.ts | 1 - src/constants.ts | 14 +++++++------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b459f9d..dd919af 100644 --- a/README.md +++ b/README.md @@ -13,19 +13,21 @@ type(category): description [flag] The `type` must be one of the followings: * `breaking` (Breaking Changes) -* `build` (Build System) -* `ci` (Continuous Integration) -* `chore` (Chores) -* `deps` (Dependencies) -* `docs` (Documentation Changes) * `feat` (New Features) * `fix` (Bug Fixes) -* `other` (Other Changes) +* `revert` (Reverts) * `perf` (Performance Improvements) * `refactor` (Refactors) -* `revert` (Reverts) +* `deps` (Dependencies) +* `docs` (Documentation Changes) * `style` (Code Style Changes) +* `build` (Build System) +* `ci` (Continuous Integration) * `test` (Tests) +* `chore` (Chores) +* `other` (Other Changes) + +> The changelogs will be in the same order as listed above. > If the `type` is not found in the list, it'll be considered as `other`. diff --git a/src/changelog.ts b/src/changelog.ts index 5c8468e..1c0393d 100644 --- a/src/changelog.ts +++ b/src/changelog.ts @@ -52,7 +52,6 @@ export async function generate(input: InputI): Promise { return Object.values(TYPES) .filter((type) => !exclude.includes(type)) - .sort() .reduce((changelog, type) => { const typeGroup = commits[type]; diff --git a/src/constants.ts b/src/constants.ts index 493b951..62936a1 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -6,19 +6,19 @@ export const PR_REGEX = /#([1-9]\d*)/g; export const TYPES: TypesI = { breaking: "Breaking Changes", - build: "Build System", - ci: "Continuous Integration", - chore: "Chores", - deps: "Dependencies", - docs: "Documentation Changes", feat: "New Features", fix: "Bug Fixes", - other: "Other Changes", + revert: "Reverts", perf: "Performance Improvements", refactor: "Refactors", - revert: "Reverts", + deps: "Dependencies", + docs: "Documentation Changes", style: "Code Style Changes", + build: "Build System", + ci: "Continuous Integration", test: "Tests", + chore: "Chores", + other: "Other Changes", }; export interface TypesI {