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 = ; ;
Use for ES6 services
Place following to your gulpfile.js
'use strict'; var initBuildService = ; ;
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 - run development server unit [--tags feature]... - run unit tests once unit:watch [--tags feature]... - run unit tests continuously 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 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
- install globally npmrc and typescript
npm install -g npmrcnpm install -g typescript
-
Create file
.npmrc
in 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 install
Common 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.componentgulp 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 cgulp jsdocgulp 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
- Check, that module compiled without errors
npm run prepare
- Publish module
npm run publish
Notes
-
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: