-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: move forge build + abi + abi-ts to out #1483
Conversation
🦋 Changeset detectedLatest commit: bd04598 The changes in this PR will be included in the next version bump. This PR includes changesets to release 28 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
good point, should be in world! |
**/abi/**/*.json linguist-generated=true | ||
**/abi/**/*.json.d.ts linguist-generated=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we suppress out
diffs now then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh i see abis are no longer checked in to git
@@ -5,11 +5,11 @@ | |||
"license": "MIT", | |||
"scripts": { | |||
"build": "pnpm run build:mud && pnpm run build:abi && pnpm run build:abi-ts", | |||
"build:abi": "forge build --extra-output-files abi --out abi --skip test script MudTest.sol", | |||
"build:abi-ts": "mud abi-ts --input 'abi/IWorld.sol/IWorld.abi.json' && prettier --write '**/*.abi.json.d.ts'", | |||
"build:abi": "forge build --skip test script", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we not need the --extra-output-files abi
anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh i see it's in the forge config now
@@ -2,10 +2,10 @@ | |||
pragma solidity >=0.8.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just realized this and other tests here are still using 0.8.0
, should we update to 0.8.21
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we haven't merged the solc stuff yet (pending changeset and some more testing)
Co-authored-by: alvarius <[email protected]>
Co-authored-by: alvarius <[email protected]>
forge
has a defaultout
directory for build artifacts. When youforge build
orforge test
, everything gets built and written to this directory, including tests and scripts.For the purposes of a clean ABI directory with matching TS types, I thought I would try to side step this by separately writing
forge build
output to anabi
dir (via--out abi
) that would also skip script (.s.sol
) and test (.t.sol
) files (via--skip script test
).This ended up working against us in our current CLI approach, where deploys need the systems ABI artifacts to generate an
IWorld
interface, and uses the configured forge output dir (viaforge config
) to get it. So we either had to build to both places (out
andabi
) or build to justabi
but then be missing systems ABIs because they may not have been built toout
, where forge is configured. And we can't update thefoundry.toml
toout = abi
because that would causeforge test
to put its artifacts there too.We could work around this by updating our deploy pipeline to be configurable with a forge output dir (and fall back to
forge config
->out
), but then we'd still haveforge build --out abi --extra-files abi ...
commands littered around and that felt gross too.So I've gone the simpler route for now and just default everything to
forge build
(with skips for tests/scripts when we're just deploying or building for ABI artifacts) and make sure to include the proper ABI files we need in our npm package artifacts.This also moves
src/MudTest.sol
totest/MudTest.t.sol
so it's included in--skip test
and we don't have to manually skip it. Since this isn't used in store package and has a reference to a world, should we move this to the world package instead?