@greenlabs/ppx-spice 0.2.0-next.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 CHANGED
@@ -1,5 +1,16 @@
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
+
8
+ ## 0.2.0
9
+
10
+ ### Minor Changes
11
+
12
+ - 9ce55bf: Compat the untagged variant
13
+
3
14
  ## 0.2.0-next.0
4
15
 
5
16
  ### Minor Changes
package/README.md CHANGED
@@ -74,6 +74,8 @@ type data = {
74
74
 
75
75
  There are many cases to parse and stringify the string data into (polymorphic) variants. Furthermore, the Unicode string needs to be handled with a variant. Currently, pattern matching is not working for the Unicode string in ReScript, the Spice is using `if ... then ... else` to compare the Unicode string in case of adding `@spice.as` attribute.
76
76
 
77
+ 3. Last but not least, Spice supports the latest ReScript compilers: v10's optional field record, v11's untagged variant, and more.
78
+
77
79
  ## Example
78
80
 
79
81
  1. Variant
@@ -124,6 +126,13 @@ Read our [Guide with examples](docs/GUIDE.md)
124
126
 
125
127
  ## Install
126
128
 
129
+ ### Versions
130
+
131
+ |Compiler|Ppx_spice |
132
+ |--------|-----------|
133
+ |v10 |~<= v0.1.15|
134
+ |v11 |>= v0.2.0 |
135
+
127
136
  ```sh
128
137
  yarn add -D @greenlabs/ppx-spice
129
138
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greenlabs/ppx-spice",
3
- "version": "0.2.0-next.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
@@ -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.True
64
- | false => Js.Json.False
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.True => Belt.Result.Ok(true)
69
- | Js.Json.False => Belt.Result.Ok(false)
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.False
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.False => Belt.Result.Ok(None)
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)