From 2ab29c28378b37ce69cd1ebbd55bc2f11d7a40f3 Mon Sep 17 00:00:00 2001 From: Leandro Ostera Date: Thu, 11 Apr 2024 07:44:17 +0200 Subject: [PATCH] meta: release 0.0.2 fix: scope derive cram tests to derive package fix: clean up deps --- CHANGES.md | 24 ++++++++++++++++++++++++ README.md | 4 ++-- derive/dune | 1 + dune-project | 5 ++--- serde_derive.opam | 1 + serde_json.opam | 2 +- 6 files changed, 31 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0446e75..22b5281 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,27 @@ +# 0.0.2 + +Complete rewrite of the Serde library with a heavy focus on usability and +maintainability. + +* Support writing manual serializers and deserializers with an ergonomic API. + +* Introduce a new CPS-style de/serialization mechanism. + +* Configurable de/serializers including options to: + * rename all fields on records – thanks to @tjdevries :sparkles: + * ignore unknown fields – thanks to @tjdevries :clap: + * rename specific fields – thanks to @tjdevries :zap: + * adjacently tagged variants – thanks to @sabine + * out of order fields + +* Better derivation support now including: + * records + * variants (unit, newtype, tuple, and record variants) + * lists and options + * floats – thanks to @wesleimp :clap: + +* Support nix flakes for development and installation – thanks to @metame :sparkles: + # 0.0.1 Introduce the library with a few standard serde formats: diff --git a/README.md b/README.md index 76c02d1..bd69784 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ The main goals for `serde.ml` are: structures of the user's choice with maximum efficiency. ```ocaml -type rank = Captain | Chief_petty_officer [@@deriving serializer, deserializer] -type t = { name : string; rank : rank } [@@deriving serializer, deserializer] +type rank = Captain | Chief_petty_officer [@@deriving serialize, deserialize] +type t = { name : string; rank : rank } [@@deriving serialize, deserialize] let obrien = { name = "Miles O'Brien"; rank = Chief_petty_officer } let sisko = { name = "Benjamin Sisko"; rank = Captain } diff --git a/derive/dune b/derive/dune index 80b33ed..a4e4ecf 100644 --- a/derive/dune +++ b/derive/dune @@ -6,6 +6,7 @@ (pps ppxlib.metaquot))) (cram + (package serde_derive) (deps (package serde) (package serde_derive) diff --git a/dune-project b/dune-project index eb9e80b..5809770 100644 --- a/dune-project +++ b/dune-project @@ -24,7 +24,6 @@ (rio (>= "0.0.8")) (spices :with-test) dune)) - (package (name serde_derive) @@ -35,8 +34,8 @@ (ppx_deriving (>= "5.2.1")) (ppxlib (>= "0.28.0")) (serde (= :version)) + (serde_json (and :with-test (= :version))) dune)) - (package (name serde_json) @@ -47,7 +46,7 @@ (qcheck :with-test) (rio (>= "0.0.8")) (serde (= :version)) - (serde_derive (= :version)) + (serde_derive (and :with-test (= :version))) (spices :with-test) (yojson (>= "2.1.0")) dune)) diff --git a/serde_derive.opam b/serde_derive.opam index d5f7d56..09af72e 100644 --- a/serde_derive.opam +++ b/serde_derive.opam @@ -13,6 +13,7 @@ depends: [ "ppx_deriving" {>= "5.2.1"} "ppxlib" {>= "0.28.0"} "serde" {= version} + "serde_json" {with-test & = version} "dune" {>= "3.12"} "odoc" {with-doc} ] diff --git a/serde_json.opam b/serde_json.opam index 593cc35..10fb2b1 100644 --- a/serde_json.opam +++ b/serde_json.opam @@ -12,7 +12,7 @@ depends: [ "qcheck" {with-test} "rio" {>= "0.0.8"} "serde" {= version} - "serde_derive" {= version} + "serde_derive" {with-test & = version} "spices" {with-test} "yojson" {>= "2.1.0"} "dune" {>= "3.12"}