fix(core): update

This commit is contained in:
Philipp Kunz 2022-10-26 18:41:04 +02:00
parent 9073d9a7f8
commit 0a3f6da174
17 changed files with 4440 additions and 4998 deletions

View File

@ -12,30 +12,38 @@ stages:
- release - release
- metadata - metadata
before_script:
- pnpm install -g pnpm
- pnpm install -g @shipzone/npmci
- npmci npm prepare
# ==================== # ====================
# security stage # security stage
# ==================== # ====================
mirror: # ====================
stage: security # security stage
script: # ====================
- npmci git mirror auditProductionDependencies:
tags:
- lossless
- docker
- notpriv
audit:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security stage: security
script: script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org - npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high - npmci command pnpm audit --audit-level=high --prod
tags: tags:
- lossless - lossless
- docker - docker
- notpriv allow_failure: true
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci command npm config set registry https://registry.npmjs.org
- npmci command pnpm audit --audit-level=high --dev
tags:
- lossless
- docker
allow_failure: true
# ==================== # ====================
# test stage # test stage
@ -44,28 +52,22 @@ audit:
testStable: testStable:
stage: test stage: test
script: script:
- npmci npm prepare
- npmci node install stable - npmci node install stable
- npmci npm install - npmci npm install
- npmci npm test - npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- lossless
- docker - docker
- priv
testBuild: testBuild:
stage: test stage: test
script: script:
- npmci npm prepare
- npmci node install stable - npmci node install stable
- npmci npm install - npmci npm install
- npmci command npm run build - npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- lossless
- docker - docker
- notpriv
release: release:
stage: release stage: release
@ -85,11 +87,12 @@ release:
codequality: codequality:
stage: metadata stage: metadata
allow_failure: true allow_failure: true
only:
- tags
script: script:
- npmci command npm install -g tslint typescript - npmci command npm install -g typescript
- npmci npm prepare - npmci npm prepare
- npmci npm install - npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags: tags:
- lossless - lossless
- docker - docker
@ -109,11 +112,9 @@ trigger:
pages: pages:
stage: metadata stage: metadata
script: script:
- npmci node install lts - npmci node install stable
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci npm install - npmci npm install
- npmci command tsdoc - npmci command npm run buildDocs
tags: tags:
- lossless - lossless
- docker - docker

4
.snyk
View File

@ -1,4 +0,0 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.12.0
ignore: {}
patch: {}

24
.vscode/launch.json vendored
View File

@ -2,28 +2,10 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "current file", "command": "npm test",
"type": "node", "name": "Run npm test",
"request": "launch", "request": "launch",
"args": [ "type": "node-terminal"
"${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"
} }
] ]
} }

View File

@ -15,7 +15,7 @@
"properties": { "properties": {
"projectType": { "projectType": {
"type": "string", "type": "string",
"enum": ["website", "element", "service", "npm"] "enum": ["website", "element", "service", "npm", "wcc"]
} }
} }
} }

22
LICENSE
View File

@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2015 Lossless GmbH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -57,7 +57,7 @@ Beautylog makes it easy to have all your node applications log to a remote locat
```javascript ```javascript
import { Loggly } from 'beautyremote'; import { Loggly } from 'beautyremote';
let myLogglyRemote = new Loggly({ let myLogglyRemote = new Loggly({
token: 'my_super_long_token_here' token: 'my_super_long_token_here',
}); });
beautylog.registerRemote(myLogglyRemote); beautylog.registerRemote(myLogglyRemote);
``` ```

View File

@ -9,7 +9,7 @@
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "pushrocks", "gitscope": "pushrocks",
"gitrepo": "smartlog-destination-local", "gitrepo": "smartlog-destination-local",
"shortDescription": "a smartlog destination targeting the local console", "description": "a smartlog destination targeting the local console",
"npmPackagename": "@pushrocks/smartlog-destination-local", "npmPackagename": "@pushrocks/smartlog-destination-local",
"license": "MIT" "license": "MIT"
} }

