From 25c0deb3f3d2c6afedee5123d6dbebba74b87d1f Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Tue, 26 Mar 2019 12:07:12 +0100 Subject: [PATCH] fix(core): update --- .gitlab-ci.yml | 30 +++++++----------------------- README.md | 36 ++++++++++++++++-------------------- npmextra.json | 10 ++++++++++ package.json | 2 +- test/test.ts | 8 ++++++-- ts/index.ts | 4 ++-- tslint.json | 16 +++++++++++++++- 7 files changed, 57 insertions(+), 49 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8b576a0..8321aed 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,6 +26,7 @@ mirror: snyk: stage: security script: + - npmci npm prepare - npmci command npm install -g snyk - npmci command npm install --ignore-scripts - npmci command snyk test @@ -36,21 +37,11 @@ snyk: # ==================== # test stage # ==================== -testLEGACY: - stage: test - script: - - npmci node install legacy - - npmci npm install - - npmci npm test - coverage: /\d+.?\d+?\%\s*coverage/ - tags: - - docker - - notpriv - allow_failure: true testLTS: stage: test script: + - npmci npm prepare - npmci node install lts - npmci npm install - npmci npm test @@ -62,6 +53,7 @@ testLTS: testSTABLE: stage: test script: + - npmci npm prepare - npmci node install stable - npmci npm install - npmci npm test @@ -117,8 +109,10 @@ pages: image: hosttoday/ht-docker-node:npmci stage: metadata script: - - npmci command npm install -g npmpage - - npmci command npmpage + - npmci command npm install -g typedoc typescript + - npmci npm prepare + - npmci npm install + - npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/ tags: - docker - notpriv @@ -129,13 +123,3 @@ pages: paths: - public allow_failure: true - -windowsCompatibility: - image: stefanscherer/node-windows:10-build-tools - stage: metadata - script: - - npm install & npm test - coverage: /\d+.?\d+?\%\s*coverage/ - tags: - - windows - allow_failure: true diff --git a/README.md b/README.md index 35616d6..e9b7f92 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,20 @@ # @pushrocks/smartpromise +simple promises and Deferred constructs -smart helpers that work with promises - -## Availabililty - -[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartq) -[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartq) -[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartq) -[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartq/) +## Availabililty and Links +* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartpromise) +* [gitlab.com (source)](https://gitlab.com/pushrocks/smartpromise) +* [github.com (source mirror)](https://github.com/pushrocks/smartpromise) +* [docs (typedoc)](https://pushrocks.gitlab.io/smartpromise/) ## Status for master - -[![build status](https://GitLab.com/pushrocks/smartq/badges/master/build.svg)](https://GitLab.com/pushrocks/smartq/commits/master) -[![coverage report](https://GitLab.com/pushrocks/smartq/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartq/commits/master) -[![npm downloads per month](https://img.shields.io/npm/dm/smartq.svg)](https://www.npmjs.com/package/smartq) -[![Dependency Status](https://david-dm.org/pushrocks/smartq.svg)](https://david-dm.org/pushrocks/smartq) -[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartq/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartq/master/dependencies/npm) -[![bitHound Code](https://www.bithound.io/github/pushrocks/smartq/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartq) -[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/) -[![node](https://img.shields.io/badge/node->=%208.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/) -[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) +[![build status](https://gitlab.com/pushrocks/smartpromise/badges/master/build.svg)](https://gitlab.com/pushrocks/smartpromise/commits/master) +[![coverage report](https://gitlab.com/pushrocks/smartpromise/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartpromise/commits/master) +[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartpromise.svg)](https://www.npmjs.com/package/@pushrocks/smartpromise) +[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartpromise/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartpromise) +[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) +[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) +[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/) ## Usage @@ -77,8 +72,9 @@ myPromisedFunction('helloThere', 2).then(x => { }) ``` -For further information read the linked docs at the top of this README. +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.html) -[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks) +[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://maintainedby.lossless.com) diff --git a/npmextra.json b/npmextra.json index 7ffba4e..f3df88b 100644 --- a/npmextra.json +++ b/npmextra.json @@ -4,5 +4,15 @@ "npmts" ], "npmAccessLevel": "public" + }, + "gitzone": { + "module": { + "githost": "gitlab.com", + "gitscope": "pushrocks", + "gitrepo": "smartpromise", + "shortDescription": "simple promises and Deferred constructs", + "npmPackagename": "@pushrocks/smartpromise", + "license": "MIT" + } } } \ No newline at end of file diff --git a/package.json b/package.json index 1b60781..de71887 100644 --- a/package.json +++ b/package.json @@ -25,4 +25,4 @@ "@types/node": "^10.5.1", "tapbundle": "^2.0.0" } -} +} \ No newline at end of file diff --git a/test/test.ts b/test/test.ts index 0d38392..36f1515 100644 --- a/test/test.ts +++ b/test/test.ts @@ -18,8 +18,12 @@ tap.test('should let types flow through the Promise', async () => { tap.test('should map callbacks', async () => { let inputArray = ['hi', 'awesome']; - const myPromisified = async (myInput) => { return myInput }; - const expectPromise = expect(q.map(inputArray, myPromisified)).to.eventually.deep.equal(inputArray); + const myPromisified = async myInput => { + return myInput; + }; + const expectPromise = expect(q.map(inputArray, myPromisified)).to.eventually.deep.equal( + inputArray + ); return expectPromise; }); diff --git a/ts/index.ts b/ts/index.ts index b619c3a..1c0dcb4 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -41,10 +41,10 @@ export let rejectedPromise = err => { }; interface IAsyncFunction { - (someArg: T):Promise + (someArg: T): Promise; } -export let map = async (inputArg: T[], functionArg: IAsyncFunction ) => { +export let map = async (inputArg: T[], functionArg: IAsyncFunction) => { let promiseArray: Promise[] = []; let resultArray = []; for (let item of inputArg) { diff --git a/tslint.json b/tslint.json index 45052ad..d4ea2e9 100644 --- a/tslint.json +++ b/tslint.json @@ -1,3 +1,17 @@ { - "extends": "tslint-config-standard" + "extends": ["tslint:latest", "tslint-config-prettier"], + "rules": { + "semicolon": [true, "always"], + "no-console": false, + "ordered-imports": false, + "object-literal-sort-keys": false, + "member-ordering": { + "options":{ + "order": [ + "static-method" + ] + } + } + }, + "defaultSeverity": "warning" }