Skip to content

Commit c7cb64a

Browse files
committed
Update of all dependencies to the latest versions
- NodeJS updated to the latest LTS (v10.14.2) - Babel updated from v6 to v7 - All other NPM dependencies updated to their latest versions
1 parent a492e96 commit c7cb64a

File tree

14 files changed

+8029
-5979
lines changed

14 files changed

+8029
-5979
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"presets": [
33
"./config/babel/node-ssr"
44
]
5-
}
5+
}

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v8.11.3
1+
v10.14.2

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Topcoder React Utils Changelog
22

3+
### V0.9.0
4+
- NodeJS updated to the latest LTS version (10.14.2);
5+
- NPM dependencies updated to the latest versions. In particular:
6+
- Babel updated from v6 to v7.
7+
38
### v0.8.2
49
- Adds [**`Modal`**](docs/modal.md) component.
510

__tests__/.babelrc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
"../config/babel/node-ssr"
44
],
55
"plugins": [
6-
["module-resolver", {
7-
"alias": {
8-
"topcoder-react-utils/dist": "./src"
6+
[
7+
"module-resolver",
8+
{
9+
"alias": {
10+
"topcoder-react-utils/dist": "./src"
11+
}
912
}
10-
}]
13+
]
1114
]
1215
}

__tests__/__snapshots__/index.js.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Object {
8181
"animationEnd": [Function],
8282
"animationIteration": [Function],
8383
"animationStart": [Function],
84+
"auxClick": [Function],
8485
"beforeInput": [Function],
8586
"blur": [Function],
8687
"canPlay": [Function],

__tests__/server/__snapshots__/renderer.jsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ exports[`Server-side rendering (SSR); injection of CSS chunks & Redux state 1`]
182182
</head>
183183
<body>
184184
185-
<div id=\\"react-view\\"><div data-reactroot=\\"\\">Hello Wold!</div></div>
185+
<div id=\\"react-view\\"><div>Hello Wold!</div></div>
186186
<script id=\\"inj\\" type=\\"application/javascript\\">
187187
window.SPLITS = {}
188188
window.INJ=\\"MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDGF1OkTQprU3+cINSXQietFqgqagolJ5j9NlQutv03F1TZonSyrmykHqLzmKxXS0DLPyBqGDNu0Yb+sEvg3s2Nv7ZYfzgAL5LpxryHNGWLiWYlCFgBW1NkdubXDUzuNfddcSwOHmA68IbAvuQnY81RZWKcs/M+w/CFPnw0PiVYASg==\\"

__tests__/shared/components/__snapshots__/Modal.jsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ exports[`Snapshot match 1`] = `
55
className="MOCK_PORTAL"
66
>
77
<div
8-
className="style__container___1SoeQ"
8+
className="src-shared-components-Modal-style___container___1SoeQl"
99
onWheel={[Function]}
1010
>
1111
CONTENT
1212
</div>
1313
<button
14-
className="style__overlay___X12tn"
14+
className="src-shared-components-Modal-style___overlay___X12tn9"
1515
onClick={[Function]}
1616
type="button"
1717
/>

config/babel/node-ssr.js

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,53 @@
11
/* Babel preset for NodeJS build with support of server-side JSX rendering. */
22

33
const _ = require('lodash');
4-
const config = _.cloneDeep(require('./webpack'));
5-
6-
const cssModulesTransformPluginOps = {
7-
extensions: ['.css', '.scss'],
8-
};
9-
10-
const transformAssetsPluginOptions = {
11-
extensions: ['gif', 'jpeg', 'jpg', 'png'],
12-
};
13-
14-
config.plugins = config.plugins.concat([
15-
'dynamic-import-node',
16-
['transform-assets', transformAssetsPluginOptions],
17-
['css-modules-transform', cssModulesTransformPluginOps],
18-
]);
19-
20-
const moduleResolverPluginOps = config.plugins.find(
21-
x => x[0] === 'module-resolver',
22-
)[1];
23-
24-
moduleResolverPluginOps.transformFunctions = [
25-
'resolveWeak',
26-
'webpack.resolveWeak',
27-
];
28-
29-
switch (process.env.BABEL_ENV) {
30-
case 'development':
31-
_.pull(config.plugins, 'react-hot-loader/babel');
32-
cssModulesTransformPluginOps.generateScopedName = '[path][name]___[local]___[hash:base64:6]';
33-
break;
34-
case 'production':
35-
cssModulesTransformPluginOps.generateScopedName = '[hash:base64:6]';
36-
break;
37-
case 'test':
38-
cssModulesTransformPluginOps.generateScopedName = '[path][name]___[local]___[hash:base64:6]';
39-
break;
40-
default:
41-
}
4+
const getWebpackBabelConfig = require('./webpack');
5+
6+
function getConfig(babel, ops = {}) {
7+
const config = getWebpackBabelConfig(babel);
8+
9+
const cssModulesTransformPluginOps = {
10+
extensions: ['.css', '.scss'],
11+
};
12+
13+
const transformAssetsPluginOptions = {
14+
extensions: ['gif', 'jpeg', 'jpg', 'png'],
15+
};
16+
17+
config.plugins = config.plugins.concat([
18+
'dynamic-import-node',
19+
['transform-assets', transformAssetsPluginOptions],
20+
['css-modules-transform', cssModulesTransformPluginOps],
21+
]);
22+
23+
const moduleResolverPluginOps = config.plugins.find(
24+
x => x[0] === 'module-resolver',
25+
)[1];
26+
27+
moduleResolverPluginOps.transformFunctions = [
28+
'resolveWeak',
29+
'webpack.resolveWeak',
30+
];
31+
32+
switch (babel.getEnv()) {
33+
case 'development':
34+
_.pull(config.plugins, 'react-hot-loader/babel');
35+
cssModulesTransformPluginOps.generateScopedName = '[path][name]___[local]___[hash:base64:6]';
36+
break;
37+
case 'production':
38+
cssModulesTransformPluginOps.generateScopedName = '[hash:base64:6]';
39+
break;
40+
case 'test':
41+
cssModulesTransformPluginOps.generateScopedName = '[path][name]___[local]___[hash:base64:6]';
42+
break;
43+
default:
44+
}
4245

43-
module.exports = (apt, ops = {}) => {
4446
const baseAssetsOutputPath = ops.baseAssetsOutputPath || '';
4547
transformAssetsPluginOptions.name = `${
4648
baseAssetsOutputPath}/images/[hash].[ext]`;
49+
4750
return config;
48-
};
51+
}
52+
53+
module.exports = getConfig;

config/babel/webpack.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/* Babel preset for the Webpack build. */
22

3+
const _ = require('lodash');
4+
35
const reactCssModulesPluginOps = {
46
filetypes: {
57
'.scss': {
@@ -10,9 +12,8 @@ const reactCssModulesPluginOps = {
1012

1113
const config = {
1214
presets: [
13-
'env',
14-
'react',
15-
'stage-2',
15+
'@babel/env',
16+
'@babel/react',
1617
],
1718
plugins: [
1819
['module-resolver', {
@@ -22,21 +23,25 @@ const config = {
2223
'./src',
2324
],
2425
}],
26+
'@babel/syntax-dynamic-import',
2527
'inline-react-svg',
26-
'transform-runtime',
28+
'@babel/transform-runtime',
2729
['react-css-modules', reactCssModulesPluginOps],
2830
],
2931
};
3032

31-
switch (process.env.BABEL_ENV) {
32-
case 'development':
33-
reactCssModulesPluginOps.generateScopedName = '[path][name]___[local]___[hash:base64:6]';
34-
config.plugins.push('react-hot-loader/babel');
35-
break;
36-
case 'production':
37-
reactCssModulesPluginOps.generateScopedName = '[hash:base64:6]';
38-
break;
39-
default:
33+
function getPreset(babel) {
34+
switch (babel.getEnv()) {
35+
case 'development':
36+
reactCssModulesPluginOps.generateScopedName = '[path][name]___[local]___[hash:base64:6]';
37+
config.plugins.push('react-hot-loader/babel');
38+
break;
39+
case 'production':
40+
reactCssModulesPluginOps.generateScopedName = '[hash:base64:6]';
41+
break;
42+
default:
43+
}
44+
return _.cloneDeep(config);
4045
}
4146

42-
module.exports = config;
47+
module.exports = getPreset;

config/webpack/app-base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ module.exports = function configFactory(ops) {
168168
loader: 'babel-loader',
169169
options: {
170170
babelrc: false,
171-
forceEnv: o.babelEnv,
171+
envName: o.babelEnv,
172172
presets: ['topcoder-react-utils/config/babel/webpack'],
173173
},
174174
}, {

0 commit comments

Comments
 (0)