Skip to content

Commit 04d23cd

Browse files
committed
chore: update dependencies
1 parent 3664406 commit 04d23cd

File tree

19 files changed

+2650
-2014
lines changed

19 files changed

+2650
-2014
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ $ yarn
4848
Run the current application in development mode
4949

5050
```
51-
$ yarn app start
51+
$ yarn app dev
5252
```
5353

5454
Create packages

lerna.json

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

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@
99
"app": "cd packages/p2p-chat && yarn run",
1010
"lint": "eslint .",
1111
"fix": "eslint . --fix",
12-
"format": "prettier --write '**/*.{js,scss}'",
13-
"precommit": "lint-staged",
14-
"pub": "lerna publish",
15-
"postinstall": "cd packages/p2p-chat && yarn"
12+
"format": "prettier --write '**/*.{js,scss}'"
1613
},
1714
"lint-staged": {
1815
"*.{scss,js}": [
1916
"prettier --write",
2017
"git add"
2118
]
2219
},
20+
"husky": {
21+
"hooks": {
22+
"precommit": "lint-staged"
23+
}
24+
},
2325
"devDependencies": {
24-
"eslint": "^5.5.0",
26+
"eslint": "^5.11.0",
2527
"eslint-config-dgeibi": "^5.1.1",
26-
"husky": "^0.14.3",
27-
"lerna": "2.8.0",
28-
"lint-staged": "^7.2.2",
29-
"npm-run-all": "^4.1.3",
30-
"prettier": "^1.14.2"
28+
"husky": "^1.2.1",
29+
"lint-staged": "^8.1.0",
30+
"prettier": "^1.15.3"
3131
},
3232
"workspaces": [
3333
"packages/*"

packages/p2p-chat/config/devServer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const logger = require('p2p-chat-logger')
44

55
class StartElectron {
66
apply(compiler) {
7-
compiler.plugin('done', () => {
7+
compiler.hooks.done.tap('selfdone', () => {
88
if (this.started) return
99
this.started = true
1010
spawn('electron .', {
@@ -30,6 +30,7 @@ module.exports = options => wtf => {
3030
wtf.config.devServer = Object.assign(
3131
wtf.config.devServer,
3232
{
33+
disableHostCheck: true,
3334
hot: true,
3435
stats: {
3536
colors: true,

packages/p2p-chat/config/fromAntdStyle.js

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

packages/p2p-chat/config/main.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = (env = {}) => {
5050
'@babel/env',
5151
{
5252
targets: {
53-
electron: '3.0.0',
53+
electron: '4.0.0',
5454
},
5555
modules: false,
5656
useBuiltIns: 'usage',

packages/p2p-chat/config/renderer.config.js

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module.exports = (env = {}) => {
5555
'@dgeibi/babel-preset-react-app',
5656
{
5757
targets: {
58-
electron: '3.0.0',
58+
electron: '4.0.0',
5959
},
6060
useBuiltIns: 'usage',
6161
shippedProposals: true,
@@ -67,7 +67,8 @@ module.exports = (env = {}) => {
6767
'import',
6868
{
6969
libraryName: 'antd',
70-
style: true,
70+
libraryDirectory: 'es',
71+
style: 'css',
7172
},
7273
'antd-import',
7374
],
@@ -94,25 +95,16 @@ module.exports = (env = {}) => {
9495
.use(
9596
css({
9697
rule: {
97-
test: /\.less$/,
98+
test: /\.css$/,
9899
use: [
99100
{
100101
loader: 'css-loader',
101102
options: {
102-
minimize: true,
103-
},
104-
},
105-
{
106-
loader: 'less-loader',
107-
options: {
108-
javascriptEnabled: true,
109-
modifyVars: {
110-
'icon-url': require('./fromAntdStyle')(
111-
`${__dirname}/../public/fonts/iconfont`
112-
),
113-
},
103+
importLoaders: 1,
104+
sourceMap: false,
114105
},
115106
},
107+
{ loader: 'postcss-loader', options: { sourceMap: false } },
116108
],
117109
},
118110
extract: PROD,
@@ -122,19 +114,17 @@ module.exports = (env = {}) => {
122114
css({
123115
rule: {
124116
test: /\.scss$/,
125-
include: defaultInclude,
126117
use: [
127118
{
128119
loader: 'css-loader',
129120
options: {
130121
getLocalIdent,
131122
modules: true,
132123
importLoaders: 1,
133-
minimize: true,
134-
sourceMap: true,
124+
sourceMap: false,
135125
},
136126
},
137-
{ loader: 'postcss-loader', options: { sourceMap: true } },
127+
{ loader: 'postcss-loader', options: { sourceMap: false } },
138128
],
139129
},
140130
extract: PROD,

packages/p2p-chat/main/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ function createWindow() {
200200
width: 800,
201201
height: 600,
202202
title: pkg.name,
203+
webPreferences: {
204+
nodeIntegration: true,
205+
}
203206
})
204207

205208
const urlObj = Object.assign(

packages/p2p-chat/package.json

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -42,51 +42,49 @@
4242
"p2p-chat-utils": "*"
4343
},
4444
"devDependencies": {
45-
"@babel/core": "^7.0.0",
46-
"@babel/preset-env": "^7.0.0",
47-
"@babel/runtime": "^7.0.0",
48-
"@dgeibi/babel-preset-react-app": "^1.2.1",
49-
"antd": "^3.8.4",
45+
"@babel/core": "^7.2.2",
46+
"@babel/preset-env": "^7.2.3",
47+
"@dgeibi/babel-preset-react-app": "2.0.4",
48+
"antd": "^3.11.4",
5049
"babel-core": "^7.0.0-bridge.0",
51-
"babel-loader": "^8.0.0",
52-
"babel-plugin-import": "^1.8.0",
53-
"babel-plugin-transform-react-remove-prop-types": "^0.4.15",
54-
"css-loader": "^1.0.0",
50+
"babel-loader": "^8.0.4",
51+
"babel-plugin-import": "^1.11.0",
52+
"connected-react-router": "^6.0.0",
53+
"css-loader": "^2.0.0",
54+
"cssnano": "^4.1.8",
5555
"dateformat": "^2.0.0",
56-
"electron": "^3.0.0-beta.8",
57-
"electron-builder": "^20.28.0",
58-
"file-loader": "^2.0.0",
56+
"electron": "^4.0.0",
57+
"electron-builder": "^20.38.0",
58+
"file-loader": "^3.0.0",
5959
"history": "^4.7.2",
6060
"html-webpack-plugin": "^3.2.0",
61-
"less": "^3.0.0",
61+
"less": "^3.9.0",
6262
"less-loader": "^4.1.0",
63-
"lodash": "^4.17.0",
64-
"mini-css-extract-plugin": "^0.4.2",
65-
"npm-run-all": "^4.1.2",
66-
"postcss-loader": "^2.0.10",
67-
"postcss-scss": "^1.0.3",
63+
"lodash": "^4.17.11",
64+
"mini-css-extract-plugin": "^0.5.0",
65+
"npm-run-all": "^4.1.5",
66+
"postcss-loader": "^3.0.0",
67+
"postcss-scss": "^2.0.0",
6868
"precss": "^3.0.0",
69-
"prop-types": "^15.6.0",
70-
"react": "^16.4.2",
71-
"react-dom": "^16.4.2",
72-
"react-hot-loader": "^4.3.5",
73-
"react-redux": "^5.0.6",
74-
"react-router": "^4.2.0",
75-
"react-router-dom": "^4.2.2",
76-
"react-router-redux": "^5.0.0-alpha.9",
77-
"redux": "^3.7.2",
78-
"redux-actions": "^2.2.1",
79-
"redux-devtools": "^3.4.1",
69+
"prop-types": "15.6.2",
70+
"react": "16.7.0",
71+
"react-dom": "16.7.0",
72+
"react-hot-loader": "^4.6.3",
73+
"react-redux": "6.0.0",
74+
"react-router": "4.3.1",
75+
"react-router-dom": "4.3.1",
76+
"redux": "^4.0.1",
77+
"redux-actions": "^2.6.4",
78+
"redux-devtools": "^3.5.0",
8079
"redux-devtools-dock-monitor": "^1.1.3",
8180
"redux-devtools-log-monitor": "^1.4.0",
82-
"reselect": "^3.0.1",
81+
"reselect": "^4.0.0",
8382
"rimraf": "^2.6.2",
84-
"style-loader": "^0.23.0",
85-
"uglifyjs-webpack-plugin": "^1.3.0",
86-
"webpack": "^4.16.0",
87-
"webpack-bundle-analyzer": "^2.11.1",
88-
"webpack-cli": "^3.0.0",
89-
"webpack-dev-server": "^3.1.7",
83+
"style-loader": "^0.23.1",
84+
"webpack": "^4.28.2",
85+
"webpack-bundle-analyzer": "^3.0.3",
86+
"webpack-cli": "^3.1.2",
87+
"webpack-dev-server": "^3.1.13",
9088
"wtf-webpack-config": "^0.1.3"
9189
},
9290
"build": {

packages/p2p-chat/src/components/Aside/ChatList/redux.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { push } from 'react-router-redux'
1+
import { push } from 'connected-react-router'
22
import constants from '../../../utils/constants'
33
import createReducer from '../../../utils/createReducer'
44

packages/p2p-chat/src/components/Settings/Login/redux.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ipcRenderer } from 'electron'
2-
import { push } from 'react-router-redux'
2+
import { push } from 'connected-react-router'
33

44
import createReducer from '../../../utils/createReducer'
55
import getConstants from '../../../utils/constants'
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import { combineReducers } from 'redux'
2-
3-
import { routerReducer } from 'react-router-redux'
2+
import { connectRouter } from 'connected-react-router'
43
import settings from '../views/SettingsRedux'
54
import aside from '../views/AsideRedux'
65
import chatting from '../views/ChattingRedux'
76
import modalbtns from '../views/ModalBtnRedux'
87

9-
const appReducer = combineReducers({
10-
settings,
11-
aside,
12-
chatting,
13-
modalbtns,
14-
routing: routerReducer,
15-
})
8+
// const initialState = appReducer({}, {})
169

17-
const initialState = appReducer({}, {})
10+
export default history => {
11+
const appReducer = combineReducers({
12+
settings,
13+
aside,
14+
chatting,
15+
modalbtns,
16+
router: connectRouter(history),
17+
})
1818

19-
export default (state, action) => {
20-
if (action.type === 'LOGOUT') {
21-
const { routing } = state
22-
return { ...initialState, routing }
23-
}
19+
return (state, action) => {
20+
if (action.type === 'LOGOUT') {
21+
window.location.reload()
22+
}
2423

25-
return appReducer(state, action)
24+
return appReducer(state, action)
25+
}
2626
}

packages/p2p-chat/src/global/redux.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createStore, applyMiddleware, compose } from 'redux'
2-
import { routerMiddleware as createRouterMiddleware } from 'react-router-redux'
2+
import { routerMiddleware as createRouterMiddleware } from 'connected-react-router'
33
import createHistory from 'history/createHashHistory'
4-
import rootReducer from './reducer'
4+
import makeReducer from './reducer'
55

66
const history = createHistory()
77
const RouterMiddleware = createRouterMiddleware(history)
@@ -14,11 +14,11 @@ const middlewares = [
1414
const finalCreateStore = compose(...middlewares)(createStore)
1515

1616
const configureStore = initialState => {
17-
const store = finalCreateStore(rootReducer, initialState)
17+
const store = finalCreateStore(makeReducer(history), initialState)
1818

1919
if (process.env.NODE_ENV !== 'production' && module.hot) {
2020
module.hot.accept('./reducer', () => {
21-
store.replaceReducer(rootReducer)
21+
store.replaceReducer(makeReducer(history))
2222
})
2323
}
2424

packages/p2p-chat/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { push } from 'react-router-redux'
1+
import { push } from 'connected-react-router'
22

33
import { configureStore, history } from './global/redux'
44
import ipc from './global/ipc'

packages/p2p-chat/src/layouts/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Provider } from 'react-redux'
33
import PropTypes from 'prop-types'
44
import { Row, Col } from 'antd'
55
import { Route } from 'react-router-dom'
6-
import { ConnectedRouter as Router } from 'react-router-redux'
6+
import { ConnectedRouter as Router } from 'connected-react-router'
77
import { hot } from 'react-hot-loader'
88

99
import SettingNav from '../views/Settings'

packages/p2p-chat/src/postcss.config.js

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

packages/p2p-chat/src/views/Aside.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const selectSortedUsers = createSelector([selectUsers], users =>
2828
sortBy(Object.values(users), byOnline('username'))
2929
)
3030

31-
const selectLocation = state => state.routing.location
31+
const selectLocation = state => state.router.location
3232
const selectCurrent = createSelector([selectLocation], location => {
3333
if (!location) return {}
3434
const match = matchPath(location.pathname, {

postcss.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = ({ file, env }) => ({
2+
parser: file.extname === '.scss' ? 'postcss-scss' : false,
3+
plugins: {
4+
precss: file.extname === '.scss',
5+
cssnano: env === 'production' ? {} : false,
6+
},
7+
})

0 commit comments

Comments
 (0)