Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
327 stars 207 forks source link

contract / core-eval builder filename convention #10490

Open dckc opened 1 week ago

dckc commented 1 week ago

What is the Problem Being Solved?

We have dozens of builder scripts that use writeCoreEval and get invoked as agoric run SCRIPT. They're pretty formulaic... we might even be able to apply helpful lint rules like we have for *.flows.js. A filename convention for that would help.

The closest thing we have to a convention currently is init-*.js, but they do more building than initializing.

inventory of builder script filename prefixes ```console $ cd agoric-sdk/packages/builders/scripts $ grep -rl writeCore . | xargs -I {} basename {} | sed -E 's/^([a-z]+).*$/\1/' | sort | uniq -c 5 add 1 append 3 build 1 fix 12 init 1 invite 1 price 1 probe 5 replace 5 restart 1 revive 5 start 2 test 1 tweak 6 update 7 upgrade 1 write ```

Description of the Design

*.contract.js is an emerging trend. *.start.js for core-eval has some appeal.

Perhaps *.build.js for this?

Security / Scaling / Upgrade Considerations

not much. Might help a bit with upgrade code consistency.

Test Plan

Existing tests should suffice, though there's a risk of filename references that aren't tested and aren't detected by static analysis.