diff --git a/bower.json b/bower.json index 406e206e..5c991b65 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-router", - "version": "1.0.0-rc.1.0.1", + "version": "1.0.0-rc.1.0.2", "description": "A powerful client-side router.", "keywords": [ "aurelia", diff --git a/dist/amd/aurelia-router.js b/dist/amd/aurelia-router.js index 7042538c..337d1f4f 100644 --- a/dist/amd/aurelia-router.js +++ b/dist/amd/aurelia-router.js @@ -915,7 +915,7 @@ define(['exports', 'aurelia-logging', 'aurelia-route-recognizer', 'aurelia-depen if ((navModel.order || navModel.order === 0) && this.navigation.indexOf(navModel) === -1) { if (!navModel.href && navModel.href !== '' && (state.types.dynamics || state.types.stars)) { - throw new Error('Invalid route config: dynamic routes must specify an href to be included in the navigation model.'); + throw new Error('Invalid route config for "' + config.route + '" : dynamic routes must specify an "href:" to be included in the navigation model.'); } if (typeof navModel.order !== 'number') { @@ -1079,11 +1079,12 @@ define(['exports', 'aurelia-logging', 'aurelia-route-recognizer', 'aurelia-depen } if (typeof config.route !== 'string') { - throw new Error('Invalid Route Config: You must specify a route pattern.'); + var _name2 = config.name || '(no name)'; + throw new Error('Invalid Route Config for "' + _name2 + '": You must specify a "route:" pattern.'); } if (!('redirect' in config || config.moduleId || config.navigationStrategy || config.viewPorts)) { - throw new Error('Invalid Route Config: You must specify a moduleId, redirect, navigationStrategy, or viewPorts.'); + throw new Error('Invalid Route Config for "' + config.route + '": You must specify a "moduleId:", "redirect:", "navigationStrategy:", or "viewPorts:".'); } } diff --git a/dist/aurelia-router.js b/dist/aurelia-router.js index b8f6650d..44788754 100644 --- a/dist/aurelia-router.js +++ b/dist/aurelia-router.js @@ -1236,7 +1236,7 @@ export class Router { if ((navModel.order || navModel.order === 0) && this.navigation.indexOf(navModel) === -1) { if ((!navModel.href && navModel.href !== '') && (state.types.dynamics || state.types.stars)) { - throw new Error('Invalid route config: dynamic routes must specify an href to be included in the navigation model.'); + throw new Error('Invalid route config for "' + config.route + '" : dynamic routes must specify an "href:" to be included in the navigation model.'); } if (typeof navModel.order !== 'number') { @@ -1407,11 +1407,12 @@ function validateRouteConfig(config: RouteConfig): void { } if (typeof config.route !== 'string') { - throw new Error('Invalid Route Config: You must specify a route pattern.'); + let name = config.name || '(no name)'; + throw new Error('Invalid Route Config for "' + name + '": You must specify a "route:" pattern.'); } if (!('redirect' in config || config.moduleId || config.navigationStrategy || config.viewPorts)) { - throw new Error('Invalid Route Config: You must specify a moduleId, redirect, navigationStrategy, or viewPorts.'); + throw new Error('Invalid Route Config for "' + config.route + '": You must specify a "moduleId:", "redirect:", "navigationStrategy:", or "viewPorts:".'); } } diff --git a/dist/commonjs/aurelia-router.js b/dist/commonjs/aurelia-router.js index a9dd99e0..a4c10f9b 100644 --- a/dist/commonjs/aurelia-router.js +++ b/dist/commonjs/aurelia-router.js @@ -870,7 +870,7 @@ var Router = exports.Router = function () { if ((navModel.order || navModel.order === 0) && this.navigation.indexOf(navModel) === -1) { if (!navModel.href && navModel.href !== '' && (state.types.dynamics || state.types.stars)) { - throw new Error('Invalid route config: dynamic routes must specify an href to be included in the navigation model.'); + throw new Error('Invalid route config for "' + config.route + '" : dynamic routes must specify an "href:" to be included in the navigation model.'); } if (typeof navModel.order !== 'number') { @@ -1034,11 +1034,12 @@ function validateRouteConfig(config) { } if (typeof config.route !== 'string') { - throw new Error('Invalid Route Config: You must specify a route pattern.'); + var _name2 = config.name || '(no name)'; + throw new Error('Invalid Route Config for "' + _name2 + '": You must specify a "route:" pattern.'); } if (!('redirect' in config || config.moduleId || config.navigationStrategy || config.viewPorts)) { - throw new Error('Invalid Route Config: You must specify a moduleId, redirect, navigationStrategy, or viewPorts.'); + throw new Error('Invalid Route Config for "' + config.route + '": You must specify a "moduleId:", "redirect:", "navigationStrategy:", or "viewPorts:".'); } } diff --git a/dist/es2015/aurelia-router.js b/dist/es2015/aurelia-router.js index a94965da..c55632ef 100644 --- a/dist/es2015/aurelia-router.js +++ b/dist/es2015/aurelia-router.js @@ -767,7 +767,7 @@ export let Router = class Router { if ((navModel.order || navModel.order === 0) && this.navigation.indexOf(navModel) === -1) { if (!navModel.href && navModel.href !== '' && (state.types.dynamics || state.types.stars)) { - throw new Error('Invalid route config: dynamic routes must specify an href to be included in the navigation model.'); + throw new Error('Invalid route config for "' + config.route + '" : dynamic routes must specify an "href:" to be included in the navigation model.'); } if (typeof navModel.order !== 'number') { @@ -911,11 +911,12 @@ function validateRouteConfig(config) { } if (typeof config.route !== 'string') { - throw new Error('Invalid Route Config: You must specify a route pattern.'); + let name = config.name || '(no name)'; + throw new Error('Invalid Route Config for "' + name + '": You must specify a "route:" pattern.'); } if (!('redirect' in config || config.moduleId || config.navigationStrategy || config.viewPorts)) { - throw new Error('Invalid Route Config: You must specify a moduleId, redirect, navigationStrategy, or viewPorts.'); + throw new Error('Invalid Route Config for "' + config.route + '": You must specify a "moduleId:", "redirect:", "navigationStrategy:", or "viewPorts:".'); } } diff --git a/dist/native-modules/aurelia-router.js b/dist/native-modules/aurelia-router.js index c796ae2f..671897c7 100644 --- a/dist/native-modules/aurelia-router.js +++ b/dist/native-modules/aurelia-router.js @@ -849,7 +849,7 @@ export var Router = function () { if ((navModel.order || navModel.order === 0) && this.navigation.indexOf(navModel) === -1) { if (!navModel.href && navModel.href !== '' && (state.types.dynamics || state.types.stars)) { - throw new Error('Invalid route config: dynamic routes must specify an href to be included in the navigation model.'); + throw new Error('Invalid route config for "' + config.route + '" : dynamic routes must specify an "href:" to be included in the navigation model.'); } if (typeof navModel.order !== 'number') { @@ -1013,11 +1013,12 @@ function validateRouteConfig(config) { } if (typeof config.route !== 'string') { - throw new Error('Invalid Route Config: You must specify a route pattern.'); + var _name2 = config.name || '(no name)'; + throw new Error('Invalid Route Config for "' + _name2 + '": You must specify a "route:" pattern.'); } if (!('redirect' in config || config.moduleId || config.navigationStrategy || config.viewPorts)) { - throw new Error('Invalid Route Config: You must specify a moduleId, redirect, navigationStrategy, or viewPorts.'); + throw new Error('Invalid Route Config for "' + config.route + '": You must specify a "moduleId:", "redirect:", "navigationStrategy:", or "viewPorts:".'); } } diff --git a/dist/system/aurelia-router.js b/dist/system/aurelia-router.js index f2ade761..2ed859db 100644 --- a/dist/system/aurelia-router.js +++ b/dist/system/aurelia-router.js @@ -107,11 +107,12 @@ System.register(['aurelia-logging', 'aurelia-route-recognizer', 'aurelia-depende } if (typeof config.route !== 'string') { - throw new Error('Invalid Route Config: You must specify a route pattern.'); + var _name2 = config.name || '(no name)'; + throw new Error('Invalid Route Config for "' + _name2 + '": You must specify a "route:" pattern.'); } if (!('redirect' in config || config.moduleId || config.navigationStrategy || config.viewPorts)) { - throw new Error('Invalid Route Config: You must specify a moduleId, redirect, navigationStrategy, or viewPorts.'); + throw new Error('Invalid Route Config for "' + config.route + '": You must specify a "moduleId:", "redirect:", "navigationStrategy:", or "viewPorts:".'); } } @@ -1320,7 +1321,7 @@ System.register(['aurelia-logging', 'aurelia-route-recognizer', 'aurelia-depende if ((navModel.order || navModel.order === 0) && this.navigation.indexOf(navModel) === -1) { if (!navModel.href && navModel.href !== '' && (state.types.dynamics || state.types.stars)) { - throw new Error('Invalid route config: dynamic routes must specify an href to be included in the navigation model.'); + throw new Error('Invalid route config for "' + config.route + '" : dynamic routes must specify an "href:" to be included in the navigation model.'); } if (typeof navModel.order !== 'number') { diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 1961f6ad..ce84f8f9 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,8 @@ + +# [1.0.0-rc.1.0.2](https://github.com/aurelia/router/compare/1.0.0-rc.1.0.1...v1.0.0-rc.1.0.2) (2016-07-24) + + + # [1.0.0-rc.1.0.1](https://github.com/aurelia/router/compare/1.0.0-rc.1.0.0...v1.0.0-rc.1.0.1) (2016-07-12) diff --git a/package.json b/package.json index dd363fa0..acaf4980 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-router", - "version": "1.0.0-rc.1.0.1", + "version": "1.0.0-rc.1.0.2", "description": "A powerful client-side router.", "keywords": [ "aurelia", diff --git a/src/router.js b/src/router.js index eef71ad7..18ed3ea9 100644 --- a/src/router.js +++ b/src/router.js @@ -442,7 +442,7 @@ function validateRouteConfig(config: RouteConfig): void { } if (typeof config.route !== 'string') { - var name = config.name || '(no name)'; + let name = config.name || '(no name)'; throw new Error('Invalid Route Config for "' + name + '": You must specify a "route:" pattern.'); }