Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"private": true,
"description": "mud.dev docs",
"license": "",
"type": "module",
"main": "index.js",
"scripts": {
"build": "next build",
Expand Down
1 change: 0 additions & 1 deletion e2e/packages/client-vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"build": "vite build",
"clean": "rimraf dist",
Expand Down
4 changes: 2 additions & 2 deletions e2e/packages/sync-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"@latticexyz/world-modules": "link:../../../packages/world-modules",
"@viem/anvil": "^0.0.6",
"abitype": "1.0.0",
"chalk": "^5.2.0",
"chalk": "4.1.2",
"dotenv": "^16.0.3",
"drizzle-orm": "^0.28.5",
"execa": "^7.1.1",
"execa": "^5.1.1",
"happy-dom": "^12.10.3",
"postgres": "3.3.5",
"typescript": "5.4.2",
Expand Down
2 changes: 1 addition & 1 deletion e2e/packages/sync-test/setup/deployContracts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalk from "chalk";
import { execa } from "execa";
import execa from "execa";

export function deployContracts(rpc: string) {
const deploymentProcess = execa("pnpm", ["mud", "deploy", "--rpc", rpc], {
Expand Down
2 changes: 1 addition & 1 deletion e2e/packages/sync-test/setup/startIndexer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalk from "chalk";
import { execa } from "execa";
import execa from "execa";
import { rmSync } from "node:fs";
import { cleanDatabase } from "@latticexyz/store-sync/postgres";
import { drizzle } from "drizzle-orm/postgres-js";
Expand Down
2 changes: 1 addition & 1 deletion e2e/packages/test-data/generateLogs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { execa } from "execa";
import execa from "execa";
import {
ClientConfig,
GetContractReturnType,
Expand Down
3 changes: 1 addition & 2 deletions e2e/packages/test-data/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion examples/faucet-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"drip": "tsx index.ts"
},
Expand Down
1 change: 0 additions & 1 deletion examples/indexer-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"read-indexer": "tsx index.ts"
},
Expand Down
1 change: 0 additions & 1 deletion examples/minimal/packages/client-phaser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"build": "vite build",
"dev": "vite",
Expand Down
1 change: 0 additions & 1 deletion examples/minimal/packages/client-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"build": "vite build",
"dev": "wait-port localhost:8545 && vite",
Expand Down
1 change: 0 additions & 1 deletion examples/minimal/packages/client-vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"build": "vite build",
"dev": "wait-port localhost:8545 && vite",
Expand Down
1 change: 0 additions & 1 deletion examples/multiple-accounts/packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"build": "vite build",
"dev": "wait-port localhost:8545 && vite",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
},
"devDependencies": {
"@arktype/attest": "0.7.5",
"@arktype/util": "0.0.43",
"@arktype/util": "0.0.41-cjs",
"@changesets/cli": "^2.26.1",
"@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "7.1.1",
"@typescript-eslint/parser": "7.1.1",
"bun": "^1.0.11",
"chalk": "^5.2.0",
"chalk": "4.1.2",
"eslint": "8.57.0",
"execa": "^7.0.0",
"execa": "^5.1.1",
"glob": "^10.4.2",
"husky": ">=6",
"lint-staged": ">=10",
Expand Down
5 changes: 2 additions & 3 deletions packages/abi-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"directory": "packages/abi-ts"
},
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/index.js"
},
Expand All @@ -34,9 +33,9 @@
"test:ci": "pnpm run test"
},
"dependencies": {
"chalk": "^5.3.0",
"chalk": "4.1.2",
"debug": "^4.3.4",
"execa": "^7.0.0",
"execa": "^5.1.1",
"glob": "^10.4.2",
"yargs": "^17.7.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/abi-ts/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from "tsup";
export default defineConfig({
entry: ["src/index.ts", "src/abi-ts.ts"],
target: "esnext",
format: ["esm"],
format: ["esm", "cjs"],
dts: !process.env.TSUP_SKIP_DTS,
sourcemap: true,
clean: true,
Expand Down
7 changes: 3 additions & 4 deletions packages/account-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"directory": "packages/account-kit"
},
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/tsup/index.js",
"./internal": "./dist/tsup/internal.js",
Expand All @@ -19,7 +18,7 @@
],
"scripts": {
"build": "pnpm run build:js",
"build:js": "tsup & vite build",
"build:js": "tsup",
"clean": "pnpm run clean:js",
"clean:js": "rimraf dist",
"dev": "tsup --watch & vite build --watch",
Expand All @@ -43,8 +42,8 @@
"@tanstack/react-query": "^5.28.8",
"abitype": "1.0.0",
"debug": "^4.3.4",
"execa": "^7.0.0",
"p-retry": "^5.1.2",
"execa": "^5.1.1",
"p-retry": "4.6.2",
"permissionless": "^0.1.17",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
1 change: 0 additions & 1 deletion packages/account-kit/src/transportObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export function transportObserver<TTransport extends Transport>(name: string, tr
const result = transport(opts);
const request: typeof result.request = async (req) => {
debug("request", name, req);
console.trace("request", name, req.method);
const response = await result.request(req);
debug("response", name, response);
return response as never;
Expand Down
2 changes: 1 addition & 1 deletion packages/account-kit/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default defineConfig({
internal: "src/exports/internal.ts",
},
target: "esnext",
format: ["esm"],
format: ["esm", "cjs"],
dts: false, // TODO: figure out how to reenable
sourcemap: true,
clean: true,
Expand Down
1 change: 0 additions & 1 deletion packages/block-logs-stream/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"directory": "packages/block-logs-stream"
},
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/index.js"
},
Expand Down
1 change: 1 addition & 0 deletions packages/block-logs-stream/src/createBlockStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export function createBlockStream<TBlockTag extends BlockTag>({
return publicClient.watchBlocks({
blockTag,
emitOnBegin: true,
emitMissed: true,
onBlock: (block) => subscriber.next(block),
onError: (error) => subscriber.error(error),
});
Expand Down
13 changes: 12 additions & 1 deletion packages/block-logs-stream/src/fetchLogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,18 @@ export async function* fetchLogs<TAbiEvents extends readonly AbiEvent[]>({
try {
const toBlock = fromBlock + blockRange;
debug("getting logs", { fromBlock, toBlock });
const logs = await publicClient.getLogs({ ...getLogsOpts, fromBlock, toBlock, strict: true });

const [latestBlockNumber, logs] = await Promise.all([
publicClient.getBlockNumber({ cacheTime: 0 }),
publicClient.getLogs({ ...getLogsOpts, fromBlock, toBlock, strict: true }),
]);
if (latestBlockNumber < toBlock) {
const blockTimeInSeconds = 2;
const seconds = Number(toBlock - latestBlockNumber) * blockTimeInSeconds;
debug(`latest block number ${latestBlockNumber} is less than toBlock ${toBlock}, retrying in ${seconds}s`);
await wait(1000 * seconds);
continue;
}
yield { fromBlock, toBlock, logs };
fromBlock = toBlock + 1n;
blockRange = bigIntMin(maxBlockRange, getLogsOpts.toBlock - fromBlock);
Expand Down
2 changes: 1 addition & 1 deletion packages/block-logs-stream/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from "tsup";
export default defineConfig({
entry: ["src/index.ts"],
target: "esnext",
format: ["esm"],
format: ["esm", "cjs"],
dts: !process.env.TSUP_SKIP_DTS,
sourcemap: true,
clean: true,
Expand Down
11 changes: 5 additions & 6 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"directory": "packages/cli"
},
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/index.js"
},
Expand Down Expand Up @@ -53,17 +52,17 @@
"@latticexyz/world": "workspace:*",
"abitype": "1.0.0",
"asn1.js": "^5.4.1",
"chalk": "^5.0.1",
"chalk": "4.1.2",
"chokidar": "^3.5.3",
"debug": "^4.3.4",
"dotenv": "^16.0.3",
"ethers": "^5.7.2",
"execa": "^7.0.0",
"find-up": "^6.3.0",
"execa": "^5.1.1",
"find-up": "5.0.0",
"glob": "^10.4.2",
"openurl": "^1.1.1",
"p-queue": "^7.4.1",
"p-retry": "^5.1.2",
"p-queue": "6.6.2",
"p-retry": "4.6.2",
"path": "^0.12.7",
"rxjs": "7.5.5",
"throttle-debounce": "^5.0.0",
Expand Down
6 changes: 4 additions & 2 deletions packages/cli/scripts/generate-test-tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ const config = defineStore({
},
});

const remappings = await getRemappings();
(async () => {
const remappings = await getRemappings();

await tablegen({ configPath, config, remappings });
await tablegen({ configPath, config, remappings });
})();
2 changes: 1 addition & 1 deletion packages/cli/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { worldgen } from "@latticexyz/world/node";
import { World as WorldConfig } from "@latticexyz/world";
import { forge, getRemappings } from "@latticexyz/common/foundry";
import { getExistingContracts } from "./utils/getExistingContracts";
import { execa } from "execa";
import execa from "execa";

type BuildOptions = {
foundryProfile?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/devnode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { rmSync } from "fs";
import { homedir } from "os";
import path from "path";
import type { CommandModule } from "yargs";
import { execa } from "execa";
import execa from "execa";

type Options = {
blocktime: number;
Expand Down
17 changes: 16 additions & 1 deletion packages/cli/src/deploy/getWorldContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import accessManagementSystemBuild from "@latticexyz/world/out/AccessManagementS
import balanceTransferSystemBuild from "@latticexyz/world/out/BalanceTransferSystem.sol/BalanceTransferSystem.json" assert { type: "json" };
import batchCallSystemBuild from "@latticexyz/world/out/BatchCallSystem.sol/BatchCallSystem.json" assert { type: "json" };
import registrationSystemBuild from "@latticexyz/world/out/RegistrationSystem.sol/RegistrationSystem.json" assert { type: "json" };
import extendedRegistrationSystemBuild from "@latticexyz/world/out/ExtendedRegistrationSystem.sol/ExtendedRegistrationSystem.json" assert { type: "json" };
import initModuleBuild from "@latticexyz/world/out/InitModule.sol/InitModule.json" assert { type: "json" };
import initModuleAbi from "@latticexyz/world/out/InitModule.sol/InitModule.abi.json" assert { type: "json" };
import { Hex, getCreate2Address, encodeDeployData, size } from "viem";
Expand Down Expand Up @@ -36,11 +37,19 @@ export function getWorldContracts(deployerAddress: Hex) {
salt,
});

const extendedRegistrationDeployedBytecodeSize = size(extendedRegistrationSystemBuild.deployedBytecode.object as Hex);
const extendedRegistrationBytecode = extendedRegistrationSystemBuild.bytecode.object as Hex;
const extendedRegistration = getCreate2Address({
from: deployerAddress,
bytecode: extendedRegistrationBytecode,
salt,
});

const initModuleDeployedBytecodeSize = size(initModuleBuild.deployedBytecode.object as Hex);
const initModuleBytecode = encodeDeployData({
bytecode: initModuleBuild.bytecode.object as Hex,
abi: initModuleAbi,
args: [accessManagementSystem, balanceTransferSystem, batchCallSystem, registration],
args: [accessManagementSystem, balanceTransferSystem, batchCallSystem, registration, extendedRegistration],
});
const initModule = getCreate2Address({ from: deployerAddress, bytecode: initModuleBytecode, salt });

Expand Down Expand Up @@ -69,6 +78,12 @@ export function getWorldContracts(deployerAddress: Hex) {
label: "core registration system",
address: registration,
},
ExtendedRegistrationSystem: {
bytecode: extendedRegistrationBytecode,
deployedBytecodeSize: extendedRegistrationDeployedBytecodeSize,
label: "extended core registration system",
address: extendedRegistration,
},
InitModule: {
bytecode: initModuleBytecode,
deployedBytecodeSize: initModuleDeployedBytecodeSize,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/getContractArtifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { findPlaceholders } from "./findPlaceholders";
import { z } from "zod";
import { Abi as abiSchema } from "abitype/zod";
import { createRequire } from "node:module";
import { findUp } from "find-up";
import findUp from "find-up";

export type GetContractArtifactOptions = {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getDeployer } from "./deploy/getDeployer";
import { MUDError } from "@latticexyz/common/errors";
import { Module, salt } from "./deploy/common";
import { getStorageAt } from "viem/actions";
import { execa } from "execa";
import execa from "execa";

type VerifyOptions = {
client: Client<Transport, Chain | undefined>;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const mudPackages: MudPackages = Object.fromEntries(
export default defineConfig({
entry: ["src/index.ts", "src/mud.ts"],
target: "esnext",
format: ["esm"],
format: ["esm", "cjs"],
dts: !process.env.TSUP_SKIP_DTS,
sourcemap: true,
clean: true,
Expand Down
Loading
Loading