From 4726df7c6f62c9f2265b1e77ee7b25295c6cfe5b Mon Sep 17 00:00:00 2001 From: kaspazza Date: Thu, 1 Aug 2024 12:43:55 +0200 Subject: [PATCH] 1.2.7-la --- .github/workflows/commit_validation.yml | 2 +- bb.edn | 2 +- deps.edn | 4 ++-- pom.xml | 2 +- src/clj/automaton_core/repl.clj | 8 ++++---- src/clj/automaton_core/utils/pretty_print.clj | 4 ++-- src/cljc/automaton_core/adapters/regexp.cljc | 5 +++-- src/cljc/automaton_core/configuration.cljc | 3 +-- src/cljc/automaton_core/configuration/environment.cljc | 7 +++++-- src/cljc/automaton_core/configuration/files.cljc | 7 +++++-- src/cljc/automaton_core/utils/type_arg.cljc | 6 +++--- version.edn | 2 +- 12 files changed, 29 insertions(+), 23 deletions(-) diff --git a/.github/workflows/commit_validation.yml b/.github/workflows/commit_validation.yml index ad3ab074..eeeaf2a8 100644 --- a/.github/workflows/commit_validation.yml +++ b/.github/workflows/commit_validation.yml @@ -12,4 +12,4 @@ jobs: # this is to fix GIT not liking owner of the checkout dir, See https://github.com/actions/runner/issues/2033 chown -R $(id -u):$(id -g) $PWD - name: Base image - uses: docker://hephaistox/gha-automaton-core:1.2.6-la + uses: docker://hephaistox/gha-automaton-core:1.2.7-la diff --git a/bb.edn b/bb.edn index bf997b5a..8d8f8931 100644 --- a/bb.edn +++ b/bb.edn @@ -1,5 +1,5 @@ ;; The file is updated automatically -{:deps {org.clojars.hephaistox/automaton-build #:mvn{:version "1.4.7-la"}} +{:deps {org.clojars.hephaistox/automaton-build #:mvn{:version "2.0.0-la"}} :paths [] :tasks {:requires diff --git a/deps.edn b/deps.edn index aae9b0f1..24a05c96 100644 --- a/deps.edn +++ b/deps.edn @@ -1,8 +1,8 @@ {:aliases {:bb-deps {:extra-deps {org.clojars.hephaistox/automaton-build #:mvn{:version - "1.4.7-la"}}} + "2.0.0-la"}}} :build {:extra-deps {org.clojars.hephaistox/automaton-build #:mvn{:version - "1.4.7-la"}}} + "2.0.0-la"}}} :cljs-deps {:extra-deps {binaryage/devtools #:mvn{:version "1.0.7"} com.yetanalytics/colossal-squuid {:mvn/version "0.1.5"} diff --git a/pom.xml b/pom.xml index 247b4c30..af389991 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ jar org.clojars.hephaistox automaton-core - 1.2.6-la + 1.2.7-la automaton-core diff --git a/src/clj/automaton_core/repl.clj b/src/clj/automaton_core/repl.clj index 8fc1c459..d33f18a0 100644 --- a/src/clj/automaton_core/repl.clj +++ b/src/clj/automaton_core/repl.clj @@ -17,7 +17,6 @@ (defn- force-option? [args] (filter some? (map #(contains? #{"-f" "--force"} %) args))) -(force-option? "--force") (def nrepl-port-filename "Name of the `.nrepl-port` file" ".nrepl-port") @@ -54,8 +53,9 @@ (create-nrepl-files repl-port) (reset! repl {:nrepl-port repl-port :repl (do (core-log/info "nrepl available on port " repl-port) - (core-log-terminal/log "repl port is available on: " - repl-port) + (core-log-terminal/log + "-> Repl port is available on: " + repl-port) (start-server :port repl-port :handler (apply default-handler middlewares)))}) @@ -71,7 +71,7 @@ (-> (files/search-files "" (str "**" nrepl-port-filename)) (files/delete-files)) (core-portal-server/stop) - (println "SHUTDOWN ends succesfully")))))) + (println "SHUTDOWN ends successfully")))))) (defn default-middleware [] diff --git a/src/clj/automaton_core/utils/pretty_print.clj b/src/clj/automaton_core/utils/pretty_print.clj index fa50e1d3..68464316 100644 --- a/src/clj/automaton_core/utils/pretty_print.clj +++ b/src/clj/automaton_core/utils/pretty_print.clj @@ -1,7 +1,7 @@ (ns automaton-core.utils.pretty-print "Gathers functions related to pretty printing or pretty formatting." (:require - [automaton-core.adapters.string :as bas] + [automaton-core.adapters.string :as core-string] [clojure.pprint :as pp])) (defn one-liner-print @@ -13,7 +13,7 @@ (-> elt pp/pprint with-out-str - bas/remove-last-character) + core-string/remove-last-character) elt)) (defn seq->string diff --git a/src/cljc/automaton_core/adapters/regexp.cljc b/src/cljc/automaton_core/adapters/regexp.cljc index e38af0f5..309d7dd4 100644 --- a/src/cljc/automaton_core/adapters/regexp.cljc +++ b/src/cljc/automaton_core/adapters/regexp.cljc @@ -3,7 +3,7 @@ Seamless access to regular expressions between cljs and clj Managing both back and frontend to have a seamless experience" #?(:cljs (:require - [automaton-core.adapters.string :as aas]))) + [automaton-core.adapters.string :as core-string]))) (def starts-a-string #?(:clj "\\A" @@ -16,7 +16,8 @@ (defn stringify [re] #?(:clj (str re) - :cljs (if (string? re) re (aas/remove-first-last-character (str re))))) + :cljs + (if (string? re) re (core-string/remove-first-last-character (str re))))) (defn assemble-re "Assemble regular expressions together diff --git a/src/cljc/automaton_core/configuration.cljc b/src/cljc/automaton_core/configuration.cljc index 83202d74..c109ff3f 100644 --- a/src/cljc/automaton_core/configuration.cljc +++ b/src/cljc/automaton_core/configuration.cljc @@ -21,8 +21,7 @@ (defn start-conf [] - (try (println "Starting configuration component") - (let [conf (core-conf-files/make-files-conf) + (try (let [conf (core-conf-files/make-files-conf) env-conf (core-conf-env/make-env-conf)] [conf env-conf]) (catch #?(:clj Throwable diff --git a/src/cljc/automaton_core/configuration/environment.cljc b/src/cljc/automaton_core/configuration/environment.cljc index 7c0b3dba..8a4e0ac2 100644 --- a/src/cljc/automaton_core/configuration/environment.cljc +++ b/src/cljc/automaton_core/configuration/environment.cljc @@ -2,7 +2,7 @@ "Get environment data stored in the configuration" (:require #?@(:clj [[clojure.edn :as edn]] - :cljs [[cljs.reader :as edn] [goog.object :as obj]]) + :cljs [[cljs.reader] [goog.object :as obj]]) [automaton-core.configuration.protocol :as core-conf-prot] [automaton-core.utils.keyword :as core-keyword] [clojure.string :as str])) @@ -36,7 +36,10 @@ (re-matches #"^(true|false)$" v) #?(:clj (Boolean/parseBoolean v) :cljs (parse-boolean v)) (re-matches #"\w+" v) v - :else (try (let [parsed (edn/read-string v)] (if (symbol? parsed) v parsed)) + :else (try (let [f #?(:clj edn/read-string + :cljs cljs.reader/read-string) + parsed (f v)] + (if (symbol? parsed) v parsed)) (catch #?(:clj Exception :cljs js/Error) _ diff --git a/src/cljc/automaton_core/configuration/files.cljc b/src/cljc/automaton_core/configuration/files.cljc index b1b10311..6672b16a 100644 --- a/src/cljc/automaton_core/configuration/files.cljc +++ b/src/cljc/automaton_core/configuration/files.cljc @@ -5,7 +5,7 @@ #?@(:clj [[clojure.edn :as edn] [clojure.java.io :as io] [automaton-core.adapters.java-properties :as java-properties]] - :cljs [[cljs.reader :as edn]]) + :cljs [[cljs.reader]]) [automaton-core.configuration.protocol :as core-conf-prot] [automaton-core.utils.keyword :as core-keyword] [automaton-core.utils.map :as utils-map])) @@ -26,7 +26,10 @@ "Reads config file, on purpose fn defined here to keep dependencies as small as possible." [f] (when-let [content (slurp-file f)] - (into {} (core-keyword/sanitize-map-keys (edn/read-string content))))) + (into {} + (core-keyword/sanitize-map-keys #?(:clj (edn/read-string content) + :cljs (cljs.reader/read-string + content)))))) (def config-file #?(:clj "heph-conf" diff --git a/src/cljc/automaton_core/utils/type_arg.cljc b/src/cljc/automaton_core/utils/type_arg.cljc index b3288bff..43de07c0 100644 --- a/src/cljc/automaton_core/utils/type_arg.cljc +++ b/src/cljc/automaton_core/utils/type_arg.cljc @@ -22,13 +22,13 @@ * All assert will return true on clojurescript * The `assert-protocol` function has a `:unused-binding` flag to prevent kondo warnings" (:require - #?@(:clj [[automaton-core.configuration :as core-configuration] + #?@(:clj [[automaton-core.configuration :as core-conf] [automaton-core.log :as core-log]]))) #?(:clj (defmacro assert-protocols "Assert the `args` to check if they all match the expected type" [caller-fn-name asserts & body] - (if (core-configuration/read-param [:test-type-arg?] false) + (if (core-conf/read-param [:test-type-arg?] false) `(do ~@body) `(when (->> (for [[expected-type# arg#] ~asserts] (cond @@ -57,7 +57,7 @@ * `val` value to test * `msg` message to display, the `%s` in the string is replaced with the value" [val msg & body] - (if (core-configuration/read-param [:test-type-arg?] false) + (if (core-conf/read-param [:test-type-arg?] false) `(do ~@body) `(if (and (int? ~val) (or (zero? ~val) (pos? ~val))) (do ~@body) diff --git a/version.edn b/version.edn index 290d3512..95f579a2 100644 --- a/version.edn +++ b/version.edn @@ -1,2 +1,2 @@ ;; Last generated version, note a failed push consume a number -{:version "1.2.6-la"} \ No newline at end of file +{:version "1.2.7-la"} \ No newline at end of file