Skip to content

Commit

Permalink
feat(common,store): add support for user-defined types (#1566)
Browse files Browse the repository at this point in the history
Co-authored-by: alvarius <[email protected]>
  • Loading branch information
dk1a and alvrs authored Sep 23, 2023
1 parent cea754d commit 44a5432
Show file tree
Hide file tree
Showing 28 changed files with 1,478 additions and 45 deletions.
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

0 comments on commit 44a5432

Please sign in to comment.