diff --git a/env/dev/clj/user.clj b/env/dev/clj/user.clj index b318a86..a70555a 100644 --- a/env/dev/clj/user.clj +++ b/env/dev/clj/user.clj @@ -1,15 +1,34 @@ (ns user (:require [mount.core :as mount] - [commiteth.figwheel :refer [start-fw stop-fw cljs]])) + [commiteth.figwheel :refer [start-fw stop-fw cljs]] + [clojure.tools.namespace.repl :as repl])) -(defn start [] +(repl/set-refresh-dirs "src" "dev" "test") + +(defn start + "Start all the application components" + [] (require 'commiteth.core) (mount/start-without (ns-resolve 'commiteth.core 'repl-server))) -(defn stop [] +(defn stop + "Stop all the application components" + [] (require 'commiteth.core) (mount/stop-except (ns-resolve 'commiteth.core 'repl-server))) +(defn refresh + "Reload the latest namespace definitions" + [] + (repl/refresh)) + +(defn reset + "Restart application after refreshing namespace definitions" + [] + (stop) + (repl/refresh :after 'user/start)) + (defn restart [] + "Restart without refreshing namespace definitions" (stop) (start)) diff --git a/project.clj b/project.clj index ac5d67a..71f2c74 100644 --- a/project.clj +++ b/project.clj @@ -124,6 +124,7 @@ [binaryage/devtools "0.9.7"] [figwheel-sidecar "0.5.14"] [org.clojure/tools.nrepl "0.2.13"] + [org.clojure/tools.namespace "0.2.11"] [com.cemerick/piggieback "0.2.2"] [sablono "0.8.1"]] :plugins [[com.jakemccrary/lein-test-refresh "0.14.0"]