diff --git a/.changeset/clever-berries-pay.md b/.changeset/clever-berries-pay.md deleted file mode 100644 index 70517cd..0000000 --- a/.changeset/clever-berries-pay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mheob/changeset-changelog': patch ---- - -Just a test of the new changelog diff --git a/.changeset/shy-eels-pretend.md b/.changeset/shy-eels-pretend.md new file mode 100644 index 0000000..00c13aa --- /dev/null +++ b/.changeset/shy-eels-pretend.md @@ -0,0 +1,5 @@ +--- +'@mheob/changeset-changelog': minor +--- + +Improve changelog output diff --git a/.changeset/twelve-rats-repair.md b/.changeset/twelve-rats-repair.md deleted file mode 100644 index a845151..0000000 --- a/.changeset/twelve-rats-repair.md +++ /dev/null @@ -1,2 +0,0 @@ ---- ---- diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a0c580a..9262da2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,6 +45,7 @@ jobs: commit: "chore(release): bump version and deploy" title: "chore(release): bump version and deploy" publish: pnpm run release + version: pnpm run version-packages env: GITHUB_TOKEN: ${{ secrets.MACHINE_USER_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.prettierignore b/.prettierignore index 8bcf429..e84d6ba 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,6 +4,3 @@ dist # dependencies node_modules pnpm-lock.yaml - -# changelog -CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md index dc7d95e..f09a5d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,4 +4,6 @@ ### Major Changes -- Initial creation of the package ([[#1](https://github.com/mheob/changeset-changelog/pull/1)] - Thanks [@mheob](https://github.com/mheob)!) +- Initial creation of the package --> ([#1](https://github.com/mheob/changeset-changelog/pull/1)) + [`57d3b5`](https://github.com/mheob/changeset-changelog/commit/57d3b5c57cf4126c0fdd54d10d51969fe5280fa7) by + [@mheob](https://github.com/mheob)) diff --git a/package.json b/package.json index 78664b9..ad26cbf 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "test": "vitest", "test:cov": "vitest run --coverage", "test:run": "vitest run", - "test:ui": "vitest --ui" + "test:ui": "vitest --ui", + "version-packages": "changeset version && pnpm run format" }, "commitlint": { "extends": [ diff --git a/src/index.test.ts b/src/index.test.ts index 8f1e546..3e1a262 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -111,7 +111,7 @@ describe('getReplacedChangelog', () => { ); const result = await getReleaseLine(changeset, 'minor', { repo: data.repo }); expect(result).toBe( - '\n- An awesome feature. ([[#2](https://github.com/mheob/changeset-changelog/pull/2)] [`38f35f8`](https://github.com/mheob/changeset-changelog/commit/38f35f8) by [@mheob](https://github.com/mheob))\n', + '\n- An awesome feature. --> ([#2](https://github.com/mheob/changeset-changelog/pull/2)) [`38f35f8`](https://github.com/mheob/changeset-changelog/commit/38f35f8) by [@mheob](https://github.com/mheob)\n', ); }); @@ -119,7 +119,7 @@ describe('getReplacedChangelog', () => { const changeset = getChangeset('An awesome feature.', data.commit); const result = await getReleaseLine(changeset, 'minor', { repo: data.repo }); expect(result).toBe( - '\n- An awesome feature. ([[#2](https://github.com/mheob/changeset-changelog/pull/2)] [`38f35f8`](https://github.com/mheob/changeset-changelog/commit/38f35f8) by [@mheob](https://github.com/mheob))\n', + '\n- An awesome feature. --> ([#2](https://github.com/mheob/changeset-changelog/pull/2)) [`38f35f8`](https://github.com/mheob/changeset-changelog/commit/38f35f8) by [@mheob](https://github.com/mheob)\n', ); }); diff --git a/src/index.ts b/src/index.ts index 9780cd9..6a51efe 100644 --- a/src/index.ts +++ b/src/index.ts @@ -46,8 +46,8 @@ export const getReleaseLine: GetReleaseLine = async (changeset, _type, options) const userLink = getUserLink(usersFromSummary, user); const [firstLine, ...futureLines] = replacedChangelog.split('\n').map((line) => line.trimEnd()); - const suffix = [pull ? `[${pull}]` : '', commit ?? '', userLink ?? ''].join(' '); - const suffixedMessage = suffix.trim() ? ` (${suffix})` : ''; + const suffix = [pull ? `(${pull})` : '', commit ?? '', userLink ?? ''].join(' '); + const suffixedMessage = suffix.trim() ? ` --> ${suffix}` : ''; const futureLinesMessage = futureLines.map((line) => ` ${line}`).join('\n'); return `\n- ${firstLine}${suffixedMessage}\n${futureLinesMessage}`;