Skip to content
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(common,store): add support for user-defined types #1566

Merged
merged 11 commits into from
Sep 23, 2023
10 changes: 10 additions & 0 deletions .changeset/nice-fishes-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@latticexyz/store": major
---

These breaking changes only affect store utilities, you aren't affected if you use `@latticexyz/cli` codegen scripts.

- Add `remappings` argument to the `tablegen` codegen function, so that it can read user-provided files.
- In `RenderTableOptions` change the type of `imports` from `RelativeImportDatum` to `ImportDatum`, to allow passing absolute imports to the table renderer.
- Add `solidityUserTypes` argument to several functions that need to resolve user or abi types: `resolveAbiOrUserType`, `importForAbiOrUserType`, `getUserTypeInfo`.
- Add `userTypes` config option to MUD config, which takes user types mapped to file paths from which to import them.
7 changes: 7 additions & 0 deletions .changeset/popular-coins-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@latticexyz/common": minor
---

- Add `getRemappings` to get foundry remappings as an array of `[to, from]` tuples.
- Add `extractUserTypes` solidity parser utility to extract user-defined types.
- Add `loadAndExtractUserTypes` helper to load and parse a solidity file, extracting user-defined types.
1 change: 1 addition & 0 deletions packages/cli/contracts/src/codegen/index.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading