jonschlinkert / normalize-pkg

Normalize values in package.json to improve compatibility, programmatic readability and usefulness with third party libs.
https://github.com/jonschlinkert
MIT License
18 stars 2 forks source link

try to extract homepage url from repository #8

Closed pdehaan closed 7 years ago

pdehaan commented 10 years ago

Similar to #7, but I think it'd be neat if normalize could detect that I don't have a homepage defined, then try and set a smart default if it can parse a GitHub URL from the repository (if it exists).

Relevant: https://github.com/visionmedia/node-github-url-from-git

Not sure how/if it should handle non-GitHub repo URIs since those may not always have a public HTTP site to point to.

jonschlinkert commented 10 years ago

I thought about this, but didn't do it b/c it seemed like it would be a craps shoot whether or not it would yield "correct" results. I think my opinion is skewed here though, my gh url is https://github.com/jonschlinkert, but the vast majority of the libs I publish are on other orgs.

It seems like maybe we should just implement it and add a flag for implementors or users to override. thougths?

pdehaan commented 10 years ago

Yeah, sounds good. I'm probably skewed in the opposite direction though where typically a module's homepage is set to the GitHub repo (not an authors homepage or some other page).

jonschlinkert commented 10 years ago

k, good to know

pdehaan commented 10 years ago

https://www.npmjs.org/doc/json.html#homepage

The url to the project homepage.

NOTE: This is not the same as "url". If you put a "url" field, then the registry will think it's a redirection to your package that has been published somewhere else, and spit at you.

Literally. Spit. I'm so not kidding.

jonschlinkert commented 10 years ago

lol, that always makes me laugh. This is in reference to the homepage field though, so we're good.

doowb commented 7 years ago

The homepage field is normalized using existing repository data now.