nice-registry / nice-package

📦 Clean up messy package metadata from the npm registry
35 stars 7 forks source link

Add check for doc.dist-tags.latest #9

Closed pdehaan closed 8 years ago

zeke commented 8 years ago

Thanks! Landed in 1.2.1

Out of curiosity, what are you using nice-package for?

pdehaan commented 8 years ago

I recently found https://registry.npmjs.org/-/all/static/today.json So I slapped together https://github.com/pdehaan/npm-today so I could see what packages were recently published, and thought that nice-package formatted everything beautifully.

Now I'm just trying to hack it locally to see what repo URLs it's failing to parse so I can see if it's potentially a nice-package issue, a github-url-to-object issue, or something else. Basically it's Saturday, and I don't want to do chores.

PS: Thanks for all your npm modules! 🍻

zeke commented 8 years ago

Whoa I didn't know about today.json. The couch registry has all these crazy undocumented endpoints that people only find out about by word of mouth. Anyway, glad you found it.

This module isn't published to npm

Why not? Just curious.

Please let me know about any (other) snags you hit with nice-package and/or github-url-to-object. Happy to help.

zeke commented 8 years ago

Turns out there's a yesterday endpoint too

https://registry.npmjs.org/-/all/static/yesterday.json

zeke commented 8 years ago

And quarter, whatever that means.

https://registry.npmjs.org/-/all/static/quarter.json

pdehaan commented 8 years ago

Yeah, they got some weird endpoints. Also not always accurate since I had to add some checks to see if the records in today.json were still available, since people tend to publish to npm and then delete minutes later (or make private in npm/GitHub).

I think so far the only other interesting issue I've found, is I have to delete the package['dist-tags'] key before passing the package object to nice-package, otherwise I was getting some errors. See https://github.com/pdehaan/npm-today/blob/7bc35b71da52b1d2fe2d8fc48594a1e474973482/index.js#L17-L19

I'll have to dig deeper into that to figure out if it's because the today.json endpoint doesn't contain all the same keys as a proper package.json, or what, but I had to read the nice-package code to figure out what if..else block I was hitting so I could try and get in a different code path. :shrug:

Also got to say I'm a huge fan of https://github.com/zeke/all-the-packages. I was using it to grab all the modules, filter by only grunt-* modules so I could check for keywords, and run through the nsp node security tool. Very cool, although re-reading your docs, I should definitely check out the streaming interface instead of just including the entire .json and doing a .filter().map(). 👍