Skip to content

Commit

Permalink
Update dependencies and tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
taion committed Jul 25, 2016
1 parent c656d36 commit a52848f
Show file tree
Hide file tree
Showing 10 changed files with 119 additions and 121 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ language: node_js
node_js:
- stable

env:
- BROWSER=ChromeCi
- BROWSER=Firefox

cache:
directories:
- node_modules

before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

branches:
only:
- master
2 changes: 1 addition & 1 deletion bower.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"main": "lib/ReactRouterBootstrap.js",
"bugs": <%= JSON.stringify(pkg.bugs) %>,
"keywords": [
<%= _.map(pkg.keywords, function(keyword) { return '"' + keyword + '"' }).join(',')%>
<%= pkg.keywords.map(keyword => `"${keyword}"`).join(',') %>
],
"dependencies": <%= JSON.stringify(pkg.peerDependencies) %>,
"ignore": [
Expand Down
53 changes: 0 additions & 53 deletions karma.conf.babel.js

This file was deleted.

54 changes: 52 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,52 @@
require('babel-register');
module.exports = require('./karma.conf.babel');
const webpack = require('webpack');

module.exports = config => {
const { env } = process;

const isCi = env.CONTINUOUS_INTEGRATION === 'true';

config.set({
frameworks: ['mocha', 'sinon-chai'],

files: ['test/index.js'],

preprocessors: {
'test/index.js': ['webpack', 'sourcemap'],
},

webpack: {
module: {
loaders: [
{ test: /\.js/, loader: 'babel', exclude: /node_modules/ },
],
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('test'),
}),
],
devtool: 'cheap-module-inline-source-map',
},

webpackMiddleware: {
noInfo: true,
},

reporters: ['mocha'],

mochaReporter: {
output: 'autowatch',
},

customLaunchers: {
ChromeCi: {
base: 'Chrome',
flags: ['--no-sandbox'],
},
},

browsers: env.BROWSER ? env.BROWSER.split(',') : ['Chrome'],

singleRun: isCi,
});
};
94 changes: 44 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
"name": "react-router-bootstrap",
"version": "0.23.1",
"description": "Integration between React Router and React-Bootstrap",
"files": [
"lib"
],
"main": "./lib/index.js",
"scripts": {
"prepublish": "npm run build",
"build": "rimraf lib && babel src -d lib && webpack && webpack -p && npm run bower-prepare",
"test": "npm run lint && karma start --single-run",
"tdd": "karma start",
"visual-test": "open http://localhost:8080/ && webpack-dev-server --config webpack.visual.config.babel.js",
"lint": "eslint *.js src test",
"bower-prepare": "babel-node scripts/bower-prepare.js",
"release": "release"
"build": "rimraf lib && babel src -d lib && webpack && webpack -p && npm run bower-prepare",
"lint": "eslint scripts src test *.js",
"release": "release",
"test": "npm run lint && karma start",
"visual-test": "open http://localhost:8080/ && webpack-dev-server --config webpack.visual.config.babel.js"
},
"repository": {
"type": "git",
Expand All @@ -35,64 +36,57 @@
"react": ">=0.14.0"
},
"devDependencies": {
"babel-cli": "^6.5.2",
"babel-core": "^6.7.7",
"babel-eslint": "^6.0.4",
"babel-cli": "^6.11.4",
"babel-core": "^6.11.4",
"babel-eslint": "^6.1.2",
"babel-loader": "^6.2.4",
"babel-plugin-add-module-exports": "^0.1.3",
"babel-preset-es2015": "^6.6.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-preset-es2015": "^6.9.0",
"babel-preset-es2015-loose": "^7.0.0",
"babel-preset-react": "^6.5.0",
"babel-preset-react": "^6.11.1",
"babel-preset-stage-1": "^6.5.0",
"babel-register": "^6.7.2",
"bootstrap": "^3.3.6",
"babel-register": "^6.11.5",
"bootstrap": "^3.3.7",
"chai": "^3.5.0",
"colors": "^1.1.2",
"css-loader": "^0.23.1",
"es5-shim": "^4.5.8",
"eslint": "^2.8.0",
"eslint-config-airbnb": "^8.0.0",
"eslint-plugin-babel": "^3.2.0",
"eslint-plugin-import": "^1.6.0",
"eslint-plugin-jsx-a11y": "^1.0.3",
"eslint-plugin-mocha": "^2.2.0",
"eslint-plugin-react": "^5.0.1",
"file-loader": "^0.8.5",
"history": "^2.1.0",
"html-webpack-plugin": "^2.16.0",
"karma": "^0.13.22",
"karma-cli": "^0.1.2",
"karma-mocha": "^0.2.2",
"karma-mocha-reporter": "^2.0.2",
"karma-phantomjs-launcher": "^1.0.0",
"karma-sinon-chai": "^1.2.0",
"eslint": "^2.13.1",
"eslint-config-airbnb": "^9.0.1",
"eslint-plugin-babel": "^3.3.0",
"eslint-plugin-import": "^1.11.1",
"eslint-plugin-jsx-a11y": "^1.5.5",
"eslint-plugin-mocha": "^4.1.0",
"eslint-plugin-react": "^5.2.2",
"file-loader": "^0.9.0",
"history": "^2.1.2",
"html-webpack-plugin": "^2.22.0",
"karma": "^1.1.1",
"karma-chrome-launcher": "^1.0.1",
"karma-firefox-launcher": "^1.0.0",
"karma-mocha": "^1.1.1",
"karma-mocha-reporter": "^2.0.4",
"karma-sinon-chai": "^1.2.3",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.7.0",
"less": "^2.6.1",
"less": "^2.7.1",
"less-loader": "^2.2.3",
"lodash": "^4.11.1",
"lolex": "^1.4.0",
"mocha": "^2.4.5",
"node-libs-browser": "^1.0.0",
"phantomjs-prebuilt": "^2.1.7",
"react": "^15.0.1",
"react-bootstrap": "^0.29.2",
"react-dom": "^15.0.1",
"react-router": "^2.3.0",
"lodash": "^4.14.0",
"mocha": "^2.5.3",
"react": "^15.2.1",
"react-bootstrap": "^0.30.0",
"react-dom": "^15.2.1",
"react-router": "^2.6.0",
"release-script": "^1.0.2",
"rimraf": "^2.5.2",
"shelljs": "^0.7.0",
"sinon": "^1.17.3",
"rimraf": "^2.5.4",
"shelljs": "^0.7.2",
"sinon": "^1.17.4",
"sinon-chai": "^2.8.0",
"style-loader": "^0.13.1",
"url-loader": "^0.5.7",
"webpack": "^1.13.0",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1",
"yargs": "^4.6.0"
"yargs": "^4.8.1"
},
"files": [
"lib"
],
"release-script": {
"bowerRepo": "git@github.com:react-bootstrap/react-router-bootstrap-bower.git"
}
Expand Down
14 changes: 3 additions & 11 deletions scripts/bower-prepare.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-console */
/* globals cat, config, cp, mkdir, rm, test */
/* eslint curly: 0 */

