Skip to content

Commit

Permalink
wait fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Wooleners committed Jan 3, 2016
1 parent 505a299 commit 1928509
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 68 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ ES6 + Webpack + React + Redux + NPM
## Usage

```bash
$ saller foo
$ cd foo && saller install
$ saller init foo && cd foo
$ saller install
```
##Steup

Expand Down
8 changes: 8 additions & 0 deletions bin/saller
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,12 @@ program
require('../lib/install')
})

program
.command('start')
.description('Run Develop Env')
.action(function(){
console.log('♣ Run Develop Env'.cyan)
require('../lib/start')
})

program.parse(process.argv);
130 changes: 64 additions & 66 deletions boilerplate/package.json
Original file line number Diff line number Diff line change
@@ -1,68 +1,66 @@
{
"name": "saller-demo",
"main": "server.js",
"scripts": {
"start": "babel-node server",
"deploy": "rm -rf dist && NODE_ENV=production webpack --config ./webpack.deploy.js --progress --profile --colors"
},
"author": "wooleners",
"license": "ISC",
"dependencies": {
"babel": "^5.8.25",
"babel-runtime": "^5.8.25",
"classnames": "^2.1.5",
"history": "^1.13.1",
"immutable": "^3.7.5",
"js-csp": "^0.5.0",
"parse-link-header": "^0.4.1",
"react": "^0.14.0",
"react-dom": "^0.14.0",
"react-hot-loader": "^1.3.0",
"react-redux": "^4.0.1",
"react-router": "^1.0.2",
"redux": "^3.0.0",
"redux-logger": "^2.1.4",
"superagent": "^1.4.0",
"transducers.js": "^0.3.2",
"whatwg-fetch": "^0.10.0"
},
"version": "1.0.0",
"description": "",
"devDependencies": {
"autoprefixer": "^6.1.2",
"autoprefixer-loader": "~2.0.0",
"babel": "^5.8.25",
"babel-core": "^5.4.7",
"babel-eslint": "^3.1.23",
"babel-loader": "^5.0.0",
"babel-plugin-object-assign": "^1.2.0",
"babel-plugin-react-transform": "^1.1.1",
"colors": "^1.1.2",
"compression-webpack-plugin": "^0.2.0",
"css-loader": "^0.14.1",
"eslint": "^0.24.1",
"eslint-plugin-react": "~2.5.0",
"extract-text-webpack-plugin": "^0.8.1",
"file-loader": "^0.8.5",
"html-webpack-plugin": "^2.0.4",
"ip": "^1.0.2",
"json-loader": "^0.5.1",
"jsx-loader": "^0.13.2",
"less": "~2.5.1",
"less-loader": "^2.2.0",
"node-libs-browser": "^0.5.2",
"postcss-loader": "^0.8.0",
"precss": "^1.3.0",
"react-hot-loader": "^1.2.7",
"redux-devtools": "^2.1.5",
"redux-simple-router": "^0.0.10",
"redux-thunk": "^1.0.0",
"stats-webpack-plugin": "^0.2.2",
"style-loader": "^0.13.0",
"url-loader": "^0.5.7",
"webpack": "^1.9.10",
"webpack-dev-middleware": "^1.2.0",
"webpack-dev-server": "^1.9.0",
"webpack-hot-middleware": "^2.2.0"
}
"name": "saller-demo",
"main": "server.js",
"scripts": {
"start": "babel-node server",
"dev": "webpack-dev-server --devtool eval --progress --colors --content-base build",
"deploy": "rm -rf dist && NODE_ENV=production webpack --config ./webpack.deploy.js --progress --profile --colors"
},
"author": "wooleners",
"license": "ISC",
"dependencies": {
"history": "^1.13.1",
"isomorphic-fetch": "^2.2.0",
"js-cookie": "^2.0.4",
"parse-link-header": "^0.4.1",
"react": "^0.14.0",
"react-cookie": "^0.4.3",
"react-dom": "^0.14.0",
"react-redux": "^4.0.1",
"react-router": "^1.0.2",
"redux": "^3.0.0",
"redux-logger": "^2.1.4",
"reqwest": "^2.0.5"
},
"version": "1.0.0",
"description": "",
"devDependencies": {
"babel": "^5.8.25",
"babel-runtime": "^5.8.25",
"react-hot-loader": "^1.3.0",
"autoprefixer": "^6.1.2",
"autoprefixer-loader": "~2.0.0",
"babel-core": "^5.4.7",
"babel-eslint": "^3.1.23",
"babel-loader": "^5.0.0",
"babel-plugin-object-assign": "^1.2.0",
"babel-plugin-react-transform": "^1.1.1",
"colors": "^1.1.2",
"compression-webpack-plugin": "^0.2.0",
"css-loader": "^0.14.1",
"eslint": "^0.24.1",
"eslint-plugin-react": "~2.5.0",
"extract-text-webpack-plugin": "^0.8.1",
"file-loader": "^0.8.5",
"html-webpack-plugin": "^2.0.4",
"ip": "^1.0.2",
"json-loader": "^0.5.1",
"jsx-loader": "^0.13.2",
"less": "~2.5.1",
"less-loader": "^2.2.0",
"node-libs-browser": "^0.5.2",
"postcss-loader": "^0.8.0",
"precss": "^1.3.0",
"react-hot-loader": "^1.2.7",
"redux-devtools": "^2.1.5",
"redux-simple-router": "^0.0.10",
"redux-thunk": "^1.0.0",
"stats-webpack-plugin": "^0.2.2",
"style-loader": "^0.13.0",
"url-loader": "^0.5.7",
"webpack": "^1.9.10",
"webpack-dev-middleware": "^1.2.0",
"webpack-dev-server": "^1.9.0",
"webpack-hot-middleware": "^2.2.0"
}
}
33 changes: 33 additions & 0 deletions lib/start.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
function runCmd(cmd, args, fn) {
args = args || [];
var runner = require('child_process').spawn(cmd, args, {
// keep color
stdio: "inherit"
});
runner.on('close', function (code) {
if (fn) {
fn(code);
}
});
}

var which = require('which');
var npms = ['tnpm', 'cnpm', 'npm'];

function findNpm() {
for (var i = 0; i < npms.length; i++) {
try {
which.sync(npms[i]);
return npms[i];
} catch (e) {

}
}
throw new Error('♣ Please install npm'.cyan);
}

var npm = findNpm();

runCmd(which.sync(npm), ['start'], function(){

});

0 comments on commit 1928509

Please sign in to comment.