git ssb

1+

dinoworm ๐Ÿ› / catstack



Commit 7d964f2bef52e9913aa6872a034f7e967653274b

Merged from upstream

Don Smith committed on 12/28/2015, 1:14:07 AM
Parent: 933707b15a97d425b47f252ba48ad6d5643f4550
Parent: 7eb00ba7b58a21dd513f2151dc5ce33c0cd09dca

Files changed

.babelrcchanged
app/components/dev-tools.jschanged
app/components/landing/index.cssadded
app/components/landing/index.jsadded
app/containers/app.jschanged
app/containers/landing.jschanged
app/containers/no-match.jschanged
app/containers/todos.jschanged
app/containers/dev-root.jsadded
app/containers/root.jsdeleted
app/package.jsonchanged
app/routes.jschanged
app/server.jschanged
app/store.jschanged
package.jsonchanged
server.jschanged
assets/.gitkeepadded
.babelrcView
@@ -5,6 +5,22 @@
55 ],
66 "plugins": [
77 "transform-runtime",
88 "transform-object-rest-spread"
9- ]
9+ ],
10+ "env": {
11+ "hot": {
12+ "plugins": [
13+ ["react-transform", {
14+ "transforms": [{
15+ "transform": "react-transform-hmr",
16+ "imports": ["react"],
17+ "locals": ["module"]
18+ }, {
19+ "transform": "react-transform-catch-errors",
20+ "imports": ["react", "redbox-react"]
21+ }]
22+ }]
23+ ]
24+ }
25+ }
1026 }
app/components/dev-tools.jsView
@@ -1,8 +1,8 @@
11 const React = require('react')
22 const { createDevTools } = require('redux-devtools')
3-const LogMonitor = require('redux-devtools-log-monitor')
4-const DockMonitor = require('redux-devtools-dock-monitor')
3+const LogMonitor = require('redux-devtools-log-monitor').default
4+const DockMonitor = require('redux-devtools-dock-monitor').default
55
66 const DevTools = createDevTools(
77 <DockMonitor toggleVisibilityKey='H'
88 changePositionKey='Q'>
app/components/landing/index.cssView
@@ -1,0 +1,3 @@
1+.container {
2+ font-weight: bold;
3+}
app/components/landing/index.jsView
@@ -1,0 +1,13 @@
1+const React = require('react')
2+
3+const style = require('./index.css')
4+
5+class Landing extends React.Component {
6+ render () {
7+ return <div className={style.container}>
8+ landing!
9+ </div>
10+ }
11+}
12+
13+module.exports = Landing
app/containers/app.jsView
@@ -1,8 +1,8 @@
11 const React = require('react')
22 const { connect } = require('react-redux')
33
4-class App extends React.Component {
4+class AppContainer extends React.Component {
55 render () {
66 const { children } = this.props
77
88 return <div>
@@ -12,6 +12,6 @@
1212 }
1313 }
1414
1515 module.exports = connect(
16- (state) => { return {} }
17-)(App)
16+ (state) => ({})
17+)(AppContainer)
app/containers/landing.jsView
@@ -1,14 +1,14 @@
11 const React = require('react')
22 const { connect } = require('react-redux')
33
4-class Landing extends React.Component {
4+const Landing = require('app/components/landing')
5+
6+class LandingContainer extends React.Component {
57 render () {
6- return <div>
7- landing!
8- </div>
8+ return <Landing />
99 }
1010 }
1111
1212 module.exports = connect(
13- (state) => { return {} }
14-)(Landing)
13+ (state) => ({})
14+)(LandingContainer)
app/containers/no-match.jsView
@@ -1,14 +1,14 @@
11 const React = require('react')
22 const { connect } = require('react-redux')
33
4-class NoMatch extends React.Component {
4+class NoMatchContainer extends React.Component {
55 render () {
66 return <div>
77 no match!
88 </div>
99 }
1010 }
1111
1212 module.exports = connect(
13- (state) => { return {} }
14-)(NoMatch)
13+ (state) => ({})
14+)(NoMatchContainer)
app/containers/todos.jsView
@@ -1,14 +1,14 @@
11 const React = require('react')
22 const { connect } = require('react-redux')
33
4-class Todos extends React.Component {
4+class TodosContainer extends React.Component {
55 render () {
66 return <div>
77 todo list!
88 </div>
99 }
1010 }
1111
1212 module.exports = connect(
13- (state) => { return {} }
14-)(Todos)
13+ (state) => ({})
14+)(TodosContainer)
app/containers/dev-root.jsView
@@ -1,0 +1,31 @@
1+const React = require('react')
2+const { Provider } = require('react-redux')
3+const { ReduxRouter } = require('redux-router')
4+
5+const routes = require('app/routes')
6+
7+if (process.env.NODE_ENV === 'development') {
8+ var DevTools = require('app/components/dev-tools')
9+}
10+
11+class Root extends React.Component {
12+ render() {
13+ const { store } = this.props;
14+
15+ return (
16+ <Provider store={store}>
17+ <div>
18+ <ReduxRouter>
19+ { routes }
20+ </ReduxRouter>
21+ {
22+ (process.env.NODE_ENV === 'development') ?
23+ <DevTools /> : null
24+ }
25+ </div>
26+ </Provider>
27+ )
28+ }
29+}
30+
31+module.exports = Root
app/containers/root.jsView
@@ -1,31 +1,0 @@
1-const React = require('react')
2-const { Provider } = require('react-redux')
3-const { ReduxRouter } = require('redux-router')
4-
5-const routes = require('app/routes')
6-
7-if (process.env.NODE_ENV === 'development') {
8- var DevTools = require('app/components/dev-tools')
9-}
10-
11-class Root extends React.Component {
12- render() {
13- const { store } = this.props;
14-
15- return (
16- <Provider store={store}>
17- <div>
18- <ReduxRouter>
19- { routes }
20- </ReduxRouter>
21- {
22- (process.env.NODE_ENV === 'development') ?
23- <DevTools /> : null
24- }
25- </div>
26- </Provider>
27- )
28- }
29-}
30-
31-module.exports = Root
app/package.jsonView
@@ -4,12 +4,12 @@
44 "./config.js": "./config-browser.js"
55 },
66 "browserify": {
77 "transform": [
8+ ["cssify", { "modules": true }],
89 "babelify",
910 "envify",
1011 ["evalify", { "files": [ "config-browser.js" ] } ],
11- "bulkify",
12- "sheetify/transform"
12+ "bulkify"
1313 ]
1414 }
1515 }
app/routes.jsView
@@ -1,17 +1,17 @@
11 const React = require('react')
22 const { Route, IndexRoute } = require('react-router')
33
4-const App = require('app/containers/app')
5-const Landing = require('app/containers/landing')
6-const Todos = require('app/containers/todos')
7-const NoMatch = require('app/containers/no-match')
4+const AppContainer = require('app/containers/app')
5+const LandingContainer = require('app/containers/landing')
6+const TodosContainer = require('app/containers/todos')
7+const NoMatchContainer = require('app/containers/no-match')
88
99 const routes = (
10- <Route path='/' component={App}>
11- <IndexRoute component={Landing} />
12- <Route path='todos' component={Todos} />
13- <Route path="*" component={NoMatch} />
10+ <Route path='/' component={AppContainer}>
11+ <IndexRoute component={LandingContainer} />
12+ <Route path='todos' component={TodosContainer} />
13+ <Route path="*" component={NoMatchContainer} />
1414 </Route>
1515 )
1616
1717 module.exports = routes
app/server.jsView
@@ -1,6 +1,4 @@
1-const { mapObjIndexed, reduce, toPairs } = require('ramda')
2-
31 const createStack = require('app/stack')
42
53 module.exports = createServer
64
app/store.jsView
@@ -39,8 +39,15 @@
3939 ...storeEnhancers
4040 )(createStore)
4141
4242 function finalCreateStore(initialState) {
43+
44+ if (module.hot) {
45+ module.hot.accept('app/reducers', () => {
46+ store.replaceReducer(require('app/reducers'))
47+ })
48+ }
49+
4350 return createEnhancedStore(reducer, initialState)
4451 }
4552
4653 module.exports = finalCreateStore
package.jsonView
@@ -1,17 +1,17 @@
11 {
22 "name": "craftworks-todomvc",
33 "version": "0.0.0",
44 "description": "real-world production-quality TodoMVC example",
5- "main": "index.js",
5+ "main": "server",
66 "scripts": {
77 "postinstall": "lnfs app node_modules/app",
88 "lint": "snazzy",
99 "format": "snazzy --format",
10- "test": "(npm run spec & npm run feature)",
11- "spec": "node spec",
12- "feature": "node feature",
13- "dev:client": "watchify client -o assets/bundle.js -dv",
10+ "test": "npm-run-all -p test:*",
11+ "test:spec": "node spec",
12+ "test:feature": "node feature",
13+ "dev:client": "BABEL_ENV=hot watchify client -o assets/bundle.js -dv -p browserify-hmr",
1414 "dev:assets": "cpx \"app/assets/**/*\" assets -w",
1515 "dev:server": "node-dev server",
1616 "prod:client": "browserify client -o assets/bundle.js -g envify -g uglifyify",
1717 "prod:assets": "cpx \"app/assets/**/*\" assets",
@@ -46,11 +46,16 @@
4646 "node": "^4.0.0",
4747 "npm": "^3.0.0"
4848 },
4949 "devDependencies": {
50+ "babel-plugin-react-transform": "^2.0.0",
51+ "browserify-hmr": "^0.3.1",
5052 "cuke-tap": "^1.0.2",
5153 "jsdom": "^7.1.0",
5254 "node-dev": "^2.7.1",
55+ "react-transform-catch-errors": "^1.0.0",
56+ "react-transform-hmr": "^1.0.1",
57+ "redbox-react": "^1.2.0",
5358 "redux-devtools": "^3.0.0",
5459 "redux-devtools-dock-monitor": "^1.0.1",
5560 "redux-devtools-log-monitor": "^1.0.1",
5661 "redux-logger": "^2.0.4",
@@ -68,8 +73,10 @@
6873 "browserify": "^12.0.1",
6974 "bulk-require": "^0.2.1",
7075 "bulkify": "^1.1.1",
7176 "cpx": "^1.2.1",
77+ "css-modules-require-hook": "^2.1.0",
78+ "cssify": "^1.0.2",
7279 "envify": "^3.4.0",
7380 "evalify": "^1.0.1",
7481 "feathers": "^1.2.0",
7582 "history": "^1.13.1",
@@ -84,8 +91,7 @@
8491 "redux": "^3.0.5",
8592 "redux-simple-router": "0.0.10",
8693 "redux-thunk": "^1.0.0",
8794 "serve-static": "^1.10.0",
88- "sheetify": "^3.1.0",
8995 "uglifyify": "^3.0.1"
9096 }
9197 }
server.jsView
@@ -1,5 +1,6 @@
11 require('babel-core/register')
2+require('css-modules-require-hook')
23
34 const createServer = require('app/server')
45 const config = require('app/config')
56
assets/.gitkeepView

Built with git-ssb-web