Patch Changes
-
c10c9fb: Internal
tablegen
function (exported from@latticexyz/store/codegen
) now expects an object of options with aconfigPath
to use as a base path to resolve other relative paths from. -
c10c9fb: Added
sourceDirectory
as a top-level config option for specifying contracts source (i.e. Solidity) directory relative to the MUD config. This is used to resolve other paths in the config, like codegen and user types. Likefoundry.toml
, this defaults tosrc
and should be kept in sync withfoundry.toml
.Also added a
codegen.namespaceDirectories
option to organize codegen output (table libraries, etc.) into directories by namespace. For example, aCounter
table in theapp
namespace will have codegen atcodegen/app/tables/Counter.sol
. If not set, defaults totrue
when using top-levelnamespaces
key,false
otherwise. -
96e7bf4: TS source has been removed from published packages in favor of DTS in an effort to improve TS performance. All packages now inherit from a base TS config in
@latticexyz/common
to allow us to continue iterating on TS performance without requiring changes in your project code.If you have a MUD project that you're upgrading, we suggest adding a
tsconfig.json
file to your project workspace that extends this base config.pnpm add -D @latticexyz/common echo "{\n \"extends\": \"@latticexyz/common/tsconfig.base.json\"\n}" > tsconfig.json
Then in each package of your project, inherit from your workspace root's config.
For example, your TS config in
packages/contracts/tsconfig.json
might look like:{ "extends": "../../tsconfig.json" }
And your TS config in
packages/client/tsconfig.json
might look like:{ "extends": "../../tsconfig.json", "compilerOptions": { "types": ["vite/client"], "target": "ESNext", "lib": ["ESNext", "DOM"], "jsx": "react-jsx", "jsxImportSource": "react" }, "include": ["src"] }
You may need to adjust the above configs to include any additional TS options you've set. This config pattern may also reveal new TS errors that need to be fixed or rules disabled.
If you want to keep your existing TS configs, we recommend at least updating your
moduleResolution
setting.-"moduleResolution": "node" +"moduleResolution": "Bundler"
-
Updated dependencies [96e7bf4]
- @latticexyz/[email protected]
- @latticexyz/[email protected]
- @latticexyz/[email protected]
- @latticexyz/[email protected]