Skip to content

Commit 7d6f40c

Browse files
AllenFangCYBAI
authored andcommitted
Add Redux base (#3)
* redux base * move eslint config to .eslintrc * add .vscode
1 parent a446293 commit 7d6f40c

File tree

7 files changed

+75
-28
lines changed

7 files changed

+75
-28
lines changed

.eslintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "react-app",
3+
"compilerOptions": {
4+
"experimentalDecorators": true
5+
}
6+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public/js/devStyling.js
2020
public/images/
2121

2222
.ungitrc
23+
.vscode
2324

2425
report/
2526
.bin/

package.json

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -72,62 +72,63 @@
7272
},
7373
"devDependencies": {
7474
"ansi-color": "~0.2.1",
75-
"babel-preset-es2015": "~6.24.1",
76-
"babel-preset-stage-0": "~6.24.1",
77-
"browserify": "~14.3.0",
78-
"electron-packager": "~8.6.0",
79-
"expect.js": "~0.3.1",
80-
"grunt": "~1.0.1",
81-
"grunt-babel": "~6.0.0",
82-
"grunt-contrib-clean": "~1.1.0",
83-
"grunt-contrib-copy": "~1.0.0",
84-
"grunt-contrib-imagemin": "~1.0.1",
85-
"grunt-contrib-jshint": "~1.1.0",
86-
"grunt-contrib-less": "~1.4.1",
87-
"grunt-contrib-watch": "~1.0.0",
88-
"grunt-image-embed": "0.3.3",
89-
"grunt-lineending": "~1.0.0",
90-
"grunt-mocha-istanbul": "~5.0.2",
91-
"grunt-mocha-test": "~0.13.2",
92-
"grunt-plato": "~1.4.0",
93-
"grunt-release": "~0.14.0",
94-
"istanbul": "~0.4.5",
95-
"mocha": "~3.3.0",
96-
"phantomjs-prebuilt": "~2.1.14",
97-
"supertest": "~3.0.0",
9875
"autoprefixer": "6.7.2",
9976
"babel-core": "6.22.1",
10077
"babel-eslint": "7.1.1",
10178
"babel-jest": "18.0.0",
10279
"babel-loader": "6.2.10",
80+
"babel-plugin-transform-decorators-legacy": "^1.3.4",
81+
"babel-preset-es2015": "~6.24.1",
10382
"babel-preset-react-app": "^2.2.0",
83+
"babel-preset-stage-0": "~6.24.1",
10484
"babel-runtime": "^6.20.0",
85+
"browserify": "~14.3.0",
10586
"case-sensitive-paths-webpack-plugin": "1.1.4",
10687
"chalk": "1.1.3",
10788
"connect-history-api-fallback": "1.3.0",
10889
"cross-spawn": "4.0.2",
10990
"css-loader": "0.26.1",
11091
"detect-port": "1.1.0",
11192
"dotenv": "2.0.0",
93+
"electron-packager": "~8.6.0",
11294
"eslint": "3.16.1",
11395
"eslint-config-react-app": "^0.6.2",
11496
"eslint-loader": "1.6.0",
11597
"eslint-plugin-flowtype": "2.21.0",
11698
"eslint-plugin-import": "2.0.1",
11799
"eslint-plugin-jsx-a11y": "4.0.0",
118100
"eslint-plugin-react": "6.4.1",
101+
"expect.js": "~0.3.1",
119102
"extract-text-webpack-plugin": "1.0.1",
120103
"file-loader": "0.10.0",
121104
"fs-extra": "0.30.0",
105+
"grunt": "~1.0.1",
106+
"grunt-babel": "~6.0.0",
107+
"grunt-contrib-clean": "~1.1.0",
108+
"grunt-contrib-copy": "~1.0.0",
109+
"grunt-contrib-imagemin": "~1.0.1",
110+
"grunt-contrib-jshint": "~1.1.0",
111+
"grunt-contrib-less": "~1.4.1",
112+
"grunt-contrib-watch": "~1.0.0",
113+
"grunt-image-embed": "0.3.3",
114+
"grunt-lineending": "~1.0.0",
115+
"grunt-mocha-istanbul": "~5.0.2",
116+
"grunt-mocha-test": "~0.13.2",
117+
"grunt-plato": "~1.4.0",
118+
"grunt-release": "~0.14.0",
122119
"html-webpack-plugin": "2.24.0",
123120
"http-proxy-middleware": "0.17.3",
121+
"istanbul": "~0.4.5",
124122
"jest": "18.1.0",
125123
"json-loader": "0.5.4",
124+
"mocha": "~3.3.0",
126125
"object-assign": "4.1.1",
126+
"phantomjs-prebuilt": "~2.1.14",
127127
"postcss-loader": "1.2.2",
128128
"promise": "7.1.1",
129129
"react-dev-utils": "^0.5.2",
130130
"style-loader": "0.13.1",
131+
"supertest": "~3.0.0",
131132
"url-loader": "0.5.7",
132133
"webpack": "1.14.0",
133134
"webpack-dev-server": "1.16.2",
@@ -161,11 +162,11 @@
161162
"babel": {
162163
"presets": [
163164
"react-app"
165+
],
166+
"plugins": [
167+
"transform-decorators-legacy"
164168
]
165169
},
166-
"eslintConfig": {
167-
"extends": "react-app"
168-
},
169170
"window": {
170171
"title": "Ungit",
171172
"icon": "icon.png",

src-react/containers/path.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React, { Component } from 'react';
2+
import { connect } from 'react-redux'
3+
4+
@connect(state => { return { ...state } })
5+
class Path extends Component {
6+
render() {
7+
return (
8+
<div className="App">
9+
<div className="App-header">
10+
<h2>Welcome to { this.props.app }</h2>
11+
</div>
12+
<p className="App-intro">
13+
To get started, edit <code>src/container/Path.js</code> and save to reload.
14+
</p>
15+
</div>
16+
);
17+
}
18+
}
19+
20+
export default Path;

src-react/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import App from './App';
3+
import { Provider } from 'react-redux';
4+
import Path from './containers/path';
5+
import store from './store';
46
import './index.css';
57

68
ReactDOM.render(
7-
<App />,
9+
<Provider store={ store }>
10+
<Path />
11+
</Provider>,
812
document.getElementById('root')
913
);

src-react/reducers/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const initialState = {
2+
app: 'React'
3+
};
4+
5+
const ungitApp = function(state, action) {
6+
return { ...initialState };
7+
}
8+
9+
export default ungitApp;

src-react/store.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { createStore } from 'redux';
2+
import ungitApp from './reducers';
3+
4+
const store = createStore(ungitApp);
5+
6+
export default store;

0 commit comments

Comments
 (0)