Skip to content

Commit

Permalink
build: upgrade to babel 7 and upgrade other dev deps
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Jan 29, 2019
1 parent c046ae4 commit 304a6b1
Show file tree
Hide file tree
Showing 15 changed files with 5,858 additions and 3,486 deletions.
59 changes: 0 additions & 59 deletions .babelrc

This file was deleted.

28 changes: 28 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = function(api) {
const plugins = [
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-class-properties',
]
const presets = [
[
'@babel/preset-env',
api.env('es5')
? { forceAllTransforms: true }
: { targets: { node: 'current' } },
],
'@babel/preset-react',
'@babel/preset-flow',
]

if (api.env(['test', 'coverage', 'es5'])) {
plugins.push('@babel/plugin-transform-runtime')
}
if (api.env('coverage')) {
plugins.push('babel-plugin-istanbul')
}

return { plugins, presets }
}
8 changes: 7 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"extends": [
"@jedwards1211/eslint-config-react", "@jedwards1211/eslint-config-flow"
"@jedwards1211/eslint-config-react",
"@jedwards1211/eslint-config-flow",
"eslint-config-prettier"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"env": {
"es6": true,
"shared-node-browser": true
Expand Down
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PROJECT_ROOT>/lib/.*
<PROJECT_ROOT>/node_modules/.*/fbjs/.*
<PROJECT_ROOT>/node_modules/fbjs/.*
<PROJECT_ROOT>/node_modules/.*/config-chain/.*

[include]
./src
Expand Down
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.babelrc
.eslintrc
.eslintcache
.eslintrc
.idea
.nyc_output
.prettierrc
.storybook
.travis.yml
commitlint.config.js
Expand Down
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ cache:
notifications:
email: false
node_js:
- '10'
- '8'
- '7'
- '6'
install:
- yarn install --ignore-engines --check-files --frozen-lockfile
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![Coverage Status](https://codecov.io/gh/jcoreio/material-ui-popup-state/branch/master/graph/badge.svg)](https://codecov.io/gh/jcoreio/material-ui-popup-state)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![npm version](https://badge.fury.io/js/material-ui-popup-state.svg)](https://badge.fury.io/js/material-ui-popup-state)

PopupState takes care of the boilerplate for common Menu, Popover and Popper use cases.

Expand Down
116 changes: 67 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,42 @@
"modules.root": "es",
"sideEffects": false,
"scripts": {
"lint": "eslint src test stories --cache",
"lint:fix": "eslint --fix src test stories --cache",
"lint:watch": "esw --watch src test stories --cache",
"lint": "eslint src test --cache",
"lint:fix": "eslint --fix src test --cache",
"lint:watch": "esw --watch src test --cache",
"prettier": "prettier --write src/**/*.js test/**/*.js",
"prettier:check": "prettier --list-different src/**/*.js test/**/*.js",
"flow": "flow",
"flow:coverage": "for file in src/**.js test/**.js; do echo $file; flow coverage $file; done",
"flow:watch": "flow-watch -e js,js.flow,flowconfig --ignore es/ --ignore node_modules/ --watch .flowconfig --watch src/ --watch test/",
"clean": "rimraf es lib $(cd src; ls) *.js.flow",
"build": "npm run clean && BABEL_ENV=production babel src --out-dir es && flow-copy-source -v src/ es && BABEL_ENV=es5 babel src --out-dir . && flow-copy-source -v src/ .",
"test": "NODE_ENV=production BABEL_ENV=es5 mocha $npm_package_config_mocha && NODE_ENV=production BABEL_ENV=coverage nyc --reporter=lcov --reporter=text mocha $npm_package_config_mocha",
"test:watch": "NODE_ENV=production BABEL_ENV=test mocha --watch $npm_package_config_mocha",
"build": "npm run clean && cross-env BABEL_ENV=production babel src --out-dir es && flow-copy-source -v src/ es && cross-env BABEL_ENV=es5 babel src --out-dir . && flow-copy-source -v src/ .",
"test": "cross-env NODE_ENV=production BABEL_ENV=es5 mocha $npm_package_config_mocha && cross-env NODE_ENV=production BABEL_ENV=coverage nyc --reporter=lcov --reporter=text mocha $npm_package_config_mocha",
"test:watch": "cross-env NODE_ENV=production BABEL_ENV=test mocha --watch $npm_package_config_mocha",
"test:debug": "cross-env NODE_ENV=production BABEL_ENV=test mocha --inspect-brk $npm_package_config_mocha",
"codecov": "nyc report --reporter=text-lcov > coverage.lcov; codecov",
"commitmsg": "commitlint -e $GIT_PARAMS",
"precommit": "npm run lint && flow",
"prepush": "npm test",
"prepublishOnly": "npm run clean && npm run lint && flow && npm test && npm run build",
"prepublishOnly": "npm run clean && npm run prettier:check && npm run lint && flow && npm test && npm run build",
"open:coverage": "open coverage/lcov-report/index.html",
"semantic-release": "semantic-release",
"travis-deploy-once": "travis-deploy-once",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged && npm run lint && flow",
"commit-msg": "commitlint -e $GIT_PARAMS",
"pre-push": "npm test"
}
},
"lint-staged": {
"*.{js,json,css,md}": [
"prettier --write",
"git add"
]
},
"config": {
"mocha": "-r babel-register ./test/utils/setup.js ./test/*.js",
"mocha": "-r @babel/register ./test/utils/setup.js ./test/*.js",
"commitizen": {
"path": "cz-conventional-changelog"
}
Expand All @@ -39,7 +52,7 @@
"src/**/*.js"
],
"require": [
"babel-register"
"@babel/register"
],
"sourceMap": false,
"instrument": false
Expand All @@ -63,57 +76,62 @@
},
"homepage": "https://github.com/jcoreio/material-ui-popup-state#readme",
"devDependencies": {
"@babel/cli": "^7.1.5",
"@babel/core": "^7.1.6",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-export-default-from": "^7.0.0",
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.1.0",
"@babel/preset-env": "^7.1.6",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.0.0",
"@commitlint/cli": "^6.0.2",
"@commitlint/config-conventional": "^6.0.2",
"@jedwards1211/commitlint-config": "^1.0.0",
"@jedwards1211/eslint-config": "^2.0.0",
"@jedwards1211/eslint-config-flow": "^1.0.0",
"@jedwards1211/eslint-config-flow": "^1.0.2",
"@jedwards1211/eslint-config-react": "^4.0.0",
"@material-ui/core": "^1.4.3",
"babel-cli": "^6.23.0",
"babel-core": "^6.23.1",
"babel-eslint": "^7.1.1",
"babel-plugin-istanbul": "^4.0.0",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-export-extensions": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-react-constant-elements": "^6.9.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.7.0",
"babel-preset-flow": "^6.23.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-1": "^6.24.1",
"babel-register": "^6.23.0",
"babel-runtime": "^6.23.0",
"chai": "^4.1.2",
"codecov": "^3.0.0",
"copy": "^0.3.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"eslint": "^3.15.0",
"eslint-plugin-flowtype": "^2.30.0",
"eslint-plugin-react": "^7.0.0",
"eslint-watch": "^3.0.0",
"flow-bin": "^0.87.0",
"flow-copy-source": "^1.2.1",
"flow-watch": "^1.1.0",
"husky": "^0.14.3",
"@material-ui/core": "^3.0.0",
"babel-eslint": "^10.0.1",
"babel-plugin-istanbul": "^5.1.0",
"chai": "^4.2.0",
"codecov": "^3.1.0",
"copy": "^0.3.2",
"cross-env": "^5.2.0",
"enzyme": "^3.8.0",
"enzyme-adapter-react-16": "^1.7.1",
"eslint": "^5.9.0",
"eslint-config-prettier": "^3.3.0",
"eslint-plugin-flowtype": "^3.2.0",
"eslint-plugin-react": "^7.11.1",
"eslint-watch": "^4.0.2",
"flow-bin": "^0.91.0",
"flow-copy-source": "^2.0.2",
"flow-watch": "^1.1.4",
"husky": "^1.1.4",
"istanbul": "^0.4.5",
"jsdom": "^11.12.0",
"mocha": "^5.0.0",
"nyc": "^11.4.1",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"jsdom": "^11.5.1",
"jsdom-global": "^3.0.2",
"lint-staged": "^8.0.4",
"mocha": "^5.2.0",
"nyc": "^13.1.0",
"prettier": "^1.15.2",
"prettier-eslint": "^8.8.2",
"react": "^16.6.3",
"react-dom": "^16.6.3",
"rimraf": "^2.6.0",
"semantic-release": "^15.1.4",
"sinon": "^6.1.4",
"travis-deploy-once": "^4.3.1"
"travis-deploy-once": "^5.0.9"
},
"peerDependencies": {
"react": "^15.0.0 || ^16.0.0"
},
"dependencies": {
"@babel/runtime": "^7.1.5",
"prop-types": "^15.0.0"
}
}
Loading

0 comments on commit 304a6b1

Please sign in to comment.