# cypper-node-microservices-build

> Gulp build tasks for an express microservice

Latest version **0.0.1** (published 2018-09-02) · LicenseRef-LICENSE license · 0 weekly downloads

## Install

```sh
npm install cypper-node-microservices-build
pnpm add cypper-node-microservices-build
yarn add cypper-node-microservices-build
bun add cypper-node-microservices-build
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2018-09-02 |
| First published | 2018-09-02 |
| Weekly downloads | 0 |
| License | LicenseRef-LICENSE |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 44 |
| Unpacked size | 140.4 KB |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| Author | Cypper, LLC |
| Maintainers | cypper |
| Keywords | gulp, es6, express, microservice |

## Links

- npm: https://www.npmjs.com/package/cypper-node-microservices-build
- Repository: https://cypper.com/bitbucket/scm/cmp/node-microservices-build
- Homepage: https://cypper.com/bitbucket/projects/CMP/repos/node-microservices-build/browse
- npm.io page: https://npm.io/package/cypper-node-microservices-build

## Dependencies (44)

- [del](https://npm.io/package/del.md) ~2.2.2
- [sfx](https://npm.io/package/sfx.md) ~0.1.1
- [gulp](https://npm.io/package/gulp.md) ~3.9.1
- [chalk](https://npm.io/package/chalk.md) ~1.1.3
- [esdoc](https://npm.io/package/esdoc.md) ~1.0.4
- [jsdoc](https://npm.io/package/jsdoc.md) ~3.4.0
- [eslint](https://npm.io/package/eslint.md) ~4.15.0
- [jshint](https://npm.io/package/jshint.md) ~2.9.2
- [mkdirp](https://npm.io/package/mkdirp.md) ~0.5.1
- [tslint](https://npm.io/package/tslint.md) ~4.5.1
- [core-js](https://npm.io/package/core-js.md) ~2.4.1
- [request](https://npm.io/package/request.md) ~2.81.0
- [jsonfile](https://npm.io/package/jsonfile.md) ~3.0.0
- [through2](https://npm.io/package/through2.md) ~2.0.1
- [gulp-jscs](https://npm.io/package/gulp-jscs.md) ~3.0.2
- [gulp-util](https://npm.io/package/gulp-util.md) ~3.0.7
- [gulp-babel](https://npm.io/package/gulp-babel.md) ~6.1.2
- [gulp-mocha](https://npm.io/package/gulp-mocha.md) ~2.2.0
- [gulp-shell](https://npm.io/package/gulp-shell.md) ~0.5.2
- [node-watch](https://npm.io/package/node-watch.md) ~0.5.2
- [typescript](https://npm.io/package/typescript.md) ~2.3.2
- [body-parser](https://npm.io/package/body-parser.md) ~1.15.2
- [gulp-eslint](https://npm.io/package/gulp-eslint.md) ~4.0.1
- [gulp-jshint](https://npm.io/package/gulp-jshint.md) ~2.0.0
- [gulp-tslint](https://npm.io/package/gulp-tslint.md) ~7.1.0
- [require-dir](https://npm.io/package/require-dir.md) ~0.3.2
- [color-logger](https://npm.io/package/color-logger.md) 0.0.6
- [jasmine-core](https://npm.io/package/jasmine-core.md) ~2.5.2
- [merge-stream](https://npm.io/package/merge-stream.md) ~1.0.1
- [run-sequence](https://npm.io/package/run-sequence.md) ~1.2.2
- [app-root-path](https://npm.io/package/app-root-path.md) ~2.0.1
- [gulp-istanbul](https://npm.io/package/gulp-istanbul.md) ~0.10.3
- [babel-register](https://npm.io/package/babel-register.md) ~6.8.0
- [remap-istanbul](https://npm.io/package/remap-istanbul.md) ~0.8.4
- [swagger-parser](https://npm.io/package/swagger-parser.md) ~3.4.1
- [gulp-sourcemaps](https://npm.io/package/gulp-sourcemaps.md) ~1.9.1
- [request-promise](https://npm.io/package/request-promise.md) ~4.1.1
- [gulp-live-server](https://npm.io/package/gulp-live-server.md) ~0.0.29
- [express-validator](https://npm.io/package/express-validator.md) ~2.6.0
- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ~6.6.0
- [babel-preset-es2017](https://npm.io/package/babel-preset-es2017.md) ~6.16.0
- [eslint-plugin-mocha](https://npm.io/package/eslint-plugin-mocha.md) ~4.11.0
- [esdoc-standard-plugin](https://npm.io/package/esdoc-standard-plugin.md) ~1.0.0
- [recursive-readdir-sync](https://npm.io/package/recursive-readdir-sync.md) ~1.0.6

## Recent versions

- 0.0.1 (latest) — 2018-09-02

## README

# Table of content

- [Use for ES5 services](#es5-usage)
- [Use for ES6 services](#es6-usage)
- [Show supported tasks](#supported-tasks)
- [Creating hook in Rocket.Chat for coverage report ](#rocket-coverage-report)
- [Work with ng2+ modules](#work-with-ng2-module)
    - [Developer environment deployment](#ng2-dev-environment-deployment)
    - [Common commands](#ng2-common-commands)
    - [Scoped package.json](#sng2-coped-package)
    - [Publishing](#ng2-publishing)
    - [Notes](#ng2-repo-notes)

# <a name="es5-usage"></a>Use for ES5 services
Place following to your gulpfile.js
```javascript
'use strict';

