Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: plugins #702

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

feat: plugins #702

wants to merge 10 commits into from

Conversation

18alantom
Copy link
Member

@18alantom 18alantom commented Jul 19, 2023

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.
  • Allowing plugins to be more powerful
    • Registering database functions
    • Extending main process functionality
    • Allowing custom UI
    • Translations

- make connect private
- remove old problematic patch updateSchemas
- refactor a few imports
- move model file into plugin
- refactor doc.getDoc to doc.get
- refactor doc.getNewDoc to doc.new
@18alantom 18alantom added the DONT MERGE PR is not to be merged due to incomplete implementation or other issues. label Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DONT MERGE PR is not to be merged due to incomplete implementation or other issues.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant