Should I change author in package.json after forking and improving a Github repo?
Asked Answered
B

1

24

I forked someone's repo and added functionality. The amount I contributed is just under half of all the functionality it now has.

In the fork in package.json, his name is still in the author field.

Should I change the author field to myself and add him as a contributor to the contributors field? Or should I leave the author field AS-IS and add me as a contributor?

Belsen answered 27/1, 2019 at 18:10 Comment(3)
That's a good question. It also happens when you're 2 people, co-authors of one package. Then what? I think the author key is not flexible enough. It should accept also an array of authors. In other cases, the author is merely the «creator» of the package, but not the author of most of the code. Not even 1%. The code will be totally transformed and won't be distributed in NPM. Example: project starters/generators... Starting a site with Gatsby, it generates a base project with the official boilerplate, but there is already an author in package.json. Then what?Tentation
contributors key (which is not even mentioned in official npm page about package.json) is like: «Hey, this people also did some work here»... but I'm still the main author. It's a difficult matter, I guess. Sorry for this not being an answer, but even more questions, @christiaan-westerbeek. Anyways, in that case, more or less 50% of code, you both should be on contributors (but there is the thing that contributors is not even parsed by NPM... As example, eslint package. List 3 persons (not authors key, not contributors not github.com/eslint/eslint/graphs/contributors).Tentation
Well, I was wrong. TIL: npm.github.io/using-pkgs-docs/package-json/… Even a maintainers key is mentioned. Maybe that key would be more appropiate for this (seems like it should have the same shape than contributors key).Tentation
G
4

So I just ran into this as well. Going off of @juanriqgon's comment, you could add contributors (in order of who contributed the most - maybe adding a note to the package for that).

{
  "contributors" : [
  {
    "name" : "Barney Rubble",
    "email" : "[email protected]",
    "url" : "http://barnyrubble.tumblr.com/"
  },  
  {
    "name" : "Newton Bubble",
    "email" : "[email protected]",
    "url" : "http://newtonbubble.tumblr.com/"
  }
 ]
}

source: https://docs.npmjs.com/cli/v7/configuring-npm/package-json#people-fields-author-contributors

hope this helps the community!

Garget answered 9/10, 2021 at 15:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.