diff --git a/.babelrc b/.babelrc deleted file mode 100644 index f61ba128..00000000 --- a/.babelrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presets": ["es2015", "react"], - "plugins": [ - "transform-class-properties", - "transform-object-rest-spread" - ], - "env": { - "test": { - "plugins": ["istanbul"] - } - } -} diff --git a/.mocharc.js b/.mocharc.js index 40bc4ffe..54299d9f 100644 --- a/.mocharc.js +++ b/.mocharc.js @@ -1,6 +1,8 @@ +const path = require('path'); + module.exports = { recursive: true, reporter: 'spec', - require: 'babel-register', + require: path.join(__dirname, './testSetup'), timeout: 10000 -} \ No newline at end of file +}; diff --git a/.nycrc b/.nycrc index 8b7b5d84..cb16dcfe 100644 --- a/.nycrc +++ b/.nycrc @@ -1,5 +1,6 @@ { "reporter": "lcov", "sourceMap": false, - "instrument": false + "instrument": false, + "extends": "@istanbuljs/nyc-config-babel" } diff --git a/.travis.yml b/.travis.yml index 94c60f41..573ad4cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,5 +14,4 @@ before_script: npm run build script: npm test after_success: - "npm run cover" - - "npm run cover:collect" - - "cat artifacts/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js" + - "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js" diff --git a/babel.config.json b/babel.config.json new file mode 100644 index 00000000..81546835 --- /dev/null +++ b/babel.config.json @@ -0,0 +1,13 @@ +{ + "presets": ["@babel/preset-env", "@babel/preset-react"], + "plugins": [ + ["@babel/plugin-proposal-decorators", { "legacy": true }], + ["@babel/plugin-proposal-class-properties", { "loose" : true }], + "@babel/plugin-proposal-object-rest-spread" + ], + "env": { + "test": { + "plugins": ["istanbul"] + } + } +} diff --git a/package.json b/package.json index c3a15c0a..61e64124 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ }, "scripts": { "build": "lerna bootstrap --hoist --since --include-filtered-dependencies --no-ci", - "cover": "lerna run cover --since", - "cover:collect": "mkdir -p ./.nyc_output/ && for d in $(find packages -type d -name '.nyc_output' -maxdepth 2 -exec find '{}' -type f ';'); do (cp $d ./.nyc_output/); done; nyc report --reporter=lcov --report-dir=${COVERAGE_DIR:-artifacts/coverage}", + "clean": "lerna exec -- rm -rf node_modules dist", + "cover": "nyc lerna run cover --since", "dev:lint": "lerna run lint --since master --stream", "dev:test": "lerna run test --since master --stream", "lint": "eslint .", @@ -18,32 +18,32 @@ }, "dependencies": {}, "devDependencies": { + "@babel/cli": "^7.11.6", + "@babel/core": "^7.11.6", + "@babel/plugin-proposal-class-properties": "^7.10.4", + "@babel/plugin-proposal-decorators": "^7.10.5", + "@babel/plugin-proposal-object-rest-spread": "^7.11.0", + "@babel/preset-env": "^7.11.5", + "@babel/preset-react": "^7.10.4", + "@babel/register": "^7.11.5", + "@istanbuljs/nyc-config-babel": "^3.0.0", "async": "^3.0.1", - "babel": "^6.5.2", - "babel-cli": "^6.26.0", - "babel-core": "^6.6.4", - "babel-eslint": "^10.0.0", + "babel-eslint": "^10.1.0", "babel-plugin-istanbul": "^6.0.0", - "babel-plugin-syntax-decorators": "^6.5.0", - "babel-plugin-transform-class-properties": "^6.6.0", - "babel-plugin-transform-object-rest-spread": "^6.6.4", - "babel-preset-es2015": "^6.6.0", - "babel-preset-react": "^6.5.0", - "babel-register": "^6.24.1", "chai": "^4.0.2", - "coveralls": "^3.0.0", + "coveralls": "^3.1.0", "create-react-class": "^15.5.1", "es6-promise": "^4.0.2", "eslint": "^7.1.0", - "eslint-plugin-babel": "^5.0.0", + "eslint-plugin-babel": "^5.3.0", "eslint-plugin-react": "^7.0.0", "fluxible": "^1.0.0", "jsdom": "^16.2.1", "lerna": "^3.0.0", "lodash": "^4.17.5", - "mocha": "^8.0.1", + "mocha": "^8.1.3", "mockery": "^2.1.0", - "nyc": "^15.0.0", + "nyc": "^15.1.0", "pre-commit": "^1.0.7", "react": "^16.0.0", "react-dom": "^16.0.0", diff --git a/packages/fluxible-addons-react/tests/.babelrc b/packages/fluxible-addons-react/tests/.babelrc deleted file mode 100644 index afbe093c..00000000 --- a/packages/fluxible-addons-react/tests/.babelrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "presets": ["es2015", "react"], - "plugins": [ - "transform-class-properties", - "syntax-decorators" - ] -} diff --git a/packages/fluxible-addons-react/tests/unit/lib/connectToStores.js b/packages/fluxible-addons-react/tests/unit/lib/connectToStores.js index 05e117bf..d61c8184 100644 --- a/packages/fluxible-addons-react/tests/unit/lib/connectToStores.js +++ b/packages/fluxible-addons-react/tests/unit/lib/connectToStores.js @@ -91,62 +91,58 @@ describe('fluxible-addons-react', function () { done(); }); - // Decorators not supported with babel 6 - it.skip('should get the state from the stores using decorator pattern', function (done) { - //@connectToStores([FooStore, BarStore], (context) => { - // return { - // foo: context.getStore(FooStore).getFoo(), - // bar: context.getStore(BarStore).getBar() - // }; - //}) class Component extends React.Component { - // static contextTypes = { - // executeAction: PropTypes.func.isRequired - // }; - // - // onClick() { - // this.context.executeAction(function (actionContext) { - // actionContext.dispatch('DOUBLE_UP'); - // }); - // } - // - // render() { - // return ( - //