From 46fafb4c10af2fb848ed259ac6e14aee7aab60d5 Mon Sep 17 00:00:00 2001 From: Oscar Franco Date: Sun, 4 May 2025 11:22:27 +0800 Subject: [PATCH 1/4] Test resolution for monorepos --- op-sqlite.podspec | 21 ++++++++++++++++++++- package.json | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/op-sqlite.podspec b/op-sqlite.podspec index b8568b91..7c848d38 100644 --- a/op-sqlite.podspec +++ b/op-sqlite.podspec @@ -12,9 +12,28 @@ fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1' parent_folder_name = File.basename(__dir__) app_package = nil + # When installed on user node_modules lives inside node_modules/@op-engineering/op-sqlite if is_user_app - app_package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json"))) + current_dir = File.expand_path(__dir__) + package_json_path = nil + + # Find the package.json by searching up through parent directories + loop do + package_path = File.join(current_dir, "package.json") + if File.exist?(package_path) + package_json_path = package_path + break + end + + parent_dir = File.dirname(current_dir) + break if parent_dir == current_dir # reached filesystem root + current_dir = parent_dir + end + + raise "package.json not found" if package_json_path.nil? + + app_package = JSON.parse(File.read(package_json_path)) # When running on the example app else app_package = JSON.parse(File.read(File.join(__dir__, "example", "package.json"))) diff --git a/package.json b/package.json index 8d6ef541..32e0052f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@op-engineering/op-sqlite", - "version": "0.0.0", + "version": "0.0.0-resolution-test", "description": "Next generation SQLite for React Native", "main": "lib/commonjs/index", "module": "lib/module/index", From fd1056350a32be0af33b9ae83adb7af22e066946 Mon Sep 17 00:00:00 2001 From: Oscar Franco Date: Sun, 4 May 2025 11:42:46 +0800 Subject: [PATCH 2/4] WIP --- op-sqlite.podspec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/op-sqlite.podspec b/op-sqlite.podspec index 7c848d38..2bf5e48d 100644 --- a/op-sqlite.podspec +++ b/op-sqlite.podspec @@ -12,11 +12,13 @@ fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1' parent_folder_name = File.basename(__dir__) app_package = nil +package_json_path = nil # When installed on user node_modules lives inside node_modules/@op-engineering/op-sqlite if is_user_app current_dir = File.expand_path(__dir__) - package_json_path = nil + # Move one level up to the parent directory + current_dir = File.dirname(current_dir) # Find the package.json by searching up through parent directories loop do @@ -36,6 +38,7 @@ if is_user_app app_package = JSON.parse(File.read(package_json_path)) # When running on the example app else + package_json_path = File.join(__dir__, "example", "package.json") app_package = JSON.parse(File.read(File.join(__dir__, "example", "package.json"))) end @@ -119,8 +122,8 @@ Pod::Spec.new do |s| :CLANG_CXX_LANGUAGE_STANDARD => "c++17", } - log_message.call("[OP-SQLITE] Configuration:") - + log_message.call("[OP-SQLITE] Configuration found at #{package_json_path}") + exclude_files = [] if use_sqlcipher then From 5f841bbd5813854bb3e72b8f9a02f27a466e7571 Mon Sep 17 00:00:00 2001 From: Oscar Franco Date: Sun, 4 May 2025 11:56:44 +0800 Subject: [PATCH 3/4] WIP --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 32e0052f..6370b998 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@op-engineering/op-sqlite", - "version": "0.0.0-resolution-test", + "version": "0.0.0-resolution-test2", "description": "Next generation SQLite for React Native", "main": "lib/commonjs/index", "module": "lib/module/index", From 7a16b6f59ed44f0e4bf7cf4bda9d427a96ddf96b Mon Sep 17 00:00:00 2001 From: Oscar Franco Date: Sun, 4 May 2025 12:05:20 +0800 Subject: [PATCH 4/4] Revert version change --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6370b998..8d6ef541 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@op-engineering/op-sqlite", - "version": "0.0.0-resolution-test2", + "version": "0.0.0", "description": "Next generation SQLite for React Native", "main": "lib/commonjs/index", "module": "lib/module/index",