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
- metadata
before_script:
- pnpm install -g pnpm
- pnpm install -g @shipzone/npmci
- npmci npm prepare
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
tags:
- lossless
- docker
- notpriv
audit:
# ====================
# security stage
# ====================
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high
- npmci command npm config set registry https://registry.npmjs.org
- npmci command pnpm audit --audit-level=high --prod
tags:
- lossless
- 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
@ -44,28 +52,22 @@ audit:
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- lossless
- docker
- priv
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- lossless
- docker
- notpriv
release:
stage: release
@ -85,11 +87,12 @@ release:
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g tslint typescript
- npmci command npm install -g typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- lossless
- docker
@ -109,11 +112,9 @@ trigger:
pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command tsdoc
- npmci command npm run buildDocs
tags:
- lossless
- 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",
"configurations": [
{
"name": "current file",
"type": "node",
"command": "npm test",
"name": "Run npm test",
"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"
"type": "node-terminal"
}
]
}

View File

@ -15,7 +15,7 @@
"properties": {
"projectType": {
"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
import { Loggly } from 'beautyremote';
let myLogglyRemote = new Loggly({
token: 'my_super_long_token_here'
token: 'my_super_long_token_here',
});
beautylog.registerRemote(myLogglyRemote);
```

View File

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

4352
pnpm-lock.yaml 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
## 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

View File

@ -1,6 +1,6 @@
import { tap, expect } from '@pushrocks/tapbundle';
import smartlogDesinationLocal = require('../ts/index');
import * as smartlogDesinationLocal from '../ts/index.js';
import { ILogContext } from '@pushrocks/smartlog-interfaces';
const testLogContext: ILogContext = {
@ -9,14 +9,14 @@ const testLogContext: ILogContext = {
containerName: 'gitlabci',
environment: 'staging',
runtime: 'node',
zone: 'shipzone'
zone: 'shipzone',
};
let testLocalInstance: smartlogDesinationLocal.DestinationLocal;
tap.test('should create a valid instance of DestinationLocal', async () => {
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 () => {
@ -28,8 +28,8 @@ tap.test('.log(message) should print a blue Dir message', async () => {
message: 'this is a info log message',
correlation: {
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 { 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';
// other beautylog classes
@ -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',
},
};
}

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"
}