Skip to content

Commit 4aaad42

Browse files
committed
Merge pull request #156 from aldanor/feature/more-example-fixes
A few more examples fixes
2 parents c8b7074 + bf85566 commit 4aaad42

File tree

4 files changed

+25
-23
lines changed

4 files changed

+25
-23
lines changed

examples/rest-api/README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@
22

33
This example shows how to build a generic Rest API module for NuclearJS's flux architecture.
44

5-
## Running the example
5+
## Running
66

7-
The built files are already checked in, simply open `index.html` to see the example. Make sure you open the console to see the actions being dispatched.
7+
You must have [npm](https://www.npmjs.org/) installed on your computer.
8+
From the root project directory run these commands from the command line:
89

9-
**To watch/rebuild**
10+
`npm install`
1011

11-
```sh
12-
npm run watch
13-
```
12+
This will install all dependencies.
13+
14+
To build the project, first run this command:
15+
16+
`npm start`
17+
18+
After starting the watcher, you can open `index.html` in your browser to
19+
open the app.
1420

1521
## Architecture
1622

examples/rest-api/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"main": "index.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
8-
"build": "`npm bin`/webpack --progress --colors",
9-
"watch": "`npm bin`/webpack --watch --progress --colors"
8+
"start": "./node_modules/webpack/bin/webpack.js --watch --progress"
109
},
1110
"author": "",
1211
"license": "ISC",

examples/shopping-cart/README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ See [NuclearJS: Getting Started](https://optimizely.github.io/nuclear-js/docs/01
44

55
Taken (and slightly modified) from [https://github.com/voronianski/flux-comparison](https://github.com/voronianski/flux-comparison)
66

7-
## To Run
7+
## Running
88

9-
The compiled files are checked in simply, open the `index.html` file
9+
You must have [npm](https://www.npmjs.org/) installed on your computer.
10+
From the root project directory run these commands from the command line:
1011

11-
## To modify
12+
`npm install`
1213

13-
**Start the webpack watch task:**
14+
This will install all dependencies.
1415

15-
```sh
16-
webpack -w
17-
```
16+
To build the project, first run this command:
17+
18+
`npm start`
19+
20+
After starting the watcher, you can open `index.html` in your browser to
21+
open the app.

examples/shopping-cart/package.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
{
22
"main": "js/app.js",
33
"scripts": {
4-
"start": "../node_modules/watchify/bin/cmd.js js/app.js -o build/bundle.js -v -d",
5-
"build": "browserify js/app.js > build/bundle.js"
6-
},
7-
"browserify": {
8-
"transform": [
9-
"babelify",
10-
"envify"
11-
]
4+
"start": "./node_modules/webpack/bin/webpack.js --watch --progress"
125
},
136
"dependencies": {
147
"nuclear-js": "^1.0.5",

0 commit comments

Comments
 (0)