Restructure create-comit-app towards multiple examples and integrate hello-swap #66
Description
Note: This is the outcome of the discussion with @bonomat and @thomaseizinger 04.10.2019.
Problem
Having multiple repositories as starting point is difficult to understand.
Goals
- Have one repository.
- Be able to have multiple examples.
- The examples are not there to be changed (to build on) but just to take a look at.
Proposal
Idea
The idea is to integrate all examples into cca so there is only one go-to project as starting point. There will be multiple ones. The examples should be functionally driven (e.g. eth-btc, erc20-btc, ...).
When creating a new comit-app you get a template and all examples to look at. The examples can be run through create-comit-app. The examples are not meant as templates to build an application on, but help to understand functional parts.
For a workshop it has to be able to write a new examples (basically re-create one of the simple ones in the example folder) within 30 minutes. We can measure how good the sdk is by that measure.
Folder structure
cca
|- src (1)
|- new_project
--|- index.ts (2)
|- package.json (3)
|- examples
--|- eth-btc (4)
--|- src
|- ...
(1) cca rust code
(2) start point for creating a comit-app, an "empty template"
(3) presets all dependencies (comit-js-sdk ...)
(4) contains one self-contained examples, in the future we can create more packages to share between examples (like e.g. wallets)
Commands
new
run app
run example [example_name]
To be discussed:
start-env
still separate?