fix(core): update

This commit is contained in:
Philipp Kunz 2022-03-07 22:08:32 +01:00
parent 5bce57203e
commit d1936a94bc
7 changed files with 39 additions and 40 deletions

View File

@ -12,6 +12,9 @@ stages:
- release - release
- metadata - metadata
before_script:
- npm install -g @shipzone/npmci
# ==================== # ====================
# security stage # security stage
# ==================== # ====================
@ -19,23 +22,36 @@ mirror:
stage: security stage: security
script: script:
- npmci git mirror - npmci git mirror
only:
- tags
tags: tags:
- lossless - lossless
- docker - docker
- notpriv - notpriv
audit: auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
allow_failure: true
auditDevDependencies:
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 npm prepare
- npmci command npm install --ignore-scripts - 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 npm audit --audit-level=high --only=dev
tags: tags:
- lossless
- docker - docker
- notpriv allow_failure: true
# ==================== # ====================
# test stage # test stage
@ -50,9 +66,7 @@ testStable:
- 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
@ -63,9 +77,7 @@ testBuild:
- 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,6 +97,8 @@ 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 tslint typescript
- npmci npm prepare - npmci npm prepare

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

View File

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

View File

@ -36,5 +36,8 @@
"cli.js", "cli.js",
"npmextra.json", "npmextra.json",
"readme.md" "readme.md"
],
"browserslist": [
"last 1 chrome versions"
] ]
} }

View File

@ -7,7 +7,7 @@ import * as smartlogReceiver from '../ts/index';
let testReceiver: smartlogReceiver.SmartlogReceiver; let testReceiver: smartlogReceiver.SmartlogReceiver;
let testSmartlog = new smartlog.Smartlog({ let testSmartlog = new smartlog.Smartlog({
logContext: null, logContext: null,
minimumLogLevel: 'debug' minimumLogLevel: 'debug',
}); });
testSmartlog.enableConsole(); testSmartlog.enableConsole();
@ -17,7 +17,7 @@ tap.test('should create a valid SmartlogReceiver', async () => {
smartlogInstance: testSmartlog, smartlogInstance: testSmartlog,
validatorFunction: async () => { validatorFunction: async () => {
return true; return true;
} },
}); });
expect(testReceiver).toBeInstanceOf(smartlogReceiver.SmartlogReceiver); expect(testReceiver).toBeInstanceOf(smartlogReceiver.SmartlogReceiver);
}); });
@ -33,16 +33,16 @@ tap.test('should receive a message', async () => {
containerName: null, containerName: null,
environment: 'staging', environment: 'staging',
runtime: 'node', runtime: 'node',
zone: 'gitzone' zone: 'gitzone',
}, },
level: 'info', level: 'info',
type: 'log', type: 'log',
correlation: { correlation: {
id: '123', id: '123',
type: 'none' type: 'none',
},
message: 'hi there',
}, },
message: 'hi there'
}
}); });
}); });

View File

@ -3,7 +3,7 @@ import * as plugins from './sl.receiver.plugins';
import { import {
ILogPackage, ILogPackage,
ILogPackageAuthenticated, ILogPackageAuthenticated,
ILogDestination ILogDestination,
} from '@pushrocks/smartlog-interfaces'; } from '@pushrocks/smartlog-interfaces';
export type TValidatorFunction = (logPackage: ILogPackage) => Promise<boolean>; export type TValidatorFunction = (logPackage: ILogPackage) => Promise<boolean>;
@ -26,7 +26,7 @@ export class SmartlogReceiver {
this.passphrase = smartlogReceiverOptions.passphrase; this.passphrase = smartlogReceiverOptions.passphrase;
this.validatorFunction = this.validatorFunction =
smartlogReceiverOptions.validatorFunction || smartlogReceiverOptions.validatorFunction ||
(async logpackageArg => { (async (logpackageArg) => {
return true; return true;
}); });
this.smartlogInstance = smartlogReceiverOptions.smartlogInstance; this.smartlogInstance = smartlogReceiverOptions.smartlogInstance;