Skip to content

Commit

Permalink
fix: release bytecode on npm and import abi in cli deploy (#1490)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs authored Sep 14, 2023
1 parent 4746832 commit aea67c5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .changeset/clever-items-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@latticexyz/cli": patch
"@latticexyz/store": patch
"@latticexyz/world": patch
---

Include bytecode for `World` and `Store` in npm packages.
2 changes: 1 addition & 1 deletion packages/cli/src/commands/trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MUDError } from "@latticexyz/common/errors";
import { cast, getRpcUrl, getSrcDirectory } from "@latticexyz/common/foundry";
import { StoreConfig } from "@latticexyz/store";
import { resolveWorldConfig, WorldConfig } from "@latticexyz/world";
import IBaseWorldData from "@latticexyz/world/out/IBaseWorld.sol/IBaseWorld.json" assert { type: "json" };
import IBaseWorldData 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";
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/utils/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { encodeSchema, getStaticByteLength } from "@latticexyz/schema-type/depre
import { StoreConfig } from "@latticexyz/store";
import { resolveAbiOrUserType } from "@latticexyz/store/codegen";
import { WorldConfig, resolveWorldConfig } from "@latticexyz/world";
import IBaseWorldData from "@latticexyz/world/out/IBaseWorld.sol/IBaseWorld.json" assert { type: "json" };
import IBaseWorldAbi from "@latticexyz/world/out/IBaseWorld.sol/IBaseWorld.abi.json" assert { type: "json" };
import WorldData from "@latticexyz/world/out/World.sol/World.json" assert { type: "json" };
import CoreModuleData from "@latticexyz/world/out/CoreModule.sol/CoreModule.json" assert { type: "json" };
import KeysWithValueModuleData from "@latticexyz/world/out/KeysWithValueModule.sol/KeysWithValueModule.json" assert { type: "json" };
Expand Down Expand Up @@ -81,7 +81,7 @@ export async function deploy(
? Promise.resolve(worldAddress)
: worldContractName
? deployContractByName(worldContractName, disableTxWait)
: deployContract(IBaseWorldData.abi, WorldData.bytecode, disableTxWait, "World"),
: deployContract(IBaseWorldAbi, WorldData.bytecode, disableTxWait, "World"),
};

// Deploy Systems
Expand Down Expand Up @@ -129,7 +129,7 @@ export async function deploy(
const contractPromises: Record<string, Promise<string>> = { ...worldPromise, ...systemPromises, ...modulePromises };

// Create World contract instance from deployed address
const WorldContract = new ethers.Contract(await contractPromises.World, IBaseWorldData.abi, signer);
const WorldContract = new ethers.Contract(await contractPromises.World, IBaseWorldAbi, signer);

const confirmations = disableTxWait ? 0 : 1;

Expand Down
1 change: 1 addition & 0 deletions packages/store/.npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*

!out/**/*.json
!out/**/*.abi.json
!out/**/*.abi.json.d.ts
!src/**
Expand Down
1 change: 1 addition & 0 deletions packages/world/.npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*

!out/**/*.json
!out/**/*.abi.json
!out/**/*.abi.json.d.ts
!src/**
Expand Down

0 comments on commit aea67c5

Please sign in to comment.