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
chore(release): update contributors when publishing a release #3552
Conversation
Grunt release publishing [used to](https://github.com/karma-runner/karma/blob/master/gruntfile.js#L103) update `contributors` in `package.json`, but this feature has been lost during the migration to `semantic-release`. This PR restores the same logic in `semantic-release` plugin. I considered using [semantic-release-contributors](https://www.npmjs.com/package/semantic-release-contributors) first, but it has couple of issues: - it only adds contributors since last release, so can not restore contributors, who were missed while semantic-release was used for publishing - it parses author data from commit and then serializes it back, which in some cases produces wrong results (e.g. David Jensen <david@frode.(none)> becomes an empty string, because parsing silently fails) Because of the above issues I've re-implemented logic from the [Grunt plugin](https://github.com/vojtajina/grunt-npm/blob/master/tasks/npm.js#L90) as a semantic-release plugin and applied changes produced by it. There are a many changes to existing contributors, because current logic sorts them by the amount of commits. I'm open for feedback what is the best approach here: sort alphabetically, historically or something else? Maybe get rid of this field altogether as contributors are visible in GitHub and NPM does not seem to display them anywhere on the website? I've checked couple of packages from my project and they don't seem to include this field: - @auth0/auth0-spa-js - only has `"author": "Auth0"` - @angular/core - only has `"author": "angular"` - @angular/cli - only has `"author": "Angular Authors"` - @ng-bootstrap/ng-bootstrap - points to GitHub: `"author": "https://github.com/ng-bootstrap/ng-bootstrap/graphs/contributors"` I actually like the last option as it still gives credit to contributors without having to maintain the list in two places. WDYT?
✅ Build karma 351 completed (commit 2cb4e423f5 by @devoto13) |
✅ Build karma 350 completed (commit 2cb4e423f5 by @devoto13) |
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.
Placing this code in karma-runner/karma could be an issue if we want leverage it for karma-runner/karma-jasmine and similar subprojects.
The last part of the commit message confuses me. "Maybe get rid of this field..." ? The rest of the description and the commit itself is about the contributors field in the package.json. What is the last bit about?
@johnjbarton It's just a last minute thought that crossed my mind after I have finished the implementation. Maybe it is better to remove I've checked couple of popular projects from my project's dependencies and discovered that they don't have |
Perhaps it's not vital to have the contributors list, but since you fixed it let's let it be for now. |
🎉 This PR is included in version 5.2.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…runner#3552) Grunt release publishing [used to](https://github.com/karma-runner/karma/blob/master/gruntfile.js#L103) update `contributors` in `package.json`, but this feature has been lost during the migration to `semantic-release`. This PR restores the same logic in `semantic-release` plugin. I considered using [semantic-release-contributors](https://www.npmjs.com/package/semantic-release-contributors) first, but it has couple of issues: - it only adds contributors since last release, so can not restore contributors, who were missed while semantic-release was used for publishing - it parses author data from commit and then serializes it back, which in some cases produces wrong results (e.g. David Jensen <david@frode.(none)> becomes an empty string, because parsing silently fails) Because of the above issues I've re-implemented logic from the [Grunt plugin](https://github.com/vojtajina/grunt-npm/blob/master/tasks/npm.js#L90) as a semantic-release plugin and applied changes produced by it. There are a many changes to existing contributors, because current logic sorts them by the amount of commits.
Grunt release publishing used to update
contributors
inpackage.json
, but this feature has been lost during the migration tosemantic-release
. This PR restores the same logic insemantic-release
plugin.I considered using semantic-release-contributors first, but it has couple of issues:
Because of the above issues I've re-implemented logic from the Grunt plugin as a semantic-release plugin and applied changes produced by it.
There are a many changes to existing contributors, because current logic sorts them by the amount of commits. I'm open for feedback what is the best approach here: sort alphabetically, historically or something else?
Maybe get rid of this field altogether as contributors are visible in GitHub and NPM does not seem to display them anywhere on the website? I've checked couple of packages from my project and they don't seem to include this field:
"author": "Auth0"
"author": "angular"
"author": "Angular Authors"
"author": "https://github.com/ng-bootstrap/ng-bootstrap/graphs/contributors"
I actually like the last option as it still gives credit to contributors without having to maintain the list in two places. WDYT?