From 24e285d5ae2d4f5791688d96ee7f8635551d3fb8 Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Mon, 29 Jul 2024 18:22:22 +0100 Subject: [PATCH] fix(cli,store): don't deploy disabled tables (#2982) --- .changeset/chilly-horses-accept.md | 5 +++++ .changeset/new-ways-count.md | 5 +++++ packages/cli/src/runDeploy.ts | 4 +++- packages/store/mud.config.ts | 5 ++++- 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 .changeset/chilly-horses-accept.md create mode 100644 .changeset/new-ways-count.md diff --git a/.changeset/chilly-horses-accept.md b/.changeset/chilly-horses-accept.md new file mode 100644 index 0000000000..e011d7cf25 --- /dev/null +++ b/.changeset/chilly-horses-accept.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/store": patch +--- + +Disabled deploy of `Hooks` table, as this was meant to be a generic, codegen-only table. diff --git a/.changeset/new-ways-count.md b/.changeset/new-ways-count.md new file mode 100644 index 0000000000..b4d2d23408 --- /dev/null +++ b/.changeset/new-ways-count.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/cli": patch +--- + +`mud deploy` will now correctly skip tables configured with `deploy: { disabled: true }`. diff --git a/packages/cli/src/runDeploy.ts b/packages/cli/src/runDeploy.ts index 1bf116e10e..36e63e5505 100644 --- a/packages/cli/src/runDeploy.ts +++ b/packages/cli/src/runDeploy.ts @@ -129,7 +129,9 @@ export async function runDeploy(opts: DeployOptions): Promise { console.log("Deploying from", client.account.address); - const tables = Object.values(config.namespaces).flatMap((namespace) => Object.values(namespace.tables)); + const tables = Object.values(config.namespaces) + .flatMap((namespace) => Object.values(namespace.tables)) + .filter((table) => !table.deploy.disabled); const startTime = Date.now(); const worldDeploy = await deploy({ diff --git a/packages/store/mud.config.ts b/packages/store/mud.config.ts index f42f338267..fdcee6766a 100644 --- a/packages/store/mud.config.ts +++ b/packages/store/mud.config.ts @@ -36,7 +36,7 @@ export default defineStore({ }, key: ["resourceId"], }, - // The Hooks table is a generic table used by the `filterFromList` util in `Hook.sol` + // This is generic, codegen-only table used by `filterFromList` in `Hook.sol` Hooks: { schema: { resourceId: "ResourceId", @@ -46,6 +46,9 @@ export default defineStore({ codegen: { tableIdArgument: true, }, + deploy: { + disabled: true, + }, }, }, });