Commit b817a22329dc2038d6896282542635e15961b37b
Merge branch 'master' of https://github.com/ahdinosaur/craftworks-todomvc
Don Smith committed on 12/28/2015, 8:28:50 PMParent: 7d964f2bef52e9913aa6872a034f7e967653274b
Parent: d616b061d62dd2c5b590c4c986655fec7d2d4df7
Files changed
README.md | changed |
app/client.js | changed |
app/package.json | changed |
app/routes.js | changed |
app/services/index.js | changed |
app/store.js | changed |
app/actions/index.js | deleted |
app/components/dev-tools.js | deleted |
app/components/landing/index.css | deleted |
app/components/landing/index.js | deleted |
app/dev/root.js | added |
app/dev/tools.js | added |
app/containers/app.js | deleted |
app/containers/dev-root.js | deleted |
app/containers/landing.js | deleted |
app/containers/no-match.js | deleted |
app/containers/todos.js | deleted |
app/features.js | added |
app/four-oh-four/container.js | added |
app/four-oh-four/routes.js | added |
app/reducers/index.js | deleted |
app/reducers/todos.js | deleted |
app/landing/component.js | added |
app/landing/container.js | added |
app/landing/routes.js | added |
app/landing/style.css | added |
app/layout/container.js | added |
app/reducer.js | added |
app/spec.js | added |
app/todos/container.js | added |
app/todos/features/new.feature | added |
app/todos/reducer.js | added |
app/todos/routes.js | added |
package.json | changed |
feature/index.js | deleted |
feature/steps.js | deleted |
spec/index.js | deleted |
README.md | ||
---|---|---|
@@ -18,33 +18,28 @@ | ||
18 | 18 | - `/config/defaults.js` |
19 | 19 | - `/config/{ NODE_ENV }.js` |
20 | 20 | - `/app/` |
21 | 21 | - symlink `/app` to `/node_modules/app` |
22 | - - e.g. | |
23 | 22 | - `/app/package.json` |
24 | 23 | - `/app/client.js` |
25 | 24 | - `/app/server.js` |
25 | + - `/app/reducer.js` | |
26 | 26 | - `/app/routes.js` |
27 | - - `/app/store.js` | |
28 | - - `/app/models/todo.js` | |
29 | - - `/app/services/todos.js` | |
30 | - - `/app/clients/todos.js` | |
31 | - - `/app/actions/todos.js` | |
32 | - - `/app/action-types/todos.js` | |
33 | - - `/app/reducers/todos.js` | |
34 | - - `/app/getters/todos.js` | |
35 | - - `/app/containers/todos.js` | |
36 | - - `/app/components/todos/index.js` | |
37 | - - `/app/components/todos/index.css` | |
38 | - - always require top-down (`require('app/models/todo')`) instead of relative. | |
39 | - - `/spec/` | |
40 | - - e.g. | |
41 | - - `/spec/services/todos.js` | |
42 | - - `/spec/components/todos.js` | |
43 | - - `/features/` | |
44 | - - e.g. | |
45 | - - `/features/steps.js` | |
46 | - - `/features/todos.feature` | |
27 | + - `/app/thing/model.js` | |
28 | + - `/app/thing/service.js` | |
29 | + - `/app/thing/client.js` | |
30 | + - `/app/thing/routes.js` | |
31 | + - `/app/thing/actions.js` | |
32 | + - `/app/thing/reducer.js` | |
33 | + - `/app/thing/getters.js` | |
34 | + - `/app/thing/components/thing-list.js` | |
35 | + - `/app/thing/components/thing-list.css` | |
36 | + - `/app/thing/spec/components/thing-list.js` | |
37 | + - `/app/thing/index.feature` | |
38 | + - `/app/thing/steps.js` | |
39 | + - `/app/list-view/index.js` | |
40 | + - only do relative requires if within module | |
41 | + - otherwise, always require top-down (`require('app/things/model')`). | |
47 | 42 | - data model: [tcomb](https://github.com/gcanti/tcomb) |
48 | 43 | - database: [knex](https://www.npmjs.com/package/knex) |
49 | 44 | - data validator: [tcomb-validator](https://github.com/gcanti/tcomb-validation) |
50 | 45 | - api service: [feathers-knex](https://www.npmjs.com/package/feathers-knex) |
@@ -59,9 +54,9 @@ | ||
59 | 54 | - client store: [redux](https://www.npmjs.com/package/redux) |
60 | 55 | - client router: [redux-router](https://www.npmjs.com/package/redux-router) |
61 | 56 | - client views: [react](https://www.npmjs.com/package/react) |
62 | 57 | - client forms: [tcomb-form](https://github.com/gcanti/tcomb-form) |
63 | -- test specs: [tape](https://www.npmjs.com/package/tape) | |
58 | +- test specs: [ava](https://www.npmjs.com/package/ava) | |
64 | 59 | - test features: [cuke-tap](https://www.npmjs.com/package/cuke-tap) |
65 | 60 | - generators: [plop](https://github.com/amwmedia/plop) |
66 | 61 | |
67 | 62 | refs: [0](http://teropa.info/blog/2015/09/10/full-stack-redux-tutorial.html), [1](http://blog.workshape.io/the-3ree-stack-react-redux-rethinkdb-express-js/) |
app/client.js | ||
---|---|---|
@@ -30,9 +30,9 @@ | ||
30 | 30 | document.querySelector('main') |
31 | 31 | ) |
32 | 32 | |
33 | 33 | if (process.env.NODE_ENV === 'development') { |
34 | - const DevTools = require('app/components/dev-tools') | |
34 | + const DevTools = require('app/dev/tools') | |
35 | 35 | |
36 | 36 | render( |
37 | 37 | <Provider store={store} key="provider"> |
38 | 38 | <div> |
app/package.json | ||
---|---|---|
@@ -4,9 +4,9 @@ | ||
4 | 4 | "./config.js": "./config-browser.js" |
5 | 5 | }, |
6 | 6 | "browserify": { |
7 | 7 | "transform": [ |
8 | - ["cssify", { "modules": true }], | |
8 | + ["cssify", { "modules": true } ], | |
9 | 9 | "babelify", |
10 | 10 | "envify", |
11 | 11 | ["evalify", { "files": [ "config-browser.js" ] } ], |
12 | 12 | "bulkify" |
app/routes.js | ||
---|---|---|
@@ -1,17 +1,24 @@ | ||
1 | 1 | const React = require('react') |
2 | 2 | const { Route, IndexRoute } = require('react-router') |
3 | +const bulk = require('bulk-require') | |
4 | +const { mapObjIndexed, values } = require('ramda') | |
3 | 5 | |
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') | |
6 | +const LayoutContainer = require('app/layout/container') | |
7 | +const FourOhFourRoutes = require('app/four-oh-four/routes') | |
8 | 8 | |
9 | 9 | const routes = ( |
10 | - <Route path='/' component={AppContainer}> | |
11 | - <IndexRoute component={LandingContainer} /> | |
12 | - <Route path='todos' component={TodosContainer} /> | |
13 | - <Route path="*" component={NoMatchContainer} /> | |
10 | + <Route path='/' component={LayoutContainer}> | |
11 | + { | |
12 | + values(mapObjIndexed( | |
13 | + (module, moduleName) => ({ | |
14 | + ...module.routes, | |
15 | + key: moduleName | |
16 | + }), | |
17 | + bulk(__dirname, '!(four-oh-four)/routes.js') | |
18 | + )) | |
19 | + } | |
20 | + { FourOhFourRoutes } | |
14 | 21 | </Route> |
15 | 22 | ) |
16 | 23 | |
17 | 24 | module.exports = routes |
app/services/index.js | ||
---|---|---|
@@ -1,3 +1,10 @@ | ||
1 | 1 | const bulk = require('bulk-require') |
2 | +const { map } = require('ramda') | |
2 | 3 | |
3 | -module.exports = bulk(__dirname, '!(index.js)') | |
4 | +module.exports = { | |
5 | + ...bulk(__dirname, '*/service.js'), | |
6 | + ...map( | |
7 | + (module) => module.services, | |
8 | + bulk(__dirname, '*/services/*.js') | |
9 | + ) | |
10 | +} |
app/store.js | ||
---|---|---|
@@ -1,9 +1,9 @@ | ||
1 | 1 | const { createStore, compose, applyMiddleware } = require('redux') |
2 | 2 | const thunk = require('redux-thunk') |
3 | 3 | const { createHistory } = require('history') |
4 | 4 | |
5 | -const reducer = require('app/reducers') | |
5 | +const reducer = require('app/reducer') | |
6 | 6 | |
7 | 7 | let storeEnhancers = [] |
8 | 8 | let middleware = [] |
9 | 9 | |
@@ -12,9 +12,9 @@ | ||
12 | 12 | if (process.env.NODE_ENV === 'development') { |
13 | 13 | var logger = require('redux-logger') |
14 | 14 | var { persistState } = require('redux-devtools') |
15 | 15 | |
16 | - var DevTools = require('app/components/dev-tools') | |
16 | + var DevTools = require('app/dev/tools') | |
17 | 17 | } |
18 | 18 | |
19 | 19 | storeEnhancers.push( |
20 | 20 | applyMiddleware(...middleware) |
@@ -41,10 +41,10 @@ | ||
41 | 41 | |
42 | 42 | function finalCreateStore(initialState) { |
43 | 43 | |
44 | 44 | if (module.hot) { |
45 | - module.hot.accept('app/reducers', () => { | |
46 | - store.replaceReducer(require('app/reducers')) | |
45 | + module.hot.accept('app/reducer', () => { | |
46 | + store.replaceReducer(require('app/reducer')) | |
47 | 47 | }) |
48 | 48 | } |
49 | 49 | |
50 | 50 | return createEnhancedStore(reducer, initialState) |
app/actions/index.js | ||
---|---|---|
@@ -1,3 +1,0 @@ | ||
1 | -const bulk = require('bulk-require') | |
2 | - | |
3 | -module.exports = bulk(__dirname, '*.js') |
app/components/dev-tools.js | ||
---|---|---|
@@ -1,13 +1,0 @@ | ||
1 | -const React = require('react') | |
2 | -const { createDevTools } = require('redux-devtools') | |
3 | -const LogMonitor = require('redux-devtools-log-monitor').default | |
4 | -const DockMonitor = require('redux-devtools-dock-monitor').default | |
5 | - | |
6 | -const DevTools = createDevTools( | |
7 | - <DockMonitor toggleVisibilityKey='H' | |
8 | - changePositionKey='Q'> | |
9 | - <LogMonitor /> | |
10 | - </DockMonitor> | |
11 | -) | |
12 | - | |
13 | -module.exports = DevTools |
app/components/landing/index.js | ||
---|---|---|
@@ -1,13 +1,0 @@ | ||
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/dev/root.js | ||
---|---|---|
@@ -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/dev/tools.js | ||
---|---|---|
@@ -1,0 +1,13 @@ | ||
1 | +const React = require('react') | |
2 | +const { createDevTools } = require('redux-devtools') | |
3 | +const LogMonitor = require('redux-devtools-log-monitor').default | |
4 | +const DockMonitor = require('redux-devtools-dock-monitor').default | |
5 | + | |
6 | +const DevTools = createDevTools( | |
7 | + <DockMonitor toggleVisibilityKey='H' | |
8 | + changePositionKey='Q'> | |
9 | + <LogMonitor /> | |
10 | + </DockMonitor> | |
11 | +) | |
12 | + | |
13 | +module.exports = DevTools |
app/containers/app.js | ||
---|---|---|
@@ -1,17 +1,0 @@ | ||
1 | -const React = require('react') | |
2 | -const { connect } = require('react-redux') | |
3 | - | |
4 | -class AppContainer extends React.Component { | |
5 | - render () { | |
6 | - const { children } = this.props | |
7 | - | |
8 | - return <div> | |
9 | - <span>hello world!</span> | |
10 | - { children } | |
11 | - </div> | |
12 | - } | |
13 | -} | |
14 | - | |
15 | -module.exports = connect( | |
16 | - (state) => ({}) | |
17 | -)(AppContainer) |
app/containers/dev-root.js | ||
---|---|---|
@@ -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/containers/landing.js | ||
---|---|---|
@@ -1,14 +1,0 @@ | ||
1 | -const React = require('react') | |
2 | -const { connect } = require('react-redux') | |
3 | - | |
4 | -const Landing = require('app/components/landing') | |
5 | - | |
6 | -class LandingContainer extends React.Component { | |
7 | - render () { | |
8 | - return <Landing /> | |
9 | - } | |
10 | -} | |
11 | - | |
12 | -module.exports = connect( | |
13 | - (state) => ({}) | |
14 | -)(LandingContainer) |
app/containers/no-match.js | ||
---|---|---|
@@ -1,14 +1,0 @@ | ||
1 | -const React = require('react') | |
2 | -const { connect } = require('react-redux') | |
3 | - | |
4 | -class NoMatchContainer extends React.Component { | |
5 | - render () { | |
6 | - return <div> | |
7 | - no match! | |
8 | - </div> | |
9 | - } | |
10 | -} | |
11 | - | |
12 | -module.exports = connect( | |
13 | - (state) => ({}) | |
14 | -)(NoMatchContainer) |
app/containers/todos.js | ||
---|---|---|
@@ -1,14 +1,0 @@ | ||
1 | -const React = require('react') | |
2 | -const { connect } = require('react-redux') | |
3 | - | |
4 | -class TodosContainer extends React.Component { | |
5 | - render () { | |
6 | - return <div> | |
7 | - todo list! | |
8 | - </div> | |
9 | - } | |
10 | -} | |
11 | - | |
12 | -module.exports = connect( | |
13 | - (state) => ({}) | |
14 | -)(TodosContainer) |
app/features.js | ||
---|---|---|
@@ -1,0 +1,30 @@ | ||
1 | +const cuke = require('cuke-tap') | |
2 | +const path = require('path') | |
3 | +const glob = require('glob') | |
4 | +const join = require('path').join | |
5 | +const parallel = require('run-parallel') | |
6 | + | |
7 | +parallel([ | |
8 | + function (cb) { | |
9 | + glob('{features/*.feature,*/index.feature,*/features/*.feature}', { cwd: __dirname }, cb) | |
10 | + }, | |
11 | + function (cb) { | |
12 | + glob('{steps/*.js,*/steps.js,*/steps/*.js}', { cwd: __dirname }, cb) | |
13 | + } | |
14 | +], function (err, results) { | |
15 | + if (err) { throw err } | |
16 | + | |
17 | + const features = results[0].map(function (file) { | |
18 | + return join(__dirname, file) | |
19 | + }) | |
20 | + const steps = results[1].map(function (file) { | |
21 | + return require(join(__dirname, file)) | |
22 | + }) | |
23 | + | |
24 | + console.log("features", features) | |
25 | + console.log("steps", steps) | |
26 | + | |
27 | + if (features.length > 0) { | |
28 | + cuke(features, steps) | |
29 | + } | |
30 | +}) |
app/four-oh-four/container.js | ||
---|---|---|
@@ -1,0 +1,14 @@ | ||
1 | +const React = require('react') | |
2 | +const { connect } = require('react-redux') | |
3 | + | |
4 | +class FourOhFourContainer extends React.Component { | |
5 | + render () { | |
6 | + return <div> | |
7 | + no match! | |
8 | + </div> | |
9 | + } | |
10 | +} | |
11 | + | |
12 | +module.exports = connect( | |
13 | + (state) => ({}) | |
14 | +)(FourOhFourContainer) |
app/four-oh-four/routes.js | ||
---|---|---|
@@ -1,0 +1,6 @@ | ||
1 | +const React = require('react') | |
2 | +const { Route } = require('react-router') | |
3 | + | |
4 | +const FourOhFourContainer = require('./container') | |
5 | + | |
6 | +module.exports = <Route path="*" component={FourOhFourContainer} /> |
app/reducers/index.js | ||
---|---|---|
@@ -1,8 +1,0 @@ | ||
1 | -const bulk = require('bulk-require') | |
2 | -const { combineReducers } = require('redux') | |
3 | -const { routeReducer } = require('redux-simple-router') | |
4 | - | |
5 | -module.exports = combineReducers({ | |
6 | - ...bulk(__dirname, '!(index.js)'), | |
7 | - routing: routeReducer | |
8 | -}) |
app/reducers/todos.js | ||
---|---|---|
@@ -1,13 +1,0 @@ | ||
1 | -module.exports = todos | |
2 | - | |
3 | -function todos (state = {}, action) { | |
4 | - switch (action.type) { | |
5 | - case 'CREATE_TODO': | |
6 | - return { | |
7 | - ...state, | |
8 | - [action.payload.id]: action.payload | |
9 | - } | |
10 | - default: | |
11 | - return state | |
12 | - } | |
13 | -} |
app/landing/component.js | ||
---|---|---|
@@ -1,0 +1,13 @@ | ||
1 | +const React = require('react') | |
2 | + | |
3 | +const style = require('./style.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/landing/container.js | ||
---|---|---|
@@ -1,0 +1,14 @@ | ||
1 | +const React = require('react') | |
2 | +const { connect } = require('react-redux') | |
3 | + | |
4 | +const Landing = require('./component') | |
5 | + | |
6 | +class LandingContainer extends React.Component { | |
7 | + render () { | |
8 | + return <Landing /> | |
9 | + } | |
10 | +} | |
11 | + | |
12 | +module.exports = connect( | |
13 | + (state) => ({}) | |
14 | +)(LandingContainer) |
app/landing/routes.js | ||
---|---|---|
@@ -1,0 +1,6 @@ | ||
1 | +const React = require('react') | |
2 | +const { IndexRoute } = require('react-router') | |
3 | + | |
4 | +const LandingContainer = require('./container') | |
5 | + | |
6 | +module.exports = <IndexRoute component={LandingContainer} /> |
app/layout/container.js | ||
---|---|---|
@@ -1,0 +1,17 @@ | ||
1 | +const React = require('react') | |
2 | +const { connect } = require('react-redux') | |
3 | + | |
4 | +class LayoutContainer extends React.Component { | |
5 | + render () { | |
6 | + const { children } = this.props | |
7 | + | |
8 | + return <div> | |
9 | + <span>hello world!</span> | |
10 | + { children } | |
11 | + </div> | |
12 | + } | |
13 | +} | |
14 | + | |
15 | +module.exports = connect( | |
16 | + (state) => ({}) | |
17 | +)(LayoutContainer) |
app/reducer.js | ||
---|---|---|
@@ -1,0 +1,16 @@ | ||
1 | +const bulk = require('bulk-require') | |
2 | +const { combineReducers } = require('redux') | |
3 | +const { routeReducer } = require('redux-simple-router') | |
4 | +const { map } = require('ramda') | |
5 | + | |
6 | +module.exports = combineReducers({ | |
7 | + ...map( | |
8 | + (module) => module.reducer, | |
9 | + bulk(__dirname, '*/reducer.js') | |
10 | + ), | |
11 | + ...map( | |
12 | + (module) => combineReducers(module.reducers), | |
13 | + bulk(__dirname, '*/reducers/*.js') | |
14 | + ), | |
15 | + routing: routeReducer | |
16 | +}) |
app/spec.js | ||
---|---|---|
@@ -1,0 +1,10 @@ | ||
1 | +const ava = require('ava/api') | |
2 | +const glob = require('glob') | |
3 | + | |
4 | +glob('{spec/*.js,*/spec.js,*/spec/*.js}', { cwd: __dirname }, function (err, files) { | |
5 | + if (err) { throw err } | |
6 | + | |
7 | + if (files.length > 0) { | |
8 | + ava(files).run() | |
9 | + } | |
10 | +}) |
app/todos/container.js | ||
---|---|---|
@@ -1,0 +1,14 @@ | ||
1 | +const React = require('react') | |
2 | +const { connect } = require('react-redux') | |
3 | + | |
4 | +class TodosContainer extends React.Component { | |
5 | + render () { | |
6 | + return <div> | |
7 | + todo list! | |
8 | + </div> | |
9 | + } | |
10 | +} | |
11 | + | |
12 | +module.exports = connect( | |
13 | + (state) => ({}) | |
14 | +)(TodosContainer) |
app/todos/features/new.feature | ||
---|---|---|
@@ -1,0 +1,22 @@ | ||
1 | +Feature: New Todo | |
2 | + | |
3 | + Background: | |
4 | + Given I visit TODOMVC | |
5 | + And I make sure that there are no todos | |
6 | + | |
7 | + Scenario: Pressing enter creates the todo | |
8 | + When I enter a new todo | |
9 | + Then it should be appended to the todo list | |
10 | + | |
11 | + Scenario: Pressing enter clears the input | |
12 | + When I enter a new todo | |
13 | + Then the input should be cleared | |
14 | + | |
15 | + Scenario: The input should be trimmed | |
16 | + When I enter a new todo with extra spaces | |
17 | + Then the input should be trimmed | |
18 | + | |
19 | + Scenario: An empty todo should not be added | |
20 | + When I enter a new todo | |
21 | + And I enter a new todo that is empty | |
22 | + Then it should not add it to the list |
app/todos/reducer.js | ||
---|---|---|
@@ -1,0 +1,13 @@ | ||
1 | +module.exports = todos | |
2 | + | |
3 | +function todos (state = {}, action) { | |
4 | + switch (action.type) { | |
5 | + case 'CREATE_TODO': | |
6 | + return { | |
7 | + ...state, | |
8 | + [action.payload.id]: action.payload | |
9 | + } | |
10 | + default: | |
11 | + return state | |
12 | + } | |
13 | +} |
app/todos/routes.js | ||
---|---|---|
@@ -1,0 +1,6 @@ | ||
1 | +const React = require('react') | |
2 | +const { Route } = require('react-router') | |
3 | + | |
4 | +const TodosContainer = require('./container') | |
5 | + | |
6 | +module.exports = <Route path="todos" component={TodosContainer} /> |
package.json | ||
---|---|---|
@@ -7,10 +7,10 @@ | ||
7 | 7 | "postinstall": "lnfs app node_modules/app", |
8 | 8 | "lint": "snazzy", |
9 | 9 | "format": "snazzy --format", |
10 | 10 | "test": "npm-run-all -p test:*", |
11 | - "test:spec": "node spec", | |
12 | - "test:feature": "node feature", | |
11 | + "test:spec": "node app/spec", | |
12 | + "test:feature": "node app/features", | |
13 | 13 | "dev:client": "BABEL_ENV=hot watchify client -o assets/bundle.js -dv -p browserify-hmr", |
14 | 14 | "dev:assets": "cpx \"app/assets/**/*\" assets -w", |
15 | 15 | "dev:server": "node-dev server", |
16 | 16 | "prod:client": "browserify client -o assets/bundle.js -g envify -g uglifyify", |
@@ -46,11 +46,13 @@ | ||
46 | 46 | "node": "^4.0.0", |
47 | 47 | "npm": "^3.0.0" |
48 | 48 | }, |
49 | 49 | "devDependencies": { |
50 | + "ava": "^0.8.0", | |
50 | 51 | "babel-plugin-react-transform": "^2.0.0", |
51 | 52 | "browserify-hmr": "^0.3.1", |
52 | 53 | "cuke-tap": "^1.0.2", |
54 | + "glob": "^6.0.2", | |
53 | 55 | "jsdom": "^7.1.0", |
54 | 56 | "node-dev": "^2.7.1", |
55 | 57 | "react-transform-catch-errors": "^1.0.0", |
56 | 58 | "react-transform-hmr": "^1.0.1", |
@@ -58,9 +60,10 @@ | ||
58 | 60 | "redux-devtools": "^3.0.0", |
59 | 61 | "redux-devtools-dock-monitor": "^1.0.1", |
60 | 62 | "redux-devtools-log-monitor": "^1.0.1", |
61 | 63 | "redux-logger": "^2.0.4", |
62 | - "tape": "^4.2.2", | |
64 | + "run-parallel": "^1.1.4", | |
65 | + "tape": "^4.4.0", | |
63 | 66 | "watchify": "^3.6.1" |
64 | 67 | }, |
65 | 68 | "dependencies": { |
66 | 69 | "babel-core": "^6.2.1", |
@@ -69,14 +72,14 @@ | ||
69 | 72 | "babel-preset-es2015": "^6.1.18", |
70 | 73 | "babel-preset-react": "^6.1.18", |
71 | 74 | "babel-runtime": "^6.2.0", |
72 | 75 | "babelify": "^7.2.0", |
73 | - "browserify": "^12.0.1", | |
76 | + "browserify": "github:ahdinosaur/node-browserify", | |
74 | 77 | "bulk-require": "^0.2.1", |
75 | 78 | "bulkify": "^1.1.1", |
76 | 79 | "cpx": "^1.2.1", |
77 | 80 | "css-modules-require-hook": "^2.1.0", |
78 | - "cssify": "^1.0.2", | |
81 | + "cssify": "github:ahdinosaur/cssify", | |
79 | 82 | "envify": "^3.4.0", |
80 | 83 | "evalify": "^1.0.1", |
81 | 84 | "feathers": "^1.2.0", |
82 | 85 | "history": "^1.13.1", |
feature/index.js | ||
---|---|---|
@@ -1,7 +1,0 @@ | ||
1 | -const cuke = require('cuke-tap') | |
2 | -const path = require('path') | |
3 | - | |
4 | -const features = [ path.join(__dirname, '/feature.feature') ] | |
5 | -const steps = [ require('./steps') ] | |
6 | - | |
7 | -cuke(features, steps) |
feature/steps.js | ||
---|---|---|
@@ -1,11 +1,0 @@ | ||
1 | -const test = require('cuke-tap') | |
2 | -const jsdom = require('jsdom') | |
3 | - | |
4 | -test.given(/^I am on the landing page$/, (t, world, params) => { | |
5 | - t.plan(1) | |
6 | - jsdom.env('http://localhost:9966', (err, window) => { | |
7 | - t.error(err) | |
8 | - world.window = window | |
9 | - t.pass('done') | |
10 | - }) | |
11 | -}) |
spec/index.js |
---|
Built with git-ssb-web