Skip to content

Commit 3157a3a

Browse files
committed
feat: melange-decoders
1 parent 501d137 commit 3157a3a

33 files changed

+250
-25
lines changed

.github/workflows/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,40 @@ jobs:
7272
- run: npm ci
7373
- run: npm run build
7474
- run: npm test
75+
76+
build-melange:
77+
strategy:
78+
fail-fast: false
79+
matrix:
80+
os:
81+
- ubuntu-latest
82+
ocaml-compiler:
83+
- 4.14.x
84+
package:
85+
- melange-decoders
86+
87+
runs-on: ${{ matrix.os }}
88+
89+
steps:
90+
- uses: actions/checkout@v3
91+
92+
- name: Use Node.js ${{ matrix.node-version }}
93+
uses: actions/setup-node@v3
94+
with:
95+
node-version: 16.x
96+
cache: 'npm'
97+
98+
- run: npm ci
99+
100+
- name: Use OCaml ${{ matrix.ocaml-compiler }}
101+
uses: ocaml/setup-ocaml@v2
102+
with:
103+
ocaml-compiler: ${{ matrix.ocaml-compiler }}
104+
opam-depext-flags: --with-test
105+
opam-local-packages: |
106+
decoders.opam
107+
${{ matrix.package }}.opam
108+
109+
- run: opam install "${{ matrix.package }}" --with-test
110+
- run: opam exec -- dune build @melange
111+
- run: npx jest

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.PHONY: all
2-
all: build test build-bs test-bs
2+
all: build test build-bs test-bs test-mel
33

44
.PHONY: clean-all
55
clean-all: clean clean-bs
@@ -34,7 +34,7 @@ clean:
3434

3535
_opam:
3636
opam switch create . --empty
37-
opam install -y ocaml-base-compiler.4.12.0 utop ocaml-lsp-server
37+
opam switch set-invariant ocaml-base-compiler.4.14.1
3838

3939
install-dependencies: _opam
4040
opam install . --deps-only --with-test
@@ -61,11 +61,11 @@ build-bs:
6161
test-bs:
6262
npm test
6363

64-
watch-build-bs:
65-
npm run build-watch
66-
67-
watch-test-bs:
68-
npm run test-watch
69-
7064
clean-bs:
7165
npm run clean
66+
67+
build-mel:
68+
dune build @melange
69+
70+
test-mel:
71+
npx jest _build/default/out/

__tests__/decoders_bs_json_test.ml renamed to __tests__/decoders_js_json_test.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
open Jest
2-
open Bs_json
2+
open Js_json
33

44
external parse_int : string -> int = "parseInt" [@@bs.scope "window"] [@@bs.val]
55

__tests__/decoders_bs_xml_test.ml renamed to __tests__/decoders_js_xml_test.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
open Jest
2-
open Bs_xml
2+
open Js_xml
33

44
let () =
55
describe

__tests__/dune

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(subdir
2+
melange
3+
(library
4+
(name decoders_tests_melange)
5+
(modes melange)
6+
(libraries decoders_mel melange-jest.jest)
7+
(preprocess (pps melange.ppx))
8+
(flags -open Decoders_mel)
9+
(wrapped false))
10+
(copy_files# "../*.ml")
11+
(copy_files# "../*.re"))

bsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
"xml.ml"
1919
]
2020
}, {
21-
"dir" : "src-bs"
21+
"dir" : "src-js",
22+
"files": {
23+
"excludes": ["decoders_mel.ml"]
24+
}
2225
}, {
2326
"dir": "__tests__",
2427
"type": "dev"

decoders-bencode.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ homepage: "https://github.com/mattjbray/ocaml-decoders"
1010
doc: "https://mattjbray.github.io/ocaml-decoders/"
1111
bug-reports: "https://github.com/mattjbray/ocaml-decoders/issues"
1212
depends: [
13-
"dune" {>= "3.1"}
13+
"dune" {>= "3.8"}
1414
"ocaml" {>= "4.03.0"}
1515
"decoders" {= version}
1616
"bencode" {>= "2.0"}

decoders-cbor.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ homepage: "https://github.com/mattjbray/ocaml-decoders"
1010
doc: "https://mattjbray.github.io/ocaml-decoders/"
1111
bug-reports: "https://github.com/mattjbray/ocaml-decoders/issues"
1212
depends: [
13-
"dune" {>= "3.1"}
13+
"dune" {>= "3.8"}
1414
"ocaml" {>= "4.03.0"}
1515
"decoders" {= version}
1616
"cbor"

decoders-ezjsonm.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ homepage: "https://github.com/mattjbray/ocaml-decoders"
1010
doc: "https://mattjbray.github.io/ocaml-decoders/"
1111
bug-reports: "https://github.com/mattjbray/ocaml-decoders/issues"
1212
depends: [
13-
"dune" {>= "3.1"}
13+
"dune" {>= "3.8"}
1414
"ocaml" {>= "4.03.0"}
1515
"decoders" {= version}
1616
"ezjsonm" {>= "0.4.0"}

decoders-ezxmlm.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ homepage: "https://github.com/mattjbray/ocaml-decoders"
1010
doc: "https://mattjbray.github.io/ocaml-decoders/"
1111
bug-reports: "https://github.com/mattjbray/ocaml-decoders/issues"
1212
depends: [
13-
"dune" {>= "3.1"}
13+
"dune" {>= "3.8"}
1414
"ocaml" {>= "4.03.0"}
1515
"decoders" {= version}
1616
"ezxmlm" {>= "1.1.0"}

0 commit comments

Comments
 (0)