mirror of
https://github.com/penpot/penpot.git
synced 2025-05-23 10:26:12 +02:00
✨ Add usability improvements to schema validation subsystem
This commit is contained in:
parent
83c6354a0a
commit
37e4939af7
40 changed files with 759 additions and 511 deletions
|
@ -8,7 +8,6 @@
|
|||
(:require
|
||||
[app.auth :as auth]
|
||||
[app.common.data :as d]
|
||||
[app.common.data.macros :as dm]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.schema :as sm]
|
||||
[app.common.uuid :as uuid]
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
(def ^:private schema:templates
|
||||
[:vector schema:template])
|
||||
|
||||
(def check-templates!
|
||||
(sm/check-fn schema:templates))
|
||||
|
||||
(defmethod ig/init-key ::setup/templates
|
||||
[_ _]
|
||||
(let [templates (-> "app/onboarding.edn" io/resource slurp edn/read-string)
|
||||
|
@ -35,7 +38,7 @@
|
|||
|
||||
(dm/verify!
|
||||
"expected a valid templates file"
|
||||
(sm/valid? schema:templates templates))
|
||||
(check-templates! templates))
|
||||
|
||||
(doseq [{:keys [id path] :as template} templates]
|
||||
(let [path (or path (fs/join dest id))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue