Skip to content

Commit d9c696d

Browse files
committed
outline steps 1 and 2
1 parent 4443e01 commit d9c696d

File tree

7 files changed

+16
-13
lines changed

7 files changed

+16
-13
lines changed

coderoad.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
],
1919
"actions": [
2020
"open('package.json')",
21-
"set('{\n \"name\": \"coderoad-redux-js\",\n \"version\": \"0.1.0\",\n \"description\": \"Coderoad tutorial for using redux with raw javascript\",\n \"bugs\": {\n \"url\": \"https://github.com/shmck/coderoad-redux-js\"\n },\n \"license\": \"ISC\",\n \"author\": \"Shawn McKay <shawn.j.mckay@gmail.com>\",\n \"main\": \"index.js\",\n \"repository\": \"https://github.com/shmck/coderoad-redux-js\",\n \"scripts\": {\n \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n },\n \"dependencies\": {\n \"mocha-coderoad\": \"latest\"\n },\n \"devDependencies\": {\n \"babel-preset-es2015\": \"^6.9.0\",\n \"babel-preset-react\": \"^6.11.1\",\n \"babelify\": \"^7.3.0\",\n \"browser-sync\": \"^2.13.0\",\n \"concurrently\": \"^2.2.0\",\n \"npm-watch\": \"^0.1.5\",\n \"coderoad-redux-js\": \"^0.1.0\"\n },\n \"watch\": {\n \"reload\": {\n \"patterns\": [\n \"src\"\n ],\n \"extensions\": \"js,jsx,css,html,scss\",\n \"ignore\": \"node_modules\",\n \"quiet\": false\n }\n },\n \"scripts\": {\n \"browserify\": \"browserify src/index.js --extension=.jsx -o dist/bundle.js -t [ babelify --presets [ es2015 react ] ]\",\n \"browsersync:reload\": \"browser-sync reload\",\n \"browsersync:start\": \"browser-sync start --server --files 'index.html dist/bundle.js'\",\n \"build\": \"npm run browserify\",\n \"reload\": \"npm run browserify && npm run browsersync:reload\",\n \"start\": \"concurrently --kill-others 'npm run build' 'npm run browsersync:start' 'npm run watch'\",\n \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n \"watch\": \"npm-watch\",\n \"setup\": \"npm install && mkdir -p dist && npm i -g concurrently browser-sync && npm start\"\n }\n}\n')"
21+
"set('{\n \"name\": \"coderoad-redux-js\",\n \"version\": \"0.1.0\",\n \"description\": \"Coderoad tutorial for using redux with raw javascript\",\n \"bugs\": {\n \"url\": \"https://github.com/shmck/coderoad-redux-js\"\n },\n \"license\": \"ISC\",\n \"author\": \"Shawn McKay <shawn.j.mckay@gmail.com>\",\n \"main\": \"index.js\",\n \"repository\": \"https://github.com/shmck/coderoad-redux-js\",\n \"scripts\": {\n \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n },\n \"dependencies\": {\n \"mocha-coderoad\": \"0.9.0\"\n },\n \"devDependencies\": {\n \"babel-preset-es2015\": \"^6.9.0\",\n \"babel-preset-react\": \"^6.11.1\",\n \"babelify\": \"^7.3.0\",\n \"browser-sync\": \"^2.13.0\",\n \"concurrently\": \"^2.2.0\",\n \"npm-watch\": \"^0.1.5\",\n \"coderoad-redux-js\": \"^0.1.0\"\n },\n \"watch\": {\n \"reload\": {\n \"patterns\": [\n \"src\"\n ],\n \"extensions\": \"js,jsx,css,html,scss\",\n \"ignore\": \"node_modules\",\n \"quiet\": false\n }\n },\n \"scripts\": {\n \"browserify\": \"browserify src/index.js --extension=.jsx -o dist/bundle.js -t [ babelify --presets [ es2015 react ] ]\",\n \"browsersync:reload\": \"browser-sync reload\",\n \"browsersync:start\": \"browser-sync start --server --files 'index.html dist/bundle.js'\",\n \"build\": \"npm run browserify\",\n \"reload\": \"npm run browserify && npm run browsersync:reload\",\n \"start\": \"concurrently --kill-others 'npm run build' 'npm run browsersync:start' 'npm run watch'\",\n \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n \"watch\": \"npm-watch\",\n \"setup\": \"npm install && mkdir -p dist && npm i -g concurrently browser-sync && npm start\"\n }\n}\n')"
2222
]
2323
}
2424
],
@@ -29,7 +29,7 @@
2929
"description": "The \"single source of truth\".\n\n```js\nconst store = createStore(reducer, initialState);\n```",
3030
"tasks": [
3131
{
32-
"description": "install Redux. Run `npm install redux`.",
32+
"description": "install Redux. Run `npm install --save redux`.",
3333
"actions": [
3434
"open('index.js')"
3535
],
@@ -38,7 +38,7 @@
3838
]
3939
},
4040
{
41-
"description": "import { createStore } from 'redux';",
41+
"description": "import createStore. `import { createStore } from 'redux';`",
4242
"tests": [
4343
"02/02"
4444
]
@@ -55,7 +55,8 @@
5555
"02/04"
5656
]
5757
}
58-
]
58+
],
59+
"onPageComplete": "As you can see, the store is just an object with various methods like \"dispatch\" and \"getState\". Let's see what these methods do in the next step."
5960
}
6061
]
6162
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
"edit": true
2121
},
2222
"dependencies": {
23-
"mocha-coderoad": "0.9.0"
23+
"mocha-coderoad": "0.9.1"
2424
}
2525
}

tutorial/01/01.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
var expect = require('chai').expect;
22

3-
/// load('index.js')
4-
53
describe('01 setup', () => {
64

75
it('dist directory doesn\'t exist. Run `npm run setup`', () => {

tutorial/01/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ We'll be installing a lot of scripts from terminal. You may also want to conside
3838
"test": "echo \"Error: no test specified\" && exit 1"
3939
},
4040
"dependencies": {
41-
"mocha-coderoad": "latest"
41+
"mocha-coderoad": "0.9.0"
4242
},
4343
"devDependencies": {
4444
"babel-preset-es2015": "^6.9.0",

tutorial/02/01.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ var spies = require('chai-spies');
33
var expect = chai.expect;
44
chai.use(spies);
55

6+
var spy = chai.spy.on(console, 'log');
7+
8+
/// load('index.js')
9+
610
describe('01 Redux', () => {
711

812
it('isn\'t installed', () => {

tutorial/02/04.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
var spy = chai.spy.on(console, 'log');
2-
31
describe('04 log store', () => {
42

53
it('isn\'t logged to the console. `console.log(store)`', () => {
6-
expect(spy).to.have.been.called.with(store);
4+
expect(spy).to.have.been.called();
75
});
86

97
});

tutorial/02/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ The "single source of truth".
55
const store = createStore(reducer, initialState);
66
```
77

8-
+ install Redux. Run `npm install redux`.
8+
+ install Redux. Run `npm install --save redux`.
99
@action(open('index.js'))
1010
@test('02/01')
1111

12-
+ `import { createStore } from 'redux';`
12+
+ import createStore. `import { createStore } from 'redux';`
1313
@test('02/02')
1414

1515
+ create your first store and call it `store`. Use a simple "reducer" function for now, let's say `state => state`.
1616
@test('02/03')
1717

1818
+ log your store to the console and have a look.
1919
@test('02/04')
20+
21+
@onPageComplete('As you can see, the store is just an object with various methods like "dispatch" and "getState". Let's see what these methods do in the next step.')

0 commit comments

Comments
 (0)