fixthestatusquo/proca

Create bin/widgetopt script

marcinkoziej opened this issue · 2 comments

@1v4n4 after Friday problem of "how to change color for all widgets" I figured out you can create a small command line tool called widgetopt (widget option).

It would:

usage

With scripts we could do something like:

./bin/widgetopt --primary-color '#aabbcc' 123

change the primaryColor of config file in config/123.json

it should also accept the filename so:

./bin/widgetopt --primary-color '#aabbcc' config/123.json

and also to give it > 1 files, so it modifies all.

It should contain other options (we need to determine which ones are needed mostly), so for examply:

  • --color a_color or --primary-color a_color
  • --last-name required and --last-name optional + same for other fields
  • --consent-XXX to define the consent on the widget
  • --test y/n

and so on.
This will make our support quicker and we won't have to check every time what is the field in json config.

I imagine this script to be quite simple, lets not make it more complex then necessary :)

It should support

widgetopt --help

to show all the options.

Use yargs or minimist (simpler) package to parse the options for the script.

tttp commented

let's rename widgetopt into set (rationale, "widget" is implied for all the other actions push/pull/build...) and the other cli commands are actions, not noon

tttp commented

implemented as bin/set.js