when performing common tasks with the anchor CLI (like building a program), it would improve devex if the cli support pre and post commands. this idea already exists in the npm world (see npm docs here)
recommend support generic pre and post prefixes on any of the Anchor.toml scripts to enable devs to not have to manually run additional commands after completion of various tasks: they can be run automatically
example use case generate a Codama client:
- Anchor.toml has a
prebuild script declared that runs the Codama CLI to generate the JS/Rust client
- a dev runs
anchor build:
- the anchor cli should checks for
prebuild => if found, run it
- the anchor cli executes the normal
build logic
- the anchor cli should checks for
postbuild => if found, run it
when performing common tasks with the anchor CLI (like building a program), it would improve devex if the cli support
preandpostcommands. this idea already exists in the npm world (see npm docs here)recommend support generic
preandpostprefixes on any of the Anchor.tomlscriptsto enable devs to not have to manually run additional commands after completion of various tasks: they can be run automaticallyexample use case generate a Codama client:
prebuildscript declared that runs the Codama CLI to generate the JS/Rust clientanchor build:prebuild=> if found, run itbuildlogicpostbuild=> if found, run it