nightingale-formatter 14.2.1 → 16.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +8 -8
  3. package/lib/index.js +9 -0
  4. package/package.json +11 -61
  5. package/dist/definitions/formatObject.d.ts +0 -9
  6. package/dist/definitions/formatObject.d.ts.map +0 -1
  7. package/dist/definitions/formatObject.test.d.ts +0 -2
  8. package/dist/definitions/formatObject.test.d.ts.map +0 -1
  9. package/dist/definitions/formatRecordToString.d.ts +0 -4
  10. package/dist/definitions/formatRecordToString.d.ts.map +0 -1
  11. package/dist/definitions/index.d.ts +0 -8
  12. package/dist/definitions/index.d.ts.map +0 -1
  13. package/dist/definitions/index.test.d.ts +0 -2
  14. package/dist/definitions/index.test.d.ts.map +0 -1
  15. package/dist/definitions/levelToStyles.d.ts +0 -3
  16. package/dist/definitions/levelToStyles.d.ts.map +0 -1
  17. package/dist/definitions/levelToSymbol.d.ts +0 -3
  18. package/dist/definitions/levelToSymbol.d.ts.map +0 -1
  19. package/dist/definitions/styleToHexColor.d.ts +0 -3
  20. package/dist/definitions/styleToHexColor.d.ts.map +0 -1
  21. package/dist/definitions/styleToHtmlStyle.d.ts +0 -8
  22. package/dist/definitions/styleToHtmlStyle.d.ts.map +0 -1
  23. package/dist/index-browser.es.js +0 -526
  24. package/dist/index-browser.es.js.map +0 -1
  25. package/dist/index-browsermodern.es.js +0 -523
  26. package/dist/index-browsermodern.es.js.map +0 -1
  27. package/dist/index-node18.mjs +0 -523
  28. package/dist/index-node18.mjs.map +0 -1
  29. package/src/.eslintrc.json +0 -30
  30. package/src/formatObject.test.ts +0 -153
  31. package/src/formatObject.ts +0 -461
  32. package/src/formatRecordToString.ts +0 -67
  33. package/src/index.test.ts +0 -33
  34. package/src/index.ts +0 -10
  35. package/src/levelToStyles.ts +0 -14
  36. package/src/levelToSymbol.ts +0 -14
  37. package/src/styleToHexColor.ts +0 -7
  38. package/src/styleToHtmlStyle.ts +0 -67
