Skip to content

Commit

Permalink
Create shy-monkeys-wonder.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs authored Sep 17, 2023
1 parent 0527ec8 commit b022ca3
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .changeset/shy-monkeys-wonder.md
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";
```

0 comments on commit b022ca3

Please sign in to comment.