# conventional-logs

> A project designed to generate changelogs while following Conventional Commit Specifications to make version release and documentation easier.

Latest version **1.3.8** (published 2024-08-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install conventional-logs
pnpm add conventional-logs
yarn add conventional-logs
bun add conventional-logs
```

Provides the command `cologs`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.8 |
| Published | 2024-08-16 |
| First published | 2023-08-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 31 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ethan Jones |
| Maintainers | freebishop |

## Links

- npm: https://www.npmjs.com/package/conventional-logs
- Repository: https://github.com/FreeBishop/conventional-logs
- Homepage: https://github.com/FreeBishop/conventional-logs.git#readme
- Issues: https://github.com/FreeBishop/conventional-logs/issues
- npm.io page: https://npm.io/package/conventional-logs

## Recent versions

- 1.3.8 (latest) — 2024-08-16
- 1.3.7 — 2024-08-02
- 1.3.6 — 2024-08-02
- 1.3.5 — 2024-07-12
- 1.3.2 — 2024-04-12
- 1.2.2 — 2023-08-25
- 1.1.2 — 2023-08-14
- 1.0.2 — 2023-08-10
- 1.0.1 — 2023-08-10
- 1.0.0 — 2023-08-09

## README

# Conventional-Logs

This package is a CLI utility tool for generating a CHANGELOG using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification as a basis. By writing clean commits, it allows smaller projects to document changes between versions and update the Semantic Version accordingly.

## Installing Conventional-Logs

This [package](https://www.npmjs.com/package/conventional-logs) can be installed locally to `devDependencies`:

```bash
npm i -D conventional-logs
```

The package can be executed through an `package.json` script, or directly in the terminal:

```json
"scripts": {
    "updateChangelog": "npx cologs"
}
```

## How it Works

1. A user performs a `merge --squash` on a branch into the master branch, followed by a commit that matches [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) specifications.
2. Assuming the main branch is ready to be released, the user runs `cologs` to parse main branch commits to then add to the local CHANGELOG.md.
3. `cologs` will automatically bump the package.json version appropriately and commit the changes to CHANGELOG.md.
4. The CHANGELOG.md commit will be given a git tag of `v<version_number>` for future reference.

## Initializing CHANGELOG.md and First Release

This will create the CHANGELOG.md file for the first release of the project. Conventional-Logs will use the package.json version declared by the user as the intial release.

```bash
npm cologs --first-release
```

Once the first git tag is created, subsequent calls to `cologs` will add all commit messages to CHANGELOG.md since the previous tag.

## Specifying Additional Files for Version Updates with `--bumpList`

Some projects can have files that need to have an internal version number updated to match packge.json. An additional configuration file can be defined anywhere in the project to specify these files.

```bash
mkdir configDir # An exmaple directory where bumpList.json is stored
```

Create a file name `bumpList.json` and create a single property called `files` with a value containing an array of strings. Each string entry is the an name of the file that needs an internal version number updated.

```json
{
  "files": ["fileToUpdateOne.json", "fileToUpdateTwo.json"]
}
```

Conventional Logs will do a recursive search to find the location of these files during runtime. Only the name of the file should be provided, and should not include the local or absolute path. Internally, regex is used to identify a SemVer pattern in the file to change the number to the updated package.json version number.

The `--bumpList` flag can then be used, followed by the absolute path to the `bumpList.json`. the forward slash must be ommited.

```bash
npx cologs --bumpList configDir/bumpList.json
```

---
_Source: https://npm.io/package/conventional-logs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
