Skip to content

Commit

Permalink
Merge branch 'main' into holic/tx-queue-blockTag
Browse files Browse the repository at this point in the history
  • Loading branch information
holic authored Sep 1, 2024
2 parents 6858a5a + b434e8d commit 97cb87e
Show file tree
Hide file tree
Showing 219 changed files with 6,364 additions and 876 deletions.
5 changes: 0 additions & 5 deletions .changeset/clean-worms-walk.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/quick-frogs-fold.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/real-waves-bathe.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/swift-rabbits-appear.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/tasty-toys-deliver.md

This file was deleted.

7 changes: 0 additions & 7 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ runs:
- name: Setup prerequisites
uses: ./.github/actions/setup-prerequisites

# pnpm no longer runs this before the actual install (https://github.com/pnpm/pnpm/issues/3760)
# 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
# this resolves some chicken-and-egg problems with using workspace bins before they're created (install -> build -> install)
- name: Run prepare scripts
shell: bash
run: pnpm recursive run prepare

- name: Install node dependencies
shell: bash
run: pnpm install --frozen-lockfile
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/changeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Changeset

on:
pull_request:
paths:
- ".changeset/*.md"

jobs:
changeset:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test-published-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ jobs:
test-create-mud-project:
name: Test create-mud project
strategy:
fail-fast: false
matrix:
os: [depot-ubuntu-22.04-16, windows-latest]
os: [depot-ubuntu-22.04-16]
template: [vanilla, react, react-ecs, phaser, threejs]

runs-on: ${{ matrix.os }}
Expand Down
15 changes: 11 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,22 @@ yarn.lock
lerna-debug.log
yarn-error.log
.turbo
.attest
.tstrace

.env*

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

.env

# mud test data
test-data/world-logs-bulk-*.json
test-data/world-logs-query.json

.attest
.tstrace
# mud artifacts
.mud

# sqlite indexer data
*.db
*.db-journal
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ dist
templates/phaser/packages/art
CODEOWNERS
out

# forge docs output (gitignored anyway)
packages/*/docs
File renamed without changes.
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
## Version 2.2.0

Release date: Fri Aug 30 2024

### Minor changes

**[chore(explorer): update world explorer naming (#3069)](https://github.com/latticexyz/mud/commit/0eb25560cfc78354a5e6845c3244375759b71f4c)** (@latticexyz/explorer)

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.

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).

### Patch changes

**[fix(common): route all actions through viem client (#3071)](https://github.com/latticexyz/mud/commit/69cd0a1ba0450f3407ec5865334079653503fa86)** (@latticexyz/common)

Updated all custom Viem actions to properly call other actions via `getAction` so they can be composed.

**[build: use shx from dev deps (#3085)](https://github.com/latticexyz/mud/commit/c0bb0da58966b49c51570de9e3e031bee78b8473)** (create-mud)

Templates now use `shx` to run shell commands in scripts for better Windows compatibility.

**[feat(world): add namespaceLabel to system config (#3057)](https://github.com/latticexyz/mud/commit/04c675c946a0707956f38daad3fe516fde4a33a2)** (@latticexyz/config, @latticexyz/store)

Fixed a few type issues with `namespaceLabel` in tables and added/clarified TSDoc for config input/output objects.

**[fix(create-mud): update changeset package name + description (#3066)](https://github.com/latticexyz/mud/commit/bd4dffcabd6c6715df213e6c0c8b0631c9afc0b7)** (create-mud)

New projects created with `pnpm create mud` now include the World Explorer and SQLite indexer running as additional services.

**[feat(world): add namespaceLabel to system config (#3057)](https://github.com/latticexyz/mud/commit/04c675c946a0707956f38daad3fe516fde4a33a2)** (@latticexyz/cli, @latticexyz/world)

Add a strongly typed `namespaceLabel` to the system config output.
It corresponds to the `label` of the namespace the system belongs to and can't be set manually.

**[feat(cli,world): register system ABI onchain (#3050)](https://github.com/latticexyz/mud/commit/31caecc95be72fe94efd1df8cba2b5435fa39bb4)** (@latticexyz/cli)

In addition to table labels, system labels and ABIs are now registered onchain during deploy.

---

## Version 2.1.1

Release date: Tue Aug 20 2024
Expand Down
7 changes: 5 additions & 2 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence.

* @alvrs @holic @yonadaaa
* @alvrs @holic

docs/**/* @ludns @qbzzt @alvrs @holic @yonadaaa
/docs @ludns @qbzzt @alvrs @holic

