Skip to content
This repository has been archived by the owner on Sep 11, 2019. It is now read-only.

Shake the babel stuff up #69

Merged
merged 2 commits into from
Jul 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
{
"presets": ["es2015", "stage-2", "react"],
"presets": ["es2015-loose", "react"],
"plugins": [
"add-module-exports",
"dev-expression",
"transform-runtime"
"transform-class-properties",
"transform-export-extensions",
"transform-object-rest-spread",
["transform-runtime", {
"polyfill": false,
"regenerator": false
}]
],
"env": {
"production": {
"plugins": [
"add-module-exports",
"dev-expression",
"transform-export-extensions",
"transform-node-env-inline",
"transform-react-constant-elements",
"transform-react-remove-prop-types",
"transform-react-pure-class-to-function",
"transform-runtime"
"transform-react-pure-class-to-function"
]
}
}
Expand Down
18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
"unit": "mocha --compilers js:babel-register -r jsdom-global/register src/**/test.js",
"test": "npm run unit",
"pretest": "npm run lint",
"build": "NODE_ENV=production babel src --only index.js --out-dir components",
"build": "babel src --only index.js --out-dir components",
"build-prod": " NODE_ENV=production npm run build",
"prebuild": "./scripts/generate-main.sh",
"prepublish": "npm run clean && npm test && npm run build"
"prepublish": "npm run clean && npm test && npm run build-prod"
},
"repository": {
"type": "git",
Expand All @@ -31,6 +32,10 @@
"Aleksei Androsov <[email protected]> (https://github.com/doochik)"
],
"license": "MIT",
"peerDependencies": {
"react": "^15.0.0",
"react-dom": "^15.0.0"
},
"dependencies": {
"babel-runtime": "^6.6.1",
"warning": "^3.0.0"
Expand All @@ -41,15 +46,16 @@
"babel-core": "^6.3.26",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-transform-class-properties": "^6.10.2",
"babel-plugin-transform-export-extensions": "^6.8.0",
"babel-plugin-transform-node-env-inline": "^6.5.0",
"babel-plugin-transform-object-rest-spread": "^6.8.0",
"babel-plugin-transform-react-constant-elements": "^6.5.0",
"babel-plugin-transform-react-pure-class-to-function": "^1.0.1",
"babel-plugin-transform-react-remove-prop-types": "^0.2.7",
"babel-plugin-transform-runtime": "^6.7.5",
"babel-preset-es2015": "^6.6.0",
"babel-plugin-transform-runtime": "^6.9.0",
"babel-preset-es2015": "^6.9.0",
"babel-preset-es2015-loose": "^7.0.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-2": "^6.5.0",
"babel-register": "^6.7.2",
"babelify": "^7.3.0",
"browser-sync": "^2.12.5",
Expand Down
4 changes: 2 additions & 2 deletions src/Control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class Control extends Component {

componentDidMount() {
if (
!didWarnFocusChangedFocused &&
this.props.focused !== undefined &&
this.props.onFocusChange === undefined &&
!didWarnFocusChangedFocused
this.props.onFocusChange === undefined
) {
warning(
false,
Expand Down
4 changes: 1 addition & 3 deletions src/TextInput/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,8 @@ describe('TextInput', () => {
it('calls onChange on input change', () => {
const spy = sinon.spy();
const input = mount(<TextInput name="foo" onChange={spy}/>);
const control = input.find('input');

control.node.setAttribute('value', 'hello');
control.simulate('change');
input.find('input').simulate('change', { target: { value: 'hello' } });

expect(spy).to.have.been.called;
expect(spy.lastCall).to.have.been.calledWithMatch('hello', { name: 'foo' });
Expand Down