Skip to content

Commit b75deac

Browse files
committed
cleanups
1 parent c6b77a2 commit b75deac

File tree

11 files changed

+55
-125
lines changed

11 files changed

+55
-125
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
target
2+
resources/public/js
3+
.idea
4+
*.iml
5+
*.log

dev/client/cljs/user.cljs

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22
(:require
33
[clojure.pprint :refer (pprint)]
44
[clojure.stacktrace :refer (print-stack-trace)]
5-
[clojure.tools.namespace.repl :refer [disable-reload! refresh clear set-refresh-dirs]]
65
[com.stuartsierra.component :as component]
7-
[figwheel-sidecar.repl-api :as ra]
8-
[figwheel-sidecar.system :as fig]
9-
[app.system :as sys]
10-
[com.rpl.specter :as s]
11-
[taoensso.timbre :as timbre]))
6+
[figwheel-sidecar.system :as fig]))
127

138
;;FIGWHEEL
149
(def figwheel-config (fig/fetch-config))
@@ -28,29 +23,3 @@
2823
(println "STARTING FIGWHEEL ON BUILDS: " build-ids)
2924
(swap! figwheel component/start)
3025
(fig/cljs-repl (:figwheel-system @figwheel)))))
31-
32-
(set-refresh-dirs "src/server" "dev/server")
33-
34-
(defonce system (atom nil))
35-
36-
(defn init
37-
"Create a web server from configurations. Use `start` to start it."
38-
[]
39-
(reset! system (sys/make-system)))
40-
41-
(defn start "Start (an already initialized) web server." [] (swap! system component/start))
42-
43-
(defn stop "Stop the running web server." []
44-
(when @system
45-
(swap! system component/stop)
46-
(reset! system nil)))
47-
48-
(defn go "Load the overall web server system and start it." []
49-
(init)
50-
(start))
51-
52-
(defn reset
53-
"Stop the web server, refresh all namespace source code from disk, then restart the web server."
54-
[]
55-
(stop)
56-
(refresh :after 'user/go))

project.clj

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,31 @@
77
:dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
88
[org.clojure/clojurescript "1.9.229" :scope "provided"]
99
[org.omcljs/om "1.0.0-alpha45" :scope "provided"]
10-
[binaryage/devtools "0.5.2" :scope "test"]
11-
[figwheel-sidecar "0.5.5" :scope "test" :exclusions [ring/ring-core joda-time org.clojure/tools.reader]]
1210
[garden "1.3.2"]
1311
[com.rpl/specter "0.13.0"]
14-
[navis/untangled-spec "0.3.7-1" :scope "test"]
15-
]
12+
[navis/untangled-spec "0.3.7-1" :scope "test"]]
1613

17-
:plugins [[lein-cljsbuild "1.1.3"]]
14+
:plugins [[lein-cljsbuild "1.1.4"]]
1815

1916
:source-paths ["src"]
17+
:resource-paths []
2018
:jvm-opts ["-server" "-Xmx1024m" "-Xms512m" "-XX:-OmitStackTraceInFastThrow"]
2119
:clean-targets ^{:protect false} ["resources/public/js" "target"]
2220

2321
:cljsbuild {:builds
2422
[{:id "test"
25-
:source-paths ["test" "src"]
23+
:source-paths ["test" "src" "dev"]
2624
:figwheel true
27-
:compiler {:main app.suite
28-
:output-to "resources/public/js/specs/specs.js"
29-
:output-dir "resources/public/js/compiled/specs"
30-
:asset-path "js/compiled/specs"
31-
:recompile-dependents true
32-
:optimizations :none}}]}
25+
:compiler {:main om-css.suite
26+
:output-to "resources/public/js/specs/specs.js"
27+
:output-dir "resources/public/js/compiled/specs"
28+
:asset-path "js/compiled/specs"
29+
:optimizations :none}}]}
30+
31+
:profiles {:dev {:source-paths ["src" "dev"]
32+
:resource-paths ["src" "resources"]
33+
:dependencies [[binaryage/devtools "0.5.2" :scope "test"]
34+
[figwheel-sidecar "0.5.5" :scope "test" :exclusions [ring/ring-core joda-time org.clojure/tools.reader]]]}}
3335

3436
:repl-options {:init-ns user
3537
:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}

resources/public/css/base.css

Whitespace-only changes.

resources/public/css/index.css

Whitespace-only changes.

