OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Generate CreateForm/EditForm dynamically for "args/options" from many CLI programs

  • Thread starter Thread starter Dimitri Kopriwa
  • Start date Start date
D

Dimitri Kopriwa

Guest
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 :

Code:
{ 
  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 ?

<p>I write code in node.js and typescript.</p>
<p>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 <code>CliOptionsEntity</code>, which have this shape :</p>
<pre class="lang-js prettyprint-override"><code>{
configName: string // unique identifier
name: string // the CLI package name
options: string // a json object with all args saved for this clie
}
</code></pre>
<p>I want to generate the <code>FormCreate</code> and <code>FormEdit</code> views dynamically (as opposite to create a new one each time I had a CLI), as I have many CLIs programs.</p>
<p>My CLI usually use <a href="https://www.npmjs.com/package/yargs" rel="nofollow noreferrer"><code>yargs</code></a> to have a generic interface for it's <code>args</code>. (I am OK to change if it helps.)</p>
<p>Usually, the CLI program is a <code>function</code>, which is just wrapped in my CLI interface.</p>
<p>What technical strategies can fit this use case so I can dynamically generate my form ?</p>
 

Latest posts

Top