{"id":24514778,"url":"https://github.com/runtimerascal/changelog-from-git-commits-generator","last_synced_at":"2025-03-15T10:26:37.724Z","repository":{"id":57196892,"uuid":"181542420","full_name":"RuntimeRascal/changelog-from-git-commits-generator","owner":"RuntimeRascal","description":"A simple module that generates a changelog in markdown from all your projects git commits","archived":false,"fork":false,"pushed_at":"2019-05-15T21:45:22.000Z","size":551,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T21:19:28.031Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RuntimeRascal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-15T18:18:43.000Z","updated_at":"2019-05-15T21:45:24.000Z","dependencies_parsed_at":"2022-09-16T00:10:54.558Z","dependency_job_id":null,"html_url":"https://github.com/RuntimeRascal/changelog-from-git-commits-generator","commit_stats":null,"previous_names":["simpert/changelog-from-git-commits-generator"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RuntimeRascal%2Fchangelog-from-git-commits-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RuntimeRascal%2Fchangelog-from-git-commits-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RuntimeRascal%2Fchangelog-from-git-commits-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RuntimeRascal%2Fchangelog-from-git-commits-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RuntimeRascal","download_url":"https://codeload.github.com/RuntimeRascal/changelog-from-git-commits-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243715922,"owners_count":20336046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-22T01:14:25.818Z","updated_at":"2025-03-15T10:26:37.692Z","avatar_url":"https://github.com/RuntimeRascal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Changelog From Git Commits Generator\nA simple module that generates a changelog in markdown from all your projects git commits\n\n*This project was influenced by https://github.com/lob/generate-changelog#readme*  \n\n\u003e There are a ton of changelog generators out there and I tried many before decideing to create one. Where others failed fort was with accomodating Azure-DevOps repositories. The generators create links to issues (work items in devops) as well links to commits and tags and such. Most generators failed to create proper links for devops. Github, bitbucket, vsts, etc. use a different url and naming to access things in the repository. Also, a bit more control on what to write to the changelog seemed rational.  \n\n## Structure\n- `lib/git.ts` gets all the `git` commit data from your repo.\n- `lib/writer.ts` generates the changelog contents and writes it to disk\n- `lib/cli.ts` generates the help and options avail on command line\n\n\n## Using\nThis will generate from all commmits in your repository. NOT JUST SINCE LAST TAG. There are plans to offer major, minor and patch flags to control wether to just append to the an existing file limited commits.  \n\nI had a difficult time figuring out how to display the current commits from the last tag to the current head so I ended up probing the version from the `package.json` and placing all commits from last known tag under the current version. This is where it got difficult for me to append to an existing `changelog` file since after we bump the version and make a new tag the commits previously put in the top of changlog would then need to be compared and possible moved if the tag was different.\n\nCurrently, the command is run from the `post-commit` `git hook`. This ensures that the changlog is always up to date.  \n\nThe hook is registered via `Husky`. I dont know much about `git` or hooks but this seems to work well.  \n\n\u003e So far, there are links for a git repo that I tested with this repo in `Github` and also `Azure DevOps` formely known as `Vsts`. The links are quite a bit different between different source control providers but this was wrote for a vsts project. To provide links to such as issues or work items and commits or tags there is a constant object called `links` in the `writer.ts` file. Just determine the link format and add another section to provide links for another source control site. Also, add the repo type in the `RepoType` enum in the `interfaces.ts` file.  \n\n\nexecute `--help` to see available options  \n\n\n\u003e if you dont like provided tons of command line arguments to configure the command, you can place a config section in your `package.json` or provid the configuration in a `.changelog-from-git-rc` file \n\n`package.json`: \n```\n  \"changelog-from-git\": {\n    \"verbose\": false,\n    \"version\": \"\",\n    \"repoUrl\": \"\",\n    \"repoType\": \"git\",\n    \"file\": \"CHANGELOG.md\",\n    \"projectName\": \"\",\n    \"hideEmptyVersions\": false,   \n    \"hideUnparsableCommit\": false,\n    \"hideAuthorName\": false,\n    \"hideFeatType\": false,\n    \"hideFixType\": false,\n    \"hidePerfType\": false,\n    \"hideDocsType\": false,\n    \"hideStyleType\": false,\n    \"hideRefactorType\": false,\n    \"hideTestType\": false,\n    \"hideChoreType\": false,\n    \"hideBreakingType\": false,\n    \"hideBuildType\": false,\n    \"hideCliType\": false,\n    \"hideRevertType\": false,  \n    \"hideOtherType\": false\n}\n```\n\n`.changelog-from-git-rc`: \n```\n{\n    \"verbose\": false,\n    \"version\": \"\",\n    \"repoUrl\": \"\",\n    \"repoType\": \"git\",\n    \"file\": \"CHANGELOG.md\",\n    \"projectName\": \"\",\n    \"hideEmptyVersions\": false,   \n    \"hideUnparsableCommit\": false,\n    \"hideAuthorName\": false,\n    \"hideFeatType\": false,\n    \"hideFixType\": false,\n    \"hidePerfType\": false,\n    \"hideDocsType\": false,\n    \"hideStyleType\": false,\n    \"hideRefactorType\": false,\n    \"hideTestType\": false,\n    \"hideChoreType\": false,\n    \"hideBreakingType\": false,\n    \"hideBuildType\": false,\n    \"hideCliType\": false,\n    \"hideRevertType\": false,  \n    \"hideOtherType\": false\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruntimerascal%2Fchangelog-from-git-commits-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruntimerascal%2Fchangelog-from-git-commits-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruntimerascal%2Fchangelog-from-git-commits-generator/lists"}