-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING: Format changelog using Prettier (#100)
- Loading branch information
Showing
8 changed files
with
119 additions
and
500 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ | |
"@types/jest": "^29.5.10", | ||
"@types/jest-when": "^3.5.2", | ||
"@types/node": "^17.0.23", | ||
"@types/prettier": "^2.7.3", | ||
"@types/rimraf": "^4.0.5", | ||
"@types/which": "^3.0.0", | ||
"@types/yargs": "^17.0.10", | ||
|
@@ -75,6 +76,9 @@ | |
"tsx": "^4.6.1", | ||
"typescript": "~5.1.6" | ||
}, | ||
"peerDependencies": { | ||
"prettier": "^2" | ||
}, | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
"node": "^16.20 || ^18.16 || >=20" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -302,7 +302,9 @@ describe('create-release-branch (functional)', () => { | |
## [Unreleased] | ||
## [2.0.0] | ||
### Uncategorized | ||
- Update "a" | ||
- Initial commit | ||
|
@@ -317,7 +319,9 @@ describe('create-release-branch (functional)', () => { | |
## [Unreleased] | ||
## [2.0.0] | ||
### Uncategorized | ||
- Initial commit | ||
[Unreleased]: https://github.com/example-org/example-repo/compare/@scope/[email protected] | ||
|
@@ -362,7 +366,9 @@ describe('create-release-branch (functional)', () => { | |
## [Unreleased] | ||
## [1.0.0] | ||
### Added | ||
- Initial release | ||
[Unreleased]: https://github.com/example-org/example-repo/compare/@scope/[email protected] | ||
|
@@ -376,7 +382,9 @@ describe('create-release-branch (functional)', () => { | |
## [Unreleased] | ||
## [1.0.0] | ||
### Added | ||
- Initial release | ||
[Unreleased]: https://github.com/example-org/example-repo/compare/@scope/[email protected] | ||
|
@@ -413,11 +421,15 @@ describe('create-release-branch (functional)', () => { | |
## [Unreleased] | ||
## [2.0.0] | ||
### Uncategorized | ||
- Update "a" | ||
## [1.0.0] | ||
### Added | ||
- Initial release | ||
[Unreleased]: https://github.com/example-org/example-repo/compare/@scope/[email protected] | ||
|
@@ -432,7 +444,9 @@ describe('create-release-branch (functional)', () => { | |
## [Unreleased] | ||
## [1.0.0] | ||
### Added | ||
- Initial release | ||
[Unreleased]: https://github.com/example-org/example-repo/compare/@scope/[email protected] | ||
|
@@ -486,7 +500,9 @@ describe('create-release-branch (functional)', () => { | |
## [Unreleased] | ||
## [1.0.0] | ||
### Added | ||
- Initial release | ||
[Unreleased]: https://github.com/example-org/example-repo/compare/@scope/[email protected] | ||
|
@@ -522,7 +538,9 @@ describe('create-release-branch (functional)', () => { | |
## [Unreleased] | ||
## [1.0.0] | ||
### Uncategorized | ||
- Update "a" | ||
[Unreleased]: https://github.com/example-org/example-repo/compare/@scope/[email protected] | ||
|
@@ -536,7 +554,9 @@ describe('create-release-branch (functional)', () => { | |
## [Unreleased] | ||
## [1.0.0] | ||
### Added | ||
- Initial release | ||
[Unreleased]: https://github.com/example-org/example-repo/compare/@scope/[email protected] | ||
|
@@ -773,7 +793,9 @@ describe('create-release-branch (functional)', () => { | |
## [Unreleased] | ||
## [2.0.0] | ||
### Uncategorized | ||
- Update "a" | ||
- Initial commit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ import { | |
createNoopWriteStream, | ||
} from '../tests/unit/helpers.js'; | ||
import { | ||
formatChangelog, | ||
readMonorepoRootPackage, | ||
readMonorepoWorkspacePackage, | ||
updatePackage, | ||
|
@@ -494,11 +495,15 @@ describe('package', () => { | |
## [Unreleased] | ||
## [2.0.0] | ||
### Uncategorized | ||
- Add isNewFunction ([#2](https://repo.url/compare/package/pull/2)) | ||
## [1.0.0] - 2020-01-01 | ||
### Changed | ||
- Something else | ||
[Unreleased]: https://repo.url/compare/[email protected] | ||
|
@@ -572,6 +577,7 @@ describe('package', () => { | |
projectRootDirectory: sandbox.directoryPath, | ||
repoUrl: 'https://repo.url', | ||
tagPrefixes: ['package@', 'v'], | ||
formatter: formatChangelog, | ||
}) | ||
.mockResolvedValue('new changelog'); | ||
await fs.promises.writeFile(changelogPath, 'existing changelog'); | ||
|
@@ -610,6 +616,7 @@ describe('package', () => { | |
projectRootDirectory: sandbox.directoryPath, | ||
repoUrl: 'https://repo.url', | ||
tagPrefixes: ['package@', 'v'], | ||
formatter: formatChangelog, | ||
}) | ||
.mockResolvedValue(undefined); | ||
await fs.promises.writeFile(changelogPath, 'existing changelog'); | ||
|
@@ -673,4 +680,30 @@ describe('package', () => { | |
}); | ||
}); | ||
}); | ||
|
||
describe('formatChangelog', () => { | ||
it('formats a changelog', () => { | ||
const unformattedChangelog = `# Changelog | ||
## 1.0.0 | ||
- Some change | ||
## 0.0.1 | ||
- Some other change | ||
`; | ||
|
||
expect(formatChangelog(unformattedChangelog)).toMatchInlineSnapshot(` | ||
"# Changelog | ||
## 1.0.0 | ||
- Some change | ||
## 0.0.1 | ||
- Some other change | ||
" | ||
`); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.