diff --git a/bin/gen-site.js b/bin/gen-site.js
index aefbe47..951fbfd 100755
--- a/bin/gen-site.js
+++ b/bin/gen-site.js
@@ -3,7 +3,7 @@ var cljsLoad = require("./cljs-load");
var srcFile = "outsite/public/js/main.js";
var outputDirectory = "outsite/public/js/out/";
-var moduleName = "devsetup";
+var moduleName = "reagentdemo.dev";
var beep = "\u0007";
@@ -16,7 +16,10 @@ if (typeof location === "undefined") {
var gensite = function () {
console.log("Loading " + srcFile);
var optNone = cljsLoad.load(srcFile, outputDirectory, moduleName);
- sitetools.genpages({"opt-none": optNone});
+ if (typeof reagenttest != "undefined") {
+ reagenttest.runtests.run_tests();
+ }
+ sitetools.core.genpages({"opt-none": optNone});
}
var compileFail = function () {
diff --git a/demo/demo.cljs b/demo/reagentdemo/core.cljs
similarity index 95%
rename from demo/demo.cljs
rename to demo/reagentdemo/core.cljs
index 4494986..6e117a3 100644
--- a/demo/demo.cljs
+++ b/demo/reagentdemo/core.cljs
@@ -1,8 +1,8 @@
-(ns demo
+(ns reagentdemo.core
(:require [reagent.core :as reagent :refer [atom]]
[reagent.interop :as i :refer-macros [.' .!]]
[clojure.string :as string]
- [sitetools :as tools :refer [link]]
+ [sitetools.core :as tools :refer [link]]
[reagentdemo.common :as common :refer [demo-component]]
[reagentdemo.intro :as intro]
[reagentdemo.news :as news]
diff --git a/demo/reagentdemo/intro.cljs b/demo/reagentdemo/intro.cljs
index 67b9799..b4c6a70 100644
--- a/demo/reagentdemo/intro.cljs
+++ b/demo/reagentdemo/intro.cljs
@@ -4,10 +4,10 @@
[reagent.debug :refer-macros [dbg println]]
[clojure.string :as string]
[reagentdemo.syntax :as s]
- [sitetools :refer [link]]
+ [sitetools.core :refer [link]]
[reagentdemo.common :as common :refer [demo-component]]
- [simpleexample :as simple]
- [todomvc :as todo]))
+ [simpleexample.core :as simple]
+ [todomvc.core :as todo]))
(defn simple-component []
[:div
@@ -307,7 +307,7 @@
[demo-component {:comp simple/simple-example
:complete true
- :src (s/src-of nil "simpleexample.cljs")}]])
+ :src (s/src-of nil "simpleexample/core.cljs")}]])
(defn todomvc-demo []
[:div.demo-text
@@ -319,7 +319,7 @@
[demo-component {:comp todo/todo-app
:complete true
- :src (s/src-of nil "todomvc.cljs")}]])
+ :src (s/src-of nil "todomvc/core.cljs")}]])
(defn main []
(let [show-all (atom false)
diff --git a/demo/reagentdemo/news/anyargs.cljs b/demo/reagentdemo/news/anyargs.cljs
index 74f6196..f611766 100644
--- a/demo/reagentdemo/news/anyargs.cljs
+++ b/demo/reagentdemo/news/anyargs.cljs
@@ -3,7 +3,7 @@
[reagent.interop :refer-macros [.' .!]]
[reagent.debug :refer-macros [dbg println]]
[reagentdemo.syntax :as s]
- [sitetools :as tools :refer [link]]
+ [sitetools.core :as tools :refer [link]]
[reagentdemo.common :as common :refer [demo-component]]
[geometry.core :as geometry]))
diff --git a/demo/reagentdemo/news/async.cljs b/demo/reagentdemo/news/async.cljs
index a366f72..67c5dac 100644
--- a/demo/reagentdemo/news/async.cljs
+++ b/demo/reagentdemo/news/async.cljs
@@ -3,7 +3,7 @@
[reagent.interop :refer-macros [.' .!]]
[reagent.debug :refer-macros [dbg println]]
[reagentdemo.syntax :as s]
- [sitetools :as tools :refer [link]]
+ [sitetools.core :as tools :refer [link]]
[reagentdemo.common :as common :refer [demo-component]]))
(def url "news/reagent-is-async.html")
diff --git a/demo/reagentdemo/news/clockpost.cljs b/demo/reagentdemo/news/clockpost.cljs
index caa239c..e380fcf 100644
--- a/demo/reagentdemo/news/clockpost.cljs
+++ b/demo/reagentdemo/news/clockpost.cljs
@@ -3,7 +3,7 @@
[reagent.interop :refer-macros [.' .!]]
[reagent.debug :refer-macros [dbg]]
[reagentdemo.syntax :as s]
- [sitetools :as tools :refer [link]]
+ [sitetools.core :as tools :refer [link]]
[reagentdemo.common :as common :refer [demo-component]]
[reagentdemo.news.binaryclock :as binaryclock]))
diff --git a/demo/reagentdemo/news/news050.cljs b/demo/reagentdemo/news/news050.cljs
index 0ca1913..fad1436 100644
--- a/demo/reagentdemo/news/news050.cljs
+++ b/demo/reagentdemo/news/news050.cljs
@@ -3,9 +3,8 @@
[reagent.interop :refer-macros [.' .!]]
[reagent.debug :refer-macros [dbg println]]
[reagentdemo.syntax :as s]
- [sitetools :as tools :refer [link]]
- [reagentdemo.common :as common :refer [demo-component]]
- [todomvc :as todomvc]))
+ [sitetools.core :as tools :refer [link]]
+ [reagentdemo.common :as common :refer [demo-component]]))
(def url "news/news050.html")
(def title "News in 0.5.0-alpha")
diff --git a/demo/reagentdemo/news/undodemo.cljs b/demo/reagentdemo/news/undodemo.cljs
index bf642dd..95a9dad 100644
--- a/demo/reagentdemo/news/undodemo.cljs
+++ b/demo/reagentdemo/news/undodemo.cljs
@@ -3,9 +3,9 @@
[reagent.interop :refer-macros [.' .!]]
[reagent.debug :refer-macros [dbg println]]
[reagentdemo.syntax :as s]
- [sitetools :as tools :refer [link]]
+ [sitetools.core :as tools :refer [link]]
[reagentdemo.common :as common :refer [demo-component]]
- [todomvc :as todomvc]))
+ [todomvc.core :as todomvc]))
(def url "news/cloact-reagent-undo-demo.html")
(def title "Cloact becomes Reagent: Undo is trivial")
diff --git a/demo/sitetools.cljs b/demo/sitetools/core.cljs
similarity index 99%
rename from demo/sitetools.cljs
rename to demo/sitetools/core.cljs
index c1414ca..0b26535 100644
--- a/demo/sitetools.cljs
+++ b/demo/sitetools/core.cljs
@@ -1,4 +1,4 @@
-(ns sitetools
+(ns sitetools.core
(:require [clojure.string :as string]
[goog.events :as evt]
[goog.history.EventType :as hevt]
diff --git a/env/dev/devsetup.cljs b/env/dev/reagentdemo/dev.cljs
similarity index 62%
rename from env/dev/devsetup.cljs
rename to env/dev/reagentdemo/dev.cljs
index ef288d0..f527368 100644
--- a/env/dev/devsetup.cljs
+++ b/env/dev/reagentdemo/dev.cljs
@@ -1,6 +1,6 @@
-(ns ^:figwheel-always devsetup
- (:require [demo :as site]
- [runtests]
+(ns ^:figwheel-always reagentdemo.dev
+ (:require [reagentdemo.core :as demo]
+ [reagenttest.runtests :as runtests]
[reagent.core :as r]
[figwheel.client :as fw]))
@@ -13,6 +13,7 @@
(defn start! []
(demo/start! {:test-results test-results})
- (runtests/run-tests))
+ (when r/is-client
+ (runtests/run-tests)))
(start!)
diff --git a/env/prod/prodsetup.cljs b/env/prod/prodsetup.cljs
deleted file mode 100644
index b23eae1..0000000
--- a/env/prod/prodsetup.cljs
+++ /dev/null
@@ -1,12 +0,0 @@
-(ns envsetup
- (:require [demo :as site]
- [reagent.core :as r]))
-
-(site/start! nil)
-
-(defn do-test []
- (when (exists? js/runtests)
- (js/runtests.run-tests)))
-
-;; Wait for tests to be defined
-(r/next-tick do-test)
diff --git a/env/prod/reagentdemo/prod.cljs b/env/prod/reagentdemo/prod.cljs
new file mode 100644
index 0000000..f2aa16d
--- /dev/null
+++ b/env/prod/reagentdemo/prod.cljs
@@ -0,0 +1,13 @@
+(ns reagentdemo.prod
+ (:require [reagentdemo.core :as demo]
+ [reagent.core :as r]))
+
+(demo/start! nil)
+
+(defn do-test []
+ (when (and (exists? js/reagenttest))
+ (js/reagenttest.runtests.run-tests)))
+
+;; Wait for tests to be defined
+(when r/is-client
+ (r/next-tick do-test))
diff --git a/examples/geometry/devsrc/devsetup.cljs b/examples/geometry/devsrc/geometry/dev.cljs
similarity index 91%
rename from examples/geometry/devsrc/devsetup.cljs
rename to examples/geometry/devsrc/geometry/dev.cljs
index a25b803..06883d1 100644
--- a/examples/geometry/devsrc/devsetup.cljs
+++ b/examples/geometry/devsrc/geometry/dev.cljs
@@ -1,4 +1,4 @@
-(ns devsetup
+(ns geometry.dev
(:require [geometry.core :as example]
[figwheel.client :as fw]))
diff --git a/examples/geometry/project.clj b/examples/geometry/project.clj
index f6d042d..6adf2f0 100644
--- a/examples/geometry/project.clj
+++ b/examples/geometry/project.clj
@@ -1,6 +1,6 @@
(defproject geometry-reagent "0.5.0-alpha3"
:dependencies [[org.clojure/clojure "1.6.0"]
- [org.clojure/clojurescript "0.0-2760"]
+ [org.clojure/clojurescript "0.0-2816"]
[reagent "0.5.0-alpha3"]
[figwheel "0.2.3-SNAPSHOT"]]
@@ -12,7 +12,7 @@
:profiles {:dev {:cljsbuild
{:builds {:client {:source-paths ["devsrc"]
:compiler
- {:main devsetup
+ {:main geometry.dev
:optimizations :none
:source-map true
:source-map-timestamp true}}}}}
diff --git a/examples/todomvc/devsrc/devsetup.cljs b/examples/simple/devsrc/simpleexample/dev.cljs
similarity index 66%
rename from examples/todomvc/devsrc/devsetup.cljs
rename to examples/simple/devsrc/simpleexample/dev.cljs
index adce322..543863a 100644
--- a/examples/todomvc/devsrc/devsetup.cljs
+++ b/examples/simple/devsrc/simpleexample/dev.cljs
@@ -1,5 +1,5 @@
-(ns devsetup
- (:require [todomvc :as example]
+(ns simpleexample.dev
+ (:require [simpleexample.core :as example]
[figwheel.client :as fw]))
(fw/start {:on-jsload example/run
diff --git a/examples/simple/example.html b/examples/simple/example.html
index 0caf43b..a9b7c39 100644
--- a/examples/simple/example.html
+++ b/examples/simple/example.html
@@ -11,7 +11,7 @@