Skip to content

Commit

Permalink
automatic commit
Browse files Browse the repository at this point in the history
  • Loading branch information
caumond committed Apr 4, 2024
1 parent 3689b5b commit 75d06b1
Show file tree
Hide file tree
Showing 31 changed files with 88 additions and 134 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.1.2-la
uses: docker://hephaistox/gha-automaton-core:1.2.0-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.3.1-la"}}
{:deps {org.clojars.hephaistox/automaton-build #:mvn{:version "1.4.1-la"}}
:paths []
:tasks
{:requires
Expand Down
7 changes: 4 additions & 3 deletions build_config.edn
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
".shadow-cljs/builds/"]}
:lfe-test {}
:lfe-watch {}
:update-deps {:exclude-libs #{"com.taoensso/encore"
"org.clojars.hephaistox/automaton-build@*-*"}}
:reports {:forbiddenwords-words #{"automaton-build" "automaton-web"
"landing" "tap>"}}}}
"landing" "tap>"}}
:update-deps {:exclude-libs
#{"com.taoensso/encore"
"org.clojars.hephaistox/automaton-build@*-*"}}}}
12 changes: 6 additions & 6 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{:aliases
{:bb-deps {:extra-deps {org.clojars.hephaistox/automaton-build
#:mvn{:version "1.3.1-la"}}}
{:bb-deps {:extra-deps {org.clojars.hephaistox/automaton-build #:mvn{:version
"1.4.1-la"}}}
:build {:extra-deps {org.clojars.hephaistox/automaton-build #:mvn{:version
"1.3.1-la"}}}
"1.4.1-la"}}}
:cljs-deps {:extra-deps {binaryage/devtools #:mvn{:version "1.0.7"}
thheller/shadow-cljs #:mvn{:version "2.28.3"}}
thheller/shadow-cljs #:mvn{:version "2.28.2"}}
:extra-paths ["src/cljs/"
"src/cljc/"
"resources/"
Expand Down Expand Up @@ -48,12 +48,12 @@
com.taoensso/encore #:mvn{:version "3.62.1"}
com.taoensso/tempura #:mvn{:version "1.5.3"}
danlentz/clj-uuid #:mvn{:version "0.1.9"}
djblue/portal #:mvn{:version "0.54.1"}
djblue/portal #:mvn{:version "0.53.0"}
http-kit/http-kit #:mvn{:version "2.7.0"}
io.sentry/sentry #:mvn{:version "7.6.0"}
io.sentry/sentry-clj #:mvn{:version "7.6.215"}
lambdaisland/uri #:mvn{:version "1.19.155"}
metosin/malli #:mvn{:version "0.15.0"}
metosin/malli #:mvn{:version "0.14.0"}
mount/mount #:mvn{:version "0.1.18"}
nrepl/nrepl #:mvn{:version "1.1.1"}
org.apache.logging.log4j/log4j-api #:mvn{:version "2.23.1"}
Expand Down
4 changes: 2 additions & 2 deletions env/development/config.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{:dev {:clj-nrepl-port 8012
:portal-port 8351}
:test-type-arg? false
:env :development}
:env :development
:test-type-arg? false}
4 changes: 2 additions & 2 deletions env/development/src/cljs/cljs/user.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
(comment
(client-connect)
(tst)
;
)
;
)
6 changes: 3 additions & 3 deletions 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.1.2-la</version>
<version>1.2.0-la</version>
<name>automaton-core</name>
<dependencies>
<dependency>
Expand Down Expand Up @@ -70,7 +70,7 @@
<dependency>
<groupId>djblue</groupId>
<artifactId>portal</artifactId>
<version>0.54.1</version>
<version>0.53.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
Expand All @@ -85,7 +85,7 @@
<dependency>
<groupId>metosin</groupId>
<artifactId>malli</artifactId>
<version>0.15.0</version>
<version>0.14.0</version>
</dependency>
<dependency>
<groupId>babashka</groupId>
Expand Down
55 changes: 14 additions & 41 deletions src/cljc/automaton_core/adapters/schema.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
Is a proxy for malli"
(:require
[malli.core :as malli]
[malli.error :as malli-error]
[automaton-core.log :as core-log]))
[malli.core :as malli]
[malli.error :as malli-error]))

(defn validate-data
"Return true if the data is matching the schema
Expand Down Expand Up @@ -33,12 +32,12 @@
Params:
* `schema` schema to test"
[schema]
(try
(malli/schema schema)
true
(catch #?(:clj Exception
:cljs :default) _
false)))
(try (malli/schema schema)
true
(catch #?(:clj Exception
:cljs :default)
_
false)))

(defn validate-humanize
"Test the schema parameter is valid
Expand All @@ -48,35 +47,9 @@
Params:
* `schema` schema to test"
[schema]
(try
(malli/schema schema)
nil
(catch #?(:clj Exception
:cljs :default) _
(str "Schema not valid"
(str schema)))))

