joshwcomeau / guppy

🐠A friendly application manager and task runner for React.js
ISC License
3.27k stars 154 forks source link

Plugin / addon system for adding features to projects #313

Open AWolf81 opened 5 years ago

AWolf81 commented 5 years ago

As mentioned in this Tweet I'd like to add Docz to Guppy and Josh came up with the idea of an addon or plugin system to add Docz.

Is your feature request related to a problem? Please describe. For Docz it's not worth it to create a project type and it's more likely that it's used for documentation of a React or Gatsby app. (We could also add a vanilla js project type later where it would be easy to use a plugin/addon with-out anything else)

Describe the solution you'd like I think we can start with a menu item in current project called add plugin with a sub navigation menu where the Docz plugin can be picked for any project type.

Also add an icon to display that the project contains plugins.

(Later, it can be used for Gatsby-plugins too.)

After triggering the add Docz action: It will add the Docz dependency and two scripts docz:dev & docz:build to the package.json. We'll face again the issue #297. Where we're having an additional long running task.

So this is blocked by #297 which we need to fix first.

API It would be great if we could add the plugins/addons in a way so it's easy to create them and everything from Guppy can be controlled from a plugin:

But I'm not sure if it's worth it to create that complexity and I would start with-out that abstraction. But let me know what you think.