Skip to content

Commit a52848f

Browse files
committed
Update dependencies and tooling
1 parent c656d36 commit a52848f

10 files changed

+119
-121
lines changed

.travis.yml

+9
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,19 @@ language: node_js
44
node_js:
55
- stable
66

7+
env:
8+
- BROWSER=ChromeCi
9+
- BROWSER=Firefox
10+
711
cache:
812
directories:
913
- node_modules
1014

15+
before_install:
16+
- export CHROME_BIN=chromium-browser
17+
- export DISPLAY=:99.0
18+
- sh -e /etc/init.d/xvfb start
19+
1120
branches:
1221
only:
1322
- master

bower.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"main": "lib/ReactRouterBootstrap.js",
88
"bugs": <%= JSON.stringify(pkg.bugs) %>,
99
"keywords": [
10-
<%= _.map(pkg.keywords, function(keyword) { return '"' + keyword + '"' }).join(',')%>
10+
<%= pkg.keywords.map(keyword => `"${keyword}"`).join(',') %>
1111
],
1212
"dependencies": <%= JSON.stringify(pkg.peerDependencies) %>,
1313
"ignore": [

karma.conf.babel.js

-53
This file was deleted.

karma.conf.js

+52-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,52 @@
1-
require('babel-register');
2-
module.exports = require('./karma.conf.babel');
1+
const webpack = require('webpack');
2+
3+
module.exports = config => {
4+
const { env } = process;
5+
6+
const isCi = env.CONTINUOUS_INTEGRATION === 'true';
7+
8+
config.set({
9+
frameworks: ['mocha', 'sinon-chai'],
10+
11+
files: ['test/index.js'],
12+
13+
preprocessors: {
14+
'test/index.js': ['webpack', 'sourcemap'],
15+
},
16+
17+
webpack: {
18+
module: {
19+
loaders: [
20+
{ test: /\.js/, loader: 'babel', exclude: /node_modules/ },
21+
],
22+
},
23+
plugins: [
24+
new webpack.DefinePlugin({
25+
'process.env.NODE_ENV': JSON.stringify('test'),
26+
}),
27+
],
28+
devtool: 'cheap-module-inline-source-map',
29+
},
30+
31+
webpackMiddleware: {
32+
noInfo: true,
33+
},
34+
35+
reporters: ['mocha'],
36+
37+
mochaReporter: {
38+
output: 'autowatch',
39+
},
40+
41+
customLaunchers: {
42+
ChromeCi: {
43+
base: 'Chrome',
44+
flags: ['--no-sandbox'],
45+
},
46+
},
47+
48+
browsers: env.BROWSER ? env.BROWSER.split(',') : ['Chrome'],
49+
50+
singleRun: isCi,
51+
});
52+
};

package.json

+44-50
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
"name": "react-router-bootstrap",
33
"version": "0.23.1",
44
"description": "Integration between React Router and React-Bootstrap",
5+
"files": [
6+
"lib"
7+
],
58
"main": "./lib/index.js",
69
"scripts": {
7-
"prepublish": "npm run build",
8-
"build": "rimraf lib && babel src -d lib && webpack && webpack -p && npm run bower-prepare",
9-
"test": "npm run lint && karma start --single-run",
10-
"tdd": "karma start",
11-
"visual-test": "open http://localhost:8080/ && webpack-dev-server --config webpack.visual.config.babel.js",
12-
"lint": "eslint *.js src test",
1310
"bower-prepare": "babel-node scripts/bower-prepare.js",
14-
"release": "release"
11+
"build": "rimraf lib && babel src -d lib && webpack && webpack -p && npm run bower-prepare",
12+
"lint": "eslint scripts src test *.js",
13+
"release": "release",
14+
"test": "npm run lint && karma start",
15+
"visual-test": "open http://localhost:8080/ && webpack-dev-server --config webpack.visual.config.babel.js"
1516
},
1617
"repository": {
1718
"type": "git",
@@ -35,64 +36,57 @@
3536
"react": ">=0.14.0"
3637
},
3738
"devDependencies": {
38-
"babel-cli": "^6.5.2",
39-
"babel-core": "^6.7.7",
40-
"babel-eslint": "^6.0.4",
39+
"babel-cli": "^6.11.4",
40+
"babel-core": "^6.11.4",
41+
"babel-eslint": "^6.1.2",
4142
"babel-loader": "^6.2.4",
42-
"babel-plugin-add-module-exports": "^0.1.3",
43-
"babel-preset-es2015": "^6.6.0",
43+
"babel-plugin-add-module-exports": "^0.2.1",
44+
"babel-preset-es2015": "^6.9.0",
4445
"babel-preset-es2015-loose": "^7.0.0",
45-
"babel-preset-react": "^6.5.0",
46+
"babel-preset-react": "^6.11.1",
4647
"babel-preset-stage-1": "^6.5.0",
47-
"babel-register": "^6.7.2",
48-
"bootstrap": "^3.3.6",
48+
"babel-register": "^6.11.5",
49+
"bootstrap": "^3.3.7",
4950
"chai": "^3.5.0",
5051
"colors": "^1.1.2",
5152
"css-loader": "^0.23.1",
52-
"es5-shim": "^4.5.8",
53-
"eslint": "^2.8.0",
54-
"eslint-config-airbnb": "^8.0.0",
55-
"eslint-plugin-babel": "^3.2.0",
56-
"eslint-plugin-import": "^1.6.0",
57-
"eslint-plugin-jsx-a11y": "^1.0.3",
58-
"eslint-plugin-mocha": "^2.2.0",
59-
"eslint-plugin-react": "^5.0.1",
60-
"file-loader": "^0.8.5",
61-
"history": "^2.1.0",
62-
"html-webpack-plugin": "^2.16.0",
63-
"karma": "^0.13.22",
64-
"karma-cli": "^0.1.2",
65-
"karma-mocha": "^0.2.2",
66-
"karma-mocha-reporter": "^2.0.2",
67-
"karma-phantomjs-launcher": "^1.0.0",
68-
"karma-sinon-chai": "^1.2.0",
53+
"eslint": "^2.13.1",
54+
"eslint-config-airbnb": "^9.0.1",
55+
"eslint-plugin-babel": "^3.3.0",
56+
"eslint-plugin-import": "^1.11.1",
57+
"eslint-plugin-jsx-a11y": "^1.5.5",
58+
"eslint-plugin-mocha": "^4.1.0",
59+
"eslint-plugin-react": "^5.2.2",
60+
"file-loader": "^0.9.0",
61+
"history": "^2.1.2",
62+
"html-webpack-plugin": "^2.22.0",
63+
"karma": "^1.1.1",
64+
"karma-chrome-launcher": "^1.0.1",
65+
"karma-firefox-launcher": "^1.0.0",
66+
"karma-mocha": "^1.1.1",
67+
"karma-mocha-reporter": "^2.0.4",
68+
"karma-sinon-chai": "^1.2.3",
6969
"karma-sourcemap-loader": "^0.3.7",
7070
"karma-webpack": "^1.7.0",
71-
"less": "^2.6.1",
71+
"less": "^2.7.1",
7272
"less-loader": "^2.2.3",
73-
"lodash": "^4.11.1",
74-
"lolex": "^1.4.0",
75-
"mocha": "^2.4.5",
76-
"node-libs-browser": "^1.0.0",
77-
"phantomjs-prebuilt": "^2.1.7",
78-
"react": "^15.0.1",
79-
"react-bootstrap": "^0.29.2",
80-
"react-dom": "^15.0.1",
81-
"react-router": "^2.3.0",
73+
"lodash": "^4.14.0",
74+
"mocha": "^2.5.3",
75+
"react": "^15.2.1",
76+
"react-bootstrap": "^0.30.0",
77+
"react-dom": "^15.2.1",
78+
"react-router": "^2.6.0",
8279
"release-script": "^1.0.2",
83-
"rimraf": "^2.5.2",
84-
"shelljs": "^0.7.0",
85-
"sinon": "^1.17.3",
80+
"rimraf": "^2.5.4",
81+
"shelljs": "^0.7.2",
82+
"sinon": "^1.17.4",
8683
"sinon-chai": "^2.8.0",
8784
"style-loader": "^0.13.1",
8885
"url-loader": "^0.5.7",
89-
"webpack": "^1.13.0",
86+
"webpack": "^1.13.1",
9087
"webpack-dev-server": "^1.14.1",
91-
"yargs": "^4.6.0"
88+
"yargs": "^4.8.1"
9289
},
93-
"files": [
94-
"lib"
95-
],
9690
"release-script": {
9791
"bowerRepo": "git@github.com:react-bootstrap/react-router-bootstrap-bower.git"
9892
}

scripts/bower-prepare.js

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
/* eslint-disable no-console */
12
/* globals cat, config, cp, mkdir, rm, test */
2-
/* eslint curly: 0 */
3+
34
import 'colors';
45
import 'shelljs/global';
56
import path from 'path';
@@ -9,34 +10,26 @@ import yargs from 'yargs';
910
// do not die on errors
1011
config.fatal = false;
1112

12-
//------------------------------------------------------------------------------
13-
// constants
1413
const repoRoot = path.resolve(__dirname, '../');
1514
const libFolder = path.join(repoRoot, 'lib');
1615
const bowerRoot = path.join(repoRoot, 'amd');
1716
const bowerTemplate = path.join(repoRoot, 'bower.template.json');
1817
const license = path.join(repoRoot, 'LICENSE');
1918

20-
21-
//------------------------------------------------------------------------------
22-
// command line options
2319
const argv = yargs
2420
.usage('Usage: $0 [--verbose]')
2521
.example('$0', 'Prepare bower package for releasing')
2622
.option('verbose', {
2723
demand: false,
2824
default: false,
29-
describe: 'Increased debug output'
25+
describe: 'Increased debug output',
3026
})
3127
.argv;
3228

3329
if (argv.dryRun) console.log('DRY RUN'.magenta);
3430

3531
config.silent = !argv.verbose;
3632

37-
38-
//------------------------------------------------------------------------------
39-
// functions
4033
function bower() {
4134
console.log('Creating: '.cyan + 'bower package'.green);
4235

@@ -66,5 +59,4 @@ function bower() {
6659
console.log('Created: '.cyan + 'bower package'.green);
6760
}
6861

69-
//------------------------------------------------------------------------------
7062
bower();

test/LinkContainer.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ describe('LinkContainer', () => {
226226
router, 'target'
227227
);
228228
expect(target).to.be.empty;
229-
})
230-
;
229+
}
230+
);
231231

