nightingale-browser-console-formatter 14.2.1 → 15.0.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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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
|
+
## [15.0.0](https://github.com/christophehurpeau/nightingale/compare/v14.2.1...v15.0.0) (2023-12-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### ⚠ BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* update babel and drop browser modern version
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* update babel and drop browser modern version ([5c76abc](https://github.com/christophehurpeau/nightingale/commit/5c76abc8bfb595a617fc4c8b795dae7e674ea664))
|
|
16
|
+
|
|
17
|
+
Version bump for dependency: nightingale-formatter
|
|
18
|
+
Version bump for dependency: nightingale-types
|
|
19
|
+
Version bump for dependency: nightingale-levels
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [14.2.1](https://github.com/christophehurpeau/nightingale/compare/v14.2.0...v14.2.1) (2023-11-05)
|
|
7
23
|
|
|
8
24
|
Note: no notable changes
|
package/dist/index-browser.es.js
CHANGED
|
@@ -1,30 +1,19 @@
|
|
|
1
1
|
import { formatRecordToString, styleToHtmlStyleThemeDark, styleToHtmlStyleThemeLight } from 'nightingale-formatter';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return string;
|
|
7
|
-
}
|
|
8
|
-
var htmlStyles = styles.map(function (styleName) {
|
|
9
|
-
return styleToHtmlStyle[styleName];
|
|
10
|
-
});
|
|
11
|
-
args.push(htmlStyles.map(function (s) {
|
|
12
|
-
return s.open;
|
|
13
|
-
}).join('; '), htmlStyles.map(function (s) {
|
|
14
|
-
return s.close;
|
|
15
|
-
}).join('; '));
|
|
16
|
-
return "%c" + string + "%c";
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
function createBrowserConsoleFormatter(theme) {
|
|
20
|
-
if (theme === void 0) {
|
|
21
|
-
theme = 'light';
|
|
3
|
+
const style = (styleToHtmlStyle, args) => (styles, string) => {
|
|
4
|
+
if (!styles || styles.length === 0 || !string) {
|
|
5
|
+
return string;
|
|
22
6
|
}
|
|
23
|
-
|
|
7
|
+
const htmlStyles = styles.map(styleName => styleToHtmlStyle[styleName]);
|
|
8
|
+
args.push(htmlStyles.map(s => s.open).join('; '), htmlStyles.map(s => s.close).join('; '));
|
|
9
|
+
return `%c${string}%c`;
|
|
10
|
+
};
|
|
11
|
+
function createBrowserConsoleFormatter(theme = 'light') {
|
|
12
|
+
const styleToHtmlStyle = theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;
|
|
24
13
|
return function format(record) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return [string]
|
|
14
|
+
const args = [];
|
|
15
|
+
const string = formatRecordToString(record, style(styleToHtmlStyle, args));
|
|
16
|
+
return [string, ...args];
|
|
28
17
|
};
|
|
29
18
|
}
|
|
30
19
|
|
|
@@ -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: 'dark' | 'light' = '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"
|
|
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: 'dark' | 'light' = '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":";;AAQaA,MAAAA,KAAK,GAChBA,CAACC,gBAAkC,EAAEC,IAAc,KACnD,CAACC,MAAc,EAAEC,MAAc,KAAa;EAC1C,IAAI,CAACD,MAAM,IAAIA,MAAM,CAACE,MAAM,KAAK,CAAC,IAAI,CAACD,MAAM,EAAE;AAC7C,IAAA,OAAOA,MAAM,CAAA;AACf,GAAA;AAEA,EAAA,MAAME,UAAU,GAAGH,MAAM,CAACI,GAAG,CAAEC,SAAS,IAAKP,gBAAgB,CAACO,SAAS,CAAC,CAAC,CAAA;AACzEN,EAAAA,IAAI,CAACO,IAAI,CACPH,UAAU,CAACC,GAAG,CAAEG,CAAC,IAAKA,CAAC,CAACC,IAAI,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC,EACxCN,UAAU,CAACC,GAAG,CAAEG,CAAC,IAAKA,CAAC,CAACG,KAAK,CAAC,CAACD,IAAI,CAAC,IAAI,CAC1C,CAAC,CAAA;EACD,OAAQ,CAAA,EAAA,EAAIR,MAAO,CAAG,EAAA,CAAA,CAAA;AACxB,EAAC;AAEI,SAASU,6BAA6BA,CAC3CC,KAAuB,GAAG,OAAO,EACuB;EACxD,MAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAM,GAAGC,yBAAyB,GAAGC,0BAA0B,CAAA;AAC3E,EAAA,OAAO,SAASC,MAAMA,CAAqBC,MAAoB,EAAY;IACzE,MAAMjB,IAAc,GAAG,EAAE,CAAA;AACzB,IAAA,MAAME,MAAM,GAAGgB,oBAAoB,CAACD,MAAM,EAAEnB,KAAK,CAACC,gBAAgB,EAAEC,IAAI,CAAC,CAAC,CAAA;AAC1E,IAAA,OAAO,CAACE,MAAM,EAAE,GAAGF,IAAI,CAAC,CAAA;GACzB,CAAA;AACH;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nightingale-browser-console-formatter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
4
4
|
"description": "Nightingale Browser console formatter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nightingale",
|
|
@@ -39,9 +39,6 @@
|
|
|
39
39
|
"import": "./dist/index-node18.mjs"
|
|
40
40
|
},
|
|
41
41
|
"browser": {
|
|
42
|
-
"browser:modern": {
|
|
43
|
-
"import": "./dist/index-browsermodern.es.js"
|
|
44
|
-
},
|
|
45
42
|
"import": "./dist/index-browser.es.js"
|
|
46
43
|
}
|
|
47
44
|
}
|
|
@@ -68,10 +65,6 @@
|
|
|
68
65
|
"target": "node",
|
|
69
66
|
"version": "18"
|
|
70
67
|
},
|
|
71
|
-
{
|
|
72
|
-
"target": "browser",
|
|
73
|
-
"version": "modern"
|
|
74
|
-
},
|
|
75
68
|
{
|
|
76
69
|
"target": "browser"
|
|
77
70
|
}
|
|
@@ -81,14 +74,14 @@
|
|
|
81
74
|
]
|
|
82
75
|
},
|
|
83
76
|
"dependencies": {
|
|
84
|
-
"nightingale-formatter": "
|
|
85
|
-
"nightingale-types": "
|
|
77
|
+
"nightingale-formatter": "15.0.0",
|
|
78
|
+
"nightingale-types": "15.0.0"
|
|
86
79
|
},
|
|
87
80
|
"devDependencies": {
|
|
88
|
-
"@babel/core": "7.23.
|
|
89
|
-
"@babel/preset-env": "7.23.
|
|
90
|
-
"nightingale-levels": "
|
|
91
|
-
"pob-babel": "
|
|
92
|
-
"typescript": "5.
|
|
81
|
+
"@babel/core": "7.23.6",
|
|
82
|
+
"@babel/preset-env": "7.23.6",
|
|
83
|
+
"nightingale-levels": "15.0.0",
|
|
84
|
+
"pob-babel": "38.0.0",
|
|
85
|
+
"typescript": "5.3.3"
|
|
93
86
|
}
|
|
94
87
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { formatRecordToString, styleToHtmlStyleThemeDark, styleToHtmlStyleThemeLight } from 'nightingale-formatter';
|
|
2
|
-
|
|
3
|
-
const style = (styleToHtmlStyle, args) => (styles, string) => {
|
|
4
|
-
if (!styles || styles.length === 0 || !string) {
|
|
5
|
-
return string;
|
|
6
|
-
}
|
|
7
|
-
const htmlStyles = styles.map(styleName => styleToHtmlStyle[styleName]);
|
|
8
|
-
args.push(htmlStyles.map(s => s.open).join('; '), htmlStyles.map(s => s.close).join('; '));
|
|
9
|
-
return `%c${string}%c`;
|
|
10
|
-
};
|
|
11
|
-
function createBrowserConsoleFormatter(theme = 'light') {
|
|
12
|
-
const styleToHtmlStyle = theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;
|
|
13
|
-
return function format(record) {
|
|
14
|
-
const args = [];
|
|
15
|
-
const string = formatRecordToString(record, style(styleToHtmlStyle, args));
|
|
16
|
-
return [string, ...args];
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { createBrowserConsoleFormatter, style };
|
|
21
|
-
//# sourceMappingURL=index-browsermodern.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-browsermodern.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: 'dark' | 'light' = '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":";;AAQaA,MAAAA,KAAK,GAChBA,CAACC,gBAAkC,EAAEC,IAAc,KACnD,CAACC,MAAc,EAAEC,MAAc,KAAa;EAC1C,IAAI,CAACD,MAAM,IAAIA,MAAM,CAACE,MAAM,KAAK,CAAC,IAAI,CAACD,MAAM,EAAE;AAC7C,IAAA,OAAOA,MAAM,CAAA;AACf,GAAA;AAEA,EAAA,MAAME,UAAU,GAAGH,MAAM,CAACI,GAAG,CAAEC,SAAS,IAAKP,gBAAgB,CAACO,SAAS,CAAC,CAAC,CAAA;AACzEN,EAAAA,IAAI,CAACO,IAAI,CACPH,UAAU,CAACC,GAAG,CAAEG,CAAC,IAAKA,CAAC,CAACC,IAAI,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC,EACxCN,UAAU,CAACC,GAAG,CAAEG,CAAC,IAAKA,CAAC,CAACG,KAAK,CAAC,CAACD,IAAI,CAAC,IAAI,CAC1C,CAAC,CAAA;EACD,OAAQ,CAAA,EAAA,EAAIR,MAAO,CAAG,EAAA,CAAA,CAAA;AACxB,EAAC;AAEI,SAASU,6BAA6BA,CAC3CC,KAAuB,GAAG,OAAO,EACuB;EACxD,MAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAM,GAAGC,yBAAyB,GAAGC,0BAA0B,CAAA;AAC3E,EAAA,OAAO,SAASC,MAAMA,CAAqBC,MAAoB,EAAY;IACzE,MAAMjB,IAAc,GAAG,EAAE,CAAA;AACzB,IAAA,MAAME,MAAM,GAAGgB,oBAAoB,CAACD,MAAM,EAAEnB,KAAK,CAACC,gBAAgB,EAAEC,IAAI,CAAC,CAAC,CAAA;AAC1E,IAAA,OAAO,CAACE,MAAM,EAAE,GAAGF,IAAI,CAAC,CAAA;GACzB,CAAA;AACH;;;;"}
|