npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@primodiumxyz/mud-game-tools

v1.0.15

Published

Tools for MUD Games

Downloads

431

Readme

Primodium Game Tools

Description

@primodiumxyz/mud-game-tools is a developer utility package designed to assist in building Ethereum applications with the MUD framework. This package streamlines the development process by offering a browser and specialized tabs: CheatcodesList and Editor, to interact with the onchain game state.

Features

  • Browser: A basic browser to navigate the onchain environment.
  • CheatcodesList: Write cheatcodes to manipulate the game state for testing.
  • Editor: A comprehensive editor to view and edit all parts of the game state.

Prerequisites

  • Node.js (>=14.0.0)
  • pnpm
  • MUD V2

Installation

Install with npm:

npm install @primodiumxyz/mud-game-tools

Usage

Browser

To integrate the development browser, add the following to your file:

import { Browser } from "mud-game-tools";
<Browser
  layers={{ react: { world, components: mud.components } }}
  world={world}
/>;

CheatcodesList

To add the Cheatcodes list to the browser, create a Cheatcodes object with the following interface:

export type Cheatcodes = Record<string, Cheatcode>;

// NOTE: the params field must match the names and types of function arguments
export type Cheatcode = {
  function: (...args: any[]) => any,
  params: { name: string, type: "number" | "string" | "boolean" }[],
};

To use it, add the cheatcodes as a parameter to the Browser:

import { Browser } from "mud-game-tools";
<Browser
  layers={{ react: { world, components: mud.components } }}
  world={world}
  cheatcodes={cheatcodes}
/>;

Access via the browser's Cheatcodes tab.

Editor

Access via the browser's Editor tab. This allows you to:

  • View game state
  • Modify components
  • Execute queries

Development

  1. Run the local development server:
    pnpm run dev

Contributions

Pull requests and issues are welcome.

To develop this package locally, clone the repository and install dependencies.

git clone https://github.com/primodiumxyz/mud-dev-tools.git
cd mud-dev-tools
pnpm install
pnpm build

License

MIT