Skip to content

Commit 8b1f153

Browse files
committed
Merge pull request reduxjs#1076 from kolodny/gh-demos
Make gh-pages examples runnable
2 parents 9c35fd6 + e9c8328 commit 8b1f153

File tree

17 files changed

+27
-22
lines changed

17 files changed

+27
-22
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
**/dist/*
2+
**/static/*
23
**/node_modules/*
34
**/server.js
45
**/webpack.config*.js

docs/introduction/Examples.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Redux is distributed with a few examples in its [source code](https://github.com
55
>##### Note on Copying
66
>If you copy Redux examples outside their folders, you can delete some lines at the end of their `webpack.config.js` files. They follow a “You can safely delete these lines in your project.” comment.
77
8-
## Counter
8+
## [Counter](examples/counter)
99

1010
Run the [Counter](https://github.com/rackt/redux/tree/master/examples/counter) example:
1111

@@ -24,7 +24,7 @@ It covers:
2424
* Basic Redux flow
2525
* Testing
2626

27-
## TodoMVC
27+
## [TodoMVC](examples/todomvc)
2828

2929
Run the [TodoMVC](https://github.com/rackt/redux/tree/master/examples/todomvc) example:
3030

@@ -44,7 +44,7 @@ It covers:
4444
* Updating nested data
4545
* Testing
4646

47-
## Todos with Undo
47+
## [Todos with Undo](examples/todos-with-undo)
4848

4949
Run the [todos-with-undo](https://github.com/rackt/redux/tree/master/examples/todos-with-undo) example:
5050

@@ -63,7 +63,7 @@ It covers:
6363
* Redux flow with two reducers
6464
* Undo/Redo functionality in Redux with [redux-undo](https://github.com/omnidan/redux-undo)
6565

66-
## Async
66+
## [Async](examples/async)
6767

6868
Run the [Async](https://github.com/rackt/redux/tree/master/examples/async) example:
6969

@@ -103,7 +103,7 @@ It covers:
103103
* Prefetching state based on input and via asynchronous fetches.
104104
* Passing state from the server to the client
105105

106-
## Real World
106+
## [Real World](examples/real-world)
107107

108108
Run the [Real World](https://github.com/rackt/redux/tree/master/examples/real-world) example:
109109

@@ -126,7 +126,7 @@ It covers:
126126
* Pagination
127127
* Routing
128128

129-
## Shopping Cart
129+
## [Shopping Cart](examples/shopping-cart)
130130

131131
Run the [Shopping Cart](https://github.com/rackt/redux/tree/master/examples/shopping-cart) example:
132132

examples/async/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<body>
77
<div id="root">
88
</div>
9-
<script src="/static/bundle.js"></script>
9+
<script src="./static/bundle.js"></script>
1010
</body>
1111
</html>

examples/async/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'./index'
99
],
1010
output: {
11-
path: path.join(__dirname, 'dist'),
11+
path: path.join(__dirname, 'static'),
1212
filename: 'bundle.js',
1313
publicPath: '/static/'
1414
},

examples/counter/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<body>
77
<div id="root">
88
</div>
9-
<script src="/static/bundle.js"></script>
9+
<script src="./static/bundle.js"></script>
1010
</body>
1111
</html>

examples/counter/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'./index'
99
],
1010
output: {
11-
path: path.join(__dirname, 'dist'),
11+
path: path.join(__dirname, 'static'),
1212
filename: 'bundle.js',
1313
publicPath: '/static/'
1414
},

examples/real-world/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<body>
77
<div id="root">
88
</div>
9-
<script src="/static/bundle.js"></script>
9+
<script src="./static/bundle.js"></script>
1010
</body>
1111
</html>

examples/real-world/routes.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { Route } from 'react-router'
2+
import { Route, Redirect } from 'react-router'
33
import App from './containers/App'
44
import UserPage from './containers/UserPage'
55
import RepoPage from './containers/RepoPage'
@@ -10,5 +10,9 @@ export default (
1010
component={RepoPage} />
1111
<Route path="/:login"
1212
component={UserPage} />
13+
14+
{/* needed to get github pages to work */}
15+
<Redirect from="*" to="/" />
16+
1317
</Route>
1418
)

examples/real-world/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'./index'
99
],
1010
output: {
11-
path: path.join(__dirname, 'dist'),
11+
path: path.join(__dirname, 'static'),
1212
filename: 'bundle.js',
1313
publicPath: '/static/'
1414
},

examples/shopping-cart/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<body>
77
<div id="root">
88
</div>
9-
<script src="/static/bundle.js"></script>
9+
<script src="./static/bundle.js"></script>
1010
</body>
1111
</html>

examples/shopping-cart/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'./index'
99
],
1010
output: {
11-
path: path.join(__dirname, 'dist'),
11+
path: path.join(__dirname, 'static'),
1212
filename: 'bundle.js',
1313
publicPath: '/static/'
1414
},

examples/todomvc/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<body>
77
<div class="todoapp" id="root">
88
</div>
9-
<script src="/static/bundle.js"></script>
9+
<script src="./static/bundle.js"></script>
1010
</body>
1111
</html>

examples/todomvc/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"devDependencies": {
2727
"babel-core": "^5.6.18",
28-
"babel-loader": "^5.1.4",
28+
"babel-loader": "^5.4.0",
2929
"babel-plugin-react-transform": "^1.1.0",
3030
"expect": "^1.8.0",
3131
"express": "^4.13.3",
@@ -35,7 +35,7 @@
3535
"raw-loader": "^0.5.1",
3636
"react-addons-test-utils": "^0.14.0",
3737
"react-transform-hmr": "^1.0.0",
38-
"style-loader": "^0.12.3",
38+
"style-loader": "^0.13.0",
3939
"todomvc-app-css": "^2.0.1",
4040
"webpack": "^1.9.11",
4141
"webpack-dev-middleware": "^1.2.0",

examples/todomvc/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'./index'
99
],
1010
output: {
11-
path: path.join(__dirname, 'dist'),
11+
path: path.join(__dirname, 'static'),
1212
filename: 'bundle.js',
1313
publicPath: '/static/'
1414
},

examples/todos-with-undo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<body>
77
<div id="root">
88
</div>
9-
<script src="/static/bundle.js"></script>
9+
<script src="./static/bundle.js"></script>
1010
</body>
1111
</html>

examples/todos-with-undo/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'./index'
99
],
1010
output: {
11-
path: path.join(__dirname, 'dist'),
11+
path: path.join(__dirname, 'static'),
1212
filename: 'bundle.js',
1313
publicPath: '/static/'
1414
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"build:umd": "webpack src/index.js dist/redux.js --config webpack.config.development.js",
2222
"build:umd:min": "webpack src/index.js dist/redux.min.js --config webpack.config.production.js",
2323
"build:examples": "babel-node examples/buildAll.js",
24-
"build": "npm run build:lib && npm run build:umd && npm run build:umd:min",
24+
"build": "npm run build:lib && npm run build:umd && npm run build:umd:min && npm run build:examples",
2525
"preversion": "npm run clean && npm run check",
2626
"version": "npm run build",
2727
"postversion": "git push && git push --tags && npm run clean && npm run docs:publish",

0 commit comments

Comments
 (0)