Skip to content

Commit

Permalink
chore(all): prepare release 0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jan 12, 2015
1 parent f9df6e5 commit 8c0e3e4
Show file tree
Hide file tree
Showing 13 changed files with 561 additions and 327 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-framework",
"version": "0.6.0",
"version": "0.7.0",
"description": "The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.",
"keywords": [
"aurelia",
Expand Down
191 changes: 120 additions & 71 deletions dist/amd/aurelia.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-loader", "aurelia-templating", "./plugins"], function (exports, _aureliaLogging, _aureliaDependencyInjection, _aureliaLoader, _aureliaTemplating, _plugins) {
"use strict";

var _prototypeProperties = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};

var LogManager = _aureliaLogging;
var Container = _aureliaDependencyInjection.Container;
var Loader = _aureliaLoader.Loader;
Expand All @@ -12,88 +17,132 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
var Plugins = _plugins.Plugins;


var logger = LogManager.getLogger("aurelia");

var Aurelia = function Aurelia(loader, container, resources) {
this.loader = loader || Loader.createDefaultLoader();
this.container = container || new Container();
this.resources = resources || new ResourceRegistry();
this.resourcesToLoad = [];
this.plugins = new Plugins(this);
var logger = LogManager.getLogger("aurelia"),
slice = Array.prototype.slice;

this.withInstance(Aurelia, this);
this.withInstance(Loader, this.loader);
this.withInstance(ResourceRegistry, this.resources);
};

