liquidsoap-prettier 1.5.3 → 1.5.4
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/README.md +23 -0
- package/dist/liquidsoap.cjs +49020 -3987
- package/dist/web.mjs +1 -1
- package/package.json +7 -2
- package/scripts/download-parser.js +46 -0
- package/src/cli.js +23 -11
package/README.md
CHANGED
|
@@ -17,6 +17,13 @@ It works as follows:
|
|
|
17
17
|
$ liquidsoap-prettier [-w|--write] path/to/file.liq "path/with/glob/pattern/**/*.liq"
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
You can also simply check the script without formatting it:
|
|
21
|
+
```shell
|
|
22
|
+
$ liquidsoap-prettier [-c|--check] path/to/file.liq "path/with/glob/pattern/**/*.liq"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The program returns with exit code `0` when the script is already pretty-printed and `2` otherwise.
|
|
26
|
+
|
|
20
27
|
### Prettier plugin
|
|
21
28
|
|
|
22
29
|
The package also provides a prettier plugin which can be used to add liquidsoap script parsing to
|
|
@@ -36,3 +43,19 @@ Then add the plugin to your Prettier config:
|
|
|
36
43
|
"plugins": ["liquidsoap-prettier"]
|
|
37
44
|
}
|
|
38
45
|
```
|
|
46
|
+
|
|
47
|
+
## Developer doc
|
|
48
|
+
|
|
49
|
+
The code is built using the `prettier` API and a JSON parser exported via `js_of_ocaml` from
|
|
50
|
+
the liquidsoap code.
|
|
51
|
+
|
|
52
|
+
The JSON parser builtin from liquidsoap code is not commited to this repository. You can download
|
|
53
|
+
it using the `dev:prepare` npm script. For instance:
|
|
54
|
+
|
|
55
|
+
```shell
|
|
56
|
+
npm run dev:prepare
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
If you are working on some changes on the liquidsoap language and want to update the parser file, you need
|
|
60
|
+
to install a pinned version of your changes from the liquidsoap code repository using `opam` and then run
|
|
61
|
+
`dune build` inside this repository. This should rebuild the parser file using your latest changes.
|