Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit d42dcff

Browse files
committed
v1.0.1
1 parent d87f75e commit d42dcff

12 files changed

Lines changed: 113 additions & 85 deletions

File tree

.wooorc

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

lib/index.js

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,42 +40,33 @@ exports.default = function () {
4040

4141
case 2:
4242
args = _context.sent;
43-
44-
console.log('args:', args);
45-
46-
_context.next = 6;
43+
_context.next = 5;
4744
return (0, _options2.default)(args);
4845

49-
case 6:
46+
case 5:
5047
options = _context.sent;
51-
52-
console.log('options:', options);
53-
54-
_context.next = 10;
48+
_context.next = 8;
5549
return (0, _dependencies.prepare)(options);
5650

57-
case 10:
51+
case 8:
5852
prepared = _context.sent;
59-
60-
console.log('prepared:', prepared);
61-
62-
_context.next = 14;
53+
_context.next = 11;
6354
return (0, _dependencies.install)(prepared);
6455

65-
case 14:
56+
case 11:
6657
installed = _context.sent;
67-
_context.next = 17;
58+
_context.next = 14;
6859
return (0, _files2.default)(options);
6960

70-
case 17:
61+
case 14:
7162
created = _context.sent;
7263

7364

7465
(0, _clear2.default)();
7566

7667
console.log(created);
7768

78-
case 20:
69+
case 17:
7970
case 'end':
8071
return _context.stop();
8172
}

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "redux-wooo",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Add redux scaffolding into your folder without pain.",
55
"main": "lib/index.js",
66
"repository": {
@@ -27,11 +27,13 @@
2727
"babel-polyfill": "^6.23.0",
2828
"babel-preset-env": "^1.4.0",
2929
"babel-preset-stage-0": "^6.24.1",
30+
"mocha": "^3.3.0",
31+
"prettier": "^1.2.2"
32+
},
33+
"dependencies": {
3034
"chalk": "^1.1.3",
3135
"clear": "^0.0.1",
3236
"fs-extra": "^3.0.0",
33-
"mocha": "^3.3.0",
34-
"prettier": "^1.2.2",
3537
"yargs": "^7.1.0"
3638
}
3739
}

src/index.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,9 @@ import clear from 'clear';
77

