File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1
1
language : node_js
2
2
node_js :
3
3
- " iojs"
4
+ script :
5
+ - npm test
6
+ - npm run build:examples
7
+
Original file line number Diff line number Diff line change
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 ( let dir of exampleDirs ) {
20
+ let opts = {
21
+ cwd : path . join ( __dirname , dir ) ,
22
+ stdio : 'inherit'
23
+ } ;
24
+
25
+ for ( let cmdArg of cmdArgs ) {
26
+ let result = spawnSync ( cmdArg . cmd , cmdArg . args , opts ) ;
27
+ if ( result . status !== 0 ) {
28
+ throw new Error ( 'Building examples exited with non-zero' ) ;
29
+ }
30
+ }
31
+ }
Original file line number Diff line number Diff line change 12
12
"check" : " npm run lint && npm run test" ,
13
13
"build:lib" : " babel src --out-dir lib" ,
14
14
"build:umd" : " webpack src/index.js dist/redux.js && NODE_ENV=production webpack src/index.js dist/redux.min.js" ,
15
+ "build:examples" : " babel-node examples/buildAll.js" ,
15
16
"build" : " npm run build:lib && npm run build:umd" ,
16
17
"preversion" : " npm run clean && npm run check" ,
17
18
"version" : " npm run build" ,
You can’t perform that action at this time.
0 commit comments