diff --git a/bower.json b/bower.json index cd11f7e1..292ab06f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-framework", - "version": "0.9.0", + "version": "0.10.0", "description": "The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.", "keywords": [ "aurelia", @@ -17,13 +17,14 @@ "url": "http://github.com/aurelia/framework" }, "dependencies": { - "aurelia-binding": "^0.4.0", - "aurelia-dependency-injection": "^0.5.0", - "aurelia-loader": "^0.4.0", - "aurelia-logging": "^0.2.6", - "aurelia-metadata": "^0.3.4", - "aurelia-path": "^0.4.6", - "aurelia-task-queue": "^0.2.5", - "aurelia-templating": "^0.9.0" + "aurelia-binding": "^0.5.0", + "aurelia-dependency-injection": "^0.6.0", + "aurelia-loader": "^0.5.0", + "aurelia-logging": "^0.3.0", + "aurelia-metadata": "^0.4.0", + "aurelia-path": "^0.5.0", + "aurelia-task-queue": "^0.3.0", + "aurelia-templating": "^0.10.0", + "core-js": "zloirock/core-js" } } diff --git a/config.js b/config.js index b5424732..8f239476 100644 --- a/config.js +++ b/config.js @@ -9,31 +9,62 @@ System.config({ System.config({ "map": { - "aurelia-binding": "github:aurelia/binding@0.4.0", - "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.5.0", - "aurelia-loader": "github:aurelia/loader@0.4.0", - "aurelia-logging": "github:aurelia/logging@0.2.6", - "aurelia-metadata": "github:aurelia/metadata@0.3.4", - "aurelia-path": "github:aurelia/path@0.4.6", - "aurelia-task-queue": "github:aurelia/task-queue@0.2.5", - "aurelia-templating": "github:aurelia/templating@0.9.0", + "aurelia-binding": "github:aurelia/binding@0.5.0", + "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.6.0", + "aurelia-loader": "github:aurelia/loader@0.5.0", + "aurelia-logging": "github:aurelia/logging@0.3.0", + "aurelia-metadata": "github:aurelia/metadata@0.4.0", + "aurelia-path": "github:aurelia/path@0.5.0", + "aurelia-task-queue": "github:aurelia/task-queue@0.3.0", + "aurelia-templating": "github:aurelia/templating@0.10.0", "core-js": "github:zloirock/core-js@0.8.1", "github:aurelia/binding@0.4.0": { "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.5.0", "aurelia-metadata": "github:aurelia/metadata@0.3.4", "aurelia-task-queue": "github:aurelia/task-queue@0.2.5" }, + "github:aurelia/binding@0.5.0": { + "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.6.0", + "aurelia-metadata": "github:aurelia/metadata@0.4.0", + "aurelia-task-queue": "github:aurelia/task-queue@0.3.0", + "core-js": "github:zloirock/core-js@0.8.1" + }, "github:aurelia/dependency-injection@0.5.0": { "aurelia-logging": "github:aurelia/logging@0.2.6", "aurelia-metadata": "github:aurelia/metadata@0.3.4", "core-js": "npm:core-js@0.4.10" }, + "github:aurelia/dependency-injection@0.6.0": { + "aurelia-logging": "github:aurelia/logging@0.3.0", + "aurelia-metadata": "github:aurelia/metadata@0.4.0", + "core-js": "github:zloirock/core-js@0.8.1" + }, "github:aurelia/loader@0.4.0": { "aurelia-html-template-element": "github:aurelia/html-template-element@0.1.3", "aurelia-path": "github:aurelia/path@0.4.6", "core-js": "npm:core-js@0.4.10", "webcomponentsjs": "github:webcomponents/webcomponentsjs@0.5.5" }, + "github:aurelia/loader@0.5.0": { + "aurelia-html-template-element": "github:aurelia/html-template-element@0.2.0", + "aurelia-path": "github:aurelia/path@0.5.0", + "core-js": "github:zloirock/core-js@0.8.1", + "webcomponentsjs": "github:webcomponents/webcomponentsjs@0.5.5" + }, + "github:aurelia/metadata@0.4.0": { + "core-js": "github:zloirock/core-js@0.8.1" + }, + "github:aurelia/templating@0.10.0": { + "aurelia-binding": "github:aurelia/binding@0.5.0", + "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.6.0", + "aurelia-html-template-element": "github:aurelia/html-template-element@0.2.0", + "aurelia-loader": "github:aurelia/loader@0.5.0", + "aurelia-logging": "github:aurelia/logging@0.3.0", + "aurelia-metadata": "github:aurelia/metadata@0.4.0", + "aurelia-path": "github:aurelia/path@0.5.0", + "aurelia-task-queue": "github:aurelia/task-queue@0.3.0", + "core-js": "github:zloirock/core-js@0.8.1" + }, "github:aurelia/templating@0.9.0": { "aurelia-binding": "github:aurelia/binding@0.4.0", "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.5.0", diff --git a/dist/amd/aurelia.js b/dist/amd/aurelia.js index 26ae9a0f..8e363753 100644 --- a/dist/amd/aurelia.js +++ b/dist/amd/aurelia.js @@ -1,27 +1,22 @@ -define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-loader", "aurelia-path", "./plugins", "aurelia-templating"], function (exports, _aureliaLogging, _aureliaDependencyInjection, _aureliaLoader, _aureliaPath, _plugins, _aureliaTemplating) { - "use strict"; - - var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; - - var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; - - var LogManager = _aureliaLogging; - var Container = _aureliaDependencyInjection.Container; - var Loader = _aureliaLoader.Loader; - var join = _aureliaPath.join; - var relativeToFile = _aureliaPath.relativeToFile; - var Plugins = _plugins.Plugins; - var BindingLanguage = _aureliaTemplating.BindingLanguage; - var ViewEngine = _aureliaTemplating.ViewEngine; - var ViewSlot = _aureliaTemplating.ViewSlot; - var ResourceRegistry = _aureliaTemplating.ResourceRegistry; - var CompositionEngine = _aureliaTemplating.CompositionEngine; - var Animator = _aureliaTemplating.Animator; - - var logger = LogManager.getLogger("aurelia"), +define(['exports', 'core-js', 'aurelia-logging', 'aurelia-dependency-injection', 'aurelia-loader', 'aurelia-path', './plugins', 'aurelia-templating'], function (exports, _coreJs, _aureliaLogging, _aureliaDependencyInjection, _aureliaLoader, _aureliaPath, _plugins, _aureliaTemplating) { + 'use strict'; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _core = _interopRequire(_coreJs); + + var logger = _aureliaLogging.getLogger('aurelia'), slice = Array.prototype.slice; - if (!window.CustomEvent || typeof window.CustomEvent !== "function") { + if (!window.CustomEvent || typeof window.CustomEvent !== 'function') { var CustomEvent = function CustomEvent(event, params) { var params = params || { bubbles: false, @@ -29,7 +24,7 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l detail: undefined }; - var evt = document.createEvent("CustomEvent"); + var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; }; @@ -39,18 +34,18 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l } function preventActionlessFormSubmit() { - document.body.addEventListener("submit", function (evt) { + document.body.addEventListener('submit', function (evt) { var target = evt.target; var action = target.action; - if (target.tagName.toLowerCase() === "form" && !action) { + if (target.tagName.toLowerCase() === 'form' && !action) { evt.preventDefault(); } }); } function loadResources(container, resourcesToLoad, appResources) { - var viewEngine = container.get(ViewEngine), + var viewEngine = container.get(_aureliaTemplating.ViewEngine), importIds = Object.keys(resourcesToLoad), names = new Array(importIds.length), i, @@ -63,212 +58,130 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l return viewEngine.importViewResources(importIds, names, appResources); } - /** - * The framework core that provides the main Aurelia object. - * - * @class Aurelia - * @constructor - * @param {Loader} loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader. - * @param {Container} container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container. - * @param {ResourceRegistry} resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. - */ - - var Aurelia = exports.Aurelia = (function () { + var Aurelia = (function () { function Aurelia(loader, container, resources) { _classCallCheck(this, Aurelia); this.loader = loader || new window.AureliaLoader(); - this.container = container || new Container(); - this.resources = resources || new ResourceRegistry(); - this.use = new Plugins(this); + this.container = container || new _aureliaDependencyInjection.Container(); + this.resources = resources || new _aureliaTemplating.ResourceRegistry(); + this.use = new _plugins.Plugins(this); this.resourcesToLoad = {}; this.withInstance(Aurelia, this); - this.withInstance(Loader, this.loader); - this.withInstance(ResourceRegistry, this.resources); + this.withInstance(_aureliaLoader.Loader, this.loader); + this.withInstance(_aureliaTemplating.ResourceRegistry, this.resources); } - _prototypeProperties(Aurelia, null, { - withInstance: { - - /** - * Adds an existing object to the framework's dependency injection container. - * - * @method withInstance - * @param {Class} type The object type of the dependency that the framework will inject. - * @param {Object} instance The existing instance of the dependency that the framework will inject. - * @return {Aurelia} Returns the current Aurelia instance. - */ - - value: function withInstance(type, instance) { - this.container.registerInstance(type, instance); - return this; - }, - writable: true, - configurable: true - }, - withSingleton: { - - /** - * Adds a singleton to the framework's dependency injection container. - * - * @method withSingleton - * @param {Class} type The object type of the dependency that the framework will inject. - * @param {Object} implementation The constructor function of the dependency that the framework will inject. - * @return {Aurelia} Returns the current Aurelia instance. - */ - - value: function withSingleton(type, implementation) { - this.container.registerSingleton(type, implementation); - return this; - }, - writable: true, - configurable: true - }, - globalizeResources: { - - /** - * Adds globally available view resources to be imported into the Aurelia framework. - * - * @method globalizeResources - * @param {Object|Array} resources The relative module id to the resource. (Relative to the plugin's installer.) - * @return {Aurelia} Returns the current Aurelia instance. - */ - - value: function globalizeResources(resources) { - var toAdd = Array.isArray(resources) ? resources : arguments, - i, - ii, - pluginPath = this.currentPluginId || "", - path, - internalPlugin = pluginPath.startsWith("./"); - - for (i = 0, ii = toAdd.length; i < ii; ++i) { - path = internalPlugin ? relativeToFile(toAdd[i], pluginPath) : join(pluginPath, toAdd[i]); - - this.resourcesToLoad[path] = this.resourcesToLoad[path]; - } - - return this; - }, - writable: true, - configurable: true - }, - renameGlobalResource: { - - /** - * Renames a global resource that was imported. - * - * @method renameGlobalResource - * @param {String} resourcePath The path to the resource. - * @param {String} newName The new name. - * @return {Aurelia} Returns the current Aurelia instance. - */ - - value: function renameGlobalResource(resourcePath, newName) { - this.resourcesToLoad[resourcePath] = newName; - return this; - }, - writable: true, - configurable: true - }, - start: { - - /** - * Loads plugins, then resources, and then starts the Aurelia instance. - * - * @method start - * @return {Aurelia} Returns the started Aurelia instance. - */ - - value: function start() { - var _this = this; - - if (this.started) { - return Promise.resolve(this); - } + _createClass(Aurelia, [{ + key: 'withInstance', + value: function withInstance(type, instance) { + this.container.registerInstance(type, instance); + return this; + } + }, { + key: 'withSingleton', + value: function withSingleton(type, implementation) { + this.container.registerSingleton(type, implementation); + return this; + } + }, { + key: 'globalizeResources', + value: function globalizeResources(resources) { + var toAdd = Array.isArray(resources) ? resources : arguments, + i, + ii, + pluginPath = this.currentPluginId || '', + path, + internalPlugin = pluginPath.startsWith('./'); + + for (i = 0, ii = toAdd.length; i < ii; ++i) { + path = internalPlugin ? _aureliaPath.relativeToFile(toAdd[i], pluginPath) : _aureliaPath.join(pluginPath, toAdd[i]); + + this.resourcesToLoad[path] = this.resourcesToLoad[path]; + } + + return this; + } + }, { + key: 'renameGlobalResource', + value: function renameGlobalResource(resourcePath, newName) { + this.resourcesToLoad[resourcePath] = newName; + return this; + } + }, { + key: 'start', + value: function start() { + var _this = this; - this.started = true; - logger.info("Aurelia Starting"); + if (this.started) { + return Promise.resolve(this); + } - preventActionlessFormSubmit(); + this.started = true; + logger.info('Aurelia Starting'); - return this.use._process().then(function () { - if (!_this.container.hasHandler(BindingLanguage)) { - var message = "You must configure Aurelia with a BindingLanguage implementation."; - logger.error(message); - throw new Error(message); - } + preventActionlessFormSubmit(); - if (!_this.container.hasHandler(Animator)) { - Animator.configureDefault(_this.container); - } + return this.use._process().then(function () { + if (!_this.container.hasHandler(_aureliaTemplating.BindingLanguage)) { + var message = 'You must configure Aurelia with a BindingLanguage implementation.'; + logger.error(message); + throw new Error(message); + } - return loadResources(_this.container, _this.resourcesToLoad, _this.resources).then(function () { - logger.info("Aurelia Started"); - var evt = new window.CustomEvent("aurelia-started", { bubbles: true, cancelable: true }); - document.dispatchEvent(evt); - return _this; - }); - }); - }, - writable: true, - configurable: true - }, - setRoot: { - - /** - * Instantiates the root view-model and view and add them to the DOM. - * - * @method withSingleton - * @param {Object} root The root view-model to load upon bootstrap. - * @param {string|Object} applicationHost The DOM object that Aurelia will attach to. - * @return {Aurelia} Returns the current Aurelia instance. - */ - - value: function setRoot() { - var _this = this; - - var root = arguments[0] === undefined ? "app" : arguments[0]; - var applicationHost = arguments[1] === undefined ? null : arguments[1]; - - var compositionEngine, - instruction = {}; - - if (!applicationHost || typeof applicationHost == "string") { - this.host = document.getElementById(applicationHost || "applicationHost") || document.body; - } else { - this.host = applicationHost; + if (!_this.container.hasHandler(_aureliaTemplating.Animator)) { + _aureliaTemplating.Animator.configureDefault(_this.container); } - this.host.aurelia = this; - this.container.registerInstance(Element, this.host); - - compositionEngine = this.container.get(CompositionEngine); - instruction.viewModel = root; - instruction.container = instruction.childContainer = this.container; - instruction.viewSlot = new ViewSlot(this.host, true); - instruction.viewSlot.transformChildNodesIntoView(); - - return compositionEngine.compose(instruction).then(function (root) { - _this.root = root; - instruction.viewSlot.attached(); - var evt = new window.CustomEvent("aurelia-composed", { bubbles: true, cancelable: true }); - setTimeout(function () { - return document.dispatchEvent(evt); - }, 1); + return loadResources(_this.container, _this.resourcesToLoad, _this.resources).then(function () { + logger.info('Aurelia Started'); + var evt = new window.CustomEvent('aurelia-started', { bubbles: true, cancelable: true }); + document.dispatchEvent(evt); return _this; }); - }, - writable: true, - configurable: true + }); } - }); + }, { + key: 'setRoot', + value: function setRoot() { + var _this2 = this; + + var root = arguments[0] === undefined ? 'app' : arguments[0]; + var applicationHost = arguments[1] === undefined ? null : arguments[1]; + + 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(_aureliaTemplating.CompositionEngine); + instruction.viewModel = root; + instruction.container = instruction.childContainer = this.container; + instruction.viewSlot = new _aureliaTemplating.ViewSlot(this.host, true); + instruction.viewSlot.transformChildNodesIntoView(); + + return compositionEngine.compose(instruction).then(function (root) { + _this2.root = root; + instruction.viewSlot.attached(); + var evt = new window.CustomEvent('aurelia-composed', { bubbles: true, cancelable: true }); + setTimeout(function () { + return document.dispatchEvent(evt); + }, 1); + return _this2; + }); + } + }]); return Aurelia; })(); - Object.defineProperty(exports, "__esModule", { - value: true - }); + exports.Aurelia = Aurelia; }); \ No newline at end of file diff --git a/dist/amd/index.js b/dist/amd/index.js index 2a4709af..33b3ac32 100644 --- a/dist/amd/index.js +++ b/dist/amd/index.js @@ -1,17 +1,19 @@ -define(["exports", "./aurelia", "aurelia-dependency-injection", "aurelia-binding", "aurelia-metadata", "aurelia-templating", "aurelia-loader", "aurelia-task-queue", "aurelia-logging"], function (exports, _aurelia, _aureliaDependencyInjection, _aureliaBinding, _aureliaMetadata, _aureliaTemplating, _aureliaLoader, _aureliaTaskQueue, _aureliaLogging) { - "use strict"; +define(['exports', 'aurelia-logging', './aurelia', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-metadata', 'aurelia-templating', 'aurelia-loader', 'aurelia-task-queue'], function (exports, _aureliaLogging, _aurelia, _aureliaDependencyInjection, _aureliaBinding, _aureliaMetadata, _aureliaTemplating, _aureliaLoader, _aureliaTaskQueue) { + 'use strict'; - var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; }; + var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; var _defaults = function (obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }; - /** - * The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform. - * - * @module framework - */ - - exports.Aurelia = _aurelia.Aurelia; + Object.defineProperty(exports, '__esModule', { + value: true + }); + Object.defineProperty(exports, 'Aurelia', { + enumerable: true, + get: function get() { + return _aurelia.Aurelia; + } + }); _defaults(exports, _interopRequireWildcard(_aureliaDependencyInjection)); @@ -25,9 +27,6 @@ define(["exports", "./aurelia", "aurelia-dependency-injection", "aurelia-binding _defaults(exports, _interopRequireWildcard(_aureliaTaskQueue)); - var TheLogManager = _aureliaLogging; - var LogManager = exports.LogManager = TheLogManager; - Object.defineProperty(exports, "__esModule", { - value: true - }); + var LogManager = _aureliaLogging; + exports.LogManager = LogManager; }); \ No newline at end of file diff --git a/dist/amd/plugins.js b/dist/amd/plugins.js index 0cfda78b..982fd727 100644 --- a/dist/amd/plugins.js +++ b/dist/amd/plugins.js @@ -1,49 +1,46 @@ -define(["exports", "aurelia-logging", "aurelia-metadata"], function (exports, _aureliaLogging, _aureliaMetadata) { - "use strict"; +define(['exports', 'core-js', 'aurelia-logging', 'aurelia-metadata'], function (exports, _coreJs, _aureliaLogging, _aureliaMetadata) { + 'use strict'; - var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; - var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - var LogManager = _aureliaLogging; - var Metadata = _aureliaMetadata.Metadata; + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - var logger = LogManager.getLogger("aurelia"); + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _core = _interopRequire(_coreJs); + + var logger = _aureliaLogging.getLogger('aurelia'); function loadPlugin(aurelia, loader, info) { - logger.debug("Loading plugin " + info.moduleId + "."); + logger.debug('Loading plugin ' + info.moduleId + '.'); aurelia.currentPluginId = info.moduleId; return loader.loadModule(info.moduleId).then(function (exportedValue) { - if ("install" in exportedValue) { + if ('install' in exportedValue) { var result = exportedValue.install(aurelia, info.config || {}); if (result) { return result.then(function () { aurelia.currentPluginId = null; - logger.debug("Installed plugin " + info.moduleId + "."); + logger.debug('Installed plugin ' + info.moduleId + '.'); }); } else { - logger.debug("Installed plugin " + info.moduleId + "."); + logger.debug('Installed plugin ' + info.moduleId + '.'); } } else { - logger.debug("Loaded plugin " + info.moduleId + "."); + logger.debug('Loaded plugin ' + info.moduleId + '.'); } aurelia.currentPluginId = null; }); } - /** - * Manages loading and installing plugins. - * - * @class Plugins - * @constructor - * @param {Aurelia} aurelia An instance of Aurelia. - */ - - var Plugins = exports.Plugins = (function () { + var Plugins = (function () { function Plugins(aurelia) { _classCallCheck(this, Plugins); @@ -52,117 +49,81 @@ define(["exports", "aurelia-logging", "aurelia-metadata"], function (exports, _a this.processed = false; } - _prototypeProperties(Plugins, null, { - plugin: { - - /** - * Installs a plugin before Aurelia starts. - * - * @method plugin - * @param {moduleId} moduleId The ID of the module to install. - * @param {config} config The configuration for the specified module. - * @return {Plugins} Returns the current Plugins instance. - */ - - value: (function (_plugin) { - var _pluginWrapper = function plugin(_x, _x2) { - return _plugin.apply(this, arguments); - }; + _createClass(Plugins, [{ + key: 'plugin', + value: (function (_plugin) { + function plugin(_x, _x2) { + return _plugin.apply(this, arguments); + } - _pluginWrapper.toString = function () { - return _plugin.toString(); - }; + plugin.toString = function () { + return _plugin.toString(); + }; - return _pluginWrapper; - })(function (moduleId, config) { - var plugin = { moduleId: moduleId, config: config || {} }; + return plugin; + })(function (moduleId, config) { + var plugin = { moduleId: moduleId, config: config || {} }; - if (this.processed) { - loadPlugin(this.aurelia, this.aurelia.loader, plugin); - } else { - this.info.push(plugin); - } + if (this.processed) { + loadPlugin(this.aurelia, this.aurelia.loader, plugin); + } else { + this.info.push(plugin); + } - return this; - }), - writable: true, - configurable: true - }, - es5: { - - /** - * Installs special support for ES5 authoring. - * - * @method es5 - * @return {Plugins} Returns the current Plugins instance. - */ - - value: function es5() { - Function.prototype.computed = function (computedProperties) { - for (var key in computedProperties) { - if (computedProperties.hasOwnProperty(key)) { - Object.defineProperty(this.prototype, key, { get: computedProperties[key], enumerable: true }); - } + return this; + }) + }, { + key: 'es5', + value: function es5() { + Function.prototype.computed = function (computedProperties) { + for (var key in computedProperties) { + if (computedProperties.hasOwnProperty(key)) { + Object.defineProperty(this.prototype, key, { get: computedProperties[key], enumerable: true }); } - }; - - return this; - }, - writable: true, - configurable: true - }, - atscript: { - - /** - * Installs special support for AtScript authoring. - * - * @method atscript - * @return {Plugins} Returns the current Plugins instance. - */ - - value: function atscript() { - this.aurelia.container.supportAtScript(); - Metadata.configure.locator(function (fn) { - return fn.annotate || fn.annotations; - }); - return this; - }, - writable: true, - configurable: true - }, - _process: { - value: function _process() { - var _this = this; - - var aurelia = this.aurelia, - loader = aurelia.loader, - info = this.info, - current; - - if (this.processed) { - return; } + }; - var next = function () { - if (current = info.shift()) { - return loadPlugin(aurelia, loader, current).then(next); - } + return this; + } + }, { + key: '_process', + value: function _process() { + var _this = this; + + var aurelia = this.aurelia, + loader = aurelia.loader, + info = this.info, + current; + + if (this.processed) { + return; + } + + var next = (function (_next) { + function next() { + return _next.apply(this, arguments); + } - _this.processed = true; - return Promise.resolve(); + next.toString = function () { + return _next.toString(); }; - return next(); - }, - writable: true, - configurable: true + return next; + })(function () { + if (current = info.shift()) { + return loadPlugin(aurelia, loader, current).then(next); + } + + _this.processed = true; + return Promise.resolve(); + }); + + return next(); } - }); + }]); return Plugins; })(); - Object.defineProperty(exports, "__esModule", { - value: true - }); + exports.Plugins = Plugins; }); \ No newline at end of file diff --git a/dist/commonjs/aurelia.js b/dist/commonjs/aurelia.js index 62eab6a3..c0222153 100644 --- a/dist/commonjs/aurelia.js +++ b/dist/commonjs/aurelia.js @@ -1,37 +1,37 @@ -"use strict"; +'use strict'; -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; }; +var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; -var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; +var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); -var LogManager = _interopRequireWildcard(require("aurelia-logging")); +Object.defineProperty(exports, '__esModule', { + value: true +}); + +var _core = require('core-js'); -var Container = require("aurelia-dependency-injection").Container; +var _core2 = _interopRequireWildcard(_core); -var Loader = require("aurelia-loader").Loader; +var _import = require('aurelia-logging'); -var _aureliaPath = require("aurelia-path"); +var LogManager = _interopRequireWildcard(_import); -var join = _aureliaPath.join; -var relativeToFile = _aureliaPath.relativeToFile; +var _Container = require('aurelia-dependency-injection'); -var Plugins = require("./plugins").Plugins; +var _Loader = require('aurelia-loader'); -var _aureliaTemplating = require("aurelia-templating"); +var _join$relativeToFile = require('aurelia-path'); -var BindingLanguage = _aureliaTemplating.BindingLanguage; -var ViewEngine = _aureliaTemplating.ViewEngine; -var ViewSlot = _aureliaTemplating.ViewSlot; -var ResourceRegistry = _aureliaTemplating.ResourceRegistry; -var CompositionEngine = _aureliaTemplating.CompositionEngine; -var Animator = _aureliaTemplating.Animator; +var _Plugins = require('./plugins'); -var logger = LogManager.getLogger("aurelia"), +var _BindingLanguage$ViewEngine$ViewSlot$ResourceRegistry$CompositionEngine$Animator = require('aurelia-templating'); + +var logger = LogManager.getLogger('aurelia'), slice = Array.prototype.slice; -if (!window.CustomEvent || typeof window.CustomEvent !== "function") { +if (!window.CustomEvent || typeof window.CustomEvent !== 'function') { var CustomEvent = function CustomEvent(event, params) { var params = params || { bubbles: false, @@ -39,7 +39,7 @@ if (!window.CustomEvent || typeof window.CustomEvent !== "function") { detail: undefined }; - var evt = document.createEvent("CustomEvent"); + var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; }; @@ -49,18 +49,18 @@ if (!window.CustomEvent || typeof window.CustomEvent !== "function") { } function preventActionlessFormSubmit() { - document.body.addEventListener("submit", function (evt) { + document.body.addEventListener('submit', function (evt) { var target = evt.target; var action = target.action; - if (target.tagName.toLowerCase() === "form" && !action) { + if (target.tagName.toLowerCase() === 'form' && !action) { evt.preventDefault(); } }); } function loadResources(container, resourcesToLoad, appResources) { - var viewEngine = container.get(ViewEngine), + var viewEngine = container.get(_BindingLanguage$ViewEngine$ViewSlot$ResourceRegistry$CompositionEngine$Animator.ViewEngine), importIds = Object.keys(resourcesToLoad), names = new Array(importIds.length), i, @@ -73,211 +73,129 @@ function loadResources(container, resourcesToLoad, appResources) { return viewEngine.importViewResources(importIds, names, appResources); } -/** - * The framework core that provides the main Aurelia object. - * - * @class Aurelia - * @constructor - * @param {Loader} loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader. - * @param {Container} container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container. - * @param {ResourceRegistry} resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. - */ - -var Aurelia = exports.Aurelia = (function () { +var Aurelia = (function () { function Aurelia(loader, container, resources) { _classCallCheck(this, Aurelia); this.loader = loader || new window.AureliaLoader(); - this.container = container || new Container(); - this.resources = resources || new ResourceRegistry(); - this.use = new Plugins(this); + this.container = container || new _Container.Container(); + this.resources = resources || new _BindingLanguage$ViewEngine$ViewSlot$ResourceRegistry$CompositionEngine$Animator.ResourceRegistry(); + this.use = new _Plugins.Plugins(this); this.resourcesToLoad = {}; this.withInstance(Aurelia, this); - this.withInstance(Loader, this.loader); - this.withInstance(ResourceRegistry, this.resources); + this.withInstance(_Loader.Loader, this.loader); + this.withInstance(_BindingLanguage$ViewEngine$ViewSlot$ResourceRegistry$CompositionEngine$Animator.ResourceRegistry, this.resources); } - _prototypeProperties(Aurelia, null, { - withInstance: { - - /** - * Adds an existing object to the framework's dependency injection container. - * - * @method withInstance - * @param {Class} type The object type of the dependency that the framework will inject. - * @param {Object} instance The existing instance of the dependency that the framework will inject. - * @return {Aurelia} Returns the current Aurelia instance. - */ - - value: function withInstance(type, instance) { - this.container.registerInstance(type, instance); - return this; - }, - writable: true, - configurable: true - }, - withSingleton: { - - /** - * Adds a singleton to the framework's dependency injection container. - * - * @method withSingleton - * @param {Class} type The object type of the dependency that the framework will inject. - * @param {Object} implementation The constructor function of the dependency that the framework will inject. - * @return {Aurelia} Returns the current Aurelia instance. - */ - - value: function withSingleton(type, implementation) { - this.container.registerSingleton(type, implementation); - return this; - }, - writable: true, - configurable: true - }, - globalizeResources: { - - /** - * Adds globally available view resources to be imported into the Aurelia framework. - * - * @method globalizeResources - * @param {Object|Array} resources The relative module id to the resource. (Relative to the plugin's installer.) - * @return {Aurelia} Returns the current Aurelia instance. - */ - - value: function globalizeResources(resources) { - var toAdd = Array.isArray(resources) ? resources : arguments, - i, - ii, - pluginPath = this.currentPluginId || "", - path, - internalPlugin = pluginPath.startsWith("./"); - - for (i = 0, ii = toAdd.length; i < ii; ++i) { - path = internalPlugin ? relativeToFile(toAdd[i], pluginPath) : join(pluginPath, toAdd[i]); - - this.resourcesToLoad[path] = this.resourcesToLoad[path]; - } - - return this; - }, - writable: true, - configurable: true - }, - renameGlobalResource: { - - /** - * Renames a global resource that was imported. - * - * @method renameGlobalResource - * @param {String} resourcePath The path to the resource. - * @param {String} newName The new name. - * @return {Aurelia} Returns the current Aurelia instance. - */ - - value: function renameGlobalResource(resourcePath, newName) { - this.resourcesToLoad[resourcePath] = newName; - return this; - }, - writable: true, - configurable: true - }, - start: { - - /** - * Loads plugins, then resources, and then starts the Aurelia instance. - * - * @method start - * @return {Aurelia} Returns the started Aurelia instance. - */ - - value: function start() { - var _this = this; - - if (this.started) { - return Promise.resolve(this); - } + _createClass(Aurelia, [{ + key: 'withInstance', + value: function withInstance(type, instance) { + this.container.registerInstance(type, instance); + return this; + } + }, { + key: 'withSingleton', + value: function withSingleton(type, implementation) { + this.container.registerSingleton(type, implementation); + return this; + } + }, { + key: 'globalizeResources', + value: function globalizeResources(resources) { + var toAdd = Array.isArray(resources) ? resources : arguments, + i, + ii, + pluginPath = this.currentPluginId || '', + path, + internalPlugin = pluginPath.startsWith('./'); + + for (i = 0, ii = toAdd.length; i < ii; ++i) { + path = internalPlugin ? _join$relativeToFile.relativeToFile(toAdd[i], pluginPath) : _join$relativeToFile.join(pluginPath, toAdd[i]); + + this.resourcesToLoad[path] = this.resourcesToLoad[path]; + } + + return this; + } + }, { + key: 'renameGlobalResource', + value: function renameGlobalResource(resourcePath, newName) { + this.resourcesToLoad[resourcePath] = newName; + return this; + } + }, { + key: 'start', + value: function start() { + var _this = this; - this.started = true; - logger.info("Aurelia Starting"); + if (this.started) { + return Promise.resolve(this); + } - preventActionlessFormSubmit(); + this.started = true; + logger.info('Aurelia Starting'); - return this.use._process().then(function () { - if (!_this.container.hasHandler(BindingLanguage)) { - var message = "You must configure Aurelia with a BindingLanguage implementation."; - logger.error(message); - throw new Error(message); - } + preventActionlessFormSubmit(); - if (!_this.container.hasHandler(Animator)) { - Animator.configureDefault(_this.container); - } + return this.use._process().then(function () { + if (!_this.container.hasHandler(_BindingLanguage$ViewEngine$ViewSlot$ResourceRegistry$CompositionEngine$Animator.BindingLanguage)) { + var message = 'You must configure Aurelia with a BindingLanguage implementation.'; + logger.error(message); + throw new Error(message); + } - return loadResources(_this.container, _this.resourcesToLoad, _this.resources).then(function () { - logger.info("Aurelia Started"); - var evt = new window.CustomEvent("aurelia-started", { bubbles: true, cancelable: true }); - document.dispatchEvent(evt); - return _this; - }); - }); - }, - writable: true, - configurable: true - }, - setRoot: { - - /** - * Instantiates the root view-model and view and add them to the DOM. - * - * @method withSingleton - * @param {Object} root The root view-model to load upon bootstrap. - * @param {string|Object} applicationHost The DOM object that Aurelia will attach to. - * @return {Aurelia} Returns the current Aurelia instance. - */ - - value: function setRoot() { - var _this = this; - - var root = arguments[0] === undefined ? "app" : arguments[0]; - var applicationHost = arguments[1] === undefined ? null : arguments[1]; - - var compositionEngine, - instruction = {}; - - if (!applicationHost || typeof applicationHost == "string") { - this.host = document.getElementById(applicationHost || "applicationHost") || document.body; - } else { - this.host = applicationHost; + if (!_this.container.hasHandler(_BindingLanguage$ViewEngine$ViewSlot$ResourceRegistry$CompositionEngine$Animator.Animator)) { + _BindingLanguage$ViewEngine$ViewSlot$ResourceRegistry$CompositionEngine$Animator.Animator.configureDefault(_this.container); } - this.host.aurelia = this; - this.container.registerInstance(Element, this.host); - - compositionEngine = this.container.get(CompositionEngine); - instruction.viewModel = root; - instruction.container = instruction.childContainer = this.container; - instruction.viewSlot = new ViewSlot(this.host, true); - instruction.viewSlot.transformChildNodesIntoView(); - - return compositionEngine.compose(instruction).then(function (root) { - _this.root = root; - instruction.viewSlot.attached(); - var evt = new window.CustomEvent("aurelia-composed", { bubbles: true, cancelable: true }); - setTimeout(function () { - return document.dispatchEvent(evt); - }, 1); + return loadResources(_this.container, _this.resourcesToLoad, _this.resources).then(function () { + logger.info('Aurelia Started'); + var evt = new window.CustomEvent('aurelia-started', { bubbles: true, cancelable: true }); + document.dispatchEvent(evt); return _this; }); - }, - writable: true, - configurable: true + }); } - }); + }, { + key: 'setRoot', + value: function setRoot() { + var _this2 = this; + + var root = arguments[0] === undefined ? 'app' : arguments[0]; + var applicationHost = arguments[1] === undefined ? null : arguments[1]; + + 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(_BindingLanguage$ViewEngine$ViewSlot$ResourceRegistry$CompositionEngine$Animator.CompositionEngine); + instruction.viewModel = root; + instruction.container = instruction.childContainer = this.container; + instruction.viewSlot = new _BindingLanguage$ViewEngine$ViewSlot$ResourceRegistry$CompositionEngine$Animator.ViewSlot(this.host, true); + instruction.viewSlot.transformChildNodesIntoView(); + + return compositionEngine.compose(instruction).then(function (root) { + _this2.root = root; + instruction.viewSlot.attached(); + var evt = new window.CustomEvent('aurelia-composed', { bubbles: true, cancelable: true }); + setTimeout(function () { + return document.dispatchEvent(evt); + }, 1); + return _this2; + }); + } + }]); return Aurelia; })(); -Object.defineProperty(exports, "__esModule", { - value: true -}); \ No newline at end of file +exports.Aurelia = Aurelia; \ No newline at end of file diff --git a/dist/commonjs/index.js b/dist/commonjs/index.js index 65289afe..2d8019a9 100644 --- a/dist/commonjs/index.js +++ b/dist/commonjs/index.js @@ -1,32 +1,49 @@ -"use strict"; - -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; }; +'use strict'; var _defaults = function (obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }; -/** - * The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform. - * - * @module framework - */ +var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; -exports.Aurelia = require("./aurelia").Aurelia; +Object.defineProperty(exports, '__esModule', { + value: true +}); -_defaults(exports, _interopRequireWildcard(require("aurelia-dependency-injection"))); +var _import = require('aurelia-logging'); -_defaults(exports, _interopRequireWildcard(require("aurelia-binding"))); +var TheLogManager = _interopRequireWildcard(_import); -_defaults(exports, _interopRequireWildcard(require("aurelia-metadata"))); +var _Aurelia = require('./aurelia'); -_defaults(exports, _interopRequireWildcard(require("aurelia-templating"))); +Object.defineProperty(exports, 'Aurelia', { + enumerable: true, + get: function get() { + return _Aurelia.Aurelia; + } +}); -_defaults(exports, _interopRequireWildcard(require("aurelia-loader"))); +var _aureliaDependencyInjection = require('aurelia-dependency-injection'); -_defaults(exports, _interopRequireWildcard(require("aurelia-task-queue"))); +_defaults(exports, _interopRequireWildcard(_aureliaDependencyInjection)); -var TheLogManager = _interopRequireWildcard(require("aurelia-logging")); +var _aureliaBinding = require('aurelia-binding'); -var LogManager = exports.LogManager = TheLogManager; -Object.defineProperty(exports, "__esModule", { - value: true -}); \ No newline at end of file +_defaults(exports, _interopRequireWildcard(_aureliaBinding)); + +var _aureliaMetadata = require('aurelia-metadata'); + +_defaults(exports, _interopRequireWildcard(_aureliaMetadata)); + +var _aureliaTemplating = require('aurelia-templating'); + +_defaults(exports, _interopRequireWildcard(_aureliaTemplating)); + +var _aureliaLoader = require('aurelia-loader'); + +_defaults(exports, _interopRequireWildcard(_aureliaLoader)); + +var _aureliaTaskQueue = require('aurelia-task-queue'); + +_defaults(exports, _interopRequireWildcard(_aureliaTaskQueue)); + +var LogManager = TheLogManager; +exports.LogManager = LogManager; \ No newline at end of file diff --git a/dist/commonjs/plugins.js b/dist/commonjs/plugins.js index 4776738b..4fed4829 100644 --- a/dist/commonjs/plugins.js +++ b/dist/commonjs/plugins.js @@ -1,51 +1,53 @@ -"use strict"; +'use strict'; -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; }; +var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; -var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; +var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); -var LogManager = _interopRequireWildcard(require("aurelia-logging")); +Object.defineProperty(exports, '__esModule', { + value: true +}); + +var _core = require('core-js'); + +var _core2 = _interopRequireWildcard(_core); + +var _import = require('aurelia-logging'); -var Metadata = require("aurelia-metadata").Metadata; +var LogManager = _interopRequireWildcard(_import); -var logger = LogManager.getLogger("aurelia"); +var _Metadata = require('aurelia-metadata'); + +var logger = LogManager.getLogger('aurelia'); function loadPlugin(aurelia, loader, info) { - logger.debug("Loading plugin " + info.moduleId + "."); + logger.debug('Loading plugin ' + info.moduleId + '.'); aurelia.currentPluginId = info.moduleId; return loader.loadModule(info.moduleId).then(function (exportedValue) { - if ("install" in exportedValue) { + if ('install' in exportedValue) { var result = exportedValue.install(aurelia, info.config || {}); if (result) { return result.then(function () { aurelia.currentPluginId = null; - logger.debug("Installed plugin " + info.moduleId + "."); + logger.debug('Installed plugin ' + info.moduleId + '.'); }); } else { - logger.debug("Installed plugin " + info.moduleId + "."); + logger.debug('Installed plugin ' + info.moduleId + '.'); } } else { - logger.debug("Loaded plugin " + info.moduleId + "."); + logger.debug('Loaded plugin ' + info.moduleId + '.'); } aurelia.currentPluginId = null; }); } -/** - * Manages loading and installing plugins. - * - * @class Plugins - * @constructor - * @param {Aurelia} aurelia An instance of Aurelia. - */ - -var Plugins = exports.Plugins = (function () { +var Plugins = (function () { function Plugins(aurelia) { _classCallCheck(this, Plugins); @@ -54,116 +56,80 @@ var Plugins = exports.Plugins = (function () { this.processed = false; } - _prototypeProperties(Plugins, null, { - plugin: { - - /** - * Installs a plugin before Aurelia starts. - * - * @method plugin - * @param {moduleId} moduleId The ID of the module to install. - * @param {config} config The configuration for the specified module. - * @return {Plugins} Returns the current Plugins instance. - */ - - value: (function (_plugin) { - var _pluginWrapper = function plugin(_x, _x2) { - return _plugin.apply(this, arguments); - }; + _createClass(Plugins, [{ + key: 'plugin', + value: (function (_plugin) { + function plugin(_x, _x2) { + return _plugin.apply(this, arguments); + } - _pluginWrapper.toString = function () { - return _plugin.toString(); - }; + plugin.toString = function () { + return _plugin.toString(); + }; - return _pluginWrapper; - })(function (moduleId, config) { - var plugin = { moduleId: moduleId, config: config || {} }; + return plugin; + })(function (moduleId, config) { + var plugin = { moduleId: moduleId, config: config || {} }; - if (this.processed) { - loadPlugin(this.aurelia, this.aurelia.loader, plugin); - } else { - this.info.push(plugin); - } + if (this.processed) { + loadPlugin(this.aurelia, this.aurelia.loader, plugin); + } else { + this.info.push(plugin); + } - return this; - }), - writable: true, - configurable: true - }, - es5: { - - /** - * Installs special support for ES5 authoring. - * - * @method es5 - * @return {Plugins} Returns the current Plugins instance. - */ - - value: function es5() { - Function.prototype.computed = function (computedProperties) { - for (var key in computedProperties) { - if (computedProperties.hasOwnProperty(key)) { - Object.defineProperty(this.prototype, key, { get: computedProperties[key], enumerable: true }); - } + return this; + }) + }, { + key: 'es5', + value: function es5() { + Function.prototype.computed = function (computedProperties) { + for (var key in computedProperties) { + if (computedProperties.hasOwnProperty(key)) { + Object.defineProperty(this.prototype, key, { get: computedProperties[key], enumerable: true }); } - }; - - return this; - }, - writable: true, - configurable: true - }, - atscript: { - - /** - * Installs special support for AtScript authoring. - * - * @method atscript - * @return {Plugins} Returns the current Plugins instance. - */ - - value: function atscript() { - this.aurelia.container.supportAtScript(); - Metadata.configure.locator(function (fn) { - return fn.annotate || fn.annotations; - }); - return this; - }, - writable: true, - configurable: true - }, - _process: { - value: function _process() { - var _this = this; - - var aurelia = this.aurelia, - loader = aurelia.loader, - info = this.info, - current; - - if (this.processed) { - return; } + }; - var next = function () { - if (current = info.shift()) { - return loadPlugin(aurelia, loader, current).then(next); - } + return this; + } + }, { + key: '_process', + value: function _process() { + var _this = this; + + var aurelia = this.aurelia, + loader = aurelia.loader, + info = this.info, + current; + + if (this.processed) { + return; + } + + var next = (function (_next) { + function next() { + return _next.apply(this, arguments); + } - _this.processed = true; - return Promise.resolve(); + next.toString = function () { + return _next.toString(); }; - return next(); - }, - writable: true, - configurable: true + return next; + })(function () { + if (current = info.shift()) { + return loadPlugin(aurelia, loader, current).then(next); + } + + _this.processed = true; + return Promise.resolve(); + }); + + return next(); } - }); + }]); return Plugins; })(); -Object.defineProperty(exports, "__esModule", { - value: true -}); \ No newline at end of file +exports.Plugins = Plugins; \ No newline at end of file diff --git a/dist/es6/aurelia.js b/dist/es6/aurelia.js index 374e70a4..55225e2a 100644 --- a/dist/es6/aurelia.js +++ b/dist/es6/aurelia.js @@ -1,3 +1,4 @@ +import core from 'core-js'; import * as LogManager from 'aurelia-logging'; import {Container} from 'aurelia-dependency-injection'; import {Loader} from 'aurelia-loader'; diff --git a/dist/es6/plugins.js b/dist/es6/plugins.js index 1eb79183..8b62625e 100644 --- a/dist/es6/plugins.js +++ b/dist/es6/plugins.js @@ -1,3 +1,4 @@ +import core from 'core-js'; import * as LogManager from 'aurelia-logging'; import {Metadata} from 'aurelia-metadata'; @@ -80,18 +81,6 @@ export class Plugins { return this; } - /** - * Installs special support for AtScript authoring. - * - * @method atscript - * @return {Plugins} Returns the current Plugins instance. - */ - atscript(){ - this.aurelia.container.supportAtScript(); - Metadata.configure.locator(fn => fn['annotate'] || fn['annotations']); - return this; - } - _process(){ var aurelia = this.aurelia, loader = aurelia.loader, diff --git a/dist/system/aurelia.js b/dist/system/aurelia.js index 2a221144..c5bbad4f 100644 --- a/dist/system/aurelia.js +++ b/dist/system/aurelia.js @@ -1,12 +1,12 @@ -System.register(["aurelia-logging", "aurelia-dependency-injection", "aurelia-loader", "aurelia-path", "./plugins", "aurelia-templating"], function (_export) { - var LogManager, Container, Loader, join, relativeToFile, Plugins, BindingLanguage, ViewEngine, ViewSlot, ResourceRegistry, CompositionEngine, Animator, _prototypeProperties, _classCallCheck, logger, slice, CustomEvent, Aurelia; +System.register(['core-js', 'aurelia-logging', 'aurelia-dependency-injection', 'aurelia-loader', 'aurelia-path', './plugins', 'aurelia-templating'], function (_export) { + var core, LogManager, Container, Loader, join, relativeToFile, Plugins, BindingLanguage, ViewEngine, ViewSlot, ResourceRegistry, CompositionEngine, Animator, _classCallCheck, _createClass, logger, slice, CustomEvent, Aurelia; function preventActionlessFormSubmit() { - document.body.addEventListener("submit", function (evt) { + document.body.addEventListener('submit', function (evt) { var target = evt.target; var action = target.action; - if (target.tagName.toLowerCase() === "form" && !action) { + if (target.tagName.toLowerCase() === 'form' && !action) { evt.preventDefault(); } }); @@ -27,7 +27,9 @@ System.register(["aurelia-logging", "aurelia-dependency-injection", "aurelia-loa } return { - setters: [function (_aureliaLogging) { + setters: [function (_coreJs) { + core = _coreJs['default']; + }, function (_aureliaLogging) { LogManager = _aureliaLogging; }, function (_aureliaDependencyInjection) { Container = _aureliaDependencyInjection.Container; @@ -47,16 +49,16 @@ System.register(["aurelia-logging", "aurelia-dependency-injection", "aurelia-loa Animator = _aureliaTemplating.Animator; }], execute: function () { - "use strict"; + 'use strict'; - _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; + _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; + _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - logger = LogManager.getLogger("aurelia"); + logger = LogManager.getLogger('aurelia'); slice = Array.prototype.slice; - if (!window.CustomEvent || typeof window.CustomEvent !== "function") { + if (!window.CustomEvent || typeof window.CustomEvent !== 'function') { CustomEvent = function CustomEvent(event, params) { var params = params || { bubbles: false, @@ -64,23 +66,15 @@ System.register(["aurelia-logging", "aurelia-dependency-injection", "aurelia-loa detail: undefined }; - var evt = document.createEvent("CustomEvent"); + var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; }; CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent; - } /** - * The framework core that provides the main Aurelia object. - * - * @class Aurelia - * @constructor - * @param {Loader} loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader. - * @param {Container} container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container. - * @param {ResourceRegistry} resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. - */ - Aurelia = _export("Aurelia", (function () { + } + Aurelia = (function () { function Aurelia(loader, container, resources) { _classCallCheck(this, Aurelia); @@ -95,185 +89,117 @@ System.register(["aurelia-logging", "aurelia-dependency-injection", "aurelia-loa this.withInstance(ResourceRegistry, this.resources); } - _prototypeProperties(Aurelia, null, { - withInstance: { - - /** - * Adds an existing object to the framework's dependency injection container. - * - * @method withInstance - * @param {Class} type The object type of the dependency that the framework will inject. - * @param {Object} instance The existing instance of the dependency that the framework will inject. - * @return {Aurelia} Returns the current Aurelia instance. - */ - - value: function withInstance(type, instance) { - this.container.registerInstance(type, instance); - return this; - }, - writable: true, - configurable: true - }, - withSingleton: { - - /** - * Adds a singleton to the framework's dependency injection container. - * - * @method withSingleton - * @param {Class} type The object type of the dependency that the framework will inject. - * @param {Object} implementation The constructor function of the dependency that the framework will inject. - * @return {Aurelia} Returns the current Aurelia instance. - */ - - value: function withSingleton(type, implementation) { - this.container.registerSingleton(type, implementation); - return this; - }, - writable: true, - configurable: true - }, - globalizeResources: { - - /** - * Adds globally available view resources to be imported into the Aurelia framework. - * - * @method globalizeResources - * @param {Object|Array} resources The relative module id to the resource. (Relative to the plugin's installer.) - * @return {Aurelia} Returns the current Aurelia instance. - */ - - value: function globalizeResources(resources) { - var toAdd = Array.isArray(resources) ? resources : arguments, - i, - ii, - pluginPath = this.currentPluginId || "", - path, - internalPlugin = pluginPath.startsWith("./"); - - for (i = 0, ii = toAdd.length; i < ii; ++i) { - path = internalPlugin ? relativeToFile(toAdd[i], pluginPath) : join(pluginPath, toAdd[i]); - - this.resourcesToLoad[path] = this.resourcesToLoad[path]; - } - - return this; - }, - writable: true, - configurable: true - }, - renameGlobalResource: { - - /** - * Renames a global resource that was imported. - * - * @method renameGlobalResource - * @param {String} resourcePath The path to the resource. - * @param {String} newName The new name. - * @return {Aurelia} Returns the current Aurelia instance. - */ - - value: function renameGlobalResource(resourcePath, newName) { - this.resourcesToLoad[resourcePath] = newName; - return this; - }, - writable: true, - configurable: true - }, - start: { - - /** - * Loads plugins, then resources, and then starts the Aurelia instance. - * - * @method start - * @return {Aurelia} Returns the started Aurelia instance. - */ - - value: function start() { - var _this = this; - - if (this.started) { - return Promise.resolve(this); - } + _createClass(Aurelia, [{ + key: 'withInstance', + value: function withInstance(type, instance) { + this.container.registerInstance(type, instance); + return this; + } + }, { + key: 'withSingleton', + value: function withSingleton(type, implementation) { + this.container.registerSingleton(type, implementation); + return this; + } + }, { + key: 'globalizeResources', + value: function globalizeResources(resources) { + var toAdd = Array.isArray(resources) ? resources : arguments, + i, + ii, + pluginPath = this.currentPluginId || '', + path, + internalPlugin = pluginPath.startsWith('./'); + + for (i = 0, ii = toAdd.length; i < ii; ++i) { + path = internalPlugin ? relativeToFile(toAdd[i], pluginPath) : join(pluginPath, toAdd[i]); + + this.resourcesToLoad[path] = this.resourcesToLoad[path]; + } + + return this; + } + }, { + key: 'renameGlobalResource', + value: function renameGlobalResource(resourcePath, newName) { + this.resourcesToLoad[resourcePath] = newName; + return this; + } + }, { + key: 'start', + value: function start() { + var _this = this; - this.started = true; - logger.info("Aurelia Starting"); + if (this.started) { + return Promise.resolve(this); + } - preventActionlessFormSubmit(); + this.started = true; + logger.info('Aurelia Starting'); - return this.use._process().then(function () { - if (!_this.container.hasHandler(BindingLanguage)) { - var message = "You must configure Aurelia with a BindingLanguage implementation."; - logger.error(message); - throw new Error(message); - } + preventActionlessFormSubmit(); - if (!_this.container.hasHandler(Animator)) { - Animator.configureDefault(_this.container); - } + return this.use._process().then(function () { + if (!_this.container.hasHandler(BindingLanguage)) { + var message = 'You must configure Aurelia with a BindingLanguage implementation.'; + logger.error(message); + throw new Error(message); + } - return loadResources(_this.container, _this.resourcesToLoad, _this.resources).then(function () { - logger.info("Aurelia Started"); - var evt = new window.CustomEvent("aurelia-started", { bubbles: true, cancelable: true }); - document.dispatchEvent(evt); - return _this; - }); - }); - }, - writable: true, - configurable: true - }, - setRoot: { - - /** - * Instantiates the root view-model and view and add them to the DOM. - * - * @method withSingleton - * @param {Object} root The root view-model to load upon bootstrap. - * @param {string|Object} applicationHost The DOM object that Aurelia will attach to. - * @return {Aurelia} Returns the current Aurelia instance. - */ - - value: function setRoot() { - var _this = this; - - var root = arguments[0] === undefined ? "app" : arguments[0]; - var applicationHost = arguments[1] === undefined ? null : arguments[1]; - - var compositionEngine, - instruction = {}; - - if (!applicationHost || typeof applicationHost == "string") { - this.host = document.getElementById(applicationHost || "applicationHost") || document.body; - } else { - this.host = applicationHost; + if (!_this.container.hasHandler(Animator)) { + Animator.configureDefault(_this.container); } - this.host.aurelia = this; - this.container.registerInstance(Element, this.host); - - compositionEngine = this.container.get(CompositionEngine); - instruction.viewModel = root; - instruction.container = instruction.childContainer = this.container; - instruction.viewSlot = new ViewSlot(this.host, true); - instruction.viewSlot.transformChildNodesIntoView(); - - return compositionEngine.compose(instruction).then(function (root) { - _this.root = root; - instruction.viewSlot.attached(); - var evt = new window.CustomEvent("aurelia-composed", { bubbles: true, cancelable: true }); - setTimeout(function () { - return document.dispatchEvent(evt); - }, 1); + return loadResources(_this.container, _this.resourcesToLoad, _this.resources).then(function () { + logger.info('Aurelia Started'); + var evt = new window.CustomEvent('aurelia-started', { bubbles: true, cancelable: true }); + document.dispatchEvent(evt); return _this; }); - }, - writable: true, - configurable: true + }); + } + }, { + key: 'setRoot', + value: function setRoot() { + var _this2 = this; + + var root = arguments[0] === undefined ? 'app' : arguments[0]; + var applicationHost = arguments[1] === undefined ? null : arguments[1]; + + 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.container = instruction.childContainer = this.container; + instruction.viewSlot = new ViewSlot(this.host, true); + instruction.viewSlot.transformChildNodesIntoView(); + + return compositionEngine.compose(instruction).then(function (root) { + _this2.root = root; + instruction.viewSlot.attached(); + var evt = new window.CustomEvent('aurelia-composed', { bubbles: true, cancelable: true }); + setTimeout(function () { + return document.dispatchEvent(evt); + }, 1); + return _this2; + }); } - }); + }]); return Aurelia; - })()); + })(); + + _export('Aurelia', Aurelia); } }; }); \ No newline at end of file diff --git a/dist/system/index.js b/dist/system/index.js index 605dc96b..42d0a544 100644 --- a/dist/system/index.js +++ b/dist/system/index.js @@ -1,14 +1,10 @@ -System.register(["./aurelia", "aurelia-dependency-injection", "aurelia-binding", "aurelia-metadata", "aurelia-templating", "aurelia-loader", "aurelia-task-queue", "aurelia-logging"], function (_export) { +System.register(['aurelia-logging', './aurelia', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-metadata', 'aurelia-templating', 'aurelia-loader', 'aurelia-task-queue'], function (_export) { var TheLogManager, LogManager; return { - setters: [function (_aurelia) { - /** - * The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform. - * - * @module framework - */ - - _export("Aurelia", _aurelia.Aurelia); + setters: [function (_aureliaLogging) { + TheLogManager = _aureliaLogging; + }, function (_aurelia) { + _export('Aurelia', _aurelia.Aurelia); }, function (_aureliaDependencyInjection) { for (var _key in _aureliaDependencyInjection) { _export(_key, _aureliaDependencyInjection[_key]); @@ -33,13 +29,13 @@ System.register(["./aurelia", "aurelia-dependency-injection", "aurelia-binding", for (var _key6 in _aureliaTaskQueue) { _export(_key6, _aureliaTaskQueue[_key6]); } - }, function (_aureliaLogging) { - TheLogManager = _aureliaLogging; }], execute: function () { - "use strict"; + 'use strict'; + + LogManager = TheLogManager; - LogManager = _export("LogManager", TheLogManager); + _export('LogManager', LogManager); } }; }); \ No newline at end of file diff --git a/dist/system/plugins.js b/dist/system/plugins.js index cf18a631..c53f2269 100644 --- a/dist/system/plugins.js +++ b/dist/system/plugins.js @@ -1,25 +1,25 @@ -System.register(["aurelia-logging", "aurelia-metadata"], function (_export) { - var LogManager, Metadata, _prototypeProperties, _classCallCheck, logger, Plugins; +System.register(['core-js', 'aurelia-logging', 'aurelia-metadata'], function (_export) { + var core, LogManager, Metadata, _classCallCheck, _createClass, logger, Plugins; function loadPlugin(aurelia, loader, info) { - logger.debug("Loading plugin " + info.moduleId + "."); + logger.debug('Loading plugin ' + info.moduleId + '.'); aurelia.currentPluginId = info.moduleId; return loader.loadModule(info.moduleId).then(function (exportedValue) { - if ("install" in exportedValue) { + if ('install' in exportedValue) { var result = exportedValue.install(aurelia, info.config || {}); if (result) { return result.then(function () { aurelia.currentPluginId = null; - logger.debug("Installed plugin " + info.moduleId + "."); + logger.debug('Installed plugin ' + info.moduleId + '.'); }); } else { - logger.debug("Installed plugin " + info.moduleId + "."); + logger.debug('Installed plugin ' + info.moduleId + '.'); } } else { - logger.debug("Loaded plugin " + info.moduleId + "."); + logger.debug('Loaded plugin ' + info.moduleId + '.'); } aurelia.currentPluginId = null; @@ -27,27 +27,23 @@ System.register(["aurelia-logging", "aurelia-metadata"], function (_export) { } return { - setters: [function (_aureliaLogging) { + setters: [function (_coreJs) { + core = _coreJs['default']; + }, function (_aureliaLogging) { LogManager = _aureliaLogging; }, function (_aureliaMetadata) { Metadata = _aureliaMetadata.Metadata; }], execute: function () { - "use strict"; + 'use strict'; - _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; + _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; + _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - logger = LogManager.getLogger("aurelia"); - /** - * Manages loading and installing plugins. - * - * @class Plugins - * @constructor - * @param {Aurelia} aurelia An instance of Aurelia. - */ - Plugins = _export("Plugins", (function () { + logger = LogManager.getLogger('aurelia'); + + Plugins = (function () { function Plugins(aurelia) { _classCallCheck(this, Plugins); @@ -56,115 +52,83 @@ System.register(["aurelia-logging", "aurelia-metadata"], function (_export) { this.processed = false; } - _prototypeProperties(Plugins, null, { - plugin: { - - /** - * Installs a plugin before Aurelia starts. - * - * @method plugin - * @param {moduleId} moduleId The ID of the module to install. - * @param {config} config The configuration for the specified module. - * @return {Plugins} Returns the current Plugins instance. - */ - - value: (function (_plugin) { - var _pluginWrapper = function plugin(_x, _x2) { - return _plugin.apply(this, arguments); - }; - - _pluginWrapper.toString = function () { - return _plugin.toString(); - }; - - return _pluginWrapper; - })(function (moduleId, config) { - var plugin = { moduleId: moduleId, config: config || {} }; + _createClass(Plugins, [{ + key: 'plugin', + value: (function (_plugin) { + function plugin(_x, _x2) { + return _plugin.apply(this, arguments); + } + + plugin.toString = function () { + return _plugin.toString(); + }; + + return plugin; + })(function (moduleId, config) { + var plugin = { moduleId: moduleId, config: config || {} }; + + if (this.processed) { + loadPlugin(this.aurelia, this.aurelia.loader, plugin); + } else { + this.info.push(plugin); + } + + return this; + }) + }, { + key: 'es5', + value: function es5() { + Function.prototype.computed = function (computedProperties) { + for (var key in computedProperties) { + if (computedProperties.hasOwnProperty(key)) { + Object.defineProperty(this.prototype, key, { get: computedProperties[key], enumerable: true }); + } + } + }; - if (this.processed) { - loadPlugin(this.aurelia, this.aurelia.loader, plugin); - } else { - this.info.push(plugin); + return this; + } + }, { + key: '_process', + value: function _process() { + var _this = this; + + var aurelia = this.aurelia, + loader = aurelia.loader, + info = this.info, + current; + + if (this.processed) { + return; + } + + var next = (function (_next) { + function next() { + return _next.apply(this, arguments); } - return this; - }), - writable: true, - configurable: true - }, - es5: { - - /** - * Installs special support for ES5 authoring. - * - * @method es5 - * @return {Plugins} Returns the current Plugins instance. - */ - - value: function es5() { - Function.prototype.computed = function (computedProperties) { - for (var key in computedProperties) { - if (computedProperties.hasOwnProperty(key)) { - Object.defineProperty(this.prototype, key, { get: computedProperties[key], enumerable: true }); - } - } + next.toString = function () { + return _next.toString(); }; - return this; - }, - writable: true, - configurable: true - }, - atscript: { - - /** - * Installs special support for AtScript authoring. - * - * @method atscript - * @return {Plugins} Returns the current Plugins instance. - */ - - value: function atscript() { - this.aurelia.container.supportAtScript(); - Metadata.configure.locator(function (fn) { - return fn.annotate || fn.annotations; - }); - return this; - }, - writable: true, - configurable: true - }, - _process: { - value: function _process() { - var _this = this; - - var aurelia = this.aurelia, - loader = aurelia.loader, - info = this.info, - current; - - if (this.processed) { - return; + return next; + })(function () { + if (current = info.shift()) { + return loadPlugin(aurelia, loader, current).then(next); } - var next = function () { - if (current = info.shift()) { - return loadPlugin(aurelia, loader, current).then(next); - } - - _this.processed = true; - return Promise.resolve(); - }; + _this.processed = true; + return Promise.resolve(); + }); - return next(); - }, - writable: true, - configurable: true + return next(); } - }); + }]); return Plugins; - })()); + })(); + + _export('Plugins', Plugins); } }; }); \ No newline at end of file diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 6e1284e1..a4550bea 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,18 @@ +## 0.10.0 (2015-04-09) + + +#### Bug Fixes + +* **all:** update compiler and metadata plugin ([50e3afe0](http://github.com/aurelia/framework/commit/50e3afe0e5a4c6c0e15242433007e4fe068e35fc)) + + +#### Features + +* **plugins:** + * remove AtScript support ([f1adb01a](http://github.com/aurelia/framework/commit/f1adb01ab32afcd8ba3b427e9274f72fb4d56fda)) + * update to use new metadata locator function ([4b09490d](http://github.com/aurelia/framework/commit/4b09490daf7f351e1001557c8e8a8032bdadbf1c)) + + ## 0.9.0 (2015-03-25) diff --git a/doc/api.json b/doc/api.json index 91e30260..8cddcb36 100644 --- a/doc/api.json +++ b/doc/api.json @@ -1 +1 @@ -{"name":"framework","description":"The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.","classes":[{"name":"Aurelia","file":"aurelia/framework/src/aurelia.js","line":59,"description":"The framework core that provides the main Aurelia object.","is_constructor":1,"params":[{"name":"loader","description":"The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader.","type":"Loader"},{"name":"container","description":"The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container.","type":"Container"},{"name":"resources","description":"The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry.","type":"ResourceRegistry"}],"methods":[{"line":81,"description":"Adds an existing object to the framework's dependency injection container.","name":"withInstance","params":[{"name":"type","description":"The object type of the dependency that the framework will inject.","type":"Class"},{"name":"instance","description":"The existing instance of the dependency that the framework will inject.","type":"Object"}],"return":{"description":"Returns the current Aurelia instance.","type":"Aurelia"}},{"line":94,"description":"Adds a singleton to the framework's dependency injection container.","name":"withSingleton","params":[{"name":"type","description":"The object type of the dependency that the framework will inject.","type":"Class"},{"name":"implementation","description":"The constructor function of the dependency that the framework will inject.","type":"Object"}],"return":{"description":"Returns the current Aurelia instance.","type":"Aurelia"}},{"line":107,"description":"Adds globally available view resources to be imported into the Aurelia framework.","name":"globalizeResources","params":[{"name":"resources","description":"The relative module id to the resource. (Relative to the plugin's installer.)","type":"Object|Array"}],"return":{"description":"Returns the current Aurelia instance.","type":"Aurelia"}},{"line":130,"description":"Renames a global resource that was imported.","name":"renameGlobalResource","params":[{"name":"resourcePath","description":"The path to the resource.","type":"String"},{"name":"newName","description":"The new name.","type":"String"}],"return":{"description":"Returns the current Aurelia instance.","type":"Aurelia"}},{"line":143,"description":"Loads plugins, then resources, and then starts the Aurelia instance.","name":"start","return":{"description":"Returns the started Aurelia instance.","type":"Aurelia"}},{"line":179,"description":"Instantiates the root view-model and view and add them to the DOM.","name":"withSingleton","params":[{"name":"root","description":"The root view-model to load upon bootstrap.","type":"Object"},{"name":"applicationHost","description":"The DOM object that Aurelia will attach to.","type":"String|Object"}],"return":{"description":"Returns the current Aurelia instance.","type":"Aurelia"}}],"properties":[],"events":[]},{"name":"Plugins","file":"aurelia/framework/src/plugins.js","line":31,"description":"Manages loading and installing plugins.","is_constructor":1,"params":[{"name":"aurelia","description":"An instance of Aurelia.","type":"Aurelia"}],"methods":[{"line":45,"description":"Installs a plugin before Aurelia starts.","name":"plugin","params":[{"name":"moduleId","description":"The ID of the module to install.","type":"ModuleId"},{"name":"config","description":"The configuration for the specified module.","type":"Config"}],"return":{"description":"Returns the current Plugins instance.","type":"Plugins"}},{"line":65,"description":"Installs special support for ES5 authoring.","name":"es5","return":{"description":"Returns the current Plugins instance.","type":"Plugins"}},{"line":83,"description":"Installs special support for AtScript authoring.","name":"atscript","return":{"description":"Returns the current Plugins instance.","type":"Plugins"}}],"properties":[],"events":[]}],"methods":[],"properties":[],"events":[]} \ No newline at end of file +{"name":"framework","description":"The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.","classes":[{"name":"Aurelia","file":"aurelia/framework/src/aurelia.js","line":60,"description":"The framework core that provides the main Aurelia object.","is_constructor":1,"params":[{"name":"loader","description":"The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader.","type":"Loader"},{"name":"container","description":"The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container.","type":"Container"},{"name":"resources","description":"The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry.","type":"ResourceRegistry"}],"methods":[{"line":82,"description":"Adds an existing object to the framework's dependency injection container.","name":"withInstance","params":[{"name":"type","description":"The object type of the dependency that the framework will inject.","type":"Class"},{"name":"instance","description":"The existing instance of the dependency that the framework will inject.","type":"Object"}],"return":{"description":"Returns the current Aurelia instance.","type":"Aurelia"}},{"line":95,"description":"Adds a singleton to the framework's dependency injection container.","name":"withSingleton","params":[{"name":"type","description":"The object type of the dependency that the framework will inject.","type":"Class"},{"name":"implementation","description":"The constructor function of the dependency that the framework will inject.","type":"Object"}],"return":{"description":"Returns the current Aurelia instance.","type":"Aurelia"}},{"line":108,"description":"Adds globally available view resources to be imported into the Aurelia framework.","name":"globalizeResources","params":[{"name":"resources","description":"The relative module id to the resource. (Relative to the plugin's installer.)","type":"Object|Array"}],"return":{"description":"Returns the current Aurelia instance.","type":"Aurelia"}},{"line":131,"description":"Renames a global resource that was imported.","name":"renameGlobalResource","params":[{"name":"resourcePath","description":"The path to the resource.","type":"String"},{"name":"newName","description":"The new name.","type":"String"}],"return":{"description":"Returns the current Aurelia instance.","type":"Aurelia"}},{"line":144,"description":"Loads plugins, then resources, and then starts the Aurelia instance.","name":"start","return":{"description":"Returns the started Aurelia instance.","type":"Aurelia"}},{"line":180,"description":"Instantiates the root view-model and view and add them to the DOM.","name":"withSingleton","params":[{"name":"root","description":"The root view-model to load upon bootstrap.","type":"Object"},{"name":"applicationHost","description":"The DOM object that Aurelia will attach to.","type":"String|Object"}],"return":{"description":"Returns the current Aurelia instance.","type":"Aurelia"}}],"properties":[],"events":[]},{"name":"Plugins","file":"aurelia/framework/src/plugins.js","line":32,"description":"Manages loading and installing plugins.","is_constructor":1,"params":[{"name":"aurelia","description":"An instance of Aurelia.","type":"Aurelia"}],"methods":[{"line":46,"description":"Installs a plugin before Aurelia starts.","name":"plugin","params":[{"name":"moduleId","description":"The ID of the module to install.","type":"ModuleId"},{"name":"config","description":"The configuration for the specified module.","type":"Config"}],"return":{"description":"Returns the current Plugins instance.","type":"Plugins"}},{"line":66,"description":"Installs special support for ES5 authoring.","name":"es5","return":{"description":"Returns the current Plugins instance.","type":"Plugins"}}],"properties":[],"events":[]}],"methods":[],"properties":[],"events":[]} \ No newline at end of file diff --git a/package.json b/package.json index 5792fbfd..a4921a59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-framework", - "version": "0.9.0", + "version": "0.10.0", "description": "The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.", "keywords": [ "aurelia", @@ -25,14 +25,14 @@ "lib": "dist/system" }, "dependencies": { - "aurelia-binding": "github:aurelia/binding@^0.4.0", - "aurelia-dependency-injection": "github:aurelia/dependency-injection@^0.5.0", - "aurelia-loader": "github:aurelia/loader@^0.4.0", - "aurelia-logging": "github:aurelia/logging@^0.2.6", - "aurelia-metadata": "github:aurelia/metadata@^0.3.4", - "aurelia-path": "github:aurelia/path@^0.4.6", - "aurelia-task-queue": "github:aurelia/task-queue@^0.2.5", - "aurelia-templating": "github:aurelia/templating@^0.9.0", + "aurelia-binding": "github:aurelia/binding@^0.5.0", + "aurelia-dependency-injection": "github:aurelia/dependency-injection@^0.6.0", + "aurelia-loader": "github:aurelia/loader@^0.5.0", + "aurelia-logging": "github:aurelia/logging@^0.3.0", + "aurelia-metadata": "github:aurelia/metadata@^0.4.0", + "aurelia-path": "github:aurelia/path@^0.5.0", + "aurelia-task-queue": "github:aurelia/task-queue@^0.3.0", + "aurelia-templating": "github:aurelia/templating@^0.10.0", "core-js": "github:zloirock/core-js@^0.8.1" } }, diff --git a/test/plugin.spec.js b/test/plugin.spec.js index a9bc27bb..53e30666 100644 --- a/test/plugin.spec.js +++ b/test/plugin.spec.js @@ -143,20 +143,4 @@ describe('the plugin loader', () => { expect(testFn.boolProp).toBeFalsy(); }); }); - - describe("atscript()", () => { - let containerMock; - - beforeEach(() => { - containerMock = jasmine.createSpyObj('container',['supportAtScript']); - aureliaMock.container = containerMock; - spyOn(Metadata.configure,'locator').and.callThrough(); - }); - - it("should add support for atScript", () => { - plugins.atscript(); - expect(containerMock.supportAtScript).toHaveBeenCalled(); - expect(Metadata.configure.locator).toHaveBeenCalled(); - }); - }); });