npms-io / npms

Meta repository for centralized issues
109 stars 9 forks source link

`dependents` and `dependencies` qualifiers #29

Open larsgw opened 5 years ago

larsgw commented 5 years ago

I don't know if this is something that can be implemented in npms directly, but since you can't search within the dependent tab, maybe we could add dependents:<pkg> and dependencies:<pkg> filters. Would that be viable?

Edit: we as in, "I'm not part of the team but I'll help if I can"

daKmoR commented 5 years ago

yeesss that would be even more awesome 🤗 🎈 🍰

thepassle commented 5 years ago

This would be incredible for our usecase

thepassle commented 5 years ago

Friendly bump 🤗 Any indication if or when this will be implemented?

satazor commented 5 years ago

Hello! Sorry for the late answer, I’ve been out of the country.

So, both features are easy to implement:

Now, I have concerns about the space of the dependants index field, specially for packages such as lodash.

Could you please give more insight why you need this feature and why it’s useful for (use-cases)?

Moreover, I don’t have the time to implement it myself but I can provide guidance and review.

thepassle commented 5 years ago

No worries, just checking in :)

For our use case:

We're making a catalog for web components. What we would like to do is provide a search based on a dependency of a web components.

How we currently achieve this is: We search for a query, e.g.: 'button', and keywords: ['webcomponent', 'webcomponents', 'customelement']. But sometimes people will specifically only want results for a web component that is made with: Polymer, or LitElement, or Stencil, or Gluon, etc. The way we can achieve that is by filtering on the dependencies, so the query would be:

satazor commented 5 years ago

@thepassle if I specify depends on: polymer, are you expecting for it to work only for direct dependencies or deep as well?

thepassle commented 5 years ago

I would say they should be direct dependencies, but maybe @daKmoR can back me on that?

Also, if you could give us some pointers/where to get started, I think we can take a stab at implementing this :)

satazor commented 5 years ago

If it’s direct it’s much easier, otherwise we would have to use some kind of graph which is way more complicated.

daKmoR commented 5 years ago

yes direct is all we need :)

so any guidance for it would be awesome 🤗

daKmoR commented 5 years ago

oh almost forgot what would probably be really nice to have would be

Depends on: 'LitElement 2.x'

so be able to specify a major version of the dependency would make this feature even more powerful...

larsgw commented 5 years ago

Now, I have concerns about the space of the dependants index field, specially for packages such as lodash.

Would that still be a problem with direct dependents?

Moreover, I don’t have the time to implement it myself but I can provide guidance and review.

I have a somewhat ready setup (without RabbitMQ, not sure if I'll need that). However, I'm not sure how the _view options work in this case.

thepassle commented 5 years ago

@larsgw Any way we can help? Do you have a PR?

larsgw commented 5 years ago

No PR yet, I'm looking to change this request first (still sad GitHub doesn't do previews for code in other repositories).

Edit: apparently it's as simple as reduce: false, not just omitting reduce. If only I was paying attention to the docs...