diff --git a/Makefile b/Makefile index 731fcdf..856418c 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ PORT = 4562 -PROF = dev -PROF = dev,test +PROF = dev,demo +PROF = dev,demo,test # PROF = dev,test,srcmap # PROF = prod,test # PROF = prod @@ -55,10 +55,10 @@ copyjs: bower_components src/cloact/react.min.js src/cloact/react.js gensite: node bin/gen-site.js -prodbuild: - $(MAKE) PROF=prod,test leinbuild +demobuild: + $(MAKE) PROF=prod,demo leinbuild -buildsite: prodbuild gensite +buildsite: demobuild gensite setversion: version=$(VERSION); \ diff --git a/test/demo.cljs b/demo/demo.cljs similarity index 98% rename from test/demo.cljs rename to demo/demo.cljs index 594786a..5e32f51 100644 --- a/test/demo.cljs +++ b/demo/demo.cljs @@ -304,11 +304,6 @@ :defs [:ns :calc-bmi :bmi-data :set-bmi :slider :bmi-component]}]]) -(defn test-results [] - [:div.demo-text - [:h2 "Test results"] - [runtests/test-output]]) - (defn complete-simple-demo [] [:div.demo-text [:h2 "Complete demo"] @@ -340,8 +335,6 @@ (defn demo [] [:div - [:div.test-output-mini - [runtests/test-output-mini]] [:div.cloact-demo [:h1 "Cloact: Minimalistic React for ClojureScript"] [intro] @@ -349,7 +342,6 @@ [essential-api] [bmi-demo] [performance] - [test-results] [complete-simple-demo] [todomvc-demo]] [github-badge]]) diff --git a/test/demoutil.clj b/demo/demoutil.clj similarity index 100% rename from test/demoutil.clj rename to demo/demoutil.clj diff --git a/test/demoutil.cljs b/demo/demoutil.cljs similarity index 100% rename from test/demoutil.cljs rename to demo/demoutil.cljs diff --git a/project.clj b/project.clj index 2469e9e..65df3e2 100644 --- a/project.clj +++ b/project.clj @@ -19,6 +19,11 @@ {:client {:source-paths ["test" "examples/todomvc/src" "examples/simple/src"]}}}} + :demo {:cljsbuild + {:builds + {:client {:source-paths ["demo" + "examples/todomvc/src" + "examples/simple/src"]}}}} :srcmap {:cljsbuild {:builds {:client diff --git a/site/test.html b/site/test.html index a122385..5c9c33b 100644 --- a/site/test.html +++ b/site/test.html @@ -14,8 +14,8 @@

This will become an example when compiled

diff --git a/test/runtests.cljs b/test/runtests.cljs index add607c..20ee6ea 100644 --- a/test/runtests.cljs +++ b/test/runtests.cljs @@ -40,3 +40,10 @@ [test-output]) [:div "."]))) +(defn test-demo [] + [:div + [test-output] + [demo/demo]]) + +(defn ^:export mounttests [] + (cloact/render-component [test-demo] (.-body js/document)))