Skip to content

Commit

Permalink
feat!: complete rewrite code and output (#10)
Browse files Browse the repository at this point in the history
Completely rewrite the code and the output. The changes are inspired by the [@svitejs/changesets-changelog-github-compact](https://github.com/svitejs/changesets-changelog-github-compact) package.
  • Loading branch information
mheob committed Oct 21, 2022
1 parent 74223f7 commit 35883d7
Show file tree
Hide file tree
Showing 10 changed files with 486 additions and 435 deletions.
5 changes: 5 additions & 0 deletions .changeset/nine-bikes-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@mheob/changeset-changelog': major
---

complete rewrite of the code and output
66 changes: 57 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# `@mheob/changeset-changelog` - My changelog for `changesets`
# `@mheob/changeset-changelog`

[![Release](https://github.com/mheob/changeset-changelog/actions/workflows/release.yml/badge.svg)](https://github.com/mheob/changeset-changelog/actions/workflows/release.yml)
[![Check](https://github.com/mheob/changeset-changelog/actions/workflows/check.yml/badge.svg)](https://github.com/mheob/changeset-changelog/actions/workflows/check.yml)
[![codecov](https://codecov.io/gh/mheob/changeset-changelog/branch/main/graph/badge.svg?token=E7RZLWHMEX)](https://codecov.io/gh/mheob/changeset-changelog)

Add my own style for the changelogs generated by the awesome [changesets](https://github.com/changesets/changesets) library. The
style was inspired by the original
[@changesets/changelog-github](https://github.com/changesets/changesets/tree/main/packages/changelog-github) package.
[@changesets/changelog-github](https://github.com/changesets/changesets/tree/main/packages/changelog-github) and the [@svitejs/changesets-changelog-github-compact](https://github.com/svitejs/changesets-changelog-github-compact) packages.

## Install
## Installation

### With NPM

Expand All @@ -30,12 +30,60 @@ pnpm add -D @mheob/changeset-changelog

## Usage

Add in your `.changeset/config.json` file the following snippet:
Set in your `.changeset/config.json` file the following snippet:

```jsonc
{
// ...
"changelog": ["@mheob/changeset-changelog", { "repo": "YOUR_USER/YOUR_REPO" }]
// ...
}
"changelog": ["@mheob/changeset-changelog", { "repo": "YOUR_ORG_OR_USER/YOUR_REPO" }]
```

### Output

<!-- markdownlint-disable MD042 -->

There are differences between this changelog output and the others:

### `@changesets/changelog-github`

- [#PR-ID](#) [`commit`](#) Thanks [@user](#)! - Add nice feature to the project with a PR and commit
- [`commit`](#) Thanks [@user](#)! - Add nice feature to the project without a PR

### `@svitejs/changesets-changelog-github-compact`

- Add nice feature to the project with a PR and commit ([#PR](#))
- Add nice feature to the project without a PR ([commit](#))

<!-- markdownlint-disable MD024 -->

### `@mheob/changeset-changelog`

<!-- markdownlint-enable MD024 -->

- Add nice feature to the project with a PR and commit --> ([#PR](#)) by [@user](#)
- Add nice feature to the project without a PR --> ([commit](#)) by [@user](#)

## Additional feature: linking issues

_Thanks to `@svitejs/changesets-changelog-github-compact` for this nice feature!_

All links to issues (or pull requests) in the chageset will automatically converted to a link.\
To enable the changeset have to called it like this variants:

- `(fix: #123)`,
- `(fixes: #123)`,
- `(resolves: #123)` or
- `(see: #123)`

### Example

The changeset

```yml
---
'@mheob/changeset-changelog': patch
---
Add nice feature to the project (see #123)
```

will outputted in the changelog like

> Add nice Feature to the project, (see [#123](#)) --> ([#130](#)) by [@user](#)
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@
},
"license": "MIT",
"author": "Alexander Böhm <tools@boehm.work>",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"scripts": {
"build": "tsup",
"changeset": "changeset",
Expand Down Expand Up @@ -53,7 +61,7 @@
"@mheob/eslint-config": "^3.0.0",
"@mheob/prettier-config": "^2.0.2",
"@mheob/tsconfig": "^1.0.1",
"@types/node": "^18.11.0",
"@types/node": "^18.11.3",
"@vitest/coverage-istanbul": "^0.24.3",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
Expand All @@ -67,6 +75,10 @@
"clean": true,
"entry": [
"src/index.ts"
],
"format": [
"esm",
"cjs"
]
}
}
Loading

0 comments on commit 35883d7

Please sign in to comment.