Creating a plugin
Zenith source code
Before starting to create a plugin you will need to have the zenith source code in some place of your machine
git clone https://github.com/sidekick-coder/zenith /home/user/projects/zenithThis is just to run the plugin you wont need change anything directly in the source code
Clone plugin starter repository
To start creating a plugin you can start by cloning the plugin starter repository
git clone \
https://github.com/sidekick-coder/zenith-plugin-starter \
/home/user/projects/my-pluginInstall the dependencies
npm installPlugin ulid
You will have generate a new ulid and add to update the zenith.config.yml
This is a unique id that will be used to identify the plugin in the app and also in the future marketplace, so make sure to generate a new one and not use the one in the starter repo
You can generate a new ulid with the following command
npx zkit ulidid: "01KRKSDD5BFHDMCKKD2C53DGBA" # replace this with a new ulid
name: "My Plugin"
...Link plugin to zenith source code
Now you just need to link the plugin to the zenith source code, you can do this just by adding a .env file in the root of the plugin with the following content
ZKIT_ZENITH_BASE_PATH=/home/user/projects/zenithThis will tell zenith-kit package where the zenith source code is located so it can use it to run the plugin
Runing
With everything set up you can now run the plugin with the following command
npm run dev # alias to npx zenith serveExecuting zenith commands
To execute zenith commands you can use npx
npx zenith route:list # list all routeszenith-kit package will automatically map to zenith
Your custom commands will also be available this way
npx zenith my-command # run my custom commandBuilding for production
To build the plugin for production you can use the following command
npm run build # alias to npx zkit buildNotes
configfolder is stored the zenith config filesstoragefolder is zenith storage foldersrcfolder that is loaded in developmentdistfolder that is loaded in production