4875
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,8 @@
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(tstest test/)",
"build": "(tsbuild --web)" "build": "(tsbuild --web)",
"buildDocs": "tsdoc"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -27,17 +28,15 @@
"homepage": "https://gitlab.com/pushrocks/beautylog", "homepage": "https://gitlab.com/pushrocks/beautylog",
"dependencies": { "dependencies": {
"@pushrocks/consolecolor": "^2.0.1", "@pushrocks/consolecolor": "^2.0.1",
"@pushrocks/smartlog-interfaces": "^2.0.20", "@pushrocks/smartlog-interfaces": "^3.0.0",
"@pushrocks/smartpromise": "^3.0.6" "@pushrocks/smartpromise": "^3.1.7"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.24", "@gitzone/tsbuild": "^2.1.65",
"@gitzone/tsrun": "^1.2.12", "@gitzone/tsrun": "^1.2.39",
"@gitzone/tstest": "^1.0.33", "@gitzone/tstest": "^1.0.73",
"@pushrocks/tapbundle": "^3.2.1", "@pushrocks/tapbundle": "^5.0.4",
"@types/node": "^14.0.13", "@types/node": "^18.11.6"
"tslint": "^6.1.2",
"tslint-config-prettier": "^1.18.0"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",
@ -50,5 +49,9 @@
"cli.js", "cli.js",
"npmextra.json", "npmextra.json",
"readme.md" "readme.md"
],
"type": "module",
"browserslist": [
"last 1 chrome versions"
] ]
} }

4352
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -25,6 +25,10 @@ Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20W
## Usage ## Usage
## Contribution
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
## Contribution ## Contribution

View File

@ -1,6 +1,6 @@
import { tap, expect } from '@pushrocks/tapbundle'; import { tap, expect } from '@pushrocks/tapbundle';
import smartlogDesinationLocal = require('../ts/index'); import * as smartlogDesinationLocal from '../ts/index.js';
import { ILogContext } from '@pushrocks/smartlog-interfaces'; import { ILogContext } from '@pushrocks/smartlog-interfaces';
const testLogContext: ILogContext = { const testLogContext: ILogContext = {
@ -9,14 +9,14 @@ const testLogContext: ILogContext = {
containerName: 'gitlabci', containerName: 'gitlabci',
environment: 'staging', environment: 'staging',
runtime: 'node', runtime: 'node',
zone: 'shipzone' zone: 'shipzone',
}; };
let testLocalInstance: smartlogDesinationLocal.DestinationLocal; let testLocalInstance: smartlogDesinationLocal.DestinationLocal;
tap.test('should create a valid instance of DestinationLocal', async () => { tap.test('should create a valid instance of DestinationLocal', async () => {
testLocalInstance = new smartlogDesinationLocal.DestinationLocal(); testLocalInstance = new smartlogDesinationLocal.DestinationLocal();
expect(testLocalInstance).to.be.instanceof(smartlogDesinationLocal.DestinationLocal); expect(testLocalInstance).toBeInstanceOf(smartlogDesinationLocal.DestinationLocal);
}); });
tap.test('.log(message) should print a blue Dir message', async () => { tap.test('.log(message) should print a blue Dir message', async () => {
@ -28,8 +28,8 @@ tap.test('.log(message) should print a blue Dir message', async () => {
message: 'this is a info log message', message: 'this is a info log message',
correlation: { correlation: {
id: '123', id: '123',
type: 'none' type: 'none',
} },
}); });
}); });

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smartlog-destination-local',
version: '8.0.9',
description: 'a smartlog destination targeting the local console'
}

View File

@ -1,2 +1,2 @@
// export classes // export classes
export { DestinationLocal } from './sl.destlocal.classes.destinationlocal'; export { DestinationLocal } from './sl.destlocal.classes.destinationlocal.js';

View File

