Skip to content

Commit

Permalink
Merge pull request #4 from mbarbin/err0
Browse files Browse the repository at this point in the history
Make err0 and standalone library with err0-handler separated
  • Loading branch information
mbarbin authored Aug 23, 2024
2 parents f608318 + 0413598 commit 3e336ad
Show file tree
Hide file tree
Showing 42 changed files with 865 additions and 516 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.0.2 (2024-08-23)

### Changed

- Make `commandlang-err` and standalone library called `err0` so it can be used more broadly. Split the handler part as a separated lib `err0-handler`.

## 0.0.1 (2024-08-22)

### Added
Expand Down
4 changes: 2 additions & 2 deletions commandlang-test.opam → commandlang-tests.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ depends: [
"climate" {= "0.0.1~preview-0.1"}
"cmdliner" {= "1.3.0"}
"commandlang" {= version}
"commandlang-err" {= version}
"commandlang-to-base" {= version}
"commandlang-to-climate" {= version}
"commandlang-to-cmdliner" {= version}
"core" {>= "v0.17" & < "v0.18"}
"core_unix" {>= "v0.17" & < "v0.18"}
"err0" {= version}
"expect_test_helpers_core" {>= "v0.17" & < "v0.18"}
"loc" {>= "0.0.2"}
"loc0" {>= "0.1.0"}
"mdx" {>= "2.4"}
"ppx_compare" {>= "v0.17" & < "v0.18"}
"ppx_enumerate" {>= "v0.17" & < "v0.18"}
Expand Down
2 changes: 1 addition & 1 deletion commandlang-to-base.opam
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ depends: [
"base" {>= "v0.17" & < "v0.18"}
"bisect_ppx" {dev & >= "2.8.3"}
"commandlang" {= version}
"commandlang-err" {= version}
"core" {>= "v0.17" & < "v0.18"}
"err0" {= version}
"ppx_compare" {>= "v0.17" & < "v0.18"}
"ppx_enumerate" {>= "v0.17" & < "v0.18"}
"ppx_expect" {>= "v0.17" & < "v0.18"}
Expand Down
2 changes: 1 addition & 1 deletion commandlang-to-climate.opam
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ depends: [
"bisect_ppx" {dev & >= "2.8.3"}
"climate" {= "0.0.1~preview-0.1"}
"commandlang" {= version}
"commandlang-err" {= version}
"err0" {= version}
"ppx_js_style" {dev & >= "v0.17" & < "v0.18"}
"odoc" {with-doc}
]
Expand Down
2 changes: 1 addition & 1 deletion commandlang-to-cmdliner.opam
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ depends: [
"bisect_ppx" {dev & >= "2.8.3"}
"cmdliner" {= "1.3.0"}
"commandlang" {= version}
"commandlang-err" {= version}
"err0" {= version}
"ppx_js_style" {dev & >= "v0.17" & < "v0.18"}
"odoc" {with-doc}
]
Expand Down
2 changes: 1 addition & 1 deletion doc/docs/tutorials/getting-started/lib/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(library
(name getting_started)
(public_name commandlang-test.getting_started)
(public_name commandlang-tests.getting_started)
(flags
:standard
-w
Expand Down
46 changes: 35 additions & 11 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,30 @@
(< v0.18)))))

(package
(name commandlang-err)
(synopsis "Error Handling Standard for Commandlang CLIs")
(name err0)
(synopsis "Error Handling Standard Based on Human Readable Messages")
(depends
(ocaml
(>= 5.2))
(bisect_ppx
(and
:dev
(>= 2.8.3)))
(ppx_js_style
(and
:dev
(>= v0.17)
(< v0.18)))
(sexplib0
(and
(>= v0.17)
(< v0.18)))
(stdune
(>= 3.16))))

