Last active
August 29, 2015 14:27
-
-
Save moimikey/6b78faff8061bb0223a8 to your computer and use it in GitHub Desktop.
Project Boilerplate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root = true | |
[*] | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = true | |
indent_size = 2 | |
indent_style = space | |
[*.md] | |
trim_trailing_whitespace = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* text=auto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The MIT License (MIT) | |
Copyright (c) 2015 Michael Scott Hertzberg <[email protected]> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in | |
all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
THE SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node --harmony | |
/** | |
* A selection tool for installing node packages | |
* | |
* Michael Scott Hertzberg / moimikey | |
* | |
*/ | |
require("shelljs/global"); | |
var inquirer = require("inquirer"); | |
var checkboxes = [].concat({ | |
type: "checkbox", | |
message: "Pick your poisons...", | |
name: "packages", | |
choices: [] | |
}); | |
[ 'babel', | |
'async-await', | |
'browserify', | |
'webpack', | |
'react', | |
'eslint' | |
].map(function(package) { | |
checkboxes[0].choices.push(package); | |
}); | |
inquirer.prompt(checkboxes, | |
function(answers) { | |
answers.packages.map(function(package) { | |
switch(package) { | |
case 'babel': | |
exec('npm install --save-dev babel \ | |
babel-core \ | |
babel-loader \ | |
babel-runtime \ | |
babel-eslint \ | |
babel-plugin-runtime \ | |
babel-plugin-object-assign \ | |
babel-plugin-undefined-to-void \ | |
babel-plugin-typecheck'); | |
case 'async-await': | |
exec('npm install --save-dev meteor-async-await'); | |
case 'browserify': | |
exec('npm install --save-dev browserify \ | |
brfs \ | |
uglifyjs \ | |
zlib-browserify'); | |
case 'webpack': | |
exec('npm install --save-dev webpack \ | |
webpack-dev-server \ | |
sass-loader \ | |
strip-loader \ | |
style-loader \ | |
json-loader \ | |
css-loader \ | |
react-hot-loader \ | |
babel-loader \ | |
autoprefixer-loader \ | |
extract-text-webpack-plugin \ | |
clean-webpack-plugin'); | |
exec('npm install --save file-loader \ | |
url-loader'); | |
case 'react': | |
exec('npm install --save-dev react-a11y \ | |
react-hot-loader'); | |
exec('npm install --save react \ | |
react-inline-css \ | |
react-redux \ | |
react-router \ | |
redux \ | |
redux-form'); | |
case 'eslint': | |
exec('npm install --save-dev eslint \ | |
eslint \ | |
eslint-plugin-react'); | |
} | |
}) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Project", | |
"version": "1.0.0", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"repository": { | |
"type": "git", | |
"url": "[email protected]:6b78faff8061bb0223a8.git" | |
}, | |
"author": "Michael Scott Hertzberg <[email protected]> (http://michael.hertzberg.co/)", | |
"license": "MIT", | |
"directories": { | |
"test": "test" | |
}, | |
"optionalDependencies": { | |
"inquirer": "~0.9.0", | |
"shelljs": "~0.5.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment