Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info

We recommend familiarising yourself with how the Forms CLI works before writing your own plugin.

What is a Forms CLI Plug-in?

The Forms CLI uses a plug-in to turn a JSON definition of a Blink form into source code for a specific framework. It deals only with forms and their functionality, however you could write a plug-in pack that could build an entire project. 

...

A plug-in consists of an entry point that exposes four functions that are called at various points by the Forms CLI. The Forms CLI must explose expose an object of the following structure:

...

Column
width800px


Code Block
languagejs
{
  build: (cfg) => Promise,
  init: (cfg) => Promise,
  processForm: (formDefinition) => Promise,
  writeTemplates: (destinationPath) => Promise
}


Your plug-in is a node module. You should be familiar with setting up your package.json correctly.

ProcessForm Function

processForm(definition) => Array<() => Promise>

...