Colecciones de software que hacen nuestro trabajo mas facil y nuestra vida mas feliz.
Mejor codigo, menos bugs, mas funcionalidad y en menos tiempo.
Aprendamos a querarla 鉂わ笍
Linter para codigo para JavaScript
.eslintr
{
"env": {
"browser": true,
},
"globals": {
"angular": true,
},
"rules": {
"camelcase": 2,
"curly": 2,
"brace-style": [2, "1tbs"],
"quotes": [2, "single"],
"semi": [2, "always"],
"space-in-brackets": [2, "never"],
"space-infix-ops": 2,
}
}
.editorconfig
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
karma.conf.js
module.exports = function(config) {
config.set({
browsers: ['PhantomJS', 'Chrome'],
frameworks: ['mocha'],
reporters: ['spec', 'coverage'],
files: ['test/'],
coverageReporter: {
dir : './coverage',
reporters: [
{ type: 'lcov', subdir: '.' },
{ type: 'text-summary' }
]
}
});
};
Transformacion + Compilacion
.babelrc
{
"presets": ["es2015", "stage-1"],
"comments": false
}
webpack.config.js
const webpack = require('webpack');
module.exports = {
entry: './src/index.js',
output: {
path: './dist',
filename: 'lib.js'
},
resolve: { root: path.resolve('./') },
module: {
preLoaders: [{
test : /\.js$/,
loader : 'eslint',
include: projectRoot,
exclude: /node_modules/
}],
loaders: [
{
test: /\.(woff|ttf|eot|svg)$/,
loader: 'url?limit=64000'
},
{
test: /\.(png|jpg)$/,
loader: 'url?limit=64000'
},
{
test : /\.js$/,
exclude: /node_modules/,
loader : 'babel'
},
{
test : /\.css$/,
loader: 'style-loader!css-loader?root=./src/'
},
{
test : /\.scss$/,
loader: 'style!css!sass'
}
]
},
};
package.json
npm run [script]
package.json
"name": "luhn-cc",
"version": "0.0.6",
"scripts": {
"build": "webpack --mode=build",
"dev": "webpack --progress --colors --watch --mode=dev",
"test": "karma start karma.conf.js --single-run",
"test-watch": "karma start karma.conf.js --auto-watch",
"check-cover": "open coverage/lcov-report/index.html",
"eslint": "eslint . .js",
"prepublish": "npm run build",
"bithound": "bithound check git@github.com:ianaya89/luhn-cc.git"
},
Integraci贸n Continua
circle.yml
machine:
timezone:
America/Vancouver
node:
version: 6
dependencies:
override:
- npm install
- npm install coveralls
- npm install bithound
test:
override:
- npm test
- COVERALLS_SERVICE_NAME="circleci" COVERALLS_SERVICE_JOB_ID="$CIRCLE_BUILD_NUM" ./node_modules/coveralls/bin/coveralls.js < ./coverage/lcov.info
- ./node_modules/.bin/bithound check git@github.com:ianaya89/luhn-cc.git
post:
- cp -R ./coverage/* $CIRCLE_ARTIFACTS/