I write code in node.js and typescript.
I have a REST backoffice front-end (build with react-admin but it doesn’t matter) on which I need to develop a CRUD for CliOptionsEntity
, which have this shape :
{
configName: string // unique identifier
name: string // the CLI package name
options: string // a json object with all args saved for this clie
}
I want to generate the FormCreate
and FormEdit
views dynamically (as opposite to create a new one each time I had a CLI), as I have many CLIs programs.
My CLI usually use yargs
to have a generic interface for it’s args
. (I am OK to change if it helps.)
Usually, the CLI program is a function
, which is just wrapped in my CLI interface.
What technical strategies can fit this use case so I can dynamically generate my form ?