Giter Club home page Giter Club logo

azk-dev's Introduction

azk-dev

This project simplifies and standardizes the main development tasks of node.js projects that are part of the azk project. Among them are:

  • Gulp tasks collection that are common to azk projects;
  • Dotfiles for editor and lint tools configuration that maintain code standards: .editorconfig, .jshintrc and .jscsrc;
  • Helper for creating a spec-helper.js with mocha, chai and chai-promise;
  • npm-deploy script that assists in releasing npm packages;

Among the gulp tasks we have:

  • lint and watch:lint: for code standards testing, via jshint and jscs;
  • babel[|:spec|:src] and babel[|:spec|:src]: transpile es6 code to es5 via babel;
  • editor:config: copy the dotfiles to the current project folder, allowing their use in the editor and not only in the lint process;
  • babel:runtime:[install|version]: to assist in the babel runtime installation process;

Installation

Before adding azk-dev to your project, be sure to remove babel, babel-core and babel-babel-runtime if they're declared as dependencies. Now install azk-dev:

$ npm install gulp azk-dev --save-dev

Gulp Tasks (commons azk project tasks)

How to import commons azk-dev gulp tasks and extends:

// gulpfile.js
var azk_gulp = require('azk-dev/gulp')({
  cwd  : __dirname,
  sourcemaps_path: "/mytest", // Custom path to prefix transpiled files
  lint: [ "bin/**/*.js" ], // Extra files for the lint analyzer
});

var gulp = azk_gulp.gulp;

gulp.task("show:args", "Help text", ["before:show"], function() {
  console.log(azk_gulp.yargs.argv);
  return null;
}, { aliases: ["sa", "s"] });

Check the tasks added to the running gulp (yes we have a gulp help \o/):

$ gulp help
Available configs:
  • src: default: { src: "src" , dest: "./lib/src" };
  • spec: default: { src: "spec" , dest: "./lib/spec" };
  • lint: default: [];
  • clean: default: true;
  • default: default: [ "lint", "test" ];
  • babel: default: { optional: ['runtime'] };
  • sourcemaps_path default: path.basename(process.cwd);

Babel

To use babel in your project require to install babel-runtime:

$ gulp babel:runtime:install

Or

$ gulp babel:runtime:version
$ npm install babel-runtime@[version] --save

Chai

// spec/spec-help.js
var Helpers = {
  expect : require('azk-dev/chai').expect,
};

export default Helpers;

Editor Configs

Copy dotfiles .jscsrc, .jshintrc and .editorconfig from shared folder to current project. Use --force to overwrite.

$  gulp editor:config

Deploy npm package

Adding this in package.json:

"deploy" : "./node_modules/.bin/npm-deploy"

Now you can deploy package with:

$ npm run deploy [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]

This should run the following steps:

  • Check if not tracked commits in git
  • Run tests with npm test
  • Upgrade version in package.json, commit and add tag
  • Publish package in npmjs.com

TODO

License

"Azuki", "Azk" and the Azuki logo are copyright (c) 2013-2015 Azuki Serviços de Internet LTDA.

Azk-dev source code is released under Apache 2 License.

Check LEGAL and LICENSE files for more information.

azk-dev's People

Contributors

gullitmiranda avatar nuxlli avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.