nice-registry / nice-package

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

Get the normalization story straight. #6

Closed zeke closed 8 years ago

zeke commented 8 years ago

I wrote in the readme that this package uses https://github.com/npm/normalize-package-data, but it actually uses https://github.com/npm/normalize-registry-metadata.

@soldair what is the difference between these two packages?

soldair commented 8 years ago

normalize-registry-metadata performs all of the output normalization and sanitization that npm-registry-couchapp performs before it serves any document. because changes from skimdb do not go through couchapp they skip the cleaning logic that grew over the years.

what it means in practice is that you can transform the raw documents you get from skim db and make them === the result you get from curling the registry directly by package name (https://registry.npmjs.org/shelljs)

normalize-registry-metadata fixes on bug in the current couchapp normalization. the version keys in the times object were not cleaned so you are unable to match the keys in times to the keys in versions when you curl the registry directly for package metadata. This only effects modules that have incorrect but cleanable semver versions like leading zeros.

afaik normalize-package-data doesnt fix the keys in times either but does a bunch of other stuff thats useful for folks using the cli to publish new documents.

i would stay with normalize-registry-metadata like you are now because its exactly the usecase it was designed for.

im not sure if adding both would help with anything but it's up to you =)

zeke commented 8 years ago

grazie mille!