clarinet icon indicating copy to clipboard operation
clarinet copied to clipboard

Add support for optional templates

Open moodmosaic opened this issue 3 years ago • 2 comments
trafficstars

Users should be able to (optionally) specify a template when scaffolding a new clarinet project.

Current usage of clarinet new is

clarinet new [OPTIONS] <NAME>

OPTIONS:
        --disable-telemetry    Do not provide developer usage telemetry for this project
    -h, --help                 Print help information

ARGS:
    <NAME>                     Project's name

Perhaps a template name could be specified in the options, e.g.:

clarinet new empty     # empty contract with clarinet test skeleton (current/default)
clarinet new react     # react frontend with some basic contract 
clarinet new fastcheck # basic contract with property-based tests
...

It should be possible for a user to list all templates via

clarinet new --list

It should be possible for a user to list all templates on web2/web3 via

clarinet new web --search

moodmosaic avatar May 05 '22 14:05 moodmosaic

I like this! I've been thinking about the idea of having some sort of curated, open repository of patterns / recipes, where developers could get some templates for things like bitcoin bridging patterns or other.

lgalabru avatar May 05 '22 16:05 lgalabru

Exactly, and templates with contract testing patterns like this, this, and this, to help detect unexpected bugs. Encoding contract invariants with the help of such templates can be a decent pre-auditing phase.

moodmosaic avatar May 05 '22 17:05 moodmosaic