Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve plugin setup #473

Open
Adam-it opened this issue Jan 6, 2024 · 3 comments
Open

Improve plugin setup #473

Adam-it opened this issue Jan 6, 2024 · 3 comments
Labels
enhancement New feature or request needs spec Issue needs specification

Comments

@Adam-it
Copy link

Adam-it commented Jan 6, 2024

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 👍

@waldekmastykarz
Copy link
Collaborator

Awesome suggestion. Schema is the low hanging fruit and we've got it already in the latest beta.

Config wizard would be awesome. Each plugin would need to implement it itself because each one has distinct options. I'm also concerned about how we'd handle complex configuration like mocks. Let us think about it some more.

@waldekmastykarz waldekmastykarz added enhancement New feature or request needs spec Issue needs specification labels Jan 6, 2024
@waldekmastykarz
Copy link
Collaborator

  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?" 🙂

I think it would be better to get the default editor rather than the default app. I wonder how many folks associate .json files with their editor. Isn't the default opening them in a browser which would be useless?

@Adam-it
Copy link
Author

Adam-it commented Jan 9, 2024

not actually sure what is the default default as I already changed it.🤔 But if it is indeed a browser then yes, it is useless 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs spec Issue needs specification
Projects
None yet
Development

No branches or pull requests

2 participants