88
export default async function wooo() {
99
const args = await argv();
10-
console.log('args:', args);
11-
1210
const options = await checkOptions(args);
13-
console.log('options:', options);
14-
1511
const prepared = await prepare(options);
16-
console.log('prepared:', prepared);
17-
1812
const installed = await install(prepared);
19-
2013
const created = await createFiles(options);
2114

2215
clear();

templates/default/static/index.css

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

1111
body {
1212
-webkit-font-smoothing: antialiased;
13-
background: #fff;
14-
color: #212529;
13+
font-family: sans-serif;
14+
font-size: 14px;
15+
font-weight: 300;
1516
line-height: 1.5;
17+
margin: 0;
18+
}
19+
20+
h1,
21+
h2,
22+
h3,
23+
h4,
24+
h5,
25+
h6,
26+
ul,
27+
li,
28+
ol,
29+
p,
30+
a {
31+
margin: 0;
1632
}

templates/default/static/normalize.css

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,23 @@
1-
/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */
1+
/*! normalize.css v6.0.0 | MIT License | github.com/necolas/normalize.css */
22

33
/* Document
44
========================================================================== */
55

66
/**
7-
* 1. Change the default font family in all browsers (opinionated).
8-
* 2. Correct the line height in all browsers.
9-
* 3. Prevent adjustments of font size after orientation changes in
7+
* 1. Correct the line height in all browsers.
8+
* 2. Prevent adjustments of font size after orientation changes in
109
* IE on Windows Phone and in iOS.
1110
*/
1211

1312
html {
14-
font-family: sans-serif; /* 1 */
15-
line-height: 1.15; /* 2 */
16-
-ms-text-size-adjust: 100%; /* 3 */
17-
-webkit-text-size-adjust: 100%; /* 3 */
13+
line-height: 1.15; /* 1 */
14+
-ms-text-size-adjust: 100%; /* 2 */
15+
-webkit-text-size-adjust: 100%; /* 2 */
1816
}
1917

2018
/* Sections
2119
========================================================================== */
2220

23-
/**
24-
* Remove the margin in all browsers (opinionated).
25-
*/
26-
27-
body {
28-
margin: 0;
29-
}
30-
3121
/**
3222
* Add the correct display in IE 9-.
3323
*/
@@ -108,17 +98,7 @@ a {
10898
}
10999

110100
/**
111-
* Remove the outline on focused links when they are also active or hovered
112-
* in all browsers (opinionated).
113-
*/
114-
115-
a:active,
116-
a:hover {
117-
outline-width: 0;
118-
}
119-
120-
/**
121-
* 1. Remove the bottom border in Firefox 39-.
101+
* 1. Remove the bottom border in Chrome 57- and Firefox 39-.
122102
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
123103
*/
124104

@@ -245,19 +225,15 @@ svg:not(:root) {
245225
========================================================================== */
246226

247227
/**
248-
* 1. Change the font styles in all browsers (opinionated).
249-
* 2. Remove the margin in Firefox and Safari.
228+
* Remove the margin in Firefox and Safari.
250229
*/
251230

252231
button,
253232
input,
254233
optgroup,
255234
select,
256235
textarea {
257-
font-family: sans-serif; /* 1 */
258-
font-size: 100%; /* 1 */
259-
line-height: 1.15; /* 1 */
260-
margin: 0; /* 2 */
236+
margin: 0;
261237
}
262238

263239
/**
@@ -316,16 +292,6 @@ button:-moz-focusring,
316292
outline: 1px dotted ButtonText;
317293
}
318294

319-
/**
320-
* Change the border, margin, and padding in all browsers (opinionated).
321-
*/
322-
323-
fieldset {
324-
border: 1px solid #c0c0c0;
325-
margin: 0 2px;
326-
padding: 0.35em 0.625em 0.75em;
327-
}
328-
329295
/**
330296
* 1. Correct the text wrapping in Edge and IE.
331297
* 2. Correct the color inheritance from `fieldset` elements in IE.
Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
11
import React, { PureComponent } from 'react';
22
import { connect } from 'react-redux';
3+
import { fakeLogin } from '../../modules/user';
34
import './index.css';
45

56
class Home extends PureComponent {
67
render() {
8+
const { name, isAuthenticated } = this.props.user;
9+
const { fakeLogin } = this.props;
10+
711
return (
812
<div>
9-
<h2>Hello</h2>
13+
{isAuthenticated
14+
? (
15+
<div>
16+
<h2>Hello, {name}</h2>
17+
</div>
18+
) : (
19+
<div>
20+
<h2>Hello</h2>
21+
<button onClick={fakeLogin}>Login</button>
22+
</div>
23+
)
24+
}
1025
</div>
1126
);
1227
}
1328
}
1429

15-
export default connect(
16-
state => state,
17-
)(Home);
30+
export default connect(({ user }) => ({ user }), {
31+
fakeLogin
32+
})(Home);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { combineReducers } from 'redux';
22
import { routerReducer } from 'react-router-redux';
3+
import user from './user';
34

45
export default combineReducers({
6+
user,
57
router: routerReducer
68
});
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
const USER_LOGGED_IN = 'app/user/USER_LOGGED_IN';
2+
const USER_LOGGED_OUT = 'app/user/USER_LOGGED_OUT';
3+
4+
const initialState = {
5+
avatar: null,
6+
isAuthenticated: false,
7+
name: null,
8+
points: null,
9+
rank_group: null
10+
}
11+
12+
export default function user (state = initialState, action) {
13+
switch (action.type) {
14+
case USER_LOGGED_IN:
15+
return {
16+
...state,
17+
isAuthenticated: true,
18+
19+
// spread over payload, instead of manually adding each key
20+
...action.payload
21+
}
22+
23+
case USER_LOGGED_OUT:
24+
return initialState
25+
26+
default:
27+
return state;
28+
}
29+
}
30+
31+
export function fakeLogin () {
32+
return dispatch => {
33+
setTimeout(() => {
34+
dispatch({
35+
type: USER_LOGGED_IN,
36+
payload: {
37+
avatar: '//placecage.com/200/200',
38+
name: 'UserName',
39+
points: 1337,
40+
rank_group: 5
41+
}
42+
})
43+
}, 2000); // fake db delay
44+
}
45+
}

templates/react-router-4/static/index.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
}
1010

1111
body {
12+
-webkit-font-smoothing: antialiased;
1213
font-family: sans-serif;
14+
font-size: 14px;
1315
font-weight: 300;
1416
line-height: 1.5;
15-
font-size: 14px;
1617
margin: 0;
1718
}
1819

0 commit comments

Comments
 (0)