hay / wiki-tools

Code for my Wikimedia Labs Tools account
http://tools.wmflabs.org/hay
90 stars 26 forks source link

Support existing package metadata format in addition to toolinfo.json #57

Closed nichtich closed 4 years ago

nichtich commented 4 years ago

Developers are lazy and try to avoid duplication. Why not allow to point to existing software metadata files to remove the need to create another metadata set that may get out of sync with the primary file?

hay commented 4 years ago

Hey, thanks for bringing this up. I understand the idea, however i don't believe this is a good idea for a couple of reasons.

The toolinfo.json format is based on existing formats like the ones you mention, however, those formats were intended for a developer audience. The audience for toolinfo.json is broader, it also includes non-technical users. The text for a description-like field might be completely different for those two audiences.

Every programming language has a different format for packaging, sometimes even multiple ones. Converting those formats 'cleverly' might cause bugs and will introduce extra complexity in the code. Note that some formats, like Pythons setup.py are far more complex to parse than simple JSON files.

However, there's nothing from stopping you to include the default toolinfo.json fields in your package.json and pointing the crawler to that file (if it is hosted over http). The filename is just a convention, the crawler will take any random URL as long as it is valid JSON and contains the necessary fields.