fix(core): update
This commit is contained in:
		
							
								
								
									
										24
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1,4 +1,22 @@ | |||||||
| coverage/ |  | ||||||
| node_modules |  | ||||||
| pages/ |  | ||||||
| .nogit/ | .nogit/ | ||||||
|  |  | ||||||
|  | # artifacts | ||||||
|  | coverage/ | ||||||
|  | public/ | ||||||
|  | pages/ | ||||||
|  |  | ||||||
|  | # installs | ||||||
|  | node_modules/ | ||||||
|  |  | ||||||
|  | # caches | ||||||
|  | .yarn/ | ||||||
|  | .cache/ | ||||||
|  | .rpt2_cache | ||||||
|  |  | ||||||
|  | # builds | ||||||
|  | dist/ | ||||||
|  | dist_web/ | ||||||
|  | dist_serve/ | ||||||
|  | dist_ts_web/ | ||||||
|  |  | ||||||
|  | # custom | ||||||
| @@ -1,5 +1,5 @@ | |||||||
| # gitzone ci_default | # gitzone ci_default | ||||||
| image: hosttoday/ht-docker-node:npmci | image: registry.gitlab.com/hosttoday/ht-docker-node:npmci | ||||||
|  |  | ||||||
| cache: | cache: | ||||||
|   paths: |   paths: | ||||||
| @@ -34,48 +34,11 @@ snyk: | |||||||
|   - docker |   - docker | ||||||
|   - notpriv |   - notpriv | ||||||
|  |  | ||||||
| sast: |  | ||||||
|   stage: security |  | ||||||
|   image: registry.gitlab.com/hosttoday/ht-docker-dbase:npmci |  | ||||||
|   variables: |  | ||||||
|     DOCKER_DRIVER: overlay2 |  | ||||||
|   allow_failure: true |  | ||||||
|   services: |  | ||||||
|     - docker:stable-dind |  | ||||||
|   script: |  | ||||||
|     - npmci npm prepare |  | ||||||
|     - npmci npm install |  | ||||||
|     - npmci command npm run build |  | ||||||
|     - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') |  | ||||||
|     - docker run |  | ||||||
|         --env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}" |  | ||||||
|         --volume "$PWD:/code" |  | ||||||
|         --volume /var/run/docker.sock:/var/run/docker.sock |  | ||||||
|         "registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code |  | ||||||
|   artifacts: |  | ||||||
|     reports: |  | ||||||
|       sast: gl-sast-report.json |  | ||||||
|   tags: |  | ||||||
|   - docker |  | ||||||
|   - priv |  | ||||||
|  |  | ||||||
| # ==================== | # ==================== | ||||||
| # test stage | # test stage | ||||||
| # ==================== | # ==================== | ||||||
|  |  | ||||||
| testLTS: | testStable: | ||||||
|   stage: test |  | ||||||
|   script: |  | ||||||
|   - npmci npm prepare |  | ||||||
|   - npmci node install lts |  | ||||||
|   - npmci npm install |  | ||||||
|   - npmci npm test |  | ||||||
|   coverage: /\d+.?\d+?\%\s*coverage/ |  | ||||||
|   tags: |  | ||||||
|   - docker |  | ||||||
|   - notpriv |  | ||||||
|      |  | ||||||
| testSTABLE: |  | ||||||
|   stage: test |   stage: test | ||||||
|   script: |   script: | ||||||
|   - npmci npm prepare |   - npmci npm prepare | ||||||
| @@ -85,12 +48,24 @@ testSTABLE: | |||||||
|   coverage: /\d+.?\d+?\%\s*coverage/ |   coverage: /\d+.?\d+?\%\s*coverage/ | ||||||
|   tags: |   tags: | ||||||
|   - docker |   - docker | ||||||
|  |   - priv | ||||||
|  |  | ||||||
|  | testBuild: | ||||||
|  |   stage: test | ||||||
|  |   script: | ||||||
|  |   - npmci npm prepare | ||||||
|  |   - npmci node install lts | ||||||
|  |   - npmci npm install | ||||||
|  |   - npmci command npm run build | ||||||
|  |   coverage: /\d+.?\d+?\%\s*coverage/ | ||||||
|  |   tags: | ||||||
|  |   - docker | ||||||
|   - notpriv |   - notpriv | ||||||
|  |  | ||||||
| release: | release: | ||||||
|   stage: release |   stage: release | ||||||
|   script: |   script: | ||||||
|   - npmci node install stable |   - npmci node install lts | ||||||
|   - npmci npm publish |   - npmci npm publish | ||||||
|   only: |   only: | ||||||
|   - tags |   - tags | ||||||
| @@ -103,19 +78,11 @@ release: | |||||||
| # ==================== | # ==================== | ||||||
| codequality: | codequality: | ||||||
|   stage: metadata |   stage: metadata | ||||||
|   image: docker:stable |  | ||||||
|   allow_failure: true |   allow_failure: true | ||||||
|   services: |  | ||||||
|     - docker:stable-dind |  | ||||||
|   script: |   script: | ||||||
|     - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') |     - npmci command npm install -g tslint typescript | ||||||
|     - docker run |     - npmci npm install | ||||||
|         --env SOURCE_CODE="$PWD" |     - npmci command "tslint -c tslint.json ./ts/**/*.ts" | ||||||
|         --volume "$PWD":/code |  | ||||||
|         --volume /var/run/docker.sock:/var/run/docker.sock |  | ||||||
|         "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code |  | ||||||
|   artifacts: |  | ||||||
|     paths: [codeclimate.json] |  | ||||||
|   tags: |   tags: | ||||||
|   - docker |   - docker | ||||||
|   - priv |   - priv | ||||||
| @@ -131,13 +98,15 @@ trigger: | |||||||
|   - notpriv |   - notpriv | ||||||
|  |  | ||||||
| pages: | pages: | ||||||
|   image: hosttoday/ht-docker-node:npmci |   image: hosttoday/ht-docker-dbase:npmci | ||||||
|  |   services: | ||||||
|  |    - docker:stable-dind | ||||||
|   stage: metadata |   stage: metadata | ||||||
|   script: |   script: | ||||||
|     - npmci command npm install -g typedoc typescript |     - npmci command npm install -g @gitzone/tsdoc | ||||||
|     - npmci npm prepare |     - npmci npm prepare | ||||||
|     - npmci npm install |     - npmci npm install | ||||||
|     - npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/ |     - npmci command tsdoc | ||||||
|   tags: |   tags: | ||||||
|     - docker |     - docker | ||||||
|     - notpriv |     - notpriv | ||||||
|   | |||||||
| @@ -3,5 +3,15 @@ | |||||||
|     "npmGlobalTools": [], |     "npmGlobalTools": [], | ||||||
|     "npmAccessLevel": "public", |     "npmAccessLevel": "public", | ||||||
|     "npmRegistryUrl": "registry.npmjs.org" |     "npmRegistryUrl": "registry.npmjs.org" | ||||||
|  |   }, | ||||||
|  |   "gitzone": { | ||||||
|  |     "module": { | ||||||
|  |       "githost": "gitlab.com", | ||||||
|  |       "gitscope": "pushrocks", | ||||||
|  |       "gitrepo": "taskbuffer", | ||||||
|  |       "shortDescription": "flexible task management. TypeScript ready!", | ||||||
|  |       "npmPackagename": "@pushrocks/taskbuffer", | ||||||
|  |       "license": "MIT" | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
							
								
								
									
										13
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								package.json
									
									
									
									
									
								
							| @@ -42,5 +42,16 @@ | |||||||
|     "@types/node": "^12.7.4", |     "@types/node": "^12.7.4", | ||||||
|     "tslint": "^5.19.0", |     "tslint": "^5.19.0", | ||||||
|     "tslint-config-prettier": "^1.18.0" |     "tslint-config-prettier": "^1.18.0" | ||||||
|   } |   }, | ||||||
|  |   "files": [ | ||||||
|  |     "ts/*", | ||||||
|  |     "ts_web/*", | ||||||
|  |     "dist/*", | ||||||
|  |     "dist_web/*", | ||||||
|  |     "dist_ts_web/*", | ||||||
|  |     "assets/*", | ||||||
|  |     "cli.js", | ||||||
|  |     "npmextra.json", | ||||||
|  |     "readme.md" | ||||||
|  |   ] | ||||||
| } | } | ||||||
							
								
								
									
										77
									
								
								readme.md
									
									
									
									
									
								
							
							
						
						
									
										77
									
								
								readme.md
									
									
									
									
									
								
							| @@ -1,64 +1,22 @@ | |||||||