@ -1,4 +1,4 @@
import * as plugins from './sl.destlocal.plugins'; import * as plugins from './sl.destlocal.plugins.js';
import { ILogDestination, ILogPackage, TLogLevel } from '@pushrocks/smartlog-interfaces'; import { ILogDestination, ILogPackage, TLogLevel } from '@pushrocks/smartlog-interfaces';
// other beautylog classes // other beautylog classes
@ -46,13 +46,13 @@ export class DestinationLocal implements ILogDestination {
containerName: 'undefined', containerName: 'undefined',
environment: 'test', environment: 'test',
runtime: 'node', runtime: 'node',
zone: 'undefined' zone: 'undefined',
}, },
message: logTextArg, message: logTextArg,
correlation: { correlation: {
id: 'none', id: 'none',
type: 'none' type: 'none',
} },
}); });
} }
} }
@ -87,49 +87,49 @@ export class DestinationLocal implements ILogDestination {
} = { } = {
silly: { silly: {
prefix: plugins.consolecolor.coloredString(' silly ', 'white', 'blue') + ' ', prefix: plugins.consolecolor.coloredString(' silly ', 'white', 'blue') + ' ',
textColor: 'blue' textColor: 'blue',
}, },
error: { error: {
prefix: prefix:
plugins.consolecolor.coloredString(' ', 'red', 'red') + plugins.consolecolor.coloredString(' ', 'red', 'red') +
plugins.consolecolor.coloredString(' ERROR! ', 'red', 'black') + plugins.consolecolor.coloredString(' ERROR! ', 'red', 'black') +
' ', ' ',
textColor: 'red' textColor: 'red',
}, },
info: { info: {
prefix: prefix:
plugins.consolecolor.coloredString(' ', 'blue', 'blue') + plugins.consolecolor.coloredString(' ', 'blue', 'blue') +
plugins.consolecolor.coloredString(' info: ', 'blue', 'black') + plugins.consolecolor.coloredString(' info: ', 'blue', 'black') +
' ', ' ',
textColor: 'white' textColor: 'white',
}, },
note: { note: {
prefix: prefix:
plugins.consolecolor.coloredString(' ', 'pink', 'pink') + plugins.consolecolor.coloredString(' ', 'pink', 'pink') +
plugins.consolecolor.coloredString(' note -> ', 'pink', 'black') + plugins.consolecolor.coloredString(' note -> ', 'pink', 'black') +
' ', ' ',
textColor: 'pink' textColor: 'pink',
}, },
ok: { ok: {
prefix: prefix:
plugins.consolecolor.coloredString(' ', 'green', 'green') + plugins.consolecolor.coloredString(' ', 'green', 'green') +
plugins.consolecolor.coloredString(' ok ', 'green', 'black') + plugins.consolecolor.coloredString(' ok ', 'green', 'black') +
' ', ' ',
textColor: 'green' textColor: 'green',
}, },
success: { success: {
prefix: prefix:
plugins.consolecolor.coloredString(' ', 'green', 'green') + plugins.consolecolor.coloredString(' ', 'green', 'green') +
plugins.consolecolor.coloredString(' SUCCESS! ', 'green', 'black') + plugins.consolecolor.coloredString(' SUCCESS! ', 'green', 'black') +
' ', ' ',
textColor: 'green' textColor: 'green',
}, },
warn: { warn: {
prefix: prefix:
plugins.consolecolor.coloredString(' ', 'orange', 'orange') + plugins.consolecolor.coloredString(' ', 'orange', 'orange') +
plugins.consolecolor.coloredString(' WARN -> ', 'orange', 'black') + plugins.consolecolor.coloredString(' WARN -> ', 'orange', 'black') +
' ', ' ',
textColor: 'orange' textColor: 'orange',
} },
}; };
} }

10
tsconfig.json Normal file
View File

@ -0,0 +1,10 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext",
"esModuleInterop": true
}
}

View File

@ -1,17 +0,0 @@
{
"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"
}