nightingale-console 12.1.0 → 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/.eslintrc.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "root": true,
3
- "extends": ["@pob/eslint-config/root-commonjs"],
3
+ "extends": ["@pob/eslint-config/root-module"],
4
4
  "ignorePatterns": ["*.d.ts", "/dist"]
5
5
  }
package/CHANGELOG.md CHANGED
@@ -3,6 +3,47 @@
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
+
17
+ ## [12.1.3](https://github.com/christophehurpeau/nightingale/compare/v12.1.2...v12.1.3) (2022-01-15)
18
+
19
+ **Note:** Version bump only for package nightingale-console
20
+
21
+
22
+
23
+
24
+
25
+ ## [12.1.2](https://github.com/christophehurpeau/nightingale/compare/v12.1.1...v12.1.2) (2022-01-02)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * main esm for jest which supports esm but not exports ([98789fa](https://github.com/christophehurpeau/nightingale/commit/98789fa490e723840fccc443584189b6905d871b))
31
+
32
+
33
+
34
+
35
+
36
+ ## [12.1.1](https://github.com/christophehurpeau/nightingale/compare/v12.1.0...v12.1.1) (2022-01-01)
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * properly configure package type ([2e0cbf5](https://github.com/christophehurpeau/nightingale/commit/2e0cbf555bd3b9fa3c3851025452937f64408aa8))
42
+
43
+
44
+
45
+
46
+
6
47
  # [12.1.0](https://github.com/christophehurpeau/nightingale/compare/v12.0.1...v12.1.0) (2021-12-15)
7
48
 
8
49
  **Note:** Version bump only for package nightingale-console
@@ -37,4 +37,4 @@ class ConsoleHandler {
37
37
  }
38
38
 
39
39
  exports.ConsoleHandler = ConsoleHandler;
40
- //# sourceMappingURL=index-node14.cjs.js.map
40
+ //# sourceMappingURL=index-node14.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-node14.cjs","sources":["../src/index.ts"],"sourcesContent":["import formatterANSI from 'nightingale-ansi-formatter';\nimport consoleOutput from 'nightingale-console-output';\nimport { createFindDebugLevel } from 'nightingale-debug';\nimport formatterJSON from 'nightingale-json-formatter';\nimport { Level } from 'nightingale-levels';\nimport type {\n IsHandling,\n Handle,\n LogRecord,\n Metadata,\n Handler,\n} from 'nightingale-types';\n\nconst defaultFormatter =\n __POB_TARGET__ === 'node' &&\n !process.stdout.isTTY &&\n process.env.NIGHTINGALE_CONSOLE_FORMATTER !== 'ansi'\n ? formatterJSON\n : formatterANSI;\n\nconst createHandle = (\n formatter = defaultFormatter,\n output = consoleOutput,\n): Handle => {\n return <T extends Metadata>(record: LogRecord<T>): void => {\n output(formatter(record), record);\n };\n};\nconst findDebugLevel = createFindDebugLevel(process.env.DEBUG);\n\ninterface ConsoleHandlerOptions {\n formatter?: <T extends Metadata>(record: LogRecord<T>) => string;\n output?: <T extends Metadata>(\n param: string | string[],\n record: LogRecord<T>,\n ) => void;\n // compat with nightingale-app-console, not used yet\n theme?: 'dark' | 'light';\n}\n\nexport class ConsoleHandler implements Handler {\n minLevel: Level = Level.ALL;\n\n isHandling: IsHandling;\n\n handle: Handle;\n\n constructor(minLevel: Level, options: ConsoleHandlerOptions = {}) {\n this.minLevel = minLevel;\n this.isHandling = (level: Level, key: string) =>\n level >= findDebugLevel(minLevel, key);\n this.handle = createHandle(options.formatter, options.output);\n }\n}\n"],"names":["defaultFormatter","process","stdout","isTTY","env","NIGHTINGALE_CONSOLE_FORMATTER","formatterJSON","formatterANSI","createHandle","formatter","output","consoleOutput","record","findDebugLevel","createFindDebugLevel","DEBUG","ConsoleHandler","minLevel","Level","ALL","constructor","options","isHandling","level","key","handle"],"mappings":";;;;;;;;;;;;;;;;AAaA,MAAMA,gBAAgB,GAEpB,CAACC,OAAO,CAACC,MAAR,CAAeC,KADhB,IAEAF,OAAO,CAACG,GAAR,CAAYC,6BAAZ,KAA8C,MAF9C,GAGIC,sBAHJ,GAIIC,sBALN;;AAOA,MAAMC,YAAY,GAAG,CACnBC,SAAS,GAAGT,gBADO,EAEnBU,MAAM,GAAGC,sBAFU,KAGR;AACX,SAA4BC,MAArB,IAAoD;AACzDF,IAAAA,MAAM,CAACD,SAAS,CAACG,MAAD,CAAV,EAAoBA,MAApB,CAAN;AACD,GAFD;AAGD,CAPD;;AAQA,MAAMC,cAAc,GAAGC,qCAAoB,CAACb,OAAO,CAACG,GAAR,CAAYW,KAAb,CAA3C;AAYO,MAAMC,cAAN,CAAwC;AAC7CC,EAAAA,QAAQ,GAAUC,uBAAK,CAACC,GAAhB;;AAMRC,EAAAA,WAAW,CAACH,QAAD,EAAkBI,OAA8B,GAAG,EAAnD,EAAuD;AAChE,SAAKJ,QAAL,GAAgBA,QAAhB;;AACA,SAAKK,UAAL,GAAkB,CAACC,KAAD,EAAeC,GAAf,KAChBD,KAAK,IAAIV,cAAc,CAACI,QAAD,EAAWO,GAAX,CADzB;;AAEA,SAAKC,MAAL,GAAcjB,YAAY,CAACa,OAAO,CAACZ,SAAT,EAAoBY,OAAO,CAACX,MAA5B,CAA1B;AACD;;AAZ4C;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nightingale-console",
3
- "version": "12.1.0",
3
+ "version": "12.1.4",
4
4
  "description": "Console handler for nightingale",
5
5
  "keywords": [
6
6
  "nightingale",
@@ -14,18 +14,18 @@
14
14
  "directory": "packages/nightingale-console"
15
15
  },
16
16
  "homepage": "https://github.com/christophehurpeau/nightingale",
17
- "type": "commonjs",
17
+ "type": "module",
18
18
  "engines": {
19
19
  "node": "^14.13.1 || >=16.0.0"
20
20
  },
21
- "main": "./dist/index-node14.cjs.js",
21
+ "main": "./dist/index-node14.mjs",
22
22
  "types": "./dist/index.d.ts",
23
23
  "exports": {
24
24
  "./package.json": "./package.json",
25
25
  ".": {
26
26
  "node": {
27
27
  "import": "./dist/index-node14.mjs",
28
- "require": "./dist/index-node14.cjs.js"
28
+ "require": "./dist/index-node14.cjs"
29
29
  }
30
30
  }
31
31
  },
@@ -61,17 +61,17 @@
61
61
  },
62
62
  "dependencies": {
63
63
  "@types/node": ">=14.0.0",
64
- "nightingale-ansi-formatter": "12.1.0",
65
- "nightingale-console-output": "12.1.0",
66
- "nightingale-debug": "12.1.0",
67
- "nightingale-json-formatter": "12.1.0",
68
- "nightingale-levels": "12.1.0",
69
- "nightingale-types": "12.1.0"
64
+ "nightingale-ansi-formatter": "12.1.4",
65
+ "nightingale-console-output": "12.1.4",
66
+ "nightingale-debug": "12.1.4",
67
+ "nightingale-json-formatter": "12.1.4",
68
+ "nightingale-levels": "12.1.4",
69
+ "nightingale-types": "12.1.4"
70
70
  },
71
71
  "devDependencies": {
72
- "@babel/core": "7.16.0",
73
- "pob-babel": "29.4.2",
74
- "typescript": "4.5.4"
72
+ "@babel/core": "7.17.0",
73
+ "pob-babel": "30.0.1",
74
+ "typescript": "4.5.5"
75
75
  },
76
- "gitHead": "f2f75856d32f444f0ed08b5ab903537cb1f4c38f"
76
+ "gitHead": "3754d4575d948b5bb8c5227d3c3f4ca25e801db5"
77
77
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-node14.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import formatterANSI from 'nightingale-ansi-formatter';\nimport consoleOutput from 'nightingale-console-output';\nimport { createFindDebugLevel } from 'nightingale-debug';\nimport formatterJSON from 'nightingale-json-formatter';\nimport { Level } from 'nightingale-levels';\nimport type {\n IsHandling,\n Handle,\n LogRecord,\n Metadata,\n Handler,\n} from 'nightingale-types';\n\nconst defaultFormatter =\n __POB_TARGET__ === 'node' &&\n !process.stdout.isTTY &&\n process.env.NIGHTINGALE_CONSOLE_FORMATTER !== 'ansi'\n ? formatterJSON\n : formatterANSI;\n\nconst createHandle = (\n formatter = defaultFormatter,\n output = consoleOutput,\n): Handle => {\n return <T extends Metadata>(record: LogRecord<T>): void => {\n output(formatter(record), record);\n };\n};\nconst findDebugLevel = createFindDebugLevel(process.env.DEBUG);\n\ninterface ConsoleHandlerOptions {\n formatter?: <T extends Metadata>(record: LogRecord<T>) => string;\n output?: <T extends Metadata>(\n param: string | string[],\n record: LogRecord<T>,\n ) => void;\n // compat with nightingale-app-console, not used yet\n theme?: 'dark' | 'light';\n}\n\nexport class ConsoleHandler implements Handler {\n minLevel: Level = Level.ALL;\n\n isHandling: IsHandling;\n\n handle: Handle;\n\n constructor(minLevel: Level, options: ConsoleHandlerOptions = {}) {\n this.minLevel = minLevel;\n this.isHandling = (level: Level, key: string) =>\n level >= findDebugLevel(minLevel, key);\n this.handle = createHandle(options.formatter, options.output);\n }\n}\n"],"names":["defaultFormatter","process","stdout","isTTY","env","NIGHTINGALE_CONSOLE_FORMATTER","formatterJSON","formatterANSI","createHandle","formatter","output","consoleOutput","record","findDebugLevel","createFindDebugLevel","DEBUG","ConsoleHandler","minLevel","Level","ALL","constructor","options","isHandling","level","key","handle"],"mappings":";;;;;;;;;;;;;;;;AAaA,MAAMA,gBAAgB,GAEpB,CAACC,OAAO,CAACC,MAAR,CAAeC,KADhB,IAEAF,OAAO,CAACG,GAAR,CAAYC,6BAAZ,KAA8C,MAF9C,GAGIC,sBAHJ,GAIIC,sBALN;;AAOA,MAAMC,YAAY,GAAG,CACnBC,SAAS,GAAGT,gBADO,EAEnBU,MAAM,GAAGC,sBAFU,KAGR;AACX,SAA4BC,MAArB,IAAoD;AACzDF,IAAAA,MAAM,CAACD,SAAS,CAACG,MAAD,CAAV,EAAoBA,MAApB,CAAN;AACD,GAFD;AAGD,CAPD;;AAQA,MAAMC,cAAc,GAAGC,qCAAoB,CAACb,OAAO,CAACG,GAAR,CAAYW,KAAb,CAA3C;AAYO,MAAMC,cAAN,CAAwC;AAC7CC,EAAAA,QAAQ,GAAUC,uBAAK,CAACC,GAAhB;;AAMRC,EAAAA,WAAW,CAACH,QAAD,EAAkBI,OAA8B,GAAG,EAAnD,EAAuD;AAChE,SAAKJ,QAAL,GAAgBA,QAAhB;;AACA,SAAKK,UAAL,GAAkB,CAACC,KAAD,EAAeC,GAAf,KAChBD,KAAK,IAAIV,cAAc,CAACI,QAAD,EAAWO,GAAX,CADzB;;AAEA,SAAKC,MAAL,GAAcjB,YAAY,CAACa,OAAO,CAACZ,SAAT,EAAoBY,OAAO,CAACX,MAA5B,CAA1B;AACD;;AAZ4C;;;;"}