Skip to content

Commit 97cb87e

Browse files
authored
Merge branch 'main' into holic/tx-queue-blockTag
2 parents 6858a5a + b434e8d commit 97cb87e

File tree

219 files changed

+6364
-876
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+6364
-876
lines changed

.changeset/clean-worms-walk.md

-5
This file was deleted.

.changeset/quick-frogs-fold.md

-6
This file was deleted.

.changeset/real-waves-bathe.md

-5
This file was deleted.

.changeset/swift-rabbits-appear.md

-7
This file was deleted.

.changeset/tasty-toys-deliver.md

-7
This file was deleted.

.github/actions/setup/action.yml

-7
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ runs:
66
- name: Setup prerequisites
77
uses: ./.github/actions/setup-prerequisites
88

9-
# pnpm no longer runs this before the actual install (https://github.com/pnpm/pnpm/issues/3760)
10-
# but we need to create some placeholder files like bins so that the install step can find them and put references to them in the right spot
11-
# this resolves some chicken-and-egg problems with using workspace bins before they're created (install -> build -> install)
12-
- name: Run prepare scripts
13-
shell: bash
14-
run: pnpm recursive run prepare
15-
169
- name: Install node dependencies
1710
shell: bash
1811
run: pnpm install --frozen-lockfile

.github/workflows/changeset.yml

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Changeset
22

33
on:
44
pull_request:
5+
paths:
6+
- ".changeset/*.md"
57

68
jobs:
79
changeset:

.github/workflows/test-published-packages.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ jobs:
1717
test-create-mud-project:
1818
name: Test create-mud project
1919
strategy:
20-
fail-fast: false
2120
matrix:
22-
os: [depot-ubuntu-22.04-16, windows-latest]
21+
os: [depot-ubuntu-22.04-16]
2322
template: [vanilla, react, react-ecs, phaser, threejs]
2423

2524
runs-on: ${{ matrix.os }}

.gitignore

+11-4
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,22 @@ yarn.lock
1111
lerna-debug.log
1212
yarn-error.log
1313
.turbo
14+
.attest
15+
.tstrace
16+
17+
.env*
1418

1519
# We don't want projects created from templates to ignore their lockfiles, but we don't
1620
# want to check them in here, so we'll ignore them from the root.
1721
templates/*/pnpm-lock.yaml
1822

19-
.env
20-
23+
# mud test data
2124
test-data/world-logs-bulk-*.json
2225
test-data/world-logs-query.json
2326

24-
.attest
25-
.tstrace
27+
# mud artifacts
28+
.mud
29+
30+
# sqlite indexer data
31+
*.db
32+
*.db-journal

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ dist
33
templates/phaser/packages/art
44
CODEOWNERS
55
out
6+
7+
# forge docs output (gitignored anyway)
8+
packages/*/docs

.prettierrc.js .prettierrc.cjs

File renamed without changes.

CHANGELOG.md

