nightingale-browser-console-formatter 12.1.3 → 13.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,39 @@
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
+ # [13.0.0](https://github.com/christophehurpeau/nightingale/compare/v12.1.4...v13.0.0) (2022-11-19)
7
+
8
+
9
+ ### Code Refactoring
10
+
11
+ * drop node 14 and cjs ([9a8ca06](https://github.com/christophehurpeau/nightingale/commit/9a8ca064449ddc0d69e26543e21c2d522536c50a))
12
+
13
+
14
+ ### Features
15
+
16
+ * build for node 16 ([30ae3e9](https://github.com/christophehurpeau/nightingale/commit/30ae3e9c455dbad793c2f704b9d860069dc80c32))
17
+
18
+
19
+ ### BREAKING CHANGES
20
+
21
+ * dropped node 14 and cjs
22
+ * drop node 14
23
+
24
+
25
+
26
+
27
+
28
+ ## [12.1.4](https://github.com/christophehurpeau/nightingale/compare/v12.1.3...v12.1.4) (2022-02-05)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * cjs build ([2e24ac5](https://github.com/christophehurpeau/nightingale/commit/2e24ac5753ee386c5be9ca56796194ee598f10ff))
34
+
35
+
36
+
37
+
38
+
6
39
  ## [12.1.3](https://github.com/christophehurpeau/nightingale/compare/v12.1.2...v12.1.3) (2022-01-15)
7
40
 
8
41
  **Note:** Version bump only for package nightingale-browser-console-formatter
package/README.md CHANGED
@@ -8,6 +8,10 @@
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://npmjs.org/package/nightingale-browser-console-formatter"><img src="https://img.shields.io/npm/v/nightingale-browser-console-formatter.svg?style=flat-square"></a>
11
+ <a href="https://npmjs.org/package/nightingale-browser-console-formatter"><img src="https://img.shields.io/npm/dw/nightingale-browser-console-formatter.svg?style=flat-square"></a>
12
+ <a href="https://npmjs.org/package/nightingale-browser-console-formatter"><img src="https://img.shields.io/node/v/nightingale-browser-console-formatter.svg?style=flat-square"></a>
13
+ <a href="https://npmjs.org/package/nightingale-browser-console-formatter"><img src="https://img.shields.io/npm/types/nightingale-browser-console-formatter.svg?style=flat-square"></a>
14
+ <a href="https://codecov.io/gh/christophehurpeau/nightingale"><img src="https://img.shields.io/codecov/c/github/christophehurpeau/nightingale/master.svg?style=flat-square"></a>
11
15
  </p>
12
16
 
13
17
  ## Install
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAM9D,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAErE,eAAO,MAAM,KAAK,qBACG,gBAAgB,QAAQ,MAAM,EAAE,cAC1C,MAAM,UAAU,MAAM,KAAG,MAWjC,CAAC;AAEJ,wBAAgB,6BAA6B,CAC3C,KAAK,GAAE,OAAO,GAAG,MAAgB,GAChC,CAAC,CAAC,SAAS,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,CAQxD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/index.test.ts"],"names":[],"mappings":""}
@@ -5,7 +5,6 @@ var style = function style(styleToHtmlStyle, args) {
5
5
  if (!styles || styles.length === 0 || !string) {
6
6
  return string;
7
7
  }
8
-
9
8
  var htmlStyles = styles.map(function (styleName) {
10
9
  return styleToHtmlStyle[styleName];
11
10
  });
@@ -21,7 +20,6 @@ function createBrowserConsoleFormatter(theme) {
21
20
  if (theme === void 0) {
22
21
  theme = 'light';
23
22
  }
24
-
25
23
  var styleToHtmlStyle = theme === 'dark' ? styleToHtmlStyleThemeDark : styleToHtmlStyleThemeLight;
26
24
  return function format(record) {
27
25
  var args = [];
@@ -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,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;;;;"}
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":";;AAQO,IAAMA,KAAK,GAChB,SADWA,KAAK,CACfC,gBAAkC,EAAEC,IAAc,EAAA;AAAA,EAAA,OACnD,UAACC,MAAc,EAAEC,MAAc,EAAa;IAC1C,IAAI,CAACD,MAAM,IAAIA,MAAM,CAACE,MAAM,KAAK,CAAC,IAAI,CAACD,MAAM,EAAE;AAC7C,MAAA,OAAOA,MAAM,CAAA;AACf,KAAA;AAEA,IAAA,IAAME,UAAU,GAAGH,MAAM,CAACI,GAAG,CAAC,UAACC,SAAS,EAAA;MAAA,OAAKP,gBAAgB,CAACO,SAAS,CAAC,CAAA;KAAC,CAAA,CAAA;IACzEN,IAAI,CAACO,IAAI,CACPH,UAAU,CAACC,GAAG,CAAC,UAACG,CAAC,EAAA;MAAA,OAAKA,CAAC,CAACC,IAAI,CAAA;KAAC,CAAA,CAACC,IAAI,CAAC,IAAI,CAAC,EACxCN,UAAU,CAACC,GAAG,CAAC,UAACG,CAAC,EAAA;MAAA,OAAKA,CAAC,CAACG,KAAK,CAAA;AAAA,KAAA,CAAC,CAACD,IAAI,CAAC,IAAI,CAAC,CAC1C,CAAA;AACD,IAAA,OAAA,IAAA,GAAYR,MAAM,GAAA,IAAA,CAAA;GACnB,CAAA;AAAA,EAAA;AAEI,SAASU,6BAA6B,CAC3CC,KAAuB,EACiC;AAAA,EAAA,IADxDA,KAAuB,KAAA,KAAA,CAAA,EAAA;AAAvBA,IAAAA,KAAuB,GAAG,OAAO,CAAA;AAAA,GAAA;EAEjC,IAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAM,GAAGC,yBAAyB,GAAGC,0BAA0B,CAAA;AAC3E,EAAA,OAAO,SAASC,MAAM,CAAqBC,MAAoB,EAAY;IACzE,IAAMjB,IAAc,GAAG,EAAE,CAAA;AACzB,IAAA,IAAME,MAAM,GAAGgB,oBAAoB,CAACD,MAAM,EAAEnB,KAAK,CAACC,gBAAgB,EAAEC,IAAI,CAAC,CAAC,CAAA;IAC1E,OAAQE,CAAAA,MAAM,SAAKF,IAAI,CAAA,CAAA;GACxB,CAAA;AACH;;;;"}
@@ -4,7 +4,6 @@ const style = (styleToHtmlStyle, args) => (styles, string) => {
4
4
  if (!styles || styles.length === 0 || !string) {
5
5
  return string;
6
6
  }
7
-
8
7
  const htmlStyles = styles.map(styleName => styleToHtmlStyle[styleName]);
9
8
  args.push(htmlStyles.map(s => s.open).join('; '), htmlStyles.map(s => s.close).join('; '));
10
9
  return `%c${string}%c`;
@@ -1 +1 @@
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: '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,yBAAnB,GAA+CC,0BADjD;AAEA,SAAO,SAASC,MAAT,CAAoCC,MAApC,EAAoE;AACzE,UAAMjB,IAAc,GAAG,EAAvB;AACA,UAAME,MAAM,GAAGgB,oBAAoB,CAACD,MAAD,EAASnB,KAAK,CAACC,gBAAD,EAAmBC,IAAnB,CAAd,CAAnC;AACA,WAAO,CAACE,MAAD,EAAS,GAAGF,IAAZ,CAAP;AACD,GAJD;AAKD;;;;"}
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: '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":";;AAQaA,MAAAA,KAAK,GAChB,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,CAAC,CAC1C,CAAA;EACD,OAAQ,CAAA,EAAA,EAAIR,MAAO,CAAG,EAAA,CAAA,CAAA;AACxB,EAAC;AAEI,SAASU,6BAA6B,CAC3CC,KAAuB,GAAG,OAAO,EACuB;EACxD,MAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAM,GAAGC,yBAAyB,GAAGC,0BAA0B,CAAA;AAC3E,EAAA,OAAO,SAASC,MAAM,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;;;;"}
@@ -4,7 +4,6 @@ const style = (styleToHtmlStyle, args) => (styles, string) => {
4
4
  if (!styles || styles.length === 0 || !string) {
5
5
  return string;
6
6
  }
7
-
8
7
  const htmlStyles = styles.map(styleName => styleToHtmlStyle[styleName]);
9
8
  args.push(htmlStyles.map(s => s.open).join('; '), htmlStyles.map(s => s.close).join('; '));
10
9
  return `%c${string}%c`;
@@ -19,4 +18,4 @@ function createBrowserConsoleFormatter(theme = 'light') {
19
18
  }
20
19
 
21
20
  export { createBrowserConsoleFormatter, style };
22
- //# sourceMappingURL=index-node14.mjs.map
21
+ //# sourceMappingURL=index-node16.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-node14.mjs","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,yBAAnB,GAA+CC,0BADjD;AAEA,SAAO,SAASC,MAAT,CAAoCC,MAApC,EAAoE;AACzE,UAAMjB,IAAc,GAAG,EAAvB;AACA,UAAME,MAAM,GAAGgB,oBAAoB,CAACD,MAAD,EAASnB,KAAK,CAACC,gBAAD,EAAmBC,IAAnB,CAAd,CAAnC;AACA,WAAO,CAACE,MAAD,EAAS,GAAGF,IAAZ,CAAP;AACD,GAJD;AAKD;;;;"}
1
+ {"version":3,"file":"index-node16.mjs","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":";;AAQaA,MAAAA,KAAK,GAChB,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,CAAC,CAC1C,CAAA;EACD,OAAQ,CAAA,EAAA,EAAIR,MAAO,CAAG,EAAA,CAAA,CAAA;AACxB,EAAC;AAEI,SAASU,6BAA6B,CAC3CC,KAAuB,GAAG,OAAO,EACuB;EACxD,MAAMd,gBAAkC,GACtCc,KAAK,KAAK,MAAM,GAAGC,yBAAyB,GAAGC,0BAA0B,CAAA;AAC3E,EAAA,OAAO,SAASC,MAAM,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": "12.1.3",
3
+ "version": "13.0.0",
4
4
  "description": "Nightingale Browser console formatter",
5
5
  "keywords": [
6
6
  "nightingale",
@@ -16,7 +16,7 @@
16
16
  "homepage": "https://github.com/christophehurpeau/nightingale",
17
17
  "type": "module",
18
18
  "engines": {
19
- "node": "^14.13.1 || >=16.0.0"
19
+ "node": ">=16.0.0"
20
20
  },
21
21
  "browserslist": [
22
22
  "defaults",
@@ -25,65 +25,48 @@
25
25
  "not safari < 10",
26
26
  "not ios_saf < 10"
27
27
  ],
28
- "main": "./dist/index-node14.mjs",
29
- "types": "./dist/index.d.ts",
28
+ "main": "./dist/index-node16.mjs",
29
+ "types": "./dist/definitions/index.d.ts",
30
30
  "module": "./dist/index-browser.es.js",
31
31
  "browser": "./dist/index-browser.es.js",
32
32
  "exports": {
33
33
  "./package.json": "./package.json",
34
34
  ".": {
35
35
  "node": {
36
- "import": "./dist/index-node14.mjs",
37
- "require": "./dist/index-node14.cjs.js"
36
+ "import": "./dist/index-node16.mjs"
38
37
  },
39
38
  "browser": {
40
39
  "browser:modern": {
41
40
  "import": "./dist/index-browsermodern.es.js"
42
41
  },
43
- "import": "./dist/index-browser.es.js",
44
- "require": "./dist/index-browser.cjs.js"
42
+ "import": "./dist/index-browser.es.js"
45
43
  }
46
44
  }
47
45
  },
48
- "module:node": "./dist/index-node14.mjs",
49
- "module:modern-browsers": "./dist/index-browsermodern.es.js",
50
46
  "sideEffects": false,
51
47
  "scripts": {
52
- "build": "pob-build && yarn run build:definitions",
53
- "build:definitions": "tsc -p tsconfig.build.json",
54
- "clean": "rm -Rf dist",
48
+ "build": "yarn clean:build && rollup --config rollup.config.mjs && yarn run build:definitions",
49
+ "build:definitions": "tsc -p",
50
+ "clean": "yarn clean:build",
51
+ "clean:build": "pob-babel-clean-out dist",
55
52
  "lint": "yarn run lint:eslint",
56
- "lint:eslint": "cd ../.. && yarn run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet packages/nightingale-browser-console-formatter",
57
- "watch": "pob-watch"
58
- },
59
- "prettier": {
60
- "trailingComma": "all",
61
- "singleQuote": true,
62
- "arrowParens": "always"
53
+ "lint:eslint": "yarn ../.. run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet packages/nightingale-browser-console-formatter",
54
+ "test": "yarn ../../ run test -- packages/nightingale-browser-console-formatter",
55
+ "watch": "yarn clean:build && rollup --config rollup.config.mjs --watch"
63
56
  },
57
+ "prettier": "@pob/root/prettier-config",
64
58
  "pob": {
65
59
  "babelEnvs": [
66
60
  {
67
61
  "target": "node",
68
- "version": "14",
69
- "formats": [
70
- "cjs",
71
- "es"
72
- ]
62
+ "version": "16"
73
63
  },
74
64
  {
75
65
  "target": "browser",
76
- "version": "modern",
77
- "formats": [
78
- "es"
79
- ]
66
+ "version": "modern"
80
67
  },
81
68
  {
82
- "target": "browser",
83
- "formats": [
84
- "cjs",
85
- "es"
86
- ]
69
+ "target": "browser"
87
70
  }
88
71
  ],
89
72
  "entries": [
@@ -91,16 +74,16 @@
91
74
  ]
92
75
  },
93
76
  "dependencies": {
94
- "nightingale-formatter": "12.1.3",
95
- "nightingale-types": "12.1.3"
77
+ "nightingale-formatter": "13.0.0",
78
+ "nightingale-types": "13.0.0"
96
79
  },
97
80
  "devDependencies": {
98
- "@babel/core": "7.16.7",
99
- "@babel/preset-env": "7.16.8",
81
+ "@babel/core": "7.20.2",
82
+ "@babel/preset-env": "7.20.2",
100
83
  "babel-preset-modern-browsers": "15.0.2",
101
- "nightingale-levels": "12.1.3",
102
- "pob-babel": "29.6.1",
103
- "typescript": "4.5.4"
84
+ "nightingale-levels": "13.0.0",
85
+ "pob-babel": "35.3.0",
86
+ "typescript": "4.9.3"
104
87
  },
105
- "gitHead": "67fdeb8e3c6660b8bfa4eed4b66b2c05876ed9cc"
88
+ "gitHead": "52cf7e3c8762a07891da9dde497ec03298c15654"
106
89
  }
@@ -1,39 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var nightingaleFormatter = require('nightingale-formatter');
6
-
7
- var style = function style(styleToHtmlStyle, args) {
8
- return function (styles, string) {
9
- if (!styles || styles.length === 0 || !string) {
10
- return string;
11
- }
12
-
13
- var htmlStyles = styles.map(function (styleName) {
14
- return styleToHtmlStyle[styleName];
15
- });
16
- args.push(htmlStyles.map(function (s) {
17
- return s.open;
18
- }).join('; '), htmlStyles.map(function (s) {
19
- return s.close;
20
- }).join('; '));
21
- return "%c" + string + "%c";
22
- };
23
- };
24
- function createBrowserConsoleFormatter(theme) {
25
- if (theme === void 0) {
26
- theme = 'light';
27
- }
28
-
29
- var styleToHtmlStyle = theme === 'dark' ? nightingaleFormatter.styleToHtmlStyleThemeDark : nightingaleFormatter.styleToHtmlStyleThemeLight;
30
- return function format(record) {
31
- var args = [];
32
- var string = nightingaleFormatter.formatRecordToString(record, style(styleToHtmlStyle, args));
33
- return [string].concat(args);
34
- };
35
- }
36
-
37
- exports.createBrowserConsoleFormatter = createBrowserConsoleFormatter;
38
- exports.style = style;
39
- //# sourceMappingURL=index-browser.cjs.js.map
@@ -1 +0,0 @@
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;;;;;"}
@@ -1,27 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const nightingaleFormatter = require('nightingale-formatter');
6
-
7
- const style = (styleToHtmlStyle, args) => (styles, string) => {
8
- if (!styles || styles.length === 0 || !string) {
9
- return string;
10
- }
11
-
12
- const htmlStyles = styles.map(styleName => styleToHtmlStyle[styleName]);
13
- args.push(htmlStyles.map(s => s.open).join('; '), htmlStyles.map(s => s.close).join('; '));
14
- return `%c${string}%c`;
15
- };
16
- function createBrowserConsoleFormatter(theme = 'light') {
17
- const styleToHtmlStyle = theme === 'dark' ? nightingaleFormatter.styleToHtmlStyleThemeDark : nightingaleFormatter.styleToHtmlStyleThemeLight;
18
- return function format(record) {
19
- const args = [];
20
- const string = nightingaleFormatter.formatRecordToString(record, style(styleToHtmlStyle, args));
21
- return [string, ...args];
22
- };
23
- }
24
-
25
- exports.createBrowserConsoleFormatter = createBrowserConsoleFormatter;
26
- exports.style = style;
27
- //# sourceMappingURL=index-node14.cjs.js.map
@@ -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;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAM9D,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAErE,eAAO,MAAM,KAAK,qBACG,gBAAgB,QAAQ,MAAM,EAAE,cAC1C,MAAM,UAAU,MAAM,KAAG,MAWjC,CAAC;AAEJ,wBAAgB,6BAA6B,CAC3C,KAAK,GAAE,OAAO,GAAG,MAAgB,GAChC,CAAC,CAAC,SAAS,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,CAQxD"}
package/rollup.config.mjs DELETED
@@ -1,3 +0,0 @@
1
- import createRollupConfig from 'pob-babel/createRollupConfig.js';
2
-
3
- export default createRollupConfig({});