Maintainer: @hanzei Co-Maintainer: @jfrerich
This is a monorepo containing multiple Mattermost plugins demonstrating various capabilities. It uses Bazel as the build system for efficient builds and dependency management across all plugins.
The original demo plugin demonstrating the capabilities of a Mattermost plugin. It implements all supported server-side hooks and registers a component for each supported client-side integration point.
A second demo plugin with identical functionality but unique plugin ID for testing and development purposes.
Each plugin has its own directory with:
server/- Go server-side codewebapp/- React/TypeScript client-side codeassets/- Plugin assets (icons, etc.)public/- Static public filesplugin.json- Plugin manifest
This monorepo uses Bazel as the build system. To build the plugins:
- Bazel
- Go 1.19+
- Node.js 20.x
-
Build all plugins:
bazel build //:all_plugins
This generates
.tar.gzfiles for all plugins ready for distribution. -
Build individual plugins:
# Build demo plugin bazel build //demo:plugin_bundle # Build demo2 plugin bazel build //demo2:plugin_bundle
-
Build specific components:
# Build only a server component bazel build //demo/server:server_binaries # Build only a webapp component bazel build //demo/webapp:webapp_bundle
-
Run tests:
# Run Go tests for a specific plugin bazel test //demo/server:server_test bazel test //demo2/server:server_test # Run webapp tests bazel test //demo/webapp:test_config bazel test //demo2/webapp:test_config
├── demo/ # Demo Plugin
│ ├── assets/
│ ├── public/
│ ├── server/
│ ├── webapp/
│ ├── plugin.json
│ └── BUILD.bazel
├── demo2/ # Demo2 Plugin
│ ├── assets/
│ ├── public/
│ ├── server/
│ ├── webapp/
│ ├── plugin.json
│ └── BUILD.bazel
├── BUILD.bazel # Root build configuration
├── MODULE.bazel # Bazel module configuration
└── package.json # Shared Node.js dependencies
To add a new plugin to the monorepo:
- Create a new directory (e.g.,
my-plugin/) - Copy the structure from
demo/ordemo2/ - Update the
plugin.jsonwith unique ID and name - Create a
BUILD.bazelfile following the existing pattern - Add the new plugin to
//:all_pluginstarget in rootBUILD.bazel
Note that plugins are authored for the Mattermost version indicated in the min_server_version within each
plugin.json, and may not be compatible with earlier releases of Mattermost.
A new minor version of this plugin is released with every feature release of Mattermost. The new version should be cut until Code complete.