Skip to content
This repository was archived by the owner on May 26, 2022. It is now read-only.

Commit b49cda8

Browse files
author
Adam Haglund
authored
Update Dependencies (#15)
* fix build * update tsconfig * update actions * update epics * update state index * update reducers * fix epics * remove unnecessary types * upgrade yarn.lock * add missing hot loader * fix errors and use new react-hot-loader * fix epicmiddleware run * remove added .idea files * fix errors * fix action creators
1 parent 6909ed1 commit b49cda8

25 files changed

+2120
-2267
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# See https://help.github.com/ignore-files/ for more about ignoring files.
1+
.idea
22

33
# dependencies
44
/node_modules

package.json

Lines changed: 68 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,70 +2,74 @@
22
"name": "mob-timer",
33
"version": "1.2.0",
44
"dependencies": {
5-
"@babel/core": "^7.0.0-beta.46",
6-
"@babel/preset-env": "^7.0.0-beta.46",
7-
"@babel/preset-react": "^7.0.0-beta.46",
8-
"autoprefixer": "8.4.1",
9-
"babel-jest": "^22.4.3",
5+
"@babel/core": "^7.0.0-beta.54",
6+
"@babel/preset-env": "^7.0.0-beta.54",
7+
"@babel/preset-react": "^7.0.0-beta.54",
8+
"autoprefixer": "9.0.0",
9+
"babel-jest": "^23.4.0",
1010
"babel-loader": "^8.0.0-beta.2",
1111
"case-sensitive-paths-webpack-plugin": "2.1.2",
1212
"chalk": "^2.4.1",
13-
"css-loader": "0.28.11",
14-
"dotenv": "5.0.1",
13+
"css-loader": "1.0.0",
14+
"dotenv": "6.0.0",
1515
"extract-text-webpack-plugin": "^4.0.0-beta.0",
1616
"file-loader": "1.1.11",
17-
"fork-ts-checker-webpack-plugin": "^0.4.1",
18-
"fs-extra": "6.0.0",
17+
"fork-ts-checker-webpack-plugin": "^0.4.3",
18+
"fs-extra": "7.0.0",
1919
"html-webpack-plugin": "^3.2.0",
2020
"interpolate-html-plugin": "^3.0.0",
21-
"jest": "22.4.3",
22-
"node-sass": "^4.9.0",
21+
"jest": "23.4.1",
22+
"node-sass": "^4.9.2",
2323
"normalize.css": "^8.0.0",
2424
"object-assign": "4.1.1",
25-
"postcss-flexbugs-fixes": "3.3.1",
26-
"postcss-loader": "2.1.4",
25+
"postcss-flexbugs-fixes": "4.0.0",
26+
"postcss-loader": "2.1.6",
2727
"promise": "8.0.1",
2828
"raf": "3.4.0",
29-
"react": "^16.3.2",
29+
"react": "^16.4.1",
3030
"react-dev-utils": "^6.0.0-next.b2fd8db8",
31-
"react-dnd": "^2.6.0",
32-
"react-dnd-multi-backend": "^3.1.2",
33-
"react-dom": "^16.3.2",
31+
"react-dnd": "^5.0.0",
32+
"react-dnd-html5-backend": "^5.0.1",
33+
"react-dnd-multi-backend": "^3.1.0",
34+
"react-dom": "^16.4.1",
35+
"react-hot-loader": "^4.3.3",
3436
"react-keydown": "^1.9.7",
35-
"react-md": "^1.3.0",
37+
"react-md": "^1.4.2",
3638
"react-redux": "^5.0.7",
37-
"redux": "^3.7.2",
38-
"redux-observable": "^0.18.0",
39-
"rxjs": "^5.5.10",
40-
"sass-loader": "^7.0.1",
39+
"redux": "^4.0.0",
40+
"redux-observable": "^1.0.0",
41+
"rxjs": "^6.2.2",
42+
"sass-loader": "^7.0.3",
4143
"source-map-loader": "^0.2.3",
4244
"style-loader": "0.21.0",
43-
"styled-components": "^3.2.6",
45+
"styled-components": "^3.3.3",
4446
"sw-precache-webpack-plugin": "0.11.5",
45-
"ts-loader": "^4.2.0",
46-
"uglifyjs-webpack-plugin": "^1.2.5",
47+
"ts-loader": "^4.4.2",
48+
"typesafe-actions": "^2.0.4",
49+
"uglifyjs-webpack-plugin": "^1.2.7",
4750
"url-loader": "1.0.1",
48-
"webpack": "4.6.0",
49-
"webpack-manifest-plugin": "2.0.2"
51+
"webpack": "4.16.1",
52+
"webpack-manifest-plugin": "2.0.3"
5053
},
5154
"devDependencies": {
52-
"@types/jest": "^22.2.3",
53-
"@types/react": "16.3.13",
54-
"@types/react-dnd": "^2.0.36",
55+
"@types/jest": "^23.3.0",
56+
"@types/node": "^10.5.2",
57+
"@types/react": "16.4.6",
5558
"@types/react-dnd-multi-backend": "^3.0.1",
56-
"@types/react-dom": "^16.0.5",
57-
"@types/react-redux": "5.0.19",
58-
"gh-pages": "^1.1.0",
59-
"husky": "^1.0.0-rc.2",
60-
"lint-staged": "^7.0.5",
61-
"prettier": "^1.12.1",
62-
"ts-jest": "22.4.4",
63-
"tsconfig-paths-webpack-plugin": "^3.0.4",
64-
"tslint": "^5.9.1",
65-
"tslint-config-prettier": "^1.12.0",
66-
"tslint-config-standard": "^7.0.0",
67-
"tslint-react": "^3.5.1",
68-
"typescript": "^2.8.3",
59+
"@types/react-dom": "^16.0.6",
60+
"@types/react-hot-loader": "^4.1.0",
61+
"@types/react-redux": "^6.0.4",
62+
"gh-pages": "^1.2.0",
63+
"husky": "^0.14.3",
64+
"lint-staged": "^7.2.0",
65+
"prettier": "^1.13.7",
66+
"ts-jest": "23.0.1",
67+
"tsconfig-paths-webpack-plugin": "^3.2.0",
68+
"tslint": "^5.11.0",
69+
"tslint-config-prettier": "^1.14.0",
70+
"tslint-config-standard": "^7.1.0",
71+
"tslint-react": "^3.6.0",
72+
"typescript": "^2.9.2",
6973
"webpack-dev-server": "3.1.4"
7074
},
7175
"homepage": "https://beeequeue.github.io/mob-timer",
@@ -76,17 +80,22 @@
7680
}
7781
},
7882
"jest": {
79-
"collectCoverageFrom": ["src/**/*.{js,jsx,ts,tsx}"],
80-
"setupFiles": ["<rootDir>/config/polyfills.js"],
81-
"testMatch": ["<rootDir>/src/**/?(*.)(test).(j|t)s?(x)"],
83+
"collectCoverageFrom": [
84+
"src/**/*.{js,jsx,ts,tsx}"
85+
],
86+
"setupFiles": [
87+
"<rootDir>/config/polyfills.js"
88+
],
89+
"testMatch": [
90+
"<rootDir>/src/**/?(*.)(test).(j|t)s?(x)"
91+
],
8292
"testEnvironment": "node",
8393
"testURL": "http://localhost",
8494
"transform": {
8595
"^.+\\.(js|jsx)$": "<rootDir>/node_modules/babel-jest",
8696
"^.+\\.tsx?$": "<rootDir>/config/jest/typescriptTransform.js",
8797
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
88-
"^(?!.*\\.(js|jsx|mjs|css|json)$)":
89-
"<rootDir>/config/jest/fileTransform.js"
98+
"^(?!.*\\.(js|jsx|mjs|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
9099
},
91100
"transformIgnorePatterns": [
92101
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$"
@@ -95,15 +104,24 @@
95104
"^react-native$": "react-native-web",
96105
"@state/(.*)": "<rootDir>/src/state/$1"
97106
},
98-
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json"],
107+
"moduleFileExtensions": [
108+
"ts",
109+
"tsx",
110+
"js",
111+
"jsx",
112+
"json"
113+
],
99114
"globals": {
100115
"ts-jest": {
101116
"tsConfigFile": "tsconfig.test.json"
102117
}
103118
}
104119
},
105120
"lint-staged": {
106-
"*.{ts,tsx,json}": ["yarn format", "git add"]
121+
"*.{ts,tsx,json}": [
122+
"yarn format",
123+
"git add"
124+
]
107125
},
108126
"private": true,
109127
"scripts": {

src/App.tsx

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { hot } from 'react-hot-loader'
12
import * as React from 'react'
23
import { compose } from 'redux'
34
import { connect } from 'react-redux'
@@ -6,12 +7,13 @@ import keydown from 'react-keydown/es'
67
import styled from 'styled-components'
78

89
import { startTimer, stopTimer, setTime } from '@state/actions/timerActions'
10+
11+
import { Time } from './time'
12+
import { IRootState } from './state'
913
import { TimerContainer } from './containers/Timer'
1014
import { UserContainer } from './containers/Users'
1115
// import { GitHubLink } from './components/GitHubLink'
1216
import { multiBackend } from './utils/dragDropContext'
13-
import { Time } from './time'
14-
import { IState } from './state'
1517

1618
const Container = styled.div`
1719
font-family: 'Roboto', sans-serif;
@@ -30,22 +32,16 @@ interface IStateProps {
3032
duration: Time
3133
}
3234

33-
interface IDispatchProps {
34-
startTimer: typeof startTimer
35-
stopTimer: typeof stopTimer
36-
setTime: typeof setTime
37-
}
38-
39-
const mapState = ({ timer }: IState): IStateProps => ({
35+
const mapState = ({ timer }: IRootState): IStateProps => ({
4036
counting: timer.counting,
4137
duration: timer.duration,
4238
})
4339

44-
const mapActions: IDispatchProps = { startTimer, stopTimer, setTime }
40+
const mapActions = { startTimer, stopTimer, setTime }
41+
type DispatchProps = typeof mapActions
4542

46-
export class AppComponent extends React.Component<
47-
IStateProps & IDispatchProps
48-
> {
43+
@DragDropContext(multiBackend)
44+
export class AppComponent extends React.Component<IStateProps & DispatchProps> {
4945
constructor(props: any) {
5046
super(props)
5147

@@ -78,6 +74,9 @@ export class AppComponent extends React.Component<
7874
}
7975

8076
export const App = compose(
81-
connect(mapState, mapActions),
82-
DragDropContext(multiBackend)
77+
hot(module),
78+
connect(
79+
mapState,
80+
mapActions
81+
)
8382
)(AppComponent)

src/components/AddUserDialog.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { hot } from 'react-hot-loader'
12
import * as React from 'react'
23
import keydown from 'react-keydown/es'
34
import { Button } from 'react-md/lib/Buttons'
@@ -16,7 +17,7 @@ interface IState {
1617
readonly names: ReadonlyArray<string>
1718
}
1819

19-
export class AddUserDialog extends React.PureComponent<IProps, IState> {
20+
class AddUserDialogComponent extends React.PureComponent<IProps, IState> {
2021
constructor(props: IProps) {
2122
super(props)
2223

@@ -57,16 +58,16 @@ export class AddUserDialog extends React.PureComponent<IProps, IState> {
5758
this.submit()
5859
}
5960

60-
private onInputKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
61+
private onInputKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {
6162
if (e.keyCode === 13) return this.submit()
6263
}
6364

6465
private onFieldChange = (value: string) => {
6566
this.setState({ value })
6667
}
6768

68-
public selectName = (name: string) => {
69-
this.setState({ value: name })
69+
public selectName = (name: React.ReactText) => {
70+
this.setState({ value: name as string })
7071
}
7172

7273
private actions = [
@@ -101,3 +102,5 @@ export class AddUserDialog extends React.PureComponent<IProps, IState> {
101102
)
102103
}
103104
}
105+
106+
export const AddUserDialog = hot(module)(AddUserDialogComponent)

src/components/Countdown.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import { hot } from 'react-hot-loader'
12
import * as React from 'react'
2-
import styled, { StyledComponentClass } from 'styled-components'
33
import { Button, ButtonProps } from 'react-md/lib/Buttons'
4+
import styled, { StyledComponentClass } from 'styled-components'
5+
46
import { Time } from '../time'
57

68
const Container = styled.div`
@@ -47,8 +49,8 @@ interface IProps {
4749
onChangeTime: (time: Time) => void
4850
}
4951

50-
export class Countdown extends React.PureComponent<IProps> {
51-
private changeMinutes = (e: React.MouseEvent<HTMLButtonElement>) => {
52+
class CountdownComponent extends React.PureComponent<IProps> {
53+
private changeMinutes = (e: React.MouseEvent<HTMLElement>) => {
5254
const { time, onChangeTime } = this.props
5355
const newMinutes = time.minutes + Number(e.currentTarget.textContent)
5456

@@ -62,7 +64,7 @@ export class Countdown extends React.PureComponent<IProps> {
6264
onChangeTime(newTime)
6365
}
6466

65-
private changeSeconds = (e: React.MouseEvent<HTMLButtonElement>) => {
67+
private changeSeconds = (e: React.MouseEvent<HTMLElement>) => {
6668
const { time, onChangeTime } = this.props
6769
let newSeconds = time.seconds + Number(e.currentTarget.textContent)
6870

@@ -112,3 +114,5 @@ export class Countdown extends React.PureComponent<IProps> {
112114
)
113115
}
114116
}
117+
118+
export const Countdown = hot(module)(CountdownComponent)

src/components/GitHubLink.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { hot } from 'react-hot-loader'
12
import * as React from 'react'
23
import styled from 'styled-components'
34

@@ -13,8 +14,10 @@ const Icon = styled.img`
1314
background: #eee;
1415
`
1516

16-
export const GitHubLink: React.SFC = () => (
17+
export const GitHubLinkComponent: React.SFC = () => (
1718
<a target="_blank" href="https://github.com/beeequeue/mob-timer">
1819
<Icon src={iconUrl} />
1920
</a>
2021
)
22+
23+
export const GitHubLink = hot(module)(GitHubLinkComponent)

src/components/KeyboardShortcutsDialog.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { hot } from 'react-hot-loader'
12
import * as React from 'react'
23
import { DialogContainer } from 'react-md/lib/Dialogs'
34
import { FontIcon } from 'react-md/lib/FontIcons'
@@ -30,7 +31,7 @@ interface IProps {
3031
readonly hide: () => void
3132
}
3233

33-
export class KeyboardShortcutsDialog extends React.PureComponent<IProps> {
34+
class KeyboardShortcutsDialogComponent extends React.PureComponent<IProps> {
3435
private actions = [{ children: 'Back', onClick: this.props.hide }]
3536

3637
public render() {
@@ -53,3 +54,5 @@ export class KeyboardShortcutsDialog extends React.PureComponent<IProps> {
5354
)
5455
}
5556
}
57+
58+
export const KeyboardShortcutsDialog = hot(module)(KeyboardShortcutsDialogComponent)

0 commit comments

Comments
 (0)