I have created a remote preset that uses a 3rd party plugin that I created for my company. It uses a predefined config for the default Vue cli plugins and then should allow to make some customizations from the 3rd party plugin. The current way it works is that all the default plugins are installed, and then my 3rd party plugin. However, I discovered it would fail, because the prompts are not executed.
The ideal workflow would be like this: the developer that uses the preset executes the vue create command and a default Vue app is created with predefined default plugins and it's configuration. When the default plugins finish installing, the prompts from the 3rd party plugin would still execute so the app can be customized to the few options my company needs.
My remote preset looks like this:
{
      "useConfigFiles": false,
      "plugins": {
        "@vue/cli-plugin-babel": {},
        "@vue/cli-plugin-eslint": {
          "config": "standard",
          "lintOn": [
            "save"
          ]
        },
        "@vue/cli-plugin-unit-jest": {},
        "@vue/cli-plugin-e2e-cypress": {},
        "@mycompany/mypreset": {"version": "^1.0.0"}
      },
      "router": true,
      "vuex": true,
      "cssPreprocessor": "stylus"
    }
I purpose that the plugin config allows for an flag that can be set, which will (when set to true) still execute the prompts.
{
      "useConfigFiles": false,
      "plugins": {
        "@vue/cli-plugin-babel": {},
        "@vue/cli-plugin-eslint": {
          "config": "standard",
          "lintOn": [
            "save"
          ]
        },
        "@vue/cli-plugin-unit-jest": {},
        "@vue/cli-plugin-e2e-cypress": {},
        "@mycompany/mypreset": {"version": "^1.0.0", "prompts": true}
      },
      "router": true,
      "vuex": true,
      "cssPreprocessor": "stylus"
    }
Just throwing an alternative approach into the ring. Maybe we could check if:
a) the custom plugin has no config passed in the preset
b) the custom plugin has prompts.js
if a && b, then present the user with prompts for that plugin?
I'm facing a similar issue atm and the workaround is that the plugins aren't
listed in the preset, but users add them manually via npm and vue invoke (or simply vue add)
I think it's better to be explicit so I implemented support for { prompts: true }. Note this works for all presets, not just remote ones.
Most helpful comment
I think it's better to be explicit so I implemented support for
{ prompts: true }. Note this works for all presets, not just remote ones.