Skip to content
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

Merged
merged 1 commit into from
Sep 2, 2020

Commits on Sep 1, 2020

  1. chore(release): update contributors when publishing a release

    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?
    devoto13 committed Sep 1, 2020
    Configuration menu
    Copy the full SHA
    1cb3d18 View commit details
    Browse the repository at this point in the history