diff --git a/template/ppx/template/CONTRIBUTING.md b/template/ppx/template/CONTRIBUTING.md new file mode 100644 index 0000000..9291d14 --- /dev/null +++ b/template/ppx/template/CONTRIBUTING.md @@ -0,0 +1,79 @@ +# Contributing + +## Setup your development environment + +You need Opam, you can install it by following [Opam's documentation](https://opam.ocaml.org/doc/Install.html). + +With Opam installed, you can install the dependencies in a new local switch with: + +```bash +make switch +``` + +Or globally, with: + +```bash +make deps +``` + +Then, build the project with: + +```bash +make build +``` + +### Running the PPX + +After building the project, you can run the main binary on an OCaml source file to see what the PPX is doing. + +```bash +opam exec -- dune exec bin/main.exe test/{{ project_snake }}_test.ml +``` + +### Running Tests + +You can run the test compiled executable: + +```bash +make test +``` + +### Building documentation + +Documentation for the libraries in the project can be generated with: + +```bash +make doc +make servedoc +``` + +### Repository Structure + +The following snippet describes {{ project_name }}'s repository structure. + +```text +. +├── bin/ +| Source for {{ project_slug }}'s binaries. This links to the rewriter defined in `lib/`. +│ +├── lib/ +| Source for {{ project_name }}'s library. Contains {{ project_name }}'s rewriting functionalities. +│ +├── test/ +| Unit tests and integration tests for {{ project_name }}. +│ +├── dune-project +| Dune file used to mark the root of the project and define project-wide parameters. +| For the documentation of the syntax, see https://dune.readthedocs.io/en/stable/dune-files.html#dune-project +│ +├── LICENSE +│ +├── Makefile +| Make file containing common development command. +│ +├── README.md +│ +└── {{ project_slug }}.opam + Opam package definition. + To know more about creating and publishing opam packages, see https://opam.ocaml.org/doc/Packaging.html. +``` diff --git a/template/ppx/template/bin/dune b/template/ppx/template/bin/dune index b6ad8c1..370410f 100644 --- a/template/ppx/template/bin/dune +++ b/template/ppx/template/bin/dune @@ -1,4 +1,3 @@ (executable (name main) - (public_name {{ project_slug }}) - (libraries {{ project_snake }} cmdliner fmt fmt.tty logs.fmt logs.cli)) + (libraries {{ project_snake }})) diff --git a/template/ppx/template/bin/main.ml b/template/ppx/template/bin/main.ml index 571a8d4..997bf20 100644 --- a/template/ppx/template/bin/main.ml +++ b/template/ppx/template/bin/main.ml @@ -1,3 +1,3 @@ open Ppxlib -let _ = Driver.run_as_ppx_rewriter () +let _ = Driver.standalone ()