Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default directories to be under target #67

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions src/clj/cemerick/austin.clj
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,9 @@ function."
(defn- always-preload
"Return a list of all namespaces which are always loaded into the browser
when using a browser-connected REPL."
[]
(let [cljs (provides-and-requires (cljsc/cljs-dependencies {} ["clojure.browser.repl"]))
goog (provides-and-requires (cljsc/js-dependencies {} cljs))]
[opts]
(let [cljs (provides-and-requires (cljsc/cljs-dependencies opts ["clojure.browser.repl"]))
goog (provides-and-requires (cljsc/js-dependencies opts cljs))]
(disj (set (concat cljs goog)) nil)))

(defn repl-env
Expand All @@ -377,11 +377,11 @@ function."

session-id: The id of the (pre-existing) session to bind to
working-dir: The directory where the compiled REPL client JavaScript will
be stored. Defaults to \".repl\".
be stored. Defaults to \"target/austin/repl\".
serve-static: Should the REPL server attempt to serve static content?
Defaults to true.
static-dir: List of directories to search for static content. Defaults to
[\".\" \"out/\"].
[\".\" \"target/austin/out/\"].
preloaded-libs: List of namespaces that should not be sent from the REPL server
to the browser. This may be required if the browser is already
loading code and reloading it would cause a problem.
Expand All @@ -398,9 +398,9 @@ function."
(env/with-compiler-env (env/default-compiler-env opts)
(let [opts (merge (BrowserEnv.)
{:optimizations :simple
:working-dir ".repl"
:working-dir "target/austin/repl"
:serve-static true
:static-dir ["." "out/"]
:static-dir ["." "target/austin/out/"]
:preloaded-libs []
:src "src/"
:host "localhost"
Expand All @@ -414,8 +414,10 @@ function."
:repl-url repl-url
:entry-url (str repl-url "/start")
:working-dir (str (:working-dir opts) "/" session-id))
preloaded-libs (set (concat (always-preload)
(map str (:preloaded-libs opts))))]
preloaded-libs (set
(concat
(always-preload {:output-dir (:working-dir opts)})
(map str (:preloaded-libs opts))))]
(swap! sessions update-in [session-id] #(merge %2 %)
(assoc session-init
:ordering (agent {:expecting nil :fns {}})
Expand Down