Use this library to scaffold your custom Monokle validation plugin in seconds. Once implemented the plugin can be used locally or contributed to our Monokle Community Plugins repository.
Read more about custom plugins in the Custom Validator documentation
This plugin can either be run interactively or with cli arguments.
Running in interactive mode:
npm create monokle-plugin@latest
will prompt for:
✔ Plugin name: … my-validation-plugin
✔ Select a plugin type: › validation
✔ Select a variant: › validation-ts
✔ Select a template: › basic
Scaffolding plugin in /Users/olensmar/WebstormProjects/monokle-core/packages/create-monokle-plugin/my-validation-plugin...
Done. Now run:
cd my-validation-plugin
npm install
npm run dev
Now you're all set to implement your Custom Plugin
Generated Folder Structure
For typescript plugins, the generated plugin will contain the following files/folders (somewhat depending on the selected template)
/src
/rules -> contains sample rules
/schemas
/crds -> contains sample CRDs
plugin.ts -> defines the plugin
.gitignore
package.json
README.md
tsconfig.json
Check the templates/validation-ts folder in this repo to see the actual templates used to generate the above.
Use the below syntax to provide all arguments upfront
npm create monokle-plugin@latest my-validator -- --template validation-ts
Head over to the Monokle Community Plugins repo to see existing community plugins and learn how you can create and share your own.
This project is a modified version of create-vite and most credits go to them.