Packetize Adonis

Hey there,

I am looking for a way to packetize an adonis.js application so can put the following in a different node repo/npm package:

  • Some controllers
  • Routes
  • Possibly some config files
  • Migrations
  • Models

Basically extract the backend of my application into multiple packages. Then I need to put them all together and be able to manage their versions with node.

Haven’t been able to come up with a simple way. Ideally there should be a way to add multiple base paths for the resources so that all the controllers can get pulled from paths ['App/Controllers/','/node_modules/my_package/Controllers'], etc. Does this exist? Any other ideas?

Cheers!

You create packages where functionality can be encapsulated and code reused. For example; Authentication. You don’t want to package the core application, what’s the point?

Maybe I have misunderstood?

Yes, those packages are then registered as providers. My point is, can you register controllers, add new routes, migrations, etc…from those modules?

For instance in the Authentication module, schemas are copied into the project structure, which is undesirable for my purposes.