(defn- schema-valid-with-log
[schema data message]
(if (validate-data schema data)
true
(do
(core-log/error (str message ": " (validate-data-humanize schema data)))
false)))

(defn assert-schema
"Assert the `data` is complying the `schema`
Params:
* `schema`
* `data`
* `message`"
[schema data message]
(assert (schema-valid-with-log schema data message)))

(defn assert-schemas
"Assert the `data` is complying the `schema`
Params:
* `schema-datas` sequence of schema data"
[& schema-datas]
(doseq [[schema data message] (partition 3 schema-datas)]
(assert-schema schema data message)))
(try (malli/schema schema)
nil
(catch #?(:clj Exception
:cljs :default)
_
(str "Schema not valid" (str schema)))))
14 changes: 7 additions & 7 deletions src/cljc/automaton_core/configuration.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
gathering all classpath, so all `config.edn` versions. The solution was to be based on environment
parameter. So each alias can tell which version it uses, especially monorepo could be different."
(:require
[automaton-core.configuration.protocol :as core-conf-prot]
[automaton-core.configuration.files :as core-conf-files]
[automaton-core.configuration.environment :as core-conf-env]
[mount.core :refer [defstate in-cljc-mode]]))
[automaton-core.configuration.files :as core-conf-files]
[automaton-core.configuration.protocol :as core-conf-prot]
[mount.core :refer [defstate in-cljc-mode]]))

;; Force the use of `cljc mode` in mount library, so call to `@` will work
(in-cljc-mode)
Expand All @@ -27,7 +27,7 @@
[conf env-conf])
(catch #?(:clj Throwable
:cljs :default)
e
e
(println "Configuration failed" e))))

(defn stop-conf [] (println "Stop configuration component"))
Expand All @@ -37,9 +37,9 @@
(defn read-param
"Returns value under `key-path` vector."
([key-path default-value]
(let [param-values [(core-conf-prot/read-conf-param (first @conf-state) key-path)
(core-conf-prot/read-conf-param (second @conf-state)
key-path)]
(let [param-values
[(core-conf-prot/read-conf-param (first @conf-state) key-path)
(core-conf-prot/read-conf-param (second @conf-state) key-path)]
value (->> param-values
(filter some?)
first)]
Expand Down
4 changes: 2 additions & 2 deletions src/cljc/automaton_core/configuration/environment.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#?@(:clj [[clojure.edn :as edn]]
:cljs [[cljs.reader :as edn] [goog.object :as obj]])
[automaton-core.configuration.protocol :as core-conf-prot]
[automaton-core.utils.keyword :as core-keyword]
[clojure.string :as str]))
[automaton-core.utils.keyword :as core-keyword]
[clojure.string :as str]))

#?(:cljs (def ^:private nodejs? (exists? js/require)))

Expand Down
10 changes: 5 additions & 5 deletions src/cljc/automaton_core/configuration/files.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
[automaton-core.adapters.java-properties :as java-properties]]
:cljs [[cljs.reader :as edn]])
[automaton-core.configuration.protocol :as core-conf-prot]
[automaton-core.utils.keyword :as core-keyword]
[automaton-core.utils.map :as utils-map]))
[automaton-core.utils.keyword :as core-keyword]
[automaton-core.utils.map :as utils-map]))

#?(:cljs (def ^:private nodejs? (exists? js/require)))
#?(:cljs (def ^:private fs (when nodejs? (js/require "fs"))))
Expand All @@ -19,7 +19,7 @@
:cljs (when ^js (.existsSync fs f) (str ^js (.readFileSync fs f))))
(catch #?(:clj Exception
:cljs js/Error)
_
_
(println (str "Reading file " f " failed")))))

(defn read-config-file
Expand Down Expand Up @@ -59,7 +59,7 @@

(defrecord FilesConf [conf]
core-conf-prot/Conf
(read-conf-param [_this key-path] (get-in conf key-path))
(config [_this] conf))
(read-conf-param [_this key-path] (get-in conf key-path))
(config [_this] conf))

(defn make-files-conf [] (->FilesConf (read-config)))
2 changes: 1 addition & 1 deletion src/cljc/automaton_core/i18n/language.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
See cust-app themselves to know what language they use"
(:require
[automaton-core.utils.map :as utils-map]
[clojure.set :as set]))
[clojure.set :as set]))

(defprotocol Languages
(language [this lang-id]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Helper functions to test correctness of translation data including dictionaries"
(:require
[automaton-core.utils.map :as utils-map]
[clojure.set :refer [union]]))
[clojure.set :refer [union]]))

