From 62ff7ec717f196545ee3263065159155782eaa04 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Thu, 11 Jun 2020 10:38:19 +0000 Subject: [PATCH] fix(core): update --- .gitignore | 4 +- .gitlab-ci.yml | 96 ++++++++++++--------- .vscode/launch.json | 29 +++++++ .vscode/settings.json | 26 ++++++ README.md | 26 ------ npmextra.json | 1 + package.json | 14 +-- ts/sl.destlocal.classes.destinationlocal.ts | 22 ++--- ts/sl.destlocal.plugins.ts | 2 +- 9 files changed, 130 insertions(+), 90 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json delete mode 100644 README.md diff --git a/.gitignore b/.gitignore index 91c0db0..ef13c79 100644 --- a/.gitignore +++ b/.gitignore @@ -15,8 +15,6 @@ node_modules/ # builds dist/ -dist_web/ -dist_serve/ -dist_ts_web/ +dist_*/ # custom \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 63b309d..8ebc8b5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,16 +1,16 @@ # gitzone ci_default -image: hosttoday/ht-docker-node:npmci +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,60 +18,66 @@ stages: mirror: stage: security script: - - npmci git mirror + - npmci git mirror tags: - - docker - - notpriv + - lossless + - docker + - notpriv -snyk: +audit: + image: registry.gitlab.com/hosttoday/ht-docker-node:npmci stage: security script: - npmci npm prepare - - npmci command npm install -g snyk - npmci command npm install --ignore-scripts - - npmci command snyk test + - npmci command npm config set registry https://registry.npmjs.org + - npmci command npm audit --audit-level=high tags: - - docker - - notpriv + - lossless + - docker + - notpriv # ==================== # test stage # ==================== -testLTS: +testStable: stage: test script: - - npmci npm prepare - - 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 - -testSTABLE: + - lossless + - docker + - priv + +testBuild: stage: test script: - - npmci npm prepare - - 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 @@ -81,31 +87,35 @@ codequality: allow_failure: true script: - 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 node install lts - npmci command npm install -g @gitzone/tsdoc - npmci npm prepare - npmci npm install - npmci command tsdoc tags: + - lossless - docker - notpriv only: @@ -113,5 +123,5 @@ pages: artifacts: expire_in: 1 week paths: - - public + - public allow_failure: true diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..112db52 --- /dev/null +++ b/.vscode/launch.json @@ -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" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..01d2b8d --- /dev/null +++ b/.vscode/settings.json @@ -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"] + } + } + } + } + } + } + ] +} diff --git a/README.md b/README.md deleted file mode 100644 index 7ce2514..0000000 --- a/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# @pushrocks/smartlog-destination-local -a smartlog destination targeting the local console - -## Availabililty and Links -* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartlog-destination-local) -* [gitlab.com (source)](https://gitlab.com/pushrocks/smartlog-destination-local) -* [github.com (source mirror)](https://github.com/pushrocks/smartlog-destination-local) -* [docs (typedoc)](https://pushrocks.gitlab.io/smartlog-destination-local/) - -## Status for master -[![build status](https://gitlab.com/pushrocks/smartlog-destination-local/badges/master/build.svg)](https://gitlab.com/pushrocks/smartlog-destination-local/commits/master) -[![coverage report](https://gitlab.com/pushrocks/smartlog-destination-local/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartlog-destination-local/commits/master) -[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartlog-destination-local.svg)](https://www.npmjs.com/package/@pushrocks/smartlog-destination-local) -[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartlog-destination-local/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartlog-destination-local) -[![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 - -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://maintainedby.lossless.com) diff --git a/npmextra.json b/npmextra.json index 32dc8e9..e794e0f 100644 --- a/npmextra.json +++ b/npmextra.json @@ -4,6 +4,7 @@ "npmAccessLevel": "public" }, "gitzone": { + "projectType": "npm", "module": { "githost": "gitlab.com", "gitscope": "pushrocks", diff --git a/package.json b/package.json index 9e23b3b..0b3e52e 100644 --- a/package.json +++ b/package.json @@ -40,13 +40,15 @@ "tslint-config-prettier": "^1.18.0" }, "files": [ - "ts/*", - "ts_web/*", - "dist/*", - "dist_web/*", - "assets/*", + "ts/**/*", + "ts_web/**/*", + "dist/**/*", + "dist_*/**/*", + "dist_ts/**/*", + "dist_ts_web/**/*", + "assets/**/*", "cli.js", "npmextra.json", "readme.md" ] -} +} \ No newline at end of file diff --git a/ts/sl.destlocal.classes.destinationlocal.ts b/ts/sl.destlocal.classes.destinationlocal.ts index 8e94a54..6290223 100644 --- a/ts/sl.destlocal.classes.destinationlocal.ts +++ b/ts/sl.destlocal.classes.destinationlocal.ts @@ -46,13 +46,13 @@ export class DestinationLocal implements ILogDestination { containerName: 'undefined', environment: 'test', runtime: 'node', - zone: 'undefined', + zone: 'undefined' }, message: logTextArg, correlation: { id: 'none', - type: 'none', - }, + type: 'none' + } }); } } @@ -87,49 +87,49 @@ export class DestinationLocal implements ILogDestination { } = { silly: { prefix: plugins.consolecolor.coloredString(' silly ', 'white', 'blue') + ' ', - textColor: 'blue', + textColor: 'blue' }, error: { prefix: plugins.consolecolor.coloredString(' ', 'red', 'red') + plugins.consolecolor.coloredString(' ERROR! ', 'red', 'black') + ' ', - textColor: 'red', + textColor: 'red' }, info: { prefix: plugins.consolecolor.coloredString(' ', 'blue', 'blue') + plugins.consolecolor.coloredString(' info: ', 'blue', 'black') + ' ', - textColor: 'white', + textColor: 'white' }, note: { prefix: plugins.consolecolor.coloredString(' ', 'pink', 'pink') + plugins.consolecolor.coloredString(' note -> ', 'pink', 'black') + ' ', - textColor: 'pink', + textColor: 'pink' }, ok: { prefix: plugins.consolecolor.coloredString(' ', 'green', 'green') + plugins.consolecolor.coloredString(' ok ', 'green', 'black') + ' ', - textColor: 'green', + textColor: 'green' }, success: { prefix: plugins.consolecolor.coloredString(' ', 'green', 'green') + plugins.consolecolor.coloredString(' SUCCESS! ', 'green', 'black') + ' ', - textColor: 'green', + textColor: 'green' }, warn: { prefix: plugins.consolecolor.coloredString(' ', 'orange', 'orange') + plugins.consolecolor.coloredString(' WARN -> ', 'orange', 'black') + ' ', - textColor: 'orange', - }, + textColor: 'orange' + } }; } diff --git a/ts/sl.destlocal.plugins.ts b/ts/sl.destlocal.plugins.ts index d94e457..f339d65 100644 --- a/ts/sl.destlocal.plugins.ts +++ b/ts/sl.destlocal.plugins.ts @@ -2,4 +2,4 @@ import * as consolecolor from '@pushrocks/consolecolor'; import * as smartlogInterfaces from '@pushrocks/smartlog-interfaces'; import * as smartpromise from '@pushrocks/smartpromise'; -export { consolecolor, smartlogInterfaces, smartpromise}; +export { consolecolor, smartlogInterfaces, smartpromise };