fix(core): update

This commit is contained in:
Philipp Kunz 2020-02-07 16:36:35 +00:00
parent 69592933aa
commit 01fd22c7d0
13 changed files with 247 additions and 162 deletions

22
.gitignore vendored
View File

@ -1,4 +1,22 @@
node_modules/
.nogit/
# artifacts
coverage/
public/
pages/
coverage/
# installs
node_modules/
# caches
.yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_web/
dist_serve/
dist_ts_web/
# custom

View File

@ -1,16 +1,16 @@
# gitzone standard
image: hosttoday/ht-docker-node:npmci
# gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: "$CI_BUILD_STAGE"
- .npmci_cache/
key: '$CI_BUILD_STAGE'
stages:
- security
- test
- release
- metadata
- security
- test
- release
- metadata
# ====================
# security stage
@ -18,109 +18,103 @@ stages:
mirror:
stage: security
script:
- npmci git mirror
- npmci git mirror
tags:
- docker
- notpriv
- lossless
- docker
- notpriv
snyk:
image: registry.gitlab.com/hosttoday/ht-docker-node:snyk
stage: security
script:
- npmci command npm install -g snyk
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags:
- docker
- notpriv
- lossless
- docker
- notpriv
# ====================
# 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:
testStable:
stage: test
script:
- npmci node install lts
- npmci npm install
- npmci npm test
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
- lossless
- docker
- priv
testSTABLE:
testBuild:
stage: test
script:
- npmci node install stable
- npmci npm install
- npmci npm test
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
- lossless
- docker
- notpriv
release:
stage: release
script:
- npmci node install stable
- npmci npm publish
- npmci node install stable
- npmci npm publish
only:
- tags
- tags
tags:
- docker
- notpriv
- lossless
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
image: docker:stable
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--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]
- npmci command npm install -g tslint typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- docker
- priv
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
- npmci trigger
only:
- tags
- tags
tags:
- docker
- notpriv
- lossless
- docker
- notpriv
pages:
image: hosttoday/ht-docker-node:npmci
stage: metadata
script:
- npmci command npm install -g typedoc typescript
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
- npmci command tsdoc
tags:
- lossless
- docker
- notpriv
only:
@ -128,15 +122,5 @@ pages:
artifacts:
expire_in: 1 week
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
- public
allow_failure: true

29
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,29 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "current file",
"type": "node",
"request": "launch",
"args": [
"${relativeFile}"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "test.ts",
"type": "node",
"request": "launch",
"args": [
"test/test.ts"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
}
]
}

26
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,26 @@
{
"json.schemas": [
{
"fileMatch": ["/npmextra.json"],
"schema": {
"type": "object",
"properties": {
"npmci": {
"type": "object",
"description": "settings for npmci"
},
"gitzone": {
"type": "object",
"description": "settings for gitzone",
"properties": {
"projectType": {
"type": "string",
"enum": ["website", "element", "service", "npm"]
}
}
}
}
}
}
]
}

View File

