-
Notifications
You must be signed in to change notification settings - Fork 72
PD-242: Add Automatic Changelog Generation #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Changesets | ||
|
|
||
| Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works with mono-repos or single package repos to help you verion and release your code. You can find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
|
||
| We have a quick list of common questions to get you started engaging with this project in [our documentation](https://github.com/changesets/changesets/blob/master/docs/common-questions.md) |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| const changesetOptions = { | ||
| // If true, we will automatically commit the changeset when the command is run | ||
| commit: false, | ||
| }; | ||
|
|
||
| // This function takes information about a changeset to generate an entry for it in your | ||
| // changelog. We provide the full changeset object as well as the version. | ||
| // It may be a good idea to replace the commit hash with a link to the commit. | ||
|
|
||
| /* the default shape is: | ||
| ### Bump Type | ||
|
|
||
| - GIT_HASH: A summary message you wrote, indented? | ||
| */ | ||
|
|
||
| const getReleaseLine = async (changeset, type) => { | ||
| const [firstLine, ...futureLines] = changeset.summary | ||
| .split('\n') | ||
| .map(l => l.trimRight()); | ||
|
|
||
| return `- ${changeset.commit}: ${firstLine}\n${futureLines | ||
| .map(l => ` ${l}`) | ||
| .join('\n')}`; | ||
| }; | ||
|
|
||
| // This function takes information about what dependencies we are updating in the package. | ||
| // It provides an array of related changesets, as well as the dependencies updated. | ||
|
|
||
| /* | ||
| - Updated dependencies: [ABCDEFG]: | ||
| - Updated dependencies: [HIJKLMN]: | ||
| - [email protected] | ||
| - [email protected] | ||
| */ | ||
| const getDependencyReleaseLine = async (changesets, dependenciesUpdated) => { | ||
| if (dependenciesUpdated.length === 0) return ''; | ||
|
|
||
| const changesetLinks = changesets.map( | ||
| changeset => `- Updated dependencies [${changeset.commit}]:`, | ||
| ); | ||
|
|
||
| const updatedDepenenciesList = dependenciesUpdated.map( | ||
| dependency => ` - ${dependency.name}@${dependency.version}`, | ||
| ); | ||
|
|
||
| return [...changesetLinks, ...updatedDepenenciesList].join('\n'); | ||
| }; | ||
|
|
||
| const versionOptions = { | ||
| // If true, we will automatically commit the version updating when the command is run | ||
| commit: false, | ||
| // Adds a skipCI flag to the commit - only valid if `commit` is also true. | ||
| skipCI: false, | ||
| // Do not modify the `changelog.md` files for packages that are updated | ||
| updateChangelog: true, | ||
| // A function that returns a string. It takes in options about a change. This allows you to customise your changelog entries | ||
| getReleaseLine, | ||
| // A function that returns a string. It takes in options about when a pacakge is updated because | ||
| getDependencyReleaseLine, | ||
| // An array of arrays that defines packages that are linked. | ||
| // Linked packages are packages that should be at the same version when they're released. | ||
| // If you've used Lerna to version packages before, this is very similar. | ||
| linked: [[]], | ||
| }; | ||
|
|
||
| const publishOptions = { | ||
| // This sets whether unpublished packages are public by default. We err on the side of caution here. | ||
| public: false, | ||
| }; | ||
|
|
||
| module.exports = { | ||
| versionOptions, | ||
| changesetOptions, | ||
| publishOptions, | ||
| }; |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to also commit these changes too right?
When do we commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!