Support package keywords / categories

Aberta
#650 0 comentários 5 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
25/100
Tipo de issue
Funcionalidade
Clareza
Precisa de esclarecimento
Status de atividade
Estagnada
Domínio
api, backend

Direção de pesquisa

Start by reviewing the existing purs publish registry compatibility code at src/Language/PureScript/Publish/Registry/Compat.hs and the related Pursuit issues 147, 431, and 416. Determine whether the registry should preserve deprecation or arbitrary keywords, then define the accepted metadata and verify that published purs.json packages expose the intended information.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

discussion pursuit

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:

image

The above screenshot shows a deprecated banner because that keyword is set:

https://github.com/purescript-deprecated/purescript-node-fs-aff/blob/56414801882dd23de272bf0bd927160b13b6e86f/bower.json#L11-L15

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:

https://github.com/purescript/pursuit-backups/blob/c2b55e73ece4105759007acbd6681b03d6991d4a/purescript-symbols/3.0.1.json

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:

https://github.com/purescript/purescript/blob/4afea2fbefeebd5e89c67d5a951efee870bcf2f2/src/Language/PureScript/Publish/Registry/Compat.hs#L16-L36

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:

Linguagem predominante
PureScript
Estrelas
95
Forks
79
Merge médio
16h 13min
PRs com merge (30d)
14

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de purescript/registry-dev

Todas as issues de purescript/registry-dev

Issues semelhantes

Mais issues de Backend & API Design

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.