nightingale-app-react-native 16.2.0 → 17.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,16 @@
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
+ ## [17.0.0](https://github.com/christophehurpeau/nightingale/compare/v16.2.0...v17.0.0) (2025-10-20)
7
+
8
+ ### Features
9
+
10
+ * add export for react-native ([4098304](https://github.com/christophehurpeau/nightingale/commit/4098304ff9b6665930b7316fe05e0baf0b2e3fe5))
11
+
12
+ Version bump for dependency: nightingale
13
+ Version bump for dependency: nightingale-react-native-console
14
+
15
+
6
16
  ## [16.2.0](https://github.com/christophehurpeau/nightingale/compare/v16.1.0...v16.2.0) (2025-03-30)
7
17
 
8
18
  Version bump for dependency: nightingale
@@ -1,20 +1,26 @@
1
1
  import { Logger, BrowserConsoleHandler, configure, Level } from 'nightingale';
2
2
  export { Level, addConfig, configure } from 'nightingale';
3
3
  import { ReactNativeConsoleHandler } from 'nightingale-react-native-console';
4
- import { Platform } from 'react-native';
4
+ import { Platform } from 'react-native-web';
5
5
 
6
6
  const appLogger = new Logger("app");
7
7
  const ReactNativeConsoleHandlerForPlatform = Platform.OS === "web" ? BrowserConsoleHandler : ReactNativeConsoleHandler;
8
- configure(process.env.NODE_ENV === "production" ? [] : [{
9
- pattern: /^app(:|$)/,
10
- handlers: [new ReactNativeConsoleHandlerForPlatform(Level.DEBUG)],
11
- stop: true
12
- }, {
13
- handlers: [new ReactNativeConsoleHandlerForPlatform(Level.INFO)]
14
- }]);
15
- function listenReactNativeUnhandledErrors(logger = new Logger("nightingale:listenReactNativeUnhandledErrors", "UnhandledErrors")) {
16
- // Check if Hermes is available and is being used for promises
17
- // React Native v0.63 and v0.64 include global.HermesInternal but not 'hasPromise'
8
+ configure(
9
+ process.env.NODE_ENV === "production" ? [] : [
10
+ {
11
+ pattern: /^app(:|$)/,
12
+ handlers: [new ReactNativeConsoleHandlerForPlatform(Level.DEBUG)],
13
+ stop: true
14
+ },
15
+ {
16
+ handlers: [new ReactNativeConsoleHandlerForPlatform(Level.INFO)]
17
+ }
18
+ ]
19
+ );
20
+ function listenReactNativeUnhandledErrors(logger = new Logger(
21
+ "nightingale:listenReactNativeUnhandledErrors",
22
+ "UnhandledErrors"
23
+ )) {
18
24
  if (globalThis.HermesInternal.hasPromise?.() && globalThis.HermesInternal.enablePromiseRejectionTracker) {
19
25
  globalThis.HermesInternal.enablePromiseRejectionTracker({
20
26
  allRejections: true,
@@ -32,17 +38,9 @@ function listenReactNativeUnhandledErrors(logger = new Logger("nightingale:liste
32
38
  const globalHandler = ErrorUtils.getGlobalHandler();
33
39
  ErrorUtils.setGlobalHandler((error, isFatal) => {
34
40
  if (isFatal) {
35
- logger.fatal(error, {
36
- unhandled: true,
37
- type: "globalHandler",
38
- isFatal
39
- });
41
+ logger.fatal(error, { unhandled: true, type: "globalHandler", isFatal });
40
42
  } else {
41
- logger.error(error, {
42
- unhandled: true,
43
- type: "globalHandler",
44
- isFatal
45
- });
43
+ logger.error(error, { unhandled: true, type: "globalHandler", isFatal });
46
44
  }
47
45
  if (globalHandler) {
48
46
  globalHandler(error, isFatal);
@@ -1 +1 @@
1
- {"version":3,"file":"index-browser.es.js","sources":["../src/index.ts"],"sourcesContent":["import { BrowserConsoleHandler, Level, Logger, configure } from \"nightingale\";\nimport { ReactNativeConsoleHandler } from \"nightingale-react-native-console\";\nimport { Platform } from \"react-native\";\n\nexport { configure, addConfig, Level } from \"nightingale\";\n\nexport const appLogger = new Logger(\"app\");\n\nexport const ReactNativeConsoleHandlerForPlatform:\n | typeof BrowserConsoleHandler\n | typeof ReactNativeConsoleHandler =\n Platform.OS === \"web\" ? BrowserConsoleHandler : ReactNativeConsoleHandler;\n\nconfigure(\n process.env.NODE_ENV === \"production\"\n ? []\n : [\n {\n pattern: /^app(:|$)/,\n handlers: [new ReactNativeConsoleHandlerForPlatform(Level.DEBUG)],\n stop: true,\n },\n {\n handlers: [new ReactNativeConsoleHandlerForPlatform(Level.INFO)],\n },\n ],\n);\n\nexport function listenReactNativeUnhandledErrors(\n logger: Logger = new Logger(\n \"nightingale:listenReactNativeUnhandledErrors\",\n \"UnhandledErrors\",\n ),\n): void {\n // Check if Hermes is available and is being used for promises\n // React Native v0.63 and v0.64 include global.HermesInternal but not 'hasPromise'\n if (\n globalThis.HermesInternal.hasPromise?.() &&\n globalThis.HermesInternal.enablePromiseRejectionTracker\n ) {\n globalThis.HermesInternal.enablePromiseRejectionTracker({\n allRejections: true,\n onUnhandled: (id: number, rejection: Error) => {\n logger.error(rejection, {\n unhandled: true,\n type: \"promiseRejectionTracker\",\n id,\n });\n },\n });\n } else {\n throw new Error(\"Only Hermes is supported.\");\n }\n\n const globalHandler = ErrorUtils.getGlobalHandler();\n\n ErrorUtils.setGlobalHandler((error: Error, isFatal?: boolean) => {\n if (isFatal) {\n logger.fatal(error, { unhandled: true, type: \"globalHandler\", isFatal });\n } else {\n logger.error(error, { unhandled: true, type: \"globalHandler\", isFatal });\n }\n\n if (globalHandler) {\n globalHandler(error, isFatal);\n }\n });\n}\n"],"names":["appLogger","Logger","ReactNativeConsoleHandlerForPlatform","Platform","OS","BrowserConsoleHandler","ReactNativeConsoleHandler","configure","process","env","NODE_ENV","pattern","handlers","Level","DEBUG","stop","INFO","listenReactNativeUnhandledErrors","logger","globalThis","HermesInternal","hasPromise","enablePromiseRejectionTracker","allRejections","onUnhandled","id","rejection","error","unhandled","type","Error","globalHandler","ErrorUtils","getGlobalHandler","setGlobalHandler","isFatal","fatal"],"mappings":";;;;;MAMaA,SAAS,GAAG,IAAIC,MAAM,CAAC,KAAK;AAElC,MAAMC,oCAEuB,GAClCC,QAAQ,CAACC,EAAE,KAAK,KAAK,GAAGC,qBAAqB,GAAGC;AAElDC,SAAS,CACPC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GAC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,CAACA,KAAK,EAAE;AAAEC,QAAAA,SAAS,EAAE,IAAI;AAAEC,QAAAA,IAAI,EAAE,eAAe;AAAEM,QAAAA;AAAQ,OAAC,CAAC;AAC1E;AAEA,IAAA,IAAIJ,aAAa,EAAE;AACjBA,MAAAA,aAAa,CAACJ,KAAK,EAAEQ,OAAO,CAAC;AAC/B;AACF,GAAC,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"index-browser.es.js","sources":["../src/index.ts"],"sourcesContent":["import { BrowserConsoleHandler, Level, Logger, configure } from \"nightingale\";\nimport { ReactNativeConsoleHandler } from \"nightingale-react-native-console\";\nimport { Platform } from \"react-native\";\n\nexport { configure, addConfig, Level } from \"nightingale\";\n\nexport const appLogger = new Logger(\"app\");\n\nexport const ReactNativeConsoleHandlerForPlatform:\n | typeof BrowserConsoleHandler\n | typeof ReactNativeConsoleHandler =\n Platform.OS === \"web\" ? BrowserConsoleHandler : ReactNativeConsoleHandler;\n\nconfigure(\n process.env.NODE_ENV === \"production\"\n ? []\n : [\n {\n pattern: /^app(:|$)/,\n handlers: [new ReactNativeConsoleHandlerForPlatform(Level.DEBUG)],\n stop: true,\n },\n {\n handlers: [new ReactNativeConsoleHandlerForPlatform(Level.INFO)],\n },\n ],\n);\n\nexport function listenReactNativeUnhandledErrors(\n logger: Logger = new Logger(\n \"nightingale:listenReactNativeUnhandledErrors\",\n \"UnhandledErrors\",\n ),\n): void {\n // Check if Hermes is available and is being used for promises\n // React Native v0.63 and v0.64 include global.HermesInternal but not 'hasPromise'\n if (\n globalThis.HermesInternal.hasPromise?.() &&\n globalThis.HermesInternal.enablePromiseRejectionTracker\n ) {\n globalThis.HermesInternal.enablePromiseRejectionTracker({\n allRejections: true,\n onUnhandled: (id: number, rejection: Error) => {\n logger.error(rejection, {\n unhandled: true,\n type: \"promiseRejectionTracker\",\n id,\n });\n },\n });\n } else {\n throw new Error(\"Only Hermes is supported.\");\n }\n\n const globalHandler = ErrorUtils.getGlobalHandler();\n\n ErrorUtils.setGlobalHandler((error: Error, isFatal?: boolean) => {\n if (isFatal) {\n logger.fatal(error, { unhandled: true, type: \"globalHandler\", isFatal });\n } else {\n logger.error(error, { unhandled: true, type: \"globalHandler\", isFatal });\n }\n\n if (globalHandler) {\n globalHandler(error, isFatal);\n }\n });\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,SAAA,GAAY,IAAI,MAAA,CAAO,KAAK;AAElC,MAAM,oCAAA,GAGX,QAAA,CAAS,EAAA,KAAO,KAAA,GAAQ,qBAAA,GAAwB;AAElD,SAAA;AAAA,EACE,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa,YAAA,GACrB,EAAC,GACD;AAAA,IACE;AAAA,MACE,OAAA,EAAS,WAAA;AAAA,MACT,UAAU,CAAC,IAAI,oCAAA,CAAqC,KAAA,CAAM,KAAK,CAAC,CAAA;AAAA,MAChE,IAAA,EAAM;AAAA,KACR;AAAA,IACA;AAAA,MACE,UAAU,CAAC,IAAI,oCAAA,CAAqC,KAAA,CAAM,IAAI,CAAC;AAAA;AACjE;AAER,CAAA;AAEO,SAAS,gCAAA,CACd,SAAiB,IAAI,MAAA;AAAA,EACnB,8CAAA;AAAA,EACA;AACF,CAAA,EACM;AAGN,EAAA,IACE,WAAW,cAAA,CAAe,UAAA,IAAa,IACvC,UAAA,CAAW,eAAe,6BAAA,EAC1B;AACA,IAAA,UAAA,CAAW,eAAe,6BAAA,CAA8B;AAAA,MACtD,aAAA,EAAe,IAAA;AAAA,MACf,WAAA,EAAa,CAAC,EAAA,EAAY,SAAA,KAAqB;AAC7C,QAAA,MAAA,CAAO,MAAM,SAAA,EAAW;AAAA,UACtB,SAAA,EAAW,IAAA;AAAA,UACX,IAAA,EAAM,yBAAA;AAAA,UACN;AAAA,SACD,CAAA;AAAA;AACH,KACD,CAAA;AAAA,GACH,MAAO;AACL,IAAA,MAAM,IAAI,MAAM,2BAA2B,CAAA;AAAA;AAG7C,EAAA,MAAM,aAAA,GAAgB,WAAW,gBAAA,EAAiB;AAElD,EAAA,UAAA,CAAW,gBAAA,CAAiB,CAAC,KAAA,EAAc,OAAA,KAAsB;AAC/D,IAAA,IAAI,OAAA,EAAS;AACX,MAAA,MAAA,CAAO,KAAA,CAAM,OAAO,EAAE,SAAA,EAAW,MAAM,IAAA,EAAM,eAAA,EAAiB,SAAS,CAAA;AAAA,KACzE,MAAO;AACL,MAAA,MAAA,CAAO,KAAA,CAAM,OAAO,EAAE,SAAA,EAAW,MAAM,IAAA,EAAM,eAAA,EAAiB,SAAS,CAAA;AAAA;AAGzE,IAAA,IAAI,aAAA,EAAe;AACjB,MAAA,aAAA,CAAc,OAAO,OAAO,CAAA;AAAA;AAC9B,GACD,CAAA;AACH;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nightingale-app-react-native",
3
- "version": "16.2.0",
3
+ "version": "17.0.0",
4
4
  "description": "React Native and Expo logger for application",
5
5
  "keywords": [
6
6
  "nightingale",
@@ -28,6 +28,9 @@
28
28
  "./package.json": "./package.json",
29
29
  ".": {
30
30
  "types": "./dist/definitions/index.d.ts",
31
+ "react-native": {
32
+ "import": "./dist/index-browser.es.js"
33
+ },
31
34
  "browser": {
32
35
  "import": "./dist/index-browser.es.js"
33
36
  }
@@ -41,7 +44,7 @@
41
44
  "build": "yarn clean:build && rollup --config rollup.config.mjs && yarn run build:definitions",
42
45
  "build:definitions": "tsc -p tsconfig.json",
43
46
  "clean": "yarn clean:build",
44
- "clean:build": "pob-babel-clean-out dist",
47
+ "clean:build": "pob-esbuild-clean-out dist",
45
48
  "lint": "yarn run lint:eslint",
46
49
  "lint:eslint": "yarn ../.. run eslint --quiet packages/nightingale-app-react-native",
47
50
  "watch": "yarn clean:build && rollup --config rollup.config.mjs --watch"
@@ -56,7 +59,7 @@
56
59
  ]
57
60
  },
58
61
  "pob": {
59
- "bundler": "rollup-babel",
62
+ "bundler": "rollup-esbuild",
60
63
  "entries": [
61
64
  "index"
62
65
  ],
@@ -64,7 +67,8 @@
64
67
  {
65
68
  "target": "browser"
66
69
  }
67
- ]
70
+ ],
71
+ "typescript": true
68
72
  },
69
73
  "prettier": "@pob/root/prettier-config",
70
74
  "peerDependencies": {
@@ -77,13 +81,11 @@
77
81
  }
78
82
  },
79
83
  "dependencies": {
80
- "nightingale": "16.2.0",
81
- "nightingale-react-native-console": "16.2.0"
84
+ "nightingale": "17.0.0",
85
+ "nightingale-react-native-console": "17.0.0"
82
86
  },
83
87
  "devDependencies": {
84
- "@babel/core": "7.26.10",
85
- "@babel/preset-env": "7.26.9",
86
- "pob-babel": "43.4.0",
87
- "typescript": "5.8.2"
88
+ "@pob/rollup-esbuild": "6.7.0",
89
+ "typescript": "5.9.2"
88
90
  }
89
91
  }