Skip to content

Commit

Permalink
docs: update namespaces changeset (#2989)
Browse files Browse the repository at this point in the history
  • Loading branch information
holic authored Jul 30, 2024
1 parent c7b2ecd commit 1fe57de
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions .changeset/seven-melons-kneel.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,20 @@ import { defineWorld } from "@latticexyz/world";

export default defineWorld({
namespaces: {
app: {
tables: { ... },
systems: { ... },
game: {
tables: {
Player: { ... },
Position: { ... },
},
},
guilds: {
tables: {
Guild: { ... },
},
systems: {
MembershipSystem: { ... },
TreasurySystem: { ... },
},
},
},
});
Expand All @@ -22,13 +33,19 @@ export default defineWorld({
Once you use the top-level `namespaces` config option, your project will be in "multiple namespaces mode", which expects a source directory structure similar to the config structure: a top-level `namespaces` directory with nested namespace directories that correspond to each namespace label in the config.

```
mud-project/
├─ mud.config.ts
└─ src/
└─ namespaces/
└─ app/
├─ TasksSystem.sol
└─ codegen/
├─ tables/
└─ Tasks.sol
~/guilds
├── mud.config.ts
└── src
└── namespaces
├── game
│   └── codegen
│   └── tables
│   ├── Player.sol
│   └── Position.sol
└── guilds
├── MembershipSystem.sol
├── TreasurySystem.sol
└── codegen
└── tables
└── Guild.sol
```

0 comments on commit 1fe57de

Please sign in to comment.