Skip to content

Commit 8571816

Browse files
committed
Build examples
Fix #4.
1 parent 1069983 commit 8571816

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ node_modules
22
npm-debug.log
33
.DS_Store
44
.idea/
5+
dist/
56
build/
67
dev/

examples/buildAll.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
// Ordering is important here. `npm install` must come first.
14+
var cmdArgs = [
15+
{ cmd: 'npm', args: ['install'] },
16+
{ cmd: 'webpack', args: ['index.js'] }
17+
];
18+
19+
for (const dir of exampleDirs) {
20+
for (const cmdArg of cmdArgs) {
21+
// declare opts in this scope to avoid https://github.com/joyent/node/issues/9158
22+
const opts = {
23+
cwd: path.join(__dirname, dir),
24+
stdio: 'inherit'
25+
};
26+
let result = {};
27+
if (process.platform === 'win32') {
28+
result = spawnSync(cmdArg.cmd + '.cmd', cmdArg.args, opts);
29+
} else {
30+
result = spawnSync(cmdArg.cmd, cmdArg.args, opts);
31+
}
32+
if (result.status !== 0) {
33+
throw new Error('Building examples exited with non-zero');
34+
}
35+
}
36+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"start": "gulp",
77
"build:extension": "BABEL_ENV=production gulp build:extension",
88
"build:firefox": "BABEL_ENV=production gulp build:firefox",
9+
"build:examples": "babel-node examples/buildAll.js",
910
"compress:extension": "npm run build:extension && gulp compress:extension",
1011
"compress:firefox": "npm run build:firefox && gulp compress:firefox",
1112
"clean": "rm -rf build/ && rm -rf dev/",

src/browser/extension/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.1.0",
2+
"version": "0.1.9",
33
"name": "Redux DevTools",
44
"short_name": "Redux DevTools",
55
"description": "DevTools for Redux with actions history, undo and replay.",

0 commit comments

Comments
 (0)