|
| 1 | +##Project Setup |
| 2 | +Getting your project directory setup. |
| 3 | + |
| 4 | +1. Install package dependencies |
| 5 | +2. Create an output directory called "dist" |
| 6 | +3. Install "concurrently" & "browser-sync" globally |
| 7 | +4. Run our app in the browser |
| 8 | + |
| 9 | +You may want to consider installing the atom package["platformio-ide-terminal"](https://github.com/platformio/platformio-atom-ide-terminal), which provides a terminal inside your editor. |
| 10 | + |
| 11 | ++ in a terminal run`> npm run setup` |
| 12 | +@test('01/01') |
| 13 | +@hint('in a terminal run`npm run setup` to get setup') |
| 14 | +@action(open('package.json')) |
| 15 | +@action(set( |
| 16 | +``` |
| 17 | +{ |
| 18 | + "name": "coderoad-redux-js", |
| 19 | + "version": "0.1.0", |
| 20 | + "description": "Coderoad tutorial for using redux with raw javascript", |
| 21 | + "bugs": { |
| 22 | + "url": "https://github.com/shmck/coderoad-redux-js" |
| 23 | + }, |
| 24 | + "license": "ISC", |
| 25 | + "author": "Shawn McKay <shawn.j.mckay@gmail.com>", |
| 26 | + "main": "index.js", |
| 27 | + "repository": "https://github.com/shmck/coderoad-redux-js", |
| 28 | + "scripts": { |
| 29 | + "test": "echo \"Error: no test specified\" && exit 1" |
| 30 | + }, |
| 31 | + "config": { |
| 32 | + "language": "JS", |
| 33 | + "runner": "mocha-coderoad" |
| 34 | + }, |
| 35 | + "dependencies": { |
| 36 | + "mocha-coderoad": "latest" |
| 37 | + }, |
| 38 | + "devDependencies": { |
| 39 | + "babel-preset-es2015": "^6.9.0", |
| 40 | + "babel-preset-react": "^6.11.1", |
| 41 | + "babelify": "^7.3.0", |
| 42 | + "browser-sync": "^2.13.0", |
| 43 | + "concurrently": "^2.2.0", |
| 44 | + "npm-watch": "^0.1.5" |
| 45 | + }, |
| 46 | + "watch": { |
| 47 | + "reload": { |
| 48 | + "patterns": [ |
| 49 | + "src" |
| 50 | + ], |
| 51 | + "extensions": "js,jsx,css,html,scss", |
| 52 | + "ignore": "node_modules", |
| 53 | + "quiet": false |
| 54 | + } |
| 55 | + }, |
| 56 | + "scripts": { |
| 57 | + "browserify": "browserify src/index.js --extension=.jsx -o dist/bundle.js -t [ babelify --presets [ es2015 react ] ]", |
| 58 | + "browsersync:reload": "browser-sync reload", |
| 59 | + "browsersync:start": "browser-sync start --server --files 'index.html dist/bundle.js'", |
| 60 | + "build": "npm run browserify", |
| 61 | + "reload": "npm run browserify && npm run browsersync:reload", |
| 62 | + "start": "concurrently --kill-others 'npm run build' 'npm run browsersync:start' 'npm run watch'", |
| 63 | + "test": "echo \"Error: no test specified\" && exit 1", |
| 64 | + "watch": "npm-watch", |
| 65 | + "setup": "npm install && mkdir -p dist && npm i -g concurrently browser-sync && npm start" |
| 66 | + } |
| 67 | +} |
| 68 | +``` |
| 69 | +)) |
| 70 | + |
| 71 | +@onPageComplete('Continue to start working with Redux') |