f-o-a-m / kepler

A Haskell framework that facilitates writing ABCI applications
https://kepler.dev
Apache License 2.0
34 stars 10 forks source link

Include an external project setup snippet in readme #202

Closed IvantheTricourne closed 4 years ago

IvantheTricourne commented 4 years ago

We should consider including a "how to make your own hs-abci project" walkthrough. This is separate and different from the existing nameservice tutorial. This should be more general and allow people to understand how to setup their own abci apps outside (unlike nameservice) of this repo:

  1. What is the proper way import this repo (i.e., the proper way to use this repo as a library)?
  2. Should external projects import individual libraries in this repo (i.e., hs-abci-sdk, hs-abci-server, hs-abci-types)?
IvantheTricourne commented 4 years ago

This was quite useful: https://github.com/commercialhaskell/stack/blob/master/doc/yaml_configuration.md#packages

IvantheTricourne commented 4 years ago

In an external project, I've done this with the following in a stack.yaml file:

extra-deps:
  - git: https://github.com/f-o-a-m/hs-abci/
    commit: 3b13a569bcc77dcdec154552175f69bf4ea8b8ca
    subdirs:
      - hs-abci-extra
      - hs-abci-sdk
      - hs-abci-server
      - hs-abci-test-utils
      - hs-abci-types
      - hs-tendermint-client
IvantheTricourne commented 4 years ago

The snippet should also list some necessary/recommended extra-deps and default-extensions to make this process easier. Alternatively, it could also point to appropriate docs to do so (e.g. polysemy, proto-lens, etc.).

IvantheTricourne commented 4 years ago

Not sure how useful this one is going to end up being for the reasons:

  1. Stack already supports importing subdirs (albeit not very well documented)
  2. This project will eventually get released and thus (1) is not a big issue.
kejace commented 4 years ago

You could also make a stack new <template>: https://github.com/commercialhaskell/stack/pull/4103