Starting a weekend in purescript

Hi all,

I am still learning, this could be a silly question.
I would like to develop this kind of project:

  • A command line application
  • A web ui
  • Some shared logic (the core funcionality)

I would like to know if I can have a single repository creating 2 different bundles (the CLI and the web ui).

Kind Regards

1 Like

Yes you can do this - you can for example have multiple .dhall files with shared “src” folders to reuse models.
I don’t know if there is some direct example of this out there but if you look for projects with a separate “test” source-folder and test-project you will see how to setup this.

Basically you set up .dhall files that include a common one (the Dhall language allows for that) and then compile with spago -x target.dhall ./path-to/main.purs ...

EDIT: here is a small section in the spago-documentation that explains a bit more about this situation with an example of such a .dhall importing another one (for common dependencies) - technically you only need to include the source-files though.

1 Like

If you are familiar with nix, we were discussing just this in another thread.

I am not.
I’ll read the post anyway. Maybe I can get some ideas.

Thank you