Skip to content

[Search npm Packages] Include popularity, stars etc. in search results #1033

Closed

Description

@michal-kaciuba

Extension – Search npm Packages

Author: @mrmartineau

First of all, I absolutely love the extension!

I think one useful addition would be to include info such as popularity, GitHub star count, last publish date etc. I usually base my decision about using a particular package on this info.

Activity

  1. added
    extension
    feature request
    on Mar 5, 2022
  2. mrmartineau commented on Mar 29, 2022

    @mrmartineau
    Contributor

    @MKaciuba hi mate, thanks for the feedback. I would also like to add more info to the output, but there isn't much space for it in the Raycast UI. 3rd party extensions have a title, description (second line), image and the right-hand bit where we put the version, to put information. That doesn't leave much space for the new things that you've suggested. Have a look at the Raycast extensions API docs and see if you can figure out where that information could go.

    Actually, we could put that info in the action panel, would that be acceptable?

  3. michal-kaciuba commented on Mar 30, 2022

    @michal-kaciuba
    Author

    What do you think about giving a configurable option to choose one of those data points to appear next to the version simply by concatenation, like this: 1.2.3 | ⭐456? Then you could have more detailed info in the action panel as you propose.

  4. mrmartineau commented on Apr 4, 2022

    @mrmartineau
    Contributor

    That could also work. If I get some time, I will add this stuff.

  5. mrmartineau commented on Apr 26, 2022

    @mrmartineau
    Contributor

    @MKaciuba FWIW a typical response from the npms.io suggestions API (that the extension uses) looks like this:

    {
      "package": {
        "name": "react",
        "scope": "unscoped",
        "version": "18.0.0",
        "description": "React is a JavaScript library for building user interfaces.",
        "keywords": [
          "react"
        ],
        "date": "2022-03-29T16:00:04.223Z",
        "links": {
          "npm": "https://www.npmjs.com/package/react",
          "homepage": "https://reactjs.org/",
          "repository": "https://github.com/facebook/react",
          "bugs": "https://github.com/facebook/react/issues"
        },
        "publisher": {
          "username": "acdlite",
          "email": "[email protected]"
        },
        "maintainers": [
          {
            "username": "gaearon",
            "email": "[email protected]"
          },
          {
            "username": "acdlite",
            "email": "[email protected]"
          },
          {
            "username": "fb",
            "email": "[email protected]"
          },
          {
            "username": "trueadm",
            "email": "[email protected]"
          },
          {
            "username": "sophiebits",
            "email": "[email protected]"
          },
          {
            "username": "lunaruan",
            "email": "[email protected]"
          }
        ]
      },
      "score": {
        "final": 0.9197584952933029,
        "detail": {
          "quality": 0.8629706748020751,
          "popularity": 0.9194826852725915,
          "maintenance": 0.9687095800207814
        }
      },
      "searchScore": 1010.62555,
      "highlight": "<em>react</em>"
    }

    There are some score values which might be useful, but as you can see there are no GitHub star counts. I don't think it's a good idea to call another API to fetch this info for every result item. So unless you can find a free suggestions API that also returns GitHub stars, I think we'll have to leave it as is.

    Having said that, here's what it could look like with scores information added:

    image

    ..which also isn't ideal because Raycast doesn't offer an Action for simply displaying information like we want in the ActionsPanel. I am using Action.CopyToClipboard in the screenshot above which isn't great. See more options here

  6. mathieudutour commented on Apr 27, 2022

    @mathieudutour
    Member
  7. mrmartineau commented on Apr 27, 2022

    @mrmartineau
    Contributor

    @mathieudutour I wasn't aware of the Detail view. So I could use markdown and render something like this (but better):

    image

    I'm still not sure if it is worth the changes to be honest. Am happy to take suggestions though.

  8. mrmartineau commented on May 4, 2022

    @mrmartineau
    Contributor

    FYI I have a just opened PR with some updates to this extension: #1585

  9. stale commented on Jun 23, 2022

    @stale

    This issue/pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs in the next 7 days to keep our backlog clean. Thanks for your contributions.

  10. added
    wontfix
    on Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    extensionfeature requestwontfix

    Type

    No type

    Fields

    Priority

    None yet

    Severity

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions