diff --git a/.vscode/settings.json b/.vscode/settings.json index 25fa6215fd..940599e55d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "typescript.tsdk": "node_modules/typescript/lib" + "typescript.tsdk": "node_modules/typescript/lib", + "vitest.disableWorkspaceWarning": true } diff --git a/package.json b/package.json index 5f23a86ff8..8c2e0a1638 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,8 @@ "release:check": "changeset status --verbose --since=origin/main", "release:publish": "pnpm install && pnpm build && changeset publish", "release:version": "changeset version && pnpm install --lockfile-only && pnpm run changelog:generate", - "test": "pnpm run --recursive test", - "test:ci": "pnpm run --recursive test:ci", + "test": "with-anvil turbo run test --concurrency=100%", + "test:ci": "with-anvil turbo run test:ci --concurrency=100%", "type-bench": "pnpm --filter ./test/ts-benchmarks bench", "type-stats-repo": "attest stats packages/*", "vercel:prepare": "ln -sf /vercel/.foundry/bin/* node_modules/.bin/ && forge --version" @@ -49,9 +49,10 @@ "glob": "^10.4.2", "husky": ">=6", "lint-staged": "^15.2.10", + "mock-game-contracts": "workspace:*", "prettier": "3.2.5", "prettier-plugin-solidity": "1.3.1", - "prool": "^0.0.16", + "prool": "^0.0.17", "shx": "^0.3.4", "sort-package-json": "^2.10.1", "tsup": "8.3.0", @@ -59,7 +60,8 @@ "turbo": "^1.9.3", "typescript": "5.4.2", "viem": "2.21.19", - "vitest": "2.1.2" + "vitest": "2.1.2", + "with-anvil": "workspace:*" }, "packageManager": "pnpm@9.15.4", "engines": { diff --git a/packages/abi-ts/package.json b/packages/abi-ts/package.json index 0c429e33d1..f9a5aaac38 100644 --- a/packages/abi-ts/package.json +++ b/packages/abi-ts/package.json @@ -30,7 +30,7 @@ "build": "tsup", "clean": "shx rm -rf dist", "dev": "tsup --watch", - "test": "vitest typecheck --run --passWithNoTests && vitest --run --passWithNoTests", + "test": "vitest --run", "test:ci": "pnpm run test" }, "dependencies": { diff --git a/packages/block-logs-stream/package.json b/packages/block-logs-stream/package.json index e5f27340d6..497bc13456 100644 --- a/packages/block-logs-stream/package.json +++ b/packages/block-logs-stream/package.json @@ -29,7 +29,7 @@ "clean:js": "shx rm -rf dist", "dev": "tsup --watch", "lint": "eslint .", - "test": "vitest typecheck --run --passWithNoTests && vitest --run --passWithNoTests", + "test": "vitest --run", "test:ci": "pnpm run test" }, "dependencies": { @@ -39,8 +39,7 @@ }, "devDependencies": { "@types/debug": "^4.1.7", - "viem": "2.21.19", - "vitest": "3.0.4" + "viem": "2.21.19" }, "peerDependencies": { "viem": "2.x" diff --git a/packages/cli/package.json b/packages/cli/package.json index acc9778fa2..aa73a4c58e 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -83,7 +83,6 @@ "@types/toposort": "^2.0.6", "@types/yargs": "^17.0.10", "ds-test": "https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0", - "forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1", - "vitest": "0.34.6" + "forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1" } } diff --git a/packages/common/package.json b/packages/common/package.json index 2e3ce31617..2c9f9306cf 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -66,7 +66,7 @@ "clean": "pnpm run clean:js", "clean:js": "shx rm -rf dist", "dev": "tsup --watch", - "test": "vitest typecheck --run --passWithNoTests && vitest --run", + "test": "vitest --run", "test:ci": "pnpm run test" }, "dependencies": { @@ -82,9 +82,7 @@ }, "devDependencies": { "@types/debug": "^4.1.7", - "@viem/anvil": "^0.0.7", - "viem": "2.21.19", - "vitest": "0.34.6" + "viem": "2.21.19" }, "peerDependencies": { "@aws-sdk/client-kms": "3.x", diff --git a/packages/common/src/account/kms/kmsKeyToAccount.test.ts b/packages/common/src/account/kms/kmsKeyToAccount.test.ts index 36b9c8d05d..25ce4aab53 100644 --- a/packages/common/src/account/kms/kmsKeyToAccount.test.ts +++ b/packages/common/src/account/kms/kmsKeyToAccount.test.ts @@ -1,16 +1,19 @@ -import { describe, it, expect, beforeAll } from "vitest"; +import { describe, it, expect, beforeAll, beforeEach } from "vitest"; import { KmsAccount, kmsKeyToAccount } from "./kmsKeyToAccount"; import { CreateKeyCommand, KMSClient } from "@aws-sdk/client-kms"; import { parseGwei, http, verifyMessage, verifyTypedData, createClient, parseEther } from "viem"; import { foundry } from "viem/chains"; -import { anvilRpcUrl, testClient } from "../../../test/common"; +import { getAnvilRpcUrl, createTestClient, snapshotAnvilState } from "with-anvil"; import { waitForTransaction } from "../../test/waitForTransaction"; -import { getTransactionReceipt, sendTransaction } from "viem/actions"; +import { getTransactionReceipt, sendTransaction, setBalance } from "viem/actions"; describe.skipIf(!process.env.AWS_ENDPOINT_URL)("kmsKeyToAccount", () => { let account: KmsAccount; let keyId: string; + beforeAll(snapshotAnvilState); + beforeEach(snapshotAnvilState); + beforeAll(async () => { const client = new KMSClient({ region: "local", @@ -32,7 +35,6 @@ describe.skipIf(!process.env.AWS_ENDPOINT_URL)("kmsKeyToAccount", () => { } keyId = createResponse.KeyMetadata.KeyId; - account = await kmsKeyToAccount({ keyId, client }); }); @@ -108,11 +110,11 @@ describe.skipIf(!process.env.AWS_ENDPOINT_URL)("kmsKeyToAccount", () => { it("can execute transactions", async () => { // Fund the KMS account - testClient.setBalance({ address: account.address, value: parseEther("1") }); + setBalance(createTestClient(), { address: account.address, value: parseEther("1") }); const kmsClient = createClient({ chain: foundry, - transport: http(anvilRpcUrl), + transport: http(getAnvilRpcUrl()), account, }); diff --git a/packages/common/src/codegen/render-solidity/common.test.ts b/packages/common/src/codegen/render-solidity/common.test.ts index c249c21cec..41fc952cac 100644 --- a/packages/common/src/codegen/render-solidity/common.test.ts +++ b/packages/common/src/codegen/render-solidity/common.test.ts @@ -62,7 +62,7 @@ describe("renderTableId", () => { it("returns Solidity code to compute table ID", () => { expect(renderTableId({ namespace: "somewhere", name: "Player", offchainOnly: false })).toMatchInlineSnapshot(` " - // Hex below is the result of \`WorldResourceIdLib.encode({ namespace: \\"somewhere\\", name: \\"Player\\", typeId: RESOURCE_TABLE });\` + // Hex below is the result of \`WorldResourceIdLib.encode({ namespace: "somewhere", name: "Player", typeId: RESOURCE_TABLE });\` ResourceId constant _tableId = ResourceId.wrap(0x7462736f6d6577686572650000000000506c6179657200000000000000000000); " `); @@ -71,7 +71,7 @@ describe("renderTableId", () => { it("returns Solidity code to compute offchain table ID", () => { expect(renderTableId({ namespace: "somewhere", name: "Player", offchainOnly: true })).toMatchInlineSnapshot(` " - // Hex below is the result of \`WorldResourceIdLib.encode({ namespace: \\"somewhere\\", name: \\"Player\\", typeId: RESOURCE_OFFCHAIN_TABLE });\` + // Hex below is the result of \`WorldResourceIdLib.encode({ namespace: "somewhere", name: "Player", typeId: RESOURCE_OFFCHAIN_TABLE });\` ResourceId constant _tableId = ResourceId.wrap(0x6f74736f6d6577686572650000000000506c6179657200000000000000000000); " `); diff --git a/packages/common/src/resourceToHex.test.ts b/packages/common/src/resourceToHex.test.ts index ceae742ebe..b184e8d166 100644 --- a/packages/common/src/resourceToHex.test.ts +++ b/packages/common/src/resourceToHex.test.ts @@ -45,7 +45,7 @@ describe("resourceToHex", () => { name: "name", }), ).toThrowErrorMatchingInlineSnapshot( - '"Namespaces must fit into `bytes14`, but \\"AVeryLongNamespace\\" is too long."', + `[Error: Namespaces must fit into \`bytes14\`, but "AVeryLongNamespace" is too long.]`, ); }); diff --git a/packages/common/src/test/minePending.ts b/packages/common/src/test/minePending.ts index 1ce4743f92..b934b113e3 100644 --- a/packages/common/src/test/minePending.ts +++ b/packages/common/src/test/minePending.ts @@ -1,9 +1,12 @@ -import { testClient } from "../../test/common"; +import { getTxpoolContent, mine } from "viem/actions"; +import { createTestClient } from "with-anvil"; export async function minePending(): Promise { - const content = await testClient.getTxpoolContent(); + const testClient = createTestClient(); + + const content = await getTxpoolContent(testClient); if (!Object.keys(content.pending).length) return; - await testClient.mine({ blocks: 1 }); + await mine(testClient, { blocks: 1 }); await minePending(); } diff --git a/packages/common/src/test/waitForTransaction.ts b/packages/common/src/test/waitForTransaction.ts index abf5fe8556..6e281cf439 100644 --- a/packages/common/src/test/waitForTransaction.ts +++ b/packages/common/src/test/waitForTransaction.ts @@ -1,11 +1,11 @@ import { Hex } from "viem"; import { getTransactionReceipt } from "viem/actions"; -import { testClient } from "../../test/common"; import { minePending } from "./minePending"; +import { createTestClient } from "with-anvil"; export async function waitForTransaction(hash: Hex): Promise { await minePending(); - const receipt = await getTransactionReceipt(testClient, { hash }); + const receipt = await getTransactionReceipt(createTestClient(), { hash }); if (receipt.status === "reverted") { // TODO: better error throw new Error(`Transaction reverted (${hash})`); diff --git a/packages/common/test/common.ts b/packages/common/test/common.ts deleted file mode 100644 index d62e4ab516..0000000000 --- a/packages/common/test/common.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { createTestClient, http, publicActions, walletActions } from "viem"; - -export const anvilHost = "127.0.0.1"; -export const anvilPort = 8565; - -// ID of the current test worker. Used by the `@viem/anvil` proxy server. -export const poolId = Number(process.env.VITEST_POOL_ID ?? 1); - -export const anvilRpcUrl = `http://${anvilHost}:${anvilPort}/${poolId}`; - -export const testClient = createTestClient({ - mode: "anvil", - // TODO: if tests get slow, try switching to websockets? - transport: http(anvilRpcUrl), - pollingInterval: 10, -}) - .extend(publicActions) - .extend(walletActions); diff --git a/packages/common/test/globalSetup.ts b/packages/common/test/globalSetup.ts deleted file mode 100644 index 6f9bd68343..0000000000 --- a/packages/common/test/globalSetup.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { startProxy as startAnvilProxy } from "@viem/anvil"; -import { anvilHost, anvilPort } from "./common"; - -export default async function globalSetup(): Promise<() => Promise> { - const shutdownAnvilProxy = await startAnvilProxy({ - host: anvilHost, - port: anvilPort, - }); - - return async () => { - await shutdownAnvilProxy(); - }; -} diff --git a/packages/common/test/setup.ts b/packages/common/test/setup.ts deleted file mode 100644 index 35d83f4304..0000000000 --- a/packages/common/test/setup.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { beforeAll, beforeEach } from "vitest"; -import { testClient } from "./common"; - -// Some test suites deploy contracts in a `beforeAll` handler, so we restore chain state here. -beforeAll(async () => { - const state = await testClient.dumpState(); - return async (): Promise => { - await testClient.loadState({ state }); - }; -}); - -// Some tests execute transactions, so we restore chain state here. -beforeEach(async () => { - const state = await testClient.dumpState(); - return async (): Promise => { - await testClient.loadState({ state }); - }; -}); diff --git a/packages/common/vitest.config.ts b/packages/common/vitest.config.ts deleted file mode 100644 index 61f51f284f..0000000000 --- a/packages/common/vitest.config.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - globalSetup: ["test/globalSetup.ts"], - setupFiles: ["test/setup.ts"], - // Temporarily set a low teardown timeout because anvil hangs otherwise - // Could move this timeout to anvil setup after https://github.com/wevm/anvil.js/pull/46 - teardownTimeout: 500, - hookTimeout: 15000, - }, -}); diff --git a/packages/create-mud/package.json b/packages/create-mud/package.json index 0087475460..fdba1cc198 100644 --- a/packages/create-mud/package.json +++ b/packages/create-mud/package.json @@ -19,7 +19,7 @@ "copy-templates": "tsx ./scripts/copy-templates.ts", "dev": "tsup --watch", "prepublishOnly": "npm run clean && npm run build", - "test": "pnpm run copy-templates && pnpm vitest --run && pnpm run test:vanilla && pnpm run test:react && pnpm run test:react-ecs && pnpm run test:phaser && pnpm run test:threejs", + "test": "shx rm -rf test-project && pnpm run copy-templates && pnpm vitest --run && pnpm run test:vanilla && pnpm run test:react && pnpm run test:react-ecs && pnpm run test:phaser && pnpm run test:threejs", "test:ci": "pnpm run test", "test:phaser": "bin/cli.js --name test-project --template phaser && pnpm --dir test-project install && shx rm -rf test-project", "test:react": "bin/cli.js --name test-project --template react && pnpm --dir test-project install && shx rm -rf test-project", diff --git a/packages/dev-tools/package.json b/packages/dev-tools/package.json index 9832212a6a..a9b6064a53 100644 --- a/packages/dev-tools/package.json +++ b/packages/dev-tools/package.json @@ -55,8 +55,7 @@ "autoprefixer": "^10.4.14", "postcss": "^8.4.23", "tailwindcss": "^3.3.2", - "viem": "2.21.19", - "vitest": "0.34.6" + "viem": "2.21.19" }, "peerDependencies": { "@latticexyz/common": "2.x", diff --git a/packages/entrykit/package.json b/packages/entrykit/package.json index ad06282618..04e17d0b2b 100644 --- a/packages/entrykit/package.json +++ b/packages/entrykit/package.json @@ -82,7 +82,6 @@ "vite": "^5.4.1", "vite-plugin-dts": "^4.2.4", "vite-plugin-externalize-deps": "^0.8.0", - "vitest": "0.34.6", "wagmi": "2.12.11" }, "peerDependencies": { diff --git a/packages/faucet/package.json b/packages/faucet/package.json index 2da4ee6374..621494561d 100644 --- a/packages/faucet/package.json +++ b/packages/faucet/package.json @@ -50,8 +50,7 @@ }, "devDependencies": { "@types/debug": "^4.1.7", - "viem": "2.21.19", - "vitest": "0.34.6" + "viem": "2.21.19" }, "peerDependencies": { "viem": "2.x" diff --git a/packages/gas-report/package.json b/packages/gas-report/package.json index 7388cd60aa..015fd48b02 100644 --- a/packages/gas-report/package.json +++ b/packages/gas-report/package.json @@ -32,7 +32,7 @@ "build": "tsup", "clean": "shx rm -rf dist", "dev": "tsup --watch", - "test": "vitest typecheck --run --passWithNoTests && vitest --run --passWithNoTests && forge test", + "test": "vitest --run && forge test", "test:ci": "pnpm run test" }, "dependencies": { @@ -48,7 +48,6 @@ "@types/stream-to-array": "^2.3.1", "@types/yargs": "^17.0.10", "ds-test": "https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0", - "forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1", - "vitest": "0.34.6" + "forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1" } } diff --git a/packages/protocol-parser/package.json b/packages/protocol-parser/package.json index 00dbf9651e..48a489dcd6 100644 --- a/packages/protocol-parser/package.json +++ b/packages/protocol-parser/package.json @@ -33,7 +33,7 @@ "clean:js": "shx rm -rf dist", "dev": "tsup --watch", "lint": "eslint .", - "test": "vitest typecheck --run && vitest --run", + "test": "vitest --run", "test:ci": "pnpm run test" }, "dependencies": { @@ -43,8 +43,7 @@ "abitype": "1.0.6" }, "devDependencies": { - "viem": "2.21.19", - "vitest": "0.34.6" + "viem": "2.21.19" }, "peerDependencies": { "viem": "2.x" diff --git a/packages/protocol-parser/src/hexToEncodedLengths.test.ts b/packages/protocol-parser/src/hexToEncodedLengths.test.ts index 3f029c5e17..075c35cd3b 100644 --- a/packages/protocol-parser/src/hexToEncodedLengths.test.ts +++ b/packages/protocol-parser/src/hexToEncodedLengths.test.ts @@ -20,7 +20,7 @@ describe("hexToEncodedLengths", () => { it("throws if schema hex data is not bytes32", () => { expect(() => hexToEncodedLengths("0x01234")).toThrowErrorMatchingInlineSnapshot( - '"Hex value \\"0x01234\\" has length of 5, but expected length of 64 for encoded lengths."', + `[InvalidHexLengthForEncodedLengthsError: Hex value "0x01234" has length of 5, but expected length of 64 for encoded lengths.]`, ); }); @@ -29,7 +29,7 @@ describe("hexToEncodedLengths", () => { hexToEncodedLengths("0x0000000000000000000000000000400000000020000000002000000000000040"), ).toThrowErrorMatchingInlineSnapshot( // eslint-disable-next-line max-len - '"EncodedLengths \\"0x0000000000000000000000000000400000000020000000002000000000000040\\" total bytes length (64) did not match the summed length of all field byte lengths (128)."', + `[EncodedLengthsLengthMismatchError: EncodedLengths "0x0000000000000000000000000000400000000020000000002000000000000040" total bytes length (64) did not match the summed length of all field byte lengths (128).]`, ); }); }); diff --git a/packages/react/package.json b/packages/react/package.json index c3edac6428..8ba8d5cf92 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -47,7 +47,6 @@ "eslint-plugin-react-hooks": "4.6.0", "jsdom": "^22.1.0", "react-test-renderer": "^18.2.0", - "vite": "^4.3.6", - "vitest": "0.34.6" + "vite": "^4.3.6" } } diff --git a/packages/schema-type/package.json b/packages/schema-type/package.json index 094937c85a..aaf6fe4204 100644 --- a/packages/schema-type/package.json +++ b/packages/schema-type/package.json @@ -39,7 +39,7 @@ "clean:js": "shx rm -rf dist/typescript", "dev": "tsup --watch", "gas-report": "gas-report --save gas-report.json", - "test": "vitest typecheck --run && vitest --run && forge test", + "test": "vitest --run && forge test", "test:ci": "pnpm run test" }, "dependencies": { @@ -49,8 +49,7 @@ "@latticexyz/gas-report": "workspace:*", "ds-test": "https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0", "forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1", - "viem": "2.21.19", - "vitest": "0.34.6" + "viem": "2.21.19" }, "peerDependencies": { "viem": "2.x" diff --git a/packages/stash/src/actions/subscribeTable.test.ts b/packages/stash/src/actions/subscribeTable.test.ts index 364c7493e3..016c7817f5 100644 --- a/packages/stash/src/actions/subscribeTable.test.ts +++ b/packages/stash/src/actions/subscribeTable.test.ts @@ -1,13 +1,18 @@ import { defineStore } from "@latticexyz/store"; -import { describe, expect, it, vi } from "vitest"; +import { beforeEach, describe, expect, it, vi } from "vitest"; import { createStash } from "../createStash"; import { subscribeTable } from "./subscribeTable"; import { setRecord } from "./setRecord"; describe("subscribeTable", () => { - it("should notify subscriber of table change", () => { + beforeEach(() => { vi.useFakeTimers({ toFake: ["queueMicrotask"] }); + return () => { + vi.useRealTimers(); + }; + }); + it("should notify subscriber of table change", () => { const config = defineStore({ namespaces: { namespace1: { diff --git a/packages/store-indexer/package.json b/packages/store-indexer/package.json index a5a22ef3bc..79b3b2e7e2 100644 --- a/packages/store-indexer/package.json +++ b/packages/store-indexer/package.json @@ -84,8 +84,7 @@ "@types/koa__cors": "^4.0.3", "@types/koa__router": "^12.0.4", "concurrently": "^8.2.2", - "viem": "2.21.19", - "vitest": "0.34.6" + "viem": "2.21.19" }, "peerDependencies": { "viem": "2.x" diff --git a/packages/store-sync/package.json b/packages/store-sync/package.json index f1be37bbd3..16b35ec609 100644 --- a/packages/store-sync/package.json +++ b/packages/store-sync/package.json @@ -70,7 +70,7 @@ "clean:js": "shx rm -rf dist", "dev": "tsup --watch", "lint": "eslint .", - "test": "DATABASE_URL=http://127.0.0.1:5432/postgres vitest", + "test": "vitest", "test:ci": "vitest --run" }, "dependencies": { @@ -105,13 +105,11 @@ "@types/debug": "^4.1.7", "@types/react": "18.2.22", "@types/sql.js": "^1.4.4", - "@viem/anvil": "^0.0.7", "eslint-plugin-react": "7.31.11", "eslint-plugin-react-hooks": "4.6.0", "react": "18.2.0", "react-dom": "18.2.0", "viem": "2.21.19", - "vitest": "0.34.6", "wagmi": "2.12.11" }, "peerDependencies": { diff --git a/packages/store-sync/src/sqlite/sqliteStorage.test.ts b/packages/store-sync/src/sqlite/sqliteStorage.test.ts index fe53a3995e..704c53d1ff 100644 --- a/packages/store-sync/src/sqlite/sqliteStorage.test.ts +++ b/packages/store-sync/src/sqlite/sqliteStorage.test.ts @@ -46,10 +46,10 @@ describe("sqliteStorage", async () => { it("should create tables and data from block log", async () => { expect(() => db.select().from(chainState).all()).toThrowErrorMatchingInlineSnapshot( - '"no such table: __chainState"', + `[Error: no such table: __chainState]`, ); expect(() => db.select().from(mudStoreTables).all()).toThrowErrorMatchingInlineSnapshot( - '"no such table: __mudStoreTables"', + `[Error: no such table: __mudStoreTables]`, ); const storageAdapter = await sqliteStorage({ database: db, publicClient }); diff --git a/packages/store-sync/src/sqlite/sqliteTableToSql.test.ts b/packages/store-sync/src/sqlite/sqliteTableToSql.test.ts index cad8a1ca39..59b81eed98 100644 --- a/packages/store-sync/src/sqlite/sqliteTableToSql.test.ts +++ b/packages/store-sync/src/sqlite/sqliteTableToSql.test.ts @@ -16,7 +16,7 @@ describe("sqliteTableToSql", () => { expect(sql).toMatchInlineSnapshot( // eslint-disable-next-line max-len - '"create table if not exists \\"some table\\" (\\"x\\" integer not null, \\"y\\" integer not null, \\"name\\" text default \'\' not null, \\"block_number\\" blob default \'1000\' not null, constraint \\"some table__primaryKey\\" primary key (\\"x\\", \\"y\\"))"', + `"create table if not exists "some table" ("x" integer not null, "y" integer not null, "name" text default '' not null, "block_number" blob default '1000' not null, constraint "some table__primaryKey" primary key ("x", "y"))"`, ); }); @@ -28,9 +28,7 @@ describe("sqliteTableToSql", () => { const sql = sqliteTableToSql(table); - expect(sql).toMatchInlineSnapshot( - '"create table if not exists \\"some table\\" (\\"name\\" text default \'\' not null)"', - ); + expect(sql).toMatchInlineSnapshot(`"create table if not exists "some table" ("name" text default '' not null)"`); }); it("should generate correct SQL when keys != column names", async () => { @@ -42,7 +40,7 @@ describe("sqliteTableToSql", () => { const sql = sqliteTableToSql(table); expect(sql).toMatchInlineSnapshot( - '"create table if not exists \\"some table\\" (\\"snake_case\\" text default \'\' not null, constraint \\"some table__primaryKey\\" primary key (\\"snake_case\\"))"', + `"create table if not exists "some table" ("snake_case" text default '' not null, constraint "some table__primaryKey" primary key ("snake_case"))"`, ); }); }); diff --git a/packages/store-sync/src/stash/createStorageAdapter.test.ts b/packages/store-sync/src/stash/createStorageAdapter.test.ts index 08b15bac7c..6af6ee74fd 100644 --- a/packages/store-sync/src/stash/createStorageAdapter.test.ts +++ b/packages/store-sync/src/stash/createStorageAdapter.test.ts @@ -1,18 +1,22 @@ -import { beforeAll, describe, expect, it } from "vitest"; +import { beforeAll, beforeEach, describe, expect, it } from "vitest"; import { storeEventsAbi } from "@latticexyz/store"; import { createStorageAdapter } from "./createStorageAdapter"; -import { config, deployMockGame } from "../../test/mockGame"; +import { config, deployMockGame } from "mock-game-contracts"; import { fetchAndStoreLogs } from "../fetchAndStoreLogs"; -import { testClient } from "../../test/common"; import { getBlockNumber } from "viem/actions"; import { createStash } from "@latticexyz/stash/internal"; +import { createTestClient, snapshotAnvilState } from "with-anvil"; describe("createStorageAdapter", async () => { + beforeAll(snapshotAnvilState); + beforeEach(snapshotAnvilState); + beforeAll(async () => { await deployMockGame(); }); it("sets component values from logs", async () => { + const testClient = createTestClient(); const stash = createStash(config); const storageAdapter = createStorageAdapter({ stash }); diff --git a/packages/store-sync/src/zustand/createStorageAdapter.test.ts b/packages/store-sync/src/zustand/createStorageAdapter.test.ts index 4ff4863559..7c87baf468 100644 --- a/packages/store-sync/src/zustand/createStorageAdapter.test.ts +++ b/packages/store-sync/src/zustand/createStorageAdapter.test.ts @@ -1,21 +1,22 @@ -import { beforeAll, describe, expect, it } from "vitest"; +import { beforeAll, beforeEach, describe, expect, it } from "vitest"; import { storeEventsAbi } from "@latticexyz/store"; import { createStorageAdapter } from "./createStorageAdapter"; import { createStore } from "./createStore"; -import { config, deployMockGame } from "../../test/mockGame"; +import { config, deployMockGame } from "mock-game-contracts"; import { fetchAndStoreLogs } from "../fetchAndStoreLogs"; -import { testClient } from "../../test/common"; import { getBlockNumber } from "viem/actions"; -import { Address } from "viem"; +import { createTestClient, snapshotAnvilState } from "with-anvil"; describe("createStorageAdapter", async () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - let worldAddress: Address; + beforeAll(snapshotAnvilState); + beforeEach(snapshotAnvilState); + beforeAll(async () => { - worldAddress = await deployMockGame(); + await deployMockGame(); }); it("sets component values from logs", async () => { + const testClient = createTestClient(); const useStore = createStore({ tables: config.tables }); const storageAdapter = createStorageAdapter({ store: useStore }); diff --git a/packages/store-sync/test/common.ts b/packages/store-sync/test/common.ts deleted file mode 100644 index d61f512394..0000000000 --- a/packages/store-sync/test/common.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { createTestClient, http, publicActions, walletActions } from "viem"; - -export const anvilHost = "127.0.0.1"; -export const anvilPort = 8555; - -// ID of the current test worker. Used by the `@viem/anvil` proxy server. -export const poolId = Number(process.env.VITEST_POOL_ID ?? 1); - -export const anvilRpcUrl = `http://${anvilHost}:${anvilPort}/${poolId}`; - -export const testClient = createTestClient({ - mode: "anvil", - // TODO: if tests get slow, try switching to websockets? - transport: http(anvilRpcUrl), - pollingInterval: 10, -}) - .extend(publicActions) - .extend(walletActions); diff --git a/packages/store-sync/test/globalSetup.ts b/packages/store-sync/test/globalSetup.ts deleted file mode 100644 index 926984f2eb..0000000000 --- a/packages/store-sync/test/globalSetup.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { startProxy as startAnvilProxy } from "@viem/anvil"; -import { anvilHost, anvilPort } from "./common"; -import { execa } from "execa"; - -export default async function globalSetup(): Promise<() => Promise> { - console.log("building mock game"); - await execa("pnpm", ["run", "build"], { - cwd: `${__dirname}/../../../test/mock-game-contracts`, - }); - - const shutdownAnvilProxy = await startAnvilProxy({ - host: anvilHost, - port: anvilPort, - }); - - return async () => { - await shutdownAnvilProxy(); - }; -} diff --git a/packages/store-sync/test/mockGame.ts b/packages/store-sync/test/mockGame.ts deleted file mode 100644 index 4329b6178b..0000000000 --- a/packages/store-sync/test/mockGame.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { execa } from "execa"; -import { anvilRpcUrl } from "./common"; -import { Hex, isHex } from "viem"; -import config from "../../../test/mock-game-contracts/mud.config"; -import worldAbi from "../../../test/mock-game-contracts/out/IWorld.sol/IWorld.abi.json"; - -export { config, worldAbi }; - -export async function deployMockGame(): Promise { - console.log("deploying mock game to", anvilRpcUrl); - const { stdout, stderr } = await execa( - "pnpm", - // skip build because its slow and we do it in global setup - // if we don't skip build here, it regenerates ABIs which cause the tests to re-run (because we import the ABI here), which re-runs this deploy... - ["mud", "deploy", "--rpc", anvilRpcUrl, "--saveDeployment", "false", "--skipBuild"], - { - cwd: `${__dirname}/../../../test/mock-game-contracts`, - env: { - // anvil default account - PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", - DEBUG: "mud:*", - }, - }, - ); - if (stderr) console.error(stderr); - if (stdout) console.log(stdout); - - const [, worldAddress] = stdout.match(/worldAddress: '(0x[0-9a-f]+)'/i) ?? []; - if (!isHex(worldAddress)) { - throw new Error("world address not found in output, did the deploy fail?"); - } - console.log("deployed mock game", worldAddress); - - return worldAddress; -} diff --git a/packages/store-sync/test/setup.ts b/packages/store-sync/test/setup.ts deleted file mode 100644 index 35d83f4304..0000000000 --- a/packages/store-sync/test/setup.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { beforeAll, beforeEach } from "vitest"; -import { testClient } from "./common"; - -// Some test suites deploy contracts in a `beforeAll` handler, so we restore chain state here. -beforeAll(async () => { - const state = await testClient.dumpState(); - return async (): Promise => { - await testClient.loadState({ state }); - }; -}); - -// Some tests execute transactions, so we restore chain state here. -beforeEach(async () => { - const state = await testClient.dumpState(); - return async (): Promise => { - await testClient.loadState({ state }); - }; -}); diff --git a/packages/store-sync/vitest.config.ts b/packages/store-sync/vitest.config.ts deleted file mode 100644 index 0913de5c2d..0000000000 --- a/packages/store-sync/vitest.config.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - globalSetup: ["vitestSetup.ts", "test/globalSetup.ts"], - setupFiles: ["test/setup.ts"], - // Temporarily set a low teardown timeout because anvil hangs otherwise - // Could move this timeout to anvil setup after https://github.com/wevm/anvil.js/pull/46 - teardownTimeout: 500, - hookTimeout: 15000, - }, - server: { - watch: { - // we build+import this file in test setup, which causes vitest to restart in a loop unless we ignore it here - ignored: ["**/test/mock-game-contracts/out/IWorld.sol/IWorld.abi.json"], - }, - }, -}); diff --git a/packages/store-sync/vitestSetup.ts b/packages/store-sync/vitestSetup.ts deleted file mode 100644 index 533675030d..0000000000 --- a/packages/store-sync/vitestSetup.ts +++ /dev/null @@ -1 +0,0 @@ -export { setup, cleanup as teardown } from "@ark/attest"; diff --git a/packages/store/ts/flattenStoreLogs.test.ts b/packages/store/ts/flattenStoreLogs.test.ts index ad2ac5ddb1..e7835d8b2f 100644 --- a/packages/store/ts/flattenStoreLogs.test.ts +++ b/packages/store/ts/flattenStoreLogs.test.ts @@ -2,20 +2,20 @@ import { beforeAll, beforeEach, describe, expect, it } from "vitest"; import { getStoreLogs } from "./getStoreLogs"; import { flattenStoreLogs } from "./flattenStoreLogs"; -import { snapshotAnvilState, testClient } from "../../../test-setup/common"; -import { deployMockGame } from "../../../test-setup/mockGame"; +import { deployMockGame } from "mock-game-contracts"; import { summarizeLogs } from "./test/summarizeLogs"; +import { createTestClient, snapshotAnvilState } from "with-anvil"; describe("flattenStoreLogs", async () => { + beforeAll(snapshotAnvilState); + beforeEach(snapshotAnvilState); + beforeAll(async () => { - const resetAnvilState = await snapshotAnvilState(); await deployMockGame(); - return resetAnvilState; }); - beforeEach(snapshotAnvilState); it("flattens store logs", async () => { - const logs = await getStoreLogs(testClient, { fromBlock: "earliest", toBlock: "latest" }); + const logs = await getStoreLogs(createTestClient(), { fromBlock: "earliest", toBlock: "latest" }); const flattenedLogs = flattenStoreLogs(logs); expect(summarizeLogs(flattenedLogs)).toMatchInlineSnapshot(` diff --git a/packages/store/ts/getStoreLogs.test.ts b/packages/store/ts/getStoreLogs.test.ts index c818ec33a3..3032b8a5eb 100644 --- a/packages/store/ts/getStoreLogs.test.ts +++ b/packages/store/ts/getStoreLogs.test.ts @@ -2,20 +2,20 @@ import { beforeAll, beforeEach, describe, expect, it } from "vitest"; import { getStoreLogs } from "./getStoreLogs"; import config from "../mud.config"; -import { snapshotAnvilState, testClient } from "../../../test-setup/common"; -import { deployMockGame } from "../../../test-setup/mockGame"; +import { deployMockGame } from "mock-game-contracts"; import { summarizeLogs } from "./test/summarizeLogs"; +import { createTestClient, snapshotAnvilState } from "with-anvil"; describe("getStoreLogs", async () => { + beforeAll(snapshotAnvilState); + beforeEach(snapshotAnvilState); + beforeAll(async () => { - const resetAnvilState = await snapshotAnvilState(); await deployMockGame(); - return resetAnvilState; }); - beforeEach(snapshotAnvilState); it("fetches only store logs", async () => { - const logs = await getStoreLogs(testClient, { fromBlock: "earliest", toBlock: "latest" }); + const logs = await getStoreLogs(createTestClient(), { fromBlock: "earliest", toBlock: "latest" }); expect(summarizeLogs(logs)).toMatchInlineSnapshot(` [ "Store_SpliceStaticData world__InitModuleAddres ()", @@ -210,7 +210,7 @@ describe("getStoreLogs", async () => { }); it("fetches only store logs for a specific table", async () => { - const logs = await getStoreLogs(testClient, { + const logs = await getStoreLogs(createTestClient(), { fromBlock: "earliest", toBlock: "latest", tableId: config.tables.store__ResourceIds.tableId, @@ -256,7 +256,7 @@ describe("getStoreLogs", async () => { }); it("fetches only store logs for specific tables", async () => { - const logs = await getStoreLogs(testClient, { + const logs = await getStoreLogs(createTestClient(), { fromBlock: "earliest", toBlock: "latest", tableId: [config.tables.store__ResourceIds.tableId, config.tables.store__Tables.tableId], diff --git a/packages/world-module-callwithsignature/package.json b/packages/world-module-callwithsignature/package.json index 814e81f4a1..280b728846 100644 --- a/packages/world-module-callwithsignature/package.json +++ b/packages/world-module-callwithsignature/package.json @@ -42,7 +42,7 @@ "dev": "tsup --watch", "gas-report": "gas-report --save gas-report.json", "lint": "solhint --config ./.solhint.json 'src/**/*.sol'", - "test": "forge test", + "test": "tsc --noEmit && forge test", "test:ci": "pnpm run test" }, "dependencies": { @@ -55,8 +55,7 @@ "@latticexyz/gas-report": "workspace:*", "ds-test": "https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0", "forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1", - "solhint": "^3.3.7", - "vitest": "0.34.6" + "solhint": "^3.3.7" }, "publishConfig": { "access": "public" diff --git a/packages/world-module-erc20/package.json b/packages/world-module-erc20/package.json index c9a21cfd61..20ce400196 100644 --- a/packages/world-module-erc20/package.json +++ b/packages/world-module-erc20/package.json @@ -42,7 +42,7 @@ "dev": "tsup --watch", "gas-report": "gas-report --save gas-report.json", "lint": "solhint --config ./.solhint.json 'src/**/*.sol'", - "test": "forge test", + "test": "tsc --noEmit && forge test", "test:ci": "pnpm run test" }, "dependencies": { @@ -57,8 +57,7 @@ "@latticexyz/gas-report": "workspace:*", "ds-test": "https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0", "forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1", - "solhint": "^3.3.7", - "vitest": "0.34.6" + "solhint": "^3.3.7" }, "publishConfig": { "access": "public" diff --git a/packages/world-module-metadata/package.json b/packages/world-module-metadata/package.json index a4529e1fec..32ab08679d 100644 --- a/packages/world-module-metadata/package.json +++ b/packages/world-module-metadata/package.json @@ -38,7 +38,7 @@ "dev": "tsup --watch", "gas-report": "gas-report --save gas-report.json", "lint": "solhint --config ./.solhint.json 'src/**/*.sol'", - "test": "forge test", + "test": "tsc --noEmit && forge test", "test:ci": "pnpm run test" }, "dependencies": { @@ -51,8 +51,7 @@ "@latticexyz/gas-report": "workspace:*", "ds-test": "https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0", "forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1", - "solhint": "^3.3.7", - "vitest": "0.34.6" + "solhint": "^3.3.7" }, "publishConfig": { "access": "public" diff --git a/packages/world-modules/package.json b/packages/world-modules/package.json index 0fc7befe22..7df6e9be5f 100644 --- a/packages/world-modules/package.json +++ b/packages/world-modules/package.json @@ -38,7 +38,7 @@ "dev": "tsup --watch", "gas-report": "gas-report --save gas-report.json", "lint": "solhint --config ./.solhint.json 'src/**/*.sol'", - "test": "forge test", + "test": "tsc --noEmit && forge test", "test:ci": "pnpm run test" }, "dependencies": { @@ -57,8 +57,7 @@ "ds-test": "https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0", "forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1", "glob": "^10.4.2", - "solhint": "^3.3.7", - "vitest": "0.34.6" + "solhint": "^3.3.7" }, "publishConfig": { "access": "public" diff --git a/packages/world/package.json b/packages/world/package.json index 723287ed82..0108b6bb71 100644 --- a/packages/world/package.json +++ b/packages/world/package.json @@ -76,8 +76,7 @@ "forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1", "glob": "^10.4.2", "solhint": "^3.3.7", - "viem": "2.21.19", - "vitest": "0.34.6" + "viem": "2.21.19" }, "peerDependencies": { "viem": "2.x" diff --git a/packages/world/vitest.config.ts b/packages/world/vitest.config.ts deleted file mode 100644 index b6a66f2a98..0000000000 --- a/packages/world/vitest.config.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - globalSetup: "vitestSetup.ts", - }, -}); diff --git a/packages/world/vitestSetup.ts b/packages/world/vitestSetup.ts deleted file mode 100644 index 61f38808c3..0000000000 --- a/packages/world/vitestSetup.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { setup } from "@ark/attest"; - -export default () => setup({ updateSnapshots: true }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 71418bbd95..aa62064c26 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -41,6 +41,9 @@ importers: lint-staged: specifier: ^15.2.10 version: 15.2.10 + mock-game-contracts: + specifier: workspace:* + version: link:test/mock-game-contracts prettier: specifier: 3.2.5 version: 3.2.5 @@ -48,8 +51,8 @@ importers: specifier: 1.3.1 version: 1.3.1(prettier@3.2.5) prool: - specifier: ^0.0.16 - version: 0.0.16 + specifier: ^0.0.17 + version: 0.0.17 shx: specifier: ^0.3.4 version: 0.3.4 @@ -74,6 +77,9 @@ importers: vitest: specifier: 2.1.2 version: 2.1.2(@types/node@20.17.16)(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) + with-anvil: + specifier: workspace:* + version: link:test/with-anvil packages/abi-ts: dependencies: @@ -115,9 +121,6 @@ importers: viem: specifier: 2.21.19 version: 2.21.19(bufferutil@4.0.8)(typescript@5.4.2)(utf-8-validate@5.0.10)(zod@3.23.8) - vitest: - specifier: 3.0.4 - version: 3.0.4(@types/debug@4.1.7)(@types/node@22.7.4)(jiti@1.21.6)(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1)(tsx@4.19.2)(yaml@2.5.1) packages/cli: dependencies: @@ -251,9 +254,6 @@ importers: forge-std: specifier: https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1 version: https://codeload.github.com/foundry-rs/forge-std/tar.gz/74cfb77e308dd188d2f58864aaf44963ae6b88b1 - vitest: - specifier: 0.34.6 - version: 0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) packages/common: dependencies: @@ -294,15 +294,9 @@ importers: '@types/debug': specifier: ^4.1.7 version: 4.1.7 - '@viem/anvil': - specifier: ^0.0.7 - version: 0.0.7(bufferutil@4.0.8)(debug@4.3.4)(utf-8-validate@5.0.10) viem: specifier: 2.21.19 version: 2.21.19(bufferutil@4.0.8)(typescript@5.4.2)(utf-8-validate@5.0.10)(zod@3.23.8) - vitest: - specifier: 0.34.6 - version: 0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) packages/config: dependencies: @@ -408,9 +402,6 @@ importers: viem: specifier: 2.21.19 version: 2.21.19(bufferutil@4.0.8)(typescript@5.4.2)(utf-8-validate@5.0.10)(zod@3.23.8) - vitest: - specifier: 0.34.6 - version: 0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) packages/entrykit: dependencies: @@ -526,9 +517,6 @@ importers: vite-plugin-externalize-deps: specifier: ^0.8.0 version: 0.8.0(vite@5.4.8(@types/node@22.7.4)(terser@5.34.1)) - vitest: - specifier: 0.34.6 - version: 0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) wagmi: specifier: 2.12.11 version: 2.12.11(@tanstack/query-core@5.56.2)(@tanstack/react-query@5.56.2(react@18.2.0))(@types/react@18.2.22)(bufferutil@4.0.8)(encoding@0.1.13)(react-dom@18.2.0(react@18.2.0))(react-native@0.75.2(@babel/core@7.25.2)(@babel/preset-env@7.25.3(@babel/core@7.25.2))(@types/react@18.2.22)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(typescript@5.4.2)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@4.30.1)(typescript@5.4.2)(utf-8-validate@5.0.10)(viem@2.21.19(bufferutil@4.0.8)(typescript@5.4.2)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8) @@ -750,9 +738,6 @@ importers: viem: specifier: 2.21.19 version: 2.21.19(bufferutil@4.0.8)(typescript@5.4.2)(utf-8-validate@5.0.10)(zod@3.23.8) - vitest: - specifier: 0.34.6 - version: 0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) packages/gas-report: dependencies: @@ -790,9 +775,6 @@ importers: forge-std: specifier: https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1 version: https://codeload.github.com/foundry-rs/forge-std/tar.gz/74cfb77e308dd188d2f58864aaf44963ae6b88b1 - vitest: - specifier: 0.34.6 - version: 0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) packages/paymaster: devDependencies: @@ -830,9 +812,6 @@ importers: viem: specifier: 2.21.19 version: 2.21.19(bufferutil@4.0.8)(typescript@5.4.2)(utf-8-validate@5.0.10)(zod@3.23.8) - vitest: - specifier: 0.34.6 - version: 0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) packages/react: dependencies: @@ -879,9 +858,6 @@ importers: vite: specifier: ^4.3.6 version: 4.5.5(@types/node@22.7.4)(terser@5.34.1) - vitest: - specifier: 0.34.6 - version: 0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) packages/recs: dependencies: @@ -932,9 +908,6 @@ importers: viem: specifier: 2.21.19 version: 2.21.19(bufferutil@4.0.8)(typescript@5.4.2)(utf-8-validate@5.0.10)(zod@3.23.8) - vitest: - specifier: 0.34.6 - version: 0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) packages/solhint-config-mud: {} @@ -1175,9 +1148,6 @@ importers: viem: specifier: 2.21.19 version: 2.21.19(bufferutil@4.0.8)(typescript@5.4.2)(utf-8-validate@5.0.10)(zod@3.23.8) - vitest: - specifier: 0.34.6 - version: 0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) packages/store-sync: dependencies: @@ -1269,9 +1239,6 @@ importers: '@types/sql.js': specifier: ^1.4.4 version: 1.4.4 - '@viem/anvil': - specifier: ^0.0.7 - version: 0.0.7(bufferutil@4.0.8)(debug@4.3.4)(utf-8-validate@5.0.10) eslint-plugin-react: specifier: 7.31.11 version: 7.31.11(eslint@8.57.0) @@ -1287,9 +1254,6 @@ importers: viem: specifier: 2.21.19 version: 2.21.19(bufferutil@4.0.8)(typescript@5.4.2)(utf-8-validate@5.0.10)(zod@3.23.8) - vitest: - specifier: 0.34.6 - version: 0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) wagmi: specifier: 2.12.11 version: 2.12.11(@tanstack/query-core@5.56.2)(@tanstack/react-query@5.56.2(react@18.2.0))(@types/react@18.2.22)(bufferutil@4.0.8)(encoding@0.1.13)(react-dom@18.2.0(react@18.2.0))(react-native@0.75.2(@babel/core@7.25.7)(@babel/preset-env@7.25.3(@babel/core@7.25.7))(@types/react@18.2.22)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.2.0)(typescript@5.4.2)(utf-8-validate@5.0.10))(react@18.2.0)(rollup@4.30.1)(typescript@5.4.2)(utf-8-validate@5.0.10)(viem@2.21.19(bufferutil@4.0.8)(typescript@5.4.2)(utf-8-validate@5.0.10)(zod@3.23.8))(zod@3.23.8) @@ -1385,9 +1349,6 @@ importers: viem: specifier: 2.21.19 version: 2.21.19(bufferutil@4.0.8)(typescript@5.4.2)(utf-8-validate@5.0.10)(zod@3.23.8) - vitest: - specifier: 0.34.6 - version: 0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) packages/world-module-callwithsignature: dependencies: @@ -1416,9 +1377,6 @@ importers: solhint: specifier: ^3.3.7 version: 3.3.7 - vitest: - specifier: 0.34.6 - version: 0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) packages/world-module-erc20: dependencies: @@ -1453,9 +1411,6 @@ importers: solhint: specifier: ^3.3.7 version: 3.3.7 - vitest: - specifier: 0.34.6 - version: 0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) packages/world-module-metadata: dependencies: @@ -1484,9 +1439,6 @@ importers: solhint: specifier: ^3.3.7 version: 3.3.7 - vitest: - specifier: 0.34.6 - version: 0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) packages/world-modules: dependencies: @@ -1533,9 +1485,6 @@ importers: solhint: specifier: ^3.3.7 version: 3.3.7 - vitest: - specifier: 0.34.6 - version: 0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1) test/mock-game-contracts: devDependencies: @@ -1636,6 +1585,8 @@ importers: specifier: ^4.2.1 version: 4.5.5(@types/node@22.7.4)(terser@5.34.1) + test/with-anvil: {} + packages: '@aashutoshrathi/word-wrap@1.2.6': @@ -5576,12 +5527,6 @@ packages: '@types/body-parser@1.19.5': resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==} - '@types/chai-subset@1.3.5': - resolution: {integrity: sha512-c2mPnw+xHtXDoHmdtcCXGwyLMiauiAyxWMzhGpqHC4nqI/Y5G2XhTampslK2rb59kpcuHon03UH8W6iYUzw88A==} - - '@types/chai@4.3.19': - resolution: {integrity: sha512-2hHHvQBVE2FiSK4eN0Br6snX9MtolHaTo/batnLjlGRhoQzlCL61iVpxoqO7SfFyOw+P/pwv+0zNHzKoGWz9Cw==} - '@types/connect@3.4.38': resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} @@ -5868,24 +5813,15 @@ packages: peerDependencies: '@vanilla-extract/css': ^1.0.0 - '@viem/anvil@0.0.7': - resolution: {integrity: sha512-F+3ljCT1bEt8T4Fzm9gWpIgO3Dc7bzG1TtUtkStkJFMuummqZ8kvYc3UFMo5j3F51fSWZZvEkjs3+i7qf0AOqQ==} - '@vitejs/plugin-react@4.3.1': resolution: {integrity: sha512-m/V2syj5CuVnaxcUJOQRel/Wr31FFXRFlnOoq1TVtkCxsY5veGMTEmpWHndrhB2U8ScHtCQB1e+4hWYExQc6Lg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: ^4.2.0 || ^5.0.0 - '@vitest/expect@0.34.6': - resolution: {integrity: sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==} - '@vitest/expect@2.1.2': resolution: {integrity: sha512-FEgtlN8mIUSEAAnlvn7mP8vzaWhEaAEvhSXCqrsijM7K6QqjB11qoRZYEd4AKSCDz8p0/+yH5LzhZ47qt+EyPg==} - '@vitest/expect@3.0.4': - resolution: {integrity: sha512-Nm5kJmYw6P2BxhJPkO3eKKhGYKRsnqJqf+r0yOGRKpEP+bSCBDsjXgiu1/5QFrnPMEgzfC38ZEjvCFgaNBC0Eg==} - '@vitest/mocker@2.1.2': resolution: {integrity: sha512-ExElkCGMS13JAJy+812fw1aCv2QO/LBK6CyO4WOPAzLTmve50gydOlWhgdBJPx2ztbADUq3JVI0C5U+bShaeEA==} peerDependencies: @@ -5898,59 +5834,21 @@ packages: vite: optional: true - '@vitest/mocker@3.0.4': - resolution: {integrity: sha512-gEef35vKafJlfQbnyOXZ0Gcr9IBUsMTyTLXsEQwuyYAerpHqvXhzdBnDFuHLpFqth3F7b6BaFr4qV/Cs1ULx5A==} - peerDependencies: - msw: ^2.4.9 - vite: ^5.0.0 || ^6.0.0 - peerDependenciesMeta: - msw: - optional: true - vite: - optional: true - '@vitest/pretty-format@2.1.2': resolution: {integrity: sha512-FIoglbHrSUlOJPDGIrh2bjX1sNars5HbxlcsFKCtKzu4+5lpsRhOCVcuzp0fEhAGHkPZRIXVNzPcpSlkoZ3LuA==} - '@vitest/pretty-format@3.0.4': - resolution: {integrity: sha512-ts0fba+dEhK2aC9PFuZ9LTpULHpY/nd6jhAQ5IMU7Gaj7crPCTdCFfgvXxruRBLFS+MLraicCuFXxISEq8C93g==} - - '@vitest/runner@0.34.6': - resolution: {integrity: sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==} - '@vitest/runner@2.1.2': resolution: {integrity: sha512-UCsPtvluHO3u7jdoONGjOSil+uON5SSvU9buQh3lP7GgUXHp78guN1wRmZDX4wGK6J10f9NUtP6pO+SFquoMlw==} - '@vitest/runner@3.0.4': - resolution: {integrity: sha512-dKHzTQ7n9sExAcWH/0sh1elVgwc7OJ2lMOBrAm73J7AH6Pf9T12Zh3lNE1TETZaqrWFXtLlx3NVrLRb5hCK+iw==} - - '@vitest/snapshot@0.34.6': - resolution: {integrity: sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==} - '@vitest/snapshot@2.1.2': resolution: {integrity: sha512-xtAeNsZ++aRIYIUsek7VHzry/9AcxeULlegBvsdLncLmNCR6tR8SRjn8BbDP4naxtccvzTqZ+L1ltZlRCfBZFA==} - '@vitest/snapshot@3.0.4': - resolution: {integrity: sha512-+p5knMLwIk7lTQkM3NonZ9zBewzVp9EVkVpvNta0/PlFWpiqLaRcF4+33L1it3uRUCh0BGLOaXPPGEjNKfWb4w==} - - '@vitest/spy@0.34.6': - resolution: {integrity: sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==} - '@vitest/spy@2.1.2': resolution: {integrity: sha512-GSUi5zoy+abNRJwmFhBDC0yRuVUn8WMlQscvnbbXdKLXX9dE59YbfwXxuJ/mth6eeqIzofU8BB5XDo/Ns/qK2A==} - '@vitest/spy@3.0.4': - resolution: {integrity: sha512-sXIMF0oauYyUy2hN49VFTYodzEAu744MmGcPR3ZBsPM20G+1/cSW/n1U+3Yu/zHxX2bIDe1oJASOkml+osTU6Q==} - - '@vitest/utils@0.34.6': - resolution: {integrity: sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==} - '@vitest/utils@2.1.2': resolution: {integrity: sha512-zMO2KdYy6mx56btx9JvAqAZ6EyS3g49krMPPrgOp1yxGZiA93HumGk+bZ5jIZtOg5/VBYl5eBmGRQHqq4FG6uQ==} - '@vitest/utils@3.0.4': - resolution: {integrity: sha512-8BqC1ksYsHtbWH+DfpOAKrFw3jl3Uf9J7yeFh85Pz52IWuh1hBBtyfEbRNNZNjl8H8A5yMLH9/t+k7HIKzQcZQ==} - '@volar/language-core@2.4.6': resolution: {integrity: sha512-FxUfxaB8sCqvY46YjyAAV6c3mMIq/NWQMVvJ+uS4yxr1KzOvyg61gAuOnNvgCvO4TZ7HcLExBEsWcDu4+K4E8A==} @@ -6117,10 +6015,6 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn-walk@8.3.4: - resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==} - engines: {node: '>=0.4.0'} - acorn@6.4.2: resolution: {integrity: sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==} engines: {node: '>=0.4.0'} @@ -6327,9 +6221,6 @@ packages: asn1.js@5.4.1: resolution: {integrity: sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==} - assertion-error@1.1.0: - resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} - assertion-error@2.0.1: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} @@ -6605,18 +6496,10 @@ packages: caniuse-lite@1.0.30001667: resolution: {integrity: sha512-7LTwJjcRkzKFmtqGsibMeuXmvFDfZq/nzIjnmgCGzKKRVzjD72selLDK1oPF/Oxzmt4fNcPvTDvGqSDG4tCALw==} - chai@4.5.0: - resolution: {integrity: sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==} - engines: {node: '>=4'} - chai@5.1.1: resolution: {integrity: sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==} engines: {node: '>=12'} - chai@5.1.2: - resolution: {integrity: sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==} - engines: {node: '>=12'} - chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -6646,9 +6529,6 @@ packages: chardet@0.7.0: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - check-error@1.0.3: - resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} - check-error@2.1.1: resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} engines: {node: '>= 16'} @@ -7070,10 +6950,6 @@ packages: babel-plugin-macros: optional: true - deep-eql@4.1.4: - resolution: {integrity: sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==} - engines: {node: '>=6'} - deep-eql@5.0.2: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} @@ -7417,9 +7293,6 @@ packages: resolution: {integrity: sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw==} engines: {node: '>= 0.4'} - es-module-lexer@1.6.0: - resolution: {integrity: sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==} - es-object-atoms@1.0.0: resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} engines: {node: '>= 0.4'} @@ -7665,10 +7538,6 @@ packages: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} - execa@7.2.0: - resolution: {integrity: sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==} - engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0} - execa@8.0.1: resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} engines: {node: '>=16.17'} @@ -7685,10 +7554,6 @@ packages: resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} engines: {node: '>=6'} - expect-type@1.1.0: - resolution: {integrity: sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==} - engines: {node: '>=12.0.0'} - expect@29.5.0: resolution: {integrity: sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -7995,10 +7860,6 @@ packages: get-port-please@3.1.2: resolution: {integrity: sha512-Gxc29eLs1fbn6LQ4jSU4vXjlwyZhF5HsGuMAa7gqBP4Rw4yxxltyDUuF5MBclFzDTXO+ACchGQoeela4DSfzdQ==} - get-port@6.1.2: - resolution: {integrity: sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - get-port@7.1.0: resolution: {integrity: sha512-QB9NKEeDg3xxVwCCwJQ9+xycaz6pBB6iQ76wiWMl1927n0Kir6alPiP+yuiICLLU4jpMe08dXfpebuQppFA2zw==} engines: {node: '>=16'} @@ -8210,10 +8071,6 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} - human-signals@4.3.1: - resolution: {integrity: sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==} - engines: {node: '>=14.18.0'} - human-signals@5.0.0: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} @@ -8975,10 +8832,6 @@ packages: resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} engines: {node: '>=6'} - local-pkg@0.4.3: - resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} - engines: {node: '>=14'} - local-pkg@0.5.0: resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} engines: {node: '>=14'} @@ -9043,15 +8896,9 @@ packages: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true - loupe@2.3.7: - resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} - loupe@3.1.1: resolution: {integrity: sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==} - loupe@3.1.3: - resolution: {integrity: sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==} - lru-cache@10.3.0: resolution: {integrity: sha512-CQl19J/g+Hbjbv4Y3mFNNXFEL/5t/KCg8POCuUqd4rMKjGG+j1ybER83hxV58zL+dFI1PTkt3GNFSHRt+d8qEQ==} engines: {node: 14 || >=16.14} @@ -9085,9 +8932,6 @@ packages: magic-string@0.30.11: resolution: {integrity: sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==} - magic-string@0.30.17: - resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} - make-dir@2.1.0: resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==} engines: {node: '>=6'} @@ -9835,12 +9679,6 @@ packages: pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} - pathe@2.0.2: - resolution: {integrity: sha512-15Ztpk+nov8DR524R4BF7uEuzESgzUEAV4Ah7CUMNGXdE5ELuvxElxGXndBl32vMSsWa1jpNf22Z+Er3sKwq+w==} - - pathval@1.1.1: - resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} - pathval@2.0.0: resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} engines: {node: '>= 14.16'} @@ -10199,8 +10037,8 @@ packages: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} - prool@0.0.16: - resolution: {integrity: sha512-s+i66jsINIJQd8w5iGunT8hCeM6RSXjL8qgXDTvcIuaAOjVRVMh0/PgbJ90KR3JAprXWXpa5XQnDEc4fLnvy1Q==} + prool@0.0.17: + resolution: {integrity: sha512-wSEoXcsJflqnrqAcJy3XAsJceF0qN2W4UTCQIpAvsf0g9WOrdA9/zgIGeaFUG87PrcYZ3i5Bdw/Fv30o4NmXBA==} engines: {node: '>=22'} peerDependencies: '@pimlico/alto': '*' @@ -10991,9 +10829,6 @@ packages: std-env@3.7.0: resolution: {integrity: sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==} - std-env@3.8.0: - resolution: {integrity: sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==} - stop-iteration-iterator@1.0.0: resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} engines: {node: '>= 0.4'} @@ -11115,9 +10950,6 @@ packages: resolution: {integrity: sha512-0fk9zBqO67Nq5M/m45qHCJxylV/DhBlIOVExqgOMiCCrzrhU6tCibRXNqE3jwJLftzE9SNuZtYbpzcO+i9FiKw==} engines: {node: '>=14.16'} - strip-literal@1.3.0: - resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==} - strnum@1.0.5: resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==} @@ -11294,37 +11126,18 @@ packages: tinyexec@0.3.0: resolution: {integrity: sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==} - tinyexec@0.3.2: - resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} - tinyglobby@0.2.10: resolution: {integrity: sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==} engines: {node: '>=12.0.0'} - tinypool@0.7.0: - resolution: {integrity: sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==} - engines: {node: '>=14.0.0'} - tinypool@1.0.1: resolution: {integrity: sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA==} engines: {node: ^18.0.0 || >=20.0.0} - tinypool@1.0.2: - resolution: {integrity: sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==} - engines: {node: ^18.0.0 || >=20.0.0} - tinyrainbow@1.2.0: resolution: {integrity: sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==} engines: {node: '>=14.0.0'} - tinyrainbow@2.0.0: - resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} - engines: {node: '>=14.0.0'} - - tinyspy@2.2.1: - resolution: {integrity: sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==} - engines: {node: '>=14.0.0'} - tinyspy@3.0.2: resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==} engines: {node: '>=14.0.0'} @@ -11506,10 +11319,6 @@ packages: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} - type-detect@4.1.0: - resolution: {integrity: sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==} - engines: {node: '>=4'} - type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} @@ -11786,21 +11595,11 @@ packages: typescript: optional: true - vite-node@0.34.6: - resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==} - engines: {node: '>=v14.18.0'} - hasBin: true - vite-node@2.1.2: resolution: {integrity: sha512-HPcGNN5g/7I2OtPjLqgOtCRu/qhVvBxTUD3qzitmL0SrG1cWFzxzhMDWussxSbrRYWqnKf8P2jiNhPMSN+ymsQ==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true - vite-node@3.0.4: - resolution: {integrity: sha512-7JZKEzcYV2Nx3u6rlvN8qdo3QV7Fxyt6hx+CCKz9fbWxdX5IvUOmTWEAxMrWxaiSf7CKGLJQ5rFu8prb/jBjOA==} - engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} - hasBin: true - vite-plugin-dts@4.2.4: resolution: {integrity: sha512-REcYoxO90Pi8c0P1J7XAa/nVwNVGkX2eYkBEIfFSfcKE4g1W8sB0R23a7SU3aLEMfdOdb0SVHq3JlJ+Qb6gjgA==} engines: {node: ^14.18.0 || >=16.0.0} @@ -11915,37 +11714,6 @@ packages: yaml: optional: true - vitest@0.34.6: - resolution: {integrity: sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==} - engines: {node: '>=v14.18.0'} - hasBin: true - peerDependencies: - '@edge-runtime/vm': '*' - '@vitest/browser': '*' - '@vitest/ui': '*' - happy-dom: '*' - jsdom: '*' - playwright: '*' - safaridriver: '*' - webdriverio: '*' - peerDependenciesMeta: - '@edge-runtime/vm': - optional: true - '@vitest/browser': - optional: true - '@vitest/ui': - optional: true - happy-dom: - optional: true - jsdom: - optional: true - playwright: - optional: true - safaridriver: - optional: true - webdriverio: - optional: true - vitest@2.1.2: resolution: {integrity: sha512-veNjLizOMkRrJ6xxb+pvxN6/QAWg95mzcRjtmkepXdN87FNfxAss9RKe2far/G9cQpipfgP2taqg0KiWsquj8A==} engines: {node: ^18.0.0 || >=20.0.0} @@ -11971,34 +11739,6 @@ packages: jsdom: optional: true - vitest@3.0.4: - resolution: {integrity: sha512-6XG8oTKy2gnJIFTHP6LD7ExFeNLxiTkK3CfMvT7IfR8IN+BYICCf0lXUQmX7i7JoxUP8QmeP4mTnWXgflu4yjw==} - engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} - hasBin: true - peerDependencies: - '@edge-runtime/vm': '*' - '@types/debug': ^4.1.12 - '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 - '@vitest/browser': 3.0.4 - '@vitest/ui': 3.0.4 - happy-dom: '*' - jsdom: '*' - peerDependenciesMeta: - '@edge-runtime/vm': - optional: true - '@types/debug': - optional: true - '@types/node': - optional: true - '@vitest/browser': - optional: true - '@vitest/ui': - optional: true - happy-dom: - optional: true - jsdom: - optional: true - vlq@1.0.1: resolution: {integrity: sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==} @@ -12163,18 +11903,6 @@ packages: utf-8-validate: optional: true - ws@8.13.0: - resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - ws@8.17.1: resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} engines: {node: '>=10.0.0'} @@ -18141,12 +17869,6 @@ snapshots: '@types/connect': 3.4.38 '@types/node': 20.17.16 - '@types/chai-subset@1.3.5': - dependencies: - '@types/chai': 4.3.19 - - '@types/chai@4.3.19': {} - '@types/connect@3.4.38': dependencies: '@types/node': 20.17.16 @@ -18503,17 +18225,6 @@ snapshots: dependencies: '@vanilla-extract/css': 1.15.5 - '@viem/anvil@0.0.7(bufferutil@4.0.8)(debug@4.3.4)(utf-8-validate@5.0.10)': - dependencies: - execa: 7.2.0 - get-port: 6.1.2 - http-proxy: 1.18.1(debug@4.3.4) - ws: 8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - bufferutil - - debug - - utf-8-validate - '@vitejs/plugin-react@4.3.1(vite@4.5.5(@types/node@22.7.4)(terser@5.34.1))': dependencies: '@babel/core': 7.25.2 @@ -18536,12 +18247,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitest/expect@0.34.6': - dependencies: - '@vitest/spy': 0.34.6 - '@vitest/utils': 0.34.6 - chai: 4.5.0 - '@vitest/expect@2.1.2': dependencies: '@vitest/spy': 2.1.2 @@ -18549,13 +18254,6 @@ snapshots: chai: 5.1.1 tinyrainbow: 1.2.0 - '@vitest/expect@3.0.4': - dependencies: - '@vitest/spy': 3.0.4 - '@vitest/utils': 3.0.4 - chai: 5.1.2 - tinyrainbow: 2.0.0 - '@vitest/mocker@2.1.2(@vitest/spy@2.1.2)(vite@5.4.8(@types/node@20.17.16)(terser@5.34.1))': dependencies: '@vitest/spy': 2.1.2 @@ -18564,86 +18262,31 @@ snapshots: optionalDependencies: vite: 5.4.8(@types/node@20.17.16)(terser@5.34.1) - '@vitest/mocker@3.0.4(vite@6.0.7(@types/node@22.7.4)(jiti@1.21.6)(terser@5.34.1)(tsx@4.19.2)(yaml@2.5.1))': - dependencies: - '@vitest/spy': 3.0.4 - estree-walker: 3.0.3 - magic-string: 0.30.17 - optionalDependencies: - vite: 6.0.7(@types/node@22.7.4)(jiti@1.21.6)(terser@5.34.1)(tsx@4.19.2)(yaml@2.5.1) - '@vitest/pretty-format@2.1.2': dependencies: tinyrainbow: 1.2.0 - '@vitest/pretty-format@3.0.4': - dependencies: - tinyrainbow: 2.0.0 - - '@vitest/runner@0.34.6': - dependencies: - '@vitest/utils': 0.34.6 - p-limit: 4.0.0 - pathe: 1.1.2 - '@vitest/runner@2.1.2': dependencies: '@vitest/utils': 2.1.2 pathe: 1.1.2 - '@vitest/runner@3.0.4': - dependencies: - '@vitest/utils': 3.0.4 - pathe: 2.0.2 - - '@vitest/snapshot@0.34.6': - dependencies: - magic-string: 0.30.11 - pathe: 1.1.2 - pretty-format: 29.7.0 - '@vitest/snapshot@2.1.2': dependencies: '@vitest/pretty-format': 2.1.2 magic-string: 0.30.11 pathe: 1.1.2 - '@vitest/snapshot@3.0.4': - dependencies: - '@vitest/pretty-format': 3.0.4 - magic-string: 0.30.17 - pathe: 2.0.2 - - '@vitest/spy@0.34.6': - dependencies: - tinyspy: 2.2.1 - '@vitest/spy@2.1.2': dependencies: tinyspy: 3.0.2 - '@vitest/spy@3.0.4': - dependencies: - tinyspy: 3.0.2 - - '@vitest/utils@0.34.6': - dependencies: - diff-sequences: 29.6.3 - loupe: 2.3.7 - pretty-format: 29.7.0 - '@vitest/utils@2.1.2': dependencies: '@vitest/pretty-format': 2.1.2 loupe: 3.1.1 tinyrainbow: 1.2.0 - '@vitest/utils@3.0.4': - dependencies: - '@vitest/pretty-format': 3.0.4 - loupe: 3.1.3 - tinyrainbow: 2.0.0 - '@volar/language-core@2.4.6': dependencies: '@volar/source-map': 2.4.6 @@ -19126,10 +18769,6 @@ snapshots: dependencies: acorn: 8.12.1 - acorn-walk@8.3.4: - dependencies: - acorn: 8.12.1 - acorn@6.4.2: {} acorn@8.12.1: {} @@ -19353,8 +18992,6 @@ snapshots: minimalistic-assert: 1.0.1 safer-buffer: 2.1.2 - assertion-error@1.1.0: {} - assertion-error@2.0.1: {} ast-parents@0.0.1: {} @@ -19709,16 +19346,6 @@ snapshots: caniuse-lite@1.0.30001667: {} - chai@4.5.0: - dependencies: - assertion-error: 1.1.0 - check-error: 1.0.3 - deep-eql: 4.1.4 - get-func-name: 2.0.2 - loupe: 2.3.7 - pathval: 1.1.1 - type-detect: 4.1.0 - chai@5.1.1: dependencies: assertion-error: 2.0.1 @@ -19727,14 +19354,6 @@ snapshots: loupe: 3.1.1 pathval: 2.0.0 - chai@5.1.2: - dependencies: - assertion-error: 2.0.1 - check-error: 2.1.1 - deep-eql: 5.0.2 - loupe: 3.1.1 - pathval: 2.0.0 - chalk@2.4.2: dependencies: ansi-styles: 3.2.1 @@ -19758,10 +19377,6 @@ snapshots: chardet@0.7.0: {} - check-error@1.0.3: - dependencies: - get-func-name: 2.0.2 - check-error@2.1.1: {} chokidar@3.5.3: @@ -20163,10 +19778,6 @@ snapshots: dedent@1.5.3: {} - deep-eql@4.1.4: - dependencies: - type-detect: 4.1.0 - deep-eql@5.0.2: {} deep-equal@1.0.1: {} @@ -20499,8 +20110,6 @@ snapshots: iterator.prototype: 1.1.2 safe-array-concat: 1.1.2 - es-module-lexer@1.6.0: {} - es-object-atoms@1.0.0: dependencies: es-errors: 1.3.0 @@ -20979,18 +20588,6 @@ snapshots: signal-exit: 3.0.7 strip-final-newline: 2.0.0 - execa@7.2.0: - dependencies: - cross-spawn: 7.0.3 - get-stream: 6.0.1 - human-signals: 4.3.1 - is-stream: 3.0.0 - merge-stream: 2.0.0 - npm-run-path: 5.3.0 - onetime: 6.0.0 - signal-exit: 3.0.7 - strip-final-newline: 3.0.0 - execa@8.0.1: dependencies: cross-spawn: 7.0.3 @@ -21022,8 +20619,6 @@ snapshots: expand-template@2.0.3: {} - expect-type@1.1.0: {} - expect@29.5.0: dependencies: '@jest/expect-utils': 29.5.0 @@ -21242,9 +20837,7 @@ snapshots: flow-parser@0.247.1: {} - follow-redirects@1.15.2(debug@4.3.4): - optionalDependencies: - debug: 4.3.4 + follow-redirects@1.15.2: {} for-each@0.3.3: dependencies: @@ -21354,8 +20947,6 @@ snapshots: get-port-please@3.1.2: {} - get-port@6.1.2: {} - get-port@7.1.0: {} get-stdin@9.0.0: {} @@ -21590,10 +21181,10 @@ snapshots: transitivePeerDependencies: - supports-color - http-proxy@1.18.1(debug@4.3.4): + http-proxy@1.18.1: dependencies: eventemitter3: 4.0.7 - follow-redirects: 1.15.2(debug@4.3.4) + follow-redirects: 1.15.2 requires-port: 1.0.0 transitivePeerDependencies: - debug @@ -21611,8 +21202,6 @@ snapshots: human-signals@2.1.0: {} - human-signals@4.3.1: {} - human-signals@5.0.0: {} human-signals@8.0.0: {} @@ -22714,8 +22303,6 @@ snapshots: pify: 4.0.1 strip-bom: 3.0.0 - local-pkg@0.4.3: {} - local-pkg@0.5.0: dependencies: mlly: 1.7.1 @@ -22779,16 +22366,10 @@ snapshots: dependencies: js-tokens: 4.0.0 - loupe@2.3.7: - dependencies: - get-func-name: 2.0.2 - loupe@3.1.1: dependencies: get-func-name: 2.0.2 - loupe@3.1.3: {} - lru-cache@10.3.0: {} lru-cache@10.4.3: {} @@ -22818,10 +22399,6 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 - magic-string@0.30.17: - dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 - make-dir@2.1.0: dependencies: pify: 4.0.1 @@ -23645,10 +23222,6 @@ snapshots: pathe@1.1.2: {} - pathe@2.0.2: {} - - pathval@1.1.1: {} - pathval@2.0.0: {} peek-stream@1.1.3: @@ -23961,13 +23534,13 @@ snapshots: kleur: 3.0.3 sisteransi: 1.0.5 - prool@0.0.16: + prool@0.0.17: dependencies: change-case: 5.4.4 eventemitter3: 5.0.1 execa: 9.5.2 get-port: 7.1.0 - http-proxy: 1.18.1(debug@4.3.4) + http-proxy: 1.18.1 tar: 7.2.0 transitivePeerDependencies: - debug @@ -24929,8 +24502,6 @@ snapshots: std-env@3.7.0: {} - std-env@3.8.0: {} - stop-iteration-iterator@1.0.0: dependencies: internal-slot: 1.0.7 @@ -25065,10 +24636,6 @@ snapshots: strip-json-comments@5.0.1: {} - strip-literal@1.3.0: - dependencies: - acorn: 8.12.1 - strnum@1.0.5: {} styled-jsx@5.1.1(@babel/core@7.25.7)(react@18.2.0): @@ -25326,25 +24893,15 @@ snapshots: tinyexec@0.3.0: {} - tinyexec@0.3.2: {} - tinyglobby@0.2.10: dependencies: fdir: 6.4.3(picomatch@4.0.2) picomatch: 4.0.2 - tinypool@0.7.0: {} - tinypool@1.0.1: {} - tinypool@1.0.2: {} - tinyrainbow@1.2.0: {} - tinyrainbow@2.0.0: {} - - tinyspy@2.2.1: {} - tinyspy@3.0.2: {} tmp@0.0.33: @@ -25531,8 +25088,6 @@ snapshots: type-detect@4.0.8: {} - type-detect@4.1.0: {} - type-fest@0.20.2: {} type-fest@0.21.3: {} @@ -25779,24 +25334,6 @@ snapshots: - utf-8-validate - zod - vite-node@0.34.6(@types/node@18.19.50)(terser@5.34.1): - dependencies: - cac: 6.7.14 - debug: 4.3.7 - mlly: 1.7.1 - pathe: 1.1.2 - picocolors: 1.1.1 - vite: 4.5.5(@types/node@18.19.50)(terser@5.34.1) - transitivePeerDependencies: - - '@types/node' - - less - - lightningcss - - sass - - stylus - - sugarss - - supports-color - - terser - vite-node@2.1.2(@types/node@20.17.16)(terser@5.34.1): dependencies: cac: 6.7.14 @@ -25814,27 +25351,6 @@ snapshots: - supports-color - terser - vite-node@3.0.4(@types/node@22.7.4)(jiti@1.21.6)(terser@5.34.1)(tsx@4.19.2)(yaml@2.5.1): - dependencies: - cac: 6.7.14 - debug: 4.4.0 - es-module-lexer: 1.6.0 - pathe: 2.0.2 - vite: 6.0.7(@types/node@22.7.4)(jiti@1.21.6)(terser@5.34.1)(tsx@4.19.2)(yaml@2.5.1) - transitivePeerDependencies: - - '@types/node' - - jiti - - less - - lightningcss - - sass - - sass-embedded - - stylus - - sugarss - - supports-color - - terser - - tsx - - yaml - vite-plugin-dts@4.2.4(@types/node@22.7.4)(rollup@4.30.1)(typescript@5.4.2)(vite@5.4.8(@types/node@22.7.4)(terser@5.34.1)): dependencies: '@microsoft/api-extractor': 7.47.7(@types/node@22.7.4) @@ -25858,16 +25374,6 @@ snapshots: dependencies: vite: 5.4.8(@types/node@22.7.4)(terser@5.34.1) - vite@4.5.5(@types/node@18.19.50)(terser@5.34.1): - dependencies: - esbuild: 0.18.20 - postcss: 8.4.47 - rollup: 3.29.4 - optionalDependencies: - '@types/node': 18.19.50 - fsevents: 2.3.3 - terser: 5.34.1 - vite@4.5.5(@types/node@22.7.4)(terser@5.34.1): dependencies: esbuild: 0.18.20 @@ -25911,43 +25417,6 @@ snapshots: tsx: 4.19.2 yaml: 2.5.1 - vitest@0.34.6(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1): - dependencies: - '@types/chai': 4.3.19 - '@types/chai-subset': 1.3.5 - '@types/node': 18.19.50 - '@vitest/expect': 0.34.6 - '@vitest/runner': 0.34.6 - '@vitest/snapshot': 0.34.6 - '@vitest/spy': 0.34.6 - '@vitest/utils': 0.34.6 - acorn: 8.12.1 - acorn-walk: 8.3.4 - cac: 6.7.14 - chai: 4.5.0 - debug: 4.3.7 - local-pkg: 0.4.3 - magic-string: 0.30.11 - pathe: 1.1.2 - picocolors: 1.1.1 - std-env: 3.7.0 - strip-literal: 1.3.0 - tinybench: 2.9.0 - tinypool: 0.7.0 - vite: 4.5.5(@types/node@18.19.50)(terser@5.34.1) - vite-node: 0.34.6(@types/node@18.19.50)(terser@5.34.1) - why-is-node-running: 2.3.0 - optionalDependencies: - jsdom: 22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - less - - lightningcss - - sass - - stylus - - sugarss - - supports-color - - terser - vitest@2.1.2(@types/node@20.17.16)(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1): dependencies: '@vitest/expect': 2.1.2 @@ -25983,46 +25452,6 @@ snapshots: - supports-color - terser - vitest@3.0.4(@types/debug@4.1.7)(@types/node@22.7.4)(jiti@1.21.6)(jsdom@22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(terser@5.34.1)(tsx@4.19.2)(yaml@2.5.1): - dependencies: - '@vitest/expect': 3.0.4 - '@vitest/mocker': 3.0.4(vite@6.0.7(@types/node@22.7.4)(jiti@1.21.6)(terser@5.34.1)(tsx@4.19.2)(yaml@2.5.1)) - '@vitest/pretty-format': 3.0.4 - '@vitest/runner': 3.0.4 - '@vitest/snapshot': 3.0.4 - '@vitest/spy': 3.0.4 - '@vitest/utils': 3.0.4 - chai: 5.1.2 - debug: 4.4.0 - expect-type: 1.1.0 - magic-string: 0.30.17 - pathe: 2.0.2 - std-env: 3.8.0 - tinybench: 2.9.0 - tinyexec: 0.3.2 - tinypool: 1.0.2 - tinyrainbow: 2.0.0 - vite: 6.0.7(@types/node@22.7.4)(jiti@1.21.6)(terser@5.34.1)(tsx@4.19.2)(yaml@2.5.1) - vite-node: 3.0.4(@types/node@22.7.4)(jiti@1.21.6)(terser@5.34.1)(tsx@4.19.2)(yaml@2.5.1) - why-is-node-running: 2.3.0 - optionalDependencies: - '@types/debug': 4.1.7 - '@types/node': 22.7.4 - jsdom: 22.1.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - jiti - - less - - lightningcss - - msw - - sass - - sass-embedded - - stylus - - sugarss - - supports-color - - terser - - tsx - - yaml - vlq@1.0.1: {} vscode-uri@3.0.8: {} @@ -26310,11 +25739,6 @@ snapshots: bufferutil: 4.0.8 utf-8-validate: 5.0.10 - ws@8.13.0(bufferutil@4.0.8)(utf-8-validate@5.0.10): - optionalDependencies: - bufferutil: 4.0.8 - utf-8-validate: 5.0.10 - ws@8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10): optionalDependencies: bufferutil: 4.0.8 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 65fa7a5f47..12a9316a42 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,5 +1,6 @@ packages: - packages/* + - test/with-anvil - test/mock-game-contracts - test/puppet-modules - test/system-libraries diff --git a/test-setup/common.ts b/test-setup/common.ts deleted file mode 100644 index 5ca803fdfe..0000000000 --- a/test-setup/common.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { createTestClient, http } from "viem"; - -export const anvilHost = process.env.ANVIL_HOST || "127.0.0.1"; -export const anvilPort = Number(process.env.ANVIL_PORT) || 8556; - -// ID of the current test worker. Used by the `@viem/anvil` proxy server. -export const poolId = Number(process.env.VITEST_POOL_ID ?? 1); - -export const anvilRpcUrl = `http://${anvilHost}:${anvilPort}/${poolId}`; - -export const testClient = createTestClient({ - mode: "anvil", - // TODO: if tests get slow, try switching to websockets? - transport: http(anvilRpcUrl), - pollingInterval: 10, -}); - -export async function snapshotAnvilState() { - const state = await testClient.dumpState(); - return async (): Promise => { - await testClient.loadState({ state }); - }; -} diff --git a/test-setup/global/anvil.ts b/test-setup/global/anvil.ts deleted file mode 100644 index 03a26a0751..0000000000 --- a/test-setup/global/anvil.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { createServer } from "prool"; -import { anvil } from "prool/instances"; -import { anvilHost, anvilPort } from "../common"; -import { execa } from "execa"; - -// The nightly warning from Foundry causes anvil to not start up properly. -// https://github.com/wevm/prool/issues/35 -process.env.FOUNDRY_DISABLE_NIGHTLY_WARNING ??= "1"; - -const server = createServer({ - instance: anvil(), - host: anvilHost, - port: anvilPort, -}); - -export default async () => { - console.log("building mock game contracts"); - await execa("pnpm", ["build"], { - cwd: `${__dirname}/../../test/mock-game-contracts`, - stdout: ["inherit"], - stderr: ["inherit"], - }); - - console.log("starting anvil proxy"); - const stopServer = await server.start(); - - return async () => { - await stopServer(); - }; -}; diff --git a/test-setup/global/polyfill.ts b/test-setup/global/polyfill.ts deleted file mode 100644 index fa5c25f99b..0000000000 --- a/test-setup/global/polyfill.ts +++ /dev/null @@ -1,14 +0,0 @@ -// TODO: remove once we upgrade to -if (typeof Promise.withResolvers === "undefined") { - Promise.withResolvers = () => { - let resolve: (value: T | PromiseLike) => void; - let reject: (reason?: unknown) => void; - const promise = new Promise((res, rej) => { - resolve = res; - reject = rej; - }); - return { promise, resolve: resolve!, reject: reject! }; - }; -} - -export default () => {}; diff --git a/test-setup/mockGame.ts b/test-setup/mockGame.ts deleted file mode 100644 index e76172a1a5..0000000000 --- a/test-setup/mockGame.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { execa } from "execa"; -import { anvilRpcUrl } from "./common"; -import { Hex, isHex } from "viem"; -import config from "../test/mock-game-contracts/mud.config"; -import worldAbi from "../test/mock-game-contracts/out/IWorld.sol/IWorld.abi.json"; - -export { config, worldAbi }; - -export async function deployMockGame(): Promise { - console.log("deploying mock game to", anvilRpcUrl); - const { stdout, stderr } = await execa( - "pnpm", - // skip build because its slow and we do it in global setup - // if we don't skip build here, it regenerates ABIs which cause the tests to re-run (because we import the ABI here), which re-runs this deploy... - ["mud", "deploy", "--rpc", anvilRpcUrl, "--saveDeployment", "false", "--skipBuild"], - { - cwd: `${__dirname}/../test/mock-game-contracts`, - env: { - // anvil default account - PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", - DEBUG: "mud:*", - }, - }, - ); - if (stderr) console.error(stderr); - if (stdout) console.log(stdout); - - const [, worldAddress] = stdout.match(/worldAddress: '(0x[0-9a-f]+)'/i) ?? []; - if (!isHex(worldAddress)) { - throw new Error("world address not found in output, did the deploy fail?"); - } - console.log("deployed mock game", worldAddress); - - return worldAddress; -} diff --git a/test/mock-game-contracts/package.json b/test/mock-game-contracts/package.json index 7676f32001..1eb3b0c7cd 100644 --- a/test/mock-game-contracts/package.json +++ b/test/mock-game-contracts/package.json @@ -3,6 +3,10 @@ "version": "0.0.0", "private": true, "license": "MIT", + "type": "module", + "exports": { + ".": "./ts/exports/index.ts" + }, "scripts": { "build": "mud build", "clean": "forge clean && shx rm -rf src/**/codegen", diff --git a/test/mock-game-contracts/ts/deployMockGame.ts b/test/mock-game-contracts/ts/deployMockGame.ts new file mode 100644 index 0000000000..141a7cbaaa --- /dev/null +++ b/test/mock-game-contracts/ts/deployMockGame.ts @@ -0,0 +1,42 @@ +import { execa } from "execa"; +import { Hex, isHex } from "viem"; +import config from "../mud.config"; +import worldAbi from "../out/IWorld.sol/IWorld.abi.json"; +import { getAnvilRpcUrl } from "with-anvil"; + +export { config, worldAbi }; + +export async function deployMockGame(): Promise { + console.log("deploying mock game to", getAnvilRpcUrl()); + const { stdout } = await execa( + "pnpm", + [ + ["mud", "deploy"], + ["--rpc", getAnvilRpcUrl()], + ["--saveDeployment", "false"], + // skip build because + // - we do it as a test dependency in turbo + // - building regenerates ABIs which causes tests to rerun which causes another deploy + // - race conditions with codegen files missing during build when another process needs them + "--skipBuild", + ].flat(), + { + cwd: `${__dirname}/..`, + env: { + // anvil default account + PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", + DEBUG: "mud:*", + }, + stdout: ["pipe", "inherit"], + stderr: "inherit", + }, + ); + + const [, worldAddress] = stdout.match(/worldAddress: '(0x[0-9a-f]+)'/i) ?? []; + if (!isHex(worldAddress)) { + throw new Error("world address not found in output, did the deploy fail?"); + } + console.log("deployed mock game world", worldAddress); + + return worldAddress; +} diff --git a/test/mock-game-contracts/ts/exports/index.ts b/test/mock-game-contracts/ts/exports/index.ts new file mode 100644 index 0000000000..f781493fe6 --- /dev/null +++ b/test/mock-game-contracts/ts/exports/index.ts @@ -0,0 +1 @@ +export * from "../deployMockGame"; diff --git a/test/with-anvil/package.json b/test/with-anvil/package.json new file mode 100644 index 0000000000..705eab8e33 --- /dev/null +++ b/test/with-anvil/package.json @@ -0,0 +1,11 @@ +{ + "name": "with-anvil", + "version": "0.0.0", + "private": true, + "license": "MIT", + "type": "module", + "exports": { + ".": "./src/exports/index.ts" + }, + "bin": "src/bin/with-anvil.ts" +} diff --git a/test/with-anvil/src/bin/with-anvil.ts b/test/with-anvil/src/bin/with-anvil.ts new file mode 100755 index 0000000000..b8a98a2bd1 --- /dev/null +++ b/test/with-anvil/src/bin/with-anvil.ts @@ -0,0 +1,43 @@ +#!/usr/bin/env -S pnpm tsx +import { createServer } from "prool"; +import { anvil } from "prool/instances"; +import { ExecaError, execa } from "execa"; + +const command = process.argv.slice(2); +if (!command.length) { + throw new Error("No command provided."); +} + +// polyfill Promise.withResolvers for prool +// TODO: remove once we upgrade to node 22 +if (typeof Promise.withResolvers === "undefined") { + Promise.withResolvers = () => { + let resolve: (value: T | PromiseLike) => void; + let reject: (reason?: unknown) => void; + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + return { promise, resolve: resolve!, reject: reject! }; + }; +} + +const host = process.env.PROOL_ANVIL_HOST || "127.0.0.1"; +const port = Number(process.env.PROOL_ANVIL_PORT) || 8556; + +const server = createServer({ instance: anvil(), host, port }); + +console.log("starting anvil proxy"); +await server.start(); + +console.log(`running: ${command.join(" ")}`); +try { + await execa(command[0], command.slice(1), { + stdio: "inherit", + env: { PROOL_ANVIL_URL: `http://${host}:${port}` }, + }); + process.exit(0); +} catch (error) { + if (!(error instanceof ExecaError)) throw error; + process.exit(error.exitCode ?? 1); +} diff --git a/test/with-anvil/src/createTestClient.ts b/test/with-anvil/src/createTestClient.ts new file mode 100644 index 0000000000..92dc05b7a1 --- /dev/null +++ b/test/with-anvil/src/createTestClient.ts @@ -0,0 +1,10 @@ +import { createClient, http } from "viem"; +import { getAnvilRpcUrl } from "./getAnvilRpcUrl"; + +// TODO: pass through client options +export function createTestClient() { + return createClient({ + transport: http(getAnvilRpcUrl()), + pollingInterval: 10, + }).extend(() => ({ mode: "anvil" })); +} diff --git a/test/with-anvil/src/exports/index.ts b/test/with-anvil/src/exports/index.ts new file mode 100644 index 0000000000..3886e65caf --- /dev/null +++ b/test/with-anvil/src/exports/index.ts @@ -0,0 +1,3 @@ +export * from "../createTestClient"; +export * from "../getAnvilRpcUrl"; +export * from "../snapshotAnvilState"; diff --git a/test/with-anvil/src/getAnvilRpcUrl.ts b/test/with-anvil/src/getAnvilRpcUrl.ts new file mode 100644 index 0000000000..760c2895ea --- /dev/null +++ b/test/with-anvil/src/getAnvilRpcUrl.ts @@ -0,0 +1,23 @@ +// Usually you'd use something like `VITEST_POOL_ID` here, but we can't because +// we might be running many instances of Vitest in parallel with Turbo. +// Instead, we'll just pick a random ID. We do this out here instead of inside +// the function to guarantee that each importing context (i.e. Vitest worker) +// has a stable ID. +const instanceId = Math.floor(Math.random() * 100000); + +export function getAnvilRpcUrl() { + const rpcUrl = process.env.PROOL_ANVIL_URL ? `${process.env.PROOL_ANVIL_URL}/${instanceId}` : "http://127.0.0.1:8545"; + + if (!process.env.PROOL_ANVIL_URL) { + console.warn(` + A test asked for the Anvil RPC URL, but was run outside of our test wrapper that manages Anvil instances. + + You can either start an Anvil server at "${rpcUrl}" or prefix your command: + + pnpm with-anvil ${process.env.npm_lifecycle_script || "vitest ..."} + + `); + } + + return rpcUrl; +} diff --git a/test/with-anvil/src/snapshotAnvilState.ts b/test/with-anvil/src/snapshotAnvilState.ts new file mode 100644 index 0000000000..1210eeb8b2 --- /dev/null +++ b/test/with-anvil/src/snapshotAnvilState.ts @@ -0,0 +1,10 @@ +import { dumpState, loadState } from "viem/actions"; +import { createTestClient } from "./createTestClient"; + +export async function snapshotAnvilState() { + const testClient = createTestClient(); + const state = await dumpState(testClient); + return async (): Promise => { + await loadState(testClient, { state }); + }; +} diff --git a/turbo.json b/turbo.json index fa151fa625..94b9d42e4f 100644 --- a/turbo.json +++ b/turbo.json @@ -3,7 +3,7 @@ "pipeline": { "build": { "dependsOn": ["^build"], - "outputs": ["dist/**", "out/**", "build/**", "bin/**", ".next/**"] + "outputs": ["dist/**", "out/**", "build/**", ".mud/**", ".next/**"] }, "create-mud#build": { "dependsOn": ["^build"], @@ -18,12 +18,15 @@ "clean": { "cache": false }, + "test": { + "dependsOn": ["mock-game-contracts#build"] + }, + "test:ci": { + "dependsOn": ["mock-game-contracts#build"], + "cache": false + }, "@latticexyz/store#clean": { - "dependsOn": [ - "@latticexyz/world#clean", - "puppet-modules-test#clean", - "mock-game-contracts#clean" - ], + "dependsOn": ["@latticexyz/world#clean", "puppet-modules-test#clean", "mock-game-contracts#clean"], "cache": false }, "@latticexyz/world#clean": { diff --git a/vitest.config.ts b/vitest.config.ts index 35f75d2b7c..45abc69b70 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -2,19 +2,20 @@ import { defineConfig } from "vitest/config"; export default defineConfig({ test: { - globalSetup: [ - `${__dirname}/test-setup/global/polyfill.ts`, - `${__dirname}/test-setup/global/arktype.ts`, - `${__dirname}/test-setup/global/anvil.ts`, - ], - setupFiles: [], + globalSetup: [`${__dirname}/test-setup/global/arktype.ts`], passWithNoTests: true, - // Temporarily set a low teardown timeout because anvil hangs otherwise - // Could move this timeout to anvil setup after https://github.com/wevm/anvil.js/pull/46 - teardownTimeout: 500, + teardownTimeout: 1000, hookTimeout: 15000, - // Temporarily disable file parallelism until we improve MUD config imports (https://github.com/latticexyz/mud/pull/3290) + // doing parallel MUD deploys from the same project dir + // still seems to have race conditions so disable for now fileParallelism: false, + env: { + // For MacOS users, set up PostgreSQL with + // brew update + // brew install postgresql@14 + // /opt/homebrew/opt/postgresql@14/bin/createuser -s postgres + DATABASE_URL: process.env.DATABASE_URL || "postgres://postgres@localhost:5432/postgres", + }, }, server: { watch: {