Skip to content

Commit

Permalink
Update ts2ocaml to 1.4.6
Browse files Browse the repository at this point in the history
Signed-off-by: Sora Morimoto <[email protected]>
  • Loading branch information
smorimoto committed Nov 2, 2023
1 parent 729e62b commit e0119d9
Show file tree
Hide file tree
Showing 12 changed files with 164 additions and 138 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
13 changes: 3 additions & 10 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@ on:

jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest

steps:
- name: Checkout code
Expand All @@ -34,10 +26,11 @@ jobs:
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: "4.14"
allow-prelease-opam: true

- run: yarn install --immutable

- run: opam install . --deps-only --with-test
- run: opam install . --deps-only

- run: yarn exec -- opam exec -- make

Expand Down
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=0.23.0
version=0.26.1
profile=conventional
break-infix=fit-or-vertical
parse-docstrings=true
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ all: clean bindings build
.PHONY: pretty-bytes
pretty-bytes:
ts2ocaml jsoo node_modules/pretty-bytes/index.d.ts \
--preset=full \
--output-dir=lib \
--preset=full \
--simplify \
--number-as-int \
--verbose \
--nowarn

Expand Down
3 changes: 1 addition & 2 deletions bin/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
(modes js)
(js_of_ocaml
(flags
(--target-env nodejs)
(--enable use-js-string))
(--target-env nodejs))
(javascript_files ../lib/stub.js)))
17 changes: 15 additions & 2 deletions bin/main.ml
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
open Example
open Ts2ocaml_min

let () = print_endline @@ Pretty_bytes.prettyBytes ~number:128000000.0 ()
module PrettyBytes = struct
open Example
module Options = Pretty_bytes.Export.Options

let pretty_bytes = Pretty_bytes.prettyBytes
end

let options =
PrettyBytes.Options.create ~signed:false
~locale:(Primitive.inject (`String "en"))
~bits:false ~binary:false ~minimumFractionDigits:1 ~maximumFractionDigits:2
()

let () = print_endline @@ PrettyBytes.pretty_bytes ~number:128000000 ~options ()
13 changes: 11 additions & 2 deletions dune-project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(lang dune 3.3)
(lang dune 3.11)

(name example)

Expand All @@ -17,4 +17,13 @@
(name example)
(synopsis "Example use of ts2ocaml")
(description "Example use of ts2ocaml")
(depends ts2ocaml-jsoo-stdlib ojs gen_js_api js_of_ocaml-compiler))
(depends
ts2ocaml-jsoo-stdlib
ojs
gen_js_api
js_of_ocaml-compiler
(ocamlformat
(and
(= 0.26.1)
:with-dev-setup))
(ocaml-lsp-server :with-dev-setup)))
6 changes: 4 additions & 2 deletions example.opam
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ license: "ISC"
homepage: "https://github.com/ocsigen/ts2ocaml"
bug-reports: "https://github.com/ocsigen/ts2ocaml/issues"
depends: [
"dune" {>= "3.3"}
"dune" {>= "3.11"}
"ts2ocaml-jsoo-stdlib"
"ojs"
"gen_js_api"
"js_of_ocaml-compiler"
"ocamlformat" {= "0.26.1" & with-dev-setup}
"ocaml-lsp-server" {with-dev-setup}
"odoc" {with-doc}
]
build: [
Expand All @@ -31,5 +33,5 @@ build: [
]
dev-repo: "git+https://github.com/ocsigen/ts2ocaml.git"
pin-depends: [
[ "ts2ocaml-jsoo-stdlib.dev" "git+https://github.com/ocsigen/ts2ocaml.git#jsoo-stdlib-v1.4.4" ]
[ "ts2ocaml-jsoo-stdlib.dev" "git+https://github.com/ocsigen/ts2ocaml.git#jsoo-stdlib-v1.4.6" ]
]
2 changes: 1 addition & 1 deletion example.opam.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pin-depends: [
[ "ts2ocaml-jsoo-stdlib.dev" "git+https://github.com/ocsigen/ts2ocaml.git#jsoo-stdlib-v1.4.4" ]
[ "ts2ocaml-jsoo-stdlib.dev" "git+https://github.com/ocsigen/ts2ocaml.git#jsoo-stdlib-v1.4.6" ]
]
2 changes: 1 addition & 1 deletion lib/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(library
(name example)
(public_name example)
(libraries ts2ocaml-jsoo-stdlib ojs))
(libraries ts2ocaml-jsoo-stdlib))

(rule
(targets pretty_bytes.ml)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"pretty-bytes": "5.6.0"
},
"devDependencies": {
"@ocsigen/ts2ocaml": "1.4.4",
"esbuild": "0.17.5"
"@ocsigen/ts2ocaml": "1.4.6",
"esbuild": "0.19.5"
},
"packageManager": "[email protected]+sha256.5a9d054e67fbbae8774cd3667736fd74407ffbbb336898523ca1fe87b3fc4ee3"
}
Loading

0 comments on commit e0119d9

Please sign in to comment.