@ -1,35 +0,0 @@
# smartinteract
smart cli interaction
## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartinteract)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartinteract)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartinteract)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartinteract/)
## Status for master
[![build status](https://GitLab.com/pushrocks/smartinteract/badges/master/build.svg)](https://GitLab.com/pushrocks/smartinteract/commits/master)
[![coverage report](https://GitLab.com/pushrocks/smartinteract/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartinteract/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smartinteract.svg)](https://www.npmjs.com/package/smartinteract)
[![Dependency Status](https://david-dm.org/pushrocks/smartinteract.svg)](https://david-dm.org/pushrocks/smartinteract)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartinteract/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartinteract/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartinteract/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartinteract)
[![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->=%206.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/)
## Usage
Use TypeScript for best in class instellisense.
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)

View File

@ -1,6 +1,17 @@
{
"gitzone": {
"projectType": "npm",
"module": {
"githost": {},
"gitscope": {},
"gitrepo": {},
"shortDescription": {},
"npmPackagename": {},
"license": {}
}
},
"npmci": {
"npmGlobalTools": ["npmts"],
"npmGlobalTools": [],
"npmAccessLevel": "public"
}
}

48
package-lock.json generated
View File

@ -63,14 +63,15 @@
}
},
"@pushrocks/lik": {
"version": "3.0.13",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.13.tgz",
"integrity": "sha512-YDxYoh2UksEfUxcjSjTwLsW5j852E5FrMG62CUi1I7ZpBxf96b7P1t2pRWsQsNnHRz6FHckW/A1V6XKASB+jZA==",
"version": "3.0.17",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.17.tgz",
"integrity": "sha512-Ip56GDuW/ReBPhRVIhaqosqXu12SBW1DT3GkY8hOTiF1YNdKxiaw13QOPva6KPeTffb9DTThOu352KvjMrfxRw==",
"requires": {
"@pushrocks/smartdelay": "^2.0.6",
"@pushrocks/smartpromise": "^3.0.6",
"@pushrocks/smartrx": "^2.0.5",
"@pushrocks/smarttime": "^3.0.12",
"@pushrocks/smartunique": "^3.0.1",
"@types/minimatch": "^3.0.3",
"minimatch": "^3.0.4",
"symbol-tree": "^3.2.4"
@ -209,6 +210,17 @@
"luxon": "^1.16.0"
}
},
"@pushrocks/smartunique": {
"version": "3.0.1",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartunique/-/smartunique-3.0.1.tgz",
"integrity": "sha512-xBu9ZB4C0BA0S/pbFFZn2ItPfnodPKpzrYIq1yN5XDs6OaookwcDF/iBwfS9+EYMSPENC9wAsOxg2RGMm4Qicw==",
"requires": {
"@types/shortid": "^0.0.29",
"@types/uuid": "^3.0.0",
"shortid": "^2.2.8",
"uuid": "^3.1.0"
}
},
"@pushrocks/tapbundle": {
"version": "3.2.0",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-3.2.0.tgz",
@ -401,7 +413,7 @@
},
"@types/minimatch": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
"resolved": "https://verdaccio.lossless.one/@types%2fminimatch/-/minimatch-3.0.3.tgz",
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
},
"@types/node": {
@ -409,6 +421,11 @@
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.3.tgz",
"integrity": "sha512-jQ1p+SyF/z8ygPxfSPKZKMWazlCgTBSyIaC1UCUvkLHDdxdmPQtQFk02X4WFM31Z1BKMAS3MSAK0cRP2c92n6Q=="
},
"@types/shortid": {
"version": "0.0.29",
"resolved": "https://verdaccio.lossless.one/@types%2fshortid/-/shortid-0.0.29.tgz",
"integrity": "sha1-gJPuBBam4r8qpjOBCRFLP7/6Dps="
},
"@types/through": {
"version": "0.0.30",
"resolved": "https://verdaccio.lossless.one/@types%2fthrough/-/through-0.0.30.tgz",
@ -426,6 +443,11 @@
"@types/node": "*"
}
},
"@types/uuid": {
"version": "3.4.7",
"resolved": "https://verdaccio.lossless.one/@types%2fuuid/-/uuid-3.4.7.tgz",
"integrity": "sha512-C2j2FWgQkF1ru12SjZJyMaTPxs/f6n90+5G5qNakBxKXjTBc/YTSelHh4Pz1HUDwxFXD9WvpQhOGCDC+/Y4mIQ=="
},
"agentkeepalive": {
"version": "4.1.0",
"resolved": "https://verdaccio.lossless.one/agentkeepalive/-/agentkeepalive-4.1.0.tgz",
@ -960,6 +982,11 @@
"resolved": "https://verdaccio.lossless.one/mute-stream/-/mute-stream-0.0.8.tgz",
"integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA=="
},
"nanoid": {
"version": "2.1.11",
"resolved": "https://verdaccio.lossless.one/nanoid/-/nanoid-2.1.11.tgz",
"integrity": "sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA=="
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
@ -1072,6 +1099,14 @@
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true
},
"shortid": {
"version": "2.2.15",
"resolved": "https://verdaccio.lossless.one/shortid/-/shortid-2.2.15.tgz",
"integrity": "sha512-5EaCy2mx2Jgc/Fdn9uuDuNIIfWBpzY4XIlhoqtXF6qsf+/+SGZ+FxDdX/ZsMZiWupIWNqAEmiNY4RC+LSmCeOw==",
"requires": {
"nanoid": "^2.1.0"
}
},
"signal-exit": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
@ -1275,6 +1310,11 @@
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
"dev": true
},
"uuid": {
"version": "3.4.0",
"resolved": "https://verdaccio.lossless.one/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",

View File

@ -25,7 +25,7 @@
},
"homepage": "https://gitlab.com/pushrocks/smartinteract#README",
"dependencies": {
"@pushrocks/lik": "^3.0.13",
"@pushrocks/lik": "^3.0.17",
"@pushrocks/smartparam": "^1.1.6",
"@pushrocks/smartpromise": "^3.0.6",
"@types/inquirer": "^6.5.0",
@ -36,5 +36,16 @@
"@pushrocks/tapbundle": "^3.2.0",
"tslint": "^6.0.0",
"tslint-config-prettier": "^1.18.0"
}
},
"files": [
"ts/**/*",
"ts_web/**/*",
"dist/**/*",
"dist_web/**/*",
"dist_ts_web/**/*",
"assets/**/*",
"cli.js",
"npmextra.json",
"readme.md"
]
}