232232
it('should render with disabled class', () => {
233233
const component = ReactTestUtils.findRenderedComponentWithType(

test/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
import 'es5-shim';
2-
31
const testsContext = require.context('.', true, /\.spec\.js$/);
42
testsContext.keys().forEach(testsContext);

webpack.config.babel.js

+5
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,20 @@ export default {
88
entry: {
99
ReactRouterBootstrap: './src/index.js',
1010
},
11+
1112
output: {
1213
path: './lib',
1314
filename: optimizeMinimize ? '[name].min.js' : '[name].js',
1415
library: 'ReactRouterBootstrap',
1516
libraryTarget: 'umd',
1617
},
18+
1719
module: {
1820
loaders: [
1921
{ test: /\.js$/, loader: 'babel', exclude: /node_modules/ },
2022
],
2123
},
24+
2225
externals: [
2326
{
2427
react: {
@@ -37,10 +40,12 @@ export default {
3740
},
3841
},
3942
],
43+
4044
plugins: [
4145
new webpack.DefinePlugin({
4246
'process.env': { NODE_ENV: JSON.stringify(nodeEnv) },
4347
}),
4448
],
49+
4550
devtool: optimizeMinimize ? 'source-map' : null,
4651
};

webpack.visual.config.babel.js

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import HtmlWebpackPlugin from 'html-webpack-plugin';
22

33
export default {
44
entry: './test/visual',
5+
56
module: {
67
loaders: [
78
{ test: /\.js/, loader: 'babel', exclude: /node_modules/ },
@@ -10,8 +11,10 @@ export default {
1011
{ test: /\.eot$|\.ttf$|\.svg$/, loader: 'file?prefix=font/' },
1112
],
1213
},
14+
1315
plugins: [
1416
new HtmlWebpackPlugin(),
1517
],
18+
1619
devtool: 'eval-source-map',
1720
};

0 commit comments

Comments
 (0)