@op-engineering/op-sqlite 10.0.0-tokenizers-beta1 → 10.0.0-tokenizers-beta2
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.
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'fileutils'
|
|
2
|
+
|
|
3
|
+
def generate_tokenizers_header_file(names, file_path, is_user_app)
|
|
4
|
+
# Ensure the directory exists
|
|
5
|
+
dir_path = File.dirname(file_path)
|
|
6
|
+
FileUtils.mkdir_p(dir_path) unless Dir.exist?(dir_path)
|
|
7
|
+
tokenizer_list = names.map { |name| "opsqlite_#{name}_init(db,&errMsg,nullptr);" }.join
|
|
8
|
+
|
|
9
|
+
File.open(file_path, 'w') do |file|
|
|
10
|
+
file.puts "#ifndef TOKENIZERS_H"
|
|
11
|
+
file.puts "#define TOKENIZERS_H"
|
|
12
|
+
file.puts
|
|
13
|
+
file.puts "#define TOKENIZER_LIST #{tokenizer_list}"
|
|
14
|
+
file.puts
|
|
15
|
+
if is_user_app
|
|
16
|
+
file.puts "#include \"node-modules/@op-engineering/op-sqlite/cpp/sqlite3.h\""
|
|
17
|
+
else
|
|
18
|
+
file.puts "#include \"../../cpp/sqlite3.h\""
|
|
19
|
+
end
|
|
20
|
+
file.puts
|
|
21
|
+
file.puts "namespace opsqlite {"
|
|
22
|
+
file.puts
|
|
23
|
+
|
|
24
|
+
names.each do |name|
|
|
25
|
+
file.puts "int opsqlite_#{name}_init(sqlite3 *db, char **error, const sqlite3_api_routines *api);"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
file.puts
|
|
29
|
+
file.puts "} // namespace opsqlite"
|
|
30
|
+
file.puts
|
|
31
|
+
file.puts "#endif // TOKENIZERS_H"
|
|
32
|
+
end
|
|
33
|
+
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@op-engineering/op-sqlite",
|
|
3
|
-
"version": "10.0.0-tokenizers-
|
|
3
|
+
"version": "10.0.0-tokenizers-beta2",
|
|
4
4
|
"description": "Next generation SQLite for React Native",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"ios",
|
|
15
15
|
"cpp",
|
|
16
16
|
"op-sqlite.podspec",
|
|
17
|
+
"generate_tokenizers_header_file.rb",
|
|
17
18
|
"ios/**.xcframework",
|
|
18
19
|
"!lib/typescript/example",
|
|
19
20
|
"!android/build",
|