adding a proto-repl playground

This commit is contained in:
anatoly 2016-12-02 16:33:40 -06:00
parent f38bc2f0e7
commit c9945aef5b
3 changed files with 23 additions and 5 deletions

View file

@ -20,6 +20,10 @@
[org.clojure/tools.nrepl "0.2.12" :scope "provided"] [org.clojure/tools.nrepl "0.2.12" :scope "provided"]
[com.datomic/datomic-free "0.9.5359" :scope "provided" :exclusions [joda-time]] [com.datomic/datomic-free "0.9.5359" :scope "provided" :exclusions [joda-time]]
;; proto repl for fun and joy
[proto-repl "0.3.1" :scope "provided"]
[proto-repl-charts "0.3.2" :scope "provided"]
;; boot clj ;; boot clj
[boot/core "2.6.0" :scope "provided"] [boot/core "2.6.0" :scope "provided"]
[adzerk/bootlaces "0.1.13" :scope "test"] [adzerk/bootlaces "0.1.13" :scope "test"]
@ -62,7 +66,7 @@
(deftask dev [] (deftask dev []
(set-env! :source-paths #(conj % "dev/clj" "dev/cljs")) (set-env! :source-paths #(conj % "dev/clj" "dev/cljs"))
(alter-var-root #'log/*logger-factory* (alter-var-root #'log/*logger-factory*
(constantly (log-service/make-factory log4b))) (constantly (log-service/make-factory log4b)))
(apply set-refresh-dirs (get-env :directories)) (apply set-refresh-dirs (get-env :directories))
(load-data-readers!) (load-data-readers!)
@ -80,7 +84,7 @@
(require '[mount.core]) (require '[mount.core])
(comp (comp
(strip-deps-attr :attr :classifier :value "aot") (strip-deps-attr :attr :classifier :value "aot")
(tcs/test-cljs ;; :optimizations :advanced (tcs/test-cljs ;; :optimizations :advanced
:out-file "mount.js"))) :out-file "mount.js")))
@ -88,7 +92,7 @@
(deftask test-cljs-advanced [] (deftask test-cljs-advanced []
(set-env! :source-paths #(conj % "dev/clj" "dev/cljs")) (set-env! :source-paths #(conj % "dev/clj" "dev/cljs"))
(set-env! :resource-paths #{"dev/resources"}) (set-env! :resource-paths #{"dev/resources"})
(comp (comp
(cljs :optimizations :advanced :ids #{"mount"}))) (cljs :optimizations :advanced :ids #{"mount"})))
@ -114,7 +118,7 @@
(cljs-repl) (cljs-repl)
(cljs :optimizations :none :ids #{"mount"}))) (cljs :optimizations :none :ids #{"mount"})))
(deftask cljs-example (deftask cljs-example
"mount cljs example" "mount cljs example"
[] []
(set-env! :source-paths #(conj % "dev/clj" "dev/cljs")) (set-env! :source-paths #(conj % "dev/clj" "dev/cljs"))

15
dev/clj/proto_play.clj Normal file
View file

@ -0,0 +1,15 @@
(ns proto-play
(:require [mount.tools.graph :as mount]
[proto-repl-charts.graph :as proto]))
(defn mount->proto [graph]
(reduce (fn [g {:keys [name deps]}]
(-> g
(update :nodes conj name)
(update :edges conj (-> deps (conj name) vec))))
{}
graph))
(->> (mount/states-with-deps)
mount->proto
(proto/graph "a proto graph of mount states"))

View file

@ -24,4 +24,3 @@
meta-with-ns) meta-with-ns)
states) states)
(sort-by :order))))) (sort-by :order)))))