Skip to content

Commit 8f81d42

Browse files
committed
Update dependencies and upgrade to Babel 7
1 parent 2b8d2f4 commit 8f81d42

File tree

5 files changed

+1197
-1085
lines changed

5 files changed

+1197
-1085
lines changed

package.json

+21-20
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"clean": "rm -f index.js && rm -fr es && rm -fr umd",
3636
"prebuild": "npm run clean",
3737
"build": "node ./tools/build.js",
38-
"watch": "babel ./src -d . --ignore __tests__,*.test.js --watch",
38+
"watch": "babel ./src -d . --ignore __tests__,**/*.test.js --watch",
3939
"prepare": "npm run build",
4040
"prepublishOnly": "node ./tools/build.js",
4141
"push-release": "git push origin master && git push --tags",
@@ -49,39 +49,40 @@
4949
"prop-types": "^15.5.10"
5050
},
5151
"devDependencies": {
52-
"babel-cli": "^6.24.1",
53-
"babel-core": "^6.26.0",
54-
"babel-jest": "^23.0.1",
52+
"@babel/cli": "^7.1.0",
53+
"@babel/core": "^7.1.0",
54+
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
55+
"@babel/preset-env": "^7.1.0",
56+
"@babel/preset-react": "^7.0.0",
57+
"babel-core": "^7.0.0-bridge.0",
58+
"babel-jest": "^23.6.0",
5559
"babel-plugin-dev-expression": "^0.2.1",
56-
"babel-plugin-external-helpers": "^6.22.0",
5760
"babel-plugin-transform-object-rest-spread": "^6.26.0",
58-
"babel-plugin-transform-react-remove-prop-types": "^0.4.6",
59-
"babel-preset-env": "^1.6.1",
60-
"babel-preset-react": "^6.24.1",
61+
"babel-plugin-transform-react-remove-prop-types": "^0.4.15",
6162
"coveralls": "^3.0.1",
6263
"enzyme": "^3.6.0",
6364
"enzyme-adapter-react-16": "^1.5.0",
6465
"greenkeeper-lockfile": "^1.15.1",
6566
"gzip-size": "^5.0.0",
66-
"jest": "^23.1.0",
67-
"jest-enzyme": "^6.0.1",
67+
"jest": "^23.6.0",
68+
"jest-enzyme": "^6.0.4",
6869
"jsdom": "^12.0.0",
69-
"lolex": "^2.7.0",
70+
"lolex": "^2.7.5",
7071
"pretty-bytes": "^5.1.0",
71-
"react": "^16.3.1",
72-
"react-dom": "^16.4.1",
73-
"react-test-renderer": "^16.3.1",
74-
"react-timecode": "^1.1.3",
72+
"react": "^16.5.2",
73+
"react-dom": "^16.5.2",
74+
"react-test-renderer": "^16.5.2",
75+
"react-timecode": "^1.1.11",
7576
"regenerator-runtime": "^0.12.0",
7677
"rimraf": "^2.6.1",
77-
"rollup": "^0.66.0",,
78+
"rollup": "^0.66.0",
7879
"rollup-plugin-babel": "^4.0.3",
79-
"rollup-plugin-commonjs": "^9.1.0",
80-
"rollup-plugin-json": "^3.0.0",
81-
"rollup-plugin-node-resolve": "^3.3.0",
80+
"rollup-plugin-commonjs": "^9.1.8",
81+
"rollup-plugin-json": "^3.1.0",
82+
"rollup-plugin-node-resolve": "^3.4.0",
8283
"rollup-plugin-uglify": "^6.0.0",
8384
"rollup-watch": "^4.3.1",
84-
"sinon": "^6.0.0"
85+
"sinon": "^6.3.4"
8586
},
8687
"jest": {
8788
"collectCoverage": true,

rollup.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const config = {
2424
plugins: [
2525
babel({
2626
exclude: 'node_modules/**',
27+
externalHelpers: process.env.BABEL_ENV === 'umd',
2728
}),
2829
resolve(),
2930
commonjs({

tools/babel-preset.js

+18-22
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
11
const BABEL_ENV = process.env.BABEL_ENV;
22
const building = BABEL_ENV != undefined && BABEL_ENV !== 'cjs';
33

4-
const plugins = [
5-
'transform-object-rest-spread',
6-
];
7-
8-
if (BABEL_ENV === 'umd') {
9-
plugins.push('external-helpers');
10-
}
4+
const plugins = ['@babel/plugin-proposal-object-rest-spread'];
115

126
if (process.env.NODE_ENV === 'production') {
137
plugins.push(
14-
'dev-expression',
15-
'transform-react-remove-prop-types'
8+
'babel-plugin-dev-expression',
9+
'babel-plugin-transform-react-remove-prop-types'
1610
);
1711
}
1812

19-
module.exports = {
20-
env: {
21-
test: {
22-
presets: [['env'], 'react'],
13+
module.exports = () => {
14+
return {
15+
env: {
16+
test: {
17+
presets: [['@babel/preset-env'], '@babel/preset-react'],
18+
},
2319
},
24-
},
25-
presets: [
26-
['env', {
27-
'loose': true,
28-
'modules': building ? false : 'commonjs',
29-
}],
30-
'react'
31-
],
32-
plugins: plugins
20+
presets: [
21+
['@babel/preset-env', {
22+
'loose': true,
23+
'modules': building ? false : 'commonjs'
24+
}],
25+
'@babel/preset-react'
26+
],
27+
plugins: plugins,
28+
};
3329
};

tools/build.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ const exec = (command, extraEnv) => {
1212

1313
console.log('Building CommonJS modules ...');
1414

15-
exec('babel src -d . --ignore __tests__,*.test.js', {
15+
exec('babel src -d . --ignore __tests__,**/*.test.js', {
1616
BABEL_ENV: 'cjs'
1717
});
1818

1919
console.log('\nBuilding ES modules ...');
2020

21-
exec('babel src -d es --ignore __tests__,*.test.js', {
21+
exec('babel src -d es --ignore __tests__,**/*.test.js', {
2222
BABEL_ENV: 'es'
2323
});
2424

0 commit comments

Comments
 (0)