diff --git a/bower.json b/bower.json index 80da898..0d269fc 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-bootstrapper", - "version": "1.0.0", + "version": "1.0.1", "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 e2c1adf..295a667 100644 --- a/dist/amd/aurelia-bootstrapper.js +++ b/dist/amd/aurelia-bootstrapper.js @@ -102,7 +102,11 @@ define(['exports', 'aurelia-pal', 'aurelia-pal-browser', 'aurelia-polyfills'], f if (configModuleId) { return loader.loadModule(configModuleId).then(function (customConfig) { - return customConfig.configure(aurelia); + if (!customConfig.configure) { + throw new Error("Cannot initialize module '" + configModuleId + "' without a configure function."); + } + + customConfig.configure(aurelia); }); } diff --git a/dist/aurelia-bootstrapper.js b/dist/aurelia-bootstrapper.js index 6419f10..f763fc4 100644 --- a/dist/aurelia-bootstrapper.js +++ b/dist/aurelia-bootstrapper.js @@ -89,7 +89,13 @@ function config(loader, appHost, configModuleId) { aurelia.configModuleId = configModuleId || null; if (configModuleId) { - return loader.loadModule(configModuleId).then(customConfig => customConfig.configure(aurelia)); + return loader.loadModule(configModuleId).then(customConfig => { + if (!customConfig.configure) { + throw new Error("Cannot initialize module '" + configModuleId + "' without a configure function."); + } + + customConfig.configure(aurelia); + }); } aurelia.use diff --git a/dist/commonjs/aurelia-bootstrapper.js b/dist/commonjs/aurelia-bootstrapper.js index 5ab4589..0b23812 100644 --- a/dist/commonjs/aurelia-bootstrapper.js +++ b/dist/commonjs/aurelia-bootstrapper.js @@ -106,7 +106,11 @@ function config(loader, appHost, configModuleId) { if (configModuleId) { return loader.loadModule(configModuleId).then(function (customConfig) { - return customConfig.configure(aurelia); + if (!customConfig.configure) { + throw new Error("Cannot initialize module '" + configModuleId + "' without a configure function."); + } + + customConfig.configure(aurelia); }); } diff --git a/dist/es2015/aurelia-bootstrapper.js b/dist/es2015/aurelia-bootstrapper.js index 778202e..c674b2a 100644 --- a/dist/es2015/aurelia-bootstrapper.js +++ b/dist/es2015/aurelia-bootstrapper.js @@ -82,7 +82,13 @@ function config(loader, appHost, configModuleId) { aurelia.configModuleId = configModuleId || null; if (configModuleId) { - return loader.loadModule(configModuleId).then(customConfig => customConfig.configure(aurelia)); + return loader.loadModule(configModuleId).then(customConfig => { + if (!customConfig.configure) { + throw new Error("Cannot initialize module '" + configModuleId + "' without a configure function."); + } + + customConfig.configure(aurelia); + }); } aurelia.use.standardConfiguration().developmentLogging(); diff --git a/dist/native-modules/aurelia-bootstrapper.js b/dist/native-modules/aurelia-bootstrapper.js index 42a94e6..fcd5354 100644 --- a/dist/native-modules/aurelia-bootstrapper.js +++ b/dist/native-modules/aurelia-bootstrapper.js @@ -97,7 +97,11 @@ function config(loader, appHost, configModuleId) { if (configModuleId) { return loader.loadModule(configModuleId).then(function (customConfig) { - return customConfig.configure(aurelia); + if (!customConfig.configure) { + throw new Error("Cannot initialize module '" + configModuleId + "' without a configure function."); + } + + customConfig.configure(aurelia); }); } diff --git a/dist/system/aurelia-bootstrapper.js b/dist/system/aurelia-bootstrapper.js index 364d8ea..9fe6587 100644 --- a/dist/system/aurelia-bootstrapper.js +++ b/dist/system/aurelia-bootstrapper.js @@ -97,7 +97,11 @@ System.register(['aurelia-polyfills', 'aurelia-pal', 'aurelia-pal-browser'], fun if (configModuleId) { return loader.loadModule(configModuleId).then(function (customConfig) { - return customConfig.configure(aurelia); + if (!customConfig.configure) { + throw new Error("Cannot initialize module '" + configModuleId + "' without a configure function."); + } + + customConfig.configure(aurelia); }); } diff --git a/dist/system/index.js b/dist/system/index.js index 871d02c..274fd92 100644 --- a/dist/system/index.js +++ b/dist/system/index.js @@ -8,7 +8,7 @@ System.register(['./aurelia-bootstrapper'], function (_export, _context) { var _exportObj = {}; for (var _key in _aureliaBootstrapper) { - if (_key !== "default" && key !== "__esModule") _exportObj[_key] = _aureliaBootstrapper[_key]; + if (_key !== "default" && _key !== "__esModule") _exportObj[_key] = _aureliaBootstrapper[_key]; } _export(_exportObj); diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 037f35f..175d5b7 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,9 @@ +# [1.0.1] + +### Bug Fixes + +* **bootstrapper:** Check module function configure before execute it + # [1.0.0](https://github.com/aurelia/bootstrapper/compare/1.0.0-rc.1.0.1...v1.0.0) (2016-07-27) diff --git a/doc/api.json b/doc/api.json index 11fa39f..fed48bc 100644 --- a/doc/api.json +++ b/doc/api.json @@ -1 +1 @@ -{"name":"aurelia-bootstrapper","children":[{"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"}]}}]}],"groups":[{"title":"Functions","kind":64,"children":[2]}]} \ No newline at end of file +{"name":"aurelia-bootstrapper","children":[{"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":14,"character":33}]}],"groups":[{"title":"Functions","kind":64,"children":[2]}]} \ No newline at end of file diff --git a/package.json b/package.json index 8b347a0..f1e4593 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-bootstrapper", - "version": "1.0.0", + "version": "1.0.1", "description": "Sets up the default configuration for the aurelia framework and gets you up and running quick and easy.", "keywords": [ "aurelia",