-
Notifications
You must be signed in to change notification settings - Fork 3.4k
RC1.0 Core Packages
Towards the RC (Release candidate) we are planning to release the next packages...
- i18n - Internationalisation
- Circles - Abstract data structure and api to describe object heirarchy and is used for permissions and content permissions
- Permissions - Role based heirarchical permissions system
- Menu - Menu management
In the admin package we plan to expose all settings for the packages in the modules page in the admin and to revive the ability to disable and enable core packages. A more robust Error implementation in package form.
Use Inject to push your service to the core to be aggregated.
inject(service);
In /packages/custom/customPkg/mean.json
use 'dependencies'
to list other mean package dependencies:
{'dependencies':{}}
All mean.json
dependencies are packages, not applications.
If a package is an intended application entry point, it should be declared in the root mean.json
'dependencies'
.
Unify all packages and move packages/core
to packages/linnovate
.
There needs to be some more definite separation ofmeanio
from packages/core/**
or packages/linnovate/**
.
meanio
should be the application in its entirety. packages are just a method of configuration and injecting code.
There are two diffrent ways to manage dependencies right now : Aggregation-core-module#specifying-files-to-be-aggregated. The global approach is fine for core dependencies required by all modules. The second one is fine for independent modules but has two drawbacks:
- As the dependencies are embedded into each module you might have the same dependency used twice (if used by two modules of your application), potentially leading to conflicts.
- The dependency list is not available outside the server code so you cannot for instance create gulp task to create a minified file of all dependencies of your module such as it is possible in the global approach. This makes MEAN.io not really friendly for approaches decoupling client/server code such as cordova.
The first issue can be resolved by keeping installing everything in the global bower_components folder and let bower manage this for us (you can benefit from resolution on specific versions as well, etc.). So we should have the following .bowerrc in all modules:
{
"directory": "../../../bower_components",
"storage": {
"packages": "../../../.bower-cache",
"registry": "../../../.bower-registry"
},
"tmp": "../../../.bower-tmp"
}
For the last issue we should have a 'service' that seamlessly manages the dependency injection as usual but based on a assets.json file for each module, for instance this file for a module name mymodule should be like this:
{
"mymodule": {
"css": {
"bower_components/build/mymodule/css/mymodule.min.css": [
"bower_components/library/lib.css",
...
]
},
"js": {
"bower_components/build/mymodule/js/mymodule.min.js": [
"bower_components/lib/lib.js",
...
]
},
"angularDependencies": ["mean.mymodule", "lib", ...]
}
}
Then the dependencies injection should look like this in the app.js of the module:
var Module = require('meanio').Module;
var moduleName = 'mymodule';
var AssetsManager = require(core('AssetsManager'));
var assets = new AssetsManager(require('./assets.json'), moduleName);
var MyModule = new Module(moduleName);
// MEAN packages registration
MyModule.register(function (app, auth, database, system) {
// Perform assets aggregation based on local assets.json for global dependencies
assets.aggregateAssets(MyModule);
// We enable routing. By default the Package Object is passed to the routes
MyModule.routes(app, auth, database);
...
}
The required service for dependencies injection is detailed here : AssetsManager.
- Getting Started Guides
- Deployment
- Testing
- System Deep Dives
Aggregation- Packages
- Database
- Menus
- Circles (roles/permissions) High Level Overview
- Circles code examples
- User Auth withJWT
- Contributing