nightingale-browser-console-formatter 12.0.1 → 12.1.3
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/.eslintrc.json +1 -1
- package/CHANGELOG.md +38 -0
- package/dist/index-browser.cjs.js +1 -1
- package/dist/index-browser.cjs.js.map +1 -1
- package/dist/index-browser.es.js +1 -1
- package/dist/index-browser.es.js.map +1 -1
- package/package.json +11 -11
package/.eslintrc.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,44 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [12.1.3](https://github.com/christophehurpeau/nightingale/compare/v12.1.2...v12.1.3) (2022-01-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package nightingale-browser-console-formatter
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [12.1.2](https://github.com/christophehurpeau/nightingale/compare/v12.1.1...v12.1.2) (2022-01-02)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* main esm for jest which supports esm but not exports ([98789fa](https://github.com/christophehurpeau/nightingale/commit/98789fa490e723840fccc443584189b6905d871b))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [12.1.1](https://github.com/christophehurpeau/nightingale/compare/v12.1.0...v12.1.1) (2022-01-01)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* properly configure package type ([2e0cbf5](https://github.com/christophehurpeau/nightingale/commit/2e0cbf555bd3b9fa3c3851025452937f64408aa8))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# [12.1.0](https://github.com/christophehurpeau/nightingale/compare/v12.0.1...v12.1.0) (2021-12-15)
|
|
37
|
+
|
|
38
|
+
**Note:** Version bump only for package nightingale-browser-console-formatter
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
6
44
|
## [12.0.1](https://github.com/christophehurpeau/nightingale/compare/v12.0.0...v12.0.1) (2021-12-12)
|
|
7
45
|
|
|
8
46
|
**Note:** Version bump only for package nightingale-browser-console-formatter
|
|
@@ -18,7 +18,7 @@ var style = function style(styleToHtmlStyle, args) {
|
|
|
18
18
|
}).join('; '), htmlStyles.map(function (s) {
|
|
19
19
|
return s.close;
|
|
20
20
|
}).join('; '));
|
|
21
|
-
return
|
|
21
|
+
return "%c" + string + "%c";
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
function createBrowserConsoleFormatter(theme) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-browser.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style =\n (styleToHtmlStyle: StyleToHtmlStyle, args: string[]) =>\n (styles: Styles, string: string): string => {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n const htmlStyles = styles.map((styleName) => styleToHtmlStyle[styleName]);\n args.push(\n htmlStyles.map((s) => s.open).join('; '),\n htmlStyles.map((s) => s.close).join('; '),\n );\n return `%c${string}%c`;\n };\n\nexport function createBrowserConsoleFormatter(\n theme: 'light' | 'dark' = 'light',\n): <T extends Metadata>(record: LogRecord<T>) => string[] {\n const styleToHtmlStyle: StyleToHtmlStyle =\n theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;\n return function format<T extends Metadata>(record: LogRecord<T>): string[] {\n const args: string[] = [];\n const string = formatRecordToString(record, style(styleToHtmlStyle, args));\n return [string, ...args];\n };\n}\n"],"names":["style","styleToHtmlStyle","args","styles","string","length","htmlStyles","map","styleName","push","s","open","join","close","createBrowserConsoleFormatter","theme","styleToHtmlStyleThemeDark","styleToHtmlStyleThemeLight","format","record","formatRecordToString"],"mappings":";;;;;;IAQaA,KAAK,GAChB,SADWA,KACX,CAACC,gBAAD,EAAqCC,IAArC;AAAA,SACA,UAACC,MAAD,EAAiBC,MAAjB,EAA4C;AAC1C,QAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,aAAOA,MAAP;AACD;;AAED,QAAME,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAW,UAACC,SAAD;AAAA,aAAeP,gBAAgB,CAACO,SAAD,CAA/B;AAAA,KAAX,CAAnB;AACAN,IAAAA,IAAI,CAACO,IAAL,CACEH,UAAU,CAACC,GAAX,CAAe,UAACG,CAAD;AAAA,aAAOA,CAAC,CAACC,IAAT;AAAA,KAAf,EAA8BC,IAA9B,CAAmC,IAAnC,CADF,EAEEN,UAAU,CAACC,GAAX,CAAe,UAACG,CAAD;AAAA,aAAOA,CAAC,CAACG,KAAT;AAAA,KAAf,EAA+BD,IAA/B,CAAoC,IAApC,CAFF;AAIA,
|
|
1
|
+
{"version":3,"file":"index-browser.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style =\n (styleToHtmlStyle: StyleToHtmlStyle, args: string[]) =>\n (styles: Styles, string: string): string => {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n const htmlStyles = styles.map((styleName) => styleToHtmlStyle[styleName]);\n args.push(\n htmlStyles.map((s) => s.open).join('; '),\n htmlStyles.map((s) => s.close).join('; '),\n );\n return `%c${string}%c`;\n };\n\nexport function createBrowserConsoleFormatter(\n theme: 'light' | 'dark' = 'light',\n): <T extends Metadata>(record: LogRecord<T>) => string[] {\n const styleToHtmlStyle: StyleToHtmlStyle =\n theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;\n return function format<T extends Metadata>(record: LogRecord<T>): string[] {\n const args: string[] = [];\n const string = formatRecordToString(record, style(styleToHtmlStyle, args));\n return [string, ...args];\n };\n}\n"],"names":["style","styleToHtmlStyle","args","styles","string","length","htmlStyles","map","styleName","push","s","open","join","close","createBrowserConsoleFormatter","theme","styleToHtmlStyleThemeDark","styleToHtmlStyleThemeLight","format","record","formatRecordToString"],"mappings":";;;;;;IAQaA,KAAK,GAChB,SADWA,KACX,CAACC,gBAAD,EAAqCC,IAArC;AAAA,SACA,UAACC,MAAD,EAAiBC,MAAjB,EAA4C;AAC1C,QAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,aAAOA,MAAP;AACD;;AAED,QAAME,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAW,UAACC,SAAD;AAAA,aAAeP,gBAAgB,CAACO,SAAD,CAA/B;AAAA,KAAX,CAAnB;AACAN,IAAAA,IAAI,CAACO,IAAL,CACEH,UAAU,CAACC,GAAX,CAAe,UAACG,CAAD;AAAA,aAAOA,CAAC,CAACC,IAAT;AAAA,KAAf,EAA8BC,IAA9B,CAAmC,IAAnC,CADF,EAEEN,UAAU,CAACC,GAAX,CAAe,UAACG,CAAD;AAAA,aAAOA,CAAC,CAACG,KAAT;AAAA,KAAf,EAA+BD,IAA/B,CAAoC,IAApC,CAFF;AAIA,kBAAYR,MAAZ;AACD,GAZD;AAAA;AAcK,SAASU,6BAAT,CACLC,KADK,EAEmD;AAAA,MADxDA,KACwD;AADxDA,IAAAA,KACwD,GAD9B,OAC8B;AAAA;;AACxD,MAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAV,GAAmBC,8CAAnB,GAA+CC,+CADjD;AAEA,SAAO,SAASC,MAAT,CAAoCC,MAApC,EAAoE;AACzE,QAAMjB,IAAc,GAAG,EAAvB;AACA,QAAME,MAAM,GAAGgB,yCAAoB,CAACD,MAAD,EAASnB,KAAK,CAACC,gBAAD,EAAmBC,IAAnB,CAAd,CAAnC;AACA,YAAQE,MAAR,SAAmBF,IAAnB;AACD,GAJD;AAKD;;;;;"}
|
package/dist/index-browser.es.js
CHANGED
|
@@ -14,7 +14,7 @@ var style = function style(styleToHtmlStyle, args) {
|
|
|
14
14
|
}).join('; '), htmlStyles.map(function (s) {
|
|
15
15
|
return s.close;
|
|
16
16
|
}).join('; '));
|
|
17
|
-
return
|
|
17
|
+
return "%c" + string + "%c";
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
function createBrowserConsoleFormatter(theme) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-browser.es.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style =\n (styleToHtmlStyle: StyleToHtmlStyle, args: string[]) =>\n (styles: Styles, string: string): string => {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n const htmlStyles = styles.map((styleName) => styleToHtmlStyle[styleName]);\n args.push(\n htmlStyles.map((s) => s.open).join('; '),\n htmlStyles.map((s) => s.close).join('; '),\n );\n return `%c${string}%c`;\n };\n\nexport function createBrowserConsoleFormatter(\n theme: 'light' | 'dark' = 'light',\n): <T extends Metadata>(record: LogRecord<T>) => string[] {\n const styleToHtmlStyle: StyleToHtmlStyle =\n theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;\n return function format<T extends Metadata>(record: LogRecord<T>): string[] {\n const args: string[] = [];\n const string = formatRecordToString(record, style(styleToHtmlStyle, args));\n return [string, ...args];\n };\n}\n"],"names":["style","styleToHtmlStyle","args","styles","string","length","htmlStyles","map","styleName","push","s","open","join","close","createBrowserConsoleFormatter","theme","styleToHtmlStyleThemeDark","styleToHtmlStyleThemeLight","format","record","formatRecordToString"],"mappings":";;IAQaA,KAAK,GAChB,SADWA,KACX,CAACC,gBAAD,EAAqCC,IAArC;AAAA,SACA,UAACC,MAAD,EAAiBC,MAAjB,EAA4C;AAC1C,QAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,aAAOA,MAAP;AACD;;AAED,QAAME,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAW,UAACC,SAAD;AAAA,aAAeP,gBAAgB,CAACO,SAAD,CAA/B;AAAA,KAAX,CAAnB;AACAN,IAAAA,IAAI,CAACO,IAAL,CACEH,UAAU,CAACC,GAAX,CAAe,UAACG,CAAD;AAAA,aAAOA,CAAC,CAACC,IAAT;AAAA,KAAf,EAA8BC,IAA9B,CAAmC,IAAnC,CADF,EAEEN,UAAU,CAACC,GAAX,CAAe,UAACG,CAAD;AAAA,aAAOA,CAAC,CAACG,KAAT;AAAA,KAAf,EAA+BD,IAA/B,CAAoC,IAApC,CAFF;AAIA,
|
|
1
|
+
{"version":3,"file":"index-browser.es.js","sources":["../src/index.ts"],"sourcesContent":["import type { StyleToHtmlStyle } from 'nightingale-formatter';\nimport {\n formatRecordToString,\n styleToHtmlStyleThemeLight,\n styleToHtmlStyleThemeDark,\n} from 'nightingale-formatter';\nimport type { LogRecord, Metadata, Styles } from 'nightingale-types';\n\nexport const style =\n (styleToHtmlStyle: StyleToHtmlStyle, args: string[]) =>\n (styles: Styles, string: string): string => {\n if (!styles || styles.length === 0 || !string) {\n return string;\n }\n\n const htmlStyles = styles.map((styleName) => styleToHtmlStyle[styleName]);\n args.push(\n htmlStyles.map((s) => s.open).join('; '),\n htmlStyles.map((s) => s.close).join('; '),\n );\n return `%c${string}%c`;\n };\n\nexport function createBrowserConsoleFormatter(\n theme: 'light' | 'dark' = 'light',\n): <T extends Metadata>(record: LogRecord<T>) => string[] {\n const styleToHtmlStyle: StyleToHtmlStyle =\n theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;\n return function format<T extends Metadata>(record: LogRecord<T>): string[] {\n const args: string[] = [];\n const string = formatRecordToString(record, style(styleToHtmlStyle, args));\n return [string, ...args];\n };\n}\n"],"names":["style","styleToHtmlStyle","args","styles","string","length","htmlStyles","map","styleName","push","s","open","join","close","createBrowserConsoleFormatter","theme","styleToHtmlStyleThemeDark","styleToHtmlStyleThemeLight","format","record","formatRecordToString"],"mappings":";;IAQaA,KAAK,GAChB,SADWA,KACX,CAACC,gBAAD,EAAqCC,IAArC;AAAA,SACA,UAACC,MAAD,EAAiBC,MAAjB,EAA4C;AAC1C,QAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,aAAOA,MAAP;AACD;;AAED,QAAME,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAW,UAACC,SAAD;AAAA,aAAeP,gBAAgB,CAACO,SAAD,CAA/B;AAAA,KAAX,CAAnB;AACAN,IAAAA,IAAI,CAACO,IAAL,CACEH,UAAU,CAACC,GAAX,CAAe,UAACG,CAAD;AAAA,aAAOA,CAAC,CAACC,IAAT;AAAA,KAAf,EAA8BC,IAA9B,CAAmC,IAAnC,CADF,EAEEN,UAAU,CAACC,GAAX,CAAe,UAACG,CAAD;AAAA,aAAOA,CAAC,CAACG,KAAT;AAAA,KAAf,EAA+BD,IAA/B,CAAoC,IAApC,CAFF;AAIA,kBAAYR,MAAZ;AACD,GAZD;AAAA;AAcK,SAASU,6BAAT,CACLC,KADK,EAEmD;AAAA,MADxDA,KACwD;AADxDA,IAAAA,KACwD,GAD9B,OAC8B;AAAA;;AACxD,MAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAV,GAAmBC,yBAAnB,GAA+CC,0BADjD;AAEA,SAAO,SAASC,MAAT,CAAoCC,MAApC,EAAoE;AACzE,QAAMjB,IAAc,GAAG,EAAvB;AACA,QAAME,MAAM,GAAGgB,oBAAoB,CAACD,MAAD,EAASnB,KAAK,CAACC,gBAAD,EAAmBC,IAAnB,CAAd,CAAnC;AACA,YAAQE,MAAR,SAAmBF,IAAnB;AACD,GAJD;AAKD;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nightingale-browser-console-formatter",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.1.3",
|
|
4
4
|
"description": "Nightingale Browser console formatter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nightingale",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"directory": "packages/nightingale-browser-console-formatter"
|
|
15
15
|
},
|
|
16
16
|
"homepage": "https://github.com/christophehurpeau/nightingale",
|
|
17
|
-
"type": "
|
|
17
|
+
"type": "module",
|
|
18
18
|
"engines": {
|
|
19
19
|
"node": "^14.13.1 || >=16.0.0"
|
|
20
20
|
},
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"not safari < 10",
|
|
26
26
|
"not ios_saf < 10"
|
|
27
27
|
],
|
|
28
|
-
"main": "./dist/index-node14.
|
|
28
|
+
"main": "./dist/index-node14.mjs",
|
|
29
29
|
"types": "./dist/index.d.ts",
|
|
30
30
|
"module": "./dist/index-browser.es.js",
|
|
31
31
|
"browser": "./dist/index-browser.es.js",
|
|
@@ -91,16 +91,16 @@
|
|
|
91
91
|
]
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"nightingale-formatter": "12.
|
|
95
|
-
"nightingale-types": "12.
|
|
94
|
+
"nightingale-formatter": "12.1.3",
|
|
95
|
+
"nightingale-types": "12.1.3"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
|
-
"@babel/core": "7.16.
|
|
99
|
-
"@babel/preset-env": "7.16.
|
|
98
|
+
"@babel/core": "7.16.7",
|
|
99
|
+
"@babel/preset-env": "7.16.8",
|
|
100
100
|
"babel-preset-modern-browsers": "15.0.2",
|
|
101
|
-
"nightingale-levels": "12.
|
|
102
|
-
"pob-babel": "29.
|
|
103
|
-
"typescript": "4.5.
|
|
101
|
+
"nightingale-levels": "12.1.3",
|
|
102
|
+
"pob-babel": "29.6.1",
|
|
103
|
+
"typescript": "4.5.4"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "67fdeb8e3c6660b8bfa4eed4b66b2c05876ed9cc"
|
|
106
106
|
}
|