(package
(name err0-handler)
(synopsis "A handler for Err0 that works well with commandlang")
(depends
(ocaml
(>= 5.2))
Expand All @@ -45,6 +67,8 @@
(>= 2.8.3)))
(commandlang
(= :version))
(err0
(= :version))
(ppx_js_style
(and
:dev
Expand Down Expand Up @@ -73,12 +97,12 @@
(>= 2.8.3)))
(commandlang
(= :version))
(commandlang-err
(= :version))
(core
(and
(>= v0.17)
(< v0.18)))
(err0
(= :version))
(ppx_compare
(and
(>= v0.17)
Expand Down Expand Up @@ -135,7 +159,7 @@
(= 1.3.0))
(commandlang
(= :version))
(commandlang-err
(err0
(= :version))
(ppx_js_style
(and
Expand All @@ -157,7 +181,7 @@
(= 0.0.1~preview-0.1))
(commandlang
(= :version))
(commandlang-err
(err0
(= :version))
(ppx_js_style
(and
Expand All @@ -166,7 +190,7 @@
(< v0.18)))))

(package
(name commandlang-test)
(name commandlang-tests)
(synopsis "Tests for commandlang")
(depends
(ocaml
Expand All @@ -185,8 +209,6 @@
(= 1.3.0))
(commandlang
(= :version))
(commandlang-err
(= :version))
(commandlang-to-base
(= :version))
(commandlang-to-climate
Expand All @@ -201,12 +223,14 @@
(and
(>= v0.17)
(< v0.18)))
(err0
(= :version))
(expect_test_helpers_core
(and
(>= v0.17)
(< v0.18)))
(loc
(>= 0.0.2))
(loc0
(>= 0.1.0))
(mdx
(>= 2.4))
(ppx_compare
Expand Down
3 changes: 2 additions & 1 deletion commandlang-err.opam → err0-handler.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "Error Handling Standard for Commandlang CLIs"
synopsis: "A handler for Err0 that works well with commandlang"
maintainer: ["Mathieu Barbin"]
authors: ["Mathieu Barbin"]
license: "MIT"
Expand All @@ -12,6 +12,7 @@ depends: [
"ocaml" {>= "5.2"}
"bisect_ppx" {dev & >= "2.8.3"}
"commandlang" {= version}
"err0" {= version}
"ppx_js_style" {dev & >= "v0.17" & < "v0.18"}
"sexplib0" {>= "v0.17" & < "v0.18"}
"stdune" {>= "3.16"}
Expand Down
33 changes: 33 additions & 0 deletions err0.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "Error Handling Standard Based on Human Readable Messages"
maintainer: ["Mathieu Barbin"]
authors: ["Mathieu Barbin"]
license: "MIT"
homepage: "https://github.com/mbarbin/commandlang"
doc: "https://mbarbin.github.io/commandlang/"
bug-reports: "https://github.com/mbarbin/commandlang/issues"
depends: [
"dune" {>= "3.16"}
"ocaml" {>= "5.2"}
"bisect_ppx" {dev & >= "2.8.3"}
"ppx_js_style" {dev & >= "v0.17" & < "v0.18"}
"sexplib0" {>= "v0.17" & < "v0.18"}
"stdune" {>= "3.16"}
"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/mbarbin/commandlang.git"
2 changes: 1 addition & 1 deletion lib/commandlang/src/command.mli
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ module Let_syntax : sig
This module is exported to be used by libraries with strong ties to
[commandlang]. Its signature may change in breaking ways at any time without
prior notice. *)
prior notice, and outside of the guidelines set by semver. *)

module Private : sig
module To_ast : sig
Expand Down
2 changes: 1 addition & 1 deletion lib/commandlang/test/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(library
(name commandlang_test)
(public_name commandlang-test.commandlang_test)
(public_name commandlang-tests.commandlang_test)
(inline_tests)
(flags
:standard
Expand Down
2 changes: 1 addition & 1 deletion lib/commandlang_ast/test/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(library
(name commandlang_ast_test)
(public_name commandlang-test.commandlang_ast_test)
(public_name commandlang-tests.commandlang_ast_test)
(inline_tests)
(flags :standard -w +a-4-40-41-42-44-45-48-66 -warn-error +a)
(libraries commandlang_ast)
Expand Down
Loading

0 comments on commit 3e336ad

Please sign in to comment.