diff --git a/bower.json b/bower.json index b58ce71..dbb011f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-bootstrapper", - "version": "2.3.4", + "version": "2.4.0", "description": "Sets up the default configuration for the aurelia framework and gets you up and running quick and easy.", "keywords": [ "aurelia", diff --git a/dist/amd/aurelia-bootstrapper.js b/dist/amd/aurelia-bootstrapper.js index 9baa53c..df30188 100644 --- a/dist/amd/aurelia-bootstrapper.js +++ b/dist/amd/aurelia-bootstrapper.js @@ -1,176 +1,142 @@ -define(['module', 'exports', 'aurelia-pal', 'aurelia-polyfills'], function (module, exports, _aureliaPal) { - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.starting = undefined; - exports.bootstrap = bootstrap; - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; - } : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - - var bootstrapPromises = []; - var startResolve = void 0; - - var startPromise = new Promise(function (resolve) { - return startResolve = resolve; - }); - var host = _aureliaPal.PLATFORM.global; - var isNodeLike = typeof process !== 'undefined' && !process.browser; - - function ready() { - if (!host.document || host.document.readyState === 'complete') { - return Promise.resolve(); +define('aurelia-bootstrapper', ['exports', 'aurelia-polyfills', 'aurelia-pal'], (function (exports, aureliaPolyfills, aureliaPal) { 'use strict'; + + var bootstrapPromises = []; + var startResolve; + var startPromise = new Promise(function (resolve) { return startResolve = resolve; }); + var host = aureliaPal.PLATFORM.global; + var isNodeLike = typeof process !== 'undefined' && !process.browser; + function ready() { + if (!host.document || host.document.readyState === 'complete') { + return Promise.resolve(); + } + return new Promise(function (resolve) { + host.document.addEventListener('DOMContentLoaded', completed); + host.addEventListener('load', completed); + function completed() { + host.document.removeEventListener('DOMContentLoaded', completed); + host.removeEventListener('load', completed); + resolve(); + } + }); } - - return new Promise(function (resolve) { - host.document.addEventListener('DOMContentLoaded', completed); - host.addEventListener('load', completed); - - function completed() { - host.document.removeEventListener('DOMContentLoaded', completed); - host.removeEventListener('load', completed); - resolve(); - } - }); - } - - function createLoader() { - if (_aureliaPal.PLATFORM.Loader) { - return Promise.resolve(new _aureliaPal.PLATFORM.Loader()); + function createLoader() { + if (aureliaPal.PLATFORM.Loader) { + return Promise.resolve(new aureliaPal.PLATFORM.Loader()); + } + if (typeof AURELIA_WEBPACK_2_0 === 'undefined') { + if (typeof __webpack_require__ !== 'undefined') { + var m = __webpack_require__(require.resolve('aurelia-loader-webpack')); + return Promise.resolve(new m.WebpackLoader()); + } + if (host.System && typeof host.System.config === 'function') { + return host.System.normalize('aurelia-bootstrapper').then(function (bsn) { + return host.System.normalize('aurelia-loader-default', bsn); + }).then(function (loaderName) { + return host.System.import(loaderName).then(function (m) { return new m.DefaultLoader(); }); + }); + } + if (typeof host.require === 'function' && typeof host.define === 'function' && typeof host.define.amd === 'object') { + return new Promise(function (resolve, reject) { return host.require(['aurelia-loader-default'], function (m) { return resolve(new m.DefaultLoader()); }, reject); }); + } + if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') { + var m = module.require('aurelia-loader-nodejs'); + return Promise.resolve(new m.NodeJsLoader()); + } + } + return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.'); } - - if (typeof AURELIA_WEBPACK_2_0 === 'undefined') { - if (typeof __webpack_require__ !== 'undefined') { - var m = __webpack_require__(require.resolve('aurelia-loader-webpack')); - return Promise.resolve(new m.WebpackLoader()); - } - - if (host.System && typeof host.System.config === 'function') { - return host.System.normalize('aurelia-bootstrapper').then(function (bsn) { - return host.System.normalize('aurelia-loader-default', bsn); - }).then(function (loaderName) { - return host.System.import(loaderName).then(function (m) { - return new m.DefaultLoader(); - }); - }); - } - - if (typeof host.require === 'function' && typeof host.define === 'function' && _typeof(host.define.amd) === 'object') { - return new Promise(function (resolve, reject) { - return host.require(['aurelia-loader-default'], function (m) { - return resolve(new m.DefaultLoader()); - }, reject); - }); - } - - if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') { - var _m = module.require('aurelia-loader-nodejs'); - return Promise.resolve(new _m.NodeJsLoader()); - } + function initializePal(loader) { + if (aureliaPal.isInitialized) + return Promise.resolve(); + var type; + var isRenderer = isNodeLike && (process.type === 'renderer' || process.versions['node-webkit']); + if (isNodeLike && !isRenderer) { + type = 'nodejs'; + } + else if (typeof window !== 'undefined') { + type = 'browser'; + } + else if (typeof self !== 'undefined') { + type = 'worker'; + } + else { + throw new Error('Could not determine platform implementation to load.'); + } + return loader.loadModule('aurelia-pal-' + type) + .then(function (palModule) { return type === 'nodejs' && !aureliaPal.isInitialized && palModule.globalize() || palModule.initialize(); }); } - - return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.'); - } - - function initializePal(loader) { - if (_aureliaPal.isInitialized) return Promise.resolve(); - - var type = void 0; - - var isRenderer = isNodeLike && (process.type === 'renderer' || process.versions['node-webkit']); - - if (isNodeLike && !isRenderer) { - type = 'nodejs'; - } else if (typeof window !== 'undefined') { - type = 'browser'; - } else if (typeof self !== 'undefined') { - type = 'worker'; - } else { - throw new Error('Could not determine platform implementation to load.'); + function preparePlatform(loader) { + var map = function (moduleId, relativeTo) { + return loader.normalize(moduleId, relativeTo) + .then(function (normalized) { + loader.map(moduleId, normalized); + return normalized; + }); + }; + return initializePal(loader) + .then(function () { return loader.normalize('aurelia-bootstrapper'); }) + .then(function (bootstrapperName) { + var frameworkPromise = map(aureliaPal.PLATFORM.moduleName('aurelia-framework', { exports: ['Aurelia'] }), bootstrapperName); + return Promise.all([ + frameworkPromise, + frameworkPromise.then(function (frameworkName) { return map('aurelia-dependency-injection', frameworkName); }), + map('aurelia-router', bootstrapperName), + map('aurelia-logging-console', bootstrapperName) + ]); + }) + .then(function (_a) { + var frameworkName = _a[0]; + return loader.loadModule(frameworkName); + }) + .then(function (fx) { return startResolve(function () { return new fx.Aurelia(loader); }); }); } - - return loader.loadModule('aurelia-pal-' + type).then(function (palModule) { - return type === 'nodejs' && !_aureliaPal.isInitialized && palModule.globalize() || palModule.initialize(); - }); - } - - function preparePlatform(loader) { - var map = function map(moduleId, relativeTo) { - return loader.normalize(moduleId, relativeTo).then(function (normalized) { - loader.map(moduleId, normalized); - return normalized; - }); - }; - - return initializePal(loader).then(function () { - return loader.normalize('aurelia-bootstrapper'); - }).then(function (bootstrapperName) { - var frameworkPromise = map(_aureliaPal.PLATFORM.moduleName('aurelia-framework', { exports: ['Aurelia'] }), bootstrapperName); - - return Promise.all([frameworkPromise, frameworkPromise.then(function (frameworkName) { - return map('aurelia-dependency-injection', frameworkName); - }), map('aurelia-router', bootstrapperName), map('aurelia-logging-console', bootstrapperName)]); - }).then(function (_ref) { - var frameworkName = _ref[0]; - return loader.loadModule(frameworkName); - }).then(function (fx) { - return startResolve(function () { - return new fx.Aurelia(loader); - }); - }); - } - - function config(appHost, configModuleId, aurelia) { - aurelia.host = appHost; - aurelia.configModuleId = configModuleId || null; - - if (configModuleId) { - return aurelia.loader.loadModule(configModuleId).then(function (customConfig) { - if (!customConfig.configure) { - throw new Error('Cannot initialize module \'' + configModuleId + '\' without a configure function.'); + function config(appHost, configModuleId, aurelia) { + aurelia.host = appHost; + aurelia.configModuleId = configModuleId || null; + if (configModuleId) { + return aurelia.loader + .loadModule(configModuleId) + .then(function (customConfig) { + if (!customConfig.configure) { + throw new Error("Cannot initialize module '".concat(configModuleId, "' without a configure function.")); + } + return customConfig.configure(aurelia); + }); } - - return customConfig.configure(aurelia); - }); + aurelia.use + .standardConfiguration() + .developmentLogging(); + return aurelia.start().then(function () { return aurelia.setRoot(); }); } + function run() { + return ready() + .then(createLoader) + .then(preparePlatform) + .then(function () { + var appHosts = host.document.querySelectorAll('[aurelia-app],[data-aurelia-app]'); + for (var i = 0, ii = appHosts.length; i < ii; ++i) { + var appHost = appHosts[i]; + var mainModuleId = appHost.getAttribute('aurelia-app') || appHost.getAttribute('data-aurelia-app'); + bootstrap(config.bind(null, appHost, mainModuleId)); + } + var toConsole = console.error.bind(console); + var bootstraps = bootstrapPromises.map(function (p) { return p.catch(toConsole); }); + bootstrapPromises = null; + return Promise.all(bootstraps); + }); + } + function bootstrap(configure) { + var p = startPromise.then(function (factory) { return configure(factory()); }); + if (bootstrapPromises) + bootstrapPromises.push(p); + return p; + } + var starting = run(); - aurelia.use.standardConfiguration().developmentLogging(); - - return aurelia.start().then(function () { - return aurelia.setRoot(); - }); - } - - function run() { - return ready().then(createLoader).then(preparePlatform).then(function () { - var appHosts = host.document.querySelectorAll('[aurelia-app],[data-aurelia-app]'); - for (var i = 0, ii = appHosts.length; i < ii; ++i) { - var appHost = appHosts[i]; - var moduleId = appHost.getAttribute('aurelia-app') || appHost.getAttribute('data-aurelia-app'); - bootstrap(config.bind(null, appHost, moduleId)); - } - - var toConsole = console.error.bind(console); - var bootstraps = bootstrapPromises.map(function (p) { - return p.catch(toConsole); - }); - bootstrapPromises = null; - return Promise.all(bootstraps); - }); - } + exports.bootstrap = bootstrap; + exports.starting = starting; - function bootstrap(configure) { - var p = startPromise.then(function (factory) { - return configure(factory()); - }); - if (bootstrapPromises) bootstrapPromises.push(p); - return p; - } + Object.defineProperty(exports, '__esModule', { value: true }); - var starting = exports.starting = run(); -}); \ No newline at end of file +})); +//# sourceMappingURL=aurelia-bootstrapper.js.map diff --git a/dist/amd/aurelia-bootstrapper.js.map b/dist/amd/aurelia-bootstrapper.js.map new file mode 100644 index 0000000..3704a74 --- /dev/null +++ b/dist/amd/aurelia-bootstrapper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aurelia-bootstrapper.js","sources":["../../src/aurelia-bootstrapper.ts"],"sourcesContent":[null],"names":["PLATFORM","isInitialized"],"mappings":";;IAOA,IAAI,iBAAiB,GAAG,EAAE,CAAC;IAC3B,IAAI,YAA2E,CAAC;IAEhF,IAAM,YAAY,GAAG,IAAI,OAAO,CAAmB,UAAA,OAAO,EAAI,EAAA,OAAA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EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;IACrD,SAAA;YAID,IAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9C,QAAA,IAAM,UAAU,GAAG,iBAAiB,CAAC,GAAG,CAAC,UAAA,CAAC,EAAA,EAAI,OAAA,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAlB,EAAkB,CAAC,CAAC;YAClE,iBAAiB,GAAG,IAAI,CAAC;IACzB,QAAA,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACjC,KAAC,CAAC,CAAC;IACP,CAAC;IASK,SAAU,SAAS,CAAC,SAAmB,EAAA;IAC3C,IAAA,IAAM,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,UAAA,OAAO,EAAA,EAAI,OAAA,SAAS,CAAC,OAAO,EAAE,CAAC,CAApB,EAAoB,CAAC,CAAC;IAC7D,IAAA,IAAI,iBAAiB;IAAE,QAAA,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjD,IAAA,OAAO,CAAC,CAAC;IACX,CAAC;AAMY,QAAA,QAAQ,GAAG,GAAG;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/commonjs/aurelia-bootstrapper.js b/dist/commonjs/aurelia-bootstrapper.js index 9628a84..7f1444d 100644 --- a/dist/commonjs/aurelia-bootstrapper.js +++ b/dist/commonjs/aurelia-bootstrapper.js @@ -1,175 +1,143 @@ 'use strict'; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.starting = undefined; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -exports.bootstrap = bootstrap; +Object.defineProperty(exports, '__esModule', { value: true }); require('aurelia-polyfills'); - -var _aureliaPal = require('aurelia-pal'); +var aureliaPal = require('aurelia-pal'); var bootstrapPromises = []; -var startResolve = void 0; - -var startPromise = new Promise(function (resolve) { - return startResolve = resolve; -}); -var host = _aureliaPal.PLATFORM.global; +var startResolve; +var startPromise = new Promise(function (resolve) { return startResolve = resolve; }); +var host = aureliaPal.PLATFORM.global; var isNodeLike = typeof process !== 'undefined' && !process.browser; - function ready() { - if (!host.document || host.document.readyState === 'complete') { - return Promise.resolve(); - } - - return new Promise(function (resolve) { - host.document.addEventListener('DOMContentLoaded', completed); - host.addEventListener('load', completed); - - function completed() { - host.document.removeEventListener('DOMContentLoaded', completed); - host.removeEventListener('load', completed); - resolve(); + if (!host.document || host.document.readyState === 'complete') { + return Promise.resolve(); } - }); + return new Promise(function (resolve) { + host.document.addEventListener('DOMContentLoaded', completed); + host.addEventListener('load', completed); + function completed() { + host.document.removeEventListener('DOMContentLoaded', completed); + host.removeEventListener('load', completed); + resolve(); + } + }); } - function createLoader() { - if (_aureliaPal.PLATFORM.Loader) { - return Promise.resolve(new _aureliaPal.PLATFORM.Loader()); - } - - if (typeof AURELIA_WEBPACK_2_0 === 'undefined') { - if (typeof __webpack_require__ !== 'undefined') { - var m = __webpack_require__(require.resolve('aurelia-loader-webpack')); - return Promise.resolve(new m.WebpackLoader()); + if (aureliaPal.PLATFORM.Loader) { + return Promise.resolve(new aureliaPal.PLATFORM.Loader()); } - - if (host.System && typeof host.System.config === 'function') { - return host.System.normalize('aurelia-bootstrapper').then(function (bsn) { - return host.System.normalize('aurelia-loader-default', bsn); - }).then(function (loaderName) { - return host.System.import(loaderName).then(function (m) { - return new m.DefaultLoader(); - }); - }); - } - - if (typeof host.require === 'function' && typeof host.define === 'function' && _typeof(host.define.amd) === 'object') { - return new Promise(function (resolve, reject) { - return host.require(['aurelia-loader-default'], function (m) { - return resolve(new m.DefaultLoader()); - }, reject); - }); + if (typeof AURELIA_WEBPACK_2_0 === 'undefined') { + if (typeof __webpack_require__ !== 'undefined') { + var m = __webpack_require__(require.resolve('aurelia-loader-webpack')); + return Promise.resolve(new m.WebpackLoader()); + } + if (host.System && typeof host.System.config === 'function') { + return host.System.normalize('aurelia-bootstrapper').then(function (bsn) { + return host.System.normalize('aurelia-loader-default', bsn); + }).then(function (loaderName) { + return host.System.import(loaderName).then(function (m) { return new m.DefaultLoader(); }); + }); + } + if (typeof host.require === 'function' && typeof host.define === 'function' && typeof host.define.amd === 'object') { + return new Promise(function (resolve, reject) { return host.require(['aurelia-loader-default'], function (m) { return resolve(new m.DefaultLoader()); }, reject); }); + } + if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') { + var m = module.require('aurelia-loader-nodejs'); + return Promise.resolve(new m.NodeJsLoader()); + } } - - if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') { - var _m = module.require('aurelia-loader-nodejs'); - return Promise.resolve(new _m.NodeJsLoader()); - } - } - - return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.'); + return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.'); } - function initializePal(loader) { - if (_aureliaPal.isInitialized) return Promise.resolve(); - - var type = void 0; - - var isRenderer = isNodeLike && (process.type === 'renderer' || process.versions['node-webkit']); - - if (isNodeLike && !isRenderer) { - type = 'nodejs'; - } else if (typeof window !== 'undefined') { - type = 'browser'; - } else if (typeof self !== 'undefined') { - type = 'worker'; - } else { - throw new Error('Could not determine platform implementation to load.'); - } - - return loader.loadModule('aurelia-pal-' + type).then(function (palModule) { - return type === 'nodejs' && !_aureliaPal.isInitialized && palModule.globalize() || palModule.initialize(); - }); + if (aureliaPal.isInitialized) + return Promise.resolve(); + var type; + var isRenderer = isNodeLike && (process.type === 'renderer' || process.versions['node-webkit']); + if (isNodeLike && !isRenderer) { + type = 'nodejs'; + } + else if (typeof window !== 'undefined') { + type = 'browser'; + } + else if (typeof self !== 'undefined') { + type = 'worker'; + } + else { + throw new Error('Could not determine platform implementation to load.'); + } + return loader.loadModule('aurelia-pal-' + type) + .then(function (palModule) { return type === 'nodejs' && !aureliaPal.isInitialized && palModule.globalize() || palModule.initialize(); }); } - function preparePlatform(loader) { - var map = function map(moduleId, relativeTo) { - return loader.normalize(moduleId, relativeTo).then(function (normalized) { - loader.map(moduleId, normalized); - return normalized; - }); - }; - - return initializePal(loader).then(function () { - return loader.normalize('aurelia-bootstrapper'); - }).then(function (bootstrapperName) { - var frameworkPromise = map(_aureliaPal.PLATFORM.moduleName('aurelia-framework', { exports: ['Aurelia'] }), bootstrapperName); - - return Promise.all([frameworkPromise, frameworkPromise.then(function (frameworkName) { - return map('aurelia-dependency-injection', frameworkName); - }), map('aurelia-router', bootstrapperName), map('aurelia-logging-console', bootstrapperName)]); - }).then(function (_ref) { - var frameworkName = _ref[0]; - return loader.loadModule(frameworkName); - }).then(function (fx) { - return startResolve(function () { - return new fx.Aurelia(loader); - }); - }); + var map = function (moduleId, relativeTo) { + return loader.normalize(moduleId, relativeTo) + .then(function (normalized) { + loader.map(moduleId, normalized); + return normalized; + }); + }; + return initializePal(loader) + .then(function () { return loader.normalize('aurelia-bootstrapper'); }) + .then(function (bootstrapperName) { + var frameworkPromise = map(aureliaPal.PLATFORM.moduleName('aurelia-framework', { exports: ['Aurelia'] }), bootstrapperName); + return Promise.all([ + frameworkPromise, + frameworkPromise.then(function (frameworkName) { return map('aurelia-dependency-injection', frameworkName); }), + map('aurelia-router', bootstrapperName), + map('aurelia-logging-console', bootstrapperName) + ]); + }) + .then(function (_a) { + var frameworkName = _a[0]; + return loader.loadModule(frameworkName); + }) + .then(function (fx) { return startResolve(function () { return new fx.Aurelia(loader); }); }); } - function config(appHost, configModuleId, aurelia) { - aurelia.host = appHost; - aurelia.configModuleId = configModuleId || null; - - if (configModuleId) { - return aurelia.loader.loadModule(configModuleId).then(function (customConfig) { - if (!customConfig.configure) { - throw new Error('Cannot initialize module \'' + configModuleId + '\' without a configure function.'); - } - - return customConfig.configure(aurelia); - }); - } - - aurelia.use.standardConfiguration().developmentLogging(); - - return aurelia.start().then(function () { - return aurelia.setRoot(); - }); + aurelia.host = appHost; + aurelia.configModuleId = configModuleId || null; + if (configModuleId) { + return aurelia.loader + .loadModule(configModuleId) + .then(function (customConfig) { + if (!customConfig.configure) { + throw new Error("Cannot initialize module '".concat(configModuleId, "' without a configure function.")); + } + return customConfig.configure(aurelia); + }); + } + aurelia.use + .standardConfiguration() + .developmentLogging(); + return aurelia.start().then(function () { return aurelia.setRoot(); }); } - function run() { - return ready().then(createLoader).then(preparePlatform).then(function () { - var appHosts = host.document.querySelectorAll('[aurelia-app],[data-aurelia-app]'); - for (var i = 0, ii = appHosts.length; i < ii; ++i) { - var appHost = appHosts[i]; - var moduleId = appHost.getAttribute('aurelia-app') || appHost.getAttribute('data-aurelia-app'); - bootstrap(config.bind(null, appHost, moduleId)); - } - - var toConsole = console.error.bind(console); - var bootstraps = bootstrapPromises.map(function (p) { - return p.catch(toConsole); + return ready() + .then(createLoader) + .then(preparePlatform) + .then(function () { + var appHosts = host.document.querySelectorAll('[aurelia-app],[data-aurelia-app]'); + for (var i = 0, ii = appHosts.length; i < ii; ++i) { + var appHost = appHosts[i]; + var mainModuleId = appHost.getAttribute('aurelia-app') || appHost.getAttribute('data-aurelia-app'); + bootstrap(config.bind(null, appHost, mainModuleId)); + } + var toConsole = console.error.bind(console); + var bootstraps = bootstrapPromises.map(function (p) { return p.catch(toConsole); }); + bootstrapPromises = null; + return Promise.all(bootstraps); }); - bootstrapPromises = null; - return Promise.all(bootstraps); - }); } - function bootstrap(configure) { - var p = startPromise.then(function (factory) { - return configure(factory()); - }); - if (bootstrapPromises) bootstrapPromises.push(p); - return p; + var p = startPromise.then(function (factory) { return configure(factory()); }); + if (bootstrapPromises) + bootstrapPromises.push(p); + return p; } +var starting = run(); -var starting = exports.starting = run(); \ No newline at end of file +exports.bootstrap = bootstrap; +exports.starting = starting; +//# sourceMappingURL=aurelia-bootstrapper.js.map diff --git a/dist/commonjs/aurelia-bootstrapper.js.map b/dist/commonjs/aurelia-bootstrapper.js.map new file mode 100644 index 0000000..6742095 --- /dev/null +++ b/dist/commonjs/aurelia-bootstrapper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aurelia-bootstrapper.js","sources":["../../src/aurelia-bootstrapper.ts"],"sourcesContent":[null],"names":["PLATFORM","isInitialized"],"mappings":";;;;;;;AAOA,IAAI,iBAAiB,GAAG,EAAE,CAAC;AAC3B,IAAI,YAA2E,CAAC;AAEhF,IAAM,YAAY,GAAG,IAAI,OAAO,CAAmB,UAAA,OAAO,EAAI,EAAA,OAAA,YAAY,GAAG,OAAO,CAAtB,EAAsB,CAAC,CAAC;AACtF,IAAM,IAAI,GAAGA,mBAAQ,CAAC,MAAM,CAAC;AAC7B,IAAM,UAAU,GAAG,OAAO,OAAO,KAAK,WAAW,IAAI,CAAE,OAA0B,CAAC,OAAO,CAAC;AAE1F,SAAS,KAAK,GAAA;AACZ,IAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,KAAK,UAAU,EAAE;AAC7D,QAAA,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AAC1B,KAAA;AAED,IAAA,OAAO,IAAI,OAAO,CAAO,UAAA,OAAO,EAAA;QAC9B,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;AAC9D,QAAA,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAEzC,QAAA,SAAS,SAAS,GAAA;YAChB,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;AACjE,YAAA,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAC5C,YAAA,OAAO,EAAE,CAAC;SACX;AACH,KAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,YAAY,GAAA;IASnB,IAAIA,mBAAQ,CAAC,MAAM,EAAE;QACnB,O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GAAG,CAAC,EAAE,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;AACjD,YAAA,IAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC5B,YAAA,IAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;AACrG,YAAA,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;AACrD,SAAA;QAID,IAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC9C,QAAA,IAAM,UAAU,GAAG,iBAAiB,CAAC,GAAG,CAAC,UAAA,CAAC,EAAA,EAAI,OAAA,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAlB,EAAkB,CAAC,CAAC;QAClE,iBAAiB,GAAG,IAAI,CAAC;AACzB,QAAA,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACjC,KAAC,CAAC,CAAC;AACP,CAAC;AASK,SAAU,SAAS,CAAC,SAAmB,EAAA;AAC3C,IAAA,IAAM,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,UAAA,OAAO,EAAA,EAAI,OAAA,SAAS,CAAC,OAAO,EAAE,CAAC,CAApB,EAAoB,CAAC,CAAC;AAC7D,IAAA,IAAI,iBAAiB;AAAE,QAAA,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjD,IAAA,OAAO,CAAC,CAAC;AACX,CAAC;AAMY,IAAA,QAAQ,GAAG,GAAG;;;;;"} \ No newline at end of file diff --git a/dist/es2015/aurelia-bootstrapper.js b/dist/es2015/aurelia-bootstrapper.js index 419041c..dec360d 100644 --- a/dist/es2015/aurelia-bootstrapper.js +++ b/dist/es2015/aurelia-bootstrapper.js @@ -3,132 +3,131 @@ import { PLATFORM, isInitialized } from 'aurelia-pal'; let bootstrapPromises = []; let startResolve; - const startPromise = new Promise(resolve => startResolve = resolve); const host = PLATFORM.global; const isNodeLike = typeof process !== 'undefined' && !process.browser; - function ready() { - if (!host.document || host.document.readyState === 'complete') { - return Promise.resolve(); - } - - return new Promise(resolve => { - host.document.addEventListener('DOMContentLoaded', completed); - host.addEventListener('load', completed); - - function completed() { - host.document.removeEventListener('DOMContentLoaded', completed); - host.removeEventListener('load', completed); - resolve(); + if (!host.document || host.document.readyState === 'complete') { + return Promise.resolve(); } - }); + return new Promise(resolve => { + host.document.addEventListener('DOMContentLoaded', completed); + host.addEventListener('load', completed); + function completed() { + host.document.removeEventListener('DOMContentLoaded', completed); + host.removeEventListener('load', completed); + resolve(); + } + }); } - function createLoader() { - if (PLATFORM.Loader) { - return Promise.resolve(new PLATFORM.Loader()); - } - - if (typeof AURELIA_WEBPACK_2_0 === 'undefined') { - if (typeof __webpack_require__ !== 'undefined') { - const m = __webpack_require__(require.resolve('aurelia-loader-webpack')); - return Promise.resolve(new m.WebpackLoader()); + if (PLATFORM.Loader) { + return Promise.resolve(new PLATFORM.Loader()); } - - if (host.System && typeof host.System.config === 'function') { - return host.System.normalize('aurelia-bootstrapper').then(bsn => { - return host.System.normalize('aurelia-loader-default', bsn); - }).then(loaderName => { - return host.System.import(loaderName).then(m => new m.DefaultLoader()); - }); - } - - if (typeof host.require === 'function' && typeof host.define === 'function' && typeof host.define.amd === 'object') { - return new Promise((resolve, reject) => host.require(['aurelia-loader-default'], m => resolve(new m.DefaultLoader()), reject)); + if (typeof AURELIA_WEBPACK_2_0 === 'undefined') { + if (typeof __webpack_require__ !== 'undefined') { + const m = __webpack_require__(require.resolve('aurelia-loader-webpack')); + return Promise.resolve(new m.WebpackLoader()); + } + if (host.System && typeof host.System.config === 'function') { + return host.System.normalize('aurelia-bootstrapper').then(bsn => { + return host.System.normalize('aurelia-loader-default', bsn); + }).then(loaderName => { + return host.System.import(loaderName).then(m => new m.DefaultLoader()); + }); + } + if (typeof host.require === 'function' && typeof host.define === 'function' && typeof host.define.amd === 'object') { + return new Promise((resolve, reject) => host.require(['aurelia-loader-default'], m => resolve(new m.DefaultLoader()), reject)); + } + if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') { + const m = module.require('aurelia-loader-nodejs'); + return Promise.resolve(new m.NodeJsLoader()); + } } - - if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') { - const m = module.require('aurelia-loader-nodejs'); - return Promise.resolve(new m.NodeJsLoader()); - } - } - - return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.'); + return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.'); } - function initializePal(loader) { - if (isInitialized) return Promise.resolve(); - - let type; - - const isRenderer = isNodeLike && (process.type === 'renderer' || process.versions['node-webkit']); - - if (isNodeLike && !isRenderer) { - type = 'nodejs'; - } else if (typeof window !== 'undefined') { - type = 'browser'; - } else if (typeof self !== 'undefined') { - type = 'worker'; - } else { - throw new Error('Could not determine platform implementation to load.'); - } - - return loader.loadModule('aurelia-pal-' + type).then(palModule => type === 'nodejs' && !isInitialized && palModule.globalize() || palModule.initialize()); + if (isInitialized) + return Promise.resolve(); + let type; + const isRenderer = isNodeLike && (process.type === 'renderer' || process.versions['node-webkit']); + if (isNodeLike && !isRenderer) { + type = 'nodejs'; + } + else if (typeof window !== 'undefined') { + type = 'browser'; + } + else if (typeof self !== 'undefined') { + type = 'worker'; + } + else { + throw new Error('Could not determine platform implementation to load.'); + } + return loader.loadModule('aurelia-pal-' + type) + .then(palModule => type === 'nodejs' && !isInitialized && palModule.globalize() || palModule.initialize()); } - function preparePlatform(loader) { - const map = (moduleId, relativeTo) => loader.normalize(moduleId, relativeTo).then(normalized => { - loader.map(moduleId, normalized); - return normalized; - }); - - return initializePal(loader).then(() => loader.normalize('aurelia-bootstrapper')).then(bootstrapperName => { - const frameworkPromise = map(PLATFORM.moduleName('aurelia-framework', { exports: ['Aurelia'] }), bootstrapperName); - - return Promise.all([frameworkPromise, frameworkPromise.then(frameworkName => map('aurelia-dependency-injection', frameworkName)), map('aurelia-router', bootstrapperName), map('aurelia-logging-console', bootstrapperName)]); - }).then(([frameworkName]) => loader.loadModule(frameworkName)).then(fx => startResolve(() => new fx.Aurelia(loader))); + const map = (moduleId, relativeTo) => loader.normalize(moduleId, relativeTo) + .then(normalized => { + loader.map(moduleId, normalized); + return normalized; + }); + return initializePal(loader) + .then(() => loader.normalize('aurelia-bootstrapper')) + .then(bootstrapperName => { + const frameworkPromise = map(PLATFORM.moduleName('aurelia-framework', { exports: ['Aurelia'] }), bootstrapperName); + return Promise.all([ + frameworkPromise, + frameworkPromise.then(frameworkName => map('aurelia-dependency-injection', frameworkName)), + map('aurelia-router', bootstrapperName), + map('aurelia-logging-console', bootstrapperName) + ]); + }) + .then(([frameworkName]) => loader.loadModule(frameworkName)) + .then((fx) => startResolve(() => new fx.Aurelia(loader))); } - function config(appHost, configModuleId, aurelia) { - aurelia.host = appHost; - aurelia.configModuleId = configModuleId || null; - - if (configModuleId) { - return aurelia.loader.loadModule(configModuleId).then(customConfig => { - if (!customConfig.configure) { - throw new Error(`Cannot initialize module '${configModuleId}' without a configure function.`); - } - - return customConfig.configure(aurelia); - }); - } - - aurelia.use.standardConfiguration().developmentLogging(); - - return aurelia.start().then(() => aurelia.setRoot()); + aurelia.host = appHost; + aurelia.configModuleId = configModuleId || null; + if (configModuleId) { + return aurelia.loader + .loadModule(configModuleId) + .then(customConfig => { + if (!customConfig.configure) { + throw new Error(`Cannot initialize module '${configModuleId}' without a configure function.`); + } + return customConfig.configure(aurelia); + }); + } + aurelia.use + .standardConfiguration() + .developmentLogging(); + return aurelia.start().then(() => aurelia.setRoot()); } - function run() { - return ready().then(createLoader).then(preparePlatform).then(() => { - const appHosts = host.document.querySelectorAll('[aurelia-app],[data-aurelia-app]'); - for (let i = 0, ii = appHosts.length; i < ii; ++i) { - const appHost = appHosts[i]; - const moduleId = appHost.getAttribute('aurelia-app') || appHost.getAttribute('data-aurelia-app'); - bootstrap(config.bind(null, appHost, moduleId)); - } - - const toConsole = console.error.bind(console); - const bootstraps = bootstrapPromises.map(p => p.catch(toConsole)); - bootstrapPromises = null; - return Promise.all(bootstraps); - }); + return ready() + .then(createLoader) + .then(preparePlatform) + .then(() => { + const appHosts = host.document.querySelectorAll('[aurelia-app],[data-aurelia-app]'); + for (let i = 0, ii = appHosts.length; i < ii; ++i) { + const appHost = appHosts[i]; + const mainModuleId = appHost.getAttribute('aurelia-app') || appHost.getAttribute('data-aurelia-app'); + bootstrap(config.bind(null, appHost, mainModuleId)); + } + const toConsole = console.error.bind(console); + const bootstraps = bootstrapPromises.map(p => p.catch(toConsole)); + bootstrapPromises = null; + return Promise.all(bootstraps); + }); } - -export function bootstrap(configure) { - const p = startPromise.then(factory => configure(factory())); - if (bootstrapPromises) bootstrapPromises.push(p); - return p; +function bootstrap(configure) { + const p = startPromise.then(factory => configure(factory())); + if (bootstrapPromises) + bootstrapPromises.push(p); + return p; } +const starting = run(); -export const starting = run(); \ No newline at end of file +export { bootstrap, starting }; +//# sourceMappingURL=aurelia-bootstrapper.js.map diff --git a/dist/es2015/aurelia-bootstrapper.js.map b/dist/es2015/aurelia-bootstrapper.js.map new file mode 100644 index 0000000..b2265b5 --- /dev/null +++ b/dist/es2015/aurelia-bootstrapper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aurelia-bootstrapper.js","sources":["../../src/aurelia-bootstrapper.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAOA,IAAI,iBAAiB,GAAG,EAAE,CAAC;AAC3B,IAAI,YAA2E,CAAC;AAEhF,MAAM,YAAY,GAAG,IAAI,OAAO,CAAmB,OAAO,IAAI,YAAY,GAAG,OAAO,CAAC,CAAC;AACtF,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC;AAC7B,MAAM,UAAU,GAAG,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AAE,QAAA,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjD,IAAA,OAAO,CAAC,CAAC;AACX,CAAC;AAMY,MAAA,QAAQ,GAAG,GAAG;;;;"} \ No newline at end of file diff --git a/dist/es2017/aurelia-bootstrapper.js b/dist/es2017/aurelia-bootstrapper.js new file mode 100644 index 0000000..dec360d --- /dev/null +++ b/dist/es2017/aurelia-bootstrapper.js @@ -0,0 +1,133 @@ +import 'aurelia-polyfills'; +import { PLATFORM, isInitialized } from 'aurelia-pal'; + +let bootstrapPromises = []; +let startResolve; +const startPromise = new Promise(resolve => startResolve = resolve); +const host = PLATFORM.global; +const isNodeLike = typeof process !== 'undefined' && !process.browser; +function ready() { + if (!host.document || host.document.readyState === 'complete') { + return Promise.resolve(); + } + return new Promise(resolve => { + host.document.addEventListener('DOMContentLoaded', completed); + host.addEventListener('load', completed); + function completed() { + host.document.removeEventListener('DOMContentLoaded', completed); + host.removeEventListener('load', completed); + resolve(); + } + }); +} +function createLoader() { + if (PLATFORM.Loader) { + return Promise.resolve(new PLATFORM.Loader()); + } + if (typeof AURELIA_WEBPACK_2_0 === 'undefined') { + if (typeof __webpack_require__ !== 'undefined') { + const m = __webpack_require__(require.resolve('aurelia-loader-webpack')); + return Promise.resolve(new m.WebpackLoader()); + } + if (host.System && typeof host.System.config === 'function') { + return host.System.normalize('aurelia-bootstrapper').then(bsn => { + return host.System.normalize('aurelia-loader-default', bsn); + }).then(loaderName => { + return host.System.import(loaderName).then(m => new m.DefaultLoader()); + }); + } + if (typeof host.require === 'function' && typeof host.define === 'function' && typeof host.define.amd === 'object') { + return new Promise((resolve, reject) => host.require(['aurelia-loader-default'], m => resolve(new m.DefaultLoader()), reject)); + } + if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') { + const m = module.require('aurelia-loader-nodejs'); + return Promise.resolve(new m.NodeJsLoader()); + } + } + return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.'); +} +function initializePal(loader) { + if (isInitialized) + return Promise.resolve(); + let type; + const isRenderer = isNodeLike && (process.type === 'renderer' || process.versions['node-webkit']); + if (isNodeLike && !isRenderer) { + type = 'nodejs'; + } + else if (typeof window !== 'undefined') { + type = 'browser'; + } + else if (typeof self !== 'undefined') { + type = 'worker'; + } + else { + throw new Error('Could not determine platform implementation to load.'); + } + return loader.loadModule('aurelia-pal-' + type) + .then(palModule => type === 'nodejs' && !isInitialized && palModule.globalize() || palModule.initialize()); +} +function preparePlatform(loader) { + const map = (moduleId, relativeTo) => loader.normalize(moduleId, relativeTo) + .then(normalized => { + loader.map(moduleId, normalized); + return normalized; + }); + return initializePal(loader) + .then(() => loader.normalize('aurelia-bootstrapper')) + .then(bootstrapperName => { + const frameworkPromise = map(PLATFORM.moduleName('aurelia-framework', { exports: ['Aurelia'] }), bootstrapperName); + return Promise.all([ + frameworkPromise, + frameworkPromise.then(frameworkName => map('aurelia-dependency-injection', frameworkName)), + map('aurelia-router', bootstrapperName), + map('aurelia-logging-console', bootstrapperName) + ]); + }) + .then(([frameworkName]) => loader.loadModule(frameworkName)) + .then((fx) => startResolve(() => new fx.Aurelia(loader))); +} +function config(appHost, configModuleId, aurelia) { + aurelia.host = appHost; + aurelia.configModuleId = configModuleId || null; + if (configModuleId) { + return aurelia.loader + .loadModule(configModuleId) + .then(customConfig => { + if (!customConfig.configure) { + throw new Error(`Cannot initialize module '${configModuleId}' without a configure function.`); + } + return customConfig.configure(aurelia); + }); + } + aurelia.use + .standardConfiguration() + .developmentLogging(); + return aurelia.start().then(() => aurelia.setRoot()); +} +function run() { + return ready() + .then(createLoader) + .then(preparePlatform) + .then(() => { + const appHosts = host.document.querySelectorAll('[aurelia-app],[data-aurelia-app]'); + for (let i = 0, ii = appHosts.length; i < ii; ++i) { + const appHost = appHosts[i]; + const mainModuleId = appHost.getAttribute('aurelia-app') || appHost.getAttribute('data-aurelia-app'); + bootstrap(config.bind(null, appHost, mainModuleId)); + } + const toConsole = console.error.bind(console); + const bootstraps = bootstrapPromises.map(p => p.catch(toConsole)); + bootstrapPromises = null; + return Promise.all(bootstraps); + }); +} +function bootstrap(configure) { + const p = startPromise.then(factory => configure(factory())); + if (bootstrapPromises) + bootstrapPromises.push(p); + return p; +} +const starting = run(); + +export { bootstrap, starting }; +//# sourceMappingURL=aurelia-bootstrapper.js.map diff --git a/dist/es2017/aurelia-bootstrapper.js.map b/dist/es2017/aurelia-bootstrapper.js.map new file mode 100644 index 0000000..b2265b5 --- /dev/null +++ b/dist/es2017/aurelia-bootstrapper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aurelia-bootstrapper.js","sources":["../../src/aurelia-bootstrapper.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAOA,IAAI,iBAAiB,GAAG,EAAE,CAAC;AAC3B,IAAI,YAA2E,CAAC;AAEhF,MAAM,YAAY,GAAG,IAAI,OAAO,CAAmB,OAAO,IAAI,YAAY,GAAG,OAAO,CAAC,CAAC;AACtF,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC;AAC7B,MAAM,UAAU,GAAG,OAAO,OAAO,KAAK,WAAW,IAAI,CAAE,OAA0B,CAAC,OAAO,CAAC;AAE1F,SAAS,KAAK,GAAA;AACZ,IAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,KAAK,UAAU,EAAE;AAC7D,QAAA,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AAC1B,KAAA;AAED,IAAA,OAAO,IAAI,OAAO,CAAO,OAAO,IAAG;QACjC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;AAC9D,QAAA,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAEzC,QAAA,SAAS,SAAS,GAAA;YAChB,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,SAAS,CAAC,CA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AC,YAAY,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;AACrG,YAAA,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;AACrD,SAAA;QAID,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC9C,QAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;QAClE,iBAAiB,GAAG,IAAI,CAAC;AACzB,QAAA,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACjC,KAAC,CAAC,CAAC;AACP,CAAC;AASK,SAAU,SAAS,CAAC,SAAmB,EAAA;AAC3C,IAAA,MAAM,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AAC7D,IAAA,IAAI,iBAAiB;AAAE,QAAA,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjD,IAAA,OAAO,CAAC,CAAC;AACX,CAAC;AAMY,MAAA,QAAQ,GAAG,GAAG;;;;"} \ No newline at end of file diff --git a/dist/native-modules/aurelia-bootstrapper.js b/dist/native-modules/aurelia-bootstrapper.js index efcdc54..389a6ef 100644 --- a/dist/native-modules/aurelia-bootstrapper.js +++ b/dist/native-modules/aurelia-bootstrapper.js @@ -1,165 +1,138 @@ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - import 'aurelia-polyfills'; import { PLATFORM, isInitialized } from 'aurelia-pal'; var bootstrapPromises = []; -var startResolve = void 0; - -var startPromise = new Promise(function (resolve) { - return startResolve = resolve; -}); +var startResolve; +var startPromise = new Promise(function (resolve) { return startResolve = resolve; }); var host = PLATFORM.global; var isNodeLike = typeof process !== 'undefined' && !process.browser; - function ready() { - if (!host.document || host.document.readyState === 'complete') { - return Promise.resolve(); - } - - return new Promise(function (resolve) { - host.document.addEventListener('DOMContentLoaded', completed); - host.addEventListener('load', completed); - - function completed() { - host.document.removeEventListener('DOMContentLoaded', completed); - host.removeEventListener('load', completed); - resolve(); + if (!host.document || host.document.readyState === 'complete') { + return Promise.resolve(); } - }); + return new Promise(function (resolve) { + host.document.addEventListener('DOMContentLoaded', completed); + host.addEventListener('load', completed); + function completed() { + host.document.removeEventListener('DOMContentLoaded', completed); + host.removeEventListener('load', completed); + resolve(); + } + }); } - function createLoader() { - if (PLATFORM.Loader) { - return Promise.resolve(new PLATFORM.Loader()); - } - - if (typeof AURELIA_WEBPACK_2_0 === 'undefined') { - if (typeof __webpack_require__ !== 'undefined') { - var m = __webpack_require__(require.resolve('aurelia-loader-webpack')); - return Promise.resolve(new m.WebpackLoader()); + if (PLATFORM.Loader) { + return Promise.resolve(new PLATFORM.Loader()); } - - if (host.System && typeof host.System.config === 'function') { - return host.System.normalize('aurelia-bootstrapper').then(function (bsn) { - return host.System.normalize('aurelia-loader-default', bsn); - }).then(function (loaderName) { - return host.System.import(loaderName).then(function (m) { - return new m.DefaultLoader(); - }); - }); + if (typeof AURELIA_WEBPACK_2_0 === 'undefined') { + if (typeof __webpack_require__ !== 'undefined') { + var m = __webpack_require__(require.resolve('aurelia-loader-webpack')); + return Promise.resolve(new m.WebpackLoader()); + } + if (host.System && typeof host.System.config === 'function') { + return host.System.normalize('aurelia-bootstrapper').then(function (bsn) { + return host.System.normalize('aurelia-loader-default', bsn); + }).then(function (loaderName) { + return host.System.import(loaderName).then(function (m) { return new m.DefaultLoader(); }); + }); + } + if (typeof host.require === 'function' && typeof host.define === 'function' && typeof host.define.amd === 'object') { + return new Promise(function (resolve, reject) { return host.require(['aurelia-loader-default'], function (m) { return resolve(new m.DefaultLoader()); }, reject); }); + } + if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') { + var m = module.require('aurelia-loader-nodejs'); + return Promise.resolve(new m.NodeJsLoader()); + } } - - if (typeof host.require === 'function' && typeof host.define === 'function' && _typeof(host.define.amd) === 'object') { - return new Promise(function (resolve, reject) { - return host.require(['aurelia-loader-default'], function (m) { - return resolve(new m.DefaultLoader()); - }, reject); - }); - } - - if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') { - var _m = module.require('aurelia-loader-nodejs'); - return Promise.resolve(new _m.NodeJsLoader()); - } - } - - return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.'); + return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.'); } - function initializePal(loader) { - if (isInitialized) return Promise.resolve(); - - var type = void 0; - - var isRenderer = isNodeLike && (process.type === 'renderer' || process.versions['node-webkit']); - - if (isNodeLike && !isRenderer) { - type = 'nodejs'; - } else if (typeof window !== 'undefined') { - type = 'browser'; - } else if (typeof self !== 'undefined') { - type = 'worker'; - } else { - throw new Error('Could not determine platform implementation to load.'); - } - - return loader.loadModule('aurelia-pal-' + type).then(function (palModule) { - return type === 'nodejs' && !isInitialized && palModule.globalize() || palModule.initialize(); - }); + if (isInitialized) + return Promise.resolve(); + var type; + var isRenderer = isNodeLike && (process.type === 'renderer' || process.versions['node-webkit']); + if (isNodeLike && !isRenderer) { + type = 'nodejs'; + } + else if (typeof window !== 'undefined') { + type = 'browser'; + } + else if (typeof self !== 'undefined') { + type = 'worker'; + } + else { + throw new Error('Could not determine platform implementation to load.'); + } + return loader.loadModule('aurelia-pal-' + type) + .then(function (palModule) { return type === 'nodejs' && !isInitialized && palModule.globalize() || palModule.initialize(); }); } - function preparePlatform(loader) { - var map = function map(moduleId, relativeTo) { - return loader.normalize(moduleId, relativeTo).then(function (normalized) { - loader.map(moduleId, normalized); - return normalized; - }); - }; - - return initializePal(loader).then(function () { - return loader.normalize('aurelia-bootstrapper'); - }).then(function (bootstrapperName) { - var frameworkPromise = map(PLATFORM.moduleName('aurelia-framework', { exports: ['Aurelia'] }), bootstrapperName); - - return Promise.all([frameworkPromise, frameworkPromise.then(function (frameworkName) { - return map('aurelia-dependency-injection', frameworkName); - }), map('aurelia-router', bootstrapperName), map('aurelia-logging-console', bootstrapperName)]); - }).then(function (_ref) { - var frameworkName = _ref[0]; - return loader.loadModule(frameworkName); - }).then(function (fx) { - return startResolve(function () { - return new fx.Aurelia(loader); - }); - }); + var map = function (moduleId, relativeTo) { + return loader.normalize(moduleId, relativeTo) + .then(function (normalized) { + loader.map(moduleId, normalized); + return normalized; + }); + }; + return initializePal(loader) + .then(function () { return loader.normalize('aurelia-bootstrapper'); }) + .then(function (bootstrapperName) { + var frameworkPromise = map(PLATFORM.moduleName('aurelia-framework', { exports: ['Aurelia'] }), bootstrapperName); + return Promise.all([ + frameworkPromise, + frameworkPromise.then(function (frameworkName) { return map('aurelia-dependency-injection', frameworkName); }), + map('aurelia-router', bootstrapperName), + map('aurelia-logging-console', bootstrapperName) + ]); + }) + .then(function (_a) { + var frameworkName = _a[0]; + return loader.loadModule(frameworkName); + }) + .then(function (fx) { return startResolve(function () { return new fx.Aurelia(loader); }); }); } - function config(appHost, configModuleId, aurelia) { - aurelia.host = appHost; - aurelia.configModuleId = configModuleId || null; - - if (configModuleId) { - return aurelia.loader.loadModule(configModuleId).then(function (customConfig) { - if (!customConfig.configure) { - throw new Error('Cannot initialize module \'' + configModuleId + '\' without a configure function.'); - } - - return customConfig.configure(aurelia); - }); - } - - aurelia.use.standardConfiguration().developmentLogging(); - - return aurelia.start().then(function () { - return aurelia.setRoot(); - }); + aurelia.host = appHost; + aurelia.configModuleId = configModuleId || null; + if (configModuleId) { + return aurelia.loader + .loadModule(configModuleId) + .then(function (customConfig) { + if (!customConfig.configure) { + throw new Error("Cannot initialize module '".concat(configModuleId, "' without a configure function.")); + } + return customConfig.configure(aurelia); + }); + } + aurelia.use + .standardConfiguration() + .developmentLogging(); + return aurelia.start().then(function () { return aurelia.setRoot(); }); } - function run() { - return ready().then(createLoader).then(preparePlatform).then(function () { - var appHosts = host.document.querySelectorAll('[aurelia-app],[data-aurelia-app]'); - for (var i = 0, ii = appHosts.length; i < ii; ++i) { - var appHost = appHosts[i]; - var moduleId = appHost.getAttribute('aurelia-app') || appHost.getAttribute('data-aurelia-app'); - bootstrap(config.bind(null, appHost, moduleId)); - } - - var toConsole = console.error.bind(console); - var bootstraps = bootstrapPromises.map(function (p) { - return p.catch(toConsole); + return ready() + .then(createLoader) + .then(preparePlatform) + .then(function () { + var appHosts = host.document.querySelectorAll('[aurelia-app],[data-aurelia-app]'); + for (var i = 0, ii = appHosts.length; i < ii; ++i) { + var appHost = appHosts[i]; + var mainModuleId = appHost.getAttribute('aurelia-app') || appHost.getAttribute('data-aurelia-app'); + bootstrap(config.bind(null, appHost, mainModuleId)); + } + var toConsole = console.error.bind(console); + var bootstraps = bootstrapPromises.map(function (p) { return p.catch(toConsole); }); + bootstrapPromises = null; + return Promise.all(bootstraps); }); - bootstrapPromises = null; - return Promise.all(bootstraps); - }); } - -export function bootstrap(configure) { - var p = startPromise.then(function (factory) { - return configure(factory()); - }); - if (bootstrapPromises) bootstrapPromises.push(p); - return p; +function bootstrap(configure) { + var p = startPromise.then(function (factory) { return configure(factory()); }); + if (bootstrapPromises) + bootstrapPromises.push(p); + return p; } +var starting = run(); -export var starting = run(); \ No newline at end of file +export { bootstrap, starting }; +//# sourceMappingURL=aurelia-bootstrapper.js.map diff --git a/dist/native-modules/aurelia-bootstrapper.js.map b/dist/native-modules/aurelia-bootstrapper.js.map new file mode 100644 index 0000000..9b07009 --- /dev/null +++ b/dist/native-modules/aurelia-bootstrapper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aurelia-bootstrapper.js","sources":["../../src/aurelia-bootstrapper.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAOA,I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AC,IAAI,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;AACrG,YAAA,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;AACrD,SAAA;QAID,IAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC9C,QAAA,IAAM,UAAU,GAAG,iBAAiB,CAAC,GAAG,CAAC,UAAA,CAAC,EAAA,EAAI,OAAA,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAlB,EAAkB,CAAC,CAAC;QAClE,iBAAiB,GAAG,IAAI,CAAC;AACzB,QAAA,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACjC,KAAC,CAAC,CAAC;AACP,CAAC;AASK,SAAU,SAAS,CAAC,SAAmB,EAAA;AAC3C,IAAA,IAAM,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,UAAA,OAAO,EAAA,EAAI,OAAA,SAAS,CAAC,OAAO,EAAE,CAAC,CAApB,EAAoB,CAAC,CAAC;AAC7D,IAAA,IAAI,iBAAiB;AAAE,QAAA,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjD,IAAA,OAAO,CAAC,CAAC;AACX,CAAC;AAMY,IAAA,QAAQ,GAAG,GAAG;;;;"} \ No newline at end of file diff --git a/dist/system/aurelia-bootstrapper.js b/dist/system/aurelia-bootstrapper.js index 179f9ce..2382fab 100644 --- a/dist/system/aurelia-bootstrapper.js +++ b/dist/system/aurelia-bootstrapper.js @@ -1,184 +1,149 @@ -'use strict'; - -System.register(['aurelia-polyfills', 'aurelia-pal'], function (_export, _context) { - "use strict"; - - var PLATFORM, isInitialized, _typeof, bootstrapPromises, startResolve, startPromise, host, isNodeLike, starting; - - function ready() { - if (!host.document || host.document.readyState === 'complete') { - return Promise.resolve(); - } - - return new Promise(function (resolve) { - host.document.addEventListener('DOMContentLoaded', completed); - host.addEventListener('load', completed); - - function completed() { - host.document.removeEventListener('DOMContentLoaded', completed); - host.removeEventListener('load', completed); - resolve(); - } - }); - } - - function createLoader() { - if (PLATFORM.Loader) { - return Promise.resolve(new PLATFORM.Loader()); - } - - if (typeof AURELIA_WEBPACK_2_0 === 'undefined') { - if (typeof __webpack_require__ !== 'undefined') { - var m = __webpack_require__(require.resolve('aurelia-loader-webpack')); - return Promise.resolve(new m.WebpackLoader()); - } - - if (host.System && typeof host.System.config === 'function') { - return host.System.normalize('aurelia-bootstrapper').then(function (bsn) { - return host.System.normalize('aurelia-loader-default', bsn); - }).then(function (loaderName) { - return host.System.import(loaderName).then(function (m) { - return new m.DefaultLoader(); - }); - }); - } - - if (typeof host.require === 'function' && typeof host.define === 'function' && _typeof(host.define.amd) === 'object') { - return new Promise(function (resolve, reject) { - return host.require(['aurelia-loader-default'], function (m) { - return resolve(new m.DefaultLoader()); - }, reject); - }); - } - - if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') { - var _m = module.require('aurelia-loader-nodejs'); - return Promise.resolve(new _m.NodeJsLoader()); - } - } - - return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.'); - } - - function initializePal(loader) { - if (isInitialized) return Promise.resolve(); - - var type = void 0; - - var isRenderer = isNodeLike && (process.type === 'renderer' || process.versions['node-webkit']); - - if (isNodeLike && !isRenderer) { - type = 'nodejs'; - } else if (typeof window !== 'undefined') { - type = 'browser'; - } else if (typeof self !== 'undefined') { - type = 'worker'; - } else { - throw new Error('Could not determine platform implementation to load.'); - } - - return loader.loadModule('aurelia-pal-' + type).then(function (palModule) { - return type === 'nodejs' && !isInitialized && palModule.globalize() || palModule.initialize(); - }); - } - - function preparePlatform(loader) { - var map = function map(moduleId, relativeTo) { - return loader.normalize(moduleId, relativeTo).then(function (normalized) { - loader.map(moduleId, normalized); - return normalized; - }); +System.register(['aurelia-polyfills', 'aurelia-pal'], (function (exports) { + 'use strict'; + var PLATFORM, isInitialized; + return { + setters: [function () {}, function (module) { + PLATFORM = module.PLATFORM; + isInitialized = module.isInitialized; + }], + execute: (function () { + + exports('bootstrap', bootstrap); + + var bootstrapPromises = []; + var startResolve; + var startPromise = new Promise(function (resolve) { return startResolve = resolve; }); + var host = PLATFORM.global; + var isNodeLike = typeof process !== 'undefined' && !process.browser; + function ready() { + if (!host.document || host.document.readyState === 'complete') { + return Promise.resolve(); + } + return new Promise(function (resolve) { + host.document.addEventListener('DOMContentLoaded', completed); + host.addEventListener('load', completed); + function completed() { + host.document.removeEventListener('DOMContentLoaded', completed); + host.removeEventListener('load', completed); + resolve(); + } + }); + } + function createLoader() { + if (PLATFORM.Loader) { + return Promise.resolve(new PLATFORM.Loader()); + } + if (typeof AURELIA_WEBPACK_2_0 === 'undefined') { + if (typeof __webpack_require__ !== 'undefined') { + var m = __webpack_require__(require.resolve('aurelia-loader-webpack')); + return Promise.resolve(new m.WebpackLoader()); + } + if (host.System && typeof host.System.config === 'function') { + return host.System.normalize('aurelia-bootstrapper').then(function (bsn) { + return host.System.normalize('aurelia-loader-default', bsn); + }).then(function (loaderName) { + return host.System.import(loaderName).then(function (m) { return new m.DefaultLoader(); }); + }); + } + if (typeof host.require === 'function' && typeof host.define === 'function' && typeof host.define.amd === 'object') { + return new Promise(function (resolve, reject) { return host.require(['aurelia-loader-default'], function (m) { return resolve(new m.DefaultLoader()); }, reject); }); + } + if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') { + var m = module.require('aurelia-loader-nodejs'); + return Promise.resolve(new m.NodeJsLoader()); + } + } + return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.'); + } + function initializePal(loader) { + if (isInitialized) + return Promise.resolve(); + var type; + var isRenderer = isNodeLike && (process.type === 'renderer' || process.versions['node-webkit']); + if (isNodeLike && !isRenderer) { + type = 'nodejs'; + } + else if (typeof window !== 'undefined') { + type = 'browser'; + } + else if (typeof self !== 'undefined') { + type = 'worker'; + } + else { + throw new Error('Could not determine platform implementation to load.'); + } + return loader.loadModule('aurelia-pal-' + type) + .then(function (palModule) { return type === 'nodejs' && !isInitialized && palModule.globalize() || palModule.initialize(); }); + } + function preparePlatform(loader) { + var map = function (moduleId, relativeTo) { + return loader.normalize(moduleId, relativeTo) + .then(function (normalized) { + loader.map(moduleId, normalized); + return normalized; + }); + }; + return initializePal(loader) + .then(function () { return loader.normalize('aurelia-bootstrapper'); }) + .then(function (bootstrapperName) { + var frameworkPromise = map(PLATFORM.moduleName('aurelia-framework', { exports: ['Aurelia'] }), bootstrapperName); + return Promise.all([ + frameworkPromise, + frameworkPromise.then(function (frameworkName) { return map('aurelia-dependency-injection', frameworkName); }), + map('aurelia-router', bootstrapperName), + map('aurelia-logging-console', bootstrapperName) + ]); + }) + .then(function (_a) { + var frameworkName = _a[0]; + return loader.loadModule(frameworkName); + }) + .then(function (fx) { return startResolve(function () { return new fx.Aurelia(loader); }); }); + } + function config(appHost, configModuleId, aurelia) { + aurelia.host = appHost; + aurelia.configModuleId = configModuleId || null; + if (configModuleId) { + return aurelia.loader + .loadModule(configModuleId) + .then(function (customConfig) { + if (!customConfig.configure) { + throw new Error("Cannot initialize module '".concat(configModuleId, "' without a configure function.")); + } + return customConfig.configure(aurelia); + }); + } + aurelia.use + .standardConfiguration() + .developmentLogging(); + return aurelia.start().then(function () { return aurelia.setRoot(); }); + } + function run() { + return ready() + .then(createLoader) + .then(preparePlatform) + .then(function () { + var appHosts = host.document.querySelectorAll('[aurelia-app],[data-aurelia-app]'); + for (var i = 0, ii = appHosts.length; i < ii; ++i) { + var appHost = appHosts[i]; + var mainModuleId = appHost.getAttribute('aurelia-app') || appHost.getAttribute('data-aurelia-app'); + bootstrap(config.bind(null, appHost, mainModuleId)); + } + var toConsole = console.error.bind(console); + var bootstraps = bootstrapPromises.map(function (p) { return p.catch(toConsole); }); + bootstrapPromises = null; + return Promise.all(bootstraps); + }); + } + function bootstrap(configure) { + var p = startPromise.then(function (factory) { return configure(factory()); }); + if (bootstrapPromises) + bootstrapPromises.push(p); + return p; + } + var starting = exports('starting', run()); + + }) }; - - return initializePal(loader).then(function () { - return loader.normalize('aurelia-bootstrapper'); - }).then(function (bootstrapperName) { - var frameworkPromise = map(PLATFORM.moduleName('aurelia-framework', { exports: ['Aurelia'] }), bootstrapperName); - - return Promise.all([frameworkPromise, frameworkPromise.then(function (frameworkName) { - return map('aurelia-dependency-injection', frameworkName); - }), map('aurelia-router', bootstrapperName), map('aurelia-logging-console', bootstrapperName)]); - }).then(function (_ref) { - var frameworkName = _ref[0]; - return loader.loadModule(frameworkName); - }).then(function (fx) { - return startResolve(function () { - return new fx.Aurelia(loader); - }); - }); - } - - function config(appHost, configModuleId, aurelia) { - aurelia.host = appHost; - aurelia.configModuleId = configModuleId || null; - - if (configModuleId) { - return aurelia.loader.loadModule(configModuleId).then(function (customConfig) { - if (!customConfig.configure) { - throw new Error('Cannot initialize module \'' + configModuleId + '\' without a configure function.'); - } - - return customConfig.configure(aurelia); - }); - } - - aurelia.use.standardConfiguration().developmentLogging(); - - return aurelia.start().then(function () { - return aurelia.setRoot(); - }); - } - - function run() { - return ready().then(createLoader).then(preparePlatform).then(function () { - var appHosts = host.document.querySelectorAll('[aurelia-app],[data-aurelia-app]'); - for (var i = 0, ii = appHosts.length; i < ii; ++i) { - var appHost = appHosts[i]; - var moduleId = appHost.getAttribute('aurelia-app') || appHost.getAttribute('data-aurelia-app'); - bootstrap(config.bind(null, appHost, moduleId)); - } - - var toConsole = console.error.bind(console); - var bootstraps = bootstrapPromises.map(function (p) { - return p.catch(toConsole); - }); - bootstrapPromises = null; - return Promise.all(bootstraps); - }); - } - - function bootstrap(configure) { - var p = startPromise.then(function (factory) { - return configure(factory()); - }); - if (bootstrapPromises) bootstrapPromises.push(p); - return p; - } - - _export('bootstrap', bootstrap); - - return { - setters: [function (_aureliaPolyfills) {}, function (_aureliaPal) { - PLATFORM = _aureliaPal.PLATFORM; - isInitialized = _aureliaPal.isInitialized; - }], - execute: function () { - _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; - } : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - bootstrapPromises = []; - startResolve = void 0; - startPromise = new Promise(function (resolve) { - return startResolve = resolve; - }); - host = PLATFORM.global; - isNodeLike = typeof process !== 'undefined' && !process.browser; - - _export('starting', starting = run()); - - _export('starting', starting); - } - }; -}); \ No newline at end of file +})); +//# sourceMappingURL=aurelia-bootstrapper.js.map diff --git a/dist/system/aurelia-bootstrapper.js.map b/dist/system/aurelia-bootstrapper.js.map new file mode 100644 index 0000000..ca240b7 --- /dev/null +++ b/dist/system/aurelia-bootstrapper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aurelia-bootstrapper.js","sources":["../../src/aurelia-bootstrapper.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;YAOA,IAAI,iBAAiB,GAAG,EAAE,CAAC;YAC3B,IAAI,YAA2E,CAAC;YAEhF,IAAM,YAAY,GAAG,IAAI,OAAO,CAAmB,UAAA,OAAO,EAAI,EAAA,OAAA,YAAY,GAAG,OAAO,CAAtB,EAAsB,CAAC,CAAC;YACtF,IAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC;YAC7B,IAAM,UAAU,GAAG,OAAO,OAAO,KAAK,WAAW,IAAI,CAAE,OAA0B,CAAC,OAAO,CAAC;YAE1F,SAAS,KAAK,GAAA;YACZ,IAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,KAAK,UAAU,EAAE;YAC7D,QAAA,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;YAC1B,KAAA;YAED,IAAA,OAAO,IAAI,OAAO,CAAO,UAAA,OAAO,EAAA;oBAC9B,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,SAAS,CAA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AY,CAAC,IAAI,CAAC,UAAA,OAAO,EAAA,EAAI,OAAA,SAAS,CAAC,OAAO,EAAE,CAAC,CAApB,EAAoB,CAAC,CAAC;YAC7D,IAAA,IAAI,iBAAiB;YAAE,QAAA,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACjD,IAAA,OAAO,CAAC,CAAC;YACX,CAAC;AAMY,gBAAA,QAAQ,uBAAG,GAAG;;;;;;;;"} \ No newline at end of file diff --git a/dist/types/aurelia-bootstrapper.d.ts b/dist/types/aurelia-bootstrapper.d.ts index e0e1a53..f1cdb1e 100644 --- a/dist/types/aurelia-bootstrapper.d.ts +++ b/dist/types/aurelia-bootstrapper.d.ts @@ -1,18 +1,18 @@ -import 'aurelia-polyfills'; -import { - PLATFORM, - isInitialized -} from 'aurelia-pal'; +// Generated by dts-bundle-generator v6.7.0 + +import { Aurelia } from 'aurelia-framework'; /** * Manually bootstraps an application. * @param configure A callback which passes an Aurelia instance to the developer to manually configure and start up the app. * @return A Promise that completes when configuration is done. */ +export declare function bootstrap(configure: (aurelia: Aurelia) => any): Promise; export declare function bootstrap(configure: Function): Promise; - /** * A promise that represents the bootstrapper's startup process. * It resolves when the process has finished starting. */ -export declare const starting: any; \ No newline at end of file +export declare const starting: Promise; + +export {}; diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 1509e97..b76a339 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,14 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [2.4.0](https://github.com/aurelia/bootstrapper/compare/2.3.3...2.4.0) (2022-04-19) + + +### Bug Fixes + +* **deps:** resolve vulnerable dep issue ([45dcea1](https://github.com/aurelia/bootstrapper/commit/45dcea16bfc9fad2f3056f93b3b1efb6a21046e0)) + ## [2.3.4](https://github.com/aurelia/bootstrapper/compare/2.3.2...2.3.4) (2019-03-27) diff --git a/doc/api.json b/doc/api.json index 0185d98..9e928f1 100644 --- a/doc/api.json +++ b/doc/api.json @@ -1 +1 @@ -{"name":"aurelia-bootstrapper","children":[{"id":5,"name":"starting","kind":32,"kindString":"Variable","flags":{"isExported":true},"comment":{"shortText":"A promise that represents the bootstrapper's startup process.\nIt resolves when the process has finished starting."},"sources":[{"fileName":"aurelia-bootstrapper.d.ts","line":18,"character":29}],"type":{"type":"instrinct","name":"any"}},{"id":2,"name":"bootstrap","kind":64,"kindString":"Function","flags":{"isExported":true},"signatures":[{"id":3,"name":"bootstrap","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Manually bootstraps an application.","returns":"A Promise that completes when configuration is done.\n"},"parameters":[{"id":4,"name":"configure","kind":32768,"kindString":"Parameter","flags":{},"comment":{"text":"A callback which passes an Aurelia instance to the developer to manually configure and start up the app."},"type":{"type":"reference","name":"Function"}}],"type":{"type":"reference","name":"Promise","typeArguments":[{"type":"instrinct","name":"void"}]}}],"sources":[{"fileName":"aurelia-bootstrapper.d.ts","line":12,"character":33}]}],"groups":[{"title":"Variables","kind":32,"children":[5]},{"title":"Functions","kind":64,"children":[2]}]} \ No newline at end of file +{"id":0,"name":"aurelia-bootstrapper","kind":1,"kindString":"Project","flags":{},"originalName":"","children":[{"id":9,"name":"starting","kind":32,"kindString":"Variable","flags":{"isConst":true},"comment":{"shortText":"A promise that represents the bootstrapper's startup process.\nIt resolves when the process has finished starting."},"sources":[{"fileName":"aurelia-bootstrapper.ts","line":196,"character":13}],"type":{"type":"reference","typeArguments":[{"type":"array","elementType":{"type":"intrinsic","name":"any"}}],"qualifiedName":"Promise","package":"typescript","name":"Promise"},"defaultValue":"..."},{"id":1,"name":"bootstrap","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"aurelia-bootstrapper.ts","line":184,"character":16}],"signatures":[{"id":2,"name":"bootstrap","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Manually bootstraps an application.","returns":"A Promise that completes when configuration is done.\n"},"parameters":[{"id":3,"name":"configure","kind":32768,"kindString":"Parameter","flags":{},"comment":{"shortText":"A callback which passes an Aurelia instance to the developer to manually configure and start up the app."},"type":{"type":"reflection","declaration":{"id":4,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"signatures":[{"id":5,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":6,"name":"aurelia","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","qualifiedName":"Aurelia","package":"aurelia-framework","name":"Aurelia"}}],"type":{"type":"intrinsic","name":"any"}}]}}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"qualifiedName":"Promise","package":"typescript","name":"Promise"}},{"id":7,"name":"bootstrap","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":8,"name":"configure","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","qualifiedName":"Function","package":"typescript","name":"Function"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"qualifiedName":"Promise","package":"typescript","name":"Promise"}}]}],"groups":[{"title":"Variables","kind":32,"children":[9]},{"title":"Functions","kind":64,"children":[1]}],"sources":[{"fileName":"aurelia-bootstrapper.ts","line":1,"character":0}]} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 2abfa7d..f388dc5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "aurelia-bootstrapper", - "version": "2.3.4", + "version": "2.4.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "aurelia-bootstrapper", - "version": "2.3.4", + "version": "2.4.0", "license": "MIT", "dependencies": { "aurelia-event-aggregator": "^1.0.0", diff --git a/package.json b/package.json index c18ce8c..c70937a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-bootstrapper", - "version": "2.3.4", + "version": "2.4.0", "description": "Sets up the default configuration for the aurelia framework and gets you up and running quick and easy.", "keywords": [ "aurelia",