Skip to content

Commit

Permalink
refactor(cli): split up deploy into modules (#1384)
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin Ingersoll <[email protected]>
Co-authored-by: alvrs <[email protected]>
  • Loading branch information
3 people authored Sep 15, 2023
1 parent e037776 commit 76055f4
Show file tree
Hide file tree
Showing 31 changed files with 795 additions and 569 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/commands/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CommandModule, Options } from "yargs";
import { logError } from "../utils/errors";
import { deployHandler, DeployOptions } from "../utils";
import { DeployOptions, deployHandler } from "../utils/deployHandler";

export const yDeployOptions = {
configPath: { type: "string", desc: "Path to the config file" },
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/src/commands/dev-contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import path from "path";
import { debounce } from "throttle-debounce";
import { worldgenHandler } from "./worldgen";
import { WorldConfig } from "@latticexyz/world";
import { deployHandler, logError, printMUD } from "../utils";
import { homedir } from "os";
import { rmSync } from "fs";
import { execa } from "execa";
import { logError } from "../utils/errors";
import { deployHandler } from "../utils/deployHandler";
import { printMUD } from "../utils/printMUD";

type Options = {
rpc?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { anvil, forge, getRpcUrl } from "@latticexyz/common/foundry";
import chalk from "chalk";
import { rmSync, writeFileSync } from "fs";
import { yDeployOptions } from "./deploy";
import { deployHandler, DeployOptions } from "../utils";
import { DeployOptions, deployHandler } from "../utils/deployHandler";

type Options = DeployOptions & { port?: number; worldAddress?: string; forgeOptions?: string };

Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/commands/trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { resolveWorldConfig, WorldConfig } from "@latticexyz/world";
import IBaseWorldAbi from "@latticexyz/world/out/IBaseWorld.sol/IBaseWorld.abi.json" assert { type: "json" };
import worldConfig from "@latticexyz/world/mud.config.js";
import { tableIdToHex } from "@latticexyz/common";
import { getChainId, getExistingContracts } from "../utils";
import { getExistingContracts } from "../utils/getExistingContracts";
import { getChainId } from "../utils/utils/getChainId";

// TODO account for multiple namespaces (https://github.com/latticexyz/mud/issues/994)
const systemsTableId = tableIdToHex(worldConfig.namespace, worldConfig.tables.Systems.name);
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/worldgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { worldgen } from "@latticexyz/world/node";
import { getSrcDirectory } from "@latticexyz/common/foundry";
import path from "path";
import { rmSync } from "fs";
import { getExistingContracts } from "../utils";
import { getExistingContracts } from "../utils/getExistingContracts";

type Options = {
configPath?: string;
Expand Down
Loading

0 comments on commit 76055f4

Please sign in to comment.