bash <(curl -s https://gist.githubusercontent.com/ArnaudD/6c4b38ad578fa05ce9ce/raw/init.sh)
Last active
March 17, 2016 16:09
-
-
Save ArnaudD/6c4b38ad578fa05ce9ce to your computer and use it in GitHub Desktop.
FIZIX NPM Module boilerplate
This file contains 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
Show hidden characters
{ | |
"presets": [ | |
"es2015", | |
"stage-0", | |
] | |
} |
This file contains 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
# http://editorconfig.org | |
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = true |
This file contains 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 | |
dist |
This file contains 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
{ | |
"parser": "babel-eslint", | |
"extends": "airbnb/base", | |
"rules": { | |
"strict": 0, | |
"indent": [2, 2], | |
"no-trailing-space": [0], | |
"new-cap": 0, | |
"key-spacing": 0 | |
}, | |
"env": { | |
"es6": true, | |
"browser": true, | |
"node": true, | |
"mocha": true | |
}, | |
"ecmaFeatures": { | |
"modules": true, | |
"experimentalObjectRestSpread": true | |
} | |
} |
This file contains 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
dist | |
node_modules | |
npm-debug.log* |
This file contains 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
var mod = require('./package.json'); | |
var fs = require('fs'); | |
Object.assign(mod.scripts, { | |
clean: 'rimraf dist', | |
watch: 'npm --silent run build -- --watch', | |
build: 'npm --silent run clean && babel src -d dist', | |
test: 'mocha', | |
eslint: 'eslint --rule \"no-console\":2 src config test tools', | |
precommit: 'npm run eslint --silent && npm run test --silent', | |
}); | |
fs.writeFileSync('package.json', JSON.stringify(mod, null, 2)); |
This file contains 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
// hello world |
This file contains 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
npm init --scope=fizix | |
npm i --save-dev \ | |
babel \ | |
babel-cli \ | |
babel-preset-es2015 \ | |
babel-preset-stage-0 \ | |
assert \ | |
babel-eslint \ | |
eslint \ | |
eslint-config-airbnb \ | |
husky \ | |
mocha \ | |
should \ | |
should-sinon \ | |
sinon \ | |
babel-core \ | |
babel-polyfill \ | |
estraverse-fb | |
for file in \ | |
.babelrc \ | |
.editorconfig \ | |
.eslintrc \ | |
.gitignore \ | |
.eslintignore \ | |
index.js \ | |
src__index.js \ | |
test__mocha.opts \ | |
test__index.js | |
do | |
file_path=$(echo $file | sed 's/__/\//') | |
curl "https://gist.githubusercontent.com/ArnaudD/6c4b38ad578fa05ce9ce/raw/$file" > "$file_path" | |
done | |
node -e "$(curl -s https://gist.githubusercontent.com/ArnaudD/6c4b38ad578fa05ce9ce/raw/add-scripts.js)" |
This file contains 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
// foobar |
This file contains 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
/* eslint func-names:0 */ | |
describe('foo', function () { | |
it('bar', function () { | |
this.should.be.ok(); | |
}); | |
}); |
This file contains 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
--compilers js:babel-core/register | |
--require babel-polyfill | |
--require should | |
--require should-sinon | |
--ui tdd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment