[Fix #3076] Separate figwheel from dev lein profile
Signed-off-by: Dmitry Novotochinov <trybeee@gmail.com>
This commit is contained in:
parent
03e62548a6
commit
ae04dde8ba
|
@ -2,7 +2,8 @@
|
||||||
(:use [figwheel-sidecar.repl-api :as ra])
|
(:use [figwheel-sidecar.repl-api :as ra])
|
||||||
(:require [hawk.core :as hawk]
|
(:require [hawk.core :as hawk]
|
||||||
[re-frisk-sidecar.core :as rfs]
|
[re-frisk-sidecar.core :as rfs]
|
||||||
[clojure.string :as s]))
|
[clojure.string :as s]
|
||||||
|
[status-im.utils.core :as utils]))
|
||||||
|
|
||||||
(defn get-test-build [build]
|
(defn get-test-build [build]
|
||||||
(update build :source-paths
|
(update build :source-paths
|
||||||
|
@ -65,7 +66,9 @@
|
||||||
(drop-while #(not= % :profiles))
|
(drop-while #(not= % :profiles))
|
||||||
(apply hash-map)
|
(apply hash-map)
|
||||||
:profiles)
|
:profiles)
|
||||||
cljs-builds (get-in profiles [:dev :cljsbuild :builds])
|
dev-cljs-builds (get-in profiles [:dev :cljsbuild :builds])
|
||||||
|
fig-cljs-builds (get-in profiles [:figwheel 1 :cljsbuild :builds])
|
||||||
|
cljs-builds (utils/deep-merge dev-cljs-builds fig-cljs-builds)
|
||||||
builds (get-builds build-ids cljs-builds)]
|
builds (get-builds build-ids cljs-builds)]
|
||||||
(start-figwheel build-ids builds)
|
(start-figwheel build-ids builds)
|
||||||
(rfs/-main))))
|
(rfs/-main))))
|
||||||
|
|
29
project.clj
29
project.clj
|
@ -18,28 +18,20 @@
|
||||||
["do" "clean"
|
["do" "clean"
|
||||||
["with-profile" "prod" "cljsbuild" "once" "ios"]
|
["with-profile" "prod" "cljsbuild" "once" "ios"]
|
||||||
["with-profile" "prod" "cljsbuild" "once" "android"]]
|
["with-profile" "prod" "cljsbuild" "once" "android"]]
|
||||||
"figwheel-repl" ["run" "-m" "clojure.main" "env/dev/run.clj"]
|
"figwheel-repl" ["with-profile" "+figwheel" "run" "-m" "clojure.main" "env/dev/run.clj"]
|
||||||
"test-cljs" ["with-profile" "test" "doo" "node" "test" "once"]
|
"test-cljs" ["with-profile" "test" "doo" "node" "test" "once"]
|
||||||
"test-protocol" ["with-profile" "test" "doo" "node" "protocol" "once"]
|
"test-protocol" ["with-profile" "test" "doo" "node" "protocol" "once"]
|
||||||
"test-env-dev-utils" ["with-profile" "test" "doo" "node" "env-dev-utils" "once"]}
|
"test-env-dev-utils" ["with-profile" "test" "doo" "node" "env-dev-utils" "once"]}
|
||||||
:figwheel {:nrepl-port 7888}
|
:profiles {:dev {:dependencies [[com.cemerick/piggieback "0.2.2"]]
|
||||||
:profiles {:dev {:dependencies [[figwheel-sidecar "0.5.14"]
|
|
||||||
[re-frisk-remote "0.5.3"]
|
|
||||||
[re-frisk-sidecar "0.5.4"]
|
|
||||||
[com.cemerick/piggieback "0.2.2"]
|
|
||||||
[hawk "0.2.11"]]
|
|
||||||
:source-paths ["src" "env/dev"]
|
|
||||||
:cljsbuild {:builds
|
:cljsbuild {:builds
|
||||||
{:ios
|
{:ios
|
||||||
{:source-paths ["react-native/src" "src" "env/dev"]
|
{:source-paths ["react-native/src" "src"]
|
||||||
:figwheel true
|
|
||||||
:compiler {:output-to "target/ios/app.js"
|
:compiler {:output-to "target/ios/app.js"
|
||||||
:main "env.ios.main"
|
:main "env.ios.main"
|
||||||
:output-dir "target/ios"
|
:output-dir "target/ios"
|
||||||
:optimizations :none}}
|
:optimizations :none}}
|
||||||
:android
|
:android
|
||||||
{:source-paths ["react-native/src" "src" "env/dev"]
|
{:source-paths ["react-native/src" "src"]
|
||||||
:figwheel true
|
|
||||||
:compiler {:output-to "target/android/app.js"
|
:compiler {:output-to "target/android/app.js"
|
||||||
:main "env.android.main"
|
:main "env.android.main"
|
||||||
:output-dir "target/android"
|
:output-dir "target/android"
|
||||||
|
@ -47,6 +39,19 @@
|
||||||
:warning-handlers [status-im.utils.build/warning-handler]}}}
|
:warning-handlers [status-im.utils.build/warning-handler]}}}
|
||||||
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]
|
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]
|
||||||
:timeout 240000}}
|
:timeout 240000}}
|
||||||
|
:figwheel [:dev
|
||||||
|
{:dependencies [[figwheel-sidecar "0.5.14"]
|
||||||
|
[re-frisk-remote "0.5.3"]
|
||||||
|
[re-frisk-sidecar "0.5.4"]
|
||||||
|
[hawk "0.2.11"]]
|
||||||
|
:source-paths ["src" "env/dev"]
|
||||||
|
:cljsbuild {:builds
|
||||||
|
{:ios
|
||||||
|
{:source-paths ["react-native/src" "src" "env/dev"]
|
||||||
|
:figwheel true}
|
||||||
|
:android
|
||||||
|
{:source-paths ["react-native/src" "src" "env/dev"]
|
||||||
|
:figwheel true}}}}]
|
||||||
:test {:dependencies [[day8.re-frame/test "0.1.5"]]
|
:test {:dependencies [[day8.re-frame/test "0.1.5"]]
|
||||||
:plugins [[lein-doo "0.1.7"]]
|
:plugins [[lein-doo "0.1.7"]]
|
||||||
:cljsbuild {:builds
|
:cljsbuild {:builds
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
(ns status-im.bots.events
|
(ns status-im.bots.events
|
||||||
(:require [re-frame.core :as re-frame]
|
(:require [re-frame.core :as re-frame]
|
||||||
[status-im.utils.utils :as utils]
|
[status-im.utils.core :as utils]
|
||||||
[status-im.utils.handlers :as handlers]
|
[status-im.utils.handlers :as handlers]
|
||||||
[status-im.chat.models.input :as input-model]
|
[status-im.chat.models.input :as input-model]
|
||||||
[taoensso.timbre :as log]))
|
[taoensso.timbre :as log]))
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
[status-im.i18n :as i18n]
|
[status-im.i18n :as i18n]
|
||||||
[status-im.ui.components.animation :as anim]
|
[status-im.ui.components.animation :as anim]
|
||||||
[status-im.ui.components.list.views :as list]
|
[status-im.ui.components.list.views :as list]
|
||||||
[status-im.utils.utils :as utils]
|
[status-im.utils.core :as utils]
|
||||||
[status-im.utils.identicon :as identicon]))
|
[status-im.utils.identicon :as identicon]))
|
||||||
|
|
||||||
(defn- container-animation-logic [{:keys [to-value val]}]
|
(defn- container-animation-logic [{:keys [to-value val]}]
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
[status-im.constants :as constants]
|
[status-im.constants :as constants]
|
||||||
[status-im.data-store.realm.messages :as data-store]
|
[status-im.data-store.realm.messages :as data-store]
|
||||||
[status-im.utils.random :as random]
|
[status-im.utils.random :as random]
|
||||||
[status-im.utils.utils :as utils]))
|
[status-im.utils.core :as utils]))
|
||||||
|
|
||||||
(defn- command-type?
|
(defn- command-type?
|
||||||
[type]
|
[type]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
(ns status-im.ios.platform
|
(ns status-im.ios.platform
|
||||||
(:require [status-im.i18n :refer [label]]
|
(:require [status-im.i18n :refer [label]]
|
||||||
[status-im.utils.utils :as utils]
|
[status-im.utils.core :as utils]
|
||||||
[status-im.react-native.js-dependencies :as rn-dependencies]))
|
[status-im.react-native.js-dependencies :as rn-dependencies]))
|
||||||
|
|
||||||
(def fonts
|
(def fonts
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
(ns status-im.ui.components.action-sheet
|
(ns status-im.ui.components.action-sheet
|
||||||
(:require [status-im.i18n :as i18n]
|
(:require [status-im.i18n :as i18n]
|
||||||
[status-im.utils.utils :as utils]
|
[status-im.utils.core :as utils]
|
||||||
[status-im.react-native.js-dependencies :as rn-dependencies]))
|
[status-im.react-native.js-dependencies :as rn-dependencies]))
|
||||||
|
|
||||||
(defn- callback [options]
|
(defn- callback [options]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
(ns status-im.ui.components.chat-preview
|
(ns status-im.ui.components.chat-preview
|
||||||
(:require [status-im.ui.components.react :as components]
|
(:require [status-im.ui.components.react :as components]
|
||||||
[status-im.ui.screens.home.styles :as home.styles]
|
[status-im.ui.screens.home.styles :as home.styles]
|
||||||
[status-im.utils.utils :as utils]))
|
[status-im.utils.core :as utils]))
|
||||||
|
|
||||||
(def default-attributes
|
(def default-attributes
|
||||||
{:style home.styles/last-message-text
|
{:style home.styles/last-message-text
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
[status-im.ui.components.react :refer [view text]]
|
[status-im.ui.components.react :refer [view text]]
|
||||||
[status-im.utils.platform :refer [platform-specific]]
|
[status-im.utils.platform :refer [platform-specific]]
|
||||||
[status-im.ui.components.styles :refer [color-blue color-black color-blue4-faded]]
|
[status-im.ui.components.styles :refer [color-blue color-black color-blue4-faded]]
|
||||||
[status-im.utils.utils :refer [hash-tag?]]))
|
[status-im.utils.core :refer [hash-tag?]]))
|
||||||
|
|
||||||
(defn tag-view [tag]
|
(defn tag-view [tag]
|
||||||
[text {:style {:color color-blue4-faded}
|
[text {:style {:color color-blue4-faded}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
(:require-macros [status-im.utils.styles :refer [defstyle defnstyle]])
|
(:require-macros [status-im.utils.styles :refer [defstyle defnstyle]])
|
||||||
(:require [status-im.ui.components.styles :as common]
|
(:require [status-im.ui.components.styles :as common]
|
||||||
[status-im.utils.platform :refer [platform-specific]]
|
[status-im.utils.platform :refer [platform-specific]]
|
||||||
[status-im.utils.utils :as u]
|
[status-im.utils.core :as u]
|
||||||
[status-im.ui.components.react :as react]))
|
[status-im.ui.components.react :as react]))
|
||||||
|
|
||||||
(def sticky-button-style
|
(def sticky-button-style
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
[status-im.ui.components.context-menu :as context-menu]
|
[status-im.ui.components.context-menu :as context-menu]
|
||||||
[status-im.ui.screens.home.styles :as styles]
|
[status-im.ui.screens.home.styles :as styles]
|
||||||
[status-im.ui.components.styles :as component.styles]
|
[status-im.ui.components.styles :as component.styles]
|
||||||
[status-im.utils.utils :as utils]
|
[status-im.utils.core :as utils]
|
||||||
[status-im.commands.utils :as commands-utils]
|
[status-im.commands.utils :as commands-utils]
|
||||||
[status-im.i18n :as i18n]
|
[status-im.i18n :as i18n]
|
||||||
[status-im.utils.datetime :as time]
|
[status-im.utils.datetime :as time]
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
[status-im.utils.gfycat.core :as gfycat]
|
[status-im.utils.gfycat.core :as gfycat]
|
||||||
[status-im.utils.handlers :as handlers]
|
[status-im.utils.handlers :as handlers]
|
||||||
[status-im.utils.image-processing :refer [img->base64]]
|
[status-im.utils.image-processing :refer [img->base64]]
|
||||||
[status-im.utils.utils :as utils]
|
[status-im.utils.core :as utils]
|
||||||
[taoensso.timbre :as log]))
|
[taoensso.timbre :as log]))
|
||||||
|
|
||||||
(re-frame/reg-fx
|
(re-frame/reg-fx
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
[status-im.ui.screens.profile.styles :as styles]
|
[status-im.ui.screens.profile.styles :as styles]
|
||||||
[status-im.ui.components.colors :as colors]
|
[status-im.ui.components.colors :as colors]
|
||||||
[status-im.utils.utils :as utils]
|
[status-im.utils.utils :as utils]
|
||||||
|
[status-im.utils.core :refer [hash-tag?]]
|
||||||
[status-im.utils.datetime :as time]
|
[status-im.utils.datetime :as time]
|
||||||
[status-im.utils.config :as config]
|
[status-im.utils.config :as config]
|
||||||
[status-im.utils.platform :as platform]
|
[status-im.utils.platform :as platform]
|
||||||
|
@ -194,7 +195,7 @@
|
||||||
|
|
||||||
(defn colorize-status-hashtags [status]
|
(defn colorize-status-hashtags [status]
|
||||||
(for [[i status] (map-indexed vector (string/split status #" "))]
|
(for [[i status] (map-indexed vector (string/split status #" "))]
|
||||||
(if (utils/hash-tag? status)
|
(if (hash-tag? status)
|
||||||
^{:key (str "item-" i)}
|
^{:key (str "item-" i)}
|
||||||
[tag-view status]
|
[tag-view status]
|
||||||
^{:key (str "item-" i)}
|
^{:key (str "item-" i)}
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
(ns status-im.utils.core
|
||||||
|
(:require [clojure.string :as str]))
|
||||||
|
|
||||||
|
(defn truncate-str
|
||||||
|
"Given string and max threshold, trims the string to threshold length with `...`
|
||||||
|
appended to end if length of the string exceeds max threshold, returns the same
|
||||||
|
string if threshold is not exceeded"
|
||||||
|
[s threshold]
|
||||||
|
(if (and s (< threshold (count s)))
|
||||||
|
(str (subs s 0 (- threshold 3)) "...")
|
||||||
|
s))
|
||||||
|
|
||||||
|
(defn clean-text [s]
|
||||||
|
(-> s
|
||||||
|
(str/replace #"\n" "")
|
||||||
|
(str/replace #"\r" "")
|
||||||
|
(str/trim)))
|
||||||
|
|
||||||
|
(defn first-index
|
||||||
|
"Returns first index in coll where predicate on coll element is truthy"
|
||||||
|
[pred coll]
|
||||||
|
(->> coll
|
||||||
|
(keep-indexed (fn [idx e]
|
||||||
|
(when (pred e)
|
||||||
|
idx)))
|
||||||
|
first))
|
||||||
|
|
||||||
|
(defn hash-tag? [s]
|
||||||
|
(= \# (first s)))
|
||||||
|
|
||||||
|
(defn wrap-call-once!
|
||||||
|
"Returns a version of provided function that will be called only the first time wrapping function is called. Returns nil."
|
||||||
|
[f]
|
||||||
|
(let [called? (volatile! false)]
|
||||||
|
(fn [& args]
|
||||||
|
(when-not @called?
|
||||||
|
(vreset! called? true)
|
||||||
|
(apply f args)
|
||||||
|
nil))))
|
||||||
|
|
||||||
|
(defn update-if-present
|
||||||
|
"Like regular `clojure.core/update` but returns original map if update key is not present"
|
||||||
|
[m k f & args]
|
||||||
|
(if (contains? m k)
|
||||||
|
(apply update m k f args)
|
||||||
|
m))
|
||||||
|
|
||||||
|
(defn map-values
|
||||||
|
"Efficiently apply function to all map values"
|
||||||
|
[m f]
|
||||||
|
(into {}
|
||||||
|
(map (fn [[k v]]
|
||||||
|
[k (f v)]))
|
||||||
|
m))
|
||||||
|
|
||||||
|
(defn deep-merge
|
||||||
|
"Recursively merge maps"
|
||||||
|
[& maps]
|
||||||
|
(if (every? map? maps)
|
||||||
|
(apply merge-with deep-merge maps)
|
||||||
|
(last maps)))
|
|
@ -1,7 +1,6 @@
|
||||||
(ns status-im.utils.utils
|
(ns status-im.utils.utils
|
||||||
(:require [status-im.constants :as const]
|
(:require [status-im.constants :as const]
|
||||||
[status-im.i18n :as i18n]
|
[status-im.i18n :as i18n]
|
||||||
[clojure.string :as str]
|
|
||||||
[status-im.react-native.js-dependencies :as rn-dependencies]))
|
[status-im.react-native.js-dependencies :as rn-dependencies]))
|
||||||
|
|
||||||
(defn show-popup [title content]
|
(defn show-popup [title content]
|
||||||
|
@ -81,62 +80,3 @@
|
||||||
(.catch (or on-error
|
(.catch (or on-error
|
||||||
(fn [error]
|
(fn [error]
|
||||||
(show-popup "Error" (str error))))))))
|
(show-popup "Error" (str error))))))))
|
||||||
|
|
||||||
(defn truncate-str
|
|
||||||
"Given string and max threshold, trims the string to threshold length with `...`
|
|
||||||
appended to end if length of the string exceeds max threshold, returns the same
|
|
||||||
string if threshold is not exceeded"
|
|
||||||
[s threshold]
|
|
||||||
(if (and s (< threshold (count s)))
|
|
||||||
(str (subs s 0 (- threshold 3)) "...")
|
|
||||||
s))
|
|
||||||
|
|
||||||
(defn clean-text [s]
|
|
||||||
(-> s
|
|
||||||
(str/replace #"\n" "")
|
|
||||||
(str/replace #"\r" "")
|
|
||||||
(str/trim)))
|
|
||||||
|
|
||||||
(defn first-index
|
|
||||||
"Returns first index in coll where predicate on coll element is truthy"
|
|
||||||
[pred coll]
|
|
||||||
(->> coll
|
|
||||||
(keep-indexed (fn [idx e]
|
|
||||||
(when (pred e)
|
|
||||||
idx)))
|
|
||||||
first))
|
|
||||||
|
|
||||||
(defn hash-tag? [s]
|
|
||||||
(= \# (first s)))
|
|
||||||
|
|
||||||
(defn wrap-call-once!
|
|
||||||
"Returns a version of provided function that will be called only the first time wrapping function is called. Returns nil."
|
|
||||||
[f]
|
|
||||||
(let [called? (volatile! false)]
|
|
||||||
(fn [& args]
|
|
||||||
(when-not @called?
|
|
||||||
(vreset! called? true)
|
|
||||||
(apply f args)
|
|
||||||
nil))))
|
|
||||||
|
|
||||||
(defn update-if-present
|
|
||||||
"Like regular `clojure.core/update` but returns original map if update key is not present"
|
|
||||||
[m k f & args]
|
|
||||||
(if (contains? m k)
|
|
||||||
(apply update m k f args)
|
|
||||||
m))
|
|
||||||
|
|
||||||
(defn map-values
|
|
||||||
"Efficiently apply function to all map values"
|
|
||||||
[m f]
|
|
||||||
(into {}
|
|
||||||
(map (fn [[k v]]
|
|
||||||
[k (f v)]))
|
|
||||||
m))
|
|
||||||
|
|
||||||
(defn deep-merge
|
|
||||||
"Recursively merge maps"
|
|
||||||
[& maps]
|
|
||||||
(if (every? map? maps)
|
|
||||||
(apply merge-with deep-merge maps)
|
|
||||||
(last maps)))
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
(ns status-im.test.utils.utils
|
(ns status-im.test.utils.utils
|
||||||
(:require [cljs.test :refer-macros [deftest is]]
|
(:require [cljs.test :refer-macros [deftest is]]
|
||||||
[status-im.utils.utils :as u]))
|
[status-im.utils.core :as u]))
|
||||||
|
|
||||||
(deftest wrap-as-call-once-test
|
(deftest wrap-as-call-once-test
|
||||||
(let [count (atom 0)]
|
(let [count (atom 0)]
|
||||||
|
|
Loading…
Reference in New Issue