(defn language-report
"For all keys of a dictionnary, return the list of languages set
Expand Down
8 changes: 4 additions & 4 deletions src/cljc/automaton_core/i18n/translator/tempura.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
Is an adapter for translation in `automaton-core`, so no web related technology is mentionned there, even if tempura provides them.
It will be the job of `automton-web` to provide that features"
(:require
[automaton-core.i18n.dict.text :as core-dict]
[automaton-core.i18n.dict.text :as core-dict]
[automaton-core.i18n.translator :as core-translator]
[automaton-core.log :as core-log]
[automaton-core.utils.map :as utils-map]
[taoensso.tempura :as tempura]))
[automaton-core.log :as core-log]
[automaton-core.utils.map :as utils-map]
[taoensso.tempura :as tempura]))

(def tempura-missing-text
"Necessary for tempura, a missing key is expected for all languages marked with `:core-dict?` in `automaton-core.i18n.language`"
Expand Down
9 changes: 4 additions & 5 deletions src/cljc/automaton_core/log.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
* This namespace is the entrypoint for both clj and cljs implementations
"
(:require
[automaton-core.configuration :as core-conf]
[automaton-core.log.strategy.static-ns-level
:as
log-static-ns-level-strategy]
[automaton-core.log.strategy :as log-strategy]
[automaton-core.configuration :as core-conf]
[automaton-core.log.strategy :as log-strategy]
[automaton-core.log.strategy.static-ns-level :as
log-static-ns-level-strategy]
#?(:clj [automaton-core.log.be-log]
:cljs [automaton-core.log.fe-log]))
#?(:cljs (:require-macros [automaton-core.log])))
Expand Down
4 changes: 2 additions & 2 deletions src/cljc/automaton_core/log/strategy/static_ns_level.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
See `automaton-core.log.strategy.static-ns-level/ns-rules` for rule definition details "
(:require
[automaton-core.log.log-levels :as log-levels]
[automaton-core.log.strategy :as log-strategy]
[automaton-core.log.registry :as log-registry]))
[automaton-core.log.registry :as log-registry]
[automaton-core.log.strategy :as log-strategy]))

(def ns-rules
"Decides the level of log depending on namespace
Expand Down
2 changes: 1 addition & 1 deletion src/cljc/automaton_core/protocols/test_registry.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
See ADR-0015"
(:require
[automaton-core.adapters.schema :as core-schema]
[automaton-core.log :as core-log]))
[automaton-core.log :as core-log]))

(def ^:private test-registry-schema
"Test registry schema"
Expand Down
2 changes: 1 addition & 1 deletion src/cljc/automaton_core/utils/map.cljc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns automaton-core.utils.map
"Utility for map data structure"
(:require
[clojure.set :as set]
[clojure.set :as set]
[clojure.walk :as walk]))

(defn idx-of
Expand Down
4 changes: 2 additions & 2 deletions src/cljc/automaton_core/utils/string_to_id.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"Transform a string into an id
That id are currently used and tested for React"
(:require
[clojure.string :as str]
[automaton-core.utils.uuid-gen :as uuid-gen]))
[automaton-core.utils.uuid-gen :as uuid-gen]
[clojure.string :as str]))

(defn string-to-id
"Transform what is not alphanumerical to an id
Expand Down
2 changes: 1 addition & 1 deletion src/cljs/automaton_core/log/fe_log.cljc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(ns automaton-core.log.fe-log
"Factory generating log function"
(:require
[automaton-core.log.strategy]
[automaton-core.log.fe-registry]
[automaton-core.log.strategy]
[automaton-core.log.strategy.static-ns-level])
#?(:cljs (:require-macros [automaton-core.log.fe-log])))

Expand Down
6 changes: 2 additions & 4 deletions src/cljs/automaton_core/log/fe_registry.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
::log-registry/error-tracking-context
{:description
"For registering information for monitoring exceptions in the application"
#?@(:cljs [:impl
automaton-core.log.tracking.fe-error-tracking/add-context])}
#?@(:cljs [:impl automaton-core.log.tracking.fe-error-tracking/add-context])}
::log-registry/error-tracking-alert
{:description "For alerting about monitoring exceptions in the application"
#?@(:cljs [:impl
automaton-core.log.tracking.fe-error-tracking/error-alert])}})
#?@(:cljs [:impl automaton-core.log.tracking.fe-error-tracking/error-alert])}})
19 changes: 8 additions & 11 deletions src/cljs/automaton_core/portal/client.cljs
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
(ns automaton-core.portal.client
"Client connection to the portal"
(:require [portal.client.web :as p]))
(:require
[portal.client.web :as p-web]))

(def submit (partial p/submit {:port 8351}))
(def submit (partial p-web/submit {:port 8351}))

(defn tst
[]
(js/alert "from REPL"))
(defn tst [] (js/alert "from REPL"))

(defn client-connect
[]
(add-tap #'submit))
(defn client-connect [] (add-tap #'submit))

(comment
(client-connect)
;
)
(client-connect)
;
)
Loading

0 comments on commit 75d06b1

Please sign in to comment.