# **@inett/semantic-release-unsquash**

**This is a fork of [semantic-release-unsquash](https://www.npmjs.com/package/semantic-release-unsquash) by [romap0](https://www.npmjs.com/~romap0)** with built-in `commit-analyzer` **and** `release-notes-generator` support and opinionated defaults.

---

A tiny wrapper for [commit-analyzer](https://github.com/semantic-release/commit-analyzer) and [release-notes-generator](https://github.com/semantic-release/release-notes-generator) which works with **squashed merge requests** (e.g. GitLab or GitHub squash commits).  
It "unsquashes" the original commits from the squash message and feeds them to the underlying plugins.

---

## 🚀 Features

- Parses `* commit` style squash messages
- Built-in `commitAnalyzerConfig` and `notesGeneratorConfig`
- Supports GitHub and GitLab squash commit templates
- Optional override via plugin config in `package.json`

---

## 📦 Install

```bash
npm install -D @inett/semantic-release-unsquash
```

---

## 🔧 Usage

```json
{
  "plugins": ["@inett/semantic-release-unsquash"]
}
```

✨ You don't need to provide extra configuration — the plugin uses sensible defaults for:

- Conventional Commits parsing
- Release rules
- Changelog section titles
- Breaking change keywords

---

## ⚙️ Optional Overrides

If you want to override or extend the defaults:

```json
{
  "plugins": [
    [
      "@inett/semantic-release-unsquash",
      {
        "commitAnalyzerConfig": {
          "releaseRules": [{ "type": "deps", "release": "patch" }]
        },
        "notesGeneratorConfig": {
          "presetConfig": {
            "types": [
              { "type": "deps", "section": "📦 Dependencies", "hidden": false }
            ]
          }
        }
      }
    ]
  ]
}
```

---

## 💡 Usage with GitHub

GitHub automatically adds a list of original commits to the squash message. This plugin will parse those and pass them on to semantic-release.

---

## 💡 Usage with GitLab

To enable unsquashing, set your squash commit template in **Project Settings → Merge Requests** to:

```text
%{title}

%{all_commits}
```