/packages/explorer @alvrs @holic @karooolis
/examples/local-explorer @alvrs @holic @karooolis
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ FROM base AS mud
COPY . /app
WORKDIR /app

# pnpm no longer runs prepare before the actual install (https://github.com/pnpm/pnpm/issues/3760)
# 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
# this resolves some chicken-and-egg problems with using workspace bins before they're created (install -> build -> install)
RUN pnpm recursive run prepare
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN NODE_OPTIONS=--max-old-space-size=4096 pnpm run -r build

Expand Down
4 changes: 4 additions & 0 deletions docs/pages/_meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export default {
cli: "CLI",
"state-query": "State Query",
services: "Services",
"world-explorer": {
title: "World Explorer",
theme: { breadcrumb: false },
},
"---": {
title: "", // no title renders as a line
type: "separator",
Expand Down
41 changes: 41 additions & 0 deletions docs/pages/changelog.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
## Version 2.2.0

Release date: Fri Aug 30 2024

### Minor changes

**[chore(explorer): update world explorer naming (#3069)](https://github.com/latticexyz/mud/commit/0eb25560cfc78354a5e6845c3244375759b71f4c)** (@latticexyz/explorer)

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.

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).

### Patch changes

**[fix(common): route all actions through viem client (#3071)](https://github.com/latticexyz/mud/commit/69cd0a1ba0450f3407ec5865334079653503fa86)** (@latticexyz/common)

Updated all custom Viem actions to properly call other actions via `getAction` so they can be composed.

**[build: use shx from dev deps (#3085)](https://github.com/latticexyz/mud/commit/c0bb0da58966b49c51570de9e3e031bee78b8473)** (create-mud)

Templates now use `shx` to run shell commands in scripts for better Windows compatibility.

**[feat(world): add namespaceLabel to system config (#3057)](https://github.com/latticexyz/mud/commit/04c675c946a0707956f38daad3fe516fde4a33a2)** (@latticexyz/config, @latticexyz/store)

Fixed a few type issues with `namespaceLabel` in tables and added/clarified TSDoc for config input/output objects.

**[fix(create-mud): update changeset package name + description (#3066)](https://github.com/latticexyz/mud/commit/bd4dffcabd6c6715df213e6c0c8b0631c9afc0b7)** (create-mud)

New projects created with `pnpm create mud` now include the World Explorer and SQLite indexer running as additional services.

**[feat(world): add namespaceLabel to system config (#3057)](https://github.com/latticexyz/mud/commit/04c675c946a0707956f38daad3fe516fde4a33a2)** (@latticexyz/cli, @latticexyz/world)

Add a strongly typed `namespaceLabel` to the system config output.
It corresponds to the `label` of the namespace the system belongs to and can't be set manually.

**[feat(cli,world): register system ABI onchain (#3050)](https://github.com/latticexyz/mud/commit/31caecc95be72fe94efd1df8cba2b5435fa39bb4)** (@latticexyz/cli)

In addition to table labels, system labels and ABIs are now registered onchain during deploy.

---

## Version 2.1.1

Release date: Tue Aug 20 2024
Expand Down
15 changes: 14 additions & 1 deletion docs/pages/config/reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,26 @@ The following options are available in both single- and multiple-namespace modes
</Params>

</Param>

<Param name="modules">
<a id="modules" />
A list of modules to install into the world during the deploy step.

<Params title="Module config options">
<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>

<Param name="root">Whether or not to install this as a root module. Defaults to `false`.</Param>
<Param name="args">A list of arguments used to call the module's install function.</Param>

<Param name="args">
A list of arguments used to call the module's install function. Each argument is a structure with two fields:
<Params title="Structure in each argument">
<Param name="type">Solidity data type.</Param>
<Param name="value">
The value.
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).
</Param>
</Params>
</Param>
</Params>

</Param>
Expand Down
115 changes: 115 additions & 0 deletions docs/pages/world-explorer.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import { Tabs, Tab } from "nextra/components";
import { CollapseCode } from "../components/CollapseCode";

# World Explorer

World Explorer is a GUI tool designed for visually exploring and manipulating the state of worlds.
It is available in the MUD TypeScript templates starting with version 2.2.

## Usage

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).

<Tabs items={["Data Explorer", "Interact"]}>
<Tab>
<iframe
width="761"
height="523"
src="https://www.youtube.com/embed/87wuGFH9Pz0"
title="Using the MUD Data Explorer"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen
></iframe>
</Tab>
<Tab>
<iframe
width="761"
height="523"
src="https://www.youtube.com/embed/87wuGFH9Pz0?t=281https://www.youtube.com/embed/87wuGFH9Pz0?si=EsgcYGK9qk6J-Xvs&amp;start=281"
title="Using the MUD Data Explorer's Interact tab"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen
></iframe>
</Tab>
</Tabs>

### CLI options

To use the explorer with different command-line options, use this process:

1. In the mprocs screen, go down to the **explorer** process.

1. Type `x` to stop the default explorer.

1. In a different command-line window, go to `packages/contract`.

1. Run the explorer using `pnpm explorer <options>`.

The World Explorer accepts the following CLI arguments:

| Argument | Description | Default value |
| ----------------- | ------------------------------------------------------------------- | ------------- |
| `worldAddress` | The address of the world to explore | None |
| `worldsFile` | Path to a worlds configuration file (used to resolve world address) | "worlds.json" |
| `indexerDatabase` | Path to your SQLite indexer database | "indexer.db" |
| `chainId` | The chain ID of the network | 31337 |
| `port` | The port on which to run the World Explorer | 13690 |

## Installation

These installation steps are needed to add World Explorer to MUD 2.0 and 2.1.
In later versions the template already includes World Explorer.

1. Update to the latest MUD version (optional):

```sh copy
pnpm mud set-version --tag latest
pnpm install
```

1. Install the Indexer and World Explorer packages in the project root.

```sh copy
pnpm add -w @latticexyz/explorer @latticexyz/store-indexer
```

1. Edit `mprocs.yaml` to add the `indexer` and `explorer` processes.

<CollapseCode>

```yaml filename="mprocs.yaml" copy showLineNumbers {11-20}
procs:
client:
cwd: packages/client
shell: pnpm run dev
contracts:
cwd: packages/contracts
shell: pnpm mud dev-contracts --rpc http://127.0.0.1:8545
anvil:
cwd: packages/contracts
shell: anvil --base-fee 0 --block-time 2
indexer:
cwd: packages/contracts
shell: rm -rf $SQLITE_FILENAME && pnpm sqlite-indexer
env:
RPC_HTTP_URL: "http://127.0.0.1:8545"
FOLLOW_BLOCK_TAG: "latest"
SQLITE_FILENAME: "indexer.db"
explorer:
cwd: packages/contracts
shell: pnpm explorer
```

</CollapseCode>

1. Restart `pnpm dev`.

1. Browse to [World Explorer](http://localhost:13690).

## Contributing

See [the README](https://github.com/latticexyz/mud/blob/main/packages/explorer/README.md).
Loading

0 comments on commit 97cb87e

Please sign in to comment.