package/CHANGELOG.md CHANGED
@@ -3,6 +3,38 @@
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
+ ## [16.0.0](https://github.com/christophehurpeau/nightingale/compare/v15.0.0...v16.0.0) (2025-03-30)
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * drop node 18
11
+
12
+ ### Features
13
+
14
+ * drop node 18 ([1b11a55](https://github.com/christophehurpeau/nightingale/commit/1b11a55dd24c9435be50519a748316079f554414))
15
+
16
+ ### Bug Fixes
17
+
18
+ * fix lib exports ([5b562b2](https://github.com/christophehurpeau/nightingale/commit/5b562b245aac1aa86b728a9433f3c9d28c62fe04))
19
+
20
+ Version bump for dependency: nightingale
21
+
22
+
23
+ ## [15.0.0](https://github.com/christophehurpeau/nightingale/compare/v14.2.1...v15.0.0) (2023-12-25)
24
+
25
+
26
+ ### ⚠ BREAKING CHANGES
27
+
28
+ * update babel and drop browser modern version
29
+
30
+ ### Features
31
+
32
+ * update babel and drop browser modern version ([5c76abc](https://github.com/christophehurpeau/nightingale/commit/5c76abc8bfb595a617fc4c8b795dae7e674ea664))
33
+
34
+ Version bump for dependency: nightingale-levels
35
+ Version bump for dependency: nightingale-types
36
+
37
+
6
38
  ## [14.2.1](https://github.com/christophehurpeau/nightingale/compare/v14.2.0...v14.2.1) (2023-11-05)
7
39
 
8
40
  Note: no notable changes
package/README.md CHANGED
@@ -1,16 +1,16 @@
1
- <h3 align="center">
1
+ <h1 align="center">
2
2
  nightingale-formatter
3
- </h3>
3
+ </h1>
4
4
 
5
5
  <p align="center">
6
- Nightingale formatter
6
+ Deprecated: use nightingale package instead
7
7
  </p>
8
8
 
9
9
  <p align="center">
10
- <a href="https://npmjs.org/package/nightingale-formatter"><img src="https://img.shields.io/npm/v/nightingale-formatter.svg?style=flat-square"></a>
11
- <a href="https://npmjs.org/package/nightingale-formatter"><img src="https://img.shields.io/npm/dw/nightingale-formatter.svg?style=flat-square"></a>
12
- <a href="https://npmjs.org/package/nightingale-formatter"><img src="https://img.shields.io/node/v/nightingale-formatter.svg?style=flat-square"></a>
13
- <a href="https://npmjs.org/package/nightingale-formatter"><img src="https://img.shields.io/npm/types/nightingale-formatter.svg?style=flat-square"></a>
10
+ <a href="https://npmjs.org/package/nightingale-formatter"><img src="https://img.shields.io/npm/v/nightingale-formatter.svg?style=flat-square" alt="npm version"></a>
11
+ <a href="https://npmjs.org/package/nightingale-formatter"><img src="https://img.shields.io/npm/dw/nightingale-formatter.svg?style=flat-square" alt="npm downloads"></a>
12
+ <a href="https://npmjs.org/package/nightingale-formatter"><img src="https://img.shields.io/node/v/nightingale-formatter.svg?style=flat-square" alt="node version"></a>
13
+ <a href="https://npmjs.org/package/nightingale-formatter"><img src="https://img.shields.io/npm/types/nightingale-formatter.svg?style=flat-square" alt="types"></a>
14
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>
15
15
  </p>
16
16
 
@@ -30,5 +30,5 @@ import {
30
30
  styleToHexColor,
31
31
  formatObject,
32
32
  formatRecordToString,
33
- } from 'nightingale-formatter';
33
+ } from "nightingale-formatter";
34
34
  ```
package/lib/index.js ADDED
@@ -0,0 +1,9 @@
1
+ export {
2
+ levelToStyles,
3
+ levelToSymbol,
4
+ styleToHtmlStyleThemeDark,
5
+ styleToHtmlStyleThemeLight,
6
+ styleToHexColor,
7
+ formatObject,
8
+ formatRecordToString,
9
+ } from "nightingale";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nightingale-formatter",
3
- "version": "14.2.1",
4
- "description": "Nightingale formatter",
3
+ "version": "16.0.0",
4
+ "description": "Deprecated: use nightingale package instead",
5
5
  "keywords": [
6
6
  "nightingale",
7
7
  "nightingale-formatter"
@@ -16,78 +16,28 @@
16
16
  "homepage": "https://github.com/christophehurpeau/nightingale",
17
17
  "type": "module",
18
18
  "engines": {
19
- "node": ">=18.12.0"
19
+ "node": ">=20.9.0"
20
20
  },
21
- "browserslist": {
22
- "production": [
23
- "defaults",
24
- "> 0.2%",
25
- "not ie < 12",
26
- "not safari < 10",
27
- "not ios_saf < 10"
28
- ]
29
- },
30
- "main": "./dist/index-node18.mjs",
31
- "types": "./dist/definitions/index.d.ts",
32
- "module": "./dist/index-browser.es.js",
33
- "browser": "./dist/index-browser.es.js",
21
+ "sideEffects": false,
22
+ "main": "./lib/index.js",
23
+ "types": "./lib/index.d.ts",
34
24
  "exports": {
35
25
  "./package.json": "./package.json",
36
- ".": {
37
- "types": "./dist/definitions/index.d.ts",
38
- "node": {
39
- "import": "./dist/index-node18.mjs"
40
- },
41
- "browser": {
42
- "browser:modern": {
43
- "import": "./dist/index-browsermodern.es.js"
44
- },
45
- "import": "./dist/index-browser.es.js"
46
- }
47
- }
26
+ ".": "./lib/index.js"
48
27
  },
49
- "sideEffects": false,
50
28
  "files": [
51
- "src",
52
- "dist"
29
+ "lib"
53
30
  ],
54
31
  "scripts": {
55
- "build": "yarn clean:build && rollup --config rollup.config.mjs && yarn run build:definitions",
56
- "build:definitions": "tsc -p tsconfig.json",
57
32
  "clean": "yarn clean:build",
58
- "clean:build": "pob-babel-clean-out dist",
59
33
  "lint": "yarn run lint:eslint",
60
- "lint:eslint": "yarn ../.. run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet packages/nightingale-formatter",
34
+ "lint:eslint": "yarn ../.. run eslint --quiet packages/nightingale-formatter",
61
35
  "test": "yarn ../../ run test -- packages/nightingale-formatter",
62
36
  "watch": "yarn clean:build && rollup --config rollup.config.mjs --watch"
63
37
  },
38
+ "pob": {},
64
39
  "prettier": "@pob/root/prettier-config",
65
- "pob": {
66
- "babelEnvs": [
67
- {
68
- "target": "node",
69
- "version": "18"
70
- },
71
- {
72
- "target": "browser",
73
- "version": "modern"
74
- },
75
- {
76
- "target": "browser"
77
- }
78
- ],
79
- "entries": [
80
- "index"
81
- ]
82
- },
83
40
  "dependencies": {
84
- "nightingale-levels": "14.2.1",
85
- "nightingale-types": "14.2.1"
86
- },
87
- "devDependencies": {
88
- "@babel/core": "7.23.2",
89
- "@babel/preset-env": "7.23.2",
90
- "pob-babel": "36.6.1",
91
- "typescript": "5.2.2"
41
+ "nightingale": "16.0.0"
92
42
  }
93
43
  }
@@ -1,9 +0,0 @@
1
- import type { Styles } from 'nightingale-types';
2
- export interface FormatObjectOptions {
3
- padding?: string;
4
- maxDepth?: number;
5
- }
6
- export type StyleFn = (styles: Styles, value: string) => string;
7
- export type ObjectStyles<Keys extends string = string> = Record<Keys, Styles>;
8
- export declare function formatObject(object: Record<string, unknown>, styleFn?: StyleFn, objectStyles?: ObjectStyles, { padding, maxDepth }?: FormatObjectOptions): string;
9
- //# sourceMappingURL=formatObject.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatObject.d.ts","sourceRoot":"","sources":["../../src/formatObject.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;AAEhE,MAAM,MAAM,YAAY,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AA2a9E,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,GAAE,OAAmB,EAC5B,YAAY,CAAC,EAAE,YAAY,EAC3B,EAAE,OAAc,EAAE,QAAa,EAAE,GAAE,mBAAwB,GAC1D,MAAM,CAkBR"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=formatObject.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatObject.test.d.ts","sourceRoot":"","sources":["../../src/formatObject.test.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- import type { LogRecord, Metadata } from 'nightingale-types';
2
- import type { StyleFn } from './formatObject';
3
- export declare function formatRecordToString<T extends Metadata>(record: LogRecord<T>, style: StyleFn): string;
4
- //# sourceMappingURL=formatRecordToString.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatRecordToString.d.ts","sourceRoot":"","sources":["../../src/formatRecordToString.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,gBAAgB,CAAC;AAK5D,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,QAAQ,EACrD,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EACpB,KAAK,EAAE,OAAO,GACb,MAAM,CAyDR"}
@@ -1,8 +0,0 @@
1
- export { levelToStyles } from './levelToStyles';
2
- export { levelToSymbol } from './levelToSymbol';
3
- export { styleToHtmlStyleThemeDark, styleToHtmlStyleThemeLight, } from './styleToHtmlStyle';
4
- export type { StyleToHtmlStyle } from './styleToHtmlStyle';
5
- export { styleToHexColor } from './styleToHexColor';
6
- export { formatObject } from './formatObject';
7
- export { formatRecordToString } from './formatRecordToString';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/index.test.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- export type LevelToStyles = Readonly<Record<number, string[]>>;
2
- export declare const levelToStyles: LevelToStyles;
3
- //# sourceMappingURL=levelToStyles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"levelToStyles.d.ts","sourceRoot":"","sources":["../../src/levelToStyles.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;AAE/D,eAAO,MAAM,aAAa,EAAE,aAS3B,CAAC"}
@@ -1,3 +0,0 @@
1
- export type LevelToSymbol = Readonly<Record<number, string>>;
2
- export declare const levelToSymbol: LevelToSymbol;
3
- //# sourceMappingURL=levelToSymbol.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"levelToSymbol.d.ts","sourceRoot":"","sources":["../../src/levelToSymbol.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE7D,eAAO,MAAM,aAAa,EAAE,aAS3B,CAAC"}
@@ -1,3 +0,0 @@
1
- export type StyleToHexColor = Readonly<Record<string, string>>;
2
- export declare const styleToHexColor: StyleToHexColor;
3
- //# sourceMappingURL=styleToHexColor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styleToHexColor.d.ts","sourceRoot":"","sources":["../../src/styleToHexColor.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE/D,eAAO,MAAM,eAAe,EAAE,eAI7B,CAAC"}
@@ -1,8 +0,0 @@
1
- export interface HtmlStyle {
2
- readonly open: string;
3
- readonly close: string;
4
- }
5
- export type StyleToHtmlStyle = Readonly<Record<string, HtmlStyle>>;
6
- export declare const styleToHtmlStyleThemeLight: StyleToHtmlStyle;
7
- export declare const styleToHtmlStyleThemeDark: StyleToHtmlStyle;
8
- //# sourceMappingURL=styleToHtmlStyle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styleToHtmlStyle.d.ts","sourceRoot":"","sources":["../../src/styleToHtmlStyle.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAEnE,eAAO,MAAM,0BAA0B,EAAE,gBAgDxC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,gBAOvC,CAAC"}