PR adds support for Plugins. Plugins allow extending Frappe Books by using third-party authors. For a dummy template plugin, check the folder Plugin Template
schemas/index.ts: builds to export schema extensions
models/index.ts: builds to extend renderer code using an initialize function:
function initialize(fyo: Fyo): Promise<void>;
This function can be used to call fyo methods, such as calling fyo.doc.registerModels to register models.
Development
Plugins that are being developed should be in the plugins subfolder. After it's done developing, yarn plugin --build can be used to build the plugin, this will create a books_plugin file.
Usage
Tentative installation of plugins is to be done by going to the plugin list view (open Quick Search and type Plugin), click on add and select the built books_plugin file.
After a plugin has been saved, changes will be visible on reloading the app.
Several additional things are required to incorporate this feature to the extent envisioned.
[ ] Documentation for plugin authors.
[ ] Better dev setup for plugin authors, hot reload for plugin files under development can be trivially implemented without having to build before usage.
[ ] Build script to build plugins in CI so that no central build server is required.
[ ] Pushing the built plugin to a central repository or maintaining a list of plugins in Frappe Books
[ ] Better UX for the discovery and installation and usage of plugins.
PR adds support for Plugins. Plugins allow extending Frappe Books by using third-party authors. For a dummy template plugin, check the folder Plugin Template
schemas/index.ts
: builds to export schema extensionsmodels/index.ts
: builds to extend renderer code using an initialize function:This function can be used to call
fyo
methods, such as callingfyo.doc.registerModels
to register models.Development
Plugins that are being developed should be in the
plugins
subfolder. After it's done developing,yarn plugin --build
can be used to build the plugin, this will create abooks_plugin
file.Usage
Tentative installation of plugins is to be done by going to the plugin list view (open Quick Search and type Plugin), click on add and select the built
books_plugin
file.After a plugin has been saved, changes will be visible on reloading the app.
Several additional things are required to incorporate this feature to the extent envisioned.