c9 / architect

A simple yet powerful plugin system for large-scale node applications
MIT License
982 stars 129 forks source link

How do you manage plugins ? #59

Open jeremieca opened 7 years ago

jeremieca commented 7 years ago

Hello,

I have a question about the management of your plugins in C9. At C9, I think that you have multiples projects, with lots of plugins inside. And sometimes, you need to reuse plugin in another project. So :

If a developper, not working at C9, have an idea on the question, i'm also interested in !

Thanks !

nightwing commented 7 years ago

Hi we use a monorepo, mostly similar to https://github.com/c9/core, and a script to create separate repositories for each plugin from it.

jeremieca commented 7 years ago

Ok, thanks.

So if I well understand, you have one big repo containing all your server with plugins. And you have on repo per plugin (created by a script ?) ?

When you use a plugin in two projects, how do you propagate the change on plugins in the two projects ?

nightwing commented 7 years ago

We have only one project, that runs in many different configurations, and architect is mainly useful for running different configurations.

Currently architect doesn't automatically resolve dependencies. It allows to do the opposite, that is define dependencies manually. Say you have plugin A which provides services x, y and consumes service z, And plugins B and C which both provide service z, but implemented differently/working on different environments. Architect allows to pick plugins B or C without modifying code in A.

For example we have a config that when running on node-webkit loads implementation of clipboard plugin based on node-webkit api, and when running in browser loads the one based on html5 api

The script we have can separate a folder into a new repo and merge changes from the repo back into subfolder, so we could use it to pull changes from one project into another. But this approach would work best if both projects are maintained by same people, it won't work well for third party modules.