diff --git a/.changeset/nasty-crabs-explode.md b/.changeset/nasty-crabs-explode.md new file mode 100644 index 0000000000..ace769e3b6 --- /dev/null +++ b/.changeset/nasty-crabs-explode.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/cli": patch +--- + +Deploy commands (`deploy`, `dev-contracts`, `test`) now correctly run `worldgen` to generate system interfaces before deploying. diff --git a/packages/cli/src/runDeploy.ts b/packages/cli/src/runDeploy.ts index 8031ad2684..62c658598f 100644 --- a/packages/cli/src/runDeploy.ts +++ b/packages/cli/src/runDeploy.ts @@ -16,6 +16,8 @@ import { getChainId } from "viem/actions"; import { postDeploy } from "./utils/utils/postDeploy"; import { WorldDeploy } from "./deploy/common"; import { tablegen } from "@latticexyz/store/codegen"; +import { worldgen } from "@latticexyz/world/node"; +import { getExistingContracts } from "./utils/getExistingContracts"; export const deployOptions = { configPath: { type: "string", desc: "Path to the config file" }, @@ -57,10 +59,10 @@ export async function runDeploy(opts: DeployOptions): Promise { ) ); - // Run forge build + // Run build if (!opts.skipBuild) { const outPath = path.join(srcDir, config.codegenDirectory); - await tablegen(config, outPath, remappings); + await Promise.all([tablegen(config, outPath, remappings), worldgen(config, getExistingContracts(srcDir), outPath)]); await forge(["build"], { profile }); await execa("mud", ["abi-ts"], { stdio: "inherit" }); }