Skip to content

Commit

Permalink
docs: migrate to Retype, add services api docs, setup deploy+preview …
Browse files Browse the repository at this point in the history
…actions (latticexyz#272)
  • Loading branch information
alvrs authored Nov 29, 2022
1 parent 2a044ba commit 151faf9
Show file tree
Hide file tree
Showing 107 changed files with 1,974 additions and 6,526 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# .github/workflows/docs.yml
name: Generate and deploy docs

on:
push:
branches:
- main
pull_request:

jobs:
docs:
runs-on: ubuntu-latest
name: Generate docs
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: Setup gomarkdoc
run: go install github.com/princjef/gomarkdoc/cmd/gomarkdoc@latest && export PATH=${PATH}:`go env GOPATH`/bin

- uses: actions/setup-node@v3
with:
node-version: 16

- name: git-checkout
uses: actions/checkout@v2

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install dependencies
run: yarn install --network-concurrency 1

- name: Generate docs
run: yarn docs

- name: Publish to Cloudflare Pages
id: cloudflare_publish
uses: cloudflare/pages-action@13c6a2f35417aaf1906cdbb1f6faf6c72c697b08
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: mud-dev
directory: .retype
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
38 changes: 0 additions & 38 deletions .github/workflows/mud-dev.yml

This file was deleted.

8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ name: Run tests

on:
push:
branches:
- main
pull_request:

jobs:
build:
test:
runs-on: ubuntu-latest
name: Run tests
steps:
- uses: actions/setup-node@v3
with:
node-version: 16

- name: git-checkout
uses: actions/checkout@v2

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules
.DS_STORE
.parcel-cache
.docs
lerna-debug.log
lerna-debug.log
.retype
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"solidity.remappings": [
"memmove/=node_modules/memmove/src/",
"ds-test/=node_modules/ds-test/src/",
"@openzeppelin/=node_modules/openzeppelin-solidity/",
"forge-std/=node_modules/forge-std/src/",
"solmate/=node_modules/@rari-capital/solmate/src",
"persona/=node_modules/@latticexyz/persona/src/",
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
icon: diff
label: Changelog
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
---
icon: public/logo512_dark.png
---

# MUD

MUD is an engine for autonomous worlds.

To get started, have a look at the [documentation](https://mud.dev) and [reference implementation](https://github.com/latticexyz/mudbasics) of a simple MUD project.

## Local dev setup

- Clone MUD: `git clone https://github.com/latticexyz/mud`
- Install go (to build packages/services): `https://go.dev/doc/install`
- Install jq (for various yarn commands): `https://stedolan.github.io/jq/download/`
- Install dependencies: `yarn` (in mud root)

## Library

[!embed](https://www.youtube.com/embed/j-_Zf8o5Wlo)
[!embed](https://www.youtube.com/embed/mv3jA4USZtg)
44 changes: 44 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<style>
.dark .dark\:text-blue-400, .dark, .dark .docs-markdown a:not(.no-link), .dark .dark\:hover\:text-blue-400:hover {
color: #eb4926;
}

.dark .dark\:hover\:text-blue-200:hover {
color: #f9ccc2;
}

.dark .dark\:bg-blue-400 {
background-color: #eb4926;
}

.dark .dark\:bg-dark-550 {
background-color: rgb(255 255 255 / 10%);
}

.dark .dark\:border-dark-600 {
border-color: rgb(255 255 255 / 5%);
}

.dark .dark\:bg-dark-650 {
background-color: #270e09;
}

.dark .dark\:bg-dark-850 {
background-color: #000000;
}

.dark .dark\:bg-dark-800 {
background-color: #000000;
}

.rounded, .rounded-r-lg, .rounded-l {
border-radius: 0;
}
</style>
<script>
const themeColor = localStorage.getItem("doc_theme");
if(!themeColor) {
localStorage.setItem("doc_theme", "dark")
document.documentElement.classList.add("dark");
}
</script>
File renamed without changes
File renamed without changes
Binary file added blog/avatars/alvarius.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 11 additions & 4 deletions packages/mud.dev/src/md/blog/ecs.md → blog/ecs.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Introduction to the Entity Component System (ECS) pattern
---
author:
name: alvarius
link: https://twitter.com/_alvarius
avatar: ./avatars/alvarius.jpeg
category: introduction
date: 2022-10-01
---

_by [alvarius](https://twitter.com/_alvarius)_
# Introduction to the Entity Component System (ECS) pattern

This article outlines the basics of the ECS pattern (or the ECS variant we use in MUD).
It is recommended to first read this introduction to create some general intuition for ECS before diving into more specific documentation of the MUD packages.

![intro to ecs](/assets/ecs-intro.png)
![intro to ecs](./assets/ecs-intro.png)

## Motivation

Expand Down Expand Up @@ -48,7 +55,7 @@ Now implementing our entities is trivial:
- `Tower`: [`Combat`]
- `Chest`: [`Inventory`]

![entities in ECS](/assets/ecs-solution.png)
![entities in ECS](./assets/ecs-solution.png)

And we even get the option to add more types of entities for free:

Expand Down
5 changes: 5 additions & 0 deletions guides/getting_started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
icon: rocket
---

coming soon
3 changes: 3 additions & 0 deletions guides/index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
expanded: true
order: 50
icon: book
3 changes: 1 addition & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"packages": [
"packages/*",
"packages/ri/*"
"packages/*"
],
"version": "1.29.0",
"npmClient": "yarn",
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"packages/std-contracts",
"packages/std-client",
"packages/ecs-browser",
"packages/mud.dev",
"packages/services",
"packages/noise"
]
Expand All @@ -36,9 +35,11 @@
"cz-conventional-changelog": "3.3.0",
"eslint": "^8.15.0",
"husky": ">=6",
"jq-cli-wrapper": "^1.6.1",
"lerna": "^4.0.0",
"lint-staged": ">=10",
"prettier": "^2.6.2",
"retypeapp": "^2.4.0",
"rimraf": "^3.0.2",
"run-pty": "^3.0.0",
"typescript": ">=3.0.0"
Expand All @@ -49,7 +50,7 @@
}
},
"scripts": {
"prepare": "husky install && (forge --version || yarn foundryup) && yarn lerna run prepare",
"prepare": "husky install && (forge --version || yarn foundryup) && yarn workspaces run prepare",
"commit": "cz",
"prettier:check": "prettier --check 'packages/**/*.ts'",
"prettier": "prettier --write 'packages/**/*.ts'",
Expand All @@ -58,7 +59,7 @@
"release:force": "yarn lerna run release",
"foundryup": "curl -L https://foundry.paradigm.xyz | bash && bash ~/.foundry/bin/foundryup",
"link:packages": "yarn lerna run link",
"docs": "yarn lerna run docs && rimraf .docs && mkdir .docs && for i in network phaserx recs solecs std-client std-contracts utils services; do mkdir .docs/$i && cp -r packages/$i/docs/* .docs/$i; done && rimraf packages/mud.dev/public/docs && mv .docs packages/mud.dev/public/docs",
"docs": "yarn lerna run docs && yarn retype build",
"test": "yarn workspaces run test",
"yalc:release": "yarn entry:dist && yarn lerna exec yalc push",
"yalc:reset": "yarn entry:src",
Expand Down
1 change: 1 addition & 0 deletions packages/cli/CHANGELOG.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
label: Changelog
3 changes: 3 additions & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# cli

docs coming soon
2 changes: 2 additions & 0 deletions packages/cli/index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
label: cli
order: 10
1 change: 1 addition & 0 deletions packages/ecs-browser/CHANGELOG.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
label: Changelog
2 changes: 1 addition & 1 deletion packages/ecs-browser/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# RECS Component Browser
# ECS Browser

Unity style Component Browser sidebar for debugging / development
1 change: 1 addition & 0 deletions packages/ecs-browser/index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
label: ecs-browser
6 changes: 3 additions & 3 deletions packages/ecs-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
"typescript": "^4.5.5"
},
"peerDependencies": {
"@latticexyz/recs": "^1",
"@latticexyz/std-client": "^1",
"@latticexyz/utils": "^1",
"@latticexyz/recs": "^1.28.1",
"@latticexyz/std-client": "^1.28.1",
"@latticexyz/utils": "^1.28.1",
"lodash": "^4.17.21",
"mobx": "^6.4.2",
"mobx-react-lite": "^3.4.0",
Expand Down
1 change: 1 addition & 0 deletions packages/index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
icon: code
26 changes: 0 additions & 26 deletions packages/mud.dev/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions packages/mud.dev/README.md

This file was deleted.

47 changes: 0 additions & 47 deletions packages/mud.dev/package.json

This file was deleted.

Binary file removed packages/mud.dev/public/apple-touch-icon.png
Binary file not shown.
Binary file removed packages/mud.dev/public/favicon-16x16.png
Binary file not shown.
Binary file removed packages/mud.dev/public/favicon-32x32.png
Binary file not shown.
Loading

0 comments on commit 151faf9

Please sign in to comment.