dev-proxy icon indicating copy to clipboard operation
dev-proxy copied to clipboard

Improve plugin setup

Open Adam-it opened this issue 5 months ago • 3 comments

Currently (like in many other configure cases) if we want to setup some custom or predefined plugin to the proxy we need to modify the devproxyrc.json. This seems kinda hacky experience and when working with the proxy in a larger group I noticed many had problems with setting this up properly. For example, some were using a simple notepad to modify the JSON and made simple mistakes like missed , when adding a new array item, or extended the JSON in wrong place.

So I got a couple of ideas (smaller and bigger once) that might bring improvements to this experience:

  1. introduce a command in the devproxy (similar to msgraphdb command) which will open the devproxyrc.json in user default app to modify .json files. Something like devproxy settings. Why? ... well you wouldn't believe how many questions on teams I got like "hey, where may I find the devproxyrc.json?" 🙂
  2. introduce a json schema which will introduce validation that is specific to devproxy json format. Add it in the default devproxyrc.json. So that when someone will open it in VS Code (or something better than notepad 😉), then he or she will get additional inteli when modifying the .json file
  3. this is gonna be a hard one but I IMO 😋 it is an awesome suggestion. Introduce a command (or commands) that will modify the devproxyrc.json for the user. For example, running a command like devproxy plugin --name DevToolsPlugin would automatically for the user to extend the json with
{
  "name": "DevToolsPlugin",
  "enabled": true,
  "pluginPath": "plugins\\dev-proxy-plugins.dll",
  "configSection": "devTools"
}

and running the command should also prompt the user for plugin-specific data like

please provide value for:
preferredBrowser?

And introduce a similar command which will allow to modify the devproxyrc.json with a custom plugin. Something like devproxy customplugin --name myCustomgPlugin --pluginPath 'myCustomgPluginPathToDll' --enabled --configSection 'customPlugin' --config '{"customPlugin": "def"}' and the result of running this command should be

{
 "plugins": [
.....,
   {
     "name": "myCustomgPlugin",
     "enabled": true
     "pluginPath": "myCustomgPluginPathToDll",
     "configSection": "customPlugin"
   }
 ],
 "customPlugin": "def",
 ....
}

Let me know what you think 🙂. Cheers 👍

Adam-it avatar Jan 06 '24 01:01 Adam-it