@greenlabs/ppx-spice 0.2.0 → 0.2.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +7 -0
- package/greenlabs-ppx-spice-0.2.1-rc.0.tgz +0 -0
- package/package.json +2 -2
- package/ppx-linux.exe +0 -0
- package/ppx-osx.exe +0 -0
- package/ppx-windows.exe +0 -0
- package/src/rescript/Spice.res +4 -4
- package/src/rescript/Spice_Codecs.res +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 0.2.1 (unreleased)
|
|
4
|
+
|
|
5
|
+
- a190663 Utilize Js.Json.Boolean(bool) instead oif Js.Json.True, False https://github.com/green-labs/ppx_spice/pull/58
|
|
6
|
+
- a190663 Add support of uncurried mode for interface(*.resi) https://github.com/green-labs/ppx_spice/pull/58
|
|
7
|
+
|
|
3
8
|
## 0.2.0
|
|
4
9
|
|
|
5
10
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -126,6 +126,13 @@ Read our [Guide with examples](docs/GUIDE.md)
|
|
|
126
126
|
|
|
127
127
|
## Install
|
|
128
128
|
|
|
129
|
+
### Versions
|
|
130
|
+
|
|
131
|
+
|Compiler|Ppx_spice |
|
|
132
|
+
|--------|-----------|
|
|
133
|
+
|v10 |~<= v0.1.15|
|
|
134
|
+
|v11 |>= v0.2.0 |
|
|
135
|
+
|
|
129
136
|
```sh
|
|
130
137
|
yarn add -D @greenlabs/ppx-spice
|
|
131
138
|
```
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@greenlabs/ppx-spice",
|
|
3
|
-
"version": "0.2.0",
|
|
3
|
+
"version": "0.2.1-rc.0",
|
|
4
4
|
"description": "ReScript PPX which generate JSON (de)serializer",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Greenlabs Dev <developer@greenlabs.co.kr>",
|
|
@@ -21,4 +21,4 @@
|
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@changesets/cli": "^2.26.2"
|
|
23
23
|
}
|
|
24
|
-
}
|
|
24
|
+
}
|
package/ppx-linux.exe
CHANGED
|
Binary file
|
package/ppx-osx.exe
CHANGED
|
Binary file
|
package/ppx-windows.exe
CHANGED
|
Binary file
|
package/src/rescript/Spice.res
CHANGED
|
@@ -60,13 +60,13 @@ let floatFromJson = j =>
|
|
|
60
60
|
|
|
61
61
|
let boolToJson = (v): Js.Json.t =>
|
|
62
62
|
switch v {
|
|
63
|
-
| true => Js.Json.
|
|
64
|
-
| false => Js.Json.
|
|
63
|
+
| true => Js.Json.Boolean(true)
|
|
64
|
+
| false => Js.Json.Boolean(false)
|
|
65
65
|
}
|
|
66
66
|
let boolFromJson = j =>
|
|
67
67
|
switch (j: Js.Json.t) {
|
|
68
|
-
| Js.Json.
|
|
69
|
-
| Js.Json.
|
|
68
|
+
| Js.Json.Boolean(true) => Belt.Result.Ok(true)
|
|
69
|
+
| Js.Json.Boolean(false) => Belt.Result.Ok(false)
|
|
70
70
|
| _ => Belt.Result.Error({path: "", message: "Not a boolean", value: j})
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
let falseableEncode = (encoder, opt) =>
|
|
2
2
|
switch opt {
|
|
3
|
-
| None => Js.Json.
|
|
3
|
+
| None => Js.Json.Boolean(false)
|
|
4
4
|
| Some(v) => encoder(v)
|
|
5
5
|
}
|
|
6
6
|
let falseableDecode = (decoder, json) =>
|
|
7
7
|
switch json {
|
|
8
|
-
| Js.Json.
|
|
8
|
+
| Js.Json.Boolean(false) => Belt.Result.Ok(None)
|
|
9
9
|
| _ => Belt.Result.map(decoder(json), v => Some(v))
|
|
10
10
|
}
|
|
11
11
|
let falseable = (falseableEncode, falseableDecode)
|