Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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/small-horses-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/world": patch
---

Support systems without the System suffix by adding them to the MUD config.
14 changes: 13 additions & 1 deletion packages/world/ts/node/getSystemContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,22 @@ export async function getSystemContracts({
pattern: path.join(config.sourceDirectory, "**"),
});

// Get systems from the top-level systems object
const topLevelSystems = Object.keys(config.systems);
Comment thread
frolic marked this conversation as resolved.
Outdated

// Get systems from namespaces
const namespaceSystems = Object.values(config.namespaces || {}).flatMap((namespace) =>
Object.keys(namespace.systems || {}),
Comment thread
frolic marked this conversation as resolved.
Outdated
);

// Combine both sets of systems
const configSystems = [...topLevelSystems, ...namespaceSystems];

return solidityFiles
.filter(
(file) =>
file.basename.endsWith("System") &&
// Include files with the System suffix and files defined in config
(file.basename.endsWith("System") || configSystems.includes(file.basename)) &&
// exclude the base System contract
file.basename !== "System" &&
// exclude interfaces
Expand Down