Skip to content

Commit cbb98de

Browse files
committed
build: upgrade all build tools
1 parent 1cd8a14 commit cbb98de

File tree

7 files changed

+4749
-2981
lines changed

7 files changed

+4749
-2981
lines changed

.babelrc

Lines changed: 0 additions & 41 deletions
This file was deleted.

.babelrc.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = function(api) {
2+
const plugins = [
3+
'@babel/plugin-syntax-dynamic-import',
4+
'@babel/plugin-proposal-class-properties',
5+
'@babel/plugin-proposal-export-default-from',
6+
'@babel/plugin-proposal-export-namespace-from',
7+
'@babel/plugin-proposal-object-rest-spread',
8+
]
9+
const presets = [
10+
[
11+
'@babel/preset-env',
12+
api.env('es5')
13+
? { forceAllTransforms: true }
14+
: { targets: { node: 'current' } },
15+
],
16+
'@babel/preset-flow',
17+
]
18+
19+
if (api.env(['test', 'coverage', 'es5'])) {
20+
plugins.push('@babel/plugin-transform-runtime')
21+
}
22+
if (api.env('coverage')) {
23+
plugins.push('babel-plugin-istanbul')
24+
}
25+
26+
return { plugins, presets }
27+
}

.eslintrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
22
"extends": [
3-
"@jedwards1211/eslint-config", "@jedwards1211/eslint-config-flow"
3+
"@jedwards1211/eslint-config","@jedwards1211/eslint-config-flow", "eslint-config-prettier"
44
],
55
"parser": "babel-eslint",
6+
"parserOptions": {
7+
"ecmaVersion": 6,
8+
"sourceType": "module"
9+
},
610
"env": {
711
"es6": true
812
}

.flowconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PROJECT_ROOT>/es/.*
44
<PROJECT_ROOT>/node_modules/fbjs/.*
55
<PROJECT_ROOT>/node_modules/.*/fbjs/.*
6+
<PROJECT_ROOT>/node_modules/.*/config-chain/.*
67

78
[include]
89
./src

.prettierrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"semi": false,
33
"singleQuote": true,
4-
"trailingComma": "es5",
5-
"parser": "babylon"
4+
"trailingComma": "es5"
65
}

package.json

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,28 @@
1919
"build": "npm run clean && babel src --out-dir es && flow-copy-source -v src/ es && BABEL_ENV=es5 babel src --out-dir . && flow-copy-source -v src/ .",
2020
"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",
2121
"test:watch": "NODE_ENV=production BABEL_ENV=test mocha --watch $npm_package_config_mocha",
22+
"test:debug": "NODE_ENV=production BABEL_ENV=test mocha --inspect-brk $npm_package_config_mocha",
2223
"codecov": "nyc report --reporter=text-lcov > coverage.lcov; codecov",
23-
"commitmsg": "commitlint -e $GIT_PARAMS",
24-
"precommit": "npm run lint && npm run prettier:check && flow",
25-
"prepush": "npm test",
26-
"prepublishOnly": "npm run clean && npm run lint && flow && npm test && npm run build",
24+
"prepublishOnly": "npm run clean && npm run prettier:check && flow && npm test && npm run build",
2725
"open:coverage": "open coverage/lcov-report/index.html",
2826
"semantic-release": "semantic-release",
2927
"travis-deploy-once": "travis-deploy-once"
3028
},
29+
"husky": {
30+
"hooks": {
31+
"pre-commit": "lint-staged && flow",
32+
"commit-msg": "commitlint -e $GIT_PARAMS",
33+
"pre-push": "npm test"
34+
}
35+
},
36+
"lint-staged": {
37+
"*.{js,json,css,md}": [
38+
"prettier --write",
39+
"git add"
40+
]
41+
},
3142
"config": {
32-
"mocha": "-r babel-register ./test/**/*.js",
43+
"mocha": "-r @babel/register ./test/**/*.js",
3344
"commitizen": {
3445
"path": "cz-conventional-changelog"
3546
}
@@ -58,42 +69,46 @@
5869
},
5970
"homepage": "https://github.com/jedwards1211/es2015-library-skeleton#readme",
6071
"devDependencies": {
72+
"@babel/cli": "^7.1.5",
73+
"@babel/core": "^7.1.6",
74+
"@babel/plugin-proposal-class-properties": "^7.1.0",
75+
"@babel/plugin-proposal-export-default-from": "^7.0.0",
76+
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
77+
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
78+
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
79+
"@babel/plugin-transform-runtime": "^7.1.0",
80+
"@babel/preset-env": "^7.1.6",
81+
"@babel/preset-flow": "^7.0.0",
82+
"@babel/register": "^7.0.0",
83+
"@babel/runtime": "^7.1.5",
6184
"@commitlint/cli": "^6.0.2",
6285
"@commitlint/config-conventional": "^6.0.2",
6386
"@jedwards1211/commitlint-config": "^1.0.0",
6487
"@jedwards1211/eslint-config": "^2.0.0",
6588
"@jedwards1211/eslint-config-flow": "^1.0.0",
66-
"babel-cli": "^6.23.0",
67-
"babel-core": "^6.23.1",
68-
"babel-eslint": "^7.1.1",
69-
"babel-plugin-istanbul": "^4.0.0",
70-
"babel-plugin-syntax-dynamic-import": "^6.18.0",
71-
"babel-plugin-transform-class-properties": "^6.24.1",
72-
"babel-plugin-transform-export-extensions": "^6.22.0",
73-
"babel-plugin-transform-object-rest-spread": "^6.26.0",
74-
"babel-plugin-transform-runtime": "^6.23.0",
75-
"babel-preset-env": "^1.7.0",
76-
"babel-preset-flow": "^6.23.0",
77-
"babel-preset-stage-1": "^6.24.1",
78-
"babel-register": "^6.23.0",
79-
"babel-runtime": "^6.23.0",
80-
"chai": "^4.1.2",
81-
"codecov": "^3.0.0",
82-
"copy": "^0.3.0",
83-
"eslint": "^3.15.0",
84-
"eslint-plugin-flowtype": "^2.30.0",
85-
"eslint-watch": "^3.0.0",
86-
"flow-bin": "^0.85.0",
87-
"flow-copy-source": "^1.2.1",
89+
"babel-eslint": "^10.0.1",
90+
"babel-plugin-istanbul": "^5.1.0",
91+
"chai": "^4.2.0",
92+
"codecov": "^3.1.0",
93+
"copy": "^0.3.2",
94+
"eslint": "^5.9.0",
95+
"eslint-plugin-flowtype": "^3.2.0",
96+
"eslint-watch": "^4.0.2",
97+
"flow-bin": "^0.86.0",
98+
"flow-copy-source": "^2.0.2",
8899
"flow-watch": "^1.1.0",
89100
"husky": "^0.14.3",
90101
"istanbul": "^0.4.5",
91-
"mocha": "^4.1.0",
92-
"nyc": "^11.4.1",
93-
"prettier": "^1.15.1",
102+
"lint-staged": "^8.0.4",
103+
"mocha": "^5.2.0",
104+
"nyc": "^13.1.0",
105+
"prettier": "^1.15.2",
94106
"prettier-eslint": "^8.8.2",
95107
"rimraf": "^2.6.0",
96108
"semantic-release": "^15.1.4",
97109
"travis-deploy-once": "^4.3.1"
110+
},
111+
"dependencies": {
112+
"eslint-config-prettier": "^3.3.0"
98113
}
99114
}

0 commit comments

Comments
 (0)