From d4cc9dbcd0afbd38c690e2033947d8fd67a490a8 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Tue, 30 Oct 2018 18:56:26 +0100 Subject: [PATCH] fix(core): implement log router --- .gitlab-ci.yml | 10 +- npmextra.json | 4 +- package-lock.json | 714 ++++++++++++++++++++----------- package.json | 13 +- test/test.ts | 2 +- ts/index.ts | 1 - ts/smartlog.classes.logrouter.ts | 19 +- ts/smartlog.classes.smartlog.ts | 27 +- tslint.json | 16 +- 9 files changed, 544 insertions(+), 262 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8b576a0..67fd2eb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,6 +26,7 @@ mirror: snyk: stage: security script: + - npmci npm prepare - npmci command npm install -g snyk - npmci command npm install --ignore-scripts - npmci command snyk test @@ -39,6 +40,7 @@ snyk: testLEGACY: stage: test script: + - npmci npm prepare - npmci node install legacy - npmci npm install - npmci npm test @@ -51,6 +53,7 @@ testLEGACY: testLTS: stage: test script: + - npmci npm prepare - npmci node install lts - npmci npm install - npmci npm test @@ -62,6 +65,7 @@ testLTS: testSTABLE: stage: test script: + - npmci npm prepare - npmci node install stable - npmci npm install - npmci npm test @@ -117,8 +121,10 @@ pages: image: hosttoday/ht-docker-node:npmci stage: metadata script: - - npmci command npm install -g npmpage - - npmci command npmpage + - npmci command npm install -g typedoc typescript + - npmci npm prepare + - npmci npm install + - npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/ tags: - docker - notpriv diff --git a/npmextra.json b/npmextra.json index 0eb7b21..193d59b 100644 --- a/npmextra.json +++ b/npmextra.json @@ -1,8 +1,6 @@ { "npmci": { - "npmGlobalTools": [ - "@gitzone/npmts" - ], + "npmGlobalTools": [], "npmAccessLevel": "public" } } diff --git a/package-lock.json b/package-lock.json index ac0acc6..7ee4a67 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,15 +14,149 @@ "nan": "^2.9.2" } }, - "@gitzone/tsrun": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@gitzone/tsrun/-/tsrun-1.1.1.tgz", - "integrity": "sha512-/hocNkbpcm65MrSdF3V28lBH2iNcZThtbvKuISdCVgKejQUugTe9uNzLn//UCuCbbXODSVmjMbbYU4nMksssUw==", + "@gitzone/tsbuild": { + "version": "2.0.22", + "resolved": "https://registry.npmjs.org/@gitzone/tsbuild/-/tsbuild-2.0.22.tgz", + "integrity": "sha512-H0rqGVUKXWgxXhkY62kF92WpbS9GSJW27jQXaoyMsQptTQN4HIYKHWZMdO4egkk0/gDmKnBjk8MXg5Rx6efItA==", "dev": true, "requires": { - "smartfile": "^4.2.28", + "@pushrocks/smartfile": "^6.0.6", + "@pushrocks/smartlog": "^2.0.1", + "@pushrocks/smartpath": "^4.0.1", + "@pushrocks/smartpromise": "^2.0.5", + "typescript": "^3.0.1" + }, + "dependencies": { + "typescript": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.1.4.tgz", + "integrity": "sha512-JZHJtA6ZL15+Q3Dqkbh8iCUmvxD3iJ7ujXS+fVkKnwIVAdHc5BJTDNM0aTrnr2luKulFjU7W+SRhDZvi66Ru7Q==", + "dev": true + } + } + }, + "@gitzone/tsrun": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/@gitzone/tsrun/-/tsrun-1.1.13.tgz", + "integrity": "sha512-yJLXfqu33zGc1hBX4HGxzlBvb5DU2zs80MUd8UsULJvkgOBofb3XR7eyV7iZfP097sd+ABj17yoeqJcRRjOZTg==", + "dev": true, + "requires": { + "@gitzone/tsbuild": "^2.0.22", + "@pushrocks/smartfile": "^6.0.6", "ts-node": "^7.0.0", - "typescript": "^2.9.1" + "typescript": "^3.0.1" + } + }, + "@gitzone/tstest": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@gitzone/tstest/-/tstest-1.0.15.tgz", + "integrity": "sha512-+t5fvYK4a0JkwwH0Fokh5aOxVzrax5OjDUL4zmhBk7KFmXt7fdvcqsSNaEp9iyqC52dLiDybdAXqHYZypXTIYw==", + "dev": true, + "requires": { + "@gitzone/tsrun": "^1.1.12", + "@pushrocks/consolecolor": "^2.0.1", + "@pushrocks/smartfile": "^6.0.6", + "@pushrocks/smartlog": "^2.0.1", + "@pushrocks/smartpromise": "^2.0.5", + "@pushrocks/smartshell": "^2.0.6", + "@types/figures": "^2.0.0", + "figures": "^2.0.0" + }, + "dependencies": { + "@gitzone/tsrun": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/@gitzone/tsrun/-/tsrun-1.1.13.tgz", + "integrity": "sha512-yJLXfqu33zGc1hBX4HGxzlBvb5DU2zs80MUd8UsULJvkgOBofb3XR7eyV7iZfP097sd+ABj17yoeqJcRRjOZTg==", + "dev": true, + "requires": { + "@gitzone/tsbuild": "^2.0.22", + "@pushrocks/smartfile": "^6.0.6", + "ts-node": "^7.0.0", + "typescript": "^3.0.1" + } + }, + "typescript": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.1.4.tgz", + "integrity": "sha512-JZHJtA6ZL15+Q3Dqkbh8iCUmvxD3iJ7ujXS+fVkKnwIVAdHc5BJTDNM0aTrnr2luKulFjU7W+SRhDZvi66Ru7Q==", + "dev": true + } + } + }, + "@pushrocks/consolecolor": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@pushrocks/consolecolor/-/consolecolor-2.0.1.tgz", + "integrity": "sha512-iOFCHVeFZ2OywbdwSxVI4/wokkcLrXVdHLgvMmkNhJ220eeLgjNZWx3EJo3vNW3zq5ybCSCUIq0878djBxrWpw==", + "dev": true, + "requires": { + "ansi-256-colors": "^1.1.0" + } + }, + "@pushrocks/early": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@pushrocks/early/-/early-3.0.3.tgz", + "integrity": "sha512-71/nwxTpqdp1glmHz4YaGusNl/XOOcPelAxC9RA6rpS/6280QyY2u4yx+mRdMrCzn7ruLYF5awbkS8llNZ94Pg==", + "dev": true, + "requires": { + "@pushrocks/consolecolor": "^2.0.1", + "@pushrocks/smartpromise": "^2.0.5" + } + }, + "@pushrocks/smartdelay": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@pushrocks/smartdelay/-/smartdelay-2.0.2.tgz", + "integrity": "sha512-4xf6tMKwZcxBynKgXrM4SQKgeASfRvx43LUmR5DkStp26ZHAsarCXUdKJS6y8QIPygEOTOCP8we97JAcCzBuMg==", + "dev": true, + "requires": { + "@pushrocks/smartpromise": "^2.0.5" + } + }, + "@pushrocks/smartfile": { + "version": "6.0.8", + "resolved": "https://registry.npmjs.org/@pushrocks/smartfile/-/smartfile-6.0.8.tgz", + "integrity": "sha512-YkAovvQ0pcVphXLynlQ1D4nhEoUqALqqUn2pRXc2vXNy0RDSU22puLlLVhoXT0NPAqYNMazhqc4OAixgEOpdFw==", + "dev": true, + "requires": { + "@pushrocks/smartpath": "^4.0.1", + "@pushrocks/smartpromise": "^2.0.5", + "@pushrocks/smartrequest": "^1.1.14", + "@types/fs-extra": "^5.0.4", + "@types/vinyl": "^2.0.2", + "fs-extra": "^7.0.0", + "glob": "^7.1.2", + "js-yaml": "^3.10.0", + "vinyl-file": "^3.0.0" + }, + "dependencies": { + "@types/fs-extra": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.4.tgz", + "integrity": "sha512-DsknoBvD8s+RFfSGjmERJ7ZOP1HI0UZRA3FSI+Zakhrc/Gy26YQsLI+m5V5DHxroHRJqCDLKJp7Hixn8zyaF7g==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "fs-extra": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.0.tgz", + "integrity": "sha512-EglNDLRpmaTWiD/qraZn6HREAEAHJcJOmxNEYwq6xeMKnVMAy3GUcFB+wXt2C6k4CNvB/mP1y/U3dzvKKj5OtQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + } + } + }, + "@pushrocks/smartlog": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@pushrocks/smartlog/-/smartlog-2.0.1.tgz", + "integrity": "sha512-GtsDTGIUF3VuWPyF8FV5dF31ZCEIcaJ56ZlvJsWxjnyJq57X25mk5/K0QAaRE9IIeHg6fORcukFomb5C+AOQrg==", + "dev": true, + "requires": { + "@pushrocks/smartlog-interfaces": "^1.0.9" } }, "@pushrocks/smartlog-interfaces": { @@ -30,6 +164,53 @@ "resolved": "https://registry.npmjs.org/@pushrocks/smartlog-interfaces/-/smartlog-interfaces-1.0.9.tgz", "integrity": "sha512-0qwpomrRN0kFjmhR9m1iHYXoISoNuXtRP0Wr+JtkYyURLwKHMaW8Xoznf8MzXJptRfqufJi3Fxh5HodpPrIZUA==" }, + "@pushrocks/smartpath": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@pushrocks/smartpath/-/smartpath-4.0.1.tgz", + "integrity": "sha512-MaI0+uLQPCr2V3WGnbdgb0pWa9xkWyrP4qYcbsHIjeismGLbn9s3jmP/HIXU8LkgzRgaVb+BJxmZJHOwl32DyA==", + "dev": true + }, + "@pushrocks/smartpromise": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@pushrocks/smartpromise/-/smartpromise-2.0.5.tgz", + "integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g==", + "dev": true + }, + "@pushrocks/smartrequest": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/@pushrocks/smartrequest/-/smartrequest-1.1.14.tgz", + "integrity": "sha512-+sDQB4Mxvpn8BIMPUQ7TPSCKUVMln3tHC4rp4pmfEHmBQK+g1XwtNr59aMA9kEoBDMt7li1hu+1cs+SNsWt6Gw==", + "dev": true, + "requires": { + "@pushrocks/smartpromise": "^2.0.5", + "@types/form-data": "^2.2.1", + "form-data": "^2.3.2" + } + }, + "@pushrocks/smartshell": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@pushrocks/smartshell/-/smartshell-2.0.8.tgz", + "integrity": "sha512-OeGrJez0vSHe/E0auHNUqf7r0B3yS+pkVe6BuxdJemJx5LBRtcHuZnJCxU5pSLL8igzlTfR+jVpjKJXUMzCsrA==", + "dev": true, + "requires": { + "@pushrocks/smartpromise": "^2.0.5", + "@types/which": "^1.3.1", + "which": "^1.3.1" + } + }, + "@pushrocks/tapbundle": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@pushrocks/tapbundle/-/tapbundle-3.0.7.tgz", + "integrity": "sha512-ZI4fhXPy8XMfiy/QofP0ZDuFdv3cErm+FP/+AXaNKdgCCx01MXNTYSUdER1GPUXW3ZbiXdurkLJlxlhIzD1ZJw==", + "dev": true, + "requires": { + "@pushrocks/early": "^3.0.3", + "@pushrocks/smartdelay": "^2.0.2", + "@pushrocks/smartpromise": "^2.0.5", + "leakage": "^0.4.0", + "smartchai": "^2.0.1" + } + }, "@types/chai": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.4.tgz", @@ -54,19 +235,25 @@ "@types/chai": "*" } }, - "@types/fs-extra": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.0.tgz", - "integrity": "sha512-qtxDULQKUenuaDLW003CgC+0T0eiAfH3BrH+vSt87GLzbz5EZ6Ox6mv9rMttvhDOatbb9nYh0E1m7ydoYwUrAg==", + "@types/figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/figures/-/figures-2.0.0.tgz", + "integrity": "sha512-mcRgJ+ncKuNI+Dwac7omO18B8C8u+YBS+AU/oyLhEyjAnT3cUUThhHgZpbiIvu5ZqSvdD30BXtrqg9nxc3OKMg==", + "dev": true + }, + "@types/form-data": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz", + "integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==", "dev": true, "requires": { "@types/node": "*" } }, "@types/node": { - "version": "10.5.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.2.tgz", - "integrity": "sha512-m9zXmifkZsMHZBOyxZWilMwmTlpC8x5Ty360JKTiXvlXZfBWYpsg9ZZvP/Ye+iZUh+Q+MxDLjItVTWIsfwz+8Q==", + "version": "10.12.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.1.tgz", + "integrity": "sha512-i1sl+WCX2OCHeUi9oi7PiCNUtYFrpWhpcx878vpeq/tlZTKzcFdHePlyFHVbWqeuKN0SRPl/9ZFDSTsfv9h7VQ==", "dev": true }, "@types/vinyl": { @@ -78,12 +265,30 @@ "@types/node": "*" } }, + "@types/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@types/which/-/which-1.3.1.tgz", + "integrity": "sha512-ZrJDWpvg75LTGX4XwuneY9s6bF3OeZcGTpoGh3zDV9ytzcHMFsRrMIaLBRJZQMBoGyKs6unBQfVdrLZiYfb1zQ==", + "dev": true + }, "ansi-256-colors": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/ansi-256-colors/-/ansi-256-colors-1.1.0.tgz", "integrity": "sha1-kQ3lDvzHwJ49gvL4er1rcAwYgYo=", "dev": true }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -105,22 +310,44 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + } + } + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "beautycolor": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/beautycolor/-/beautycolor-1.0.11.tgz", - "integrity": "sha512-Uxl/39+2uqixPzsrV+0NOHf0sJlWmsKnRTV0oz8+bfwnHPA/E+SZuh3Upn3OXobv0W7LZg5BVoLj1nkMj7m5jA==", - "dev": true, - "requires": { - "ansi-256-colors": "^1.1.0", - "typings-global": "^1.0.14" - } - }, "bindings": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", @@ -143,6 +370,12 @@ "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==", "dev": true }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, "chai": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chai/-/chai-4.1.2.tgz", @@ -172,6 +405,37 @@ "integrity": "sha1-NZFAwFHTak5LGl/GuRAVL0OKjUk=", "dev": true }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", @@ -207,6 +471,36 @@ "readable-stream": "^2.3.5" } }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "combined-stream": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -228,15 +522,11 @@ "type-detect": "^4.0.0" } }, - "define-properties": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", - "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", - "dev": true, - "requires": { - "foreach": "^2.0.5", - "object-keys": "^1.0.8" - } + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true }, "diff": { "version": "3.5.0", @@ -244,53 +534,39 @@ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, - "early": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/early/-/early-2.1.1.tgz", - "integrity": "sha1-hB4jJU6l3FTYr67ugvWrZcAO4jw=", - "dev": true, - "requires": { - "beautycolor": "^1.0.7", - "smartq": "^1.1.1", - "typings-global": "^1.0.16" - } - }, - "es-abstract": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", - "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", - "dev": true, - "requires": { - "es-to-primitive": "^1.1.1", - "function-bind": "^1.1.1", - "has": "^1.0.1", - "is-callable": "^1.1.3", - "is-regex": "^1.0.4" - } - }, - "es-to-primitive": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", - "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", - "dev": true, - "requires": { - "is-callable": "^1.1.1", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.1" - } - }, "es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", "dev": true }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, "first-chunk-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz", @@ -300,21 +576,15 @@ "readable-stream": "^2.0.2" } }, - "foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true - }, - "fs-extra": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", - "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" } }, "fs.realpath": { @@ -323,12 +593,6 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, "get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", @@ -355,23 +619,20 @@ "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { - "function-bind": "^1.1.1" + "ansi-regex": "^2.0.0" } }, - "home": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/home/-/home-1.0.1.tgz", - "integrity": "sha1-lqQjzrSbmDeP9e886uBZpVf53TU=", - "dev": true, - "requires": { - "os-homedir": "^1.0.1" - } + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true }, "inflight": { "version": "1.0.6", @@ -389,33 +650,6 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, - "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", - "dev": true - }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", - "dev": true - }, - "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "dev": true, - "requires": { - "has": "^1.0.1" - } - }, - "is-symbol": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", - "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", - "dev": true - }, "is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", @@ -428,6 +662,18 @@ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, "js-yaml": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", @@ -472,6 +718,21 @@ "integrity": "sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g==", "dev": true }, + "mime-db": { + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", + "dev": true + }, + "mime-types": { + "version": "2.1.21", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", + "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", + "dev": true, + "requires": { + "mime-db": "~1.37.0" + } + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -510,22 +771,6 @@ "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", "dev": true }, - "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", - "dev": true - }, - "object.getownpropertydescriptors": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", - "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.1" - } - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -535,18 +780,18 @@ "wrappy": "1" } }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, "pathval": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", @@ -598,11 +843,14 @@ "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", "dev": true }, - "require-reload": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/require-reload/-/require-reload-0.2.2.tgz", - "integrity": "sha1-KadZGEbK+RtuijzamRaD+V+NfUI=", - "dev": true + "resolve": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } }, "safe-buffer": { "version": "5.1.2", @@ -610,6 +858,12 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, "smartchai": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/smartchai/-/smartchai-2.0.1.tgz", @@ -624,62 +878,6 @@ "chai-string": "^1.4.0" } }, - "smartdelay": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/smartdelay/-/smartdelay-1.0.4.tgz", - "integrity": "sha512-ab+d8ADiMMPKwrQNhoJYjmOR20VIIIxjknoEF9/PfMryic7tmvTmFrDMdcnMRohGNw/pN+4/I5dSUBdsDya7uw==", - "dev": true, - "requires": { - "smartq": "^1.1.1", - "typings-global": "^1.0.16" - } - }, - "smartfile": { - "version": "4.2.28", - "resolved": "https://registry.npmjs.org/smartfile/-/smartfile-4.2.28.tgz", - "integrity": "sha512-zUeAOLYftz8xLfKTs9U1NOuNPTA9jlvTQNr7lDIv84kXnr1AEpDb2Xwy1MdK1w733sBil/RkxtezrkvgRVAnNg==", - "dev": true, - "requires": { - "@types/fs-extra": "5.0.0", - "@types/vinyl": "^2.0.2", - "fs-extra": "^5.0.0", - "glob": "^7.1.2", - "js-yaml": "^3.10.0", - "require-reload": "0.2.2", - "smartpath": "^3.2.8", - "smartq": "^1.1.6", - "smartrequest": "^1.0.8", - "vinyl-file": "^3.0.0" - } - }, - "smartpath": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/smartpath/-/smartpath-3.2.8.tgz", - "integrity": "sha1-SDS9OouuIpW6rK26I8h6UBlS+UA=", - "dev": true, - "requires": { - "home": "^1.0.1", - "typings-global": "^1.0.14" - } - }, - "smartq": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/smartq/-/smartq-1.1.8.tgz", - "integrity": "sha512-FURlYW/C3bLeZjJcBVyw7bxCyQoCXiXbLCZcDUKznhXHaLu35c8m33/a2H8CA0rtb82lvzN8dRLnBZAcNMzNHQ==", - "dev": true, - "requires": { - "util.promisify": "^1.0.0" - } - }, - "smartrequest": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/smartrequest/-/smartrequest-1.0.13.tgz", - "integrity": "sha512-OHrvzaxaA8Z8bJr33yxnyJF35nrWyaumsajqXm2Zkv0/2hfWO1NQAj02VVV51rLQfmtU0Hex7Nk19SoC8nOmYg==", - "dev": true, - "requires": { - "smartq": "^1.1.1" - } - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -711,6 +909,15 @@ "safe-buffer": "~5.1.0" } }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, "strip-bom": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", @@ -739,18 +946,11 @@ "strip-bom": "^2.0.0" } }, - "tapbundle": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/tapbundle/-/tapbundle-2.0.2.tgz", - "integrity": "sha512-y3ulfK4GKoVkuqF2QsrwVMWLXHqXeoDEzsw/Q9ZTJumNINbx4bcWPAdg2IcTHYgJHeSdF03HiB9EbHoUTRjD9Q==", - "dev": true, - "requires": { - "early": "^2.1.1", - "leakage": "^0.4.0", - "smartchai": "^2.0.1", - "smartdelay": "^1.0.4", - "smartq": "^1.1.8" - } + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true }, "ts-node": { "version": "7.0.0", @@ -768,6 +968,47 @@ "yn": "^2.0.0" } }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, + "tslint": { + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.11.0.tgz", + "integrity": "sha1-mPMMAurjzecAYgHkwzywi0hYHu0=", + "dev": true, + "requires": { + "babel-code-frame": "^6.22.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^3.2.0", + "glob": "^7.1.1", + "js-yaml": "^3.7.0", + "minimatch": "^3.0.4", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.27.2" + } + }, + "tslint-config-prettier": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.15.0.tgz", + "integrity": "sha512-06CgrHJxJmNYVgsmeMoa1KXzQRoOdvfkqnJth6XUkNeOz707qxN0WfxfhYwhL5kXHHbYJRby2bqAPKwThlZPhw==", + "dev": true + }, + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -775,15 +1016,9 @@ "dev": true }, "typescript": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", - "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", - "dev": true - }, - "typings-global": { - "version": "1.0.28", - "resolved": "https://registry.npmjs.org/typings-global/-/typings-global-1.0.28.tgz", - "integrity": "sha512-6VOwJWEY2971HOMHu/7sURzUXiD4/LiMJPsMAOqkHHAtS3MVpLFE5gzTiHilsH9KY5VE1mBQirWIgWFsDuo90A==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.1.4.tgz", + "integrity": "sha512-JZHJtA6ZL15+Q3Dqkbh8iCUmvxD3iJ7ujXS+fVkKnwIVAdHc5BJTDNM0aTrnr2luKulFjU7W+SRhDZvi66Ru7Q==", "dev": true }, "universalify": { @@ -798,16 +1033,6 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, - "util.promisify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", - "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "object.getownpropertydescriptors": "^2.0.3" - } - }, "vinyl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", @@ -835,6 +1060,15 @@ "vinyl": "^2.0.1" } }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index ce907e9..e21ece3 100644 --- a/package.json +++ b/package.json @@ -8,13 +8,18 @@ "author": "Lossless GmbH", "license": "UNLICENSED", "scripts": { - "test": "(tsrun test/test.ts)", - "build": "(npmts)", + "test": "(tstest test/)", + "build": "(tsbuild)", "format": "(gitzone format)" }, "devDependencies": { - "@gitzone/tsrun": "^1.1.1", - "tapbundle": "^2.0.2" + "@gitzone/tsbuild": "^2.0.22", + "@gitzone/tsrun": "^1.1.13", + "@gitzone/tstest": "^1.0.15", + "@pushrocks/tapbundle": "^3.0.7", + "@types/node": "^10.12.1", + "tslint": "^5.11.0", + "tslint-config-prettier": "^1.15.0" }, "dependencies": { "@pushrocks/smartlog-interfaces": "^1.0.9" diff --git a/test/test.ts b/test/test.ts index 5b20280..b42b136 100644 --- a/test/test.ts +++ b/test/test.ts @@ -1,4 +1,4 @@ -import { expect, tap } from 'tapbundle'; +import { expect, tap } from '@pushrocks/tapbundle'; import * as smartlog from '../ts/index'; let defaultLogger: smartlog.Smartlog; diff --git a/ts/index.ts b/ts/index.ts index f296cf0..471fb7a 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -3,4 +3,3 @@ import { Smartlog } from './smartlog.classes.smartlog'; const defaultLogger: Smartlog = new Smartlog(); export { Smartlog, defaultLogger }; - diff --git a/ts/smartlog.classes.logrouter.ts b/ts/smartlog.classes.logrouter.ts index 08d9824..f9666cb 100644 --- a/ts/smartlog.classes.logrouter.ts +++ b/ts/smartlog.classes.logrouter.ts @@ -1,10 +1,23 @@ import * as plugins from './smartlog.plugins'; -import { ILogDestination } from '@pushrocks/smartlog-interfaces'; +import { ILogDestination, ILogPackage } from '@pushrocks/smartlog-interfaces'; export class LogRouter { - logDestinations: ILogDestination[] = []; + /** + * all log destinations + */ + private logDestinations: ILogDestination[] = []; + constructor() {} - addLogDestination; + public addLogDestination(logDestination: ILogDestination) { + this.logDestinations.push(logDestination); + } + + // routes the log according to added logDestinations + routeLog(logPackageArg: ILogPackage) { + for (const logDestination of this.logDestinations) { + logDestination.handleLog(logPackageArg); + } + } } diff --git a/ts/smartlog.classes.smartlog.ts b/ts/smartlog.classes.smartlog.ts index 6478f41..827a0dd 100644 --- a/ts/smartlog.classes.smartlog.ts +++ b/ts/smartlog.classes.smartlog.ts @@ -3,11 +3,19 @@ import * as plugins from './smartlog.plugins'; // interfaces import { TEnvironment, ILogContext, TLogLevel, TRuntime } from '@pushrocks/smartlog-interfaces'; +import { LogRouter } from './smartlog.classes.logrouter'; + export class Smartlog { private logContext: ILogContext; private consoleEnabled: boolean; private minimumLevel: TLogLevel; private runtime: TRuntime; + + public logRouter = new LogRouter(); + + public addLogDestination = this.logRouter.addLogDestination; + + // ============ // Logger Setup // ============ @@ -33,29 +41,34 @@ export class Smartlog { * @param logLevelArg * @param logMessageArg */ - log(logLevelArg: TLogLevel, logMessageArg: string) { + public log(logLevelArg: TLogLevel, logMessageArg: string) { if (this.consoleEnabled) { - console.log(`${logLevelArg}: ${logMessageArg}`) + console.log(`${logLevelArg}: ${logMessageArg}`); } + this.logRouter.routeLog({ + logContext: this.logContext, + logLevel: logLevelArg, + message: logMessageArg + }); } - silly(logMessageArg: string) { + public silly(logMessageArg: string) { this.log('silly', logMessageArg); } - debug(logMessageArg) { + public debug(logMessageArg) { this.log('debug', logMessageArg); } - info(logMessageArg: string) { + public info(logMessageArg: string) { this.log('info', logMessageArg); } - warn(logMessageArg) { + public warn(logMessageArg) { this.log('warn', logMessageArg); } - error(logMessageArg) { + public error(logMessageArg) { this.log('error', logMessageArg); } } diff --git a/tslint.json b/tslint.json index 45052ad..d4ea2e9 100644 --- a/tslint.json +++ b/tslint.json @@ -1,3 +1,17 @@ { - "extends": "tslint-config-standard" + "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" }