nightingale-console 11.6.0 → 11.7.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", "@pob/eslint-config-node"],
3
+ "extends": ["@pob/eslint-config/root-commonjs"],
4
4
  "ignorePatterns": ["*.d.ts", "/dist"]
5
5
  }
package/CHANGELOG.md CHANGED
@@ -3,6 +3,41 @@
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
+ ## [11.7.4](https://github.com/christophehurpeau/nightingale/compare/v11.7.3...v11.7.4) (2021-11-27)
7
+
8
+ **Note:** Version bump only for package nightingale-console
9
+
10
+
11
+
12
+
13
+
14
+ ## [11.7.2](https://github.com/christophehurpeau/nightingale/compare/v11.7.1...v11.7.2) (2021-11-27)
15
+
16
+ **Note:** Version bump only for package nightingale-console
17
+
18
+
19
+
20
+
21
+
22
+ ## [11.7.1](https://github.com/christophehurpeau/nightingale/compare/v11.7.0...v11.7.1) (2021-06-29)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * update pob-babel to bring back webpack 4 support ([4887431](https://github.com/christophehurpeau/nightingale/commit/4887431b3b272496511f879af022638723b9056e))
28
+
29
+
30
+
31
+
32
+
33
+ # [11.7.0](https://github.com/christophehurpeau/nightingale/compare/v11.6.0...v11.7.0) (2021-03-29)
34
+
35
+ **Note:** Version bump only for package nightingale-console
36
+
37
+
38
+
39
+
40
+
6
41
  # [11.6.0](https://github.com/christophehurpeau/nightingale/compare/v11.5.4...v11.6.0) (2021-03-21)
7
42
 
8
43
 
package/README.md CHANGED
@@ -39,3 +39,9 @@ DEBUG=/^(app|nightingale$)/ # debug for logger with key starting with 'app' and
39
39
  DEBUG='*,-app'; # debug everything except app
40
40
  DEBUG='*,-app:*'; # debug everything except app and all its children
