@decaf-ts/logging 0.0.16 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decaf-ts/logging",
3
- "version": "0.0.16",
3
+ "version": "0.1.0",
4
4
  "description": "simple winston inspired wrapper for cross lib logging",
5
5
  "type": "module",
6
6
  "exports": {
@@ -16,23 +16,29 @@
16
16
  "types": "lib/index.d.ts",
17
17
  "scripts": {
18
18
  "do-install": "TOKEN=$(cat .token) npm install",
19
+ "update-dependencies": "npm update @decaf-ts/*",
20
+ "update-scripts": "npx update-scripts",
21
+ "on-first-run": "npx update-scripts --boot",
22
+ "set-git-auth": "git config url.\"https://api:$(cat .token)@github.com/\".insteadOf \"https://github.com/\" && git config url.\"https://ssh:$(cat .token)@github.com/\".insteadOf \"ssh://git@github.com/\" && git config url.\"https://git:$(cat .token)@github.com/\".insteadOf \"git@github.com:\"",
19
23
  "flash-forward": "npx npm-check-updates -u && npm run do-install",
20
24
  "reset": "rm -rf * && git checkout . && git pull && npm run do-install",
21
- "build": "rimraf ./lib && rimraf ./dist && gulp dev",
22
- "build:prod": "rimraf ./lib && rimraf ./dist && gulp prod",
23
- "test": "jest --coverage --testPathPattern=\"/tests/unit\" --passWithNoTests --detectOpenHandles",
24
- "test:integration": "jest --coverage --testPathPattern=\"/tests/(integration)\" --passWithNoTests --detectOpenHandles",
25
- "test:all": "jest --coverage --testPathPattern=\"/tests/(unit|integration)\" --passWithNoTests --detectOpenHandles",
25
+ "build": "npx build-scripts --dev",
26
+ "build:prod": "npx build-scripts --prod",
27
+ "test": "jest --runInBand --coverage --detectOpenHandles",
28
+ "test:unit": "jest --testPathPattern=\"/tests/unit\" --passWithNoTests --detectOpenHandles",
29
+ "test:integration": "jest --testPathPattern=\"/tests/(integration)\" --passWithNoTests --detectOpenHandles",
30
+ "test:all": "jest --testPathPattern=\"/tests\" --passWithNoTests --detectOpenHandles",
31
+ "test:circular": "dpdm -T --no-warning --no-tree ./src/index.ts",
32
+ "coverage": "rimraf ./workdocs/reports/data/*.json && npm run test:all -- --coverage --config=./workdocs/reports/jest.coverage.config.ts",
26
33
  "lint": "eslint .",
27
34
  "lint-fix": "eslint --fix .",
28
- "test:circular": "dpdm -T --no-warning --no-tree ./src/index.ts",
29
35
  "prepare-release": "npm run lint-fix && npm run build:prod && npm run coverage && npm run docs",
30
36
  "release": "./bin/tag-release.sh",
31
37
  "clean-publish": "npx clean-publish",
32
- "coverage": "npm run test:all && cd workdocs && jest-coverage-badges",
33
38
  "drawings": "for FILE in workdocs/drawings/*.drawio; do echo \"converting $FILE to image...\" && docker run --rm -v $(pwd):/data rlespinasse/drawio-export --format png $FILE; done && cp -rf workdocs/drawings/export/* workdocs/resources/",
34
39
  "uml": "cd workdocs/uml && for FILE in ./*.puml; do docker run --rm -v $(pwd):/work -w /work miy4/plantuml -DPLANTUML_LIMIT_SIZE=8192 -tpng $FILE; done && cd ../.. && cp -fr workdocs/uml/*.png workdocs/resources/",
35
- "docs": "npx rimraf ./docs && mkdir docs && npm run do-install -- better-docs taffydb && gulp docs; npm remove better-docs taffydb"
40
+ "docs": "npx rimraf ./docs && mkdir docs && npx build-scripts --docs",
41
+ "publish-docs": "docker run -it --rm --user $(id -u):$(id -g) -v \"$(pwd)/workdocs/confluence:/content\" -e ATLASSIAN_API_TOKEN=$(cat .confluence-token) ghcr.io/markdown-confluence/publish:latest"
36
42
  },
37
43
  "repository": {
38
44
  "type": "git",
@@ -58,49 +64,37 @@
58
64
  },
59
65
  "homepage": "https://github.com/decaf-ts/logging#readme",
60
66
  "devDependencies": {
61
- "@eslint/js": "^9.22.0",
67
+ "@decaf-ts/utils": "latest",
68
+ "@eslint/js": "^9.25.1",
69
+ "@rollup/plugin-commonjs": "^28.0.3",
70
+ "@rollup/plugin-json": "^6.1.0",
71
+ "@rollup/plugin-node-resolve": "^16.0.1",
72
+ "@rollup/plugin-typescript": "^12.1.2",
62
73
  "@stylistic/eslint-plugin": "^4.2.0",
63
74
  "@types/jest": "^29.5.14",
64
75
  "clean-publish": "^5.1.0",
65
76
  "dpdm": "^3.14.0",
66
- "eslint": "^9.22.0",
67
- "eslint-config-prettier": "^10.1.1",
68
- "eslint-plugin-prettier": "^5.2.3",
77
+ "eslint": "^9.25.1",
78
+ "eslint-config-prettier": "^10.1.2",
79
+ "eslint-plugin-prettier": "^5.2.6",
69
80
  "globals": "^16.0.0",
70
- "gulp": "^5.0.0",
71
- "gulp-if": "^3.0.0",
72
- "gulp-rename": "^2.0.0",
73
- "gulp-replace": "^1.1.4",
74
- "gulp-run-command": "^0.0.10",
75
- "gulp-sourcemaps": "^2.6.5",
76
- "gulp-typescript": "^6.0.0-alpha.1",
77
- "gulp-uglify": "^3.0.2",
78
- "https-browserify": "^1.0.0",
79
81
  "jest": "^29.7.0",
80
- "jest-coverage-badges": "^1.0.0",
82
+ "jest-html-reporters": "^3.1.7",
81
83
  "jest-junit": "^16.0.0",
82
84
  "jsdoc": "^4.0.4",
83
85
  "jsdoc-mermaid": "^1.0.0",
84
86
  "markdown-include": "^0.4.3",
85
- "merge-stream": "^2.0.0",
86
87
  "minimist": "^1.2.8",
87
88
  "nodemon": "^3.1.9",
88
- "npm-check-updates": "^17.1.15",
89
+ "npm-check-updates": "^18.0.0",
89
90
  "prettier": "3.5.3",
90
91
  "rimraf": "^6.0.1",
91
- "stream-http": "^3.2.0",
92
- "ts-jest": "^29.2.6",
92
+ "rollup": "^4.40.0",
93
+ "ts-jest": "^29.3.2",
93
94
  "ts-loader": "^9.5.2",
94
95
  "ts-node": "^10.9.2",
95
- "typescript": "^5.8.2",
96
- "typescript-eslint": "^8.26.1",
97
- "vinyl-named": "^1.1.0",
98
- "webpack-stream": "^7.0.0",
96
+ "typescript": "^5.8.3",
97
+ "typescript-eslint": "^8.31.0",
99
98
  "winston": "^3.17.0"
100
- },
101
- "overrides": {
102
- "gulp-run-command": {
103
- "cross-spawn": "^7.0.6"
104
- }
105
99
  }
106
100
  }
