This package provides a module-based architecture for AdonisJS, inspired by the popular Laravel modules package. It enables developers to structure their AdonisJS applications using a modular approach, organizing features into individual modules.
To install the package, run the following command:
npm install adonisjs-modulesAfter installing the package, configure it by running:
node ace configure adonisjs-modulesThis will set up the necessary files and make the commands available to you.
To create a new module, run:
node ace module:make <module_name>Replace <module_name> with the actual name of the module you want to create.
If you want to set a module as the default module, run:
node ace module:use <module_name>If you don’t set a default module, you will be required to pass the --module=<module_name> flag with each command you execute.
Once the package is configured, you can use the following commands to generate various module components. To see the list of available commands, run:
node ace module:make <component> [--module=<module_name>]Where <component> can be one of the following:
To see the full list you should run
node ace list moduleTo create a new controller inside a specific module:
node ace module:make-controller user --module=blogIf you have already set blog as the default module, you can simply run:
node ace module:make-controller userThis package is inspired by the Laravel Modules package, which offers a similar approach for structuring Laravel applications.
If you find this package useful, please consider giving it a star on GitHub. It helps others discover it and motivates continued development.