Skip to main content

Create a new plugin

Steps:

  1. Identify your usecase. Think if this is a common scenario and we need to create a plugin for this?
  2. Check all the plugins available.
  3. If a very similar plugin exists for the same usecase, contribute to that plugin.
  4. If a similar plugin doesn't exist, consider building a new plugin.

How to build a new plugin?

  1. Clone the base-template: git clone git@git.geekyants.com:framework-v3/frontend-plugins/base-fe-template.git
  2. Make the changes in the template folder.
  3. Please be mindful while making these changes. It should make sense in a project and should be easily mergable. Check structure for base-fe for frontend plugin and base-be for backend plugin.
  4. Update the plugin installation script in src/index.ts file. It uses merge functions from @gluestack-framework-v3/framework. Update those functions according to your plugin in the index file. Check structure for index merge file to see how to write index file to merge.
  5. Update the package.json with the name of the plugin.
  6. Add pluginDependencies in the package.json. Plugin dependencies are the dependent plugins on which this plugin will depend. e.g. in chat-fe, it is mandatory to have auth-fe installed in the project.
  7. Create a new repo for this plugin by the name ${{name}}-fe or ${{name}}-be in the subgroup
  8. Change the remote and push to this repository.
  9. Push to the main branch.

Register a plugin:

  1. Clone the framework repo: git clone git@git.geekyants.com:framework-v3/frontend-plugins/base-fe-template.git
  2. Go to plugins.ts file and register this plugin.
  3. Release a version for framework.
  4. Update the framework version in the plugin and again push to main branch.

Update cli with the new plugin:

  1. Clone the cli repo: git@git.geekyants.com:framework-v3/cli.git
  2. Update the framework version to latest.
  3. Publish the new version for cli updates.

Update the documentation for the new plugin:

  1. Clone the cli repo: git@git.geekyants.com:framework-v3/documentation.git
  2. Add the documentation generic for end users and plugin developer both.
  3. Test the documentation build and push to main.

How to test the new plugin that you added?

  1. Release alpha versions first and test the plugins and then release the stable versions.
  2. Try creating a project and add that plugin in your project. Check if the project is running fine and has all the things that you added?
  3. If yes, you have successfully created a new plugin.