Skip to content

Commit 4bc7a39

Browse files
committed
Merge branch 'master' into parsing-conjunctions
2 parents 8e04382 + b4ca7c2 commit 4bc7a39

31 files changed

+1808
-2720
lines changed

.github/workflows/clojure.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
with:
7070
cli: latest
7171
- name: Setup Node.js
72-
uses: actions/setup-node@v4.1.0
72+
uses: actions/setup-node@v4.4.0
7373
with:
7474
node-version: 16
7575
- name: Install dependencies
@@ -105,3 +105,33 @@ jobs:
105105
bb: latest
106106
- name: Run tests
107107
run: bb test-bb
108+
109+
doc-tests:
110+
# Builds tests from Documentation with test-doc-blocks and tests that
111+
# the examples are still valid.
112+
name: Doc Tests
113+
runs-on: ubuntu-latest
114+
steps:
115+
- uses: actions/checkout@v4
116+
- name: Setup Java 11
117+
uses: actions/setup-java@v4
118+
with:
119+
distribution: zulu
120+
java-version: 11
121+
- uses: actions/cache@v4
122+
with:
123+
path: |
124+
~/.m2/repository
125+
~/.deps.clj
126+
~/.gitlibs
127+
key: ${{ runner.os }}-test-deps-${{ hashFiles('**/deps.edn') }}-${{ hashFiles('**/bb.edn') }}
128+
restore-keys: |
129+
${{ runner.os }}-test-deps-${{ hashFiles('**/deps.edn') }}-
130+
${{ runner.os }}-test-deps-
131+
- name: Setup Clojure
132+
uses: DeLaGuardo/setup-clojure@master
133+
with:
134+
cli: latest
135+
bb: latest
136+
- name: Run doc tests
137+
run: bb test-docs

.github/workflows/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- published # reacts to releases and prereleases, but not their drafts
7+
8+
jobs:
9+
build-and-release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: "Setup Java"
14+
uses: actions/setup-java@v4
15+
with:
16+
distribution: zulu
17+
java-version: 8
18+
- name: "Setup Clojure"
19+
uses: DeLaGuardo/setup-clojure@master
20+
with:
21+
cli: latest
22+
- name: Build jar
23+
run: clojure -M:jar
24+
- name: Deploy to Clojars
25+
run: clojure -X:deploy
26+
env:
27+
CLOJARS_USERNAME: metosinci
28+
CLOJARS_PASSWORD: "${{ secrets.CLOJARS_DEPLOY_TOKEN }}"

CHANGELOG.md

Lines changed: 46 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,36 @@ Malli is in well matured [alpha](README.md#alpha).
1616

1717
## UNRELEASED
1818

19-
* Docs: elaborate optional-keys and required-keys [#1117](https://github.com/metosin/malli/pull/1117)
19+
* Performance improvements in `malli.transform/transformer` [#1220](https://github.com/metosin/malli/pull/1220)
20+
* `malli.clj-kondo/emit!` saves to `.clj-kondo/imports` now as recommended by clj-kondo. [#1216](https://github.com/metosin/malli/pull/1216)
21+
22+
## 0.19.1 (2025-06-09)
23+
* Technical release
24+
25+
## 0.19.0 (2025-06-09)
26+
27+
* **BREAKING** FIX: `json-transformer` is now better at inferring en/decoders for `:enum` and `:=`. [#1205](https://github.com/metosin/malli/pull/1205)
28+
* For example `[:enum 1 2 3]` gets encoded as a JSON number, not a string.
29+
* If you need the old behaviour, you can override the en/decoders using properties. [See docs.](README.md#advanced-transformations)
30+
* Value generation: `:+` and `:*` now support generator directives `:gen/min`, `:gen/max` as well as `:min` and `:max` schema directives [#1208](https://github.com/metosin/malli/pull/1208)
31+
* CLJS bundle size reduced [#1211](https://github.com/metosin/malli/pull/1211)
32+
* FIX: `:default/fn` now works in map entry properties in addition to schema properties [#1209](https://github.com/metosin/malli/pull/1209)
33+
34+
## 0.18.0 (2025-05-12)
35+
2036
* **BREAKING** Output of `parse` now uses new `malli.core.Tag` and `malli.core.Tags` records for `:orn`, `:multi`, `:altn`, `:catn` etc. [#1123](https://github.com/metosin/malli/issues/1123) [#1153](https://github.com/metosin/malli/issues/1153)
2137
* See [Parsing](#parsing-values) and [Unparsing](#unparsing-values) for docs.
38+
* **BREAKING** Swagger and JSON-Schema outputs now use `.` instead of `/` (encoded as `~1`) as the separator. [#1183](https://github.com/metosin/malli/pull/1183)
39+
* This will only affect you if you rely on the exact name of the schema
40+
* Docs: elaborate optional-keys and required-keys [#1117](https://github.com/metosin/malli/pull/1117)
41+
* JSON Schema for `:tuple` now uses `"prefixItems"` [#1151](https://github.com/metosin/malli/pull/1151)
2242
* FIX: `:path` when explaining `:ref` errors [#1106](https://github.com/metosin/malli/issues/1106)
43+
* FIX: don't instrument functions with primitive type hints (like `^double`), instead, emit a warning [#1176](https://github.com/metosin/malli/pull/1176)
44+
* FIX: `:map-of` and `:map` decode now retain the input map type (eg. `sorted-map`) [#1189](https://github.com/metosin/malli/pull/1189)
45+
* FIX: schemas and into-schemas are printed to the console and the REPL in CLJS the same way as they are in CLJ. [#1186](https://github.com/metosin/malli/issues/1186)
46+
* FIX: `:merge` and `:union` now work with 1 child. With no children, throw a clearer error. [#1147](https://github.com/metosin/malli/pull/1147)
47+
* FIX: `default-value-transformer` for `:ref`s inside `:map`s [#1145](https://github.com/metosin/malli/issues/1145)
48+
* FIX: generator for `empty?` schema [#1196](https://github.com/metosin/malli/pull/1196)
2349

2450
## 0.17.0 (2024-12-08)
2551

@@ -147,20 +173,20 @@ borkdude/edamame 1.3.23 -> 1.4.25
147173
* Support for Var references [#985](https://github.com/metosin/malli/pull/985), see [guide](README.md#var-registry) for details.
148174
* **BREAKING**: `m/coerce` and `m/coercer` throw `::m/coercion` instead of `::m/invalid-input`
149175
* New Guide for [Reusable Schemas](docs/reusable-schemas.md)
150-
* Less printing of Var instumentation
151-
* **BREAKING**: qualified symbols are valid reference types [#984](https://github.com/metosin/malli/pull/984)
176+
* Less printing of Var instumentation
177+
* **BREAKING**: qualified symbols are valid reference types [#984](https://github.com/metosin/malli/pull/984)
152178
* Fixing `mt/strip-extra-keys-transformer` for recursive map encoding [#963](https://github.com/metosin/malli/pull/963)
153179
* Support passing custom `:type` in into-schema opt for `:map` and `:map-of` [#968](https://github.com/metosin/malli/pull/968)
154180
* `mu/path->in` works with `:orn`, `:catn` and `:altn`.
155181

156182
## 0.13.0 (2023-09-24)
157183

158-
* **BREAKING** Fallback to use result of first branch when decoding `:or` and `:orn`, [#946](https://github.com/metosin/malli/pull/946)
184+
* **BREAKING** Fallback to use result of first branch when decoding `:or` and `:orn`, [#946](https://github.com/metosin/malli/pull/946)
159185
* **BREAKING**: `decode` for `:double` and `double?` in cljs doesn't allow trailing garbage any more [#942](https://github.com/metosin/malli/pull/942)
160186
* Faster generators for `:map`, [#948](https://github.com/metosin/malli/pull/948) & [#949](https://github.com/metosin/malli/pull/949)
161187
* FIX: `:altn` can't handle just one child entry when nested in sequence schema [#945](https://github.com/metosin/malli/pull/945)
162188
* Officially drop Clojure 1.10 support. Tests haven't passed for some time with Clojure 1.10, but this was not noticed due to a faulty CI setup.
163-
* Use type inferrer when encoding enums [#951](https://github.com/metosin/malli/pull/951)
189+
* Use type inferrer when encoding enums [#951](https://github.com/metosin/malli/pull/951)
164190
* Use `bound-fn` in `malli.dev/start!` to preserve `*out*` [#954](https://github.com/metosin/malli/pull/954)
165191
* FIX: Malli generates invalid clj-kondo type spec for [:map [:keys [:+ :keyword]]] [#952](https://github.com/metosin/malli/pull/952)
166192
* FIX: `malli.experimental.describe` descriptions of `:min` and `:max` are backwards [#959](https://github.com/metosin/malli/pull/959)
@@ -267,7 +293,7 @@ borkdude/edamame 1.0.0 -> 1.1.17
267293

268294
## 0.10.0 (2023-01-12)
269295

270-
* New optional time-schemas for the JVM on top of `java.time`:
296+
* New optional time-schemas for the JVM on top of `java.time`:
271297
* `:time/duration`, `:time/instant`, `:time/local-date`, `:time/local-date-time`, `:time/local-time`, `:time/offset-date-time`, `:time/offset-time`, `:time/zone-id`, `:time/zone-offset`, `:time/zoned-date-time`, see [README](README.md#malliexperimentaltime)
272298
* automatic type inferring with `:enum` and `:=` with `malli.transform` and `malli.json-schema` - detects homogenous `:string`, `:keyword`, `:symbol`, `:int` and `:double`), [#782](https://github.com/metosin/malli/pull/782) & [#784](https://github.com/metosin/malli/pull/784)
273299
* New `malli.core/coercer` and `malli.core/coerce` to both decode and validate a value, see [Docs](README.md#coercion)
@@ -397,8 +423,8 @@ borkdude/edamame 0.0.18 -> 1.0.0
397423
:address {:street string?
398424
:city string?
399425
:zip (l/optional int?)
400-
:lonlat [:tuple double? double?]}}
401-
```
426+
:lonlat [:tuple double? double?]}}
427+
```
402428

403429
* updated deps:
404430

@@ -472,7 +498,7 @@ fipp/fipp 0.6.24 -> 0.6.25
472498
```clojure
473499
mvxcvi/arrangement 1.2.0 -> 2.0.0
474500
borkdude/edamame 0.0.11 -> 0.0.18
475-
org.clojure/test.check 1.1.0 -> 1.1.1
501+
org.clojure/test.check 1.1.0 -> 1.1.1
476502
```
477503

478504
## 0.7.4 (2021-12-18)
@@ -623,7 +649,7 @@ New optimized map-syntax to super-fast schema creation, see [README](README.md#m
623649
; :value {:type :map,
624650
; :keys {:x {:order 0
625651
; :value {:type boolean?}},
626-
; :y {:order 1
652+
; :y {:order 1
627653
; :value {:type int?}
628654
; :properties {:optional true}}}}}}}
629655

@@ -703,7 +729,7 @@ No need to play with Compiler options or JVM properties to swap the default regi
703729
;; 164ns -> 28ns
704730
(let [valid? (m/validator [:and [:> 0] [:> 1] [:> 2] [:> 3] [:> 4]])]
705731
(cc/quick-bench (valid? 5)))
706-
732+
707733
;; 150ns -> 30ns
708734
(let [valid? (m/validator [:map [:a :any] [:b :any] [:c :any] [:d :any] [:e :any]])
709735
value {:a 1, :b 2, :c 3, :d 4, :e 5}]
@@ -726,7 +752,7 @@ No need to play with Compiler options or JVM properties to swap the default regi
726752
:type "food"
727753
:address {:street "hämeenkatu 14"
728754
:lonlat [61 23.7644223]}}]
729-
755+
730756
;; 920ns => 160ns
731757
(cc/quick-bench
732758
(decode json)))
@@ -748,7 +774,7 @@ No need to play with Compiler options or JVM properties to swap the default regi
748774
* Collection Schemas emit correct JSON Schema min & max declarations
749775
* humanized errors for `:boolean` & `:malli.core/tuple-limit`
750776
* predicate schema for `fn?`
751-
* `malli.util/transform-entries` passes in options [#340]/(https://github.com/metosin/malli/pull/340)
777+
* `malli.util/transform-entries` passes in options [#340]/(https://github.com/metosin/malli/pull/340)
752778
* BETA: humanized errors can be read from parent schemas (also from map entries), fixes [#86](https://github.com/metosin/malli/issues/86):
753779

754780
```clojure
@@ -837,7 +863,7 @@ No need to play with Compiler options or JVM properties to swap the default regi
837863
* FIX: Schema vizualization is not working for `[:< ...]` like schemas, [#370](https://github.com/metosin/malli/issues/370)
838864
* Ensure we use size 30 for generator (for more variety), [#364](https://github.com/metosin/malli/pull/364)
839865
* Set JSON Schema types and formats for numbers properly [#354](https://github.com/metosin/malli/pull/354)
840-
* -memoize actually memoized. easily 100x faster now [#350](https://github.com/metosin/malli/pull/350)
866+
* -memoize actually memoized. easily 100x faster now [#350](https://github.com/metosin/malli/pull/350)
841867
* Fix interceptor composition, [#347](https://github.com/metosin/malli/pull/350)
842868
* `malli.util`: add a rename-keys utility, similar to clojure.set [#338](https://github.com/metosin/malli/pull/338)
843869
* Let `mu/update` accept plain data schemas, [#329](https://github.com/metosin/malli/pull/329)
@@ -849,7 +875,7 @@ No need to play with Compiler options or JVM properties to swap the default regi
849875
* **BREAKING**: `m/-coder` and `m/-chain` are replaced wih `m/-intercepting`
850876
* **BREAKING**: `m/-fail!` is now `miu/-fail!`
851877
* **BREAKING**: `m/-error` is now `miu/-error`
852-
878+
853879
## 0.2.1 (2020-10-22)
854880

855881
* fix `:sequential` decoding with empty sequence under `mt/json-transformer`, fixes [#288](https://github.com/metosin/malli/issues/288)
@@ -889,8 +915,8 @@ Merged
889915
; [:map [:y :int]]]
890916

891917
(m/deref Merged)
892-
;[:map
893-
; [:x :string]
918+
;[:map
919+
; [:x :string]
894920
; [:y :int]]
895921

896922
(m/validate Merged {:x "kikka", :y 6})
@@ -933,7 +959,7 @@ First stable release.
933959
* new mandatory Protocol method in `m/Schema`: `-type-properties`
934960
* 1.9.2020
935961
* `m/children` returns 3-tuple (key, properties, schema) for `MapSchema`s
936-
* `m/map-entries` is removed, `m/entries` returns a `MapEntry` of key & `m/-val-schema`
962+
* `m/map-entries` is removed, `m/entries` returns a `MapEntry` of key & `m/-val-schema`
937963
* 4.8.2020
938964
* `:path` in explain is re-implemented: map keys by value, others by child index
939965
* `m/-walk` and `m/Walker` uses `:path`, not `:in`
@@ -950,7 +976,7 @@ First stable release.
950976
* 18.7.2020
951977
* big cleanup of `malli.transform` internals.
952978
* 12.7.2020
953-
* `malli.mermaid` is removed (in favor of `malli.dot`)
979+
* `malli.mermaid` is removed (in favor of `malli.dot`)
954980
* 10.7.2020
955981
* `[metosin/malli "0.0.1-20200710.075225-19"]`
956982
* Visitor is implemented using a Walker.
@@ -961,6 +987,6 @@ First stable release.
961987
* new `-children` method in `Schema`, to return child schemas as instances (instead of just AST)
962988
* 17.6.2020
963989
* change all `malli.core/*-registry` defs into `malli.core/*-schemas` defns to enable DCE for clojurescript
964-
* 9.6.2020
990+
* 9.6.2020
965991
* `malli.core/name` & `malli.core/-name` renamed to `malli.core/type` & `malli.core/-type`
966992
* `malli.generator/-generator` is renamed to `malli.generator/-schema-generator`

0 commit comments

Comments
 (0)