Skip to content

Commit cc2f254

Browse files
committed
Add function to export types
1 parent f805be6 commit cc2f254

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

dev/user.clj

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
(ns user)
1+
(ns user
2+
(:require
3+
[clojure.java.io :as io]
4+
[malli.dev :as malli-dev]))
25

36
(defmacro jit [sym]
47
`(requiring-resolve '~sym))
@@ -11,3 +14,26 @@
1114
((jit clj-reload.core/init) {:dirs ["src" "dev" "test" "../examples/src"]})
1215
(reset! initiated-clj-reload? true))
1316
((jit clj-reload.core/reload)))
17+
18+
(defn export-types []
19+
;; collect schemas and start instrumentation
20+
((jit malli-dev/start!))
21+
22+
;; create export file
23+
(def export-file
24+
(io/file "resources/clj-kondo.exports/com.shipclojure/simulflow_types/config.edn"))
25+
26+
;; make parents if not exist
27+
(io/make-parents export-file)
28+
29+
;; copy the configs
30+
(io/copy
31+
(io/file ".clj-kondo/metosin/malli-types-clj/config.edn")
32+
export-file)
33+
34+
;; clear the cache and stop instrumentation
35+
((jit malli-dev/stop!)))
36+
37+
(comment
38+
(export-types)
39+
,)

0 commit comments

Comments
 (0)