Skip to content

Commit 50bf163

Browse files
chore: version package (#30)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent e526cfb commit 50bf163

File tree

3 files changed

+53
-48
lines changed

3 files changed

+53
-48
lines changed

.changeset/wet-adults-taste.md

-47
This file was deleted.

CHANGELOG.md

+52
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,57 @@
11
# changeset-conventional-commits
22

3+
## 0.2.5
4+
5+
### Patch Changes
6+
7+
- [#27](https://github.com/iamchathu/changeset-conventional-commits/pull/27) [`e526cfb`](https://github.com/iamchathu/changeset-conventional-commits/commit/e526cfbaf8bed0b2ed5b44d0f94a9e7a0c041a27) Thanks [@mblackrittr](https://github.com/mblackrittr)! - fix: duplicate generation of changesets (#26)
8+
9+
The same changesets were generated again, because the duplicate detection failed on trailing line breaks (`\n`) it got from `git`.
10+
11+
<details>
12+
<summary>Details</summary>
13+
Imagine this data it holds while duplicate checking:
14+
15+
`const changesets = ...:`
16+
17+
```ts
18+
// Data from Commits
19+
[
20+
{
21+
releases: [[Object], [Object]],
22+
summary: "chore(root): add two test packages\n",
23+
packagesChanged: [[Object], [Object]],
24+
},
25+
];
26+
```
27+
28+
`const currentChangesets = ...:`
29+
30+
```ts
31+
// Data from Changesets
32+
[
33+
{
34+
releases: [[Object], [Object]],
35+
summary: "chore(root): add two test packages",
36+
packagesChanged: [[Object], [Object]],
37+
},
38+
];
39+
```
40+
41+
Truncating the linebreak at [line 165](https://github.com/iamchathu/changeset-conventional-commits/blob/a4d324693eca549b0d016a162442eef49477ec75/src/utils/index.ts#L165) of `src/utils/index.ts` fixed it:
42+
43+
```ts
44+
const compareChangeSet = (a: Changeset, b: Changeset): boolean => {
45+
// return a.summary === b.summary && JSON.stringify(a.releases) == JSON.stringify(b.releases);
46+
return (
47+
a.summary.replace(/\n$/, "") === b.summary &&
48+
JSON.stringify(a.releases) == JSON.stringify(b.releases)
49+
);
50+
};
51+
```
52+
53+
</details>
54+
355
## 0.2.4
456

557
### Patch Changes

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "changeset-conventional-commits",
3-
"version": "0.2.4",
3+
"version": "0.2.5",
44
"description": "Generate Changesets from conventional commits",
55
"homepage": "http://github.com/iamchathu/changeset-conventional-commits",
66
"main": "bin/index.js",

0 commit comments

Comments
 (0)