Skip to content

Instantly share code, notes, and snippets.

@moimikey
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moimikey/6b78faff8061bb0223a8 to your computer and use it in GitHub Desktop.
Save moimikey/6b78faff8061bb0223a8 to your computer and use it in GitHub Desktop.
Project Boilerplate
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
node_modules
The MIT License (MIT)
Copyright (c) 2015 Michael Scott Hertzberg <mshertzberg@gmail.com>
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.
#!/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');
}
})
});
{
"name": "Project",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@gist.github.com:6b78faff8061bb0223a8.git"
},
"author": "Michael Scott Hertzberg <mshertzberg@gmail.com> (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