import 'colors';
import 'shelljs/global';
import path from 'path';
Expand All @@ -9,34 +10,26 @@ import yargs from 'yargs';
// do not die on errors
config.fatal = false;

//------------------------------------------------------------------------------
// constants
const repoRoot = path.resolve(__dirname, '../');
const libFolder = path.join(repoRoot, 'lib');
const bowerRoot = path.join(repoRoot, 'amd');
const bowerTemplate = path.join(repoRoot, 'bower.template.json');
const license = path.join(repoRoot, 'LICENSE');


//------------------------------------------------------------------------------
// command line options
const argv = yargs
.usage('Usage: $0 [--verbose]')
.example('$0', 'Prepare bower package for releasing')
.option('verbose', {
demand: false,
default: false,
describe: 'Increased debug output'
describe: 'Increased debug output',
})
.argv;

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

config.silent = !argv.verbose;


//------------------------------------------------------------------------------
// functions
function bower() {
console.log('Creating: '.cyan + 'bower package'.green);

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

//------------------------------------------------------------------------------
bower();
4 changes: 2 additions & 2 deletions test/LinkContainer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ describe('LinkContainer', () => {
router, 'target'
);
expect(target).to.be.empty;
})
;
}
);

it('should render with disabled class', () => {
const component = ReactTestUtils.findRenderedComponentWithType(
Expand Down
2 changes: 0 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
import 'es5-shim';

const testsContext = require.context('.', true, /\.spec\.js$/);
testsContext.keys().forEach(testsContext);
5 changes: 5 additions & 0 deletions webpack.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ export default {
entry: {
ReactRouterBootstrap: './src/index.js',
},

output: {
path: './lib',
filename: optimizeMinimize ? '[name].min.js' : '[name].js',
library: 'ReactRouterBootstrap',
libraryTarget: 'umd',
},

module: {
loaders: [
{ test: /\.js$/, loader: 'babel', exclude: /node_modules/ },
],
},

externals: [
{
react: {
Expand All @@ -37,10 +40,12 @@ export default {
},
},
],

plugins: [
new webpack.DefinePlugin({
'process.env': { NODE_ENV: JSON.stringify(nodeEnv) },
}),
],

devtool: optimizeMinimize ? 'source-map' : null,
};
3 changes: 3 additions & 0 deletions webpack.visual.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import HtmlWebpackPlugin from 'html-webpack-plugin';

export default {
entry: './test/visual',

module: {
loaders: [
{ test: /\.js/, loader: 'babel', exclude: /node_modules/ },
Expand All @@ -10,8 +11,10 @@ export default {
{ test: /\.eot$|\.ttf$|\.svg$/, loader: 'file?prefix=font/' },
],
},

plugins: [
new HtmlWebpackPlugin(),
],

devtool: 'eval-source-map',
};

0 comments on commit a52848f

Please sign in to comment.