Aurelia.prototype.withInstance = function (type, instance) {
this.container.registerInstance(type, instance);
return this;
};
function loadResources(container, resourcesToLoad, appResources) {
var resourceCoordinator = container.get(ResourceCoordinator), current;

Aurelia.prototype.withSingleton = function (type, implementation) {
this.container.registerSingleton(type, implementation);
return this;
};
function next() {
if (current = resourcesToLoad.shift()) {
return resourceCoordinator.importResources(current).then(function (resources) {
resources.forEach(function (x) {
return x.register(appResources);
});
return next();
});
}

Aurelia.prototype.withResources = function (resources) {
if (Array.isArray(resources)) {
this.resourcesToLoad = this.resourcesToLoad.concat(resources);
} else {
this.resourcesToLoad = this.resourcesToLoad.concat(Array.prototype.slice.call(arguments));
return Promise.resolve();
}

return this;
};
return next();
}

Aurelia.prototype.start = function () {
var _this = this;
if (this.started) {
return;
}
var Aurelia = (function () {
function Aurelia(loader, container, resources) {
this.loader = loader || Loader.createDefaultLoader();
this.container = container || new Container();
this.resources = resources || new ResourceRegistry();
this.resourcesToLoad = [];
this.plugins = new Plugins(this);

this.started = true;
logger.info("Aurelia Starting");
this.withInstance(Aurelia, this);
this.withInstance(Loader, this.loader);
this.withInstance(ResourceRegistry, this.resources);
}

return this.plugins.process().then(function () {
if (!_this.container.hasHandler(BindingLanguage)) {
logger.error("You must configure Aurelia with a BindingLanguage implementation.");
_prototypeProperties(Aurelia, null, {
withInstance: {
value: function (type, instance) {
this.container.registerInstance(type, instance);
return this;
},
writable: true,
enumerable: true,
configurable: true
},
withSingleton: {
value: function (type, implementation) {
this.container.registerSingleton(type, implementation);
return this;
},
writable: true,
enumerable: true,
configurable: true
},
withResources: {
value: function (resources) {
if (Array.isArray(resources)) {
this.resourcesToLoad.push(resources);
} else {
this.resourcesToLoad.push(slice.call(arguments));
}

return this;
},
writable: true,
enumerable: true,
configurable: true
},
start: {
value: function () {
var _this = this;
if (this.started) {
return;
}

this.started = true;
logger.info("Aurelia Starting");

return this.plugins.process().then(function () {
if (!_this.container.hasHandler(BindingLanguage)) {
logger.error("You must configure Aurelia with a BindingLanguage implementation.");
}

return loadResources(_this.container, _this.resourcesToLoad, _this.resources).then(function () {
logger.info("Aurelia Started");
return _this;
});
});
},
writable: true,
enumerable: true,
configurable: true
},
setRoot: {
value: function (root, applicationHost) {
var _this2 = this;
var compositionEngine, instruction = {};

if (!applicationHost || typeof applicationHost == "string") {
this.host = document.getElementById(applicationHost || "applicationHost") || document.body;
} else {
this.host = applicationHost;
}

this.host.aurelia = this;
this.container.registerInstance(Element, this.host);

compositionEngine = this.container.get(CompositionEngine);
instruction.viewModel = root;
instruction.viewSlot = new ViewSlot(this.host, true);
instruction.container = instruction.childContainer = this.container;

return compositionEngine.compose(instruction).then(function (root) {
_this2.root = root;
instruction.viewSlot.attached();
return _this2;
});
},
writable: true,
enumerable: true,
configurable: true
}

return _this.container.get(ResourceCoordinator).importResources(_this.resourcesToLoad).then(function (resources) {
resources.forEach(function (x) {
return x.register(_this.resources);
});
logger.info("Aurelia Started");
return _this;
});
});
};

Aurelia.prototype.setRoot = function (root, applicationHost) {
var _this2 = this;
var compositionEngine, instruction = {};

if (!applicationHost || typeof applicationHost == "string") {
this.host = document.getElementById(applicationHost || "applicationHost") || document.body;
} else {
this.host = applicationHost;
}

this.host.aurelia = this;
this.container.registerInstance(Element, this.host);

compositionEngine = this.container.get(CompositionEngine);
instruction.viewModel = root;
instruction.viewSlot = new ViewSlot(this.host, true);
instruction.container = instruction.childContainer = this.container;

return compositionEngine.compose(instruction).then(function (root) {
_this2.root = root;
instruction.viewSlot.attached();
return _this2;
});
};
return Aurelia;
})();

exports.Aurelia = Aurelia;
});
22 changes: 12 additions & 10 deletions dist/amd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,28 @@ define(["exports", "./aurelia", "aurelia-dependency-injection", "aurelia-binding
};
};

var _exportsWildcard = function (obj) {
for (var i in obj) {
if (exports[i] !== undefined) {
exports[i] = obj[i];
var _defaults = function (obj, defaults) {
for (var key in defaults) {
if (obj[key] === undefined) {
obj[key] = defaults[key];
}
}

return obj;
};

exports.Aurelia = _aurelia.Aurelia;
_exportsWildcard(_interopRequireWildcard(_aureliaDependencyInjection));
_defaults(exports, _interopRequireWildcard(_aureliaDependencyInjection));

_exportsWildcard(_interopRequireWildcard(_aureliaBinding));
_defaults(exports, _interopRequireWildcard(_aureliaBinding));

_exportsWildcard(_interopRequireWildcard(_aureliaMetadata));
_defaults(exports, _interopRequireWildcard(_aureliaMetadata));

_exportsWildcard(_interopRequireWildcard(_aureliaTemplating));
_defaults(exports, _interopRequireWildcard(_aureliaTemplating));

_exportsWildcard(_interopRequireWildcard(_aureliaLoader));
_defaults(exports, _interopRequireWildcard(_aureliaLoader));

_exportsWildcard(_interopRequireWildcard(_aureliaTaskQueue));
_defaults(exports, _interopRequireWildcard(_aureliaTaskQueue));

var TheLogManager = _aureliaLogging;
var LogManager = exports.LogManager = TheLogManager;
Expand Down
62 changes: 41 additions & 21 deletions dist/amd/plugins.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
define(["exports", "aurelia-logging"], function (exports, _aureliaLogging) {
"use strict";

var _prototypeProperties = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};

var LogManager = _aureliaLogging;


Expand All @@ -26,32 +31,47 @@ define(["exports", "aurelia-logging"], function (exports, _aureliaLogging) {
});
}

var Plugins = function Plugins(aurelia) {
this.aurelia = aurelia;
this.info = [];
this.hasProcessed = false;
};
var Plugins = (function () {
function Plugins(aurelia) {
this.aurelia = aurelia;
this.info = [];
}

Plugins.prototype.install = function (moduleId, config) {
this.info.push({ moduleId: moduleId, config: config });
return this;
};
_prototypeProperties(Plugins, null, {
install: {
value: function (moduleId, config) {
this.info.push({ moduleId: moduleId, config: config });
return this;
},
writable: true,
enumerable: true,
configurable: true
},
process: {
value: function () {
var aurelia = this.aurelia,
loader = aurelia.loader,
info = this.info,
current;

Plugins.prototype.process = function () {
var toLoad = [], aurelia = this.aurelia, loader = aurelia.loader, info = this.info, i, ii;
var next = function () {
if (current = info.shift()) {
return loadPlugin(aurelia, loader, current).then(next);
}

if (this.hasProcessed) {
return Promise.resolve();
}
return Promise.resolve();
};

this.hasProcessed = true;

for (i = 0, ii = info.length; i < ii; ++i) {
toLoad.push(loadPlugin(aurelia, loader, info[i]));
}
return next();
},
writable: true,
enumerable: true,
configurable: true
}
});

return Promise.all(toLoad);
};
return Plugins;
})();

exports.Plugins = Plugins;
});

0 comments on commit 8c0e3e4

Please sign in to comment.