BREAKING CHANGE(core): switch to esm

This commit is contained in:
Philipp Kunz 2022-06-26 10:35:35 +02:00
parent d5d6d7bf79
commit 964666902f
14 changed files with 4602 additions and 18462 deletions

View File

@ -12,6 +12,9 @@ stages:
- release
- metadata
before_script:
- npm install -g @shipzone/npmci
# ====================
# security stage
# ====================
@ -97,10 +100,9 @@ codequality:
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
@ -120,11 +122,10 @@ trigger:
pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci node install stable
- npmci npm prepare
- npmci npm install
- npmci command tsdoc
- npmci command npm run buildDocs
tags:
- lossless
- docker

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

@ -5,7 +5,7 @@
"githost": "gitlab.com",
"gitscope": "pushrocks",
"gitrepo": "smartlog",
"shortDescription": "minimalistic distributed and extensible logging tool",
"description": "minimalistic distributed and extensible logging tool",
"npmPackagename": "@pushrocks/smartlog",
"license": "MIT",
"projectDomain": "push.rocks"

22962
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,8 @@
"scripts": {
"test": "(tstest test/)",
"build": "(tsbuild --web && tsbundle npm)",
"format": "(gitzone format)"
"format": "(gitzone format)",
"buildDocs": "tsdoc"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.25",
@ -48,5 +49,6 @@
],
"browserslist": [
"last 1 chrome versions"
]
}
],
"type": "module"
}

View File

@ -1,5 +1,5 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartlog from '../ts/index';
import * as smartlog from '../ts/index.js';
let testConsoleLog: smartlog.ConsoleLog;
let testSmartLog: smartlog.Smartlog;

View File

@ -1,5 +1,5 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartlog from '../ts/index';
import * as smartlog from '../ts/index.js';
let testConsoleLog: smartlog.ConsoleLog;
let testSmartLog: smartlog.Smartlog;

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',
version: '3.0.0',
description: 'minimalistic distributed and extensible logging tool'
}

View File

@ -1,6 +1,6 @@
import * as plugins from './smartlog.plugins';
import { ConsoleLog } from './smartlog.classes.consolelog';
import { LogGroup } from './smartlog.classes.loggroup';
import { Smartlog } from './smartlog.classes.smartlog';
import * as plugins from './smartlog.plugins.js';
import { ConsoleLog } from './smartlog.classes.consolelog.js';
import { LogGroup } from './smartlog.classes.loggroup.js';
import { Smartlog } from './smartlog.classes.smartlog.js';
export { ConsoleLog, LogGroup, Smartlog };

View File

@ -1,4 +1,4 @@
import * as plugins from './smartlog.plugins';
import * as plugins from './smartlog.plugins.js';
/**
* a console log optimized for smartlog

View File

@ -1,5 +1,5 @@
import * as plugins from './smartlog.plugins';
import { Smartlog } from './smartlog.classes.smartlog';
import * as plugins from './smartlog.plugins.js';
import { Smartlog } from './smartlog.classes.smartlog.js';
export class LogGroup {
public smartlogRef: Smartlog;

View File

@ -1,4 +1,4 @@
import * as plugins from './smartlog.plugins';
import * as plugins from './smartlog.plugins.js';
import { ILogDestination, ILogPackage } from '@pushrocks/smartlog-interfaces';

View File

@ -1,7 +1,7 @@
import * as plugins from './smartlog.plugins';
import * as plugins from './smartlog.plugins.js';
import { LogRouter } from './smartlog.classes.logrouter';
import { LogGroup } from '.';
import { LogRouter } from './smartlog.classes.logrouter.js';
import { LogGroup } from './smartlog.classes.loggroup.js';
export interface ISmartlogContructorOptions {
logContext: plugins.smartlogInterfaces.ILogContext;
@ -24,7 +24,7 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
constructor(optionsArg: ISmartlogContructorOptions) {
this.logContext = optionsArg.logContext;
this.minimumLogLevel = optionsArg.minimumLogLevel;
this.minimumLogLevel = optionsArg.minimumLogLevel || 'silly';
}
// ============
@ -50,7 +50,7 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
default:
this.log('info', logString);
}
return;
return true;
}
// fileStream.write(args[0]);
write.apply(process.stdout, args);
@ -60,7 +60,7 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
process.stderr.write = (...args: any) => {
if (!args[0].startsWith('LOG')) {
this.log('error', args[0]);
return;
return true;
}
// fileStream.write(args[0]);
write.apply(process.stderr, args);

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