From 4afcb571012631f1f6fb5ca6a4e175657920e048 Mon Sep 17 00:00:00 2001 From: Murphy Randle Date: Thu, 2 May 2024 12:56:26 -0400 Subject: [PATCH] Update README.md --- README.md | 55 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 1cc45bf..bcd9937 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,34 @@ Decco is lazily maintained by it users, but it's not being actively developed, since its feature set is complete enough for general production use. If you find a major bug that you need fixed, it'll probably be your job to fix it. 💪 +## How do I install it? + +1. Install package + +``` +npm i @rescript-labs/decco +``` + +2. Update your `rescript.json` (or bsconfig.json if you haven't changed its name) + +```json +{ + ..., + "bs-dependencies": [ "@rescript-labs/decco" ], + "ppx-flags": [ "@rescript-labs/decco/ppx" ], + ... +} +``` + +Adding `decco/ppx` to `ppx-flags` will enable the PPX. Adding decco to `bs-dependencies` is required because the code generated by the PPX references the `Decco` module. + +## Compatibility + +Decco 2.0.0 and above work with ReScript 11 in uncurried mode. If you need to use Decco with an older version of ReScript, install decco version `1.6.0` + +If you need to use decco with BuckleScript 5, install `@ryb73/decco` version ^0.1.0 by [following the old ReadMe here](https://github.com/reasonml-labs/decco/blob/0452fc42fa4cd4230d394c718e7f62a0384ce045/README.md). + + ## What is it? A Rescript PPX which generates JSON serializers and deserializers for user-defined types. @@ -53,33 +81,6 @@ let { s, i, o, complex, f, otherKey, magic } = mytype_decode(encoded)->Belt.Result.getExn; ``` -## How do I install it? - -1. Install package - -``` -npm i decco -``` - -2. Update your `rescript.json` (or bsconfig.json if you haven't changed its name) - -```json -{ - ..., - "bs-dependencies": [ "decco" ], - "ppx-flags": [ "decco/ppx" ], - ... -} -``` - -Adding `decco/ppx` to `ppx-flags` will enable the PPX. Adding decco to `bs-dependencies` is required because the code generated by the PPX references the `Decco` module. - -## Compatibility - -Decco 2.0.0 and above work with ReScript 11 in uncurried mode. If you need to use Decco with an older version of ReScript, install decco version `1.6.0` - -If you need to use decco with BuckleScript 5, install `@ryb73/decco` version ^0.1.0 by [following the old ReadMe here](https://github.com/reasonml-labs/decco/blob/0452fc42fa4cd4230d394c718e7f62a0384ce045/README.md). - ## How do I use it? See the test folder in this repo for some examples.