0.0.5 • Published 10 years ago
gik v0.0.5
#GIK A gulp workflow for giks.
What tasks are included?
clean.buildClean up build dirs.clean.docsClean up docs dirs.lint.testLinter on test files.lint.srcLinter on source files.lintLint for both test and source files.docsGenerate documentation (gik-doc)buildRun the ES6 transpiler (Babel) on the source files and puts them on build.testRuns tests. (MochaChai)watchRuns tests and watches for changes.
Usage
Install
gulp,chaiandgikas a dev-dependencies.```bash $ npm install --save-dev gulp chai fai ```Install
babel-runtimeas dependency (if you want complete support for ES6 feats)```bash $ npm install --save gulp babel-runtime ```Create a
gulpfile.json your project's root and add the following lines:```javascript 'use strict'; let Gulp = require('gulp'); let Gik = require('gik'); for (let i in GIK) Gulp.task.apply(Gulp, GIK[i]); // Your tasks here Gulp.task('your task', ()=>) ```Create a
testandsrcdirectory.```bash mkdir test && mkdir src ```Add a
.chai.jsfile in thetestdirectory to configure yourChaiexperience. own globals to the mix.```bash touch test/.chai.js ``` ```javascript 'use strict'; let Chai = require('chai'); // Chai configurations. Chai.config.includeStack = false; Chai.config.showDiff = false; // globals you need on your tests. GLOBAL.expect = Chai.expect; ```Create in both
testandsrcdirs a file named.eslintrc. It will allow the linter to use ES6 and you will be able to personalize its rules.```javascript { "parser": "babel-eslint", "env":{ "browser" : false, "node" : true }, "globals":{ "xit" : true, "it" : true, "describe" : true, "expect" : true }, "rules":{ /* your rules here */ } } ```