Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add melange-json-native pkg #12

Merged
merged 3 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

- PPX: Qualify usages of infix operators with `Stdlib`
([#11](https://github.com/melange-community/melange-json/pull/11))
- Add `melange-json-native` package
([#12](https://github.com/melange-community/melange-json/pull/12))

## 1.2.0 (2024-08-16)

Expand Down
18 changes: 13 additions & 5 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@

(package
(name melange-json)
(synopsis
"Compositional JSON encode/decode library and PPX for Melange, with native compatibility")
(synopsis "Compositional JSON encode/decode library and PPX for Melange")
(description
"Provides encoders and decoders to convert JSON values into typed values. With the possibility to create custom encoders and decoders and automate them with a PPX.")
"Provides tools for converting JSON to typed OCaml values in Melange. It includes custom encoders, decoders, and a PPX for automating these conversions.")
(depends
ocaml
(melange
Expand All @@ -37,8 +36,17 @@
(>= "3.10.0")
:with-test))
ppxlib
(yojson
(>= "1.6.0")) ; only used for the native version
(opam-check-npm-deps :with-test) ; todo: use with-dev-setup once opam 2.2 is out
(ocaml-lsp-server :with-test)
(ocamlformat :with-test)))

(package
(name melange-json-native)
(synopsis "Compositional JSON encode/decode PPX for OCaml")
(description
"A PPX for OCaml that automates encoding and decoding JSON into typed values. It supports custom encoders and decoders, and integrates with Yojson")
(depends
ocaml
ppxlib
(yojson
(>= "1.6.0"))))
35 changes: 35 additions & 0 deletions melange-json-native.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "Compositional JSON encode/decode PPX for OCaml"
description:
"A PPX for OCaml that automates encoding and decoding JSON into typed values. It supports custom encoders and decoders, and integrates with Yojson"
maintainer: [
"Antonio Nuno Monteiro <[email protected]>"
"Javier Chávarri <[email protected]>"
]
authors: ["glennsl" "Andrey Popp"]
license: ["LGPL-3.0-only" "MPL-2.0"]
homepage: "https://github.com/melange-community/melange-json/"
bug-reports: "https://github.com/melange-community/melange-json/issues"
depends: [
"dune" {>= "3.9"}
"ocaml"
"ppxlib"
"yojson" {>= "1.6.0"}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/melange-community/melange-json.git"
6 changes: 2 additions & 4 deletions melange-json.opam
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis:
"Compositional JSON encode/decode library and PPX for Melange, with native compatibility"
synopsis: "Compositional JSON encode/decode library and PPX for Melange"
description:
"Provides encoders and decoders to convert JSON values into typed values. With the possibility to create custom encoders and decoders and automate them with a PPX."
"Provides tools for converting JSON to typed OCaml values in Melange. It includes custom encoders, decoders, and a PPX for automating these conversions."
maintainer: [
"Antonio Nuno Monteiro <[email protected]>"
"Javier Chávarri <[email protected]>"
Expand All @@ -19,7 +18,6 @@ depends: [
"melange-jest" {with-test}
"reason" {>= "3.10.0" & with-test}
"ppxlib"
"yojson" {>= "1.6.0"}
"opam-check-npm-deps" {with-test}
"ocaml-lsp-server" {with-test}
"ocamlformat" {with-test}
Expand Down
8 changes: 4 additions & 4 deletions ppx/native/dune
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
(library
(public_name melange-json.ppx-native)
(public_name melange-json-native.ppx)
(name ppx_deriving_json_native)
(modules
:standard
\
ppx_deriving_json_runtime
ppx_deriving_json_native_test)
(libraries ppxlib)
(ppx_runtime_libraries melange-json.ppx-runtime-native)
(ppx_runtime_libraries melange-json-native.ppx-runtime)
(preprocess
(pps ppxlib.metaquot))
(kind ppx_deriver))

(library
(public_name melange-json.ppx-runtime-native)
(public_name melange-json-native.ppx-runtime)
(name ppx_deriving_json_native_runtime)
(wrapped false)
(modules ppx_deriving_json_runtime)
Expand All @@ -22,7 +22,7 @@
(executable
(name ppx_deriving_json_native_test)
(modules ppx_deriving_json_native_test)
(libraries melange-json.ppx-native ppxlib))
(libraries melange-json-native.ppx ppxlib))

(rule
(target ppx_deriving_json_native.mli)
Expand Down
2 changes: 1 addition & 1 deletion ppx/test/ppx_deriving_json_native.e2e.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
> (name main)
> (libraries yojson)
> (flags :standard -w -37-69 -open Ppx_deriving_json_runtime.Primitives)
> (preprocess (pps melange-json.ppx-native)))' > dune
> (preprocess (pps melange-json-native.ppx)))' > dune

$ echo '
> open Example
Expand Down
Loading