@open_shield/plugin-builder
v1.0.3
Published
OpenShield Dashboard Plugin Builder — compile and package plugins for the dashboard
Maintainers
Readme
@openshield/plugin-builder
CLI tool for compiling and packaging OpenShield Dashboard plugins.
Installation
npm install -g @open_shield/plugin-builder
# or
npx @open_shield/plugin-builder <command>Usage
Create a new plugin
plugin-builder init --name my-plugin
cd my-plugin
npm installThis scaffolds a complete plugin project with:
- TypeScript configuration
- Manifest template
- Server boilerplate (API routes, DB migrations)
- Client boilerplate (React components)
- Plugin icon
Build a plugin
cd my-plugin
plugin-builder buildOutput: plugin-my-plugin-1.0.0.zip
The build process:
- Generates
manifest.jsonfrommanifest.ts(or reads existingmanifest.json) - Compiles
src/server/→server/index.js(Node.js, CommonJS, all deps bundled) - Compiles
src/client/→client/ui.js(Browser, IIFE, React/ReactDOM externalized) - Copies
src/server/migrations/*.sql→migrations/ - Copies
assets/*→assets/ - Packages everything into a
.ziparchive
Build options
plugin-builder build # Build from current directory
plugin-builder build --src ./plugin # Custom source directory
plugin-builder build --out ./dist # Custom output directory
plugin-builder build --skip-zip # Skip .zip creation (for development)Plugin Structure
my-plugin/
├── manifest.ts # Plugin manifest (or manifest.json)
├── package.json
├── tsconfig.json
├── src/
│ ├── server/
│ │ ├── index.ts # Server entry — API handlers, lifecycle hooks
│ │ └── migrations/ # SQL migration files
│ └── client/
│ └── index.tsx # Client entry — React components
└── assets/
└── icon.svg # Plugin iconRequirements
- Node.js 18+
- The plugin project must have
@openshield/plugin-sdkas a dependency