View File

@ -1,25 +1,20 @@
# smartinteract
# @[object Object]/[object Object]
[object Object]
smart cli interaction
## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartinteract)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartinteract)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartinteract)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartinteract/)
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/[object Object])
* [gitlab.com (source)](https://[object Object]/[object Object]/[object Object])
* [github.com (source mirror)](https://github.com/[object Object]/[object Object])
* [docs (typedoc)](https://[object Object].gitlab.io/[object Object]/)
## Status for master
[![build status](https://GitLab.com/pushrocks/smartinteract/badges/master/build.svg)](https://GitLab.com/pushrocks/smartinteract/commits/master)
[![coverage report](https://GitLab.com/pushrocks/smartinteract/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartinteract/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smartinteract.svg)](https://www.npmjs.com/package/smartinteract)
[![Dependency Status](https://david-dm.org/pushrocks/smartinteract.svg)](https://david-dm.org/pushrocks/smartinteract)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartinteract/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartinteract/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartinteract/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartinteract)
[![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->=%206.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/)
[![pipeline status](https://[object Object]/[object Object]/[object Object]/badges/master/pipeline.svg)](https://[object Object]/[object Object]/[object Object]/commits/master)
[![coverage report](https://[object Object]/[object Object]/[object Object]/badges/master/coverage.svg)](https://[object Object]/[object Object]/[object Object]/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/[object Object].svg)](https://www.npmjs.com/package/[object Object])
[![Known Vulnerabilities](https://snyk.io/test/npm/[object Object]/badge.svg)](https://snyk.io/test/npm/[object Object])
[![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
@ -56,7 +51,7 @@ myInteract.askQuestion{ // note: its an array. You can specify multiple question
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)
> [object Object] licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)

View File

@ -63,7 +63,7 @@ export class SmartInteract {
* skips the queue
*/
askQuestion(optionsArg: IQuestionObject): Promise<IAnswerObject> {
let done = smartpromise.defer<IAnswerObject>();
const done = smartpromise.defer<IAnswerObject>();
if (this.isValidEnv()) {
plugins.inquirer
.prompt([
@ -76,9 +76,9 @@ export class SmartInteract {
validate: optionsArg.validate
}
])
.then((answers) => {
.then(answers => {
// adjust to the fact that now dots define paths for inquirer
let answerValue = plugins.smartparam.smartGet(answers, optionsArg.name);
const answerValue = plugins.smartparam.smartGet(answers, optionsArg.name);
done.resolve({
name: optionsArg.name,
value: answerValue
@ -88,7 +88,7 @@ export class SmartInteract {
console.log(err);
});
} else {
let answer: IAnswerObject = {
const answer: IAnswerObject = {
name: optionsArg.name,
value: optionsArg.default
};
@ -109,12 +109,12 @@ export class SmartInteract {
* run the question queue
*/
runQueue() {
let done = smartpromise.defer<AnswerBucket>();
let answerBucket = new AnswerBucket();
let handleQuestion = async () => {
const done = smartpromise.defer<AnswerBucket>();
const answerBucket = new AnswerBucket();
const handleQuestion = async () => {
if (!this.questionMap.isEmpty()) {
let oneQuestion = this.questionMap.getOneAndRemove();
let answer: IAnswerObject = await this.askQuestion(oneQuestion);
const oneQuestion = this.questionMap.getOneAndRemove();
const answer: IAnswerObject = await this.askQuestion(oneQuestion);
answerBucket.addAnswer(answer);
handleQuestion(); // recursion: as questions until empty
} else {

View File

@ -2,11 +2,7 @@
import * as lik from '@pushrocks/lik';
import * as smartparam from '@pushrocks/smartparam';
export {
lik,
smartparam
}
export { lik, smartparam };
// third party scope
import * as inquirer from 'inquirer';

View File

@ -1,7 +1,17 @@
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"]
"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"
}