find-deps开源项目

我要开发同款
匿名用户2021年11月17日
54阅读
开发技术JavaScript
所属分类应用工具、终端/远程登录
授权协议Readme

作品详情

find-depsWhat?

find-depshelpsyouquicklyfinddependenciesviatheClojarsandMavensearchAPIs.Useitviathecommandline,orfromtheREPL.

find-depsutilizesclj-fuzzytorefinethesearchresultsreturnedfromrepositoryAPIs.Italsofactorsinthefreshnessofthedependencies,andthepopularityofthedependency’sgroupID.Wehopethisresultsinanear-perfectsuggestioneverytime!

SeetheFuturesectionbelowforsomeideasaroundwherethiscanbetaken.Inparticular,itwouldbegreattoenablesearchingfordeps.ednfilesongithub…

TL;DR

Addadependencytoyourcurrentdeps.ednaseasilyasthis:

clj-A:find-deps-F:savepriority-mapChangelogNotetakenon[2018-06-25Mon10:39]2018-06-25hidesnapshotversionsbydefaultinclojars(fixes#2)2018-06-24merged@pesterhazy’sREADMEfix2018-06-23fixedbugwhereinitwasn’tpossibletosavedepswithoutapreexistingdeps.ednadded-F:cliformatflagtoprintdepsascommandlineoptionto`clojure`binary2018-06-17change-Sflagto-stoavoidconflictwithtools.depsclienablepipingofinvocationstogethertoproducedmergeddeps.ednmapenablesavingofdeps.ednmapwithformat:saverenamed:mergedto:merge2018-06-16InitialcommitCLIUsage

Tousefind-depsfromthecommandline,createanaliasinyour~/.clojure/deps.ednmap:

{:aliases{:find-deps{:extra-deps{find-deps{:git/url"https://github.com/hagmonk/find-deps",:sha"6fc73813aafdd2288260abb2160ce0d4cdbac8be"}},:main-opts["-m""find-deps.core"]}}}

Youcaninvokefind-depswith-htoseethesupportedoptions:

%clj-A:find-deps-hfind-depsUsage:[options*][search-strings*]Options:-s,--sourcesSOURCES:clojars:mvnConcatenatedsourcetypes-R,--rankMETHOD:fuzzyRankingmethod-:fuzzy,:regex-F,--formatFORMAT:depsFormatforprintingresults-:deps,:merge,:table,:save,:cli-l,--limitNUM1Limitper-searchresultstoNUM-h,--helpExamples

Searchforadependencylikehttp-kit:

clj-A:find-depshttp-kit{:deps{http-kit/http-kit{:mvn/version"2.3.0"}}}

Searchformultipledependencies:

clj-A:find-depshttp-kittools.loggingpriority-map{:deps{http-kit/http-kit{:mvn/version"2.3.0"},org.clojure/tools.logging{:mvn/version"0.5.0-alpha"},org.clojure/data.priority-map{:mvn/version"0.0.9"}}}

Chaintogethermultipleinvocationsusingdifferentqueryarguments:

clj-A:find-deps-s:mvnroaringbitmap|clj-A:find-deps-s:clojars-R:regex-l5io.pedestal{:deps{org.roaringbitmap/RoaringBitmap{:mvn/version"0.7.13"},io.pedestal/pedestal.jetty{:mvn/version"0.5.3"},io.pedestal/pedestal.tomcat{:mvn/version"0.5.3"},io.pedestal/pedestal.log{:mvn/version"0.5.3"},io.pedestal/pedestal.service{:mvn/version"0.5.3"},io.pedestal/pedestal.interceptor{:mvn/version"0.5.3"}}}

Mergethesearchresultsintothecurrentproject’sdeps.edn.Youcanalsosavetheseresultstodeps.ednbyspecifying:saveinstead.

clj-A:find-deps-F:mergehttp-kittools.loggingpriority-map{:paths["src"],:deps{org.clojure/clojure{:mvn/version"1.9.0"},org.clojure/tools.logging{:mvn/version"0.5.0-alpha"},org.clojure/spec.alpha{:mvn/version"0.1.143"},clj-fuzzy{:mvn/version"0.4.1"},http-kit{:mvn/version"2.3.0"},tools.deps.alpha{:git/url"https://github.com/clojure/tools.deps.alpha",:sha"884d7ae5b9c228ff795e4385291708102f1cd46d"},metosin/jsonista{:mvn/version"0.1.1"},org.clojure/data.priority-map{:mvn/version"0.0.9"},inflections{:mvn/version"0.13.0"},http-kit/http-kit{:mvn/version"2.3.0"}};;...snip}

Stringsearchreturningmultiplematchesinatable:

clj-A:find-deps-F:table-l10"apachekafka"|:lib|:version||-----------------------------------+----------||org.apache.kafka/kafka-tools|1.1.0||org.apache.kafka/kafka_2.9.2|0.8.2.2||org.apache.kafka/kafka_2.9.1|0.8.2.2||org.apache.kafka/kafka_2.8.0|0.8.1.1||org.apache.kafka/kafka_2.8.2|0.8.1||org.apache.hadoop/hadoop-kafka|3.1.0||org.apache.kafka/kafka-streams|1.1.0||org.apache.kafka/kafka-clients|1.1.0||org.apache.kafka/kafka-examples|1.1.0||org.apache.kafka/kafka-perf_2.8.0|0.8.1.1|

Printoutacommandlineinvocationofthedeps:

clj-A:find-deps-F:clihttp-kitjsonistaclojure-Sdeps'{:deps{http-kit/http-kit{:mvn/version"2.3.0"},metosin/jsonista{:mvn/version"0.2.1"}}}'API

Thefind-deps.corenamespacecontainsanumberofhelpersyoucanusefromtheREPL.Assumingyouhaveanaliasforrebel-readline:

clj-A:rebel[Rebelreadline]Type:repl/helpforonlinehelpinfouser=>(use'find-deps.core)niluser=>(print-deps"http-kit")|:lib|:version||-------------------+----------||http-kit/http-kit|2.3.0|niluser=>(deps"http-kit"){:deps#:http-kit{http-kit#:mvn{:version"2.3.0"}}}

Seethefind-deps.corenamespaceformorehelpers.

Future[]searchgithubfordeps.ednfiles[]searchgithubforproject.cljfiles[]pagerankdepsbasedondependencygraph[]recommendedotherdependenciesbasedonclustering[]incorporatedownloadcountsintoweightingfactor[x]supportwritingdirectlyintodeps.edn[]supportadd-lib[]addvalidationsupporttocliparser
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论