Skip to content

Commit

Permalink
fix(cli): run worldgen with deploy (#1807)
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Oct 20, 2023
1 parent e196ca2 commit 69d55ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .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.
6 changes: 4 additions & 2 deletions packages/cli/src/runDeploy.ts
Expand Up @@ -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" },
Expand Down Expand Up @@ -57,10 +59,10 @@ export async function runDeploy(opts: DeployOptions): Promise<WorldDeploy> {
)
);

// 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" });
}
Expand Down

0 comments on commit 69d55ce

Please sign in to comment.