From 51593f9b5bbdacf8a0561382642d88ed6c4f6d5b Mon Sep 17 00:00:00 2001 From: Sora Morimoto Date: Thu, 2 Nov 2023 14:06:42 +0900 Subject: [PATCH] Update ts2ocaml to 1.4.6 Signed-off-by: Sora Morimoto --- .editorconfig | 9 ++ .github/workflows/workflow.yml | 13 +- .ocamlformat | 2 +- bin/dune | 3 +- bin/main.ml | 10 +- dune-project | 13 +- example.opam | 6 +- example.opam.template | 2 +- lib/dune | 2 +- package.json | 4 +- yarn.lock | 228 ++++++++++++++++----------------- 11 files changed, 156 insertions(+), 136 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c6c8b36 --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4ce3ac5..3a75779 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -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 @@ -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 diff --git a/.ocamlformat b/.ocamlformat index bf05ea6..cc431b3 100644 --- a/.ocamlformat +++ b/.ocamlformat @@ -1,4 +1,4 @@ -version=0.23.0 +version=0.26.1 profile=conventional break-infix=fit-or-vertical parse-docstrings=true diff --git a/bin/dune b/bin/dune index 1e02f2b..5f63d14 100644 --- a/bin/dune +++ b/bin/dune @@ -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))) diff --git a/bin/main.ml b/bin/main.ml index e546b1e..db5004e 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -1,3 +1,11 @@ +open Ts2ocaml open Example -let () = print_endline @@ Pretty_bytes.prettyBytes ~number:128000000.0 () +let () = + let options = + Pretty_bytes.PrettyBytes.Options.create ~signed:false ~bits:false + ~binary:false + ~locale:(Primitive.inject (`String "en")) + ~minimumFractionDigits:1.0 ~maximumFractionDigits:2.0 () + in + print_endline @@ Pretty_bytes.prettyBytes ~number:128000000.0 ~options () diff --git a/dune-project b/dune-project index 5dfabbd..d018994 100644 --- a/dune-project +++ b/dune-project @@ -1,4 +1,4 @@ -(lang dune 3.3) +(lang dune 3.11) (name example) @@ -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))) diff --git a/example.opam b/example.opam index 21d0adc..3cbb4d5 100644 --- a/example.opam +++ b/example.opam @@ -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: [ @@ -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" ] ] diff --git a/example.opam.template b/example.opam.template index eb0daa0..2116090 100644 --- a/example.opam.template +++ b/example.opam.template @@ -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" ] ] diff --git a/lib/dune b/lib/dune index 981af48..33825d9 100644 --- a/lib/dune +++ b/lib/dune @@ -1,7 +1,7 @@ (library (name example) (public_name example) - (libraries ts2ocaml-jsoo-stdlib ojs)) + (libraries ts2ocaml-jsoo-stdlib)) (rule (targets pretty_bytes.ml) diff --git a/package.json b/package.json index 20e45b9..8f81e8c 100644 --- a/package.json +++ b/package.json @@ -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": "yarn@4.0.1+sha256.5a9d054e67fbbae8774cd3667736fd74407ffbbb336898523ca1fe87b3fc4ee3" } diff --git a/yarn.lock b/yarn.lock index 251ee05..eab5936 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,170 +5,170 @@ __metadata: version: 8 cacheKey: 10c0 -"@esbuild/android-arm64@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/android-arm64@npm:0.17.5" +"@esbuild/android-arm64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/android-arm64@npm:0.19.5" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@esbuild/android-arm@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/android-arm@npm:0.17.5" +"@esbuild/android-arm@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/android-arm@npm:0.19.5" conditions: os=android & cpu=arm languageName: node linkType: hard -"@esbuild/android-x64@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/android-x64@npm:0.17.5" +"@esbuild/android-x64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/android-x64@npm:0.19.5" conditions: os=android & cpu=x64 languageName: node linkType: hard -"@esbuild/darwin-arm64@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/darwin-arm64@npm:0.17.5" +"@esbuild/darwin-arm64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/darwin-arm64@npm:0.19.5" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@esbuild/darwin-x64@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/darwin-x64@npm:0.17.5" +"@esbuild/darwin-x64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/darwin-x64@npm:0.19.5" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@esbuild/freebsd-arm64@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/freebsd-arm64@npm:0.17.5" +"@esbuild/freebsd-arm64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/freebsd-arm64@npm:0.19.5" conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@esbuild/freebsd-x64@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/freebsd-x64@npm:0.17.5" +"@esbuild/freebsd-x64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/freebsd-x64@npm:0.19.5" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@esbuild/linux-arm64@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/linux-arm64@npm:0.17.5" +"@esbuild/linux-arm64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-arm64@npm:0.19.5" conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"@esbuild/linux-arm@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/linux-arm@npm:0.17.5" +"@esbuild/linux-arm@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-arm@npm:0.19.5" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@esbuild/linux-ia32@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/linux-ia32@npm:0.17.5" +"@esbuild/linux-ia32@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-ia32@npm:0.19.5" conditions: os=linux & cpu=ia32 languageName: node linkType: hard -"@esbuild/linux-loong64@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/linux-loong64@npm:0.17.5" +"@esbuild/linux-loong64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-loong64@npm:0.19.5" conditions: os=linux & cpu=loong64 languageName: node linkType: hard -"@esbuild/linux-mips64el@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/linux-mips64el@npm:0.17.5" +"@esbuild/linux-mips64el@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-mips64el@npm:0.19.5" conditions: os=linux & cpu=mips64el languageName: node linkType: hard -"@esbuild/linux-ppc64@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/linux-ppc64@npm:0.17.5" +"@esbuild/linux-ppc64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-ppc64@npm:0.19.5" conditions: os=linux & cpu=ppc64 languageName: node linkType: hard -"@esbuild/linux-riscv64@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/linux-riscv64@npm:0.17.5" +"@esbuild/linux-riscv64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-riscv64@npm:0.19.5" conditions: os=linux & cpu=riscv64 languageName: node linkType: hard -"@esbuild/linux-s390x@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/linux-s390x@npm:0.17.5" +"@esbuild/linux-s390x@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-s390x@npm:0.19.5" conditions: os=linux & cpu=s390x languageName: node linkType: hard -"@esbuild/linux-x64@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/linux-x64@npm:0.17.5" +"@esbuild/linux-x64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/linux-x64@npm:0.19.5" conditions: os=linux & cpu=x64 languageName: node linkType: hard -"@esbuild/netbsd-x64@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/netbsd-x64@npm:0.17.5" +"@esbuild/netbsd-x64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/netbsd-x64@npm:0.19.5" conditions: os=netbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/openbsd-x64@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/openbsd-x64@npm:0.17.5" +"@esbuild/openbsd-x64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/openbsd-x64@npm:0.19.5" conditions: os=openbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/sunos-x64@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/sunos-x64@npm:0.17.5" +"@esbuild/sunos-x64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/sunos-x64@npm:0.19.5" conditions: os=sunos & cpu=x64 languageName: node linkType: hard -"@esbuild/win32-arm64@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/win32-arm64@npm:0.17.5" +"@esbuild/win32-arm64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/win32-arm64@npm:0.19.5" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@esbuild/win32-ia32@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/win32-ia32@npm:0.17.5" +"@esbuild/win32-ia32@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/win32-ia32@npm:0.19.5" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@esbuild/win32-x64@npm:0.17.5": - version: 0.17.5 - resolution: "@esbuild/win32-x64@npm:0.17.5" +"@esbuild/win32-x64@npm:0.19.5": + version: 0.19.5 + resolution: "@esbuild/win32-x64@npm:0.19.5" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@ocsigen/ts2ocaml@npm:1.4.4": - version: 1.4.4 - resolution: "@ocsigen/ts2ocaml@npm:1.4.4" +"@ocsigen/ts2ocaml@npm:1.4.6": + version: 1.4.6 + resolution: "@ocsigen/ts2ocaml@npm:1.4.6" dependencies: browser-or-node: "npm:^2.0.0" typescript: "npm:4.6.4" - yargs: "npm:17.4.1" + yargs: "npm:17.7.1" bin: ts2ocaml: dist/ts2ocaml.js - checksum: 511520b4bbcd497e2fa3831e341df2b937c9ca266e4bdf764d9a04859c0aa320248df7e974ad5bba576dc3a541d4e5e28afb41f383c4be11ab00fd7d120e0ec0 + checksum: 6ecff01f0bec53f656517fe54ff50f4b903224846a743e8034c684af7ce1400e0c14bbc0b9e8aa399c6a2941c496f1d95504f1e8435c7d46c74dfbde893b189d languageName: node linkType: hard @@ -189,20 +189,20 @@ __metadata: linkType: hard "browser-or-node@npm:^2.0.0": - version: 2.0.0 - resolution: "browser-or-node@npm:2.0.0" - checksum: 1cd6f562b0fcfea2b6b7c127118e69b95d1275d25c5f717482e0560e9d646b151a79d0e8472c2cc1389cdde51c112686dc13bf1b333ac48decd4b171110e6c18 + version: 2.1.1 + resolution: "browser-or-node@npm:2.1.1" + checksum: f727639581182f831b5bf4686b401dcad5cc29b5a6b70059c0aa90990844b8f15f3a1d328cc8e83dd3b4bfa69175f9bdf2f4383faec14d47205bfea532b9964d languageName: node linkType: hard -"cliui@npm:^7.0.2": - version: 7.0.4 - resolution: "cliui@npm:7.0.4" +"cliui@npm:^8.0.1": + version: 8.0.1 + resolution: "cliui@npm:8.0.1" dependencies: string-width: "npm:^4.2.0" - strip-ansi: "npm:^6.0.0" + strip-ansi: "npm:^6.0.1" wrap-ansi: "npm:^7.0.0" - checksum: 6035f5daf7383470cef82b3d3db00bec70afb3423538c50394386ffbbab135e26c3689c41791f911fa71b62d13d3863c712fdd70f0fbdffd938a1e6fd09aac00 + checksum: 4bda0f09c340cbb6dfdc1ed508b3ca080f12992c18d68c6be4d9cf51756033d5266e61ec57529e610dacbf4da1c634423b0c1b11037709cc6b09045cbd815df5 languageName: node linkType: hard @@ -229,32 +229,32 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:0.17.5": - version: 0.17.5 - resolution: "esbuild@npm:0.17.5" +"esbuild@npm:0.19.5": + version: 0.19.5 + resolution: "esbuild@npm:0.19.5" dependencies: - "@esbuild/android-arm": "npm:0.17.5" - "@esbuild/android-arm64": "npm:0.17.5" - "@esbuild/android-x64": "npm:0.17.5" - "@esbuild/darwin-arm64": "npm:0.17.5" - "@esbuild/darwin-x64": "npm:0.17.5" - "@esbuild/freebsd-arm64": "npm:0.17.5" - "@esbuild/freebsd-x64": "npm:0.17.5" - "@esbuild/linux-arm": "npm:0.17.5" - "@esbuild/linux-arm64": "npm:0.17.5" - "@esbuild/linux-ia32": "npm:0.17.5" - "@esbuild/linux-loong64": "npm:0.17.5" - "@esbuild/linux-mips64el": "npm:0.17.5" - "@esbuild/linux-ppc64": "npm:0.17.5" - "@esbuild/linux-riscv64": "npm:0.17.5" - "@esbuild/linux-s390x": "npm:0.17.5" - "@esbuild/linux-x64": "npm:0.17.5" - "@esbuild/netbsd-x64": "npm:0.17.5" - "@esbuild/openbsd-x64": "npm:0.17.5" - "@esbuild/sunos-x64": "npm:0.17.5" - "@esbuild/win32-arm64": "npm:0.17.5" - "@esbuild/win32-ia32": "npm:0.17.5" - "@esbuild/win32-x64": "npm:0.17.5" + "@esbuild/android-arm": "npm:0.19.5" + "@esbuild/android-arm64": "npm:0.19.5" + "@esbuild/android-x64": "npm:0.19.5" + "@esbuild/darwin-arm64": "npm:0.19.5" + "@esbuild/darwin-x64": "npm:0.19.5" + "@esbuild/freebsd-arm64": "npm:0.19.5" + "@esbuild/freebsd-x64": "npm:0.19.5" + "@esbuild/linux-arm": "npm:0.19.5" + "@esbuild/linux-arm64": "npm:0.19.5" + "@esbuild/linux-ia32": "npm:0.19.5" + "@esbuild/linux-loong64": "npm:0.19.5" + "@esbuild/linux-mips64el": "npm:0.19.5" + "@esbuild/linux-ppc64": "npm:0.19.5" + "@esbuild/linux-riscv64": "npm:0.19.5" + "@esbuild/linux-s390x": "npm:0.19.5" + "@esbuild/linux-x64": "npm:0.19.5" + "@esbuild/netbsd-x64": "npm:0.19.5" + "@esbuild/openbsd-x64": "npm:0.19.5" + "@esbuild/sunos-x64": "npm:0.19.5" + "@esbuild/win32-arm64": "npm:0.19.5" + "@esbuild/win32-ia32": "npm:0.19.5" + "@esbuild/win32-x64": "npm:0.19.5" dependenciesMeta: "@esbuild/android-arm": optional: true @@ -302,7 +302,7 @@ __metadata: optional: true bin: esbuild: bin/esbuild - checksum: 9b0f52316d2b47cd39a41a5e32b773166a3ff5ae31b122ce69f1611044c6d07d12f7c7a6b67ed35322fea8383249854139b5a22387cddaaccb2d42576f4c77de + checksum: 401e6da33bf6f2c4bbfa0aa8f37ddc6eb41c9d8ddf6b32c9922aabeef3f1886ed792eb03e778859e7e61467c765c78245f88216bc1a59050413ce7a513dd675f languageName: node linkType: hard @@ -317,8 +317,8 @@ __metadata: version: 0.0.0-use.local resolution: "example@workspace:." dependencies: - "@ocsigen/ts2ocaml": "npm:1.4.4" - esbuild: "npm:0.17.5" + "@ocsigen/ts2ocaml": "npm:1.4.6" + esbuild: "npm:0.19.5" pretty-bytes: "npm:5.6.0" languageName: unknown linkType: soft @@ -409,24 +409,24 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:^21.0.0": +"yargs-parser@npm:^21.1.1": version: 21.1.1 resolution: "yargs-parser@npm:21.1.1" checksum: f84b5e48169479d2f402239c59f084cfd1c3acc197a05c59b98bab067452e6b3ea46d4dd8ba2985ba7b3d32a343d77df0debd6b343e5dae3da2aab2cdf5886b2 languageName: node linkType: hard -"yargs@npm:17.4.1": - version: 17.4.1 - resolution: "yargs@npm:17.4.1" +"yargs@npm:17.7.1": + version: 17.7.1 + resolution: "yargs@npm:17.7.1" dependencies: - cliui: "npm:^7.0.2" + cliui: "npm:^8.0.1" escalade: "npm:^3.1.1" get-caller-file: "npm:^2.0.5" require-directory: "npm:^2.1.1" string-width: "npm:^4.2.3" y18n: "npm:^5.0.5" - yargs-parser: "npm:^21.0.0" - checksum: 0a96b9e6310014d333b8b0486e14f86a1e6a9a91763537ab27768df8ea48c0887b1b332ece1629e57d788770f95e096254b1f846004ad5cfc066b03d781e59ae + yargs-parser: "npm:^21.1.1" + checksum: 0ed3b7694d94da777f3591f1d786d947ed2e59b897da0a0c30e541109ae087979ac26b4ec39557f5e9c4592f19806447963fb132049b9806a1d416bcdd24d2b4 languageName: node linkType: hard