Skip to content

Commit

Permalink
Merge pull request #146 from vollcheck/upgrade-to-integrant-0.9
Browse files Browse the repository at this point in the history
Upgrade integrant to 0.9.0 version and use `expand` instead of `prep`
  • Loading branch information
yogthos authored Sep 4, 2024
2 parents 54566bf + 9a2dafb commit a02e184
Show file tree
Hide file tree
Showing 21 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion build/deps.edn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{:deps
{;; kit-core
aero/aero {:mvn/version "1.1.6"}
integrant/integrant {:mvn/version "0.8.1"}
integrant/integrant {:mvn/version "0.9.0"}
org.clojure/tools.logging {:mvn/version "1.2.4"}
ch.qos.logback/logback-classic {:mvn/version "1.4.11"}
com.lambdaisland/classpath {:mvn/version "0.4.44"}
Expand Down
2 changes: 1 addition & 1 deletion build/kit/sync_lib_deps.clj
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
(comment
(def test-code
"{:paths [\"src\"]
:deps {integrant/integrant {:mvn/version \"0.7.0\"}
:deps {integrant/integrant {:mvn/version \"0.9.0\"}
com.xtdb/xtdb-core {:mvn/version \"1.20.0\"}}}")

(replace-dependencies test-code dependencies))
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
[]
(integrant.repl/set-prep! (fn []
(-> (<<ns-name>>.config/system-config {:profile :dev})
(ig/prep)))))
(ig/expand)))))

(defn test-prep!
[]
(integrant.repl/set-prep! (fn []
(-> (<<ns-name>>.config/system-config {:profile :test})
(ig/prep)))))
(ig/expand)))))

;; Can change this to test-prep! if want to run tests as the test profile in your repl
;; You can run tests in the dev profile, too, but there are some differences between
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
(defn start-app [& [params]]
((or (:start params) (:start defaults) (fn [])))
(->> (config/system-config (or (:opts params) (:opts defaults) {}))
(ig/prep)
(ig/expand)
(ig/init)
(reset! system))
(.addShutdownHook (Runtime/getRuntime) (Thread. stop-app)))
Expand Down
2 changes: 1 addition & 1 deletion libs/kit-core/deps.edn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{:paths ["src"]
:deps {aero/aero {:mvn/version "1.1.6"}
integrant/integrant {:mvn/version "0.8.1"}
integrant/integrant {:mvn/version "0.9.0"}
org.clojure/tools.logging {:mvn/version "1.2.4"}
ch.qos.logback/logback-classic {:mvn/version "1.4.11"}}}
2 changes: 1 addition & 1 deletion libs/kit-generator/test/resources/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
(defn start-app [& [params]]
((or (:start params) (:start defaults) (fn [])))
(->> (config/system-config (or (:opts params) (:opts defaults) {}))
(ig/prep)
(ig/expand)
(ig/init)
(reset! system))
(.addShutdownHook (Runtime/getRuntime) (Thread. stop-app)))
Expand Down
2 changes: 1 addition & 1 deletion libs/kit-hato/deps.edn
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{:paths ["src"]
:deps {integrant/integrant {:mvn/version "0.8.1"}
:deps {integrant/integrant {:mvn/version "0.9.0"}
hato/hato {:mvn/version "1.0.0"}}}
2 changes: 1 addition & 1 deletion libs/kit-http-kit/deps.edn
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{:paths ["src"]
:deps {integrant/integrant {:mvn/version "0.8.1"}
:deps {integrant/integrant {:mvn/version "0.9.0"}
http-kit/http-kit {:mvn/version "2.7.0"}}}
10 changes: 5 additions & 5 deletions libs/kit-http-kit/src/kit/edge/server/http_kit.clj
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
(log/info "HTTP server stopped")
result))

(defmethod ig/prep-key :server/http-kit
[_ config]
(merge {:port 3000
:host "0.0.0.0"}
config))
(defmethod ig/expand-key :server/http-kit
[k config]
{k (merge {:port 3000
:host "0.0.0.0"}
config)})

