Skip to content

Commit

Permalink
bump up template version
Browse files Browse the repository at this point in the history
  • Loading branch information
Yogthos committed Jan 18, 2025
1 parent c0ac3cd commit dd189d8
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 51 deletions.
Original file line number Diff line number Diff line change
@@ -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]
Expand Down Expand Up @@ -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
Expand All @@ -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/<<name>>?characterEncoding=utf8"}
Expand All @@ -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/<<name>>?user=<<name>>&password=<<name>>"}
Expand All @@ -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 %>}
51 changes: 25 additions & 26 deletions libs/deps-template/resources/io/github/kit_clj/kit/src/clj/core.clj
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
(ns <<ns-name>>.core
(:require
[clojure.tools.logging :as log]
[integrant.core :as ig]
[<<ns-name>>.config :as config]
[<<ns-name>>.env :refer [defaults]]
[clojure.tools.logging :as log]
[integrant.core :as ig]
[<<ns-name>>.config :as config]
[<<ns-name>>.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]
[<<ns-name>>.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]
[<<ns-name>>.web.handler]

;; Routes
[<<ns-name>>.web.routes.api]
)
[<<ns-name>>.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))

Expand All @@ -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)))
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
2 changes: 1 addition & 1 deletion libs/lein-template/deps.edn
Original file line number Diff line number Diff line change
@@ -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"}}}

0 comments on commit dd189d8

Please sign in to comment.