resources/public/index.html

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<!DOCTYPE html>
2-
<html lang="en">
3-
<head>
4-
<meta charset="utf-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1">
6-
<title>Untangled Recipe</title>
7-
<link rel="stylesheet" href="css/base.css">
8-
<link rel="stylesheet" href="css/index.css">
9-
</head>
10-
<body>
11-
<div id="app"></div>
12-
<script src="js/compiled/app.js"></script>
13-
</body>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<link href="css/test.css" rel="stylesheet" type="text/css">
6+
<link href="css/edn.css" rel="stylesheet" type="text/css">
7+
<link id="favicon" rel="shortcut icon" type="image/png"
8+
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAIElEQVQ4T2NMS0v7z0ABYBw1gGE0DBhGwwCYh4ZBOgAAcQUjIUXh8RYAAAAASUVORK5CYII="/>
9+
</head>
10+
<body>
11+
<div id="app-specs"></div>
12+
<script src="js/specs/specs.js" type="text/javascript"></script>
13+
</body>
1414
</html>
15+

resources/public/test.html

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/om-css/core.cljc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
(:require [clojure.string :as str]
55
[garden.core :as g]
66
#?(:clj
7-
[cljs.tagged-literals])
8-
[om.next :as om])
7+
[cljs.tagged-literals]))
98
#?(:clj
109
(:import (cljs.tagged_literals JSValue))))
1110

@@ -111,7 +110,7 @@
111110
(let [cn (name c)]
112111
(if (str/starts-with? cn "$")
113112
(str/replace cn #"^[$]" "")
114-
`(app.css/local-class ~class ~cn))))
113+
`(om-css.core/local-class ~class ~cn))))
115114
subclasses (if (vector? subclass)
116115
(apply list (reduce (fn [acc c] (conj acc (entry c) " ")) ['str] subclass))
117116
(entry subclass))]

test/om-css/core_spec.cljs

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(ns om-css.core-spec
22
(:require [untangled-spec.core :refer-macros [specification assertions behavior]]
3-
[om-css.core :as css]
3+
[om-css.core :as css :refer-macros [apply-css]]
44
[om.next :as om :refer-macros [defui]]
55
[om.dom :as dom]))
66

@@ -38,28 +38,32 @@
3838
(specification "CSS merge"
3939
(assertions
4040
"Allows a component to specify a single rule"
41-
(css/css-merge Child) => [[:.app_css-spec_Child__p {:font-weight 'bold}]]
41+
(css/css-merge Child) => [[:.om-css_core-spec_Child__p {:font-weight 'bold}]]
4242
"Allows a component to specify multiple rules"
43-
(css/css-merge Child2) => [[:.app_css-spec_Child2__p {:font-weight 'bold}]
44-
[:.app_css-spec_Child2__p2 {:font-weight 'normal}]]
43+
(css/css-merge Child2) => [[:.om-css_core-spec_Child2__p {:font-weight 'bold}]
44+
[:.om-css_core-spec_Child2__p2 {:font-weight 'normal}]]
4545
"Allows component combinations"
46-
(css/css-merge Child Child2) => [[:.app_css-spec_Child__p {:font-weight 'bold}]
47-
[:.app_css-spec_Child2__p {:font-weight 'bold}]
48-
[:.app_css-spec_Child2__p2 {:font-weight 'normal}]]
46+
(css/css-merge Child Child2) => [[:.om-css_core-spec_Child__p {:font-weight 'bold}]
47+
[:.om-css_core-spec_Child2__p {:font-weight 'bold}]
48+
[:.om-css_core-spec_Child2__p2 {:font-weight 'normal}]]
4949
"Merges rules in with component css"
50-
(css/css-merge Child [:a {:x 1}] Child2) => [[:.app_css-spec_Child__p {:font-weight 'bold}]
50+
(css/css-merge Child [:a {:x 1}] Child2) => [[:.om-css_core-spec_Child__p {:font-weight 'bold}]
5151
[:a {:x 1}]
52-
[:.app_css-spec_Child2__p {:font-weight 'bold}]
53-
[:.app_css-spec_Child2__p2 {:font-weight 'normal}]]
54-
))
52+
[:.om-css_core-spec_Child2__p {:font-weight 'bold}]
53+
[:.om-css_core-spec_Child2__p2 {:font-weight 'normal}]]))
5554

5655
(defrecord X [])
5756

58-
#_(specification "apply-css macro"
57+
(defui Boo
58+
static css/CSS
59+
(css [this] [:a {:x 1}]))
60+
61+
(specification "apply-css macro"
5962
(assertions
60-
"Converts :class entries to localized names"
61-
(css/apply-css X (pr-str [:a {:b [:c {:d #js {:class :a}}]}])) => "[:a {:b [:c {:d {:className \"app_css-spec_X__a\"}}]}]"
62-
))
63+
"Converts :class entries to localized names for record types"
64+
(apply-css X (pr-str [:a {:b [:c {:d #js {:class :a}}]}])) => "[:a {:b [:c {:d #js {:className \"om-css_core-spec_X__a\"}}]}]"
65+
"Converts :class entries to localized names for defui types"
66+
(apply-css Boo (pr-str [:a {:b [:c {:d #js {:class :a}}]}])) => "[:a {:b [:c {:d #js {:className \"om-css_core-spec_Boo__a\"}}]}]"))
6367

6468

6569

0 commit comments

Comments
 (0)