var initBuildService = require('express-microservice-build');

initBuildService('\tmy-task - do something');
```

# <a name="es6-usage"></a>Use for ES6 services
Place following to your gulpfile.js
```javascript
'use strict';

var initBuildService = require('express-microservice-build');

initBuildService('\tmy-task - do something', 'es6');
```

# <a name="supported-tasks"></a>Show supported tasks
```bash
Romans-MBP:express-microservice roman$ gulp

[00:37:08] Using gulpfile ~/Desktop/project/agiliumsoft/workspace/express-microservice/gulpfile.js
[00:37:08] Starting 'default'...
Usage: gulp (server|unit|unit:watch|code-style|code-style:watch)
	server - run development server
	unit [--tags feature]... - run unit tests once
	unit:watch [--tags feature]... - run unit tests continuously (on every change)
	code-style [--tags file.js]... [--tags folder]... - run static code analyzer once
	code-style:watch [--tags file.js]... [--tags folder]... - continuously run static code analyzer (on every change)
	jsdoc - run jsdoc generator
	migrate - run database migration
[00:37:08] Finished 'default' after 210 μs
```
# <a name="rocket-coverage-report"></a>Creating hook in Rocket.Chat for coverage report
For integration with Rocket.Chat you need create
[Incoming WebHook](https://rocket.chat/docs/administrator-guides/integrations/)
Ok. You create your hook. Next you need create **ROCKETCHAT_HOOK_URL** environment
variable of this example *https://your_chat_host/hooks/copy_the_token_field_here*

# <a name="work-with-ng2-module"></a>Work with ng2+ modules

## <a name="ng2-dev-environment-deployment"></a>Developer environment deployment

1. install globally npmrc and typescript
```bash
npm install -g npmrc
npm install -g typescript
```

2. Create file `.npmrc` in current user folder with authorization key from sinopia.
Ask Roman for key if you don' have it.

3. install local dependencies. In root folder of project
```bash
npm install
```

## <a name="ng2-common-commands"></a>Common commands

1. Run unit test
```bash
# single run
# after each single test run you can see code coverage
gulp u

# run and watch for changes (TDD style)
gulp uw

# run unit test from specified file
gulp u --tags file-name.component
gulp uw --tags file-name.component
```

2. Create module documentation
```bash
gulp jsdoc
```

3. Serve generated documentation
```bash
gulp jsdoc:serve
# to check documentation coverage click on "Documentation coverage" link
```

4. Check project unit tests and documentation coverage
```bash
gulp c
```

5. Publish coverage info to rocket chat. <br />
NOTE1: this command available only after coverage for unit tests and create documentation tasks launch. <br />
NOTE2: for publishing info you need to config environment variables:
    - ROCKETCHAT_HOOK_URL
    - CI_SERVER_NAME
    - CI_PROJECT_PATH
    - CI_PROJECT_URL
    - CI_BUILD_REF_NAME
    - PROJECT_REPORTS_URL
```bash
gulp c
gulp jsdoc
gulp cr
```

## <a name="ng2-scoped-package"></a>Scoped package.json

This repo contains two package.json file:
- in `root` folder. Contain dependencies and scripts for module development and publishing.
- in `lib` folder. Contain just peer dependencies for module usage.

Make sure, that `lib/package.json` has correct dependencies and peerDependencies list, and package version before
publish.

## <a name="ng2-publishing"></a>Publishing

1. Check, that module compiled without errors
```bash
npm run prepare
```

2. Publish module
```bash
npm run publish
```

### <a name="ng2-repo-notes"></a>Notes

1. Push changes to master git branch is not the same as publishing to npm. It's to different operations. Git repository
is used for module source code. Npm package is used for compiled module.

2. Create angular npm module actual tutorials:
- [Distributing an Angular Library - The Brief Guide](http://blog.mgechev.com/2017/01/21/distributing-an-angular-library-aot-ngc-types),
- [How to build and publish an Angular module](https://medium.com/@cyrilletuzi/how-to-build-and-publish-an-angular-module-7ad19c0b4464),
- [Making your Angular 2 library statically analyzable for AoT](https://medium.com/@isaacplmann/making-your-angular-2-library-statically-analyzable-for-aot-e1c6f3ebedd5),
- [Guidelines For developing with Angular, ngrx/store, ngrx/effects & AOT](http://orizens.com/wp/topics/guidelines-for-developing-with-angular-ngrxstore-ngrxeffects-aot/).

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