@op-engineering/op-sqlite 15.1.4 → 15.1.6

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 +16 -8
  2. package/package.json +1 -1
package/op-sqlite.podspec CHANGED
@@ -5,13 +5,14 @@ log_message = lambda do |message|
5
5
  puts "\e[34m#{message}\e[0m"
6
6
  end
7
7
 
8
+ # In the sample app the dir is not inside of node_modules
8
9
  is_user_app = __dir__.include?("node_modules")
9
10
  package = JSON.parse(File.read(File.join(__dir__, "package.json")))
10
- parent_folder_name = File.basename(__dir__)
11
11
  app_package = nil
12
12
  package_json_path = nil
13
13
 
14
14
  # When installed on user node_modules lives inside node_modules/@op-engineering/op-sqlite
15
+ # Find the users package.json by searching up through parent directories
15
16
  if is_user_app
16
17
  current_dir = File.expand_path(__dir__)
17
18
  # Move one level up to the parent directory
@@ -31,14 +32,12 @@ if is_user_app
31
32
  end
32
33
 
33
34
  raise "package.json not found" if package_json_path.nil?
34
-
35
- app_package = JSON.parse(File.read(package_json_path))
36
35
  else
37
- # When running on the example app
38
36
  package_json_path = File.join(__dir__, "example", "package.json")
39
- app_package = JSON.parse(File.read(File.join(__dir__, "example", "package.json")))
40
37
  end
41
38
 
39
+ app_package = JSON.parse(File.read(package_json_path))
40
+
42
41
  op_sqlite_config = app_package["op-sqlite"]
43
42
  use_sqlcipher = false
44
43
  use_crsqlite = false
@@ -127,15 +126,24 @@ Pod::Spec.new do |s|
127
126
 
128
127
  if use_sqlcipher then
129
128
  log_message.call("[OP-SQLITE] using SQLCipher")
130
- exclude_files += ["cpp/sqlite3.c", "cpp/sqlite3.h", "cpp/libsql/bridge.c", "cpp/libsql/bridge.h", "cpp/libsql/bridge.cpp", "cpp/libsql/libsql.h"]
129
+ exclude_files += ["cpp/sqlite3.c", "cpp/sqlite3.h", "cpp/libsql/bridge.c", "cpp/libsql/bridge.h", "cpp/libsql/bridge.cpp", "cpp/libsql/libsql.h", "ios/libsql.xcframework/**/*"]
131
130
  xcconfig[:GCC_PREPROCESSOR_DEFINITIONS] += " OP_SQLITE_USE_SQLCIPHER=1 HAVE_FULLFSYNC=1 SQLITE_HAS_CODEC SQLITE_TEMP_STORE=3 SQLITE_EXTRA_INIT=sqlcipher_extra_init SQLITE_EXTRA_SHUTDOWN=sqlcipher_extra_shutdown"
132
131
  s.dependency "OpenSSL-Universal"
133
132
  elsif use_libsql then
134
133
  log_message.call("[OP-SQLITE] using libsql. Please contact turso (via Discord) for libsql issues")
135
134
  exclude_files += ["cpp/sqlite3.c", "cpp/sqlite3.h", "cpp/sqlcipher/sqlite3.c", "cpp/sqlcipher/sqlite3.h", "cpp/bridge.h", "cpp/bridge.cpp"]
136
135
  else
137
- log_message.call("[OP-SQLITE] using pure SQLite from CocoaPods with performance optimizations")
138
- exclude_files += ["cpp/sqlcipher/sqlite3.c", "cpp/sqlcipher/sqlite3.h", "cpp/libsql/bridge.c", "cpp/libsql/bridge.h", "cpp/libsql/bridge.cpp", "cpp/libsql/libsql.h"]
136
+ log_message.call("[OP-SQLITE] using pure SQLite")
137
+ exclude_files += ["cpp/sqlcipher/sqlite3.c", "cpp/sqlcipher/sqlite3.h", "cpp/libsql/bridge.c", "cpp/libsql/bridge.h", "cpp/libsql/bridge.cpp", "cpp/libsql/libsql.h", "ios/libsql.xcframework/**/*"]
138
+ end
139
+
140
+ # Exclude xcframeworks that aren't being used
141
+ if !use_crsqlite then
142
+ exclude_files += ["ios/crsqlite.xcframework/**/*"]
143
+ end
144
+
145
+ if !use_sqlite_vec then
146
+ exclude_files += ["ios/sqlitevec.xcframework/**/*"]
139
147
  end
140
148
 
141
149
  other_cflags = '$(inherited) -DSQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION=1 -DHAVE_USLEEP=1 -DSQLITE_ENABLE_LOCKING_STYLE=0'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@op-engineering/op-sqlite",
3
- "version": "15.1.4",
3
+ "version": "15.1.6",
4
4
  "description": "Fastest SQLite for React Native",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",