Skip to content

Commit

Permalink
feat: support only cerebral@^0.35.0-0
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
Dropped support for previous cerebral versions
  • Loading branch information
Guria committed Jul 13, 2016
1 parent 3896a9c commit 2b15114
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
12 changes: 5 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,16 @@ function Router (routesConfig, options) {
controller.on('modulesLoaded', onModulesLoaded)
}

if (controller.addContextProvider) {
var context = {}
context[MODULE] = {
path: module.path
}
controller.addContextProvider(context)
var context = {}
context[MODULE] = {
path: module.path
}
controller.addContextProvider(context)
}
}

var getRouterServices = function (context) {
var modulePath = context[MODULE] ? context[MODULE].path : context.modules[MODULE].path
var modulePath = context[MODULE].path
return modulePath.reduce(function (services, key) {
return services[key]
}, context.services)
Expand Down
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"main": "index.js",
"scripts": {
"pretest": "standard",
"test": "nodeunit tests && npm i cerebral@^0.34.0 && nodeunit tests",
"posttest": "npm i",
"test": "nodeunit tests",
"coverage": "nyc --reporter=lcov --reporter=text npm run test",
"postcoverage": "cat ./coverage/lcov.info | coveralls",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
Expand Down Expand Up @@ -50,8 +49,7 @@
"url-mapper": "^1.1.0"
},
"devDependencies": {
"cerebral": "^0.33.31",
"cerebral-model-baobab": "^0.4.8",
"cerebral": "^0.35.0-0",
"commitizen": "^2.7.6",
"conventional-changelog": "0.0.17",
"coveralls": "^2.11.9",
Expand All @@ -60,11 +58,11 @@
"nodeunit": "^0.9.1",
"nyc": "^6.4.0",
"semantic-release": "^4.3.5",
"standard": "^6.0.8",
"standard": "^7.1.2",
"validate-commit-msg": "^2.5.0"
},
"peerDependencies": {
"cerebral": "^0.33.31 || ^0.34.0"
"cerebral": "^0.35.0-0"
},
"nyc": {
"exclude": [
Expand Down
4 changes: 2 additions & 2 deletions tests/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ global.addEventListener = function () {}
global.document = {}

// SETUP
var Controller = require('cerebral')
var Model = require('cerebral-model-baobab')
var Controller = require('cerebral').Controller
var Model = require('cerebral/models/immutable')
var addressbar = require('addressbar')
var Router = require('./../index.js')
var redirect = Router.redirect
Expand Down
4 changes: 2 additions & 2 deletions tests/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ delete global.history
delete global.addEventListener

// SETUP
var Controller = require('cerebral')
var Model = require('cerebral-model-baobab')
var Controller = require('cerebral').Controller
var Model = require('cerebral/models/immutable')
var Router = require('./../index.js')

module.exports['should work in node.js'] = function (test) {
Expand Down

0 comments on commit 2b15114

Please sign in to comment.