Skip to content

Commit

Permalink
1.2.7-la
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaspazza committed Aug 1, 2024
1 parent 59668bf commit 4726df7
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/commit_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion bb.edn
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -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"}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<packaging>jar</packaging>
<groupId>org.clojars.hephaistox</groupId>
<artifactId>automaton-core</artifactId>
<version>1.2.6-la</version>
<version>1.2.7-la</version>
<name>automaton-core</name>
<dependencies>
<dependency>
Expand Down
8 changes: 4 additions & 4 deletions src/clj/automaton_core/repl.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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)))})
Expand All @@ -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
[]
Expand Down
4 changes: 2 additions & 2 deletions src/clj/automaton_core/utils/pretty_print.clj
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -13,7 +13,7 @@
(-> elt
pp/pprint
with-out-str
bas/remove-last-character)
core-string/remove-last-character)
elt))

(defn seq->string
Expand Down
5 changes: 3 additions & 2 deletions src/cljc/automaton_core/adapters/regexp.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/cljc/automaton_core/configuration.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions src/cljc/automaton_core/configuration/environment.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down Expand Up @@ -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)
_
Expand Down
7 changes: 5 additions & 2 deletions src/cljc/automaton_core/configuration/files.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions src/cljc/automaton_core/utils/type_arg.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion version.edn
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
;; Last generated version, note a failed push consume a number
{:version "1.2.6-la"}
{:version "1.2.7-la"}

0 comments on commit 4726df7

Please sign in to comment.