liquidsoap-prettier 1.4.5 → 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "liquidsoap-prettier",
3
- "version": "1.4.5",
3
+ "version": "1.4.7",
4
4
  "description": "Liquidsoap language prettier CLI and plugin",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/dune CHANGED
@@ -5,4 +5,7 @@
5
5
  (modules regexp_js liquidsoap_js)
6
6
  (preprocess
7
7
  (pps js_of_ocaml-ppx))
8
+ (js_of_ocaml
9
+ (flags --target-env=browser)
10
+ (build_runtime_flags --target-env=browser))
8
11
  (libraries js_of_ocaml liquidsoap-lang liquidsoap-lang.tooling))
@@ -1,12 +1,19 @@
1
1
  open Js_of_ocaml
2
2
  open Liquidsoap_lang
3
3
 
4
- let () =
5
- Hooks.regexp := Regexp_js.make
4
+ let () = Hooks.regexp := Regexp_js.make
6
5
 
7
6
  let parse content =
8
7
  let content = Js.to_string content in
9
- let json = Liquidsoap_tooling.Parsed_json.parse_string content in
8
+ let json =
9
+ let buf = Buffer.create 0 in
10
+ let formatter = Format.formatter_of_buffer buf in
11
+ try Liquidsoap_tooling.Parsed_json.parse_string ~formatter content
12
+ with _ ->
13
+ Js_error.raise_
14
+ (Js_error.of_error
15
+ (new%js Js.error_constr (Js.string (Buffer.contents buf))))
16
+ in
10
17
  Js._JSON##parse
11
18
  (Js.string (Liquidsoap_lang.Json.to_string ~compact:true json))
12
19
 
package/webpack.web.cjs CHANGED
@@ -1,9 +1,6 @@
1
1
  module.exports = {
2
2
  entry: "./src/index.js",
3
3
  mode: "production",
4
- resolve: {
5
- fallback: { child_process: false, constants: false, fs: false, tty: false },
6
- },
7
4
  experiments: {
8
5
  outputModule: true,
9
6
  },