# azk-dev

> Library which holds the basic tools for the development of azk projects

Latest version **0.3.0** (published 2016-01-13) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install azk-dev
pnpm add azk-dev
yarn add azk-dev
bun add azk-dev
```

Provides the command `npm-deploy`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2016-01-13 |
| First published | 2015-04-07 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10 |
| Dependencies | 35 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Éverton Ribeiro |
| Maintainers | nuxlli, fearenales, marcusgadbem, saitodisse, gullitmiranda |

## Links

- npm: https://www.npmjs.com/package/azk-dev
- Repository: https://github.com/azukiapp/azk-dev
- Issues: https://github.com/azukiapp/azk-dev/issues
- npm.io page: https://npm.io/package/azk-dev

## Dependencies (35)

- [del](https://npm.io/package/del.md) ^2.2.0
- [chai](https://npm.io/package/chai.md) ^3.4.1
- [chain](https://npm.io/package/chain.md) ^0.1.3
- [chalk](https://npm.io/package/chalk.md) ^1.0.0
- [mocha](https://npm.io/package/mocha.md) ^2.2.5
- [yargs](https://npm.io/package/yargs.md) ^3.6.0
- [dotenv](https://npm.io/package/dotenv.md) ^1.1.0
- [jshint](https://npm.io/package/jshint.md) ^2.8.0
- [tildify](https://npm.io/package/tildify.md) ^1.0.0
- [gulp-help](https://npm.io/package/gulp-help.md) ^1.3.4
- [gulp-jscs](https://npm.io/package/gulp-jscs.md) ^3.0.2
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.4
- [babel-core](https://npm.io/package/babel-core.md) ^6.3.26
- [gulp-babel](https://npm.io/package/gulp-babel.md) ^6.1.1
- [gulp-cache](https://npm.io/package/gulp-cache.md) ^0.4.1
- [gulp-debug](https://npm.io/package/gulp-debug.md) ^2.0.1
- [gulp-mocha](https://npm.io/package/gulp-mocha.md) ^2.0.1
- [gulp-shell](https://npm.io/package/gulp-shell.md) ^0.5.1
- [chai-subset](https://npm.io/package/chai-subset.md) ^1.2.0
- [chai-things](https://npm.io/package/chai-things.md) ^0.2.0
- [gulp-cached](https://npm.io/package/gulp-cached.md) ^1.0.4
- [gulp-ignore](https://npm.io/package/gulp-ignore.md) ^2.0.1
- [gulp-jshint](https://npm.io/package/gulp-jshint.md) ^2.0.0
- [vinyl-paths](https://npm.io/package/vinyl-paths.md) ^2.1.0
- [gulp-changed](https://npm.io/package/gulp-changed.md) ^1.2.1
- [gulp-plumber](https://npm.io/package/gulp-plumber.md) ^1.0.0
- [gulp-symlink](https://npm.io/package/gulp-symlink.md) ^2.1.0
- [run-sequence](https://npm.io/package/run-sequence.md) ^1.0.2
- [babel-polyfill](https://npm.io/package/babel-polyfill.md) ^6.3.14
- [jshint-stylish](https://npm.io/package/jshint-stylish.md) ^2.1.0
- [gulp-sourcemaps](https://npm.io/package/gulp-sourcemaps.md) ^1.5.1
- [chai-as-promised](https://npm.io/package/chai-as-promised.md) ^5.2.0
- [gulp-jscs-stylish](https://npm.io/package/gulp-jscs-stylish.md) ^1.1.0
- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ^6.3.13
- [babel-plugin-add-module-exports](https://npm.io/package/babel-plugin-add-module-exports.md) ^0.1.2

## Recent versions

- 0.3.0 (latest) — 2016-01-13
- 0.2.1 — 2016-01-05
- 0.2.0 — 2016-01-04
- 0.1.0 — 2015-10-15
- 0.0.15 — 2015-04-16
- 0.0.14 — 2015-04-15
- 0.0.13 — 2015-04-15
- 0.0.12 — 2015-04-14
- 0.0.11 — 2015-04-14
- 0.0.10 — 2015-04-14
- 0.0.9 — 2015-04-14
- 0.0.8 — 2015-04-14
- 0.0.7 — 2015-04-09
- 0.0.6 — 2015-04-09
- 0.0.5 — 2015-04-08
- … 4 more at https://npm.io/package/azk-dev/versions

## README

# azk-dev

This project simplifies and standardizes the main development tasks of node.js projects that are part of the [azk](https://github.com/azukiapp/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`, `chai-subset`and `chai-promise`;
- Helper to use generator and promises to simplify tests;
- `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](jshint) and [jscs](jscs);
- `babel[|:spec|:src]` and `babel[|:spec|:src]`: transpile `es6` code to `es5` via [babel](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`:

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

## Gulp Tasks (commons azk project tasks)

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

```js
// gulpfile.js
var azk_gulp = require('azk-dev/lib/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/):

```shel
$ 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:
  ```
  {
    presets: ['es2015'],
    plugins: ['add-module-exports'],
  }
  ```
- **sourcemaps_path** default: path.basename(process.cwd);

## Babel

If you use "generators" in your code, you'll need to install `babel-polyfill`:

```shell
$ gulp babel:polyfill:install
```

## Chai

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

export default Helpers;
```

## Test with generators support

```js
var BPromise = require('bluebird');
var enable_generators = require('azk-dev/lib/generators');
enable_generators((fn) => BPromise.coroutine(fn)());
```

## Editor Configs

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

```shell
$  gulp editor:config
```

## Deploy npm package

Adding this in package.json:

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

Now you can deploy package with:

```shell
$ 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

- Notify: https://github.com/mikaelbr/gulp-notify
- Test for babel, lint and watch tasks
- Improving version increment system by modifying the CHANGELOG.md when the version is incremented:
  - https://www.npmjs.com/package/mversion
  - https://github.com/mgol/npm-bump

## 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.

---
_Source: https://npm.io/package/azk-dev · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
