0.0.1 • Published 6 years ago

cypper-node-microservices-build v0.0.1

Weekly downloads
2
License
LicenseRef-LICENS...
Repository
-
Last release
6 years ago

Table of content

Use for ES5 services

Place following to your gulpfile.js

'use strict';

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

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

Use for ES6 services

Place following to your gulpfile.js

'use strict';

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

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

Show supported tasks

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

Creating hook in Rocket.Chat for coverage report

For integration with Rocket.Chat you need create Incoming WebHook 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

Work with ng2+ modules

Developer environment deployment

  1. install globally npmrc and typescript
npm install -g npmrc
npm install -g typescript
  1. Create file .npmrc in current user folder with authorization key from sinopia. Ask Roman for key if you don' have it.

  2. install local dependencies. In root folder of project

npm install

Common commands

  1. Run unit test
# 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
  1. Create module documentation
gulp jsdoc
  1. Serve generated documentation
gulp jsdoc:serve
# to check documentation coverage click on "Documentation coverage" link
  1. Check project unit tests and documentation coverage
gulp c
  1. Publish coverage info to rocket chat. NOTE1: this command available only after coverage for unit tests and create documentation tasks launch. 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
gulp c
gulp jsdoc
gulp cr

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.

Publishing

  1. Check, that module compiled without errors
npm run prepare
  1. Publish module
npm run publish

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: