BillyOutlast 9042a30bce fix(template): rewrite starter manifest to the v2 shape
- drop-plugin.json declares server/client blocks with client.entry
  (Drop Desktop never reads the legacy clientEntry alias), server
  capabilities at the top level, and no checked-in checksum/files map.
- Remove stray tracked compiled test artifacts (index.test.js/.d.ts).
- Point template dependencies and imports at @drop-oss/* and add the
  Node >=22 engine plus a typecheck script.
2026-09-14 23:11:45 -04:00
2026-09-14 20:01:04 -04:00
2026-09-14 20:01:04 -04:00
2026-09-14 11:39:59 -04:00

drop-plugin-sdk

Extensibility platform, runtime contract, and developer toolchain for the Drop game distribution platform.

Maintained by Heretek Games.


Packages

Package Version Role
@droposs/plugin-sdk (packages/plugin-sdk) 0.5.9 Universal runtime types (PLUGIN_API_VERSION = 2), JSON Schema, RPC helper client, and test harnesses (MockPluginContext, MockClientPluginContext).
@droposs/plugin-cli (packages/plugin-cli) 0.5.9 Developer CLI (drop-plugin) providing scaffolding (init), bundling (build), validation (validate), testing (test), signing (sign), and packaging (pack).
templates/starter-plugin 1.0.0 Reference starter template for creating full-stack Drop plugins (server + desktop client).

Quick Start

1. Scaffold a New Plugin

npx @droposs/plugin-cli init my-plugin
cd my-plugin
npm install

2. Implement Server and Client Logic

Server Entry (src/index.ts)

import type { PluginContext, ServerPlugin } from "@droposs/plugin-sdk";

export default class MyPlugin implements ServerPlugin {
  metadata = {
    id: "my-plugin",
    name: "My First Plugin",
    version: "1.0.0",
    apiVersion: 2,
    targets: ["server" as const],
    capabilities: ["routes" as const, "storage" as const],
  };

  async init(ctx: PluginContext): Promise<void> {
    ctx.registerRoute("GET", "/status", () => ({ ready: true }));
  }
}

Client Entry (src/client.ts)

import type { ClientPlugin, ClientPluginContext } from "@droposs/plugin-sdk";

export default class MyClientPlugin implements ClientPlugin {
  async init(ctx: ClientPluginContext): Promise<void> {
    ctx.registerPlayAction((gameId) => [
      {
        id: "custom-play",
        name: "Play with Custom Mod",
        execute: async () => {
          ctx.logger.info(`Launching game ${gameId} with custom mod`);
        },
      },
    ]);
  }
}

3. Build, Validate & Test

# Bundles TS source to ESM dist/ using esbuild and updates drop-plugin.json digests
npx drop-plugin build .

# Validates drop-plugin.json against official JSON Schema
npx drop-plugin validate .

# Executes unit tests against MockPluginContext and MockClientPluginContext
npx drop-plugin test .

4. Sign & Package for Distribution

# Cryptographically sign drop-plugin.json (uses DROP_PLUGIN_SIGNING_KEY if present)
npx drop-plugin sign .

# Packages bundle into a .dropplugin archive ready for Drop server/desktop installation
npx drop-plugin pack . ./dist-package

Architecture & Invariants

  • PLUGIN_API_VERSION = 2: Target API version matching Drop's plugin manager contract.
  • Strict Confinement: signer and pack enforce strict filesystem confinement, rejecting directory traversal (..) and symlinks escaping the bundle directory.
  • Capability Gating: All server and client capabilities must be explicitly declared in drop-plugin.json. Undeclared API calls throw in runtime and mock harnesses.
  • Zero Runtime Dependencies: @droposs/plugin-sdk contains zero third-party runtime dependencies.

Documentation & Guides

Comprehensive guides are available in the docs/ directory:


License

MIT © Heretek Games

S
Description
Drop Plugin SDK, TypeScript contracts (@drop/plugin-sdk), and CLI toolchain (drop-plugin)
Readme
390 KiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 81%
JavaScript 17.8%
Vue 1.2%