-
Notifications
You must be signed in to change notification settings - Fork 20
/
project.clj
423 lines (404 loc) · 25.6 KB
/
project.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
(def npm-deps {
})
(def closure-warns {:non-standard-jsdoc :off})
(defn modules [output-dir]
(letfn [(path [route module?]
(str output-dir "/" (when module? "closure-modules/") (name route) ".js"))
(module [[route {:keys [entries depends-on] :as m}]]
[route (cond-> (assoc m :output-to (path route true))
(some? depends-on)
(update :depends-on set)
:always
(update :entries set))])]
(into `{:cljs-base {:entries #{env.web.main}
:output-to ~(path :budget false)}}
(map module)
`{
;; Extra groupings
:stream+chat {:entries [eponai.common.ui.stream
eponai.common.stream
eponai.common.ui.chat
eponai.web.ui.stream.videoplayer
eponai.web.chat
eponai.web.sente
taoensso.sente
taoensso.sente.interfaces
taoensso.sente.packers.transit]}
;; Routes
:index {:entries [eponai.common.ui.index]}
:unauthorized {:entries [eponai.web.ui.unauthorized]}
:login {:entries [eponai.web.ui.login-page]}
:landing-page {:entries [eponai.web.ui.landing-page]}
:sell {:entries [eponai.web.ui.start-store]}
:store {:entries [eponai.common.ui.store]
:depends-on [:stream+chat]}
:stores {:entries [eponai.web.ui.stores]}
:tos {:entries [eponai.web.ui.tos]}
:checkout {:entries [eponai.web.ui.checkout
eponai.web.google-places]}
:browse {:entries [eponai.common.ui.goods
eponai.common.ui.product-filters]}
:shopping-bag {:entries [eponai.common.ui.shopping-bag]}
:product {:entries [eponai.common.ui.product-page]}
:live {:entries [eponai.common.ui.streams]}
:help {:entries [eponai.common.ui.help
eponai.common.ui.help.faq
eponai.common.ui.help.first-stream
eponai.common.ui.help.mobile-stream
eponai.common.ui.help.quality
eponai.web.ui.help.shipping-rules]}
:user {:entries [eponai.common.ui.user
eponai.common.ui.user.order-list
eponai.common.ui.user.order-receipt]}
:about {:entries [eponai.web.ui.about-sulo]}
:user-settings {:entries [eponai.web.ui.user.settings]}
:store-dashboard {:depends-on [:stream+chat]
:entries [eponai.common.ui.store.dashboard
eponai.common.ui.store.order-edit-form
eponai.common.ui.store.order-list
eponai.common.ui.store.product-edit-form
eponai.common.ui.store.product-list
eponai.common.ui.store.stream-settings
eponai.web.ui.store.edit-store
eponai.web.ui.store.business.verify
eponai.web.ui.store.business.specs
eponai.web.ui.store.finances.settings
eponai.web.ui.store.business
eponai.web.ui.store.edit-store
eponai.web.ui.store.finances
eponai.web.ui.store.home
eponai.web.ui.store.shipping
cljsjs.react-grid-layout]}})))
(defproject budget "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [
[org.clojure/clojure "1.9.0-alpha17"]
[org.clojars.petterik/om "1.0.0-alpha49-SNAPSHOT-1"]
;;[org.omcljs/om "1.0.0-alpha46"]
[io.netty/netty-all "4.1.11.Final"]
[aleph "0.4.3" :exclusions [io.netty/netty-all]]
[aleph-middleware "0.1.2" :exclusions [aleph]]
[clj-http "3.3.0" :exclusions [riddley]]
[clj-time "0.13.0"]
[compojure "1.5.1"]
[alxlit/autoclave "0.2.0"
:exclusions [com.google.guava/guava]]
[buddy/buddy-auth "1.3.0"]
[com.cemerick/url "0.1.1"]
[org.apache.logging.log4j/log4j-api "2.6.2"]
[org.apache.logging.log4j/log4j-to-slf4j "2.6.2"]
[com.datomic/datomic-pro "0.9.5544"
:exclusions [joda-time]]
[com.amazonaws/aws-java-sdk-dynamodb "1.11.77"
:exclusions [joda-time org.clojure/test.check]]
[amazonica "0.3.85"
:exclusions [com.google.protobuf/protobuf-java]]
;; Using our own com.taoensso/encore to exclude cljs.test and
;; cljs.pprint from advanced mode compilation.
[org.clojars.petterik/encore "2.91.1-SNAPSHOT"]
[com.taoensso/timbre "4.10.0"]
[com.taoensso/sente "1.11.0"]
[com.draines/postal "2.0.2"]
[environ "1.1.0"]
[hiccup "1.0.5"]
[org.clojure/data.generators "0.1.2"]
[org.clojure/core.async "0.3.442"]
[org.clojure/core.memoize "0.5.9"]
[org.clojure/data.json "0.2.6"]
[com.stuartsierra/component "0.3.2"]
[suspendable "0.1.1"]
;; Depending on transit-clj for faster cljs builds
[com.cognitect/transit-clj "0.8.300"]
; ring helpers
[org.elasticsearch.client/x-pack-transport "5.4.2"]
[ring/ring-core "1.5.0"]
[ring/ring-devel "1.5.0"]
[ring/ring-defaults "0.2.1"]
[ring/ring-ssl "0.2.1"]
[ring/ring-anti-forgery "1.0.1"]
[ring-transit "0.1.6"]
[ring/ring-json "0.4.0" :exclusions [cheshire]]
;; For ring-json
[cheshire "5.7.1" :exclusions [com.fasterxml.jackson.core/jackson-core]]
[medley "0.8.3"]
[org.martinklepsch/s3-beam "0.6.0-alpha1"]
[slingshot "0.12.2"]
[inflections "0.13.0"]
[com.google.firebase/firebase-admin "5.2.0"]
;; CLJS
[cljsjs/react "15.4.2-2"]
[cljsjs/react-dom "15.4.2-2"]
[com.cognitect/transit-cljs "0.8.239"]
[org.clojure/clojurescript "1.9.660"
;; :classifier "aot"
:exclusion [org.clojure/data.json]
]
[com.google.guava/guava "21.0"]
[com.andrewmcveigh/cljs-time "0.4.0"]
[cljs-http "0.1.39"]
[org.clojure/tools.reader "1.0.0-beta4"]
[garden "1.3.2"]
[datascript "0.15.5"]
[datascript-transit "0.2.2"
:exclusions [com.cognitect/transit-clj
com.cognitect/transit-cljs]]
[cljsjs/stripe "2.0-0"]
[cljsjs/quill "1.1.0-3"]
[cljsjs/react-select "1.0.0-rc.1"]
[cljsjs/react-grid-layout "0.13.7-0"]
[cljsjs/firebase "4.0.0-0"]
[bidi "2.0.10"]
[kibu/pushy "0.3.6"]
[prone "1.1.4"]
;; React-native
[natal-shell "0.3.0"]
;; Testing
]
:exclusions [org.clojure/test.check
org.clojure/clojure
org.clojure/clojurescript
org.clojure/core.memoize
cljsjs/react
;; Using our own version which doesn't refer to cljs.test and cljs.pprint
com.taoensso/encore]
:jvm-opts ^:replace ["-Xms512m"
"-Xmx3048m"
"-server"
"-XX:+CMSClassUnloadingEnabled"
"-Djava.awt.headless=true"
"-XX:-OmitStackTraceInFastThrow"
]
:resource-paths ["resources" "node_modules" "bower_components"]
:plugins [
;; [lein-npm "0.6.1"]
[lein-shell "0.5.0"]
[lein-doo "0.1.7" :exclusions [org.clojure/clojure org.clojure/clojurescript]]
[lein-cljsbuild "1.1.7" :exclusions [org.clojure/clojure org.clojure/clojurescript]]
[lein-figwheel "0.5.10" :exclusions [org.clojure/clojure]]
[lein-environ "1.1.0"]]
:min-lein-version "2.0.0"
:clean-targets ^{:protect false} ["resources/public/dev/js/out"
"resources/public/devcards/js/out"
;; Don't clean release, as we don't want "lein clean" to
;; remove our build javascript from the release dir.
;; See circle.yml (CircleCi)
;; "resources/public/release/js/out"
"resources/public/doo-test/js/out"
"resources/public/test/js/out"
"target/"
;; "index.ios.js"
;; "index.android.js"
]
:aliases {"all-deps" ^{:doc "Fetches both clj, cljs and node dependencies."}
["do"
["deps"]
;; ["pod-deps"]
["npm-deps"]
["css"]]
"npm-deps" ["do"
["shell" "npm" "install"]
["shell" "bower" "install"]]
"css" ["shell" "./scripts/compile-css.sh"]
"css-watch" ["shell" "./scripts/compile-css.sh" "watch"]
"prod-build-web" ^{:doc "Recompile web code with release build."}
["do"
["with-profile" "+web-prod" "cljsbuild" "once" "release"]]
"prod-build-server" ^{:doc "Recompile server code with release build."}
["do" "uberjar"]
"simple-build-web" ^{:doc "Recompile web code with release build."}
["do"
["with-profile" "+web" "cljsbuild" "once" "simple"]]
"simple-build-web-auto" ^{:doc "Recompile web code with release build."}
["do"
["with-profile" "+web" "cljsbuild" "auto" "simple"]]
"dev-build-web" ^{:doc "Compile web code in development mode."}
["do"
["with-profile" "+web" "cljsbuild" "once" "dev"]]
"dev-build-web-auto" ^{:doc "Compile web code in development mode continously."}
["do"
["with-profile" "+web" "cljsbuild" "auto" "dev"]]
"run-tests-web" ^{:doc "Compile and run web tests"}
["do"
["with-profile" "+web" "cljsbuild" "once" "doo-test"]
;;["with-profile" "+web" "doo" "phantom" "doo-test" "once"]
]
"figwheel-web" ^{:doc "Start figwheel for web"}
["do"
["with-profile" "+web" "figwheel" "dev"]
]
"figwheel-web+devcards" ^{:doc "Start figwheel for web"}
["do"
["with-profile" "+web" "figwheel" "dev" "devcards"]
]
"figwheel-test" ^{:doc "Start figwheel for web"}
["do"
["with-profile" "+web" "figwheel" "test"]]
"figwheel-web+test" ^{:doc "Start figwheel for web"}
["do"
["with-profile" "+web" "figwheel" "dev" "test"]]
}
;; TODO: TEST ALL ALIASES
;;;;;;;;;;;;;
;; AWS+Docker deploy:
;;;;;;;;;;;;;
:uberjar-name "budget-0.1.0-SNAPSHOT-standalone.jar"
:figwheel {:validate-config :ignore-unknown-keys
:css-dirs ["resources/public/assets/css/"]
:server-port ~(read-string (or (System/getenv "FIGWHEEL_PORT") "3449"))
;; :reload-clj-files {:clj true :cljc true}
}
:profiles {:dev {:dependencies [[lein-doo "0.1.7"
:exclusions [org.clojure/clojure]]
[devcards "0.2.2"]
[plomber "0.1.0"]
[reloaded.repl "0.2.3"
:exclusions [com.stuartsierra/component]]
[org.clojure/test.check "0.9.0"]
[binaryage/devtools "0.9.4"]
[org.clojure/tools.nrepl "0.2.11"
:exclusions [org.clojure/clojure]]
[vvvvalvalval/datomock "0.2.0"]
[org.clojure/tools.namespace "0.2.11"]
[aprint "0.1.3"]
[cljsjs/nvd3 "1.8.2-1"]
[figwheel-sidecar "0.5.10"]
[com.cemerick/piggieback "0.2.1"]
[criterium "0.4.4"]
]
:repl-options {:timeout 120000
:init-ns eponai.repl
:init (eponai.repl/init)}
:test-paths ["test" "env/server/dev"]}
:tester {:dependencies [[lein-cljsbuild "1.1.7"]
[cljsbuild "1.1.7"]
[clj-stacktrace "0.2.5"]
[lein-doo "0.1.7"
:exclusions [org.clojure/clojure]]]}
:uberjar {:jvm-opts ^:replace ["-Dclojure.compiler.direct-linking=true"
"-Xmx3g" "-server"]
:aot :all
:resource-paths ^:replace ["resources"]}
:web-prod {:dependencies [[amazonica "0.3.85"
:exclusions [com.taoensso/encore
com.google.protobuf/protobuf-java]]
;; [binaryage/devtools "0.9.4"]
]
:jvm-opts ^:replace ["-Xmx3g" "-server"]
:cljsbuild {:builds [{:id "release"
:source-paths ["src/" "src-hacks/web/" "env/client/prod"]
:compiler {:closure-defines {"goog.DEBUG" false}
:main "env.web.main"
:asset-path "/release/js/out"
:output-to "resources/public/release/js/out/budget.js"
:output-dir "resources/public/release/js/out/"
:optimizations :advanced
:externs ["src-hacks/js/externs/stripe-checkout.js"
"src-hacks/js/externs/red5pro.js"
"src-hacks/js/externs/hls.js"]
:infer-externs true
;; :preloads [env.web.preloads]
:language-in :ecmascript5
:parallel-build true
;; :pseudo-names true
;; :pretty-print true
:elide-asserts true
:verbose true
:compiler-stats true
:npm-deps ~npm-deps
;; :modules ~(modules "resources/public/release/js/out/")
}}]}}
:web {:jvm-opts ^:replace ["-Xmx3g" "-server"]
:cljsbuild {:builds [{:id "dev"
:figwheel {:on-jsload "eponai.web.figwheel/reload!"}
:source-paths ["src/" "src-hacks/web/" "env/client/dev"]
:compiler {:main "env.web.main"
:asset-path "/dev/js/out"
:output-to "resources/public/dev/js/out/budget.js"
;; :modules ~(modules "/dev/js/out")
:output-dir "resources/public/dev/js/out/"
:optimizations :none
:parallel-build true
:source-map true
:npm-deps ~npm-deps
:closure-warnings ~closure-warns
;; Speeds up Figwheel cycle, at the risk of dependent namespaces getting out of sync.
:recompile-dependents false
}}
{:id "devcards"
:source-paths ["src/" "src-hacks/web/" "test/"]
:figwheel {:devcards true ;; <- note this
}
:compiler {:main "eponai.devcards.devcards_main"
:asset-path "/devcards/js/out"
:output-to "resources/public/devcards/js/out/budget.js"
:output-dir "resources/public/devcards/js/out"
:source-map-timestamp true
:closure-warnings ~closure-warns
:npm-deps ~npm-deps
:recompile-dependents false}}
{:id "test"
:source-paths ["src/" "src-hacks/web/" "test/"]
:figwheel {:on-jsload "eponai.client.figwheel.test-main/reload-figwheel!"}
:compiler {:output-to "resources/public/test/js/out/budget.js"
:output-dir "resources/public/test/js/out"
:asset-path "/test/js/out"
:main "eponai.client.figwheel.test-main"
:parallel-build true
:optimizations :none
:source-map true
:closure-warnings ~closure-warns
:npm-deps ~npm-deps
:recompile-dependents false
}}
{:id "doo-test"
:source-paths ["src/" "src-hacks/web/" "test/"]
:compiler {:output-to "resources/public/doo-test/js/out/budget.js"
:output-dir "resources/public/doo-test/js/out"
:main "eponai.client.tests"
:parallel-build false
:optimizations :none
:source-map true
:closure-warnings ~closure-warns
:npm-deps ~npm-deps
}}
{:id "simple"
:source-paths ["src/" "src-hacks/web/" "env/client/simple"]
:compiler {:closure-defines {"goog.DEBUG" true}
:main "env.web.main"
:asset-path "/simple/js/out"
:output-to "resources/public/simple/js/out/budget.js"
:output-dir "resources/public/simple/js/out/"
:optimizations :simple
:externs ["src-hacks/js/externs/stripe-checkout.js"]
:infer-externs true
;; :language-in :ecmascript5
:parallel-build true
:pretty-print true
:compiler-stats true
:verbose true
;; :source-map true
:npm-deps ~npm-deps
:modules ~(modules "resources/public/simple/js/out/")
}}]}}}
;;;;;;;;;;;;;
;; clj:
;;;;;;;;;;;;;
:target-path "target/%s"
:source-paths ["src"]
:ring {:handler eponai.server.core/app
:init eponai.server.core/init}
:main eponai.server.core
:repositories {"elasticsearch" {:url "https://artifacts.elastic.co/maven"
:releases true
:snapshots false}
"my.datomic.com" {:url "https://my.datomic.com/repo"
:username ~(System/getenv "DATOMIC_EMAIL")
:password ~(System/getenv "DATOMIC_KEY")}}
;;;;;;;;;;;;;
;; cljs:
;;;;;;;;;;;;;
:doo {:paths {:phantom "./node_modules/phantomjs/bin/phantomjs"}}
)