nightingale-web-processor 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-web-processor"><img src="https://img.shields.io/npm/v/nightingale-web-processor.svg?style=flat-square"></a>
11
+ <a href="https://npmjs.org/package/nightingale-web-processor"><img src="https://img.shields.io/npm/dw/nightingale-web-processor.svg?style=flat-square"></a>
12
+ <a href="https://npmjs.org/package/nightingale-web-processor"><img src="https://img.shields.io/node/v/nightingale-web-processor.svg?style=flat-square"></a>
13
+ <a href="https://npmjs.org/package/nightingale-web-processor"><img src="https://img.shields.io/npm/types/nightingale-web-processor.svg?style=flat-square"></a>
11
14
  </p>
12
15
 
13
16
  ## Install
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import type { IncomingMessage } from 'http';
2
+ import type { IncomingMessage } from 'node:http';
3
3
  import type { LogRecord, Metadata } from 'nightingale-types';
4
4
  export interface ContextWithOptionalRequest {
5
5
  request?: IncomingMessage;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,SAAS,QAAQ,EACrD,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EACpB,OAAO,CAAC,EAAE,0BAA0B,GACnC,IAAI,CAYN"}
@@ -1,6 +1,5 @@
1
1
  function webProcessor(record, context) {
2
2
  const request = context?.request;
3
-
4
3
  if (request) {
5
4
  record.extra = record.extra || {};
6
5
  Object.assign(record.extra, {
@@ -13,4 +12,4 @@ function webProcessor(record, context) {
13
12
  }
14
13
 
15
14
  export { webProcessor as default };
16
- //# sourceMappingURL=index-node14.mjs.map
15
+ //# sourceMappingURL=index-node18.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-node18.mjs","sources":["../src/index.ts"],"sourcesContent":["import type { IncomingMessage } from 'node:http';\nimport type { LogRecord, Metadata } from 'nightingale-types';\n\nexport interface ContextWithOptionalRequest {\n request?: IncomingMessage;\n}\n\nexport default function webProcessor<T extends Metadata>(\n record: LogRecord<T>,\n context?: ContextWithOptionalRequest,\n): void {\n const request = context?.request;\n if (request) {\n record.extra = record.extra || {};\n Object.assign(record.extra, {\n url: request.url,\n method: request.method,\n server: request.headers.host,\n ip:\n request.headers['x-forwarded-for'] || request.connection.remoteAddress,\n });\n }\n}\n"],"names":["webProcessor","record","context","request","extra","Object","assign","url","method","server","headers","host","ip","connection","remoteAddress"],"mappings":"AAOe,SAASA,YAAYA,CAClCC,MAAoB,EACpBC,OAAoC,EAC9B;AACN,EAAA,MAAMC,OAAO,GAAGD,OAAO,EAAEC,OAAO,CAAA;AAChC,EAAA,IAAIA,OAAO,EAAE;IACXF,MAAM,CAACG,KAAK,GAAGH,MAAM,CAACG,KAAK,IAAI,EAAE,CAAA;AACjCC,IAAAA,MAAM,CAACC,MAAM,CAACL,MAAM,CAACG,KAAK,EAAE;MAC1BG,GAAG,EAAEJ,OAAO,CAACI,GAAG;MAChBC,MAAM,EAAEL,OAAO,CAACK,MAAM;AACtBC,MAAAA,MAAM,EAAEN,OAAO,CAACO,OAAO,CAACC,IAAI;MAC5BC,EAAE,EACAT,OAAO,CAACO,OAAO,CAAC,iBAAiB,CAAC,IAAIP,OAAO,CAACU,UAAU,CAACC,aAAAA;AAC7D,KAAC,CAAC,CAAA;AACJ,GAAA;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nightingale-web-processor",
3
- "version": "12.1.4",
3
+ "version": "14.0.0",
4
4
  "description": "Nightingale web processor",
5
5
  "keywords": [
6
6
  "nightingale",
@@ -16,43 +16,34 @@
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
- "main": "./dist/index-node14.mjs",
22
- "types": "./dist/index.d.ts",
21
+ "main": "./dist/index-node18.mjs",
22
+ "types": "./dist/definitions/index.d.ts",
23
23
  "exports": {
24
24
  "./package.json": "./package.json",
25
25
  ".": {
26
26
  "node": {
27
- "import": "./dist/index-node14.mjs",
28
- "require": "./dist/index-node14.cjs"
27
+ "import": "./dist/index-node18.mjs"
29
28
  }
30
29
  }
31
30
  },
32
- "module:node": "./dist/index-node14.mjs",
33
31
  "sideEffects": false,
34
32
  "scripts": {
35
- "build": "pob-build && yarn run build:definitions",
36
- "build:definitions": "tsc -p tsconfig.build.json",
37
- "clean": "rm -Rf dist",
33
+ "build": "yarn clean:build && rollup --config rollup.config.mjs && yarn run build:definitions",
34
+ "build:definitions": "tsc -p tsconfig.json",
35
+ "clean": "yarn clean:build",
36
+ "clean:build": "pob-babel-clean-out dist",
38
37
  "lint": "yarn run lint:eslint",
39
- "lint:eslint": "cd ../.. && yarn run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet packages/nightingale-web-processor",
40
- "watch": "pob-watch"
41
- },
42
- "prettier": {
43
- "trailingComma": "all",
44
- "singleQuote": true,
45
- "arrowParens": "always"
38
+ "lint:eslint": "yarn ../.. run eslint --report-unused-disable-directives --resolve-plugins-relative-to . --quiet packages/nightingale-web-processor",
39
+ "watch": "yarn clean:build && rollup --config rollup.config.mjs --watch"
46
40
  },
41
+ "prettier": "@pob/root/prettier-config",
47
42
  "pob": {
48
43
  "babelEnvs": [
49
44
  {
50
45
  "target": "node",
51
- "version": "14",
52
- "formats": [
53
- "cjs",
54
- "es"
55
- ]
46
+ "version": "18"
56
47
  }
57
48
  ],
58
49
  "entries": [
@@ -60,13 +51,13 @@
60
51
  ]
61
52
  },
62
53
  "dependencies": {
63
- "@types/node": ">=14.0.0",
64
- "nightingale-types": "12.1.4"
54
+ "@types/node": ">=18.0.0",
55
+ "nightingale-types": "14.0.0"
65
56
  },
66
57
  "devDependencies": {
67
- "@babel/core": "7.17.0",
68
- "pob-babel": "30.0.1",
69
- "typescript": "4.5.5"
58
+ "@babel/core": "7.22.5",
59
+ "pob-babel": "36.1.0",
60
+ "typescript": "5.1.6"
70
61
  },
71
- "gitHead": "3754d4575d948b5bb8c5227d3c3f4ca25e801db5"
62
+ "gitHead": "bc20e0f093a4fecd4d87f9374f6dbc375c09c25e"
72
63
  }
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { IncomingMessage } from 'http';
1
+ import type { IncomingMessage } from 'node:http';
2
2
  import type { LogRecord, Metadata } from 'nightingale-types';
3
3
 
4
4
  export interface ContextWithOptionalRequest {
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- function webProcessor(record, context) {
6
- const request = context?.request;
7
-
8
- if (request) {
9
- record.extra = record.extra || {};
10
- Object.assign(record.extra, {
11
- url: request.url,
12
- method: request.method,
13
- server: request.headers.host,
14
- ip: request.headers['x-forwarded-for'] || request.connection.remoteAddress
15
- });
16
- }
17
- }
18
-
19
- exports["default"] = webProcessor;
20
- //# sourceMappingURL=index-node14.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-node14.cjs","sources":["../src/index.ts"],"sourcesContent":["import type { IncomingMessage } from 'http';\nimport type { LogRecord, Metadata } from 'nightingale-types';\n\nexport interface ContextWithOptionalRequest {\n request?: IncomingMessage;\n}\n\nexport default function webProcessor<T extends Metadata>(\n record: LogRecord<T>,\n context?: ContextWithOptionalRequest,\n): void {\n const request = context?.request;\n if (request) {\n record.extra = record.extra || {};\n Object.assign(record.extra, {\n url: request.url,\n method: request.method,\n server: request.headers.host,\n ip:\n request.headers['x-forwarded-for'] || request.connection.remoteAddress,\n });\n }\n}\n"],"names":["webProcessor","record","context","request","extra","Object","assign","url","method","server","headers","host","ip","connection","remoteAddress"],"mappings":";;;;AAOe,SAASA,YAAT,CACbC,MADa,EAEbC,OAFa,EAGP;AACN,QAAMC,OAAO,GAAGD,OAAO,EAAEC,OAAzB;;AACA,MAAIA,OAAJ,EAAa;AACXF,IAAAA,MAAM,CAACG,KAAP,GAAeH,MAAM,CAACG,KAAP,IAAgB,EAA/B;AACAC,IAAAA,MAAM,CAACC,MAAP,CAAcL,MAAM,CAACG,KAArB,EAA4B;AAC1BG,MAAAA,GAAG,EAAEJ,OAAO,CAACI,GADa;AAE1BC,MAAAA,MAAM,EAAEL,OAAO,CAACK,MAFU;AAG1BC,MAAAA,MAAM,EAAEN,OAAO,CAACO,OAAR,CAAgBC,IAHE;AAI1BC,MAAAA,EAAE,EACAT,OAAO,CAACO,OAAR,CAAgB,iBAAhB,KAAsCP,OAAO,CAACU,UAAR,CAAmBC;AALjC,KAA5B;AAOD;AACF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-node14.mjs","sources":["../src/index.ts"],"sourcesContent":["import type { IncomingMessage } from 'http';\nimport type { LogRecord, Metadata } from 'nightingale-types';\n\nexport interface ContextWithOptionalRequest {\n request?: IncomingMessage;\n}\n\nexport default function webProcessor<T extends Metadata>(\n record: LogRecord<T>,\n context?: ContextWithOptionalRequest,\n): void {\n const request = context?.request;\n if (request) {\n record.extra = record.extra || {};\n Object.assign(record.extra, {\n url: request.url,\n method: request.method,\n server: request.headers.host,\n ip:\n request.headers['x-forwarded-for'] || request.connection.remoteAddress,\n });\n }\n}\n"],"names":["webProcessor","record","context","request","extra","Object","assign","url","method","server","headers","host","ip","connection","remoteAddress"],"mappings":"AAOe,SAASA,YAAT,CACbC,MADa,EAEbC,OAFa,EAGP;AACN,QAAMC,OAAO,GAAGD,OAAO,EAAEC,OAAzB;;AACA,MAAIA,OAAJ,EAAa;AACXF,IAAAA,MAAM,CAACG,KAAP,GAAeH,MAAM,CAACG,KAAP,IAAgB,EAA/B;AACAC,IAAAA,MAAM,CAACC,MAAP,CAAcL,MAAM,CAACG,KAArB,EAA4B;AAC1BG,MAAAA,GAAG,EAAEJ,OAAO,CAACI,GADa;AAE1BC,MAAAA,MAAM,EAAEL,OAAO,CAACK,MAFU;AAG1BC,MAAAA,MAAM,EAAEN,OAAO,CAACO,OAAR,CAAgBC,IAHE;AAI1BC,MAAAA,EAAE,EACAT,OAAO,CAACO,OAAR,CAAgB,iBAAhB,KAAsCP,OAAO,CAACU,UAAR,CAAmBC;AALjC,KAA5B;AAOD;AACF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,CAAC,SAAS,QAAQ,EACrD,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EACpB,OAAO,CAAC,EAAE,0BAA0B,GACnC,IAAI,CAYN"}
package/rollup.config.mjs DELETED
@@ -1,3 +0,0 @@
1
- import createRollupConfig from 'pob-babel/createRollupConfig.js';
2
-
3
- export default createRollupConfig({});