41
41
  ```
42
+
43
+ ## Use source maps to display error stack trace
44
+
45
+ Since node 12.12.0, you can use `--enable-source-maps` while running node.
46
+
47
+ ![error with source maps](https://static.hurpeau.com/images/npm/nightingale/screenshot-errors-with-source-maps.png)
@@ -4,30 +4,28 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const formatterANSI = require('nightingale-ansi-formatter');
6
6
  const consoleOutput = require('nightingale-console-output');
7
- const createFindDebugLevel = require('nightingale-debug');
7
+ const nightingaleDebug = require('nightingale-debug');
8
8
  const formatterJSON = require('nightingale-json-formatter');
9
- const Level = require('nightingale-levels');
9
+ const nightingaleLevels = require('nightingale-levels');
10
10
 
11
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
12
12
 
13
13
  const formatterANSI__default = /*#__PURE__*/_interopDefaultLegacy(formatterANSI);
14
14
  const consoleOutput__default = /*#__PURE__*/_interopDefaultLegacy(consoleOutput);
15
- const createFindDebugLevel__default = /*#__PURE__*/_interopDefaultLegacy(createFindDebugLevel);
16
15
  const formatterJSON__default = /*#__PURE__*/_interopDefaultLegacy(formatterJSON);
17
- const Level__default = /*#__PURE__*/_interopDefaultLegacy(Level);
18
16
 
19
17
  const defaultFormatter = !process.stdout.isTTY && process.env.NIGHTINGALE_CONSOLE_FORMATTER !== 'ansi' ? formatterJSON__default : formatterANSI__default;
20
18
 
21
19
  const createHandle = (formatter = defaultFormatter, output = consoleOutput__default) => {
22
20
  return record => {
23
- return output(formatter(record), record);
21
+ output(formatter(record), record);
24
22
  };
25
23
  };
26
24
 
27
- const findDebugLevel = createFindDebugLevel__default(process.env.DEBUG);
25
+ const findDebugLevel = nightingaleDebug.createFindDebugLevel(process.env.DEBUG);
28
26
  class ConsoleHandler {
29
27
  constructor(minLevel, options = {}) {
30
- this.minLevel = Level__default.ALL;
28
+ this.minLevel = nightingaleLevels.Level.ALL;
31
29
  this.minLevel = minLevel;
32
30
 
33
31
  this.isHandling = (level, key) => level >= findDebugLevel(minLevel, key);
@@ -38,5 +36,5 @@ class ConsoleHandler {
38
36
  }
39
37
 
40
38
  exports.ConsoleHandler = ConsoleHandler;
41
- exports.default = ConsoleHandler;
39
+ exports["default"] = ConsoleHandler;
42
40
  //# sourceMappingURL=index-node12-dev.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-node12-dev.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import { POB_TARGET } from 'pob-babel';\nimport 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 return 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\n/** @deprecated use named export instead */\nexport default ConsoleHandler;\n"],"names":["defaultFormatter","process","stdout","isTTY","env","NIGHTINGALE_CONSOLE_FORMATTER","formatterJSON","formatterANSI","createHandle","formatter","output","consoleOutput","record","findDebugLevel","createFindDebugLevel","DEBUG","ConsoleHandler","constructor","minLevel","options","Level","ALL","isHandling","level","key","handle"],"mappings":";;;;;;;;;;;;;;;;;;AAcA,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;AACzD,WAAOF,MAAM,CAACD,SAAS,CAACG,MAAD,CAAV,EAAoBA,MAApB,CAAb;AACD,GAFD;AAGD,CAPD;;AAQA,MAAMC,cAAc,GAAGC,6BAAoB,CAACb,OAAO,CAACG,GAAR,CAAYW,KAAb,CAA3C;AAYO,MAAMC,cAAN,CAAwC;AAO7CC,EAAAA,WAAW,CAACC,QAAD,EAAkBC,OAA8B,GAAG,EAAnD,EAAuD;AAAA,SANlED,QAMkE,GANhDE,cAAK,CAACC,GAM0C;AAChE,SAAKH,QAAL,GAAgBA,QAAhB;;AACA,SAAKI,UAAL,GAAkB,CAACC,KAAD,EAAeC,GAAf,KAChBD,KAAK,IAAIV,cAAc,CAACK,QAAD,EAAWM,GAAX,CADzB;;AAEA,SAAKC,MAAL,GAAcjB,YAAY,CAACW,OAAO,CAACV,SAAT,EAAoBU,OAAO,CAACT,MAA5B,CAA1B;AACD;;AAZ4C;;;;;"}
1
+ {"version":3,"file":"index-node12-dev.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import { POB_TARGET } from 'pob-babel';\nimport 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\n/** @deprecated use named export instead */\nexport default ConsoleHandler;\n"],"names":["defaultFormatter","process","stdout","isTTY","env","NIGHTINGALE_CONSOLE_FORMATTER","formatterJSON","formatterANSI","createHandle","formatter","output","consoleOutput","record","findDebugLevel","createFindDebugLevel","DEBUG","ConsoleHandler","constructor","minLevel","options","Level","ALL","isHandling","level","key","handle"],"mappings":";;;;;;;;;;;;;;;;AAcA,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;AAO7CC,EAAAA,WAAW,CAACC,QAAD,EAAkBC,OAA8B,GAAG,EAAnD,EAAuD;AAAA,SANlED,QAMkE,GANhDE,uBAAK,CAACC,GAM0C;AAChE,SAAKH,QAAL,GAAgBA,QAAhB;;AACA,SAAKI,UAAL,GAAkB,CAACC,KAAD,EAAeC,GAAf,KAChBD,KAAK,IAAIV,cAAc,CAACK,QAAD,EAAWM,GAAX,CADzB;;AAEA,SAAKC,MAAL,GAAcjB,YAAY,CAACW,OAAO,CAACV,SAAT,EAAoBU,OAAO,CAACT,MAA5B,CAA1B;AACD;;AAZ4C;;;;;"}
@@ -1,14 +1,14 @@
1
1
  import formatterANSI from 'nightingale-ansi-formatter';
2
2
  import consoleOutput from 'nightingale-console-output';
3
- import createFindDebugLevel from 'nightingale-debug';
3
+ import { createFindDebugLevel } from 'nightingale-debug';
4
4
  import formatterJSON from 'nightingale-json-formatter';
5
- import Level from 'nightingale-levels';
5
+ import { Level } from 'nightingale-levels';
6
6
 
7
7
  const defaultFormatter = !process.stdout.isTTY && process.env.NIGHTINGALE_CONSOLE_FORMATTER !== 'ansi' ? formatterJSON : formatterANSI;
8
8
 
9
9
  const createHandle = (formatter = defaultFormatter, output = consoleOutput) => {
10
10
  return record => {
11
- return output(formatter(record), record);
11
+ output(formatter(record), record);
12
12
  };
13
13
  };
14
14
 
@@ -25,6 +25,5 @@ class ConsoleHandler {
25
25
 
26
26
  }
27
27
 
28
- export default ConsoleHandler;
29
- export { ConsoleHandler };
28
+ export { ConsoleHandler, ConsoleHandler as default };
30
29
  //# sourceMappingURL=index-node12-dev.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-node12-dev.mjs","sources":["../src/index.ts"],"sourcesContent":["import { POB_TARGET } from 'pob-babel';\nimport 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 return 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\n/** @deprecated use named export instead */\nexport default ConsoleHandler;\n"],"names":["defaultFormatter","process","stdout","isTTY","env","NIGHTINGALE_CONSOLE_FORMATTER","formatterJSON","formatterANSI","createHandle","formatter","output","consoleOutput","record","findDebugLevel","createFindDebugLevel","DEBUG","ConsoleHandler","constructor","minLevel","options","Level","ALL","isHandling","level","key","handle"],"mappings":";;;;;;AAcA,MAAMA,gBAAgB,GAEpB,CAACC,OAAO,CAACC,MAAR,CAAeC,KADhB,IAEAF,OAAO,CAACG,GAAR,CAAYC,6BAAZ,KAA8C,MAF9C,GAGIC,aAHJ,GAIIC,aALN;;AAOA,MAAMC,YAAY,GAAG,CACnBC,SAAS,GAAGT,gBADO,EAEnBU,MAAM,GAAGC,aAFU,KAGR;AACX,SAA4BC,MAArB,IAAoD;AACzD,WAAOF,MAAM,CAACD,SAAS,CAACG,MAAD,CAAV,EAAoBA,MAApB,CAAb;AACD,GAFD;AAGD,CAPD;;AAQA,MAAMC,cAAc,GAAGC,oBAAoB,CAACb,OAAO,CAACG,GAAR,CAAYW,KAAb,CAA3C;AAYO,MAAMC,cAAN,CAAwC;AAO7CC,EAAAA,WAAW,CAACC,QAAD,EAAkBC,OAA8B,GAAG,EAAnD,EAAuD;AAAA,SANlED,QAMkE,GANhDE,KAAK,CAACC,GAM0C;AAChE,SAAKH,QAAL,GAAgBA,QAAhB;;AACA,SAAKI,UAAL,GAAkB,CAACC,KAAD,EAAeC,GAAf,KAChBD,KAAK,IAAIV,cAAc,CAACK,QAAD,EAAWM,GAAX,CADzB;;AAEA,SAAKC,MAAL,GAAcjB,YAAY,CAACW,OAAO,CAACV,SAAT,EAAoBU,OAAO,CAACT,MAA5B,CAA1B;AACD;;AAZ4C;;;;;"}
1
+ {"version":3,"file":"index-node12-dev.mjs","sources":["../src/index.ts"],"sourcesContent":["import { POB_TARGET } from 'pob-babel';\nimport 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\n/** @deprecated use named export instead */\nexport default ConsoleHandler;\n"],"names":["defaultFormatter","process","stdout","isTTY","env","NIGHTINGALE_CONSOLE_FORMATTER","formatterJSON","formatterANSI","createHandle","formatter","output","consoleOutput","record","findDebugLevel","createFindDebugLevel","DEBUG","ConsoleHandler","constructor","minLevel","options","Level","ALL","isHandling","level","key","handle"],"mappings":";;;;;;AAcA,MAAMA,gBAAgB,GAEpB,CAACC,OAAO,CAACC,MAAR,CAAeC,KADhB,IAEAF,OAAO,CAACG,GAAR,CAAYC,6BAAZ,KAA8C,MAF9C,GAGIC,aAHJ,GAIIC,aALN;;AAOA,MAAMC,YAAY,GAAG,CACnBC,SAAS,GAAGT,gBADO,EAEnBU,MAAM,GAAGC,aAFU,KAGR;AACX,SAA4BC,MAArB,IAAoD;AACzDF,IAAAA,MAAM,CAACD,SAAS,CAACG,MAAD,CAAV,EAAoBA,MAApB,CAAN;AACD,GAFD;AAGD,CAPD;;AAQA,MAAMC,cAAc,GAAGC,oBAAoB,CAACb,OAAO,CAACG,GAAR,CAAYW,KAAb,CAA3C;AAYO,MAAMC,cAAN,CAAwC;AAO7CC,EAAAA,WAAW,CAACC,QAAD,EAAkBC,OAA8B,GAAG,EAAnD,EAAuD;AAAA,SANlED,QAMkE,GANhDE,KAAK,CAACC,GAM0C;AAChE,SAAKH,QAAL,GAAgBA,QAAhB;;AACA,SAAKI,UAAL,GAAkB,CAACC,KAAD,EAAeC,GAAf,KAChBD,KAAK,IAAIV,cAAc,CAACK,QAAD,EAAWM,GAAX,CADzB;;AAEA,SAAKC,MAAL,GAAcjB,YAAY,CAACW,OAAO,CAACV,SAAT,EAAoBU,OAAO,CAACT,MAA5B,CAA1B;AACD;;AAZ4C;;;;"}
@@ -4,30 +4,28 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const formatterANSI = require('nightingale-ansi-formatter');
6
6
  const consoleOutput = require('nightingale-console-output');
7
- const createFindDebugLevel = require('nightingale-debug');
7
+ const nightingaleDebug = require('nightingale-debug');
8
8
  const formatterJSON = require('nightingale-json-formatter');
9
- const Level = require('nightingale-levels');
9
+ const nightingaleLevels = require('nightingale-levels');
10
10
 
11
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
12
12
 
13
13
  const formatterANSI__default = /*#__PURE__*/_interopDefaultLegacy(formatterANSI);
14
14
  const consoleOutput__default = /*#__PURE__*/_interopDefaultLegacy(consoleOutput);
15
- const createFindDebugLevel__default = /*#__PURE__*/_interopDefaultLegacy(createFindDebugLevel);
16
15
  const formatterJSON__default = /*#__PURE__*/_interopDefaultLegacy(formatterJSON);
17
- const Level__default = /*#__PURE__*/_interopDefaultLegacy(Level);
18
16
 
19
17
  const defaultFormatter = !process.stdout.isTTY && process.env.NIGHTINGALE_CONSOLE_FORMATTER !== 'ansi' ? formatterJSON__default : formatterANSI__default;
20
18
 
21
19
  const createHandle = (formatter = defaultFormatter, output = consoleOutput__default) => {
22
20
  return record => {
23
- return output(formatter(record), record);
21
+ output(formatter(record), record);
24
22
  };
25
23
  };
26
24
 
27
- const findDebugLevel = createFindDebugLevel__default(process.env.DEBUG);
25
+ const findDebugLevel = nightingaleDebug.createFindDebugLevel(process.env.DEBUG);
28
26
  class ConsoleHandler {
29
27
  constructor(minLevel, options = {}) {
30
- this.minLevel = Level__default.ALL;
28
+ this.minLevel = nightingaleLevels.Level.ALL;
31
29
  this.minLevel = minLevel;
32
30
 
33
31
  this.isHandling = (level, key) => level >= findDebugLevel(minLevel, key);
@@ -38,5 +36,5 @@ class ConsoleHandler {
38
36
  }
39
37
 
40
38
  exports.ConsoleHandler = ConsoleHandler;
41
- exports.default = ConsoleHandler;
39
+ exports["default"] = ConsoleHandler;
42
40
  //# sourceMappingURL=index-node12.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-node12.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import { POB_TARGET } from 'pob-babel';\nimport 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 return 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\n/** @deprecated use named export instead */\nexport default ConsoleHandler;\n"],"names":["defaultFormatter","process","stdout","isTTY","env","NIGHTINGALE_CONSOLE_FORMATTER","formatterJSON","formatterANSI","createHandle","formatter","output","consoleOutput","record","findDebugLevel","createFindDebugLevel","DEBUG","ConsoleHandler","constructor","minLevel","options","Level","ALL","isHandling","level","key","handle"],"mappings":";;;;;;;;;;;;;;;;;;AAcA,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;AACzD,WAAOF,MAAM,CAACD,SAAS,CAACG,MAAD,CAAV,EAAoBA,MAApB,CAAb;AACD,GAFD;AAGD,CAPD;;AAQA,MAAMC,cAAc,GAAGC,6BAAoB,CAACb,OAAO,CAACG,GAAR,CAAYW,KAAb,CAA3C;AAYO,MAAMC,cAAN,CAAwC;AAO7CC,EAAAA,WAAW,CAACC,QAAD,EAAkBC,OAA8B,GAAG,EAAnD,EAAuD;AAAA,SANlED,QAMkE,GANhDE,cAAK,CAACC,GAM0C;AAChE,SAAKH,QAAL,GAAgBA,QAAhB;;AACA,SAAKI,UAAL,GAAkB,CAACC,KAAD,EAAeC,GAAf,KAChBD,KAAK,IAAIV,cAAc,CAACK,QAAD,EAAWM,GAAX,CADzB;;AAEA,SAAKC,MAAL,GAAcjB,YAAY,CAACW,OAAO,CAACV,SAAT,EAAoBU,OAAO,CAACT,MAA5B,CAA1B;AACD;;AAZ4C;;;;;"}
1
+ {"version":3,"file":"index-node12.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import { POB_TARGET } from 'pob-babel';\nimport 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\n/** @deprecated use named export instead */\nexport default ConsoleHandler;\n"],"names":["defaultFormatter","process","stdout","isTTY","env","NIGHTINGALE_CONSOLE_FORMATTER","formatterJSON","formatterANSI","createHandle","formatter","output","consoleOutput","record","findDebugLevel","createFindDebugLevel","DEBUG","ConsoleHandler","constructor","minLevel","options","Level","ALL","isHandling","level","key","handle"],"mappings":";;;;;;;;;;;;;;;;AAcA,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;AAO7CC,EAAAA,WAAW,CAACC,QAAD,EAAkBC,OAA8B,GAAG,EAAnD,EAAuD;AAAA,SANlED,QAMkE,GANhDE,uBAAK,CAACC,GAM0C;AAChE,SAAKH,QAAL,GAAgBA,QAAhB;;AACA,SAAKI,UAAL,GAAkB,CAACC,KAAD,EAAeC,GAAf,KAChBD,KAAK,IAAIV,cAAc,CAACK,QAAD,EAAWM,GAAX,CADzB;;AAEA,SAAKC,MAAL,GAAcjB,YAAY,CAACW,OAAO,CAACV,SAAT,EAAoBU,OAAO,CAACT,MAA5B,CAA1B;AACD;;AAZ4C;;;;;"}
@@ -1,14 +1,14 @@
1
1
  import formatterANSI from 'nightingale-ansi-formatter';
2
2
  import consoleOutput from 'nightingale-console-output';
3
- import createFindDebugLevel from 'nightingale-debug';
3
+ import { createFindDebugLevel } from 'nightingale-debug';
4
4
  import formatterJSON from 'nightingale-json-formatter';
5
- import Level from 'nightingale-levels';
5
+ import { Level } from 'nightingale-levels';
6
6
 
7
7
  const defaultFormatter = !process.stdout.isTTY && process.env.NIGHTINGALE_CONSOLE_FORMATTER !== 'ansi' ? formatterJSON : formatterANSI;
8
8
 
9
9
  const createHandle = (formatter = defaultFormatter, output = consoleOutput) => {
10
10
  return record => {
11
- return output(formatter(record), record);
11
+ output(formatter(record), record);
12
12
  };
13
13
  };
14
14
 
@@ -25,6 +25,5 @@ class ConsoleHandler {
25
25
 
26
26
  }
27
27
 
28
- export default ConsoleHandler;
29
- export { ConsoleHandler };
28
+ export { ConsoleHandler, ConsoleHandler as default };
30
29
  //# sourceMappingURL=index-node12.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-node12.mjs","sources":["../src/index.ts"],"sourcesContent":["import { POB_TARGET } from 'pob-babel';\nimport 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 return 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\n/** @deprecated use named export instead */\nexport default ConsoleHandler;\n"],"names":["defaultFormatter","process","stdout","isTTY","env","NIGHTINGALE_CONSOLE_FORMATTER","formatterJSON","formatterANSI","createHandle","formatter","output","consoleOutput","record","findDebugLevel","createFindDebugLevel","DEBUG","ConsoleHandler","constructor","minLevel","options","Level","ALL","isHandling","level","key","handle"],"mappings":";;;;;;AAcA,MAAMA,gBAAgB,GAEpB,CAACC,OAAO,CAACC,MAAR,CAAeC,KADhB,IAEAF,OAAO,CAACG,GAAR,CAAYC,6BAAZ,KAA8C,MAF9C,GAGIC,aAHJ,GAIIC,aALN;;AAOA,MAAMC,YAAY,GAAG,CACnBC,SAAS,GAAGT,gBADO,EAEnBU,MAAM,GAAGC,aAFU,KAGR;AACX,SAA4BC,MAArB,IAAoD;AACzD,WAAOF,MAAM,CAACD,SAAS,CAACG,MAAD,CAAV,EAAoBA,MAApB,CAAb;AACD,GAFD;AAGD,CAPD;;AAQA,MAAMC,cAAc,GAAGC,oBAAoB,CAACb,OAAO,CAACG,GAAR,CAAYW,KAAb,CAA3C;AAYO,MAAMC,cAAN,CAAwC;AAO7CC,EAAAA,WAAW,CAACC,QAAD,EAAkBC,OAA8B,GAAG,EAAnD,EAAuD;AAAA,SANlED,QAMkE,GANhDE,KAAK,CAACC,GAM0C;AAChE,SAAKH,QAAL,GAAgBA,QAAhB;;AACA,SAAKI,UAAL,GAAkB,CAACC,KAAD,EAAeC,GAAf,KAChBD,KAAK,IAAIV,cAAc,CAACK,QAAD,EAAWM,GAAX,CADzB;;AAEA,SAAKC,MAAL,GAAcjB,YAAY,CAACW,OAAO,CAACV,SAAT,EAAoBU,OAAO,CAACT,MAA5B,CAA1B;AACD;;AAZ4C;;;;;"}
1
+ {"version":3,"file":"index-node12.mjs","sources":["../src/index.ts"],"sourcesContent":["import { POB_TARGET } from 'pob-babel';\nimport 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\n/** @deprecated use named export instead */\nexport default ConsoleHandler;\n"],"names":["defaultFormatter","process","stdout","isTTY","env","NIGHTINGALE_CONSOLE_FORMATTER","formatterJSON","formatterANSI","createHandle","formatter","output","consoleOutput","record","findDebugLevel","createFindDebugLevel","DEBUG","ConsoleHandler","constructor","minLevel","options","Level","ALL","isHandling","level","key","handle"],"mappings":";;;;;;AAcA,MAAMA,gBAAgB,GAEpB,CAACC,OAAO,CAACC,MAAR,CAAeC,KADhB,IAEAF,OAAO,CAACG,GAAR,CAAYC,6BAAZ,KAA8C,MAF9C,GAGIC,aAHJ,GAIIC,aALN;;AAOA,MAAMC,YAAY,GAAG,CACnBC,SAAS,GAAGT,gBADO,EAEnBU,MAAM,GAAGC,aAFU,KAGR;AACX,SAA4BC,MAArB,IAAoD;AACzDF,IAAAA,MAAM,CAACD,SAAS,CAACG,MAAD,CAAV,EAAoBA,MAApB,CAAN;AACD,GAFD;AAGD,CAPD;;AAQA,MAAMC,cAAc,GAAGC,oBAAoB,CAACb,OAAO,CAACG,GAAR,CAAYW,KAAb,CAA3C;AAYO,MAAMC,cAAN,CAAwC;AAO7CC,EAAAA,WAAW,CAACC,QAAD,EAAkBC,OAA8B,GAAG,EAAnD,EAAuD;AAAA,SANlED,QAMkE,GANhDE,KAAK,CAACC,GAM0C;AAChE,SAAKH,QAAL,GAAgBA,QAAhB;;AACA,SAAKI,UAAL,GAAkB,CAACC,KAAD,EAAeC,GAAf,KAChBD,KAAK,IAAIV,cAAc,CAACK,QAAD,EAAWM,GAAX,CADzB;;AAEA,SAAKC,MAAL,GAAcjB,YAAY,CAACW,OAAO,CAACV,SAAT,EAAoBU,OAAO,CAACT,MAA5B,CAA1B;AACD;;AAZ4C;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import Level from 'nightingale-levels';
1
+ import { Level } from 'nightingale-levels';
2
2
  import type { IsHandling, Handle, LogRecord, Metadata, Handler } from 'nightingale-types';
3
3
  interface ConsoleHandlerOptions {
4
4
  formatter?: <T extends Metadata>(record: LogRecord<T>) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,OAAO,KAAK,EACV,UAAU,EACV,MAAM,EACN,SAAS,EACT,QAAQ,EACR,OAAO,EACR,MAAM,mBAAmB,CAAC;AAmB3B,UAAU,qBAAqB;IAC7B,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;IACjE,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,QAAQ,EAC1B,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EACxB,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,KACjB,IAAI,CAAC;IAEV,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,qBAAa,cAAe,YAAW,OAAO;IAC5C,QAAQ,EAAE,KAAK,CAAa;IAE5B,UAAU,EAAE,UAAU,CAAC;IAEvB,MAAM,EAAE,MAAM,CAAC;gBAEH,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAE,qBAA0B;CAMjE;AAED,2CAA2C;AAC3C,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,EACV,UAAU,EACV,MAAM,EACN,SAAS,EACT,QAAQ,EACR,OAAO,EACR,MAAM,mBAAmB,CAAC;AAmB3B,UAAU,qBAAqB;IAC7B,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;IACjE,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,QAAQ,EAC1B,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EACxB,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,KACjB,IAAI,CAAC;IAEV,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,qBAAa,cAAe,YAAW,OAAO;IAC5C,QAAQ,EAAE,KAAK,CAAa;IAE5B,UAAU,EAAE,UAAU,CAAC;IAEvB,MAAM,EAAE,MAAM,CAAC;gBAEH,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAE,qBAA0B;CAMjE;AAED,2CAA2C;AAC3C,eAAe,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nightingale-console",
3
- "version": "11.6.0",
3
+ "version": "11.7.4",
4
4
  "description": "Console handler for nightingale",
5
5
  "keywords": [
6
6
  "nightingale",
@@ -14,12 +14,14 @@
14
14
  "directory": "packages/nightingale-console"
15
15
  },
16
16
  "homepage": "https://github.com/christophehurpeau/nightingale",
17
+ "type": "commonjs",
17
18
  "engines": {
18
- "node": ">=12.10.0"
19
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
19
20
  },
20
- "main": "./index.js",
21
+ "main": "./dist/index-node12.cjs.js",
21
22
  "types": "./dist/index.d.ts",
22
23
  "exports": {
24
+ "./package.json": "./package.json",
23
25
  ".": {
24
26
  "node": {
25
27
  "development": {
@@ -39,7 +41,7 @@
39
41
  "build:definitions": "tsc -p tsconfig.build.json",
40
42
  "clean": "rm -Rf docs dist test/node6 coverage",
41
43
  "lint": "yarn run lint:eslint",
42
- "lint:eslint": "yarn --cwd ../.. run eslint --ext .js,.mjs,.ts --report-unused-disable-directives --quiet packages/nightingale-console",
44
+ "lint:eslint": "cd ../.. && yarn run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet packages/nightingale-console",
43
45
  "watch": "pob-watch"
44
46
  },
45
47
  "prettier": {
@@ -64,30 +66,19 @@
64
66
  },
65
67
  "dependencies": {
66
68
  "@types/node": ">=12.0.0",
67
- "nightingale-ansi-formatter": "^11.6.0",
68
- "nightingale-console-output": "^11.6.0",
69
- "nightingale-debug": "^11.6.0",
70
- "nightingale-json-formatter": "^11.6.0",
71
- "nightingale-levels": "^11.6.0",
72
- "nightingale-types": "^11.6.0"
69
+ "nightingale-ansi-formatter": "^11.7.4",
70
+ "nightingale-console-output": "^11.7.4",
71
+ "nightingale-debug": "^11.7.4",
72
+ "nightingale-json-formatter": "^11.7.4",
73
+ "nightingale-levels": "^11.7.2",
74
+ "nightingale-types": "^11.7.4"
73
75
  },
74
76
  "devDependencies": {
75
- "@babel/core": "7.13.10",
76
- "@pob/eslint-config": "43.0.0",
77
- "@pob/eslint-config-node": "43.1.0",
78
- "@pob/eslint-config-typescript": "43.0.0",
79
- "@pob/eslint-config-typescript-node": "43.0.0",
80
- "@typescript-eslint/eslint-plugin": "4.18.0",
81
- "@typescript-eslint/parser": "4.18.0",
77
+ "@babel/core": "7.16.0",
82
78
  "babel-preset-latest-node": "5.5.1",
83
- "eslint": "7.22.0",
84
- "eslint-import-resolver-node": "0.3.4",
85
- "eslint-plugin-import": "2.22.1",
86
- "eslint-plugin-node": "11.1.0",
87
- "eslint-plugin-unicorn": "25.0.1",
88
- "pob-babel": "26.8.0",
89
- "rollup": "2.42.1",
90
- "typescript": "4.2.3"
79
+ "pob-babel": "28.5.0",
80
+ "rollup": "2.60.1",
81
+ "typescript": "4.5.2"
91
82
  },
92
- "gitHead": "56849d6762e917f29c20f932569973046a24f602"
83
+ "gitHead": "70f6b4ba634ff778fc94bef7e2455e8b6a7db06a"
93
84
  }
@@ -0,0 +1,3 @@
1
+ import createRollupConfig from 'pob-babel/createRollupConfig.js';
2
+
3
+ export default createRollupConfig({});
@@ -7,7 +7,7 @@
7
7
  "plugins": ["@typescript-eslint"],
8
8
  "extends": [
9
9
  "@pob/eslint-config-typescript",
10
- "@pob/eslint-config-typescript-node"
10
+ "@pob/eslint-config-typescript/node"
11
11
  ],
12
12
  "ignorePatterns": ["*.d.ts"]
13
13
  }
package/src/index.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { POB_TARGET } from 'pob-babel';
2
2
  import formatterANSI from 'nightingale-ansi-formatter';
3
3
  import consoleOutput from 'nightingale-console-output';
4
- import createFindDebugLevel from 'nightingale-debug';
4
+ import { createFindDebugLevel } from 'nightingale-debug';
5
5
  import formatterJSON from 'nightingale-json-formatter';
6
- import Level from 'nightingale-levels';
6
+ import { Level } from 'nightingale-levels';
7
7
  import type {
8
8
  IsHandling,
9
9
  Handle,
@@ -24,7 +24,7 @@ const createHandle = (
24
24
  output = consoleOutput,
25
25
  ): Handle => {
26
26
  return <T extends Metadata>(record: LogRecord<T>): void => {
27
- return output(formatter(record), record);
27
+ output(formatter(record), record);
28
28
  };
29
29
  };
30
30
  const findDebugLevel = createFindDebugLevel(process.env.DEBUG);
package/index.js DELETED
@@ -1,6 +0,0 @@
1
- /* eslint-disable import/no-dynamic-require */
2
-
3
- 'use strict';
4
-
5
- const production = process.env.NODE_ENV === 'production';
6
- module.exports = require(`./dist/index-node12${production ? '' : '-dev'}.cjs`);