Skip to content

Commit

Permalink
Merge pull request #132 from TechnologyAdvice/feature/babel6
Browse files Browse the repository at this point in the history
Upgrade to babel6
levithomason committed Dec 21, 2015
2 parents 649c049 + 6563238 commit 670ecbf
Showing 9 changed files with 45 additions and 29 deletions.
9 changes: 8 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{
"stage": 0
"presets": [
"es2015",
"react",
"stage-1"
],
"plugins": [
"add-module-exports"
]
}
2 changes: 1 addition & 1 deletion docs/app/Components/ComponentDoc/ComponentExample.js
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ export default class ComponentExample extends Component {

state = {showCode: false};
fileContents = require(`!raw!docs/app/Examples/${this.props.examplePath}`);
component = exampleContext(`./${this.props.examplePath}.js`);
component = exampleContext(`./${this.props.examplePath}.js`).default;
// 'elements/Button/Types/Button' => #Button-Types-Button
anchor = this.props.examplePath.split('/').slice(1).join('-');

2 changes: 1 addition & 1 deletion docs/app/Components/ComponentDoc/ComponentExamples.js
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ export default class ComponentExamples extends Component {
const examples = exampleContext.keys()
.filter(path => path.includes(`/${this.props.name}Examples.js`))
.map((path, i) => {
const Example = exampleContext(path);
const Example = exampleContext(path).default;
return <Example key={i} />;
});

5 changes: 0 additions & 5 deletions docs/app/index.html
Original file line number Diff line number Diff line change
@@ -12,11 +12,6 @@
<script src="//cdnjs.cloudflare.com/ajax/libs/Faker/3.0.1/faker.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.6/semantic.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bluebird/2.9.33/bluebird.min.js"></script>

<!-- build:development-->
<script src="/webpack-dev-server.js"></script>
<!-- endbuild -->

</head>
<body>
<div id="root"></div>
15 changes: 6 additions & 9 deletions karma.conf.js → karma.conf.babel.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
/* eslint-disable no-var */
require('babel-core/register');

var paths = require('./paths');
var statConfig = require('./webpack-stats');
var friendlyFormatter = require('eslint-friendly-formatter');
var exitPlugin = require('./webpack-exit-plugin');
var ENV = require('./ENV');
import paths from './paths';
import statConfig from './webpack-stats';
import friendlyFormatter from 'eslint-friendly-formatter';
import exitPlugin from './webpack-exit-plugin';
import ENV from './ENV';

/**
* This config is for running tests on the command line and will fail on errors.
* @param {{}} config Karma config object.
* @type {{}}
*/
module.exports = function(config) {
export default (config) => {
config.set({
browsers: ['PhantomJS'],
singleRun: !ENV.isDevelopment(),
26 changes: 17 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -12,7 +12,8 @@
"lint": "eslint . --format ./node_modules/eslint-friendly-formatter",
"lint-watch": "watch 'npm run lint' docs gulp src test",
"start": "gulp",
"test": "karma start karma.conf.js",
"karma": "babel-node $(npm bin)/karma start",
"test": "npm run karma -- karma.conf.babel.js",
"test-watch": "webpack-dev-server --config webpack.tests.babel.js"
},
"pre-commit": "lint",
@@ -31,12 +32,23 @@
"npm": "3.3.5"
},
"dependencies": {
"babel-core": "^5.8.25",
"babel-eslint": "^4.1.3",
"babel-loader": "^5.3.2",
"bluebird": "^2.10.2",
"chai": "^3.3.0",
"classnames": "^2.1.5",
"jquery": "^2.1.4",
"lodash": "^3.10.1",
"react": "^0.14.0",
"react-dom": "^0.14.0"
},
"devDependencies": {
"babel-cli": "^6.3.17",
"babel-core": "^6.3.2",
"babel-eslint": "^4.1.6",
"babel-loader": "^6.2.0",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"babel-preset-stage-1": "^6.1.18",
"chai": "^3.3.0",
"del": "^2.0.2",
"doctrine": "^0.7.0",
"eslint": "^1.5.1",
@@ -54,7 +66,6 @@
"gulp-util": "^3.0.6",
"highlight.js": "^8.9.1",
"imports-loader": "^0.6.4",
"jquery": "^2.1.4",
"json": "^9.0.3",
"json-loader": "^0.5.3",
"karma": "^0.13.13",
@@ -64,17 +75,14 @@
"karma-phantomjs-launcher": "^0.2.1",
"karma-sourcemap-loader": "^0.3.5",
"karma-webpack": "^1.7.0",
"lodash": "^3.10.1",
"mocha": "^2.3.3",
"mocha-loader": "^0.7.1",
"phantomjs": "^1.9.18",
"phantomjs-polyfill": "0.0.1",
"pre-commit": "^1.1.2",
"raw-loader": "^0.5.1",
"react": "^0.14.0",
"react-addons-test-utils": "^0.14.0",
"react-docgen": "^2.2.0",
"react-dom": "^0.14.0",
"react-highlight": "^0.5.1",
"react-hot-loader": "^1.3.0",
"require-dir": "^0.3.0",
8 changes: 7 additions & 1 deletion src/elements/Segment/Segments.js
Original file line number Diff line number Diff line change
@@ -11,7 +11,13 @@ export default class Segments extends Component {
/**
* Must be of type Segment, Segments, H1, H2, H3, H4, H5, H6, Subheader or Message.
*/
children: ofComponentTypes(['Segment', 'Segments', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'Subheader', 'Message']),
children: ofComponentTypes([
'Segment',
'Segments',
'H1', 'H2', 'H3', 'H4', 'H5', 'H6',
'Subheader',
'Message'
]),
className: PropTypes.string,
};

4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ import Item from 'src/views/Items/Item';
import Items from 'src/views/Items/Items';
import Statistic from 'src/views/Statistic/Statistic';

export default {
const stardust = {
// Addons
Confirm,
Textarea,
@@ -87,3 +87,5 @@ export default {
Items,
Statistic,
};

export default stardust;
3 changes: 2 additions & 1 deletion webpack.dev.babel.js
Original file line number Diff line number Diff line change
@@ -9,7 +9,8 @@ import webpack from 'webpack';
export default {
entry: {
app: [
'webpack/hot/only-dev-server',
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/dev-server',
paths.docsApp + '/DocsApp.js'
],
vendor: [

0 comments on commit 670ecbf

Please sign in to comment.