diff --git a/CHANGELOG.md b/CHANGELOG.md index c73899b..e367536 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. This change - dev: repository trivy ignore CVE-2024-22871 - service: move mulog publisher inside donut system config - readme: simplify readme, add overview, remove older examples +- service: refactor template-edn function to aid diagnosis # 2024-01-23 ## Changed diff --git a/src/practicalli/service.clj b/src/practicalli/service.clj index 11dc3ac..f70cb45 100644 --- a/src/practicalli/service.clj +++ b/src/practicalli/service.clj @@ -15,7 +15,6 @@ [clojure.pprint :as pprint] [practicalli.rules :as rules])) - #_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]} (defn substitutions "Update keys & values available in the substitution data, @@ -26,10 +25,10 @@ ;; Simple example: #_(when (= (data :component) "integrant") {:integrant-repl true}) - + ;; (println "Calculating substitutions...") + ;; (pprint/pprint data) nil) ; returning nil means no changes to options data - #_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]} (defn template-edn "Update data in the template.edn configuration. @@ -40,13 +39,17 @@ - new template.edn configuration" [edn data] - ;; (pprint/pprint data) ;; Link to Practicalli Clojure Project Templates guide (println "Template guide: https://practical.li/clojure/clojure-cli/projects/templates/") ;; (println "Component" (data :component)) + (let [updated-template + (cond + (= :donut (data :component)) (assoc edn :transform rules/donut) + (= :integrant (data :component)) (assoc edn :transform rules/integrant) + :else edn)] + + ;; (println "Updated template...") + ;; (pprint/pprint updated-template) + updated-template)) - (cond - (= :donut (data :component)) (assoc edn :transform rules/donut) - (= :integrant (data :component)) (assoc edn :transform rules/integrant) - :else edn))