Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependents and dependencies qualifiers #29

Open
larsgw opened this issue Feb 23, 2019 · 13 comments · May be fixed by npms-io/npms-analyzer#235
Open

dependents and dependencies qualifiers #29

larsgw opened this issue Feb 23, 2019 · 13 comments · May be fixed by npms-io/npms-analyzer#235

Comments

@larsgw
Copy link

larsgw commented Feb 23, 2019

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
Copy link

daKmoR commented Feb 23, 2019

yeesss that would be even more awesome 🤗 🎈 🍰

@thepassle
Copy link

This would be incredible for our usecase

@thepassle
Copy link

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

@satazor
Copy link
Member

satazor commented Mar 4, 2019

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

So, both features are easy to implement:

  • dependants: there’s a couchdb view that we can use to fetch the dependants of a given package
  • dependencies: just get them from the package.json; this will only work for direct ones, which is reasonable?

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
Copy link

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:

  • Search term: 'button'
  • Keywords: ['webcomponent', 'webcomponents', 'customelement']
  • Depends on: 'LitElement'

@satazor
Copy link
Member

satazor commented Mar 4, 2019

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

@thepassle
Copy link

thepassle commented Mar 4, 2019

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
Copy link
Member

satazor commented Mar 4, 2019

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

@daKmoR
Copy link

daKmoR commented Mar 4, 2019

yes direct is all we need :)

so any guidance for it would be awesome 🤗

@daKmoR
Copy link

daKmoR commented Mar 4, 2019

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
Copy link
Author

larsgw commented Mar 4, 2019

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
Copy link

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

@larsgw
Copy link
Author

larsgw commented Mar 4, 2019

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants