Skip to content

Commit

Permalink
fix(cli,store): don't deploy disabled tables (#2982)
Browse files Browse the repository at this point in the history
  • Loading branch information
holic authored Jul 29, 2024
1 parent 9145d0a commit 24e285d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-horses-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/store": patch
---

Disabled deploy of `Hooks` table, as this was meant to be a generic, codegen-only table.
5 changes: 5 additions & 0 deletions .changeset/new-ways-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/cli": patch
---

`mud deploy` will now correctly skip tables configured with `deploy: { disabled: true }`.
4 changes: 3 additions & 1 deletion packages/cli/src/runDeploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ export async function runDeploy(opts: DeployOptions): Promise<WorldDeploy> {

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({
Expand Down
5 changes: 4 additions & 1 deletion packages/store/mud.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -46,6 +46,9 @@ export default defineStore({
codegen: {
tableIdArgument: true,
},
deploy: {
disabled: true,
},
},
},
});

0 comments on commit 24e285d

Please sign in to comment.