Skip to content

use shelljs for shell like commands #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"description": "An experiment in fully hot-reloadable Flux",
"main": "lib/index.js",
"scripts": {
"build": "scripts/build",
"clean": "scripts/clean",
"lint": "scripts/lint",
"prepublish": "scripts/prepublish",
"start": "scripts/start",
"test": "scripts/test",
"test:watch": "scripts/test-watch",
"test:cov": "scripts/test-cov"
"build": "shjs scripts/build",
"clean": "shjs scripts/clean",
"lint": "shjs scripts/lint",
"prepublish": "shjs scripts/prepublish",
"start": "shjs scripts/start",
"test": "shjs scripts/test",
"test:watch": "shjs scripts/test-watch",
"test:cov": "shjs scripts/test-cov"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -48,7 +48,7 @@
"mocha-jsdom": "~0.4.0",
"react": "^0.13.0",
"react-hot-loader": "^1.2.7",
"rimraf": "^2.3.4",
"shelljs": "^0.5.1",
"webpack": "^1.9.6",
"webpack-dev-server": "^1.8.2"
},
Expand Down
7 changes: 0 additions & 7 deletions scripts/build

This file was deleted.

7 changes: 7 additions & 0 deletions scripts/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var sh = require('shelljs');

sh.rm('-rf', 'lib');
sh.exec('babel src --out-dir lib');

sh.mv('lib/react-entry.js', './react.js');
sh.mv('lib/react-native-entry.js', './react-native.js');
3 changes: 0 additions & 3 deletions scripts/clean

This file was deleted.

3 changes: 3 additions & 0 deletions scripts/clean.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var sh = require('shelljs');

sh.rm('-rf', 'lib');
3 changes: 0 additions & 3 deletions scripts/lint

This file was deleted.

3 changes: 3 additions & 0 deletions scripts/lint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var sh = require('shelljs');

sh.exec('eslint src test');
5 changes: 0 additions & 5 deletions scripts/prepublish

This file was deleted.

12 changes: 12 additions & 0 deletions scripts/prepublish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var sh = require('shelljs');

sh.exec('eslint src test', function(code, output) {
if(code === 0) {
sh.exec('npm run clean');
sh.exec('npm run build');
sh.exec('npm run test');
} else {
sh.echo('Exit code:', code);
sh.echo('Program output:', output);
}
});
4 changes: 0 additions & 4 deletions scripts/start

This file was deleted.

3 changes: 3 additions & 0 deletions scripts/start.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var sh = require('shelljs');

sh.exec('cd examples && node server.js');
3 changes: 0 additions & 3 deletions scripts/test

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/test-cov

This file was deleted.

3 changes: 3 additions & 0 deletions scripts/test-cov.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var sh = require('shelljs');

sh.exec('istanbul cover node_modules/mocha/bin/_mocha -- --compilers js:babel/register --recursive');
3 changes: 0 additions & 3 deletions scripts/test-watch

This file was deleted.

4 changes: 4 additions & 0 deletions scripts/test-watch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var sh = require('shelljs');

sh.env.NODE_ENV = 'test';
sh.exec('mocha --compilers js:babel/register --recursive --watch');
4 changes: 4 additions & 0 deletions scripts/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var sh = require('shelljs');

sh.env.NODE_ENV = 'test';
sh.exec('mocha --compilers js:babel/register --recursive');