GithubHelp home page GithubHelp logo

Comments (18)

borkdude avatar borkdude commented on August 20, 2024 1

Yeah, I would say :limit 10 as SQL does.

from neil.

borkdude avatar borkdude commented on August 20, 2024 1

OK for now, we could parse as number whenever we need.

from neil.

borkdude avatar borkdude commented on August 20, 2024 1

@teodorlu We can ignore git deps for now.

from neil.

teodorlu avatar teodorlu commented on August 20, 2024

Draft: https://github.com/teodorlu/neil

  • Supports version listing from Clojars only
  • Also contains some unrelated CLI additions (neil dep {add,versions)

from neil.

borkdude avatar borkdude commented on August 20, 2024

Maybe:

neil dep versions :lib hiccup/hiccup

Two level subcommand + the rest kwargs?

from neil.

teodorlu avatar teodorlu commented on August 20, 2024

Keeping the existing :lib convention makes a lot of sense.

from neil.

teodorlu avatar teodorlu commented on August 20, 2024

Do you have a preference on neil dep ... vs neil deps ...?

from neil.

teodorlu avatar teodorlu commented on August 20, 2024

Looks like :lib is already working on my branch - I copied some of your code:

neil dep versions :lib hiccup/hiccup

from neil.

borkdude avatar borkdude commented on August 20, 2024

deps does relate it to deps.edn and tools.deps so maybe that's nice? but dep is shorter to type which may be a good reason to go with that...

neil dep add ...
neil dep versions ...

I think I like that.

Maybe we should support also:

neil dep add hiccup/hiccup

without the :lib kw.

from neil.

borkdude avatar borkdude commented on August 20, 2024

So when there is a single argument, :lib would be implied. Small UX tweak.

from neil.

teodorlu avatar teodorlu commented on August 20, 2024

Sounds good to me 👍

from neil.

teodorlu avatar teodorlu commented on August 20, 2024

Should the number of versions we print be configurable as an option? Does :count make sense as a key?

neil dep add :lib hiccup/hiccup :count 10

from neil.

teodorlu avatar teodorlu commented on August 20, 2024

Any preference on how we should handle parsing :limit?

It doesn't strictly need to be parsed if we're just using it to create URLs. But passing around numbers as strings, and encoding that into option maps seems kind of dirty:

(defn mvn-versions [qlib {:keys [limit] :or {limit "10"}}]
  (let [payload
        (-> (curl/get (format "https://search.maven.org/solrsearch/select?q=g:%s+AND+a:%s&core=gav&rows=%s"
                              (namespace qlib)
                              (name qlib)
                              limit)
                      curl-opts)
            :body
            (cheshire/parse-string true))]
    (->> payload
         :response :docs
         (map :v))))

from neil.

teodorlu avatar teodorlu commented on August 20, 2024

Crated a WIP PR from my current branch: #17

I've made a complete mess of the git history -- needs cleaning.

from neil.

teodorlu avatar teodorlu commented on August 20, 2024

I'm honestly not sure about git deps. I rarely use git deps myself, so I don't feel like I know common use cases.

  • Do we ignore other forges than Github, like Gitlab and Sourcehut? Existing code seems to assume Github.
  • "Listing versions" makes sense in a Maven/Clojars world. Is a "version" a git ref? A content hash? A tag? I'm not sure.
  • What is the typical usage for Git deps?

If neil dep versions is a subcommand, does that subcommand make sense for Git?

🤔

from neil.

teodorlu avatar teodorlu commented on August 20, 2024

We could possibly "construct" a list of options that make some kind of sense.

  1. SHA for HEAD
  2. Most recent tags

Then we'd have to print something - that ideally can be piped back into neil add dep (neil dep add if we change it).

from neil.

borkdude avatar borkdude commented on August 20, 2024

The Clojure CLI has a way to list versions too btw, does it support git deps?

from neil.

teodorlu avatar teodorlu commented on August 20, 2024

It does - it lists git tags:

clj -X:deps find-versions :lib io.github.clojure/tools.gitlibs
{:git/tag "tools.gitlibs-0.1.3"}
{:git/tag "tools.gitlibs-0.1.8"}
{:git/tag "tools.gitlibs-0.2.23"}
{:git/tag "tools.gitlibs-0.2.27"}
{:git/tag "tools.gitlibs-0.2.32"}
{:git/tag "tools.gitlibs-0.2.40"}
{:git/tag "tools.gitlibs-0.2.47"}
{:git/tag "tools.gitlibs-0.2.54"}
{:git/tag "tools.gitlibs-0.2.59"}
{:git/tag "tools.gitlibs-0.2.64"}
{:git/tag "tools.gitlibs-1.0.100"}
{:git/tag "tools.gitlibs-1.0.83"}
{:git/tag "tools.gitlibs-1.0.87"}
{:git/tag "tools.gitlibs-1.0.91"}
{:git/tag "tools.gitlibs-1.0.96"}
{:git/tag "tools.gitlibs-2.0.109"}
{:git/tag "tools.gitlibs-2.0.119"}
{:git/tag "tools.gitlibs-2.1.129"}
{:git/tag "tools.gitlibs-2.1.139"}
{:git/tag "tools.gitlibs-2.1.144"}
{:git/tag "tools.gitlibs-2.2.152"}
{:git/tag "tools.gitlibs-2.2.156"}
{:git/tag "tools.gitlibs-2.3.161"}
{:git/tag "v0.0"}
{:git/tag "v2.3.167"}
{:git/tag "v2.4.172"}

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.