-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
"@latticexyz/cli": major | ||
"@latticexyz/store": major | ||
"create-mud": patch | ||
--- | ||
|
||
Renamed the default filename of generated user types from `Types.sol` to `common.sol` and the default filename of the generated table index file from `Tables.sol` to `index.sol`. | ||
|
||
Both can be overridden via the MUD config: | ||
|
||
```ts | ||
export default mudConfig({ | ||
/** Filename where common user types will be generated and imported from. */ | ||
userTypesFilename: "common.sol", | ||
/** Filename where codegen index will be generated. */ | ||
codegenIndexFilename: "index.sol" | ||
}); | ||
``` | ||
|
||
Note: `userTypesFilename` was renamed from `userTypesPath` and `.sol` is not appended automatically anymore but needs to be part of the provided filename. | ||
|
||
To update your existing project, update all imports from `Tables.sol` to `index.sol` and all imports from `Types.sol` to `common.sol`, or override the defaults in your MUD config to the previous values. | ||
|
||
```diff | ||
- import { Counter } from "../src/codegen/Tables.sol"; | ||
+ import { Counter } from "../src/codegen/index.sol"; | ||
- import { ExampleEnum } from "../src/codegen/Types.sol"; | ||
+ import { ExampleEnum } from "../src/codegen/common.sol"; | ||
``` |