Skip to content

Commit e9c7e32

Browse files
authored
Merge pull request #163 from topcoder-platform/develop
Several updates
2 parents 9e54a88 + bf6b9d9 commit e9c7e32

File tree

134 files changed

+24590
-1721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+24590
-1721
lines changed

.babelrc

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,66 @@
11
// Babel config for NodeJS (server-side). Frontend Babel configuration is embed
22
// inside Webpack config.
33
{
4+
"env": {
5+
"development": {
6+
"plugins": [
7+
["css-modules-transform", {
8+
"extensions": [".css", ".scss"],
9+
"generateScopedName": "[path][name]___[local]"
10+
}],
11+
["react-css-modules", {
12+
"filetypes": {
13+
".scss": {
14+
"syntax": "postcss-scss"
15+
}
16+
},
17+
"generateScopedName": "[path][name]___[local]"
18+
}]
19+
]
20+
},
21+
"production": {
22+
"plugins": [
23+
["css-modules-transform", {
24+
"extensions": [".css", ".scss"],
25+
"generateScopedName": "[hash:base64:6]"
26+
}],
27+
["react-css-modules", {
28+
"filetypes": {
29+
".scss": {
30+
"syntax": "postcss-scss"
31+
}
32+
},
33+
"generateScopedName": "[hash:base64:6]"
34+
}]
35+
]
36+
},
37+
"test": {
38+
"plugins": [
39+
["css-modules-transform", {
40+
"extensions": [".css", ".scss"],
41+
"generateScopedName": "[path]___[name]__[local]___[hash:base64:5]"
42+
}],
43+
["react-css-modules", {
44+
"filetypes": {
45+
".scss": {
46+
"syntax": "postcss-scss"
47+
}
48+
}
49+
}]
50+
]
51+
}
52+
},
453
"presets": ["env", "react", "stage-2"],
554
"plugins": [
6-
["css-modules-transform", {
7-
"extensions": [".css", ".scss"],
8-
"generateScopedName": "[path]___[name]__[local]___[hash:base64:5]"
9-
}],
55+
"dynamic-import-node",
1056
"inline-react-svg",
1157
["module-resolver", {
1258
"extensions": [".js", ".jsx"],
1359
"root": [
1460
"./src/shared",
1561
"./src"
16-
]
17-
}],
18-
["react-css-modules", {
19-
"filetypes": {
20-
".scss": {
21-
"syntax": "postcss-scss"
22-
}
23-
}
62+
],
63+
"transformFunctions": ["resolveWeak"]
2464
}],
2565
["transform-assets", {
2666
"extensions": ["gif", "jpeg", "jpg", "png"],

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"extends": "airbnb",
3+
"parser": "babel-eslint",
34
"settings": {
45
"import/resolver": {
56
"babel-module": {}

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ RUN npm install
1111
ADD . /opt/app
1212

1313
ARG BUILD_ENV=prod
14+
ENV BABEL_ENV=production
1415
ENV NODE_ENV=$BUILD_ENV
1516
RUN npm run build
1617

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ We use [https://logentries.com](https://logentries.com) to track the logs. Log E
6363

6464
### Development Notes
6565
- [Challenge Listing - Notes from winning submission](docs/challenge-listing-notes.md)
66+
- [**Code Splitting**](docs/code-splitting.md)
6667
- [**How to Add a New Topcoder Community?**](docs/how-to-add-a-new-topcoder-community.md)
6768
- [Leaderboard - Notes from the winning submission](docs/leaderboard-notes.md)
6869
- [**Why Reducer Factories and How to Use Them?**](docs/why-reducer-factories-and-how-to-use-them.md)

__tests__/server/server.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jest.setMock(require.resolve('server/renderer'), (req, res, next) => next());
1212
afterAll(() => {
1313
delete process.env.DEV_TOOLS;
1414
delete process.env.FRONT_END;
15+
delete process.env.NODE_ENV_REAL;
1516
});
1617

1718
beforeEach(() => {

__tests__/shared/components/examples/Content.jsx renamed to __tests__/shared/components/Content.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import Renderer from 'react-test-renderer/shallow';
3-
import Content from 'components/examples/Content';
3+
import Content from 'components/Content';
44

55
test('Matches shallow shapshot', () => {
66
const renderer = new Renderer();

__tests__/shared/components/Dashboard/__snapshots__/SubtrackStats.jsx.snap

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,8 @@ exports[`Matches shallow shapshot 1`] = `
7777
centerMode={true}
7878
dots={false}
7979
infinite={false}
80-
nextArrow={
81-
<NavButton
82-
currentSlide={null}
83-
slideCount={null}
84-
/>
85-
}
86-
prevArrow={
87-
<NavButton
88-
currentSlide={null}
89-
slideCount={null}
90-
/>
91-
}
80+
nextArrow={<NavButton />}
81+
prevArrow={<NavButton />}
9282
slidesToScroll={1}
9383
slidesToShow={1}
9484
speed={500}

__tests__/shared/components/Modal.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ const render = TU.renderIntoDocument((
2727

2828
test('onCancel', () => {
2929
const obj = TU.findAllInRenderedTree(render, item =>
30-
item && item.className && item.className.match('bg-overlay'))[0];
30+
item && item.className && item.className.match('overlay'))[0];
3131
TU.Simulate.click(obj);
3232
expect(mockOnCancel).toHaveBeenCalled();
3333
});
3434

3535
test('onWheel', () => {
3636
const container = TU.findAllInRenderedTree(render, item =>
37-
item && item.className && item.className.match('modal-container'))[0];
37+
item && item.className && item.className.match('container'))[0];
3838
TU.Simulate.wheel(container);
3939
const overlay = TU.findAllInRenderedTree(render, item =>
40-
item && item.className && item.className.match('bg-overlay'))[0];
40+
item && item.className && item.className.match('overlay'))[0];
4141
TU.Simulate.wheel(overlay);
4242
});

__tests__/shared/components/examples/__snapshots__/Content.jsx.snap renamed to __tests__/shared/components/__snapshots__/Content.jsx.snap

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`Matches shallow shapshot 1`] = `
44
<div
5-
className="src-shared-components-examples-Content-___style__Content___3X7yY"
5+
className="src-shared-components-Content-___style__Content___aJySd"
66
>
77
<h1>
88
Topcoder Community App
@@ -205,7 +205,7 @@ exports[`Matches shallow shapshot 1`] = `
205205
>
206206
design challenge 2
207207
</Link>
208-
,
208+
.
209209
</li>
210210
<li>
211211
<Link
@@ -296,6 +296,14 @@ exports[`Matches shallow shapshot 1`] = `
296296
TopGear (Wipro) community
297297
</Link>
298298
</li>
299+
<li>
300+
<Link
301+
replace={false}
302+
to="/community/veterans/"
303+
>
304+
Veterans Community
305+
</Link>
306+
</li>
299307
</ul>
300308
<h3>
301309
Misc Examples
@@ -314,6 +322,14 @@ exports[`Matches shallow shapshot 1`] = `
314322
</code>
315323
.
316324
</li>
325+
<li>
326+
<Link
327+
replace={false}
328+
to="/examples/code-splitting"
329+
>
330+
Code Splitting
331+
</Link>
332+
</li>
317333
<li>
318334
<Link
319335
replace={false}
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`Snapshot match 1`] = `
4-
<div>
5-
<div
6-
className="src-shared-components-Modal-___styles__modal-container___2m4KB"
7-
onWheel={[Function]}
8-
/>
9-
<button
10-
className="src-shared-components-Modal-___styles__bg-overlay___2xty_"
11-
onClick={[Function]}
12-
onWheel={[Function]}
13-
/>
14-
</div>
4+
<Modal
5+
onCancel={[Function]}
6+
theme={
7+
Object {
8+
"container": "src-shared-components-Modal-___styles__container___2HN2G",
9+
"overlay": "src-shared-components-Modal-___styles__overlay___36ZAX",
10+
}
11+
}
12+
/>
1513
`;

0 commit comments

Comments
 (0)