Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into holic/remove-world-mo…
Browse files Browse the repository at this point in the history
…dules-cli-dep
  • Loading branch information
holic committed May 15, 2024
2 parents 593e3eb + 63e5d2d commit 94f14b1
Show file tree
Hide file tree
Showing 23 changed files with 16,070 additions and 12,878 deletions.
5 changes: 5 additions & 0 deletions .changeset/old-eagles-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-mud": patch
---

Added pnpm 9 to project's `engines`.
2 changes: 0 additions & 2 deletions .github/actions/setup-prerequisites/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ runs:
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8.x

- name: Setup node
uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.16.1
18.20.2
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN curl -L https://foundry.paradigm.xyz/ | bash && \
# pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="${PATH}:${PNPM_HOME}"
RUN npm install pnpm@8 --global && pnpm --version
RUN npm install pnpm@9.1.1 --global && pnpm --version

FROM base AS mud
COPY . /app
Expand Down
31 changes: 1 addition & 30 deletions docs/pages/guides/extending-a-world/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ We will now fix this.
<CollapseCode>
```ts filename="setupNetwork.ts" copy showLineNumbers {26-27,40,97}
```ts filename="setupNetwork.ts" copy showLineNumbers {25-26,39,96}
/*
* The MUD client code is built on top of viem
* (https://viem.sh/docs/getting-started.html).
Expand All @@ -715,7 +715,6 @@ We will now fix this.
ClientConfig,
getContract,
} from "viem";
import { createFaucetService } from "@latticexyz/services/faucet";
import { encodeEntity, syncToRecs } from "@latticexyz/store-sync/recs";

import { getNetworkConfig } from "./getNetworkConfig";
Expand Down Expand Up @@ -799,34 +798,6 @@ We will now fix this.
startBlock: BigInt(networkConfig.initialBlockNumber),
});

/*
* If there is a faucet, request (test) ETH if you have
* less than 1 ETH. Repeat every 20 seconds to ensure you don't
* run out.
*/
if (networkConfig.faucetServiceUrl) {
const address = burnerAccount.address;
console.info("[Dev Faucet]: Player address -> ", address);

const faucet = createFaucetService(networkConfig.faucetServiceUrl);

const requestDrip = async () => {
const balance = await publicClient.getBalance({ address });
console.info(`[Dev Faucet]: Player balance -> ${balance}`);
const lowBalance = balance < parseEther("1");
if (lowBalance) {
console.info("[Dev Faucet]: Balance is low, dripping funds to player");
// Double drip
await faucet.dripDev({ address });
await faucet.dripDev({ address });
}
};

requestDrip();
// Request a drip every 20 seconds
setInterval(requestDrip, 20000);
}

return {
world,
components,
Expand Down
31 changes: 1 addition & 30 deletions docs/pages/guides/hello-world/filter-sync.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Edit `packages/client/src/mud/setupNetwork.ts`.

<CollapseCode>

```ts filename="setupNetwork.ts" copy showLineNumbers {25-26,96-108}
```ts filename="setupNetwork.ts" copy showLineNumbers {24-25,95-107}
/*
* The MUD client code is built on top of viem
* (https://viem.sh/docs/getting-started.html).
Expand All @@ -39,7 +39,6 @@ import {
ClientConfig,
getContract,
} from "viem";
import { createFaucetService } from "@latticexyz/services/faucet";
import { encodeEntity, syncToRecs } from "@latticexyz/store-sync/recs";

import { getNetworkConfig } from "./getNetworkConfig";
Expand Down Expand Up @@ -133,34 +132,6 @@ export async function setupNetwork() {
],
});

/*
* If there is a faucet, request (test) ETH if you have
* less than 1 ETH. Repeat every 20 seconds to ensure you don't
* run out.
*/
if (networkConfig.faucetServiceUrl) {
const address = burnerAccount.address;
console.info("[Dev Faucet]: Player address -> ", address);

const faucet = createFaucetService(networkConfig.faucetServiceUrl);

const requestDrip = async () => {
const balance = await publicClient.getBalance({ address });
console.info(`[Dev Faucet]: Player balance -> ${balance}`);
const lowBalance = balance < parseEther("1");
if (lowBalance) {
console.info("[Dev Faucet]: Balance is low, dripping funds to player");
// Double drip
await faucet.dripDev({ address });
await faucet.dripDev({ address });
}
};

requestDrip();
// Request a drip every 20 seconds
setInterval(requestDrip, 20000);
}

return {
world,
components,
Expand Down
31 changes: 1 addition & 30 deletions docs/pages/state-query/typescript/zustand.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ To read data you use `useStore.getState()`. It supports the same functions as th

<CollapseCode>

```ts filename="setupNetwork.ts" showLineNumbers copy {14,86-93,124-125}
```ts filename="setupNetwork.ts" showLineNumbers copy {22,94-103,106-107}
/*
* The MUD client code is built on top of viem
* (https://viem.sh/docs/getting-started.html).
Expand All @@ -242,7 +242,6 @@ To read data you use `useStore.getState()`. It supports the same functions as th
parseEther,
ClientConfig,
} from "viem";
import { createFaucetService } from "@latticexyz/services/faucet";
import { encodeEntity, syncToRecs } from "@latticexyz/store-sync/recs";

import { getNetworkConfig } from "./getNetworkConfig";
Expand Down Expand Up @@ -332,34 +331,6 @@ To read data you use `useStore.getState()`. It supports the same functions as th
startBlock: BigInt(networkConfig.initialBlockNumber),
});

/*
* If there is a faucet, request (test) ETH if you have
* less than 1 ETH. Repeat every 20 seconds to ensure you don't
* run out.
*/
if (networkConfig.faucetServiceUrl) {
const address = burnerAccount.address;
console.info("[Dev Faucet]: Player address -> ", address);

const faucet = createFaucetService(networkConfig.faucetServiceUrl);

const requestDrip = async () => {
const balance = await publicClient.getBalance({ address });
console.info(`[Dev Faucet]: Player balance -> ${balance}`);
const lowBalance = balance < parseEther("1");
if (lowBalance) {
console.info("[Dev Faucet]: Balance is low, dripping funds to player");
// Double drip
await faucet.dripDev({ address });
await faucet.dripDev({ address });
}
};

requestDrip();
// Request a drip every 20 seconds
setInterval(requestDrip, 20000);
}

return {
tables,
useStore,
Expand Down
Loading

0 comments on commit 94f14b1

Please sign in to comment.