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

beavers-system-interface

v2.2.2

Published

Beaver's System Interface

Downloads

5

Readme

Beaver's System Interface

Foundry Core Compatible Version Foundry System Download Count npm version

This module is for developers only. It helps to write system agnostic foundry vtt modules.

Beaver's System Interface is an interface for often used system dependent functionalities. When you write your module you just call the methods of this interface instead of writing system dependend code. It should speed up your development as well as gives your module the ability to work instantly for multiple Systems.

img.png

Beavers System Interface: Is an interface with some default implementations for common system dependent functionalities.

BSA-X: Beavers System Adapter for System x is an implementation of Beavers System Interface for System X.

The intention is that BSA-X implementations are kept small and simple, while complex algorithm are implemented within BSI.

Supported systems

Main Functionality v1

  • configurations e.g. list of skills,abilities,currencies
  • adjust Currencies
  • manipulate Items
  • roll on skill,abilities
  • UI Dialog Selectbox
  • TokenMovement

How to work with this

Setup

  • register your module to BSI
Hooks.on("beavers-system-interface.init", async function () {
    beaversSystemInterface.addModule("beavers-crafting");
});
  • enable your module only when a BSA implementation for the current system is found
Hooks.once("beavers-system-interface.ready", async function () {

}

Use BeaversSystemInterface

your module can access all "System" interface methods and properties:

functions

types.ts

e.g.

const selection = await beaversSystemInterface.uiDialogSelect({
    choices:[
    {text:"Carpenter's Tools:8",img:".."},
    {text:"Cartographer's Tools:8",img:".."},
    {text:"Weaver's Tools:8",img:".."},
    {text:"Alchemist's Supplies:8",img:".."}
  ]
});

img.png

TypeScript Support

When you use typescript for your module development, you can attach the types for beaversSystemInterface so your IDE can help you with spellings and autocompletion. There should be a npm package in the same version as the module.

package.json

{
  ...
  "devDependencies": {
    "beavers-system-interface": "^1.0.6"
  }
}

tsconfig.json

{
  "compilerOptions": {
    ...
    "types": [ "beavers-system-interface/src"]
  }
}

How to write BSA-X implementations

Setup

  • register your BSA-X to BSI
Hooks.on("beavers-system-interface.init", async function(){
  beaversSystemInterface.register(new Dnd5e());
});

Implement the SystemApi

create A class that implements the SystemApi

export class Dnd5e implements SystemApi {
  
}

and then implement it SystemApi

some methods have a default implementation see functions

Set your version to the major version of the SystemApi you implement.

Why this module

  • Request for another system

    I got requested to make my module available for another system. I did not know this system, so I searched for a way to allow others to write the system dependent parts for their system they know without breaking my module.
  • Discussion about "open gaming Licence"

    With the discussion of wizards of the coast "open gaming licence", I do no longer want to write a module explicitly for dnd especially if I can get sued for any or no reasons. So I decided to rewrite my module system agnostic. Then I only need to write an implementation of BSI for dnd5e, this implementation does not enable anyone todo anything it just connects an interface to its implementation this can not be sued.
  • Multiple modules use the same code