Nixin CLI
A bunch of useful configurable Gulp tasks global to many projects, to manage development and production tasks with ease.
- Asset pipeline for Stylus, JavaScript, Images, Sprites, Fonts and Pug(Jade) templates that does compilation with sourcemaps and syntax checking in development mode and minification with obfuscator for production mode
- Advanced Bower integration
- Watch changed files with BrowserSync integration
- Mail inliner
- Project tasks extend or override
- Themes bundler
- Context bundler
__ _ _ __ __ __ _| | || | / /| || | ||_|__||_|/_/_|_||_|__| Main Tasks ------------------------------ bower browserify build clean default fonts images mail pug serve sprites stylus Sub Tasks ------------------------------ build:serve clean:bower.fonts clean:bower.images clean:bower.install clean:bower.scripts clean:bower.styles clean:browserify clean:fonts clean:images clean:mail clean:pug clean:sass clean:sprites clean:stylus convert:mail.styles create:bower.fonts create:bower.images create:bower.scripts create:bower.styles create:mail.styles create:sass inline:mail.styles install:bower serve:sync serve:watch ## Get Started Before get started with nixin-cli, verify that you have installed node ```bash$ which node
if are not installed, install it with brew
$ brew install node
Or through n (node version manager)
$ curl -L http://git.io/n-install | bash
Then install nixin-cli
$ sudo npm install -g nixin-cli
Or clone the repo and then create symlink into global node_modules and set into your .bashrc or .zshenv the global node_modules path
$ git clone git@github.com:kreo/nixin-cli.git$ cd path/to/nixin-cli$ npm linkexport NODE_PATH=/path/to/node_modules/
Usage
To use:
Create a bower.json into your project root
Then run the gulp install that create the node_modules and bower_components dependencies
$ nix install:bower
Then create a nix at the same level
/* |-------------------------------------------------------------------------- | Nix - Settings |-------------------------------------------------------------------------- | author: @kreo | https://github.com/kreo | */ /*jshint esversion: 6 */"use strict"; ;;;;; const nix = gulp source: __dirname + "/resources" dest: __dirname + "/public/_dist" app: "app" vendor: "vendor" mail: "mail" npm: stylus: browserify: bower: assets: "normalize-css" "bootstrap" "jquery.scrollbar" "slideout.js" "slick-carousel" "magnific-popup" "components-font-awesome" "simple-line-icons" order: "jquery/*" "normalize-css/*" "tether/*" "bootstrap/*" "slick-carousel/*" "**/*.js" serve: host: "localhost" proxy: "localhost/" port: "9001" ; nix;
For verify if node_modules need an update install npm-check-updates
$ npm install npm-check-updates -g
and then you can update all modules version running
$ ncu$ npm update -a
Now you must simpy include css and js dist into your base template
if tree dist structure is flatten
...
else if tree dist structure is tree
...
Tasks
default
Run this task to:
- print the tasks list
nix
Bower
This task create a vendor folder into your static with your plugins (images, fonts, and various assets of your choice), then create two files vendor.js and vendor.css and exports those (including assets) to dist folder.
nix bower
build
Run this task to:
- clean any already generated JS/CSS file
- compile your Stylus/SASS files to one unified file (with sourcemaps enabled)
and, parallelly:
- compile your JS browserify files to one unified file (with sourcemaps enabled)
nix build
serve
When you run this task, it will watch your project for changes.
nix build:serve
mail (in progress)
Run this task to:
- clean any already generated inlined mail templates
- inline your CSS class to multiple html templates
and, parallelly:
- inject your responsive style after the inliner
- convert your responsive style after the inject into style tag
nix mail
Flags
Production Flag
Add flag "-p" || "--prod" || "--env=prod":
- clean any already generated JS/CSS file
- compile your Stylus/SASS files to one unified file and minified CSS file removing sourcemaps
and, parallelly:
- compile your JS browserify files to one unified file and uglified and obfuscated JS file removing sourcemaps
nix build -p
License
This project is released under the MIT license.