@op-engineering/op-sqlite 12.0.2 → 12.0.3

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.
Files changed (2) hide show
  1. package/op-sqlite.podspec +25 -3
  2. package/package.json +1 -1
package/op-sqlite.podspec CHANGED
@@ -12,11 +12,33 @@ fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
12
12
 
13
13
  parent_folder_name = File.basename(__dir__)
14
14
  app_package = nil
15
+ package_json_path = nil
16
+
15
17
  # When installed on user node_modules lives inside node_modules/@op-engineering/op-sqlite
16
18
  if is_user_app
17
- app_package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json")))
19
+ current_dir = File.expand_path(__dir__)
20
+ # Move one level up to the parent directory
21
+ current_dir = File.dirname(current_dir)
22
+
23
+ # Find the package.json by searching up through parent directories
24
+ loop do
25
+ package_path = File.join(current_dir, "package.json")
26
+ if File.exist?(package_path)
27
+ package_json_path = package_path
28
+ break
29
+ end
30
+
31
+ parent_dir = File.dirname(current_dir)
32
+ break if parent_dir == current_dir # reached filesystem root
33
+ current_dir = parent_dir
34
+ end
35
+
36
+ raise "package.json not found" if package_json_path.nil?
37
+
38
+ app_package = JSON.parse(File.read(package_json_path))
18
39
  # When running on the example app
19
40
  else
41
+ package_json_path = File.join(__dir__, "example", "package.json")
20
42
  app_package = JSON.parse(File.read(File.join(__dir__, "example", "package.json")))
21
43
  end
22
44
 
@@ -100,8 +122,8 @@ Pod::Spec.new do |s|
100
122
  :CLANG_CXX_LANGUAGE_STANDARD => "c++17",
101
123
  }
102
124
 
103
- log_message.call("[OP-SQLITE] Configuration:")
104
-
125
+ log_message.call("[OP-SQLITE] Configuration found at #{package_json_path}")
126
+
105
127
  exclude_files = []
106
128
 
107
129
  if use_sqlcipher then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@op-engineering/op-sqlite",
3
- "version": "12.0.2",
3
+ "version": "12.0.3",
4
4
  "description": "Next generation SQLite for React Native",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",