Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli,store): don't deploy disabled tables #2982

Merged
merged 4 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
},
},
},
});
Loading