feat: aztec new supporting multiple contract crates#21007
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
e2d10dd to
ed7ab74
Compare
ed7ab74 to
b580bee
Compare
d00e24e to
13ee959
Compare
nchamo
left a comment
There was a problem hiding this comment.
Great work, just left a few comments
| name_arg="$2" | ||
| shift 2 | ||
| ;; | ||
| *) |
There was a problem hiding this comment.
Correct me if I'm wrong because bash is not my strong suit, but wouldn't this cause
aztec new counter --name foo to use the name "foo" for the contract?
Should we fail for now unknown params?
There was a problem hiding this comment.
I don't follow. --name has been dropped so it's now irrelevant
The command creates a contract crate called foo_contract in workspace foo.
There was a problem hiding this comment.
I meant that since we were allowing unknown commands, only the last word would be considered the project name. Reading it back, I wasn't clear at all
BEGIN_COMMIT_OVERRIDE chore: remove prefund env var in non local networks (#21095) feat: aztec new supporting multiple contract crates (#21007) feat!: Expose offchain effects when simulating/sending txs (#20563) chore: exclude auto-generated dirs from VS Code search (#20881) feat: improve oracle name prefixes (#21101) fix(pxe): correct contract class log DA gas metering from +2 to +1 (#21102) chore: remove stale aes comments (#21133) chore: add warning on invalid recipients (#21134) feat: mask ciphertext fields with Poseidon2-derived values (#21009) END_COMMIT_OVERRIDE
## Summary Backports 6 PRs with aztec CLI improvements from `next` to `v4-next`: - #20681 - refactor: aztec new and init creating 2 crates - #20711 - test: aztec new scaffold works - #20723 - feat(cli): warning if contract crate has tests - #20729 - feat(cli): auto-recompiling when aztec test is run - #21007 - feat: aztec new supporting multiple contract crates - #21245 - feat: asserts that aztec dep version matches cli
|
Backported to v4-next in #22587 |
BEGIN_COMMIT_OVERRIDE fix(pxe): cap event filter toBlock to last synced block (#22573) fix(pxe): round tx expiration timestamp to reduce precision (#22577) fix: eliminate anvil watcher warp race and false success logs (#22584) refactor: aztec new and init creating 2 crates (#20681) test: aztec new scaffold works (#20711) feat(cli): warning if contract crate has tests (#20723) feat(cli): auto-recompiling when aztec test is run (#20729) feat: aztec new supporting multiple contract crates (#21007) feat: asserts that aztec dep version matches cli (#21245) chore: backport aztec CLI improvements to v4-next (#22587) feat: check noir release has nargo binaries before releasing (#22551) chore: cache chainInfo in embeddedwallet (#22592) fix: wrap external getCapsule in transactionAsync (#22595) fix(pxe): throw clear error for invalid comparator in pick_notes (#22585) refactor(aztec-nr): rename conversion fns to encode_/decode_ naming (#22576) feat: infrastructure for testing `[new_contract_artfiacts, old_aztec_stack]` (#22593) chore: fix unnecessary and inconsistent side-effect counter increments (#22245) fix: update FaceID wallet redirects and strip anchors in redirect validation (#22505) docs: add getting started on testnet guide (#22366) docs: add getting started on testnet guide (backport #22366) (#22619) feat(aztec-nr): new BoundedVec emit private log APIs (#22064) END_COMMIT_OVERRIDE


Summary
aztec newpreviously created a workspace with fixed crate directories namedcontract/andtest/. This made it impossible to add a second contract to the same workspace, since the directory names would collide.This PR restructures the scaffold so that:
aztec new countercreatescounter_contract/andcounter_test/instead ofcontract/andtest/.aztec newsupports adding contracts to an existing workspace: when run inside a directory that already has aNargo.tomlwith[workspace], it adds a new contract+test crate pair and appends the members to the workspace manifest.add_crate.shscript: extracted the crate-creation logic fromsetup_workspace.shinto a reusableadd_crate.shso it can be called both during initial setup and when adding subsequent contracts.setup_workspace.shsimplified: now just creates the workspace rootNargo.tomlwith empty members and delegates toadd_crate.sh.counter_contractdirectory undernoir-projects/noir-contracts/contracts/test/is restructured fromcounter_contract/{contract,test}tocounter/{counter_contract,counter_test}to match the new naming convention.generate-types.shfor bothnoir-contracts.jsandnoir-test-contracts.jsare adjusted to handle the new deeper directory nesting.Test plan
aztec-up/test/default_scaffold.sh— verifies creating a new workspace and adding a second contractaztec-up/test/counter_contract.sh— verifies the counter contract compiles and codegens with the new directory layoutNargo.toml)🤖 Generated with Claude Code
Closes https://linear.app/aztec-labs/issue/F-373/make-aztec-newinit-handle-multiple-contract-crates-within-one