Skip to content

Commit

Permalink
feat: Add antq.api
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidz committed Mar 30, 2023
1 parent a636c92 commit 9c7cc46
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/antq/api.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
(ns antq.api
(:require
[antq.core :as core]
[antq.dep.clojure :as dep.clojure]
[antq.report :as report]))

(defn outdated-deps
"Returns outdated dependencies in the form of `antq.record.Dependency`.
- deps-map (Required)
A map of the same form as `:deps` in deps.edn.
E.g. '{org.clojure/clojure {:mvn/version \"1.11.1\"}}
- repositories (Optional)
A map of the same form as `:mvn/repos` in deps.edn.
E.g. {\"clojars\" {:url \"https://clojars.org/repo\"}}
- no-changes? (Optional)
If true, skip checking changes between deps' versions.
Default is false."
([deps-map]
(outdated-deps deps-map {}))
([deps-map {:keys [repositories no-changes?]}]
(let [deps-edn (cond-> {:deps deps-map}
repositories (assoc :mvn/repos repositories))
antq-deps (dep.clojure/extract-deps "" (pr-str deps-edn))
antq-options {:reporter report/no-output-reporter
:no-changes no-changes?}]

(core/antq antq-options antq-deps))))

(comment
(outdated-deps '{org.clojure/clojure {:mvn/version "1.8.0"}}
{:no-changes? true}))

0 comments on commit 9c7cc46

Please sign in to comment.