zkapp-cli
zkapp-cli copied to clipboard
Move examples to snarkyjs repo and pull from there instead of zkapp-cli
We should be able to construct a URL for getting snarkyjs at the git tag that corresponds to the npm version number in the template that zkapp-cli pulls from github:o1-labs/zkapp-cli#main.
That would give us examples which should definitely work with that snarkyjs version
TBD: What's the value of pulling the examples from a URL? If the idea is that an old zkapp cli can still create up to date project templates -- which is awesome! -- then in commands like zk deploy we should only use the snarkyjs from the user's directory, not one from the installed zkapp-cli, otherwise we'll be incompatible.
We only have to keep the deploy API of snarkyjs stable, so that an old zkapp-cli still does the right thing.
If the idea is that an old zkapp cli can still create up to date project templates -- which is awesome! ...
Yep! That's the reason for fetching project templates. They'll always be the latest, unless the dev is offline, then a cached version is used.
And for the example source files, the reason to fetch those was two fold: 1.) early on, the aspirational intention was for for tutorials to be added/updated at a quick pace and we wanted them to all be available to all devs at all times, and avoid the bad experience of a dev using an older version of the CLI and encountering a "whaaat this example command in the docs doesn't work for me" experience, if we had used local examples. And 2.) to avoid a situation where a dev thinks they have example A, but we actually changed the API and updated example A to something newer on Github.
But at this point, open to changes!
Reviewing with Yoni. We don't think the benefits outweigh the costs and want to close to clean up repo for now