Skip to content

Commit 57f3911

Browse files
committed
package: switch to react-scripts
1 parent 565ad9f commit 57f3911

File tree

7 files changed

+13055
-125
lines changed

7 files changed

+13055
-125
lines changed

package-lock.json

Lines changed: 13030 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,56 +4,38 @@
44
"description": "help.com react coding challange",
55
"main": "index.js",
66
"scripts": {
7-
"start": "node server",
8-
"lint": "esw src/",
9-
"test": "jest"
7+
"start": "react-scripts start",
8+
"build": "react-scripts build",
9+
"test": "react-scripts test --env=jsdom"
1010
},
1111
"author": "Help.com",
1212
"license": "No license",
1313
"dependencies": {
1414
"@material-ui/core": "^3.8.2",
1515
"chance": "^0.8.0",
16-
"connect": "^3.4.1",
17-
"html-webpack-plugin": "^2.28.0",
1816
"lodash": "^4.17.2",
1917
"prop-types": "^15.5.8",
20-
"react": "^16.6.3",
21-
"react-dom": "^16.6.3",
22-
"react-hot-loader": "^4.3.4",
23-
"webpack": "^2.4.1"
18+
"react": "^16.8.6",
19+
"react-dom": "^16.8.6",
20+
"react-scripts": "^3.0.1"
2421
},
25-
"devDependencies": {
26-
"babel-core": "^6.10.4",
27-
"babel-eslint": "^7.1.0",
28-
"babel-jest": "^19.0.0",
29-
"babel-loader": "^6.2.4",
30-
"babel-plugin-transform-object-assign": "^6.22.0",
31-
"babel-plugin-transform-react-jsx-source": "^6.9.0",
32-
"babel-preset-env": "^1.3.1",
33-
"babel-preset-react": "^6.5.0",
34-
"babel-preset-stage-1": "^6.16.0",
35-
"css-loader": "^0.23.1",
36-
"eslint": "^5.12.0",
37-
"eslint-config-airbnb": "^17.1.0",
38-
"eslint-plugin-import": "^2.14.0",
39-
"eslint-plugin-jsx-a11y": "^6.1.2",
40-
"eslint-plugin-react": "^7.12.3",
41-
"eslint-watch": "^4.0.2",
42-
"jest": "^19.0.0",
43-
"style-loader": "^0.13.0",
44-
"webpack-dev-server": "^2.4.2"
22+
"devDependencies": {},
23+
"browserslist": {
24+
"production": [
25+
">0.2%",
26+
"not dead",
27+
"not op_mini all"
28+
],
29+
"development": [
30+
"last 1 chrome version",
31+
"last 1 firefox version",
32+
"last 1 safari version"
33+
]
4534
},
4635
"jest": {
4736
"collectCoverageFrom": [
4837
"**/src/**/*.js",
4938
"!**/__tests__/**"
50-
],
51-
"moduleDirectories": [
52-
"node_modules",
53-
"src"
54-
],
55-
"setupFiles": [
56-
"./jest-setup.js"
5739
]
5840
}
5941
}

src/index.html renamed to public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
<link rel="shortcut icon" href="//assets.help.com/favicons/favicon.ico">
88
</head>
99
<body>
10-
<div class="main"></div>
10+
<div id="root"></div>
1111
</body>
1212
</html>

server.js

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

src/components/message-list.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ class MessageList extends Component {
1010
}
1111
}
1212

13-
componentWillMount() {
14-
this.api = new Api({
15-
messageCallback: (message) => {
16-
this.messageCallback(message)
17-
},
18-
})
19-
}
13+
api = new Api({
14+
messageCallback: (message) => {
15+
this.messageCallback(message)
16+
},
17+
})
2018

2119
componentDidMount() {
2220
this.api.start()

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import MessageList from './components/message-list'
55
const NewApp = require('./components/message-list').default
66

77
function renderApp(App) {
8-
ReactDOM.render(<App />, document.querySelector('.main'))
8+
ReactDOM.render(<App />, document.getElementById('root'))
99
}
1010

1111
renderApp(MessageList)

webpack/config.js

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

0 commit comments

Comments
 (0)