1.1.3 • Published 6 months ago
@coffic/buddy-example-plugin v1.1.3
GitOK Sample Plugin (TypeScript Version)
This is a sample GitOK plugin developed using TypeScript. Through this example, you can learn how to create GitOK plugins using TypeScript.
Features
- Complete TypeScript type support
- Sample action implementations
- Custom view examples
Directory Structure
.
├── dist/ # Compiled JavaScript files
├── src/ # TypeScript source code
│ ├── index.ts # Plugin main entry
│ └── types.ts # TypeScript type definitions
├── views/ # HTML view files
│ ├── calculator.html
│ └── time.html
├── package.json # Project configuration
└── tsconfig.json # TypeScript configurationDevelopment Guide
Install Dependencies
pnpm installDevelopment Mode
pnpm devBuild
pnpm buildPlugin Features
This sample plugin provides three basic features:
- Greeting - Display a welcome message
- Current Time - Show current time (embedded view)
- Calculator - Provide a simple calculator (window view)
Type Definitions
The plugin uses TypeScript interfaces to define clear type structures:
Plugin- Main plugin interfaceAction- Action definition interfacePluginContext- Plugin context interface
How to Use
- Clone the repository
- Install dependencies:
pnpm install - Build the project:
pnpm build - Load this plugin in GitOK application
Links
License
MIT