tribe
Version:
Tribe is a platform for building rich, powerful, highly scalable distributed HTML5 web and mobile systems.
24 lines (22 loc) • 893 B
JavaScript
var facets = require('tribe/facets'),
flow = require('tribe/facets/flow'),
services = require('tribe/server/services'),
context = {};
module.exports = {
setContextPath: function (path, relative) {
context = { path: path, relative: relative };
},
facet: function (constructor, path) {
// if anyone uses a different extension, this will fail...
path = path || context.relative.replace(/\\/g, '/').replace('.js', '');
facets.register(path, constructor);
},
flow: function (constructor, path) {
path = path || context.relative.replace(/\\/g, '/').replace('.js', '');
if(path[0] !== '/')
path = '/' + path;
facets.register('/__flows' + path, flow(constructor));
},
service: services.register, // deprecated. only used by test-studio
model: function () { }
};