Added Luminus re-frame profile

This commit is contained in:
Simon Brooke 2020-01-24 09:55:20 +00:00
parent 0b4a7fafdd
commit ca72a63199
41 changed files with 1114 additions and 0 deletions

View file

@ -0,0 +1,11 @@
(ns datamapper.dev-middleware
(:require
[ring.middleware.reload :refer [wrap-reload]]
[selmer.middleware :refer [wrap-error-page]]
[prone.middleware :refer [wrap-exceptions]]))
(defn wrap-dev [handler]
(-> handler
wrap-reload
wrap-error-page
(wrap-exceptions {:app-namespaces ['datamapper]})))

15
env/dev/clj/datamapper/env.clj vendored Normal file
View file

@ -0,0 +1,15 @@
(ns datamapper.env
(:require
[selmer.parser :as parser]
[clojure.tools.logging :as log]
[datamapper.dev-middleware :refer [wrap-dev]]))
(def defaults
{:init
(fn []
(parser/cache-off!)
(log/info "\n-=[datamapper started successfully using the development profile]=-"))
:stop
(fn []
(log/info "\n-=[datamapper has shut down successfully]=-"))
:middleware wrap-dev})

12
env/dev/clj/datamapper/figwheel.clj vendored Normal file
View file

@ -0,0 +1,12 @@
(ns datamapper.figwheel
(:require [figwheel-sidecar.repl-api :as ra]))
(defn start-fw []
(ra/start-figwheel!))
(defn stop-fw []
(ra/stop-figwheel!))
(defn cljs []
(ra/cljs-repl))

33
env/dev/clj/user.clj vendored Normal file
View file

@ -0,0 +1,33 @@
(ns user
"Userspace functions you can run by default in your local REPL."
(:require
[datamapper.config :refer [env]]
[clojure.pprint]
[clojure.spec.alpha :as s]
[expound.alpha :as expound]
[mount.core :as mount]
[datamapper.figwheel :refer [start-fw stop-fw cljs]]
[datamapper.core :refer [start-app]]))
(alter-var-root #'s/*explain-out* (constantly expound/printer))
(add-tap (bound-fn* clojure.pprint/pprint))
(defn start
"Starts application.
You'll usually want to run this on startup."
[]
(mount/start-without #'datamapper.core/repl-server))
(defn stop
"Stops application."
[]
(mount/stop-except #'datamapper.core/repl-server))
(defn restart
"Restarts application."
[]
(stop)
(start))