Skip to content

Commit

Permalink
Updated dependencies to fix babel-eslint 'estraverse-fb' dep issue (#59)
Browse files Browse the repository at this point in the history
* Updated dependencies to fix babel-eslint 'estraverse-fb' dep issue

* added .babelrc file

* added babel-register dep

* corrected babel preset reference
  • Loading branch information
hally9k authored Jul 20, 2016
1 parent e3ec14e commit 26354a4
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 53 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
3 changes: 1 addition & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,10 @@
"before": false,
"after": true
}],
"space-after-keywords": 2, // http://eslint.org/docs/rules/space-after-keywords
"keyword-spacing": 2, // http://eslint.org/docs/rules/space-after-keywords
"space-before-blocks": 2, // http://eslint.org/docs/rules/space-before-blocks
"space-before-function-paren": [2, "never"], // http://eslint.org/docs/rules/space-before-function-paren
"space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops
"space-return-throw-case": 2, // http://eslint.org/docs/rules/space-return-throw-case
"spaced-comment": 2 // http://eslint.org/docs/rules/spaced-comment
}
}
24 changes: 12 additions & 12 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"babel-core": "5.6.15",
"babel-loader": "5.1.4",
"babel-loader": "6.2.4",
"babel-core": "6.5.2",
"redux-batched-updates": "0.1.0",
"webpack": "1.9.11",
"webpack-dev-server": "1.9.0"
"webpack": "1.13.1",
"webpack-dev-server": "1.14.1"
},
"license": "MIT",
"dependencies": {
"angular": "^1.4.6",
"angular-ui-router": "^0.2.15",
"ng-redux": "^3.0.0",
"redux": "^3.0.0",
"redux-logger": "1.0.4",
"redux-thunk": "0.1.0"
"angular": "^1.5.1",
"angular-ui-router": "0.3.1",
"ng-redux": "^3.3.3",
"redux": "^3.5.2",
"redux-logger": "2.6.1",
"redux-thunk": "2.1.0"
},
"engines" : {
"node" : "4.2.1",
"npm" : "2.14.7"
"node" : "6.3.0",
"npm" : "3.10.3"
}
}
39 changes: 20 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"scripts": {
"lint": "node node_modules/.bin/eslint src",
"clean": "rm -rf lib",
"test": "npm run lint; NODE_ENV=test node node_modules/.bin/mocha --compilers js:babel/register --recursive --require src/__tests__/index.js src/**/*.test.js",
"test:live": "npm run lint; NODE_ENV=test node node_modules/.bin/mocha --compilers js:babel/register --recursive --require src/__tests__/index.js -w src/**/*.test.js",
"test": "npm run lint; NODE_ENV=test node node_modules/.bin/mocha --compilers js:babel-register --recursive --require src/__tests__/index.js src/**/*.test.js",
"test:live": "npm run lint; NODE_ENV=test node node_modules/.bin/mocha --compilers js:babel-register --recursive --require src/__tests__/index.js -w src/**/*.test.js",
"build": "npm run clean; npm run test; node node_modules/.bin/babel src --out-dir lib"
},
"repository": {
Expand All @@ -17,30 +17,31 @@
"author": "Neil Fenton (neilff)",
"license": "ISC",
"dependencies": {
"redux": "^3.0.0"
"redux": "^3.5.2"
},
"devDependencies": {
"babel": "5.8.21",
"babel-loader": "5.1.4",
"babel-core": "5.6.15",
"babel-eslint": "5.0.0",
"chai": "3.0.0",
"eslint": "0.24.0",
"mocha": "2.2.5",
"ng-redux": "3.0.0",
"node-libs-browser": "0.5.2",
"sinon": "1.16.1",
"sinon-as-promised": "4.0.0",
"angular": "^1.4.x < 2.0.0",
"angular-ui-router": "^0.3.0"
"angular-ui-router": "0.3.1",
"babel": "6.5.2",
"babel-core": "6.5.2",
"babel-eslint": "6.1.2",
"babel-loader": "6.2.4",
"babel-preset-es2015": "^6.9.0",
"babel-register": "^6.9.0",
"chai": "^3.5.0",
"eslint": "3.1.1",
"mocha": "2.5.3",
"ng-redux": "^3.3.3",
"node-libs-browser": "^1.0.0",
"sinon": "1.17.4",
"sinon-as-promised": "^3.0.1"
},
"peerDependencies": {
"angular": "^1.4.x < 2.0.0",
"angular-ui-router": "^0.3.0"
},
"engines" : {
"node" : "4.2.1",
"npm" : "2.14.7"
"engines": {
"node": "6.3.0",
"npm": "3.10.3"
}

}
40 changes: 20 additions & 20 deletions src/router-middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@ import {
STATE_GO,
STATE_RELOAD,
STATE_TRANSITION_TO,
STATE_CHANGE_SUCCESS
STATE_CHANGE_SUCCESS,
} from './action-types';

export default function routerMiddleware($state) {
return ({ getState }) => next => action => {
const { payload } = action;

switch (action.type) {
case STATE_GO:
return $state.go(payload.to, payload.params, payload.options)
case STATE_GO:
return $state.go(payload.to, payload.params, payload.options)
.then(next(action));

case STATE_RELOAD:
return $state.reload(payload)
case STATE_RELOAD:
return $state.reload(payload)
.then(next(action));

case STATE_TRANSITION_TO:
return $state.transitionTo(payload.to, payload.params, payload.options)
.then(next(action));
case STATE_TRANSITION_TO:
return $state.transitionTo(payload.to, payload.params, payload.options)
.then(next(action));

case STATE_CHANGE_SUCCESS:
return next({
type: STATE_CHANGE_SUCCESS,
payload: {
currentState: $state.current,
currentParams: $state.params,
prevState: getState().router.currentState,
prevParams: getState().router.currentParams,
},
});
case STATE_CHANGE_SUCCESS:
return next({
type: STATE_CHANGE_SUCCESS,
payload: {
currentState: $state.current,
currentParams: $state.params,
prevState: getState().router.currentState,
prevParams: getState().router.currentParams,
},
});

default:
return next(action);
default:
return next(action);
}
};
}
Expand Down

0 comments on commit 26354a4

Please sign in to comment.