(defmethod ig/init-key :server/http-kit
[_ opts]
Expand Down
2 changes: 1 addition & 1 deletion libs/kit-nrepl/deps.edn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{:paths ["src"]
:deps {org.clojure/tools.logging {:mvn/version "1.2.4"}
integrant/integrant {:mvn/version "0.8.1"}
integrant/integrant {:mvn/version "0.9.0"}
nrepl/nrepl {:mvn/version "1.1.1"}
io.github.kit-clj/kit-core {:mvn/version "1.0.7"}}}
2 changes: 1 addition & 1 deletion libs/kit-quartz/deps.edn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{:paths ["src"]
:deps {aero/aero {:mvn/version "1.1.6"}
integrant/integrant {:mvn/version "0.8.1"}
integrant/integrant {:mvn/version "0.9.0"}
com.troy-west/cronut {:mvn/version "0.2.6"}
io.github.kit-clj/kit-core {:mvn/version "1.0.7"}}}
2 changes: 1 addition & 1 deletion libs/kit-redis/deps.edn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{:paths ["src"]
:deps {integrant/integrant {:mvn/version "0.8.1"}
:deps {integrant/integrant {:mvn/version "0.9.0"}
org.clojure/core.cache {:mvn/version "1.0.225"}
com.taoensso/carmine {:mvn/version "3.2.0"}
io.github.kit-clj/kit-core {:mvn/version "1.0.7"}}}
2 changes: 1 addition & 1 deletion libs/kit-repl/deps.edn
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{:paths ["src"]
:deps {org.clojure/tools.logging {:mvn/version "1.2.4"}
integrant/integrant {:mvn/version "0.8.1"}}}
integrant/integrant {:mvn/version "0.9.0"}}}
6 changes: 3 additions & 3 deletions libs/kit-repl/src/kit/edge/utils/repl.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
[clojure.tools.logging :as log]
[integrant.core :as ig]))

(defmethod ig/prep-key :repl/server
[_ config]
(merge {:name "main"} config))
(defmethod ig/expand-key :repl/server
[k config]
{k (merge {:name "main"} config)})

(defmethod ig/init-key :repl/server
[_ {:keys [port host name] :as config}]
Expand Down
2 changes: 1 addition & 1 deletion libs/kit-selmer/deps.edn
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{:paths ["src"]
:deps {integrant/integrant {:mvn/version "0.8.1"}
:deps {integrant/integrant {:mvn/version "0.9.0"}
selmer/selmer {:mvn/version "1.12.59"}}}
2 changes: 1 addition & 1 deletion libs/kit-sql-conman/deps.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{:paths ["src"]
:deps {integrant/integrant {:mvn/version "0.8.1"}
:deps {integrant/integrant {:mvn/version "0.9.0"}
conman/conman {:mvn/version "0.9.6"}
io.github.kit-clj/kit-core {:mvn/version "1.0.7"}}}
2 changes: 1 addition & 1 deletion libs/kit-sql-hikari/deps.edn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{:paths ["src"]
:deps {integrant/integrant {:mvn/version "0.8.1"}
:deps {integrant/integrant {:mvn/version "0.9.0"}
com.github.seancorfield/next.jdbc {:mvn/version "1.3.883"} ;; TODO: is this required here?
hikari-cp/hikari-cp {:mvn/version "3.0.1"}
io.github.kit-clj/kit-core {:mvn/version "1.0.7"}}}
2 changes: 1 addition & 1 deletion libs/kit-sql-migratus/deps.edn
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{:paths ["src"]
:deps {integrant/integrant {:mvn/version "0.8.1"}
:deps {integrant/integrant {:mvn/version "0.9.0"}
migratus/migratus {:mvn/version "1.5.1"}}}
2 changes: 1 addition & 1 deletion libs/kit-undertow/deps.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{:paths ["src"]
:deps {org.clojure/tools.logging {:mvn/version "1.2.4"}
integrant/integrant {:mvn/version "0.8.1"}
integrant/integrant {:mvn/version "0.9.0"}
luminus/ring-undertow-adapter {:mvn/version "1.3.1"}}}
12 changes: 6 additions & 6 deletions libs/kit-undertow/src/kit/edge/server/undertow.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
(.stop server)
(log/info "HTTP server stopped"))

(defmethod ig/prep-key :server/http
[_ config]
(merge {:port 3000
:host "0.0.0.0"}
config))
(defmethod ig/expand-key :server/http
[k config]
{k (merge {:port 3000
:host "0.0.0.0"}
config)})

(defmethod ig/init-key :server/http
[_ opts]
Expand All @@ -42,4 +42,4 @@
(do (deliver @(:handler old-impl) (:handler opts))
old-impl)
(do (ig/halt-key! k old-impl)
(ig/init-key k opts))))
(ig/init-key k opts))))
2 changes: 1 addition & 1 deletion libs/kit-xtdb/deps.edn
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{:paths ["src"]
:deps {integrant/integrant {:mvn/version "0.8.1"}
:deps {integrant/integrant {:mvn/version "0.9.0"}
com.xtdb/xtdb-core {:mvn/version "1.23.0"}}}

0 comments on commit a02e184

Please sign in to comment.