Skip to content

Commit

Permalink
add world explorer doc page
Browse files Browse the repository at this point in the history
  • Loading branch information
karooolis committed Aug 27, 2024
1 parent e583fc9 commit 972e0fa
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 4 deletions.
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
85 changes: 85 additions & 0 deletions docs/pages/world-explorer.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# World Explorer

World Explorer is a GUI tool designed for visually exploring and manipulating the state of worlds.

## Getting started

##### 1. **Install the package**

```sh
pnpm add @latticexyz/explorer
```

##### 2. **Start a local development chain**

Ensure you have a local development chain running.

##### 3. **Run the World Explorer**

```sh
npx @latticexyz/explorer --worldAddress <YOUR_WORLD_ADDRESS>
```

Alternatively, if you have a worlds configuration file:

```sh
npx @latticexyz/explorer --worldsConfigPath <PATH_TO_WORLDS_CONFIG>
```

Note: You can use `@latticexyz/store-indexer` for indexing your world's data.

## CLI arguments

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) | None |
| `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 |
| `env` | The environment to run the World Explorer in (e.g., "development", "production") | "production" |

## Example setup

An example setup is provided in the `examples/local-explorer` directory, demonstrating a full setup for using the World Explorer in a local development environment:

##### 1. **Setup**

```sh
cd examples/local-explorer && pnpm install
```

##### 2. **Run**

```sh
pnpm dev
```

This command starts all necessary processes, including a local chain, indexer, and the explorer.

## Contributing

To contribute to or modify the World Explorer, the easiest way is to run the example setup in `development` mode:

##### 1. **Setup**

Navigate to the `examples/local-explorer` directory and locate the `mprocs.yaml` file.

##### 2. **Configure**

In `mprocs.yaml`, ensure the `explorer` command is set up correctly. For example:

```yaml
explorer:
shell: pnpm explorer --worldsConfigPath packages/contracts/worlds.json --env development
```
##### 3. **Run**
```sh
pnpm dev
```

Files can now be edited in the `packages/explorer` directory, and changes will be reflected in the running World Explorer instance.
20 changes: 16 additions & 4 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"compilerOptions": {
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
Expand All @@ -10,7 +14,7 @@
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "Bundler",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
Expand All @@ -21,6 +25,14 @@
],
"strictNullChecks": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "pages/_meta.js", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"pages/_meta.js",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}

0 comments on commit 972e0fa

Please sign in to comment.