Refactoring of protos internals. Closes #127, #128 * Changes: - app/config/databases.js is now app/config/drivers.js - app/config/storage.js is now app/config/storages.js - boot.js stayUp variable defaults to 'production' instead of false - Added Protos::production - Removed Protos::async, Protos::done
This is a major update to the framework. Contains some bug fixes and code refactoring. Protos has now minimal dependencies, and provides an interface to install the dependencies needed for some framework components to work properly. Components can be loaded on demand. Framework components are drivers, storages, middleware and engines. Each one of these has its own set of dependencies, specified in the dependencies.json file, available on the framework's root. The boot.js file now has a 'components' event, which is where you should load your framework components. The following methods are now available: protos.loadDrivers protos.loadStorages protos.loadEngines The singular version of the commands is also available, to load a single component. The methods accept an arbitrary number of arguments (components) to load. For example, if your project is going to use the MongoDB & MySQL Driver, The Redis Storage and the EJS, Jade and Handlebars engines, you can load them as such: protos.loadDrivers('mongodb', 'mysql'); protos.loadStorage('redis'); protos.loadEngines('ejs', 'jade', 'handlebars'); Loading components makes sure protos has the necessary bindings to integrate the functionality provided by them. The application needs to have the necessary npm dependencies installed in order for the components to work properly. Luckily, this is plain easy with protos. To install the dependencies of the components in the example above, just run following command (within the app's path): protos install mongodb mysql redis jade handlebars This command will install all the dependencies needed for such components to work properly. Notice that the component name doesn't necessarily match the npm module name. A component may require multiple dependencies. Additionally, the EJS engine is not included since it's already bundled with protos. If an npm module is installed on the framework's path, the application can run without having the module installed, since protos will look for the module in its own path, if it's not found on the application's path. Being modular allows protos to be as lightweight as possible, only extending its functionality to what is really needed by the applications.