| # taskbuffer | # @pushrocks/taskbuffer | ||||||
|  |  | ||||||
| flexible task management. TypeScript ready! | flexible task management. TypeScript ready! | ||||||
|  |  | ||||||
| ## Availabililty | ## Availabililty and Links | ||||||
|  | * [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/taskbuffer) | ||||||
| [](https://www.npmjs.com/package/taskbuffer) | * [gitlab.com (source)](https://gitlab.com/pushrocks/taskbuffer) | ||||||
| [](https://GitLab.com/pushrocks/taskbuffer) | * [github.com (source mirror)](https://github.com/pushrocks/taskbuffer) | ||||||
| [](https://github.com/pushrocks/taskbuffer) | * [docs (typedoc)](https://pushrocks.gitlab.io/taskbuffer/) | ||||||
| [](https://pushrocks.gitlab.io/taskbuffer/) |  | ||||||
|  |  | ||||||
| ## Status for master | ## Status for master | ||||||
|  | [](https://gitlab.com/pushrocks/taskbuffer/commits/master) | ||||||
|  | [](https://gitlab.com/pushrocks/taskbuffer/commits/master) | ||||||
|  | [](https://www.npmjs.com/package/@pushrocks/taskbuffer) | ||||||
|  | [](https://snyk.io/test/npm/@pushrocks/taskbuffer) | ||||||
|  | [](https://nodejs.org/dist/latest-v10.x/docs/api/) | ||||||
|  | [](https://nodejs.org/dist/latest-v10.x/docs/api/) | ||||||
|  | [](https://prettier.io/) | ||||||
|  |  | ||||||
| [](https://GitLab.com/pushrocks/taskbuffer/commits/master) | ## Usage | ||||||
| [](https://GitLab.com/pushrocks/taskbuffer/commits/master) |  | ||||||
| [](https://www.npmjs.com/package/taskbuffer) |  | ||||||
| [](https://david-dm.org/pushrocks/taskbuffer) |  | ||||||
| [](https://www.bithound.io/github/pushrocks/taskbuffer/master/dependencies/npm) |  | ||||||
| [](https://www.bithound.io/github/pushrocks/taskbuffer) |  | ||||||
| [](https://nodejs.org/dist/latest-v6.x/docs/api/) |  | ||||||
| [](https://nodejs.org/dist/latest-v6.x/docs/api/) |  | ||||||
| [](http://standardjs.com/) |  | ||||||
|  |  | ||||||
| ## Install |  | ||||||
|  |  | ||||||
| ```sh |  | ||||||
| npm install taskbuffer --save |  | ||||||
| ``` |  | ||||||
|  |  | ||||||
| ## Concepts |  | ||||||
|  |  | ||||||
| ### class `Task` |  | ||||||
|  |  | ||||||
| - A Task in its most simple form is a function that is executed when the task runs. |  | ||||||
| - A Task can have a **preTask** and an **afterTask** |  | ||||||
|   (those are run before or after the main function whenever the task is called) |  | ||||||
| - A Task can be buffered. |  | ||||||
|   That means it can be called multiple times in a very short time. |  | ||||||
|   However execution happens in line: |  | ||||||
|   meaning execution of the task's main function is on halt until the previous task call has finished. |  | ||||||
|   You can set bufferMax number, which is the max number of buffered task calls. |  | ||||||
|   Any additional calls will then be truncated |  | ||||||
| - Task.trigger() and Task.triggerBuffered() always return a Promise |  | ||||||
|   which is fullfilled once the related task call has completed. |  | ||||||
| - Task.triggered() is an Observable stream that emits events every time a task call is called and every time a call is completed. |  | ||||||
| - Task is compatible to gulp streams. |  | ||||||
|  |  | ||||||
| ### class `TaskChain` |  | ||||||
|  |  | ||||||
| - TaskChain extends Task. |  | ||||||
| - Multiple Tasks can be combined in a bigger task using a TaskChain. |  | ||||||
| - While the tasks are async in themselve, TaskChain **runs Tasks serialized** (one after the other) |  | ||||||
| - that means that tasks can rely on each other and |  | ||||||
|  |  | ||||||
| ### class `TaskParallel` |  | ||||||
|  |  | ||||||
| - TaskParallel extends Task. |  | ||||||
| - like TaskChain, however **tasks run in parallel** |  | ||||||
| - Tasks cannot rely on each other. |  | ||||||
|  |  | ||||||
| ### Usage |  | ||||||
|  |  | ||||||
| We highly recommend TypeScript as this module supports **TypeScript intellisense**. | We highly recommend TypeScript as this module supports **TypeScript intellisense**. | ||||||
|  |  | ||||||
| @@ -85,3 +43,10 @@ For further information read the linked docs at the top of this README. | |||||||
| > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) | > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) | ||||||
|  |  | ||||||
| [](https://push.rocks) | [](https://push.rocks) | ||||||
|  |  | ||||||
|  | For further information read the linked docs at the top of this readme. | ||||||
|  |  | ||||||
|  | > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) | ||||||
|  | | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) | ||||||
|  |  | ||||||
|  | [](https://maintainedby.lossless.com) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user