|
1 | 1 | # changeset-conventional-commits
|
2 | 2 |
|
| 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 | + |
3 | 55 | ## 0.2.4
|
4 | 56 |
|
5 | 57 | ### Patch Changes
|
|
0 commit comments