-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade cljs workflow specs to advanced optimizations
- Loading branch information
1 parent
b0eb447
commit 57a3c37
Showing
4 changed files
with
54 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,44 @@ | ||
{ | ||
:ns-prefix "bwa.mimic" | ||
:env-keys ["BWA_ENV"] | ||
:ignore-errors ["goog/i18n/bidi.js" | ||
"Failed to load resource: net::ERR_FILE_NOT_FOUND"] | ||
:development {:cache-analysis true | ||
:optimizations :none | ||
:output-dir "target/cljs/" | ||
:output-to "target/cljs/bwa_mimic_dev.js" | ||
:pretty-print true | ||
:source-map true | ||
:sources ["spec/cljc" | ||
;"src/cljc" ; Remove until needed | ||
"spec/cljs" | ||
"src/cljs"] | ||
:specs true | ||
:verbose false | ||
:watch-fn c3kit.scaffold.cljs/on-dev-compiled | ||
} | ||
:production { | ||
:cache-analysis false | ||
:infer-externs true | ||
:optimizations :advanced | ||
:output-dir "target/cljs/" | ||
:output-to "target/cljs/bwa_mimic.js" | ||
:pretty-print false | ||
:sources [ | ||
;"src/cljc" ; Remove until needed | ||
"src/cljs" | ||
] | ||
:specs false | ||
:verbose false | ||
} | ||
:ci { | ||
:cache-analysis false | ||
:infer-externs true | ||
:optimizations :simple | ||
:output-dir "target/cljs/" | ||
:output-to "target/cljs/bwa_mimic.js" | ||
:pretty-print false | ||
:sources ["spec/cljc" "spec/cljs" "src/cljs"] | ||
:specs true | ||
:verbose false | ||
} | ||
:ns-prefix "bwa.mimic" | ||
:env-keys ["BWA_ENV"] | ||
:ignore-errors ["goog/i18n/bidi.js"] | ||
:ignore-console ["Failed to load resource: net::ERR_FILE_NOT_FOUND"] | ||
:development {:cache-analysis true | ||
:optimizations :none | ||
:output-dir "target/cljs/" | ||
:output-to "target/cljs/bwa_mimic_dev.js" | ||
:pretty-print true | ||
:source-map true | ||
:sources ["spec/cljc" | ||
;"src/cljc" ; Remove until needed | ||
"spec/cljs" | ||
"src/cljs"] | ||
:specs true | ||
:verbose false | ||
:watch-fn c3kit.scaffold.cljs/on-dev-compiled | ||
} | ||
:production { | ||
:cache-analysis false | ||
:infer-externs true | ||
:optimizations :advanced | ||
:output-dir "target/cljs/" | ||
:output-to "target/cljs/bwa_mimic.js" | ||
:pretty-print false | ||
:sources [ | ||
;"src/cljc" ; Remove until needed | ||
"src/cljs" | ||
] | ||
:specs false | ||
:verbose false | ||
} | ||
:ci { | ||
:cache-analysis false | ||
:optimizations :advanced | ||
:output-dir "target/cljs/" | ||
:output-to "target/cljs/bwa_mimic.js" | ||
:pretty-print false | ||
:sources ["spec/cljc" "spec/cljs" "src/cljs"] | ||
:specs true | ||
:verbose false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,7 @@ | ||
(ns bwa.mimic.spec-helperc | ||
#?(:cljs (:require-macros [bwa.mimic.spec-helperc :refer [capture-logs-around]])) | ||
(:require [c3kit.apron.log :as log] | ||
[taoensso.timbre :as timbre] | ||
[speclj.core #?(:clj :refer :cljs :refer-macros) [around]])) | ||
|
||
;; TODO [BAC]: Fix in c3kit.apron.log/capture-logs instead of here | ||
(defn capture-log! | ||
([config level ?ns-str ?file ?line msg-type ?err vargs_ ?base-data] | ||
(capture-log! config level ?ns-str ?file ?line msg-type ?err vargs_ ?base-data nil nil)) | ||
([config level ?ns-str ?file ?line msg-type ?err vargs_ ?base-data callsite-id] | ||
(capture-log! config level ?ns-str ?file ?line msg-type ?err vargs_ ?base-data callsite-id nil)) | ||
([config level ?ns-str ?file ?line msg-type ?err vargs_ ?base-data callsite-id spying?] | ||
(swap! log/captured-logs conj [config level ?ns-str ?file ?line msg-type ?err vargs_ ?base-data callsite-id spying?]) | ||
nil)) | ||
|
||
(defmacro capture-logs-around [] | ||
`(around [it#] | ||
(let [original-level# (:min-level timbre/*config*)] | ||
(reset! log/captured-logs []) | ||
(try | ||
(timbre/set-min-level! :trace) | ||
(with-redefs [timbre/-log! capture-log!] | ||
(it#)) | ||
(finally | ||
(timbre/set-min-level! original-level#)))))) | ||
`(around [it#] (log/capture-logs (it#)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters