nightingale-console-output 12.1.4 → 14.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,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
+ ## [14.0.0](https://github.com/christophehurpeau/nightingale/compare/v13.0.0...v14.0.0) (2023-06-30)
7
+
8
+
9
+ ### ⚠ BREAKING CHANGES
10
+
11
+ * **deps:** require node 18
12
+ * requires node 18
13
+
14
+ ### Features
15
+
16
+ * requires node 18 ([4452b11](https://github.com/christophehurpeau/nightingale/commit/4452b116188e58c293be85e462e04922f7ad51f0))
17
+
18
+
19
+ ### Miscellaneous Chores
20
+
21
+ * **deps:** update dependency @pob/root to v8 ([#760](https://github.com/christophehurpeau/nightingale/issues/760)) ([22dc3cc](https://github.com/christophehurpeau/nightingale/commit/22dc3cceabdfd465d04ee36fec8fdac31febab69))
22
+
23
+
24
+
25
+ # [13.0.0](https://github.com/christophehurpeau/nightingale/compare/v12.1.4...v13.0.0) (2022-11-19)
26
+
27
+
28
+ ### Code Refactoring
29
+
30
+ * drop node 14 and cjs ([9a8ca06](https://github.com/christophehurpeau/nightingale/commit/9a8ca064449ddc0d69e26543e21c2d522536c50a))
31
+
32
+
33
+ ### Features
34
+
35
+ * build for node 16 ([30ae3e9](https://github.com/christophehurpeau/nightingale/commit/30ae3e9c455dbad793c2f704b9d860069dc80c32))
36
+
37
+
38
+ ### BREAKING CHANGES
39
+
40
+ * dropped node 14 and cjs
41
+ * drop node 14
42
+
43
+
44
+
45
+
46
+
6
47
  ## [12.1.4](https://github.com/christophehurpeau/nightingale/compare/v12.1.3...v12.1.4) (2022-02-05)
7
48
 
8
49
 
package/README.md CHANGED
@@ -8,6 +8,9 @@
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://npmjs.org/package/nightingale-console-output"><img src="https://img.shields.io/npm/v/nightingale-console-output.svg?style=flat-square"></a>
11
+ <a href="https://npmjs.org/package/nightingale-console-output"><img src="https://img.shields.io/npm/dw/nightingale-console-output.svg?style=flat-square"></a>
12
+ <a href="https://npmjs.org/package/nightingale-console-output"><img src="https://img.shields.io/node/v/nightingale-console-output.svg?style=flat-square"></a>
13
+ <a href="https://npmjs.org/package/nightingale-console-output"><img src="https://img.shields.io/npm/types/nightingale-console-output.svg?style=flat-square"></a>
11
14
  </p>
12
15
 
13
16
  ## Install
@@ -1,4 +1,3 @@
1
1
  import type { LogRecord, Metadata } from 'nightingale-types';
2
- import 'pob-babel';
3
- export default function consoleOutput<T extends Metadata>(param: string | string[], record: LogRecord<T>): void;
2
+ export default function consoleOutput<T extends Metadata>(param: string[] | string, record: LogRecord<T>): void;
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,CAAC,SAAS,QAAQ,EACtD,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EACxB,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,GACnB,IAAI,CAON"}
@@ -1,9 +1,9 @@
1
1
  import { Level } from 'nightingale-levels';
2
2
 
3
3
  /* eslint-disable no-console */
4
+
4
5
  function consoleOutput(param, record) {
5
6
  var _console;
6
-
7
7
  (_console = console)[record.level >= Level.ERROR ? 'error' : 'log'].apply(_console, param);
8
8
  }
9
9
 
@@ -1 +1 @@
1
- {"version":3,"file":"index-browser.es.js","sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { Level } from 'nightingale-levels';\nimport type { LogRecord, Metadata } from 'nightingale-types';\nimport 'pob-babel';\n\nexport default function consoleOutput<T extends Metadata>(\n param: string | string[],\n record: LogRecord<T>,\n): void {\n if (__POB_TARGET__ !== 'browser') {\n const outKey = record.level >= Level.ERROR ? 'stderr' : 'stdout';\n process[outKey].write(`${param as string}\\n`);\n } else {\n console[record.level >= Level.ERROR ? 'error' : 'log'](...param);\n }\n}\n"],"names":["consoleOutput","param","record","console","level","Level","ERROR"],"mappings":";;AAAA;AAKe,SAASA,aAAT,CACbC,KADa,EAEbC,MAFa,EAGP;AAAA;;AAKJ,cAAAC,OAAO,EAACD,MAAM,CAACE,KAAP,IAAgBC,KAAK,CAACC,KAAtB,GAA8B,OAA9B,GAAwC,KAAzC,CAAP,iBAA0DL,KAA1D;AAEH;;;;"}
1
+ {"version":3,"file":"index-browser.es.js","sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { POB_TARGET } from 'pob-babel';\nimport { Level } from 'nightingale-levels';\nimport type { LogRecord, Metadata } from 'nightingale-types';\n\nexport default function consoleOutput<T extends Metadata>(\n param: string[] | string,\n record: LogRecord<T>,\n): void {\n if (POB_TARGET !== 'browser') {\n const outKey = record.level >= Level.ERROR ? 'stderr' : 'stdout';\n process[outKey].write(`${param as string}\\n`);\n } else {\n console[record.level >= Level.ERROR ? 'error' : 'log'](...param);\n }\n}\n"],"names":["consoleOutput","param","record","_console","console","level","Level","ERROR","apply"],"mappings":";;AAAA;;AAKe,SAASA,aAAaA,CACnCC,KAAwB,EACxBC,MAAoB,EACd;AAAA,EAAA,IAAAC,QAAA,CAAA;EAKJ,CAAAA,QAAA,GAAAC,OAAO,EAACF,MAAM,CAACG,KAAK,IAAIC,KAAK,CAACC,KAAK,GAAG,OAAO,GAAG,KAAK,CAAC,CAAAC,KAAA,CAAAL,QAAA,EAAIF,KAAK,CAAC,CAAA;AAEpE;;;;"}
@@ -1,6 +1,7 @@
1
1
  import { Level } from 'nightingale-levels';
2
2
 
3
3
  /* eslint-disable no-console */
4
+
4
5
  function consoleOutput(param, record) {
5
6
  console[record.level >= Level.ERROR ? 'error' : 'log'](...param);
6
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index-browsermodern.es.js","sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { Level } from 'nightingale-levels';\nimport type { LogRecord, Metadata } from 'nightingale-types';\nimport 'pob-babel';\n\nexport default function consoleOutput<T extends Metadata>(\n param: string | string[],\n record: LogRecord<T>,\n): void {\n if (__POB_TARGET__ !== 'browser') {\n const outKey = record.level >= Level.ERROR ? 'stderr' : 'stdout';\n process[outKey].write(`${param as string}\\n`);\n } else {\n console[record.level >= Level.ERROR ? 'error' : 'log'](...param);\n }\n}\n"],"names":["consoleOutput","param","record","console","level","Level","ERROR"],"mappings":";;AAAA;AAKe,SAASA,aAAT,CACbC,KADa,EAEbC,MAFa,EAGP;AAKJC,EAAAA,OAAO,CAACD,MAAM,CAACE,KAAP,IAAgBC,KAAK,CAACC,KAAtB,GAA8B,OAA9B,GAAwC,KAAzC,CAAP,CAAuD,GAAGL,KAA1D;AAEH;;;;"}
1
+ {"version":3,"file":"index-browsermodern.es.js","sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { POB_TARGET } from 'pob-babel';\nimport { Level } from 'nightingale-levels';\nimport type { LogRecord, Metadata } from 'nightingale-types';\n\nexport default function consoleOutput<T extends Metadata>(\n param: string[] | string,\n record: LogRecord<T>,\n): void {\n if (POB_TARGET !== 'browser') {\n const outKey = record.level >= Level.ERROR ? 'stderr' : 'stdout';\n process[outKey].write(`${param as string}\\n`);\n } else {\n console[record.level >= Level.ERROR ? 'error' : 'log'](...param);\n }\n}\n"],"names":["consoleOutput","param","record","console","level","Level","ERROR"],"mappings":";;AAAA;;AAKe,SAASA,aAAaA,CACnCC,KAAwB,EACxBC,MAAoB,EACd;AAKJC,EAAAA,OAAO,CAACD,MAAM,CAACE,KAAK,IAAIC,KAAK,CAACC,KAAK,GAAG,OAAO,GAAG,KAAK,CAAC,CAAC,GAAGL,KAAK,CAAC,CAAA;AAEpE;;;;"}
@@ -1,6 +1,7 @@
1
1
  import { Level } from 'nightingale-levels';
2
2
 
3
3
  /* eslint-disable no-console */
4
+
4
5
  function consoleOutput(param, record) {
5
6
  {
6
7
  const outKey = record.level >= Level.ERROR ? 'stderr' : 'stdout';
@@ -9,4 +10,4 @@ function consoleOutput(param, record) {
9
10
  }
10
11
 
11
12
  export { consoleOutput as default };
12
- //# sourceMappingURL=index-node14.mjs.map
13
+ //# sourceMappingURL=index-node18.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-node18.mjs","sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { POB_TARGET } from 'pob-babel';\nimport { Level } from 'nightingale-levels';\nimport type { LogRecord, Metadata } from 'nightingale-types';\n\nexport default function consoleOutput<T extends Metadata>(\n param: string[] | string,\n record: LogRecord<T>,\n): void {\n if (POB_TARGET !== 'browser') {\n const outKey = record.level >= Level.ERROR ? 'stderr' : 'stdout';\n process[outKey].write(`${param as string}\\n`);\n } else {\n console[record.level >= Level.ERROR ? 'error' : 'log'](...param);\n }\n}\n"],"names":["consoleOutput","param","record","outKey","level","Level","ERROR","process","write"],"mappings":";;AAAA;;AAKe,SAASA,aAAaA,CACnCC,KAAwB,EACxBC,MAAoB,EACd;AACwB,EAAA;AAC5B,IAAA,MAAMC,MAAM,GAAGD,MAAM,CAACE,KAAK,IAAIC,KAAK,CAACC,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAChEC,OAAO,CAACJ,MAAM,CAAC,CAACK,KAAK,CAAE,CAAA,EAAEP,KAAgB,CAAA,EAAA,CAAG,CAAC,CAAA;AAC/C,GAAA;AAGF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nightingale-console-output",
3
- "version": "12.1.4",
3
+ "version": "14.0.0",
4
4
  "description": "Nightingale console output",
5
5
  "keywords": [
6
6
  "nightingale",
@@ -16,74 +16,58 @@
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": ">=18.12.0"
20
20
  },
21
- "browserslist": [
22
- "defaults",
23
- "> 0.2%",
24
- "not ie < 12",
25
- "not safari < 10",
26
- "not ios_saf < 10"
27
- ],
28
- "main": "./dist/index-node14.mjs",
29
- "types": "./dist/index.d.ts",
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",
30
32
  "module": "./dist/index-browser.es.js",
31
33
  "browser": "./dist/index-browser.es.js",
32
34
  "exports": {
33
35
  "./package.json": "./package.json",
34
36
  ".": {
35
37
  "node": {
36
- "import": "./dist/index-node14.mjs",
37
- "require": "./dist/index-node14.cjs"
38
+ "import": "./dist/index-node18.mjs"
38
39
  },
39
40
  "browser": {
40
41
  "browser:modern": {
41
42
  "import": "./dist/index-browsermodern.es.js"
42
43
  },
43
- "import": "./dist/index-browser.es.js",
44
- "require": "./dist/index-browser.cjs.js"
44
+ "import": "./dist/index-browser.es.js"
45
45
  }
46
46
  }
47
47
  },
48
- "module:node": "./dist/index-node14.mjs",
49
- "module:modern-browsers": "./dist/index-browsermodern.es.js",
50
48
  "sideEffects": false,
51
49
  "scripts": {
52
- "build": "pob-build && yarn run build:definitions",
53
- "build:definitions": "tsc -p tsconfig.build.json",
54
- "clean": "rm -Rf dist",
50
+ "build": "yarn clean:build && rollup --config rollup.config.mjs && yarn run build:definitions",
51
+ "build:definitions": "tsc -p tsconfig.json",
52
+ "clean": "yarn clean:build",
53
+ "clean:build": "pob-babel-clean-out dist",
55
54
  "lint": "yarn run lint:eslint",
56
- "lint:eslint": "cd ../.. && yarn run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet packages/nightingale-console-output",
57
- "watch": "pob-watch"
58
- },
59
- "prettier": {
60
- "trailingComma": "all",
61
- "singleQuote": true,
62
- "arrowParens": "always"
55
+ "lint:eslint": "yarn ../.. run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet packages/nightingale-console-output",
56
+ "watch": "yarn clean:build && rollup --config rollup.config.mjs --watch"
63
57
  },
58
+ "prettier": "@pob/root/prettier-config",
64
59
  "pob": {
65
60
  "babelEnvs": [
66
61
  {
67
62
  "target": "node",
68
- "version": "14",
69
- "formats": [
70
- "cjs",
71
- "es"
72
- ]
63
+ "version": "18"
73
64
  },
74
65
  {
75
66
  "target": "browser",
76
- "version": "modern",
77
- "formats": [
78
- "es"
79
- ]
67
+ "version": "modern"
80
68
  },
81
69
  {
82
- "target": "browser",
83
- "formats": [
84
- "cjs",
85
- "es"
86
- ]
70
+ "target": "browser"
87
71
  }
88
72
  ],
89
73
  "entries": [
@@ -91,16 +75,15 @@
91
75
  ]
92
76
  },
93
77
  "dependencies": {
94
- "@types/node": ">=14.0.0",
95
- "nightingale-levels": "12.1.4",
96
- "nightingale-types": "12.1.4"
78
+ "@types/node": ">=18.0.0",
79
+ "nightingale-levels": "14.0.0",
80
+ "nightingale-types": "14.0.0"
97
81
  },
98
82
  "devDependencies": {
99
- "@babel/core": "7.17.0",
100
- "@babel/preset-env": "7.16.11",
101
- "babel-preset-modern-browsers": "15.0.2",
102
- "pob-babel": "30.0.1",
103
- "typescript": "4.5.5"
83
+ "@babel/core": "7.22.5",
84
+ "@babel/preset-env": "7.22.5",
85
+ "pob-babel": "36.1.0",
86
+ "typescript": "5.1.6"
104
87
  },
105
- "gitHead": "3754d4575d948b5bb8c5227d3c3f4ca25e801db5"
88
+ "gitHead": "bc20e0f093a4fecd4d87f9374f6dbc375c09c25e"
106
89
  }
package/src/index.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  /* eslint-disable no-console */
2
+ import { POB_TARGET } from 'pob-babel';
2
3
  import { Level } from 'nightingale-levels';
3
4
  import type { LogRecord, Metadata } from 'nightingale-types';
4
- import 'pob-babel';
5
5
 
6
6
  export default function consoleOutput<T extends Metadata>(
7
- param: string | string[],
7
+ param: string[] | string,
8
8
  record: LogRecord<T>,
9
9
  ): void {
10
- if (__POB_TARGET__ !== 'browser') {
10
+ if (POB_TARGET !== 'browser') {
11
11
  const outKey = record.level >= Level.ERROR ? 'stderr' : 'stdout';
12
12
  process[outKey].write(`${param as string}\n`);
13
13
  } else {
@@ -1,15 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var nightingaleLevels = require('nightingale-levels');
6
-
7
- /* eslint-disable no-console */
8
- function consoleOutput(param, record) {
9
- var _console;
10
-
11
- (_console = console)[record.level >= nightingaleLevels.Level.ERROR ? 'error' : 'log'].apply(_console, param);
12
- }
13
-
14
- exports["default"] = consoleOutput;
15
- //# sourceMappingURL=index-browser.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-browser.cjs.js","sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { Level } from 'nightingale-levels';\nimport type { LogRecord, Metadata } from 'nightingale-types';\nimport 'pob-babel';\n\nexport default function consoleOutput<T extends Metadata>(\n param: string | string[],\n record: LogRecord<T>,\n): void {\n if (__POB_TARGET__ !== 'browser') {\n const outKey = record.level >= Level.ERROR ? 'stderr' : 'stdout';\n process[outKey].write(`${param as string}\\n`);\n } else {\n console[record.level >= Level.ERROR ? 'error' : 'log'](...param);\n }\n}\n"],"names":["consoleOutput","param","record","console","level","Level","ERROR"],"mappings":";;;;;;AAAA;AAKe,SAASA,aAAT,CACbC,KADa,EAEbC,MAFa,EAGP;AAAA;;AAKJ,cAAAC,OAAO,EAACD,MAAM,CAACE,KAAP,IAAgBC,uBAAK,CAACC,KAAtB,GAA8B,OAA9B,GAAwC,KAAzC,CAAP,iBAA0DL,KAA1D;AAEH;;;;"}
@@ -1,16 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const nightingaleLevels = require('nightingale-levels');
6
-
7
- /* eslint-disable no-console */
8
- function consoleOutput(param, record) {
9
- {
10
- const outKey = record.level >= nightingaleLevels.Level.ERROR ? 'stderr' : 'stdout';
11
- process[outKey].write(`${param}\n`);
12
- }
13
- }
14
-
15
- exports["default"] = consoleOutput;
16
- //# sourceMappingURL=index-node14.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-node14.cjs","sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { Level } from 'nightingale-levels';\nimport type { LogRecord, Metadata } from 'nightingale-types';\nimport 'pob-babel';\n\nexport default function consoleOutput<T extends Metadata>(\n param: string | string[],\n record: LogRecord<T>,\n): void {\n if (__POB_TARGET__ !== 'browser') {\n const outKey = record.level >= Level.ERROR ? 'stderr' : 'stdout';\n process[outKey].write(`${param as string}\\n`);\n } else {\n console[record.level >= Level.ERROR ? 'error' : 'log'](...param);\n }\n}\n"],"names":["consoleOutput","param","record","outKey","level","Level","ERROR","process","write"],"mappings":";;;;;;AAAA;AAKe,SAASA,aAAT,CACbC,KADa,EAEbC,MAFa,EAGP;AAC4B;AAChC,UAAMC,MAAM,GAAGD,MAAM,CAACE,KAAP,IAAgBC,uBAAK,CAACC,KAAtB,GAA8B,QAA9B,GAAyC,QAAxD;AACAC,IAAAA,OAAO,CAACJ,MAAD,CAAP,CAAgBK,KAAhB,CAAuB,GAAEP,KAAgB,IAAzC;AACD;AAGF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-node14.mjs","sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { Level } from 'nightingale-levels';\nimport type { LogRecord, Metadata } from 'nightingale-types';\nimport 'pob-babel';\n\nexport default function consoleOutput<T extends Metadata>(\n param: string | string[],\n record: LogRecord<T>,\n): void {\n if (__POB_TARGET__ !== 'browser') {\n const outKey = record.level >= Level.ERROR ? 'stderr' : 'stdout';\n process[outKey].write(`${param as string}\\n`);\n } else {\n console[record.level >= Level.ERROR ? 'error' : 'log'](...param);\n }\n}\n"],"names":["consoleOutput","param","record","outKey","level","Level","ERROR","process","write"],"mappings":";;AAAA;AAKe,SAASA,aAAT,CACbC,KADa,EAEbC,MAFa,EAGP;AAC4B;AAChC,UAAMC,MAAM,GAAGD,MAAM,CAACE,KAAP,IAAgBC,KAAK,CAACC,KAAtB,GAA8B,QAA9B,GAAyC,QAAxD;AACAC,IAAAA,OAAO,CAACJ,MAAD,CAAP,CAAgBK,KAAhB,CAAuB,GAAEP,KAAgB,IAAzC;AACD;AAGF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,WAAW,CAAC;AAEnB,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,CAAC,SAAS,QAAQ,EACtD,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EACxB,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,GACnB,IAAI,CAON"}
package/rollup.config.mjs DELETED
@@ -1,3 +0,0 @@
1
- import createRollupConfig from 'pob-babel/createRollupConfig.js';
2
-
3
- export default createRollupConfig({});