@logbrew/react-native 0.1.18 → 0.1.19

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/README.md CHANGED
@@ -293,10 +293,15 @@ module. For a bare React Native app, add the optional subspec inside the app
293
293
  target in `ios/Podfile`, then run `pod install`:
294
294
 
295
295
  ```ruby
296
- logbrew_react_native_path = File.dirname(`node --print "require.resolve('@logbrew/react-native')"`)
296
+ require 'pathname'
297
+ logbrew_react_native_path = Pathname(File.dirname(`bun --print "require.resolve('@logbrew/react-native')"`)).relative_path_from(Pathname(__dir__)).to_s
297
298
  pod 'LogBrewReactNative/AppleNativeDiagnostics', :path => logbrew_react_native_path
298
299
  ```
299
300
 
301
+ Keep the resolved package path relative to the Podfile directory. React Native
302
+ autolinking declares the core pod with that relative source; CocoaPods rejects
303
+ the same pod when the optional subspec uses an absolute source.
304
+
300
305
  The default `LogBrewReactNative/Core` subspec remains unchanged and supports
301
306
  iOS 13. `AppleNativeDiagnostics` requires iOS 15. Install it on the main thread
302
307
  before root registration, then start replay:
package/expo.cjs CHANGED
@@ -1,20 +1,21 @@
1
1
  const PLUGIN_NAME = "@logbrew/react-native/expo";
2
2
  const START_MARKER = " # @generated by @logbrew/react-native/expo";
3
3
  const END_MARKER = " # @end @logbrew/react-native/expo";
4
+ const MANAGED_BLOCK = / # @generated by @logbrew\/react-native\/expo[\s\S]*? # @end @logbrew\/react-native\/expo\n?/gu;
4
5
  const POD_BLOCK = [
5
6
  START_MARKER,
6
- " logbrew_react_native_path = File.dirname(`node --print \"require.resolve('@logbrew/react-native')\"`)",
7
+ " require 'pathname'",
8
+ " logbrew_react_native_path = Pathname(File.dirname(`bun --print \"require.resolve('@logbrew/react-native')\"`)).relative_path_from(Pathname(__dir__)).to_s",
7
9
  " pod 'LogBrewReactNative/AppleNativeDiagnostics', :path => logbrew_react_native_path",
8
10
  END_MARKER
9
11
  ].join("\n");
10
12
 
11
13
  function withLogBrewReactNative(config, options = {}) {
12
14
  const { withPodfile } = require("expo/config-plugins");
13
- return withPodfile(config, (podfileConfig) => {
14
- podfileConfig.modResults.contents = modifyPodfile(
15
- podfileConfig.modResults.contents,
16
- options?.appleNativeDiagnostics !== false
17
- );
15
+ const enabled = options?.appleNativeDiagnostics !== false;
16
+ return withPodfile(config, podfileConfig => {
17
+ const podfile = podfileConfig.modResults;
18
+ podfile.contents = modifyPodfile(podfile.contents, enabled);
18
19
  return podfileConfig;
19
20
  });
20
21
  }
@@ -23,10 +24,7 @@ function modifyPodfile(contents, enabled = true) {
23
24
  if (typeof contents !== "string") {
24
25
  throw new TypeError(`${PLUGIN_NAME} expected Podfile text`);
25
26
  }
26
- const withoutManagedBlock = contents.replace(
27
- new RegExp(`${escapePattern(START_MARKER)}[\\s\\S]*?${escapePattern(END_MARKER)}\\n?`, "gu"),
28
- ""
29
- );
27
+ const withoutManagedBlock = contents.replace(MANAGED_BLOCK, "");
30
28
  if (!enabled) {
31
29
  return withoutManagedBlock;
32
30
  }
@@ -37,10 +35,6 @@ function modifyPodfile(contents, enabled = true) {
37
35
  return withoutManagedBlock.replace(targetPattern, `$1\n${POD_BLOCK}`);
38
36
  }
39
37
 
40
- function escapePattern(value) {
41
- return value.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
42
- }
43
-
44
38
  module.exports = withLogBrewReactNative;
45
39
  module.exports.modifyPodfile = modifyPodfile;
46
40
  module.exports.withLogBrewReactNative = withLogBrewReactNative;
package/index.cjs CHANGED
@@ -16,7 +16,7 @@ const {
16
16
  } = require("./metadata.cjs");
17
17
 
18
18
  const DEFAULT_SDK_NAME = "logbrew-react-native";
19
- const DEFAULT_SDK_VERSION = "0.1.18";
19
+ const DEFAULT_SDK_VERSION = "0.1.19";
20
20
  const DEFAULT_ENDPOINT = "https://api.logbrew.co/v1/events";
21
21
  const MAX_ACTION_NAME_LENGTH = 64;
22
22
  const MAX_PRODUCT_ANALYTICS_SURFACE_LENGTH = 256;
package/index.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  } from "./metadata.js";
17
17
 
18
18
  const DEFAULT_SDK_NAME = "logbrew-react-native";
19
- const DEFAULT_SDK_VERSION = "0.1.18";
19
+ const DEFAULT_SDK_VERSION = "0.1.19";
20
20
  const DEFAULT_ENDPOINT = "https://api.logbrew.co/v1/events";
21
21
  const MAX_ACTION_NAME_LENGTH = 64;
22
22
  const MAX_PRODUCT_ANALYTICS_SURFACE_LENGTH = 256;
@@ -3,7 +3,7 @@ import Foundation
3
3
  @objc(LBRNAppleNativeDiagnostics)
4
4
  public final class LBRNAppleNativeDiagnostics: NSObject, @unchecked Sendable {
5
5
  private static let shared = LBRNAppleNativeDiagnostics()
6
- private static let sdkVersion = "0.1.18"
6
+ private static let sdkVersion = "0.1.19"
7
7
 
8
8
  private let lock = NSLock()
9
9
  private let replayQueue = DispatchQueue(label: "co.logbrew.react-native.apple-diagnostics-replay")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logbrew/react-native",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "React Native offline delivery, Apple native diagnostics, screen, error, trace, action, and network timeline helpers for LogBrew.",
5
5
  "type": "module",
6
6
  "main": "./index.cjs",