dmmulroy / create-melange-app

The fastest, friendliest, and most delightful way to get started with OCaml, ReasonML, and Melange, geared towards JavaScript and TypeScript developers
118 stars 20 forks source link

[ocaml-install]: Create `Add_dependency` "Process" module in `dune.ml` #69

Open dmmulroy opened 8 months ago

dmmulroy commented 8 months ago

Parent: #61

In order to install a new dependency we need to be able to append the depends stanza in our users dune-project file. We will need to create a new module called Add_dependency to the src/core/dune.ml module under the nested Dune_project module.

I'm not sure the best way to parse/update the file, so I'm open to really any implementation at the moment. You might find some useful code in the dune repo itself for how they parse dune/sexp files.

The exec function should accept an input something like { file_path: string; dependency: Dependency.t } where file_path is the path to thedune-project file.

dmmulroy commented 8 months ago

Just gonna drop this here :)

https://github.com/dmmulroy/s-tier