Skip to content

Commit 5f784e9

Browse files
committed
Restore example build scripts.
1 parent 5b97e75 commit 5f784e9

File tree

6 files changed

+31
-37
lines changed

6 files changed

+31
-37
lines changed
File renamed without changes.

examples/buildAll.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Runs an ordered set of commands within each of the build directories.
3+
*/
4+
5+
import fs from 'fs'
6+
import path from 'path'
7+
import { spawnSync } from 'child_process'
8+
9+
var exampleDirs = fs.readdirSync(__dirname).filter((file) => {
10+
return fs.statSync(path.join(__dirname, file)).isDirectory()
11+
})
12+
13+
for (const dir of exampleDirs) {
14+
// declare opts in this scope to avoid https://github.com/joyent/node/issues/9158
15+
const opts = {
16+
cwd: path.join(__dirname, dir),
17+
stdio: 'inherit'
18+
}
19+
20+
let result = {}
21+
if (process.platform === 'win32') {
22+
result = spawnSync('npm.cmd', [ 'install' ], opts)
23+
} else {
24+
result = spawnSync('npm', [ 'install' ], opts)
25+
}
26+
if (result.status !== 0) {
27+
throw new Error('Building examples exited with non-zero')
28+
}
29+
}
File renamed without changes.

examples/todos/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"devDependencies": {
66
"enzyme": "^2.4.1",
7+
"react-addons-test-utils": "^15.3.0",
78
"react-scripts": "0.3.0-alpha"
89
},
910
"dependencies": {

examples_old/buildAll.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"test:cov": "cross-env BABEL_ENV=commonjs babel-node $(npm bin)/isparta cover $(npm bin)/_mocha -- --recursive",
2424
"test:examples": "cross-env BABEL_ENV=commonjs babel-node examples/testAll.js",
2525
"check:src": "npm run lint:src && npm run test",
26-
"check:examples": "npm run build:examples && npm run test:examples",
26+
"check:examples": "npm run build:examples && npm run lint:examples && npm run test:examples",
2727
"build:commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir lib",
2828
"build:es": "cross-env BABEL_ENV=es babel src --out-dir es",
2929
"build:umd": "cross-env BABEL_ENV=commonjs NODE_ENV=development webpack src/index.js dist/redux.js",

0 commit comments

Comments
 (0)