nightingale-browser-console-formatter 12.1.3 → 12.1.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
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.4](https://github.com/christophehurpeau/nightingale/compare/v12.1.3...v12.1.4) (2022-02-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * cjs build ([2e24ac5](https://github.com/christophehurpeau/nightingale/commit/2e24ac5753ee386c5be9ca56796194ee598f10ff))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [12.1.3](https://github.com/christophehurpeau/nightingale/compare/v12.1.2...v12.1.3) (2022-01-15)
7
18
 
8
19
  **Note:** Version bump only for package nightingale-browser-console-formatter
@@ -24,4 +24,4 @@ function createBrowserConsoleFormatter(theme = 'light') {
24
24
 
25
25
  exports.createBrowserConsoleFormatter = createBrowserConsoleFormatter;
26
26
  exports.style = style;
27
- //# sourceMappingURL=index-node14.cjs.js.map
27
+ //# sourceMappingURL=index-node14.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-node14.cjs","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":";;;;;;MAQaA,KAAK,GAChB,CAACC,gBAAD,EAAqCC,IAArC,KACA,CAACC,MAAD,EAAiBC,MAAjB,KAA4C;AAC1C,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD;;AAED,QAAME,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAYC,SAAD,IAAeP,gBAAgB,CAACO,SAAD,CAA1C,CAAnB;AACAN,EAAAA,IAAI,CAACO,IAAL,CACEH,UAAU,CAACC,GAAX,CAAgBG,CAAD,IAAOA,CAAC,CAACC,IAAxB,EAA8BC,IAA9B,CAAmC,IAAnC,CADF,EAEEN,UAAU,CAACC,GAAX,CAAgBG,CAAD,IAAOA,CAAC,CAACG,KAAxB,EAA+BD,IAA/B,CAAoC,IAApC,CAFF;AAIA,SAAQ,KAAIR,MAAO,IAAnB;AACD;AAEI,SAASU,6BAAT,CACLC,KAAuB,GAAG,OADrB,EAEmD;AACxD,QAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAV,GAAmBC,8CAAnB,GAA+CC,+CADjD;AAEA,SAAO,SAASC,MAAT,CAAoCC,MAApC,EAAoE;AACzE,UAAMjB,IAAc,GAAG,EAAvB;AACA,UAAME,MAAM,GAAGgB,yCAAoB,CAACD,MAAD,EAASnB,KAAK,CAACC,gBAAD,EAAmBC,IAAnB,CAAd,CAAnC;AACA,WAAO,CAACE,MAAD,EAAS,GAAGF,IAAZ,CAAP;AACD,GAJD;AAKD;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nightingale-browser-console-formatter",
3
- "version": "12.1.3",
3
+ "version": "12.1.4",
4
4
  "description": "Nightingale Browser console formatter",
5
5
  "keywords": [
6
6
  "nightingale",
@@ -34,7 +34,7 @@
34
34
  ".": {
35
35
  "node": {
36
36
  "import": "./dist/index-node14.mjs",
37
- "require": "./dist/index-node14.cjs.js"
37
+ "require": "./dist/index-node14.cjs"
38
38
  },
39
39
  "browser": {
40
40
  "browser:modern": {
@@ -91,16 +91,16 @@
91
91
  ]
92
92
  },
93
93
  "dependencies": {
94
- "nightingale-formatter": "12.1.3",
95
- "nightingale-types": "12.1.3"
94
+ "nightingale-formatter": "12.1.4",
95
+ "nightingale-types": "12.1.4"
96
96
  },
97
97
  "devDependencies": {
98
- "@babel/core": "7.16.7",
99
- "@babel/preset-env": "7.16.8",
98
+ "@babel/core": "7.17.0",
99
+ "@babel/preset-env": "7.16.11",
100
100
  "babel-preset-modern-browsers": "15.0.2",
101
- "nightingale-levels": "12.1.3",
102
- "pob-babel": "29.6.1",
103
- "typescript": "4.5.4"
101
+ "nightingale-levels": "12.1.4",
102
+ "pob-babel": "30.0.1",
103
+ "typescript": "4.5.5"
104
104
  },
105
- "gitHead": "67fdeb8e3c6660b8bfa4eed4b66b2c05876ed9cc"
105
+ "gitHead": "3754d4575d948b5bb8c5227d3c3f4ca25e801db5"
106
106
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-node14.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":";;;;;;MAQaA,KAAK,GAChB,CAACC,gBAAD,EAAqCC,IAArC,KACA,CAACC,MAAD,EAAiBC,MAAjB,KAA4C;AAC1C,MAAI,CAACD,MAAD,IAAWA,MAAM,CAACE,MAAP,KAAkB,CAA7B,IAAkC,CAACD,MAAvC,EAA+C;AAC7C,WAAOA,MAAP;AACD;;AAED,QAAME,UAAU,GAAGH,MAAM,CAACI,GAAP,CAAYC,SAAD,IAAeP,gBAAgB,CAACO,SAAD,CAA1C,CAAnB;AACAN,EAAAA,IAAI,CAACO,IAAL,CACEH,UAAU,CAACC,GAAX,CAAgBG,CAAD,IAAOA,CAAC,CAACC,IAAxB,EAA8BC,IAA9B,CAAmC,IAAnC,CADF,EAEEN,UAAU,CAACC,GAAX,CAAgBG,CAAD,IAAOA,CAAC,CAACG,KAAxB,EAA+BD,IAA/B,CAAoC,IAApC,CAFF;AAIA,SAAQ,KAAIR,MAAO,IAAnB;AACD;AAEI,SAASU,6BAAT,CACLC,KAAuB,GAAG,OADrB,EAEmD;AACxD,QAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAV,GAAmBC,8CAAnB,GAA+CC,+CADjD;AAEA,SAAO,SAASC,MAAT,CAAoCC,MAApC,EAAoE;AACzE,UAAMjB,IAAc,GAAG,EAAvB;AACA,UAAME,MAAM,GAAGgB,yCAAoB,CAACD,MAAD,EAASnB,KAAK,CAACC,gBAAD,EAAmBC,IAAnB,CAAd,CAAnC;AACA,WAAO,CAACE,MAAD,EAAS,GAAGF,IAAZ,CAAP;AACD,GAJD;AAKD;;;;;"}