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 - release
- metadata - metadata
before_script:
- npm install -g @shipzone/npmci
# ==================== # ====================
# security stage # security stage
# ==================== # ====================
@ -97,10 +100,9 @@ codequality:
only: only:
- tags - 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
@ -120,11 +122,10 @@ 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 prepare
- npmci npm install - npmci npm install
- npmci command tsdoc - npmci command npm run buildDocs
tags: tags:
- lossless - lossless
- docker - docker

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

@ -5,7 +5,7 @@
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "pushrocks", "gitscope": "pushrocks",
"gitrepo": "smartlog", "gitrepo": "smartlog",
"shortDescription": "minimalistic distributed and extensible logging tool", "description": "minimalistic distributed and extensible logging tool",
"npmPackagename": "@pushrocks/smartlog", "npmPackagename": "@pushrocks/smartlog",
"license": "MIT", "license": "MIT",
"projectDomain": "push.rocks" "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": { "scripts": {
"test": "(tstest test/)", "test": "(tstest test/)",
"build": "(tsbuild --web && tsbundle npm)", "build": "(tsbuild --web && tsbundle npm)",
"format": "(gitzone format)" "format": "(gitzone format)",
"buildDocs": "tsdoc"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.25", "@gitzone/tsbuild": "^2.1.25",
@ -48,5 +49,6 @@
], ],
"browserslist": [ "browserslist": [
"last 1 chrome versions" "last 1 chrome versions"
] ],
} "type": "module"
}

View File

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

View File

@ -1,5 +1,5 @@
import { expect, tap } from '@pushrocks/tapbundle'; import { expect, tap } from '@pushrocks/tapbundle';
import * as smartlog from '../ts/index'; import * as smartlog from '../ts/index.js';
let testConsoleLog: smartlog.ConsoleLog; let testConsoleLog: smartlog.ConsoleLog;
let testSmartLog: smartlog.Smartlog; 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 * as plugins from './smartlog.plugins.js';
import { ConsoleLog } from './smartlog.classes.consolelog'; import { ConsoleLog } from './smartlog.classes.consolelog.js';
import { LogGroup } from './smartlog.classes.loggroup'; import { LogGroup } from './smartlog.classes.loggroup.js';
import { Smartlog } from './smartlog.classes.smartlog'; import { Smartlog } from './smartlog.classes.smartlog.js';
export { ConsoleLog, LogGroup, Smartlog }; 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 * a console log optimized for smartlog

View File

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