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

Clean up package.json across all repositories #55

Closed
janpio opened this issue Nov 24, 2018 · 15 comments
Closed

Clean up package.json across all repositories #55

janpio opened this issue Nov 24, 2018 · 15 comments
Labels
enhancement New feature or request

Comments

@janpio
Copy link
Member

janpio commented Nov 24, 2018

Laborious task:

Go through all package.json files for all repositories and clean them up. Remove things like

  "bugs": {
    "url": "https://issues.apache.org/jira/browse/CB"
  },

or other unneeded entries.

Might require some discussion on what to remove and keep first.

@oliversalzburg
Copy link

Should the bugs entry be removed or updated to the correct GitHub location?

@janpio
Copy link
Member Author

janpio commented Nov 26, 2018

Depends on where this is actually used - one would have to research that.
In general: Smaller file with less unnecessary stuff is better of course.

@oliversalzburg
Copy link

npm bugs cordova

@janpio
Copy link
Member Author

janpio commented Nov 26, 2018

@janpio janpio added the enhancement New feature or request label Apr 10, 2019
@raphinesse
Copy link
Contributor

We should not remove the bugs entry, but check that the URL is up-to date and use the short notation where possible. @erisu has done a lot of work on this already.

One thing I would love to see removed are the excessively long and outdated lists of contributors in some package.json files. Any objections against that?

Another thing would be consistent ordering of keys. sort-package-json can do that automatically. The ordering of the keys cannot be configured but it makes sense to me most of the time.

If we assemble a list of things to change, we could tag this for hacktoberfest.

@erisu
Copy link
Member

erisu commented Sep 23, 2020

+1 on removing the contributors section of the package.json

I am OK with resorting the keys to be in order. I am also not against defining a manual order to be consistent across repos.. Having like items grouped together and the relevant information at top, etc... But obviously sorting alphabetical would be the quickest and easiest.

@timbru31
Copy link
Member

timbru31 commented Sep 23, 2020

+1 on contributors, too.

We should also not forget to update the URLs in the plugin.xml file, many of them still have the JIRA URLs listed.

But yes, a good task for the Hacktoberfest to get an into the different Cordova repos.

@raphinesse
Copy link
Contributor

I am OK with resorting the keys to be in order. I am also not against defining a manual order to be consistent across repos.. Having like items grouped together and the relevant information at top, etc... But obviously sorting alphabetical would be the quickest and easiest.

sort-package-json does not sort alphabetically but according to a predefined logical order. See https://www.npmjs.com/package/sort-package-json#usage for a small example.

@raphinesse
Copy link
Contributor

I've written a little script that will perform the desired changes in an automated fashion. I will still create PRs for the changes.

Right now I plan on doing two PRs (since the second one could be controversial):

PR 1

  • use short notation for repository field
  • use short notation for bugs field

PR 2

  • set author field to "Apache Software Foundation"
    (This is what is used in most packages. How about using "Apache Cordova Team" instead?)
  • remove contributors field
    (@purplecabbage @dpogue You OK with that? You appear in at least some of them...)

If we agree on these changes up front, I could also throw these all into one PR per repo. Would be less work for everyone.

Regarding the sorting: I tried sort-package-json on one of our files and I don't really like the ordering it enforces. I found out that there's also https://www.npmjs.com/package/format-package which has a configurable ordering. But right now I would definitely postpone that part.

Any changes that should be added to PRs 1&2?

@dpogue
Copy link
Member

dpogue commented Sep 23, 2020

  • remove contributors field
    (@purplecabbage @dpogue You OK with that? You appear in at least some of them...)

I'm okay with that. Those contributor lists have not been maintained since the early days, so removing them is probably best.

@timbru31
Copy link
Member

Does your script also fix the URLs of the bug report and git? Some of the projects might have the JIRA URL (https://github.com/apache/cordova-plugin-battery-status/blob/master/package.json#L20) or even the old https://git-wip-us.apache.org/repos/asf/... URLs

@raphinesse
Copy link
Contributor

Does your script also fix the URLs of the bug report and git? Some of the projects might have the JIRA URL (https://github.com/apache/cordova-plugin-battery-status/blob/master/package.json#L20) or even the old https://git-wip-us.apache.org/repos/asf/... URLs

Yes

@raphinesse
Copy link
Contributor

Thanks for the input and reviews. Can we close this as resolved? Or are there still things that need to be addressed? Like a consistent ordering of the fields in our package.json files, for example...

@raphinesse
Copy link
Contributor

Should anyone be curious, these are the scripts I used to automate these changes.

@erisu
Copy link
Member

erisu commented Oct 3, 2020

consistent ordering of the fields

I think consistent ordering would be nice to have, but I don't think it is necessary to keep this ticket open anymore.

raphinesse added a commit to raphinesse/cordova-electron that referenced this issue Oct 3, 2020
raphinesse added a commit to raphinesse/cordova-test-platform that referenced this issue Oct 3, 2020
raphinesse added a commit to raphinesse/cordova-test-platform that referenced this issue Oct 3, 2020
raphinesse added a commit to raphinesse/cordova-test-platform that referenced this issue Oct 3, 2020
raphinesse added a commit to apache/cordova-plugin-splashscreen that referenced this issue Oct 3, 2020
raphinesse added a commit to raphinesse/cordova-js that referenced this issue Oct 3, 2020
raphinesse added a commit to apache/cordova-js that referenced this issue Oct 4, 2020
raphinesse added a commit to apache/cordova-electron that referenced this issue Oct 4, 2020
raphinesse added a commit to apache/cordova-plugin-splashscreen that referenced this issue Oct 4, 2020
raphinesse added a commit to apache/cordova-test-platform that referenced this issue Oct 4, 2020
* chore(pkg): remove field "maintainers"
* chore(pkg): remove default-valued field "homepage"
* fix(pkg): fix declaration for binary "create"

Related to apache/cordova#55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants