# @dicetable/plugin-shell

> Plugin Utilities for VTT-DiceTable Plugins

Latest version **0.14.0** (published 2026-10-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install @dicetable/plugin-shell
pnpm add @dicetable/plugin-shell
yarn add @dicetable/plugin-shell
bun add @dicetable/plugin-shell
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; no vulnerabilities; recently updated.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.14.0 |
| Published | 2026-10-15 |
| First published | 2024-05-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 18 |
| Unpacked size | 277.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | DiceTable |
| Maintainers | ainias42 |
| Keywords | vtt, plugin, dicetable |

## Links

- npm: https://www.npmjs.com/package/@dicetable/plugin-shell
- npm.io page: https://npm.io/package/@dicetable/plugin-shell

## Dependencies (18)

- [ajv](https://npm.io/package/ajv.md) ^8.20.0
- [sass](https://npm.io/package/sass.md) ^1.102.0
- [ts-node](https://npm.io/package/ts-node.md) ^10.9.2
- [webpack](https://npm.io/package/webpack.md) ^5.109.0
- [zustand](https://npm.io/package/zustand.md) ^4.5.5
- [ts-loader](https://npm.io/package/ts-loader.md) ^9.6.2
- [tsc-alias](https://npm.io/package/tsc-alias.md) ^1.9.1
- [css-loader](https://npm.io/package/css-loader.md) ^7.1.4
- [sass-loader](https://npm.io/package/sass-loader.md) ^17.0.0
- [webpack-cli](https://npm.io/package/webpack-cli.md) ^7.2.1
- [@types/react](https://npm.io/package/@types/react.md) ^19.2.17
- [style-loader](https://npm.io/package/style-loader.md) ^4.0.0
- [@types/webpack](https://npm.io/package/@types/webpack.md) ^5.28.5
- [zip-webpack-plugin](https://npm.io/package/zip-webpack-plugin.md) ^4.0.3
- [copy-webpack-plugin](https://npm.io/package/copy-webpack-plugin.md) ^14.0.0
- [isomorphic-style-loader](https://npm.io/package/isomorphic-style-loader.md) ^6.0.0
- [@types/webpack-dev-server](https://npm.io/package/@types/webpack-dev-server.md) ^4.7.2
- [tsconfig-paths-webpack-plugin](https://npm.io/package/tsconfig-paths-webpack-plugin.md) ^4.2.0

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 0.14.0 (latest) — 2026-10-15
- 0.2.0 — 2024-11-30
- 0.1.1 — 2024-05-23
- 0.1.0 — 2024-05-21

## README

# DiceTable Plugin Shell

The plugin shell is used for creating plugins for the [DiceTable-VTT](https://dicetable.net).  
This repository only exports one real type, the `createWebpackConfig`. All other exports are only
included as types. They will be provided by the DiceTable-VTT. This is to ensure that
the plugin itself is as small as possible, as the plugin is also saved inside the
savestate.

## Installation

It's a node package!

```bash
npm install @dicetable/plugin-shell
```

## Usage

### webpack.config.js

After installation, setup webpack to use the plugin shell. Basically add a file
`webpack.config.js` to your project with the following content:

```javascript
const createWebpackConfig = require("@dicetable/plugin-shell/createWebpackConfig");

module.exports = createWebpackConfig(__dirname);
```

This will create a webpack config that will bundle your plugin and replace everything
imported from the plugin shell with the global variables on the site.

Hot reload is enabled automatically when webpack runs in watch mode. You can configure
the endpoint through the second argument:

```javascript
module.exports = createWebpackConfig(__dirname, {
  hotReload: {
    enabled: true,
    port: 4242,
    host: "localhost",
    persistReloadedSource: true,
  },
});
```

For this to work, it reads your package.json. The following fields are used:

- `version` (only in the resulting zip)
- `name` (only in the resulting zip)

### package.json

After that add the webpack-command to your package.json:

```json
{
  "scripts": {
    "build": "webpack"
  }
}
```

You don't need to install webpack, as it is a dependency of the plugin shell.

### src/manifest.json

Now add the manifest.json at `src/manifest.json`. This file contains infos about
your plugin. The definition of the file can be
found [here](https://beta.dicetable.net/docs/plugin/types/PluginManifestType.html).
The PluginManifestType is also included inside the plugin-shell.
A simple and complete manifest.json looks like this:

```json
{
  "apiVersion": 1,
  "id": "com.example.unique.id",
  "label": {
    "en": "My Plugin",
    "de": "Mein Plugin"
  },
  "version": "1.0.0",
  "description": {
    "en": "This is my plugin",
    "de": "Das ist mein Plugin"
  },
  "dependencies": {
    "com.example.other.plugin.id": "^1.0.0"
  },
  "author": "My Name"
}
```

Only the fields `apiVersion`, `id`, `label` and `version` are required. All other fields
are optional. The apiVersion is the version of the plugin api that is used. If the
apiVersion of the plugin is not the same as the apiVersion of the DiceTable-VTT,
a warning will be displayed to the user, that the plugin may not be working correctly.

The id is the unique identifier. It must not start with `net.dicetable.`, as only
official plugins can start with this prefix. Be sure to pick a unique id, as only
one plugin with the same id can be installed at the same time!

The label is the name shown to the user. It is an object with the language as key.
`en` is mandatory, but you can add as many languages as you want, although only
languages that are supported by the DiceTable-VTT will be displayed. At the moment
this is only `en` and `de`. The same goes for the description, where you can describe
in more detail what your plugin does.

The version is a semver-version. It is used to check dependencies of the other plugins.

The dependencies is an object with the id of the plugin as key and the semver-version.
If a plugin your plugin depends on is not installed, the user will get an error message
while trying to install your plugin. At the same time, the user cannot uninstall your
plugin as long as other plugins depending on your plugin are installed.

The author field is a string with your name. It will be shown to the user inside the
plugin list.

### src/index.ts

Now you can start writing your plugin. The entry point is `src/index.ts`.
The basic structure of the file looks like this:

```typescript
import { registerPlugin } from "@dicetable/plugin-shell";
import manifest from "./manifest.json";

registerPlugin(manifest.id, (api) => {

});
```

be sure to set `resolveJsonModule` to `true` inside your tsconfig.json, otherwise
the manifest.json cannot be imported.

with help of the `api`-object you can add own windows, tools, data, token-objects
and many more things to the DiceTable-VTT. The `api`-object is defined inside
[here](https://beta.dicetable.net/docs/plugin/classes/PluginApi.html)

## Example

You can find an example plugin [here](https://github.com/dicetable/plugin-armor-class).
This plugin adds the amor class to the token sheet and object.

---
_Source: https://npm.io/package/@dicetable/plugin-shell · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
