-
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
Changes from all commits
ecb5fdb
66bd5ae
de88352
c7deec1
2531380
b774925
36f7fce
4a33fee
590d14d
fae4f95
6850d86
bd04598
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
"@latticexyz/store": major | ||
"@latticexyz/world": major | ||
--- | ||
|
||
Store and World contract ABIs are now exported from the `out` directory. You'll need to update your imports like: | ||
|
||
```diff | ||
- import IBaseWorldAbi from "@latticexyz/world/abi/IBaseWorld.sol/IBaseWorldAbi.json"; | ||
+ import IBaseWorldAbi from "@latticexyz/world/out/IBaseWorld.sol/IBaseWorldAbi.json"; | ||
``` | ||
|
||
`MudTest.sol` was also moved to the World package. You can update your import like: | ||
|
||
```diff | ||
- import { MudTest } from "@latticexyz/store/src/MudTest.sol"; | ||
+ import { MudTest } from "@latticexyz/world/test/MudTest.t.sol"; | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
"create-mud": minor | ||
--- | ||
|
||
Templates now use `out` for their `forge build` artifacts, including ABIs. If you have a project created from a previous template, you can update your `packages/contracts/package.json` with: | ||
|
||
```diff | ||
- "build:abi": "rimraf 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 clean && forge build --skip test script", | ||
+ "build:abi-ts": "mud abi-ts && prettier --write '**/*.abi.json.d.ts'", | ||
``` | ||
|
||
And your `packages/client/src/mud/setupNetwork` with: | ||
|
||
```diff | ||
- import IWorldAbi from "contracts/abi/IWorld.sol/IWorld.abi.json"; | ||
+ import IWorldAbi from "contracts/out/IWorld.sol/IWorld.abi.json"; | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@latticexyz/cli": patch | ||
--- | ||
|
||
`deploy` and `dev-contracts` CLI commands now use `forge build --skip test script` before deploying and run `mud abi-ts` to generate strong types for ABIs. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,5 @@ dist | |
**/cache/ | ||
**/bindings/ | ||
**/artifacts/ | ||
**/abi/ | ||
**/broadcast/ | ||
**/deploys/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
# suppress diffs for codegen in PRs | ||
**/abi/**/*.json linguist-generated=true | ||
**/abi/**/*.json.d.ts linguist-generated=true | ||
**/codegen/**/*.sol linguist-generated=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ cache/ | |
node_modules/ | ||
bindings/ | ||
artifacts/ | ||
abi/ | ||
broadcast/ | ||
|
||
# Ignore all deploy artifacts | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. do we not need the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ahh i see it's in the forge config now |
||
"build:abi-ts": "mud abi-ts && prettier --write '**/*.abi.json.d.ts'", | ||
"build:mud": "mud tablegen && mud worldgen", | ||
"clean": "pnpm run clean:abi && pnpm run clean:mud", | ||
"clean:abi": "rimraf abi", | ||
"clean:abi": "forge clean", | ||
"clean:mud": "rimraf src/codegen", | ||
"deploy:local": "mud deploy", | ||
"test": "mud test", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ cache/ | |
node_modules/ | ||
bindings/ | ||
artifacts/ | ||
abi/ | ||
broadcast/ | ||
|
||
# Ignore MUD deploy artifacts | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ out/ | |
cache/ | ||
node_modules/ | ||
artifacts/ | ||
abi/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
cache | ||
abi | ||
out | ||
docs | ||
_docs | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
* | ||
|
||
!abi/** | ||
!out/**/*.abi.json | ||
!out/**/*.abi.json.d.ts | ||
!src/** | ||
!ts/** | ||
!package.json | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
cache | ||
abi | ||
out | ||
dist | ||
docs | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,3 @@ artifacts | |
yarn-error.log | ||
API | ||
dist | ||
|
||
# only check in ABIs | ||
abi/**/*.json | ||
!abi/**/*.abi.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
* | ||
|
||
!abi/** | ||
!out/**/*.abi.json | ||
!out/**/*.abi.json.d.ts | ||
!src/** | ||
!ts/** | ||
!package.json | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
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