devbug/Units.flitter.js

97 lines
4.1 KiB
JavaScript
Raw Normal View History

2019-06-21 22:01:34 +00:00
/*
* The Flitter Units File
* -------------------------------------------------------------
* Flitter uses a unit-chain style initialization system. This means that
* individual components of Flitter and its add-ons are specified in order
* here. Then, when the app is created, Flitter creates a single functional
* chain by passing the next unit to the current unit's loading script. This
* launches Flitter with a single function call (FlitterApp.up()) and enables
* developers to contextualize Flitter within async or callback functions.
*/
const FlitterUnits = {
/*
* The Core Flitter Units
* -------------------------------------------------------------
* These units comprise the core functionality of Flitter. Unless you
* really know what you are doing, you should NEVER change them.
*/
'Config' : new (require('libflitter/config/ConfigUnit'))(),
'Utility' : new (require('libflitter/utility/UtilityUnit'))(),
'Database' : new (require('libflitter/database/DatabaseUnit'))(),
'Express' : new (require('libflitter/express/ExpressUnit'))(),
'ViewEngine' : new (require('libflitter/views/ViewEngineUnit'))(),
/*
* Pre-Routing Custom Units
* -------------------------------------------------------------
* Custom units that modify or add functionality that needs to be made
* available to the middleware-routing-controller stack.
*/
'Upload' : new (require('flitter-upload/UploadUnit'))(),
/*
* The Core Flitter Units
* -------------------------------------------------------------
* These units comprise the core functionality of Flitter. Unless you
* really know what you are doing, you should NEVER change them.
*/
'Middleware' : new (require('libflitter/middleware/MiddlewareUnit'))(),
'Controller' : new (require('libflitter/controller/ControllerUnit'))(),
'Routing' : new (require('libflitter/routing/RoutingUnit'))(),
'Static' : new (require('libflitter/static/StaticUnit'))(),
/*
* The Misc Unit
* -------------------------------------------------------------
* This unit loads changes and resources customized by the application.
*/
'Misc' : new (require('./app/MiscUnit'))(),
/*
* Secondary Flitter Units
* -------------------------------------------------------------
* These units aren't strictly required for the core functionality of
* Flitter, but they enable the use of certain Flitter tools, like the
* ./flitter command and its handlers.
*/
'Cli' : new (require('flitter-cli/CliUnit'))(),
'Forms' : new (require('flitter-forms/FormsUnit'))(),
'Auth' : new (require('flitter-auth/AuthUnit'))(),
'Flap' : new (require('flitter-flap/FlapUnit'))(),
/*
* Custom Flitter Units
* -------------------------------------------------------------
* Custom units should be specified here. They will be loaded in order
* after the core of Flitter has been initialized.
*/
// 'CustomUnit' : new CustomUnit(),
/*
* HTTP Error Handling
* -------------------------------------------------------------
* This unit provides default routes for invalid requests and tags them as
* 404 errors. It also provides middleware to display error views according
* to their HTTP status code. This allows for custom views which are located
* in views/errors/.
*/
'Error' : new (require('libflitter/errors/ErrorUnit'))(),
/*
* The Flitter App Unit
* -------------------------------------------------------------
* This should ALWAYS be the last unit to run. The app unit contains the
* call to the Node HTTP server that launches Flitter. Units listed after
* the app unit are in an lower context than the Flitter app and therefore
* won't be available to Flitter or the underlying Express framework.
*/
'App' : new (require('libflitter/app/AppUnit'))(),
}
module.exports = exports = FlitterUnits