GithubHelp home page GithubHelp logo

Search fails for some deps about neil HOT 4 CLOSED

babashka avatar babashka commented on August 20, 2024
Search fails for some deps

from neil.

Comments (4)

borkdude avatar borkdude commented on August 20, 2024

This is a problem we should indeed fix. The problem is likely the slash in the name.

from neil.

bobisageek avatar bobisageek commented on August 20, 2024

It seems like the slash does break search, even on the clojars website (searching for org.clojure/tools.cli without quotes returns Could not search; please check your query syntax.).

I think quoting the search term might be the way to go:

$ ./neil dep search '"org.clojure/tools.cli"'
:lib org.clojars.rmremizov/clj-argparse :version 0.1.1-SNAPSHOT

^
This lib has the term "org.clojure/tools.cli" in its description.

But it should be noted that searching like this won't return a namespace-qualified lib, because clojars appears to store the namespace and name in separate fields (namely group-id and artifact-id).

$ ./neil dep search '"babashka.nrepl"'
:lib babashka/babashka.nrepl :version 0.0.6
$ ./neil dep search '"babashka/babashka.nrepl"'
Unable to find "babashka/babashka.nrepl" on Clojars.

Presumably the versions command would be more aimed at supplying an exact lib name.

The change of quoting the search term would technically break the capability to do lucene-type searches just like on the clojars website:

$ ./neil dep search 'babashka+AND+nrepl'
:lib babashka/babashka.nrepl :version 0.0.6
$ ./neil dep search 'babashka+OR+nrepl'
:lib nrepl/nrepl :version 0.9.0
:lib cider/cider-nrepl :version 0.28.3
...

but the README says things might break, and it seems unlikely to me that this functionality would be in heavy use.

Tangentially, I'd like to propose that the search term also be URL-encoded to allow for spaces in search strings:

$ ./neil dep search '"babashka pods"'
----- Error --------------------------------------------------------------------
Type:     com.fasterxml.jackson.core.JsonParseException
...(details elided)

vs

$ ./neil dep search '"babashka+pods"'
:lib babashka/babashka.pods :version 0.1.0

TL;DR - Quoting and URL-encoding the search string would eliminate a large swath of the error responses that lead to exceptions and facilitate searching for multi-word strings, but namespace-qualified libs won't be found.

I've got the start of a PR for this (need to do some cleanup and add some tests), but I wanted to provide the context for feedback.

from neil.

borkdude avatar borkdude commented on August 20, 2024

Thanks! Makes a lot of sense.

from neil.

borkdude avatar borkdude commented on August 20, 2024

Published as v0.0.24, thanks @bobisageek

from neil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.