-
Notifications
You must be signed in to change notification settings - Fork 137
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
Use a custom changelog line generator function to avoid adding meaningless changelog entries #1409
Merged
NullVoxPopuli
merged 3 commits into
embroider-build:main
from
NullVoxPopuli:ignore-the-dependency-release-line-logic
May 8, 2023
Merged
Changes from all commits
Commits
Show all changes
3 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 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,43 @@ | ||
'use strict'; | ||
|
||
/** | ||
* Modified version of | ||
* https://github.com/changesets/changesets/blob/main/packages/changelog-git/src/index.ts | ||
* | ||
* This is because we do not add changelog entries per-PR (upon merge), and we instead add them | ||
* later, (per changeset-recover, https://github.com/nullvoxpopuli/changeset-recover) | ||
* | ||
* All of the built-in changelog line generators provided by changesets assume a | ||
* "add changeset before merge" workflow, and add git/github references accordingly. | ||
* | ||
* Here, we ignore the commit, and just use the changeset summary. | ||
* | ||
* See docs here: https://github.com/changesets/changesets/blob/main/docs/modifying-changelog-format.md | ||
*/ | ||
async function getReleaseLine(changeset, _type) { | ||
let [firstLine, ...futureLines] = changeset.summary.split('\n').map(l => l.trimRight()); | ||
|
||
let returnVal = firstLine; | ||
|
||
if (futureLines.length > 0) { | ||
returnVal += `\n${futureLines.map(l => ` ${l}`).join('\n')}`; | ||
} | ||
|
||
return returnVal; | ||
} | ||
|
||
async function getDependencyReleaseLine(changesets, dependenciesUpdated) { | ||
if (dependenciesUpdated.length === 0) return ''; | ||
|
||
let changesetLinks = [`- Updated dependencies`]; | ||
let updatedDependenciesList = dependenciesUpdated.map( | ||
dependency => ` - ${dependency.name}@${dependency.newVersion}` | ||
); | ||
|
||
return [...changesetLinks, ...updatedDependenciesList].join('\n'); | ||
} | ||
|
||
module.exports = { | ||
getReleaseLine, | ||
getDependencyReleaseLine, | ||
}; |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": "@changesets/changelog-git", | ||
"changelog": "./changelog.cjs", | ||
"commit": false, | ||
"fixed": [["@embroider/compat", "@embroider/core", "@embroider/test-setup", "@embroider/webpack"]], | ||
"access": "public", | ||
|
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 |
---|---|---|
|
@@ -59,20 +59,19 @@ | |
"**/graceful-fs": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"@changesets/changelog-github": "^0.4.7", | ||
"@changesets/cli": "^2.25.0", | ||
"@types/jest": "^29.2.0", | ||
"@typescript-eslint/eslint-plugin": "^4.1.1", | ||
"@typescript-eslint/parser": "^4.1.1", | ||
"changeset-recover": "0.1.0-beta.10", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. using the yarn CLI sorted this file |
||
"concurrently": "^7.2.1", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^7.14.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-import": "^2.22.0", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"changeset-recover": "0.1.0-beta.10", | ||
"patch-package": "^6.5.1", | ||
"jest": "^29.2.1", | ||
"patch-package": "^6.5.1", | ||
"prettier": "^2.3.1", | ||
"typescript": "4.4.2" | ||
}, | ||
|
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
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.
unused