@@ -1 +0,0 @@
1
- var e={563:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerFactory=void 0,t.LoggerFactory=class{constructor(e){this.level=e}}},640:(e,t)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.NumericLogLevels=t.LogLevel=void 0,function(e){e.Fatal="fatal",e.Error="error",e.Warn="warn",e.Info="info",e.Http="http",e.Verbose="verbose",e.Debug="debug",e.Silly="silly"}(o||(t.LogLevel=o={})),t.NumericLogLevels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6}},760:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultLoggerFactory=void 0;const r=o(563),s=o(640),l=o(552);class n{constructor(e,t,o){this.level=e,this.clazz=t,this.method=o}log(e,t,o,r){if((0,l.toLogLevel)(e)<(0,l.toLogLevel)(this.level))return;const{context:n,app:i}=o||{},a=`${r?`[${r}]`:""}${i?`[${i}]`:""}${n?`[${n}]`:""}${this.clazz?`[${this.clazz}]`:""}${this.method?`[${this.method}]`:""} ${t}`;switch(e){case s.LogLevel.Fatal:case s.LogLevel.Error:return console.error(a);case s.LogLevel.Warn:return console.warn(a);case s.LogLevel.Info:return console.info(a);case s.LogLevel.Http:case s.LogLevel.Verbose:case s.LogLevel.Debug:case s.LogLevel.Silly:return console.debug(a);default:throw new Error(`Invalid log level: ${e}`)}}silly(e,t,o){return this.log(s.LogLevel.Silly,e,t,o)}verbose(e,t,o){return this.log(s.LogLevel.Verbose,e,t,o)}debug(e,t,o){return this.log(s.LogLevel.Debug,e,t,o)}info(e,t,o){return this.log(s.LogLevel.Info,e,t,o)}warn(e,t,o){return this.log(s.LogLevel.Warn,e,t,o)}error(e,t,o){return this.log(s.LogLevel.Error,e,t,o)}emerg(e,t,o){return this.log(s.LogLevel.Fatal,e,t,o)}profile(e,t){throw new Error("Not implemented")}}class i extends r.LoggerFactory{constructor(e){super(e)}forClass(e){return new n(this.level,e.name)}forMethod(e,t){return new n(this.level,e.name,"string"==typeof t?t:t.name)}get(){return new n(this.level)}}t.DefaultLoggerFactory=i},729:function(e,t,o){var r=this&&this.__createBinding||(Object.create?function(e,t,o,r){void 0===r&&(r=o);var s=Object.getOwnPropertyDescriptor(t,o);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,s)}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]}),s=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||r(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,s(o(640),t),s(o(760),t),s(o(563),t),s(o(317),t),s(o(916),t),s(o(552),t),t.VERSION="0.0.15"},317:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},916:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Logging=void 0;const r=o(640),s=o(760);class l{static{this._level=r.LogLevel.Info}static{this._factory=s.DefaultLoggerFactory}static{this.cacheByClass={}}static{this.cacheByClassMethod={}}constructor(){}static get level(){return this._level}static set level(e){this._level=e}static get instance(){return this._instance||(this._instance=new this._factory(l.level)),this._instance}static set factory(e){this._factory=e}static forClass(e){const t=e.name;return t in this.cacheByClass||(this.cacheByClass[t]=l.instance.forClass(e)),this.cacheByClass[t]}static forMethod(e,t){const o=e.name;o in this.cacheByClassMethod||(this.cacheByClassMethod[o]={});const r="string"==typeof t?t:t.name;return r in this.cacheByClassMethod[o]||(this.cacheByClassMethod[o][r]=l.instance.forMethod(e,t)),this.cacheByClassMethod[o][r]}static get(){return this.global||(this.global=l.instance.get()),this.global}}t.Logging=l},552:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toLogLevel=function(e){if(e.toString()in r.NumericLogLevels)return r.NumericLogLevels[e.toString()];throw new Error(`Invalid level: ${e.toString()}`)};const r=o(640)}},t={};!function o(r){var s=t[r];if(void 0!==s)return s.exports;var l=t[r]={exports:{}};return e[r].call(l.exports,l,l.exports,o),l.exports}(729);
@@ -1 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("logging",[],t):"object"==typeof exports?exports.logging=t():e.logging=t()}(this,(()=>(()=>{"use strict";var e={563:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerFactory=void 0,t.LoggerFactory=class{constructor(e){this.level=e}}},640:(e,t)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.NumericLogLevels=t.LogLevel=void 0,function(e){e.Fatal="fatal",e.Error="error",e.Warn="warn",e.Info="info",e.Http="http",e.Verbose="verbose",e.Debug="debug",e.Silly="silly"}(o||(t.LogLevel=o={})),t.NumericLogLevels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6}},760:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultLoggerFactory=void 0;const r=o(563),s=o(640),l=o(552);class n{constructor(e,t,o){this.level=e,this.clazz=t,this.method=o}log(e,t,o,r){if((0,l.toLogLevel)(e)<(0,l.toLogLevel)(this.level))return;const{context:n,app:i}=o||{},a=`${r?`[${r}]`:""}${i?`[${i}]`:""}${n?`[${n}]`:""}${this.clazz?`[${this.clazz}]`:""}${this.method?`[${this.method}]`:""} ${t}`;switch(e){case s.LogLevel.Fatal:case s.LogLevel.Error:return console.error(a);case s.LogLevel.Warn:return console.warn(a);case s.LogLevel.Info:return console.info(a);case s.LogLevel.Http:case s.LogLevel.Verbose:case s.LogLevel.Debug:case s.LogLevel.Silly:return console.debug(a);default:throw new Error(`Invalid log level: ${e}`)}}silly(e,t,o){return this.log(s.LogLevel.Silly,e,t,o)}verbose(e,t,o){return this.log(s.LogLevel.Verbose,e,t,o)}debug(e,t,o){return this.log(s.LogLevel.Debug,e,t,o)}info(e,t,o){return this.log(s.LogLevel.Info,e,t,o)}warn(e,t,o){return this.log(s.LogLevel.Warn,e,t,o)}error(e,t,o){return this.log(s.LogLevel.Error,e,t,o)}emerg(e,t,o){return this.log(s.LogLevel.Fatal,e,t,o)}profile(e,t){throw new Error("Not implemented")}}class i extends r.LoggerFactory{constructor(e){super(e)}forClass(e){return new n(this.level,e.name)}forMethod(e,t){return new n(this.level,e.name,"string"==typeof t?t:t.name)}get(){return new n(this.level)}}t.DefaultLoggerFactory=i},729:function(e,t,o){var r=this&&this.__createBinding||(Object.create?function(e,t,o,r){void 0===r&&(r=o);var s=Object.getOwnPropertyDescriptor(t,o);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,s)}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]}),s=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||r(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,s(o(640),t),s(o(760),t),s(o(563),t),s(o(317),t),s(o(916),t),s(o(552),t),t.VERSION="0.0.15"},317:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},916:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Logging=void 0;const r=o(640),s=o(760);class l{static{this._level=r.LogLevel.Info}static{this._factory=s.DefaultLoggerFactory}static{this.cacheByClass={}}static{this.cacheByClassMethod={}}constructor(){}static get level(){return this._level}static set level(e){this._level=e}static get instance(){return this._instance||(this._instance=new this._factory(l.level)),this._instance}static set factory(e){this._factory=e}static forClass(e){const t=e.name;return t in this.cacheByClass||(this.cacheByClass[t]=l.instance.forClass(e)),this.cacheByClass[t]}static forMethod(e,t){const o=e.name;o in this.cacheByClassMethod||(this.cacheByClassMethod[o]={});const r="string"==typeof t?t:t.name;return r in this.cacheByClassMethod[o]||(this.cacheByClassMethod[o][r]=l.instance.forMethod(e,t)),this.cacheByClassMethod[o][r]}static get(){return this.global||(this.global=l.instance.get()),this.global}}t.Logging=l},552:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toLogLevel=function(e){if(e.toString()in r.NumericLogLevels)return r.NumericLogLevels[e.toString()];throw new Error(`Invalid level: ${e.toString()}`)};const r=o(640)}},t={};return function o(r){var s=t[r];if(void 0!==s)return s.exports;var l=t[r]={exports:{}};return e[r].call(l.exports,l,l.exports,o),l.exports}(729)})()));