nightingale-console-output 12.1.4 → 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,28 @@
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
+
6
28
  ## [12.1.4](https://github.com/christophehurpeau/nightingale/compare/v12.1.3...v12.1.4) (2022-02-05)
7
29
 
8
30
 
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
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,GAAG,MAAM,EAAE,EACxB,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,GACnB,IAAI,CAON"}
@@ -3,7 +3,6 @@ import { Level } from 'nightingale-levels';
3
3
  /* eslint-disable no-console */
4
4
  function consoleOutput(param, record) {
5
5
  var _console;
6
-
7
6
  (_console = console)[record.level >= Level.ERROR ? 'error' : 'log'].apply(_console, param);
8
7
  }
9
8
 
@@ -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","level","Level","ERROR"],"mappings":";;AAAA;AAKe,SAASA,aAAa,CACnCC,KAAwB,EACxBC,MAAoB,EACd;AAAA,EAAA,IAAA,QAAA,CAAA;AAKJ,EAAA,CAAA,QAAA,GAAAC,OAAO,EAACD,MAAM,CAACE,KAAK,IAAIC,KAAK,CAACC,KAAK,GAAG,OAAO,GAAG,KAAK,CAAC,CAAA,KAAA,CAAA,QAAA,EAAIL,KAAK,CAAC,CAAA;AAEpE;;;;"}
@@ -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,aAAa,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;;;;"}
@@ -9,4 +9,4 @@ function consoleOutput(param, record) {
9
9
  }
10
10
 
11
11
  export { consoleOutput as default };
12
- //# sourceMappingURL=index-node14.mjs.map
12
+ //# sourceMappingURL=index-node16.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-node16.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,aAAa,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": "13.0.0",
4
4
  "description": "Nightingale console output",
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,47 @@
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"
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-console-output",
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-console-output",
54
+ "watch": "yarn clean:build && rollup --config rollup.config.mjs --watch"
63
55
  },
56
+ "prettier": "@pob/root/prettier-config",
64
57
  "pob": {
65
58
  "babelEnvs": [
66
59
  {
67
60
  "target": "node",
68
- "version": "14",
69
- "formats": [
70
- "cjs",
71
- "es"
72
- ]
61
+ "version": "16"
73
62
  },
74
63
  {
75
64
  "target": "browser",
76
- "version": "modern",
77
- "formats": [
78
- "es"
79
- ]
65
+ "version": "modern"
80
66
  },
81
67
  {
82
- "target": "browser",
83
- "formats": [
84
- "cjs",
85
- "es"
86
- ]
68
+ "target": "browser"
87
69
  }
88
70
  ],
89
71
  "entries": [
@@ -91,16 +73,16 @@
91
73
  ]
92
74
  },
93
75
  "dependencies": {
94
- "@types/node": ">=14.0.0",
95
- "nightingale-levels": "12.1.4",
96
- "nightingale-types": "12.1.4"
76
+ "@types/node": ">=16.0.0",
77
+ "nightingale-levels": "13.0.0",
78
+ "nightingale-types": "13.0.0"
97
79
  },
98
80
  "devDependencies": {
99
- "@babel/core": "7.17.0",
100
- "@babel/preset-env": "7.16.11",
81
+ "@babel/core": "7.20.2",
82
+ "@babel/preset-env": "7.20.2",
101
83
  "babel-preset-modern-browsers": "15.0.2",
102
- "pob-babel": "30.0.1",
103
- "typescript": "4.5.5"
84
+ "pob-babel": "35.3.0",
85
+ "typescript": "4.9.3"
104
86
  },
105
- "gitHead": "3754d4575d948b5bb8c5227d3c3f4ca25e801db5"
87
+ "gitHead": "52cf7e3c8762a07891da9dde497ec03298c15654"
106
88
  }
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
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({});