diff --git a/libs/deps-template/resources/io/github/kit_clj/kit/resources/system.edn b/libs/deps-template/resources/io/github/kit_clj/kit/resources/system.edn index af054c4..edab338 100644 --- a/libs/deps-template/resources/io/github/kit_clj/kit/resources/system.edn +++ b/libs/deps-template/resources/io/github/kit_clj/kit/resources/system.edn @@ -1,24 +1,23 @@ -{ - :system/env +{:system/env #profile {:dev :dev :test :test :prod :prod} -<% if metrics? %> + <% if metrics? %> :metrics/prometheus - {}<% endif %> -<% if repl? %> + {} <% endif %> + <% if repl? %> :repl/server {:port #long #or [#env REPL_PORT 7200] - :host #or [#env REPL_HOST "127.0.0.1"]}<% endif %> -<% if nrepl? %> + :host #or [#env REPL_HOST "127.0.0.1"]} <% endif %> + <% if nrepl? %> :nrepl/server {:port #long #or [#env NREPL_PORT 7000] - :bind #or [#env NREPL_HOST "127.0.0.1"]}<% endif %> -<% if redis? %> + :bind #or [#env NREPL_HOST "127.0.0.1"]} <% endif %> + <% if redis? %> :cache/redis {:ttl 3600 :conn {:pool {} - :spec {:uri #env REDIS_URI}}}<% endif %> + :spec {:uri #env REDIS_URI}}} <% endif %> :server/http {:port #long #or [#env PORT 3000] @@ -49,28 +48,26 @@ :responses {:not-modified-responses true :absolute-redirects true :content-types true - :default-charset "utf-8"}} - } + :default-charset "utf-8"}}} :reitit.routes/api {:base-path "/api" :env #ig/ref :system/env<% if metrics? %> :metrics #ig/ref :metrics/prometheus<% endif %><% if conman? %> - :query-fn #ig/ref :db.sql/query-fn<% endif %> - } + :query-fn #ig/ref :db.sql/query-fn<% endif %>} :router/routes {:routes #ig/refset :reitit/routes} :router/core {:routes #ig/ref :router/routes - :env #ig/ref :system/env}<% if quartz? %> + :env #ig/ref :system/env} <% if quartz? %> :cronut/scheduler - {:schedule []}<% endif %><% if selmer? %> + {:schedule []} <% endif %><% if selmer? %> :templating/selmer - {}<% endif %><% if xtdb? %> + {} <% endif %><% if xtdb? %> ;; https://docs.xtdb.com/administration/configuring/ :db.xtdb/node @@ -85,7 +82,7 @@ :db-dir "data/dev/index-store" :sync? true}}} :test {} - :prod {}}<% endif %><% if hikari? %> + :prod {}} <% endif %><% if hikari? %> :db.sql/hikari-connection #profile {:dev {:jdbc-url "jdbc:mysql://127.0.0.1:3306/<>?characterEncoding=utf8"} @@ -103,7 +100,7 @@ :password "123456" :jdbc-url #env JDBC_URL :driver-class-name "com.mysql.jdbc.Driver" - :register-mbeans false}}<% endif %><% if conman? %> + :register-mbeans false}} <% endif %><% if conman? %> :db.sql/connection #profile {:dev {:jdbc-url "jdbc:postgresql://localhost/<>?user=<>&password=<>"} @@ -118,10 +115,9 @@ {:conn #ig/ref :db.sql/connection :options {} :filename "queries.sql" - :env #ig/ref :system/env}<% endif %><% if migratus? %> + :env #ig/ref :system/env} <% endif %><% if migratus? %> :db.sql/migrations {:store :database :db {:datasource #ig/ref :db.sql/connection} - :migrate-on-init? true}<% endif %> -} + :migrate-on-init? true} <% endif %>} \ No newline at end of file diff --git a/libs/deps-template/resources/io/github/kit_clj/kit/src/clj/core.clj b/libs/deps-template/resources/io/github/kit_clj/kit/src/clj/core.clj index 5edde86..5a99994 100644 --- a/libs/deps-template/resources/io/github/kit_clj/kit/src/clj/core.clj +++ b/libs/deps-template/resources/io/github/kit_clj/kit/src/clj/core.clj @@ -1,38 +1,37 @@ (ns <>.core (:require - [clojure.tools.logging :as log] - [integrant.core :as ig] - [<>.config :as config] - [<>.env :refer [defaults]] + [clojure.tools.logging :as log] + [integrant.core :as ig] + [<>.config :as config] + [<>.env :refer [defaults]] ;; Edges<% if redis? %> - [kit.edge.cache.redis]<% endif %><% if xtdb? %> - [kit.edge.db.xtdb]<% endif %><% if hikari? %> - [kit.edge.db.sql.hikari]<% endif %><% if conman? %> - [kit.edge.db.sql.conman]<% endif %><% if migratus? %> - [kit.edge.db.sql.migratus]<% endif %><% if postgres? %> - [kit.edge.db.postgres]<% endif %><% if mysql? %> - [kit.edge.db.mysql]<% endif %><% if hato? %> - [kit.edge.http.hato]<% endif %><% if quartz? %> - [kit.edge.scheduling.quartz]<% endif %><% if selmer? %> - [kit.edge.templating.selmer]<% endif %><% if metrics? %> - [kit.edge.utils.metrics]<% endif %><% if repl? %> - [kit.edge.utils.repl]<% endif %><% if nrepl? %> - [kit.edge.utils.nrepl]<% endif %> - [kit.edge.server.undertow] - [<>.web.handler] + [kit.edge.cache.redis] <% endif %><% if xtdb? %> + [kit.edge.db.xtdb] <% endif %><% if hikari? %> + [kit.edge.db.sql.hikari] <% endif %><% if conman? %> + [kit.edge.db.sql.conman] <% endif %><% if migratus? %> + [kit.edge.db.sql.migratus] <% endif %><% if postgres? %> + [kit.edge.db.postgres] <% endif %><% if mysql? %> + [kit.edge.db.mysql] <% endif %><% if hato? %> + [kit.edge.http.hato] <% endif %><% if quartz? %> + [kit.edge.scheduling.quartz] <% endif %><% if selmer? %> + [kit.edge.templating.selmer] <% endif %><% if metrics? %> + [kit.edge.utils.metrics] <% endif %><% if repl? %> + [kit.edge.utils.repl] <% endif %><% if nrepl? %> + [kit.edge.utils.nrepl] <% endif %> + [kit.edge.server.undertow] + [<>.web.handler] ;; Routes - [<>.web.routes.api] - ) + [<>.web.routes.api]) (:gen-class)) ;; log uncaught exceptions in threads (Thread/setDefaultUncaughtExceptionHandler - (fn [thread ex] - (log/error {:what :uncaught-exception - :exception ex - :where (str "Uncaught exception on" (.getName thread))}))) + (fn [thread ex] + (log/error {:what :uncaught-exception + :exception ex + :where (str "Uncaught exception on" (.getName thread))}))) (defonce system (atom nil)) @@ -50,4 +49,4 @@ (defn -main [& _] (start-app) (.addShutdownHook (Runtime/getRuntime) (Thread. stop-app)) - (.addShutdownHook (Runtime/getRuntime) (Thread. shutdown-agents))) + (.addShutdownHook (Runtime/getRuntime) (Thread. shutdown-agents))) \ No newline at end of file diff --git a/libs/deps-template/resources/io/github/kit_clj/kit/versions.edn b/libs/deps-template/resources/io/github/kit_clj/kit/versions.edn index 4036abd..670ec79 100644 --- a/libs/deps-template/resources/io/github/kit_clj/kit/versions.edn +++ b/libs/deps-template/resources/io/github/kit_clj/kit/versions.edn @@ -18,5 +18,5 @@ "kit-sql-hikari" "1.0.6" "kit-sql" "1.1.4" "kit-undertow" "1.0.8" - "lein-template" "0.1.71" - "deps-template" "0.1.71"} + "lein-template" "0.1.72" + "deps-template" "0.1.72"} diff --git a/libs/lein-template/deps.edn b/libs/lein-template/deps.edn index 860e4bd..cc9343c 100644 --- a/libs/lein-template/deps.edn +++ b/libs/lein-template/deps.edn @@ -1,4 +1,4 @@ {:paths ["src"] :deps {selmer/selmer {:mvn/version "1.12.59"} com.github.seancorfield/clj-new {:mvn/version "1.2.381"} - io.github.kit-clj/deps-template {:mvn/version "0.1.71"}}} + io.github.kit-clj/deps-template {:mvn/version "0.1.72"}}}