+41
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1+
## Version 2.2.0
2+
3+
Release date: Fri Aug 30 2024
4+
5+
### Minor changes
6+
7+
**[chore(explorer): update world explorer naming (#3069)](https://github.com/latticexyz/mud/commit/0eb25560cfc78354a5e6845c3244375759b71f4c)** (@latticexyz/explorer)
8+
9+
Initial release of the `@latticexyz/explorer` package. World Explorer is a standalone tool designed to explore and manage worlds. This initial release supports local worlds, with plans to extend support to any world in the future.
10+
11+
Read more on how to get started or contribute in the [World Explorer README](https://github.com/latticexyz/mud/blob/main/packages/explorer/README.md).
12+
13+
### Patch changes
14+
15+
**[fix(common): route all actions through viem client (#3071)](https://github.com/latticexyz/mud/commit/69cd0a1ba0450f3407ec5865334079653503fa86)** (@latticexyz/common)
16+
17+
Updated all custom Viem actions to properly call other actions via `getAction` so they can be composed.
18+
19+
**[build: use shx from dev deps (#3085)](https://github.com/latticexyz/mud/commit/c0bb0da58966b49c51570de9e3e031bee78b8473)** (create-mud)
20+
21+
Templates now use `shx` to run shell commands in scripts for better Windows compatibility.
22+
23+
**[feat(world): add namespaceLabel to system config (#3057)](https://github.com/latticexyz/mud/commit/04c675c946a0707956f38daad3fe516fde4a33a2)** (@latticexyz/config, @latticexyz/store)
24+
25+
Fixed a few type issues with `namespaceLabel` in tables and added/clarified TSDoc for config input/output objects.
26+
27+
**[fix(create-mud): update changeset package name + description (#3066)](https://github.com/latticexyz/mud/commit/bd4dffcabd6c6715df213e6c0c8b0631c9afc0b7)** (create-mud)
28+
29+
New projects created with `pnpm create mud` now include the World Explorer and SQLite indexer running as additional services.
30+
31+
**[feat(world): add namespaceLabel to system config (#3057)](https://github.com/latticexyz/mud/commit/04c675c946a0707956f38daad3fe516fde4a33a2)** (@latticexyz/cli, @latticexyz/world)
32+
33+
Add a strongly typed `namespaceLabel` to the system config output.
34+
It corresponds to the `label` of the namespace the system belongs to and can't be set manually.
35+
36+
**[feat(cli,world): register system ABI onchain (#3050)](https://github.com/latticexyz/mud/commit/31caecc95be72fe94efd1df8cba2b5435fa39bb4)** (@latticexyz/cli)
37+
38+
In addition to table labels, system labels and ABIs are now registered onchain during deploy.
39+
40+
---
41+
142
## Version 2.1.1
243

344
Release date: Tue Aug 20 2024

CODEOWNERS

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# These owners will be the default owners for everything in
22
# the repo. Unless a later match takes precedence.
33

4-
* @alvrs @holic @yonadaaa
4+
* @alvrs @holic
55

6-
docs/**/* @ludns @qbzzt @alvrs @holic @yonadaaa
6+
/docs @ludns @qbzzt @alvrs @holic
7+
8+
/packages/explorer @alvrs @holic @karooolis
9+
/examples/local-explorer @alvrs @holic @karooolis

Dockerfile

-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ FROM base AS mud
3737
COPY . /app
3838
WORKDIR /app
3939

40-
# pnpm no longer runs prepare before the actual install (https://github.com/pnpm/pnpm/issues/3760)
41-
# but we need to create some placeholder files like bins so that the install step can find them and put references to them in the right spot
42-
# this resolves some chicken-and-egg problems with using workspace bins before they're created (install -> build -> install)
43-
RUN pnpm recursive run prepare
4440
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
4541
RUN NODE_OPTIONS=--max-old-space-size=4096 pnpm run -r build
4642

docs/pages/_meta.js

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export default {
2323
cli: "CLI",
2424
"state-query": "State Query",
2525
services: "Services",
26+
"world-explorer": {
27+
title: "World Explorer",
28+
theme: { breadcrumb: false },
29+
},
2630
"---": {
2731
title: "", // no title renders as a line
2832
type: "separator",

docs/pages/changelog.mdx

+41
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1+
## Version 2.2.0
2+
3+
Release date: Fri Aug 30 2024
4+
5+
### Minor changes
6+
7+
**[chore(explorer): update world explorer naming (#3069)](https://github.com/latticexyz/mud/commit/0eb25560cfc78354a5e6845c3244375759b71f4c)** (@latticexyz/explorer)
8+
9+
Initial release of the `@latticexyz/explorer` package. World Explorer is a standalone tool designed to explore and manage worlds. This initial release supports local worlds, with plans to extend support to any world in the future.
10+
11+
Read more on how to get started or contribute in the [World Explorer README](https://github.com/latticexyz/mud/blob/main/packages/explorer/README.md).
12+
13+
### Patch changes
14+
15+
**[fix(common): route all actions through viem client (#3071)](https://github.com/latticexyz/mud/commit/69cd0a1ba0450f3407ec5865334079653503fa86)** (@latticexyz/common)
16+
17+
Updated all custom Viem actions to properly call other actions via `getAction` so they can be composed.
18+
19+
**[build: use shx from dev deps (#3085)](https://github.com/latticexyz/mud/commit/c0bb0da58966b49c51570de9e3e031bee78b8473)** (create-mud)
20+
21+
Templates now use `shx` to run shell commands in scripts for better Windows compatibility.
22+
23+
**[feat(world): add namespaceLabel to system config (#3057)](https://github.com/latticexyz/mud/commit/04c675c946a0707956f38daad3fe516fde4a33a2)** (@latticexyz/config, @latticexyz/store)
24+
25+
Fixed a few type issues with `namespaceLabel` in tables and added/clarified TSDoc for config input/output objects.
26+
27+
**[fix(create-mud): update changeset package name + description (#3066)](https://github.com/latticexyz/mud/commit/bd4dffcabd6c6715df213e6c0c8b0631c9afc0b7)** (create-mud)
28+
29+
New projects created with `pnpm create mud` now include the World Explorer and SQLite indexer running as additional services.
30+
31+
**[feat(world): add namespaceLabel to system config (#3057)](https://github.com/latticexyz/mud/commit/04c675c946a0707956f38daad3fe516fde4a33a2)** (@latticexyz/cli, @latticexyz/world)
32+
33+
Add a strongly typed `namespaceLabel` to the system config output.
34+
It corresponds to the `label` of the namespace the system belongs to and can't be set manually.
35+
36+
**[feat(cli,world): register system ABI onchain (#3050)](https://github.com/latticexyz/mud/commit/31caecc95be72fe94efd1df8cba2b5435fa39bb4)** (@latticexyz/cli)
37+
38+
In addition to table labels, system labels and ABIs are now registered onchain during deploy.
39+
40+
---
41+
142
## Version 2.1.1
243

344
Release date: Tue Aug 20 2024

docs/pages/config/reference.mdx

+14-1
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,26 @@ The following options are available in both single- and multiple-namespace modes
121121
</Params>
122122

123123
</Param>
124+
124125
<Param name="modules">
126+
<a id="modules" />
125127
A list of modules to install into the world during the deploy step.
126128

127129
<Params title="Module config options">
128130
<Param name="artifactPath">Relative path to the module's compiled JSON artifact (usually in `out`) or an import path if using a module from an npm package. This path is resolved using [Node's module `require` API](https://nodejs.org/api/modules.html#modulerequireid).</Param>
131+
129132
<Param name="root">Whether or not to install this as a root module. Defaults to `false`.</Param>
130-
<Param name="args">A list of arguments used to call the module's install function.</Param>
133+
134+
<Param name="args">
135+
A list of arguments used to call the module's install function. Each argument is a structure with two fields:
136+
<Params title="Structure in each argument">
137+
<Param name="type">Solidity data type.</Param>
138+
<Param name="value">
139+
The value.
140+
To encode a complex data type, such as a structure or an array, you can use Viem's [`encodeAbiParameters`](https://viem.sh/docs/abi/encodeAbiParameters.html).
141+
</Param>
142+
</Params>
143+
</Param>
131144
</Params>
132145

133146
</Param>

docs/pages/world-explorer.mdx

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
import { Tabs, Tab } from "nextra/components";
2+
import { CollapseCode } from "../components/CollapseCode";
3+
4+
# World Explorer
5+
6+
World Explorer is a GUI tool designed for visually exploring and manipulating the state of worlds.
7+
It is available in the MUD TypeScript templates starting with version 2.2.
8+
9+
## Usage
10+
11+
If you are running locally a MUD TypeScript template version 2.2 or later, the URL for World Explorer is [http://localhost:13690](http://localhost:13690).
12+
13+
<Tabs items={["Data Explorer", "Interact"]}>
14+
<Tab>
15+
<iframe
16+
width="761"
17+
height="523"
18+
src="https://www.youtube.com/embed/87wuGFH9Pz0"
19+
title="Using the MUD Data Explorer"
20+
frameborder="0"
21+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
22+
referrerpolicy="strict-origin-when-cross-origin"
23+
allowfullscreen
24+
></iframe>
25+
</Tab>
26+
<Tab>
27+
<iframe
28+
width="761"
29+
height="523"
30+
src="https://www.youtube.com/embed/87wuGFH9Pz0?t=281https://www.youtube.com/embed/87wuGFH9Pz0?si=EsgcYGK9qk6J-Xvs&amp;start=281"
31+
title="Using the MUD Data Explorer's Interact tab"
32+
frameborder="0"
33+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
34+
referrerpolicy="strict-origin-when-cross-origin"
35+
allowfullscreen
36+
></iframe>
37+
</Tab>
38+
</Tabs>
39+
40+
### CLI options
41+
42+
To use the explorer with different command-line options, use this process:
43+
44+
1. In the mprocs screen, go down to the **explorer** process.
45+
46+
1. Type `x` to stop the default explorer.
47+
48+
1. In a different command-line window, go to `packages/contract`.
49+
50+
1. Run the explorer using `pnpm explorer <options>`.
51+
52+
The World Explorer accepts the following CLI arguments:
53+
54+
| Argument | Description | Default value |
55+
| ----------------- | ------------------------------------------------------------------- | ------------- |
56+
| `worldAddress` | The address of the world to explore | None |
57+
| `worldsFile` | Path to a worlds configuration file (used to resolve world address) | "worlds.json" |
58+
| `indexerDatabase` | Path to your SQLite indexer database | "indexer.db" |
59+
| `chainId` | The chain ID of the network | 31337 |
60+
| `port` | The port on which to run the World Explorer | 13690 |
61+
62+
## Installation
63+
64+
These installation steps are needed to add World Explorer to MUD 2.0 and 2.1.
65+
In later versions the template already includes World Explorer.
66+
67+
1. Update to the latest MUD version (optional):
68+
69+
```sh copy
70+
pnpm mud set-version --tag latest
71+
pnpm install
72+
```
73+
74+
1. Install the Indexer and World Explorer packages in the project root.
75+
76+
```sh copy
77+
pnpm add -w @latticexyz/explorer @latticexyz/store-indexer
78+
```
79+
80+
1. Edit `mprocs.yaml` to add the `indexer` and `explorer` processes.
81+
82+
<CollapseCode>
83+
84+
```yaml filename="mprocs.yaml" copy showLineNumbers {11-20}
85+
procs:
86+
client:
87+
cwd: packages/client
88+
shell: pnpm run dev
89+
contracts:
90+
cwd: packages/contracts
91+
shell: pnpm mud dev-contracts --rpc http://127.0.0.1:8545
92+
anvil:
93+
cwd: packages/contracts
94+
shell: anvil --base-fee 0 --block-time 2
95+
indexer:
96+
cwd: packages/contracts
97+
shell: rm -rf $SQLITE_FILENAME && pnpm sqlite-indexer
98+
env:
99+
RPC_HTTP_URL: "http://127.0.0.1:8545"
100+
FOLLOW_BLOCK_TAG: "latest"
101+
SQLITE_FILENAME: "indexer.db"
102+
explorer:
103+
cwd: packages/contracts
104+
shell: pnpm explorer
105+
```
106+
107+
</CollapseCode>
108+
109+
1. Restart `pnpm dev`.
110+
111+
1. Browse to [World Explorer](http://localhost:13690).
112+
113+
## Contributing
114+
115+
See [the README](https://github.com/latticexyz/mud/blob/main/packages/explorer/README.md).

0 commit comments

Comments
 (0)