open-index/open-npm huggingface dataset:
npm package: @ps-maker/plugin-api
Description: Type definitions for creating Pixel Stories Maker plugins
Author: Pixel Stories
Latest version: 0.0.3

# @pixelstories/plugin-api

TypeScript type definitions for creating Pixel Stories Maker plugins.

## Installation

```bash
npm install @pixelstories/plugin-api
# or
pnpm add @pixelstories/plugin-api
# or
yarn add @pixelstories/plugin-api
```

## Usage

```typescript
import { definePlugin, defineEvent } from "@pixelstories/plugin-api";

const spawnItem = defineEvent({
  name: "Spawn Item",
  description: "Spawns an item at a position",
  parameterDefs: {
    x: { type: "number", description: "X position", defaultValue: 0 },
    y: { type: "number", description: "Y position", defaultValue: 0 },
    itemName: { type: "string", description: "Item name" }
  },
  execute(params, ctx) {
    // params is fully typed: { x: number, y: number, itemName: string }
    ctx.scene.add.sprite(params.x, params.y, params.itemName);
  }
});

export default definePlugin({
  name: "My Plugin",
  description: "A sample plugin",
  version: "1.0.0",
  events: [spawnItem]
});
```

## API

### `definePlugin(config)`

Define a plugin with metadata and events.

### `defineEvent(config)`

Define a plugin event with typed parameters.

### `PluginContext`

Context object passed to event handlers:

- `game` - The Phaser game instance
- `scene` - The current active scene
- `player` - The player sprite

## License

MIT
npm package: @ps-maker/plugin-cli
Description: Create and build Pixel Stories Maker plugins
Author: PixelStoriesOrg
Latest version: 0.1.7

# PS Maker Plugin CLI

Create and build plugins for **Pixel Stories Maker**.

## Quick Start

Create a new plugin:

```bash
npx @ps-maker/plugin-cli create
```

## Commands

### `create [target-dir]`

Scaffolds a new plugin project using the default template.

```bash
# Create a new plugin in
npx @ps-maker/plugin-cli create

# Create a new plugin in ./my-plugin
npx @ps-maker/plugin-cli create my-plugin

# Create a plugin in the current directory
npx @ps-maker/plugin-cli create .
```

---

### `build`

Builds your plugin from `src/index.ts` into a single bundled file.

```bash
# In project root
npm run build

# Or using npx
npx @ps-maker/plugin-cli build

# Or using command directly with it installed in project
npx ps-maker-plugin build
```

By default, the output is written to `dist/`.

## Plugin Development

- Edit your plugin logic in `src/index.ts`
- Run `npm run build` to generate the final plugin bundle
- Copy the built file into your Pixel Stories Maker project’s plugins folder

## Documentation

Plugin docs and API reference:

[https://pixelstories.io/docs/plugins/](https://pixelstories.io/docs/plugins/)