Support package keywords / categories
thomashoneyman opened this issue · 0 comments
You can currently deprecate packages on Pursuit by setting the keywords
field in your bower.json file to contain the keyword pursuit-deprecated
. A package with this keyword automatically gets a banner:
The above screenshot shows a deprecated banner because that keyword is set:
Pursuit knows of the keyword because the compiler, in purs publish
, will copy the contents of the Bower file into the JSON payload sent to Pursuit. See, for example, the contents of the package upload for a deprecated package here:
Of course, any package published by the registry will use a purs.json
file, itself derived from the bowerfile, or the spago.dhall file, or the spago.yaml file. In this case, purs publish
will create a Bower package out of the purs.json file, which of course has no keywords
field:
The end result is that it is currently impossible to indicate a package is deprecated via the registry. This raises the bigger question: do we want to allow package deprecation?
Package Deprecation and Keywords
A "deprecated" package is really a social category (it's still usable at its published version, of course, but the author is encouraging you not to use it). We may choose to let authors indicate this, or we may not. Advantages of letting a user indicate information like deprecation include:
- For keywords we support, we can display extra information in documentation (such as the deprecation badge)
- For arbitrary keywords, we can support a keyword search on Pursuit
One possible approach is a fixed list of keywords or categories that we know mean something; Crates, for example, has a specific list of categories you can put a package in: https://crates.io/category_slugs
But you can also put arbitrary keywords (up to 5, I believe) in your cargo.toml. We could also support this, allowing people to self-describe with whatever keywords they want.
Related Issues
This has certainly come up before. See: