cypper-node-microservices-build
v0.0.1
Published
Gulp build tasks for an express microservice
Readme
Table of content
- Use for ES5 services
- Use for ES6 services
- Show supported tasks
- Creating hook in Rocket.Chat for coverage report
- Work with ng2+ modules
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 μsCreating 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
- install globally npmrc and typescript
npm install -g npmrc
npm install -g typescriptCreate file
.npmrcin current user folder with authorization key from sinopia. Ask Roman for key if you don' have it.install local dependencies. In root folder of project
npm installCommon commands
- 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- Create module documentation
gulp jsdoc- Serve generated documentation
gulp jsdoc:serve
# to check documentation coverage click on "Documentation coverage" link- Check project unit tests and documentation coverage
gulp c- 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 crScoped package.json
This repo contains two package.json file:
- in
rootfolder. Contain dependencies and scripts for module development and publishing. - in
libfolder. 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
- Check, that module compiled without errors
npm run prepare- Publish module
npm run publishNotes
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.
Create angular npm module actual tutorials:
