@legendapp/spark 0.0.2 → 0.0.4

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 (224) hide show
  1. package/init-template.cjs +7 -1
  2. package/package.json +10 -5
  3. package/patches/dependencies.json +252 -0
  4. package/patches/expo-application@55.0.19.patch +54 -0
  5. package/patches/expo-blur@55.0.18.patch +130 -0
  6. package/patches/expo-device@55.0.21.patch +149 -0
  7. package/patches/expo-font@55.0.8.patch +55 -0
  8. package/patches/expo-glass-effect@55.0.11.patch +304 -0
  9. package/patches/expo-haptics@55.0.18.patch +54 -0
  10. package/patches/expo-image-manipulator@55.0.21.patch +312 -0
  11. package/patches/expo-image-picker@55.0.24.patch +327 -0
  12. package/patches/expo-image@55.0.11.patch +158 -0
  13. package/patches/expo-keep-awake@55.0.8.patch +41 -0
  14. package/patches/expo-localization@55.0.19.patch +32 -0
  15. package/patches/expo-location@55.1.15.patch +190 -0
  16. package/patches/expo-symbols@55.0.9.patch +286 -0
  17. package/patches/expo-system-ui@55.0.22.patch +61 -0
  18. package/patches/expo-web-browser@55.0.20.patch +13 -0
  19. package/patches/react-native-app-logs@0.3.1.patch +20 -0
  20. package/patches/react-native-blurhash@2.1.3.patch +318 -0
  21. package/patches/react-native-community-blur@4.4.1.patch +415 -0
  22. package/patches/react-native-community-datetimepicker@9.2.2.patch +320 -0
  23. package/patches/react-native-fast-image@10.9.9.patch +131 -0
  24. package/patches/react-native-graph@1.4.0.patch +157 -0
  25. package/patches/react-native-keyboard-controller@1.22.9.patch +16 -0
  26. package/patches/react-native-masked-view-masked-view@0.3.2.patch +140 -0
  27. package/patches/react-native-mmkv@4.3.2.patch +40 -0
  28. package/patches/react-native-nitro-fetch@1.9.0.patch +130 -0
  29. package/patches/react-native-nitro-zxing@0.3.0.patch +13 -0
  30. package/patches/react-native-nitro-zxing@0.3.1.patch +22 -0
  31. package/patches/react-native-quick-base64@3.0.1.patch +13 -0
  32. package/patches/react-native-quick-crypto@1.1.9.patch +31 -0
  33. package/patches/react-native-release-profiler@0.4.5.patch +37 -0
  34. package/patches/react-native-screen-corner-radius@0.2.3.patch +13 -0
  35. package/patches/react-native-screens@4.23.0.patch +160 -0
  36. package/patches/react-native-svg@15.15.3.patch +31 -0
  37. package/patches/react-native-unistyles@3.6.0.patch +203 -0
  38. package/patches/react-native-worklets-core@1.6.3.patch +13 -0
  39. package/patches/react-navigation-native-stack@7.21.0.patch +16 -0
  40. package/patches/registry.json +615 -0
  41. package/patches/sentry-react-native@8.32.0.patch +76 -0
  42. package/patches/workspace/expo-audio@55.0.18.patch +159 -0
  43. package/patches/workspace/op-engineering-op-sqlite@18.2.1.patch +796 -0
  44. package/patches/workspace/react-native-nitro-modules@0.37.0.patch +1348 -0
  45. package/patches/workspace/react-native-runtimes-core@0.1.0-alpha.2.patch +276 -0
  46. package/patches/workspace/react-native-webview@16.0.0.patch +208 -0
  47. package/postinstall.cjs +10 -1
  48. package/skills/spark/SKILL.md +37 -4
  49. package/skills/spark/UPGRADING.md +150 -1
  50. package/skills/spark/ai-customize.md +39 -0
  51. package/skills/spark/app-and-documents.md +56 -0
  52. package/skills/spark/external-libraries.md +87 -0
  53. package/skills/spark/files.md +64 -0
  54. package/skills/spark/integrations.md +69 -0
  55. package/skills/spark/keyboard.md +54 -0
  56. package/skills/spark/library-compat.md +76 -0
  57. package/skills/spark/menus-tray-dock.md +83 -0
  58. package/skills/spark/storage-settings.md +85 -0
  59. package/skills/spark/ui.md +57 -0
  60. package/skills/spark/windows.md +91 -0
  61. package/ui-popover.ts +1 -0
  62. package/ui-progress.ts +1 -0
  63. package/ui-sheet.ts +1 -0
  64. package/ui-split-view.ts +1 -0
  65. package/ui-table.ts +1 -0
  66. package/vendor/node_modules/@legendapp/spark-ai/package.json +3 -3
  67. package/vendor/node_modules/@legendapp/spark-audio/package.json +3 -13
  68. package/vendor/node_modules/@legendapp/spark-auth-session/package.json +3 -10
  69. package/vendor/node_modules/@legendapp/spark-cli/dist/add-desktop.js +5 -0
  70. package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +139 -104
  71. package/vendor/node_modules/@legendapp/spark-cli/dist/cli-arguments.js +4 -1
  72. package/vendor/node_modules/@legendapp/spark-cli/dist/commands.js +16 -7
  73. package/vendor/node_modules/@legendapp/spark-cli/dist/dependency-pins.js +19 -3
  74. package/vendor/node_modules/@legendapp/spark-cli/dist/dev-command.js +2 -0
  75. package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +10 -2
  76. package/vendor/node_modules/@legendapp/spark-cli/dist/enriched-html-pins.js +2 -0
  77. package/vendor/node_modules/@legendapp/spark-cli/dist/errors.js +1 -1
  78. package/vendor/node_modules/@legendapp/spark-cli/dist/index.js +57 -9
  79. package/vendor/node_modules/@legendapp/spark-cli/dist/init-template.cjs +12 -2
  80. package/vendor/node_modules/@legendapp/spark-cli/dist/init-template.d.cts +1 -1
  81. package/vendor/node_modules/@legendapp/spark-cli/dist/metro.cjs +1 -0
  82. package/vendor/node_modules/@legendapp/spark-cli/dist/migrate.js +65 -0
  83. package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.cjs +4 -4
  84. package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.d.cts +2 -2
  85. package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +15 -8
  86. package/vendor/node_modules/@legendapp/spark-cli/dist/native-patch-preflight.js +35 -7
  87. package/vendor/node_modules/@legendapp/spark-cli/dist/patch.js +92 -0
  88. package/vendor/node_modules/@legendapp/spark-cli/dist/project-version.js +12 -4
  89. package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +20 -1
  90. package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +20 -20
  91. package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-input-cache.js +140 -0
  92. package/vendor/node_modules/@legendapp/spark-cli/dist/upgrade.js +1 -1
  93. package/vendor/node_modules/@legendapp/spark-cli/dist/windows.js +3 -0
  94. package/vendor/node_modules/@legendapp/spark-cli/package.json +5 -4
  95. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +2 -2
  96. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +2 -2
  97. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +2 -2
  98. package/vendor/node_modules/@legendapp/spark-clipboard/macos/RNDesktopClipboard.mm +1 -1
  99. package/vendor/node_modules/@legendapp/spark-clipboard/package.json +3 -10
  100. package/vendor/node_modules/@legendapp/spark-clipboard/src/desktop.ts +1 -0
  101. package/vendor/node_modules/@legendapp/spark-codex/package.json +3 -7
  102. package/vendor/node_modules/@legendapp/spark-commands/package.json +5 -5
  103. package/vendor/node_modules/@legendapp/spark-context-menu/package.json +3 -10
  104. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.h +3 -1
  105. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.mm +51 -10
  106. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkStorage.h +4 -0
  107. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkStorage.mm +82 -0
  108. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.mm +64 -2
  109. package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +2 -8
  110. package/vendor/node_modules/@legendapp/spark-desktop-config/autolinking.cjs +3 -2
  111. package/vendor/node_modules/@legendapp/spark-desktop-config/config.cjs +6 -8
  112. package/vendor/node_modules/@legendapp/spark-desktop-config/identity.cjs +2 -0
  113. package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.cjs +315 -68
  114. package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.d.cts +7 -0
  115. package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +3 -3
  116. package/vendor/node_modules/@legendapp/spark-desktop-config/patch-registry.cjs +318 -0
  117. package/vendor/node_modules/@legendapp/spark-desktop-config/patch-registry.d.cts +20 -0
  118. package/vendor/node_modules/@legendapp/spark-desktop-config/validation.cjs +66 -9
  119. package/vendor/node_modules/@legendapp/spark-desktop-config/windows.plugin.cjs +1 -0
  120. package/vendor/node_modules/@legendapp/spark-desktop-host/AppDelegate.mm +1 -0
  121. package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +2 -2
  122. package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +3 -10
  123. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +3 -10
  124. package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/RNDesktopWindows.mm +7 -2
  125. package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManager.mm +235 -240
  126. package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +4 -11
  127. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/api.ts +9 -3
  128. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/macos-adapter.ts +7 -0
  129. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/types.ts +32 -3
  130. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/validation.ts +28 -11
  131. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/createWindowsNavigator.tsx +15 -3
  132. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/primaryWindowLifecycle.ts +12 -3
  133. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/usePrimaryWindowLifecycle.ts +2 -1
  134. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/useWindowFocusEffect.ts +4 -1
  135. package/vendor/node_modules/@legendapp/spark-documents/package.json +7 -7
  136. package/vendor/node_modules/@legendapp/spark-drag-drop/macos/RNDesktopDragView.mm +77 -17
  137. package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +3 -8
  138. package/vendor/node_modules/@legendapp/spark-drag-drop/src/DesktopDragViewNativeComponent.ts +1 -0
  139. package/vendor/node_modules/@legendapp/spark-drag-drop/src/contracts.ts +13 -4
  140. package/vendor/node_modules/@legendapp/spark-drag-drop/src/index.tsx +5 -3
  141. package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/SparkDragDrop.h +6 -1
  142. package/vendor/node_modules/@legendapp/spark-expo-compat/metro.cjs +44 -0
  143. package/vendor/node_modules/@legendapp/spark-expo-compat/package.json +20 -0
  144. package/vendor/node_modules/@legendapp/spark-expo-compat/src/clipboard.ts +40 -0
  145. package/vendor/node_modules/@legendapp/spark-expo-compat/src/document-picker.ts +52 -0
  146. package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +3 -10
  147. package/vendor/node_modules/@legendapp/spark-file-dialog/src/options.ts +5 -2
  148. package/vendor/node_modules/@legendapp/spark-file-dialog/src/types.ts +3 -3
  149. package/vendor/node_modules/@legendapp/spark-file-system/macos/RNDesktopFileSystem.mm +1 -1
  150. package/vendor/node_modules/@legendapp/spark-file-system/package.json +3 -11
  151. package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +3 -10
  152. package/vendor/node_modules/@legendapp/spark-html/package.json +2 -2
  153. package/vendor/node_modules/@legendapp/spark-markdown/package.json +2 -2
  154. package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +3 -10
  155. package/vendor/node_modules/@legendapp/spark-message-dialog/src/index.ts +1 -0
  156. package/vendor/node_modules/@legendapp/spark-native-menu/package.json +3 -9
  157. package/vendor/node_modules/@legendapp/spark-native-menu/src/hooks.ts +4 -0
  158. package/vendor/node_modules/@legendapp/spark-notifications/package.json +3 -10
  159. package/vendor/node_modules/@legendapp/spark-processes/package.json +3 -10
  160. package/vendor/node_modules/@legendapp/spark-rich-text/package.json +2 -2
  161. package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +3 -10
  162. package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
  163. package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +4 -4
  164. package/vendor/node_modules/@legendapp/spark-sqlite/package.json +3 -3
  165. package/vendor/node_modules/@legendapp/spark-system/package.json +3 -10
  166. package/vendor/node_modules/@legendapp/spark-tray/package.json +3 -10
  167. package/vendor/node_modules/@legendapp/spark-tray/src/index.ts +2 -1
  168. package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkButton.mm +82 -14
  169. package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkTextInput.h +1 -1
  170. package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkTextInput.mm +94 -11
  171. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSidebarSplitViewComponent.mm +235 -18
  172. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkPaneSplitView.h +17 -0
  173. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkPaneSplitView.mm +216 -0
  174. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkSplitViewComponent.h +4 -0
  175. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkSplitViewComponent.mm +212 -0
  176. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkSplitViewUpdates.h +6 -0
  177. package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSegmentedControl.mm +26 -13
  178. package/vendor/node_modules/@legendapp/spark-ui/macos/popover/RNSparkPopover.h +9 -0
  179. package/vendor/node_modules/@legendapp/spark-ui/macos/popover/RNSparkPopover.mm +126 -0
  180. package/vendor/node_modules/@legendapp/spark-ui/macos/progress/RNSparkProgressIndicator.h +9 -0
  181. package/vendor/node_modules/@legendapp/spark-ui/macos/progress/RNSparkProgressIndicator.mm +66 -0
  182. package/vendor/node_modules/@legendapp/spark-ui/macos/radio-group/RNSparkRadioGroup.h +9 -0
  183. package/vendor/node_modules/@legendapp/spark-ui/macos/radio-group/RNSparkRadioGroup.mm +118 -0
  184. package/vendor/node_modules/@legendapp/spark-ui/macos/sf-symbol/RNSFSymbol.mm +4 -12
  185. package/vendor/node_modules/@legendapp/spark-ui/macos/sheet/RNSparkSheet.h +9 -0
  186. package/vendor/node_modules/@legendapp/spark-ui/macos/sheet/RNSparkSheet.mm +109 -0
  187. package/vendor/node_modules/@legendapp/spark-ui/macos/sidebar/RNSidebar.mm +418 -102
  188. package/vendor/node_modules/@legendapp/spark-ui/macos/table/RNSparkTable.h +9 -0
  189. package/vendor/node_modules/@legendapp/spark-ui/macos/table/RNSparkTable.mm +179 -0
  190. package/vendor/node_modules/@legendapp/spark-ui/package.json +9 -8
  191. package/vendor/node_modules/@legendapp/spark-ui/src/SparkButtonNativeComponent.ts +10 -2
  192. package/vendor/node_modules/@legendapp/spark-ui/src/SparkTextInputNativeComponent.ts +2 -0
  193. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SidebarSplitViewNativeComponent.ts +9 -0
  194. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SplitView.tsx +99 -0
  195. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SplitViewNativeComponent.ts +29 -0
  196. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/index.tsx +34 -17
  197. package/vendor/node_modules/@legendapp/spark-ui/src/availability.ts +5 -4
  198. package/vendor/node_modules/@legendapp/spark-ui/src/checkbox-unavailable.tsx +20 -0
  199. package/vendor/node_modules/@legendapp/spark-ui/src/control.ts +24 -3
  200. package/vendor/node_modules/@legendapp/spark-ui/src/desktop.tsx +63 -13
  201. package/vendor/node_modules/@legendapp/spark-ui/src/index.android.tsx +12 -7
  202. package/vendor/node_modules/@legendapp/spark-ui/src/index.ios.tsx +12 -7
  203. package/vendor/node_modules/@legendapp/spark-ui/src/index.web.tsx +35 -13
  204. package/vendor/node_modules/@legendapp/spark-ui/src/mobile-input.tsx +2 -2
  205. package/vendor/node_modules/@legendapp/spark-ui/src/native-select/NativeSegmentedControlNativeComponent.ts +3 -1
  206. package/vendor/node_modules/@legendapp/spark-ui/src/popover/PopoverNativeComponent.ts +20 -0
  207. package/vendor/node_modules/@legendapp/spark-ui/src/popover/index.tsx +45 -0
  208. package/vendor/node_modules/@legendapp/spark-ui/src/progress/ProgressIndicatorNativeComponent.ts +13 -0
  209. package/vendor/node_modules/@legendapp/spark-ui/src/progress/index.tsx +32 -0
  210. package/vendor/node_modules/@legendapp/spark-ui/src/radio-group/RadioGroupNativeComponent.ts +17 -0
  211. package/vendor/node_modules/@legendapp/spark-ui/src/sheet/SheetNativeComponent.ts +15 -0
  212. package/vendor/node_modules/@legendapp/spark-ui/src/sheet/index.tsx +38 -0
  213. package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/SidebarItemNativeComponent.ts +9 -1
  214. package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/SidebarNativeComponent.ts +17 -2
  215. package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/index.tsx +106 -22
  216. package/vendor/node_modules/@legendapp/spark-ui/src/table/TableNativeComponent.ts +22 -0
  217. package/vendor/node_modules/@legendapp/spark-ui/src/table/index.tsx +118 -0
  218. package/vendor/node_modules/@legendapp/spark-ui/src/types.ts +39 -6
  219. package/vendor/node_modules/@legendapp/spark-ui/uniwind.ts +3 -1
  220. package/vendor/node_modules/@legendapp/spark-ui/uniwind.web.ts +2 -1
  221. package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/SparkUI.h +46 -15
  222. package/vendor/node_modules/@legendapp/spark-updates/package.json +3 -9
  223. package/vendor/node_modules/@legendapp/spark-webview/package.json +2 -2
  224. package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
@@ -0,0 +1,796 @@
1
+ diff --git a/cpp/OPBridge.cpp b/cpp/OPBridge.cpp
2
+ index 23505cd..f1a40c8 100644
3
+ --- a/cpp/OPBridge.cpp
4
+ +++ b/cpp/OPBridge.cpp
5
+ @@ -73,7 +73,7 @@ std::string opsqlite_get_db_path(std::string const &db_name,
6
+ }
7
+
8
+ // Will return false if the directory already exists, no need to check
9
+ - std::filesystem::create_directories(location);
10
+ + std::filesystem::create_directories(std::filesystem::u8path(location));
11
+
12
+ if (!location.empty() && location.back() != '/') {
13
+ return location + "/" + db_name;
14
+ @@ -156,7 +156,7 @@ void create_dirs_if_needed(const std::string &path) {
15
+ }
16
+
17
+ // Extract directory part from path (exclude filename)
18
+ - std::filesystem::path fs_path(path);
19
+ + auto fs_path = std::filesystem::u8path(path);
20
+ auto dir = fs_path.parent_path();
21
+ if (!dir.empty()) {
22
+ std::filesystem::create_directories(dir);
23
+ @@ -193,7 +193,7 @@ void opsqlite_remove(sqlite3 *db, std::string const &name,
24
+ throw std::runtime_error("op-sqlite: db file not found:" + db_path);
25
+ }
26
+
27
+ - remove(db_path.c_str());
28
+ + std::filesystem::remove(std::filesystem::u8path(db_path));
29
+ }
30
+
31
+ void opsqlite_remove_v2(sqlite3 *db, std::string const &path) {
32
+ @@ -203,7 +203,7 @@ void opsqlite_remove_v2(sqlite3 *db, std::string const &path) {
33
+ throw std::runtime_error("[op-sqlite] db file not found: " + path);
34
+ }
35
+
36
+ - remove(path.c_str());
37
+ + std::filesystem::remove(std::filesystem::u8path(path));
38
+ }
39
+
40
+ BridgeResult opsqlite_execute_prepared_statement(
41
+ diff --git a/cpp/OPBridge.hpp b/cpp/OPBridge.hpp
42
+ index 26cd143..c53bab8 100644
43
+ --- a/cpp/OPBridge.hpp
44
+ +++ b/cpp/OPBridge.hpp
45
+ @@ -25,7 +25,7 @@ typedef std::function<void(std::string dbName)> RollbackCallback;
46
+ // Path to the optional loadable extension, set once in install() and
47
+ // shared by every subsequent open() call instead of being threaded through
48
+ // as a parameter.
49
+ -extern std::string _sqlite_vec_path;
50
+ +extern OP_SQLITE_CONTEXT_LOCAL std::string _sqlite_vec_path;
51
+
52
+ std::string opsqlite_get_db_path(std::string const &db_name,
53
+ std::string const &location);
54
+ diff --git a/cpp/OPSqlite.cpp b/cpp/OPSqlite.cpp
55
+ index 7b914f7..f2a99e3 100644
56
+ --- a/cpp/OPSqlite.cpp
57
+ +++ b/cpp/OPSqlite.cpp
58
+ @@ -1,3 +1,4 @@
59
+ +#include <filesystem>
60
+ #include "OPSqlite.hpp"
61
+ #include "OPDatabase.hpp"
62
+ #include "OPDumbHostObject.hpp"
63
+ @@ -21,10 +22,10 @@ namespace opsqlite {
64
+ namespace jsi = facebook::jsi;
65
+ namespace react = facebook::react;
66
+
67
+ -std::string _base_path;
68
+ -std::string _sqlite_vec_path;
69
+ -std::shared_ptr<react::CallInvoker> invoker;
70
+ -std::shared_ptr<std::atomic<bool>> generation_alive;
71
+ +OP_SQLITE_CONTEXT_LOCAL std::string _base_path;
72
+ +OP_SQLITE_CONTEXT_LOCAL std::string _sqlite_vec_path;
73
+ +OP_SQLITE_CONTEXT_LOCAL std::shared_ptr<react::CallInvoker> invoker;
74
+ +OP_SQLITE_CONTEXT_LOCAL std::shared_ptr<std::atomic<bool>> generation_alive;
75
+
76
+ // Each platform module calls its own invalidate() lifecycle hook when React
77
+ // Native tears down the JS context (CodePush/Hot Reload, or any other
78
+ @@ -88,7 +89,7 @@ install(jsi::Runtime &rt, const std::shared_ptr<react::CallInvoker> &invoker,
79
+ if (!location.empty()) {
80
+ if (location == ":memory:") {
81
+ path = ":memory:";
82
+ - } else if (location.rfind('/', 0) == 0) {
83
+ + } else if (std::filesystem::u8path(location).is_absolute()) {
84
+ path = location;
85
+ } else {
86
+ path = path + "/" + location;
87
+ diff --git a/cpp/OPSqlite.hpp b/cpp/OPSqlite.hpp
88
+ index 8e81903..62ba09b 100644
89
+ --- a/cpp/OPSqlite.hpp
90
+ +++ b/cpp/OPSqlite.hpp
91
+ @@ -3,7 +3,9 @@
92
+ #include <ReactCommon/CallInvoker.h>
93
+ #include <atomic>
94
+ #include <jsi/jsi.h>
95
+ +#ifndef _WIN32
96
+ #include <jsi/jsilib.h>
97
+ +#endif
98
+ #include <memory>
99
+
100
+ namespace opsqlite {
101
+ diff --git a/cpp/OPTypes.hpp b/cpp/OPTypes.hpp
102
+ index 853483c..be7cef3 100644
103
+ --- a/cpp/OPTypes.hpp
104
+ +++ b/cpp/OPTypes.hpp
105
+ @@ -1,3 +1,8 @@
106
+ +#ifdef _WIN32
107
+ +#define OP_SQLITE_CONTEXT_LOCAL thread_local
108
+ +#else
109
+ +#define OP_SQLITE_CONTEXT_LOCAL
110
+ +#endif
111
+ #pragma once
112
+
113
+ #include <ReactCommon/CallInvoker.h>
114
+ @@ -10,7 +15,7 @@
115
+
116
+ namespace opsqlite {
117
+
118
+ -extern std::shared_ptr<facebook::react::CallInvoker> invoker;
119
+ +extern OP_SQLITE_CONTEXT_LOCAL std::shared_ptr<facebook::react::CallInvoker> invoker;
120
+
121
+ // Liveness of the current JS runtime generation. Replaced by install() and
122
+ // cleared by invalidate(), so each generation gets its own flag rather than
123
+ @@ -23,7 +28,7 @@ extern std::shared_ptr<facebook::react::CallInvoker> invoker;
124
+ // generations briefly overlap, might already have been reassigned to the
125
+ // incoming generation's flag by the time the outgoing generation's
126
+ // invalidate() runs.
127
+ -extern std::shared_ptr<std::atomic<bool>> generation_alive;
128
+ +extern OP_SQLITE_CONTEXT_LOCAL std::shared_ptr<std::atomic<bool>> generation_alive;
129
+
130
+ struct ArrayBuffer {
131
+ std::shared_ptr<uint8_t[]> data;
132
+ diff --git a/cpp/OPUtils.cpp b/cpp/OPUtils.cpp
133
+ index f62f7e1..b4c838c 100644
134
+ --- a/cpp/OPUtils.cpp
135
+ +++ b/cpp/OPUtils.cpp
136
+ @@ -1,3 +1,4 @@
137
+ +#include <filesystem>
138
+
139
+ #include "OPUtils.hpp"
140
+ #include "OPSmartHostObject.hpp"
141
+ @@ -322,7 +323,7 @@ void to_batch_arguments(jsi::Runtime &rt, jsi::Array const &tuples,
142
+ #ifndef OP_SQLITE_USE_LIBSQL
143
+ BatchResult import_sql_file(sqlite3 *db, std::string path) {
144
+ std::string line;
145
+ - std::ifstream sqFile(path);
146
+ + std::ifstream sqFile(std::filesystem::u8path(path));
147
+ if (!sqFile.is_open()) {
148
+ throw std::runtime_error("Could not open file: " + path);
149
+ }
150
+ @@ -356,13 +357,11 @@ BatchResult import_sql_file(sqlite3 *db, std::string path) {
151
+ #endif
152
+
153
+ bool folder_exists(const std::string &name) {
154
+ - struct stat buffer;
155
+ - return (stat(name.c_str(), &buffer) == 0);
156
+ + return std::filesystem::exists(std::filesystem::u8path(name));
157
+ }
158
+
159
+ bool file_exists(const std::string &path) {
160
+ - struct stat buffer;
161
+ - return (stat(path.c_str(), &buffer) == 0);
162
+ + return std::filesystem::exists(std::filesystem::u8path(path));
163
+ }
164
+
165
+ void log_to_console(jsi::Runtime &runtime, const std::string &message) {
166
+ diff --git a/package.json b/package.json
167
+ index b30a29d..23a1dc6 100644
168
+ --- a/package.json
169
+ +++ b/package.json
170
+ @@ -39,7 +39,8 @@
171
+ "!**/__tests__",
172
+ "!**/__fixtures__",
173
+ "!**/__mocks__",
174
+ - "!**/.*"
175
+ + "!**/.*",
176
+ + "windows"
177
+ ],
178
+ "scripts": {
179
+ "test:node": "yarn workspace node test",
180
+ @@ -137,5 +138,9 @@
181
+ "type": "turbo-module",
182
+ "version": "0.52.1"
183
+ },
184
+ - "packageManager": "yarn@4.11.0"
185
+ + "packageManager": "yarn@4.11.0",
186
+ + "spark": {
187
+ + "sdk": true,
188
+ + "upstreamIntegrity": "sha512-atVOtXyFzO0e454eVS27AMwRs515URCKrkvLLG+mGKcyiF5UPfC53oukpNp2UmVzlLebyTEXNkTYs6n0dVGd0g=="
189
+ + }
190
+ }
191
+ diff --git a/react-native.config.js b/react-native.config.js
192
+ new file mode 100644
193
+ index 0000000..93c7170
194
+ --- /dev/null
195
+ +++ b/react-native.config.js
196
+ @@ -0,0 +1,4 @@
197
+ +module.exports = {};
198
+ +
199
+ +module.exports.dependency ??= {}; module.exports.dependency.platforms ??= {};
200
+ +module.exports.dependency.platforms.windows = {"sourceDir":"windows","solutionFile":"SparkOPSQLite.sln","projects":[{"projectFile":"SparkOPSQLite/SparkOPSQLite.vcxproj","directDependency":true}]};
201
+ diff --git a/windows/.gitignore b/windows/.gitignore
202
+ new file mode 100644
203
+ index 0000000..0fd0acf
204
+ --- /dev/null
205
+ +++ b/windows/.gitignore
206
+ @@ -0,0 +1,46 @@
207
+ +*AppPackages*
208
+ +*BundleArtifacts*
209
+ +
210
+ +#OS junk files
211
+ +[Tt]humbs.db
212
+ +*.DS_Store
213
+ +
214
+ +#Visual Studio files
215
+ +*.[Oo]bj
216
+ +*.user
217
+ +*.aps
218
+ +*.pch
219
+ +*.vspscc
220
+ +*.vssscc
221
+ +*_i.c
222
+ +*_p.c
223
+ +*.ncb
224
+ +*.suo
225
+ +*.tlb
226
+ +*.tlh
227
+ +*.bak
228
+ +*.[Cc]ache
229
+ +*.ilk
230
+ +*.log
231
+ +*.lib
232
+ +*.sbr
233
+ +*.sdf
234
+ +*.opensdf
235
+ +*.opendb
236
+ +*.unsuccessfulbuild
237
+ +ipch/
238
+ +[Oo]bj/
239
+ +[Bb]in
240
+ +[Dd]ebug*/
241
+ +[Rr]elease*/
242
+ +Ankh.NoLoad
243
+ +.vs/
244
+ +# Visual C++ cache files
245
+ +
246
+ +#Files generated by the VS build
247
+ +**/Generated Files/**
248
+ +
249
+ +#Files generated by MS build
250
+ +*.binlog
251
+ +*.err
252
+ +*.wrn
253
+ diff --git a/windows/ExperimentalFeatures.props b/windows/ExperimentalFeatures.props
254
+ new file mode 100644
255
+ index 0000000..d7b6c40
256
+ --- /dev/null
257
+ +++ b/windows/ExperimentalFeatures.props
258
+ @@ -0,0 +1,33 @@
259
+ +<?xml version="1.0" encoding="utf-8"?>
260
+ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
261
+ +
262
+ + <PropertyGroup Label="Microsoft.ReactNative Experimental Features">
263
+ + <!--
264
+ + Required for building a New Architecture project.
265
+ +
266
+ + Library projects can change this value to test against Old and New
267
+ + Architectures when building the library project's local sln file.
268
+ +
269
+ + Otherwise this value will be decided by the consuming RNW app.
270
+ +
271
+ + See https://microsoft.github.io/react-native-windows/docs/new-architecture
272
+ + -->
273
+ + <RnwNewArch>true</RnwNewArch>
274
+ +
275
+ + <!--
276
+ + Changes compilation to assume use of Microsoft.ReactNative NuGet packages
277
+ + instead of building the framework from source. Defaults to true.
278
+ +
279
+ + This is set during library project creation and is used when building
280
+ + the library project's local sln file.
281
+ +
282
+ + Otherwise this value will be decided by the consuming RNW app.
283
+ +
284
+ + See https://microsoft.github.io/react-native-windows/docs/nuget
285
+ + -->
286
+ + <UseExperimentalNuget>true</UseExperimentalNuget>
287
+ +
288
+ + <ReactExperimentalFeaturesSet>true</ReactExperimentalFeaturesSet>
289
+ + </PropertyGroup>
290
+ +
291
+ +</Project>
292
+ diff --git a/windows/LICENSE b/windows/LICENSE
293
+ new file mode 100644
294
+ index 0000000..b4f554e
295
+ --- /dev/null
296
+ +++ b/windows/LICENSE
297
+ @@ -0,0 +1,25 @@
298
+ +The MIT License (MIT)
299
+ +
300
+ +Copyright (c) Microsoft Corporation and contributors. All rights reserved.
301
+ +
302
+ +Portions derived from React Native:
303
+ +
304
+ +Copyright (c) 2015-present, Facebook, Inc.
305
+ +
306
+ +Permission is hereby granted, free of charge, to any person obtaining a copy
307
+ +of this software and associated documentation files (the "Software"), to deal
308
+ +in the Software without restriction, including without limitation the rights
309
+ +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
310
+ +copies of the Software, and to permit persons to whom the Software is
311
+ +furnished to do so, subject to the following conditions:
312
+ +
313
+ +The above copyright notice and this permission notice shall be included in all
314
+ +copies or substantial portions of the Software.
315
+ +
316
+ +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
317
+ +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
318
+ +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
319
+ +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
320
+ +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
321
+ +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
322
+ +SOFTWARE.
323
+ diff --git a/windows/SparkOPSQLite/ReactPackageProvider.cpp b/windows/SparkOPSQLite/ReactPackageProvider.cpp
324
+ new file mode 100644
325
+ index 0000000..bb3b576
326
+ --- /dev/null
327
+ +++ b/windows/SparkOPSQLite/ReactPackageProvider.cpp
328
+ @@ -0,0 +1,20 @@
329
+ +#include "pch.h"
330
+ +
331
+ +#include "ReactPackageProvider.h"
332
+ +#if __has_include("ReactPackageProvider.g.cpp")
333
+ +#include "ReactPackageProvider.g.cpp"
334
+ +#endif
335
+ +
336
+ +#include "SparkOPSQLite.h"
337
+ +
338
+ +using namespace winrt::Microsoft::ReactNative;
339
+ +
340
+ +namespace winrt::SparkOPSQLite::implementation
341
+ +{
342
+ +
343
+ +void ReactPackageProvider::CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept
344
+ +{
345
+ + AddAttributedModules(packageBuilder, true);
346
+ +}
347
+ +
348
+ +} // namespace winrt::SparkOPSQLite::implementation
349
+ diff --git a/windows/SparkOPSQLite/ReactPackageProvider.h b/windows/SparkOPSQLite/ReactPackageProvider.h
350
+ new file mode 100644
351
+ index 0000000..6099554
352
+ --- /dev/null
353
+ +++ b/windows/SparkOPSQLite/ReactPackageProvider.h
354
+ @@ -0,0 +1,24 @@
355
+ +#pragma once
356
+ +
357
+ +#include "ReactPackageProvider.g.h"
358
+ +
359
+ +using namespace winrt::Microsoft::ReactNative;
360
+ +
361
+ +namespace winrt::SparkOPSQLite::implementation
362
+ +{
363
+ +
364
+ +struct ReactPackageProvider : ReactPackageProviderT<ReactPackageProvider>
365
+ +{
366
+ + ReactPackageProvider() = default;
367
+ +
368
+ + void CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept;
369
+ +};
370
+ +
371
+ +} // namespace winrt::SparkOPSQLite::implementation
372
+ +
373
+ +namespace winrt::SparkOPSQLite::factory_implementation
374
+ +{
375
+ +
376
+ +struct ReactPackageProvider : ReactPackageProviderT<ReactPackageProvider, implementation::ReactPackageProvider> {};
377
+ +
378
+ +} // namespace winrt::SparkOPSQLite::factory_implementation
379
+ diff --git a/windows/SparkOPSQLite/ReactPackageProvider.idl b/windows/SparkOPSQLite/ReactPackageProvider.idl
380
+ new file mode 100644
381
+ index 0000000..797d2c9
382
+ --- /dev/null
383
+ +++ b/windows/SparkOPSQLite/ReactPackageProvider.idl
384
+ @@ -0,0 +1,9 @@
385
+ +namespace SparkOPSQLite
386
+ +{
387
+ + [webhosthidden]
388
+ + [default_interface]
389
+ + runtimeclass ReactPackageProvider : Microsoft.ReactNative.IReactPackageProvider
390
+ + {
391
+ + ReactPackageProvider();
392
+ + };
393
+ +}
394
+ diff --git a/windows/SparkOPSQLite/SparkOPSQLite.cpp b/windows/SparkOPSQLite/SparkOPSQLite.cpp
395
+ new file mode 100644
396
+ index 0000000..7378fdd
397
+ --- /dev/null
398
+ +++ b/windows/SparkOPSQLite/SparkOPSQLite.cpp
399
+ @@ -0,0 +1,2 @@
400
+ +#include "pch.h"
401
+ +#include "SparkOPSQLite.h"
402
+ diff --git a/windows/SparkOPSQLite/SparkOPSQLite.def b/windows/SparkOPSQLite/SparkOPSQLite.def
403
+ new file mode 100644
404
+ index 0000000..24e7c12
405
+ --- /dev/null
406
+ +++ b/windows/SparkOPSQLite/SparkOPSQLite.def
407
+ @@ -0,0 +1,3 @@
408
+ +EXPORTS
409
+ +DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE
410
+ +DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE
411
+ diff --git a/windows/SparkOPSQLite/SparkOPSQLite.h b/windows/SparkOPSQLite/SparkOPSQLite.h
412
+ new file mode 100644
413
+ index 0000000..0b59e88
414
+ --- /dev/null
415
+ +++ b/windows/SparkOPSQLite/SparkOPSQLite.h
416
+ @@ -0,0 +1,48 @@
417
+ +#pragma once
418
+ +#include "NativeModules.h"
419
+ +#include <JSI/JsiApiContext.h>
420
+ +#include <OPSqlite.hpp>
421
+ +#include <filesystem>
422
+ +#include <shlobj.h>
423
+ +#include <winrt/Windows.Security.Cryptography.h>
424
+ +#include <winrt/Windows.Security.Cryptography.Core.h>
425
+ +#pragma comment(lib, "Shell32.lib")
426
+ +REACT_MODULE(SparkOPSQLiteModule, L"OPSQLite")
427
+ +struct SparkOPSQLiteModule {
428
+ + winrt::Microsoft::ReactNative::ReactContext context;
429
+ + std::shared_ptr<std::atomic<bool>> generation;
430
+ + REACT_INIT(Initialize) void Initialize(winrt::Microsoft::ReactNative::ReactContext const &value) noexcept { context = value; }
431
+ + ~SparkOPSQLiteModule() { if (generation) opsqlite::invalidate(generation); }
432
+ + static std::filesystem::path Directory() {
433
+ + wchar_t project[32768]{}; if (!GetEnvironmentVariableW(L"SPARK_PROJECT_ID", project, 32768)) throw winrt::hresult_invalid_argument(L"Missing project identity");
434
+ + using namespace winrt::Windows::Security::Cryptography;
435
+ + auto hash = Core::HashAlgorithmProvider::OpenAlgorithm(Core::HashAlgorithmNames::Sha256());
436
+ + auto id = CryptographicBuffer::EncodeToHexString(hash.HashData(CryptographicBuffer::ConvertStringToBinary(project, BinaryStringEncoding::Utf8)));
437
+ + PWSTR raw = nullptr; winrt::check_hresult(SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, nullptr, &raw)); std::filesystem::path path(raw); CoTaskMemFree(raw);
438
+ + path /= L"Spark"; path /= id.c_str(); path /= L"data"; std::filesystem::create_directories(path); return path;
439
+ + }
440
+ + REACT_SYNC_METHOD(getConstants) winrt::Microsoft::ReactNative::JSValueObject getConstants() { return {{"WINDOWS_DATABASE_PATH", winrt::to_string(Directory().wstring())}}; }
441
+ + REACT_SYNC_METHOD(install) bool install() {
442
+ + if (generation) return true;
443
+ + auto handle = context.Handle().JSRuntime(); if (!handle) return false;
444
+ + auto &runtime = winrt::Microsoft::ReactNative::GetOrCreateContextRuntime(context, handle);
445
+ + auto location = winrt::to_string(Directory().wstring());
446
+ + generation = opsqlite::install(runtime, context.CallInvoker(), location.c_str(), ""); return true;
447
+ + }
448
+ + REACT_METHOD(moveAssetsDatabase) void moveAssetsDatabase(winrt::Microsoft::ReactNative::JSValueObject args, winrt::Microsoft::ReactNative::ReactPromise<bool> promise) noexcept {
449
+ + try {
450
+ + auto filename = args.at("filename").AsString(); std::filesystem::path name(winrt::to_hstring(filename).c_str());
451
+ + if (name.empty() || name.has_parent_path() || name == L"." || name == L".." || filename.find('\0') != std::string::npos) throw winrt::hresult_invalid_argument(L"Asset filename must be a simple filename");
452
+ + wchar_t executable[32768]{}; GetModuleFileNameW(nullptr, executable, 32768);
453
+ + auto source = std::filesystem::path(executable).parent_path() / L"Assets" / name, destination = Directory() / name;
454
+ + auto overwrite = args.count("overwrite") && args.at("overwrite").AsBoolean();
455
+ + promise.Resolve(std::filesystem::copy_file(source, destination, overwrite ? std::filesystem::copy_options::overwrite_existing : std::filesystem::copy_options::none));
456
+ + } catch (std::exception const &error) { promise.Reject(error.what()); }
457
+ + catch (winrt::hresult_error const &error) { promise.Reject(winrt::to_string(error.message()).c_str()); }
458
+ + }
459
+ + REACT_SYNC_METHOD(getDylibPath) std::string getDylibPath(std::string, std::string name) {
460
+ + std::filesystem::path file(winrt::to_hstring(name).c_str()); if (file.empty() || file.has_parent_path()) throw winrt::hresult_invalid_argument(L"Expected a library filename");
461
+ + wchar_t executable[32768]{}; GetModuleFileNameW(nullptr, executable, 32768);
462
+ + return winrt::to_string((std::filesystem::path(executable).parent_path() / (file.wstring() + L".dll")).wstring());
463
+ + }
464
+ +};
465
+ diff --git a/windows/SparkOPSQLite/SparkOPSQLite.rc b/windows/SparkOPSQLite/SparkOPSQLite.rc
466
+ new file mode 100644
467
+ index 0000000..23aece1
468
+ --- /dev/null
469
+ +++ b/windows/SparkOPSQLite/SparkOPSQLite.rc
470
+ @@ -0,0 +1,3 @@
471
+ +// Microsoft Visual C++ generated resource script.
472
+ +//
473
+ +#include "resource.h"
474
+ diff --git a/windows/SparkOPSQLite/SparkOPSQLite.vcxproj b/windows/SparkOPSQLite/SparkOPSQLite.vcxproj
475
+ new file mode 100644
476
+ index 0000000..5e1cf83
477
+ --- /dev/null
478
+ +++ b/windows/SparkOPSQLite/SparkOPSQLite.vcxproj
479
+ @@ -0,0 +1,148 @@
480
+ +<?xml version="1.0" encoding="utf-8"?>
481
+ +<!-- This project was created with react-native-windows 0.81.35 -->
482
+ +<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
483
+ + <Import Project="$(SolutionDir)\ExperimentalFeatures.props" Condition="Exists('$(SolutionDir)\ExperimentalFeatures.props')" />
484
+ + <PropertyGroup Label="Globals">
485
+ + <CppWinRTOptimized>true</CppWinRTOptimized>
486
+ + <MinimalCoreWin>true</MinimalCoreWin>
487
+ + <ProjectGuid>{96CE5E20-C675-425D-B566-7D0C8263959F}</ProjectGuid>
488
+ + <ProjectName>SparkOPSQLite</ProjectName>
489
+ + <Keyword>Win32Proj</Keyword>
490
+ + <RootNamespace>SparkOPSQLite</RootNamespace>
491
+ + <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
492
+ + <DefaultLanguage>en-US</DefaultLanguage>
493
+ + <MinimumVisualStudioVersion>17.0</MinimumVisualStudioVersion>
494
+ + <AppxPackage>false</AppxPackage>
495
+ + </PropertyGroup>
496
+ + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
497
+ + <PropertyGroup Label="ReactNativeWindowsProps">
498
+ + <ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
499
+ + <RunAutolinkCheck>false</RunAutolinkCheck>
500
+ + </PropertyGroup>
501
+ + <Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.WindowsSdk.Default.props" />
502
+ + <ItemGroup Label="ProjectConfigurations">
503
+ + <ProjectConfiguration Include="Debug|Win32">
504
+ + <Configuration>Debug</Configuration>
505
+ + <Platform>Win32</Platform>
506
+ + </ProjectConfiguration>
507
+ + <ProjectConfiguration Include="Release|Win32">
508
+ + <Configuration>Release</Configuration>
509
+ + <Platform>Win32</Platform>
510
+ + </ProjectConfiguration>
511
+ + <ProjectConfiguration Include="Debug|x64">
512
+ + <Configuration>Debug</Configuration>
513
+ + <Platform>x64</Platform>
514
+ + </ProjectConfiguration>
515
+ + <ProjectConfiguration Include="Release|x64">
516
+ + <Configuration>Release</Configuration>
517
+ + <Platform>x64</Platform>
518
+ + </ProjectConfiguration>
519
+ + <ProjectConfiguration Include="Debug|ARM64">
520
+ + <Configuration>Debug</Configuration>
521
+ + <Platform>ARM64</Platform>
522
+ + </ProjectConfiguration>
523
+ + <ProjectConfiguration Include="Release|ARM64">
524
+ + <Configuration>Release</Configuration>
525
+ + <Platform>ARM64</Platform>
526
+ + </ProjectConfiguration>
527
+ + </ItemGroup>
528
+ + <PropertyGroup Label="Configuration">
529
+ + <ConfigurationType>DynamicLibrary</ConfigurationType>
530
+ + <CharacterSet>Unicode</CharacterSet>
531
+ + <PlatformToolset>v145</PlatformToolset>
532
+ + <GenerateManifest>false</GenerateManifest>
533
+ + </PropertyGroup>
534
+ + <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
535
+ + <UseDebugLibraries>true</UseDebugLibraries>
536
+ + </PropertyGroup>
537
+ + <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
538
+ + <UseDebugLibraries>false</UseDebugLibraries>
539
+ + <WholeProgramOptimization>true</WholeProgramOptimization>
540
+ + </PropertyGroup>
541
+ + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
542
+ + <ImportGroup Label="ExtensionSettings">
543
+ + </ImportGroup>
544
+ + <ImportGroup Label="PropertySheets">
545
+ + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
546
+ + </ImportGroup>
547
+ + <ImportGroup Label="ReactNativeWindowsPropertySheets">
548
+ + <Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.CppLib.props" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.CppLib.props')" />
549
+ + </ImportGroup>
550
+ + <ItemDefinitionGroup>
551
+ + <ClCompile>
552
+ + <PrecompiledHeader>Use</PrecompiledHeader>
553
+ + <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
554
+ + <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
555
+ + <WarningLevel>Level4</WarningLevel>
556
+ + <SDLCheck>true</SDLCheck>
557
+ + <LanguageStandard>stdcpp20</LanguageStandard>
558
+ + <AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
559
+ + <DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
560
+ + <PreprocessorDefinitions>_WINRT_DLL;NOMINMAX;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_WARNINGS;SQLITE_THREADSAFE=1;SQLITE_ENABLE_FTS5;SQLITE_ENABLE_RTREE;SQLITE_ENABLE_COLUMN_METADATA;%(PreprocessorDefinitions)</PreprocessorDefinitions>
561
+ + <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
562
+ + <AdditionalIncludeDirectories>
563
+ + $(MSBuildThisFileDirectory);$(MSBuildThisFileDirectory)..\..\cpp\;
564
+ + %(AdditionalIncludeDirectories)
565
+ + </AdditionalIncludeDirectories>
566
+ + </ClCompile>
567
+ + <Link>
568
+ + <AdditionalDependencies>shell32.lib;user32.lib;windowsapp.lib;%(AdditionalDependencies)</AdditionalDependencies>
569
+ + <SubSystem>Console</SubSystem>
570
+ + <GenerateWindowsMetadata>true</GenerateWindowsMetadata>
571
+ + <ModuleDefinitionFile>SparkOPSQLite.def</ModuleDefinitionFile>
572
+ + </Link>
573
+ + </ItemDefinitionGroup>
574
+ + <ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
575
+ + <ClCompile>
576
+ + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
577
+ + </ClCompile>
578
+ + </ItemDefinitionGroup>
579
+ + <ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
580
+ + <ClCompile>
581
+ + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
582
+ + </ClCompile>
583
+ + </ItemDefinitionGroup>
584
+ + <PropertyGroup Label="UserMacros" />
585
+ + <ItemGroup>
586
+ + <ClInclude Include="SparkOPSQLite.h" />
587
+ + <ClInclude Include="ReactPackageProvider.h">
588
+ + <DependentUpon>ReactPackageProvider.idl</DependentUpon>
589
+ + </ClInclude>
590
+ + <ClInclude Include="resource.h" />
591
+ + <ClInclude Include="pch.h" />
592
+ + <ClInclude Include="targetver.h" />
593
+ + </ItemGroup>
594
+ + <ItemGroup>
595
+ + <ClCompile Include="SparkOPSQLite.cpp" />
596
+ + <ClCompile Include="pch.cpp">
597
+ + <PrecompiledHeader>Create</PrecompiledHeader>
598
+ + </ClCompile>
599
+ + <ClCompile Include="ReactPackageProvider.cpp">
600
+ + <DependentUpon>ReactPackageProvider.idl</DependentUpon>
601
+ + </ClCompile>
602
+ + <ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
603
+ + </ItemGroup>
604
+ + <ItemGroup>
605
+ + <Midl Include="ReactPackageProvider.idl" />
606
+ + </ItemGroup>
607
+ + <ItemGroup>
608
+ + <ResourceCompile Include="SparkOPSQLite.rc" />
609
+ + </ItemGroup>
610
+ + <ItemGroup>
611
+ +<ClCompile Include="$(MSBuildThisFileDirectory)..\..\cpp\*.cpp"><PrecompiledHeader>NotUsing</PrecompiledHeader></ClCompile>
612
+ +<ClCompile Include="$(MSBuildThisFileDirectory)..\..\cpp\sqlite3.c"><PrecompiledHeader>NotUsing</PrecompiledHeader><CompileAs>CompileAsC</CompileAs></ClCompile>
613
+ +</ItemGroup>
614
+ +<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
615
+ + <ImportGroup Label="ReactNativeWindowsTargets">
616
+ + <Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.CppLib.targets" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.CppLib.targets')" />
617
+ + </ImportGroup>
618
+ + <ItemGroup>
619
+ + </ItemGroup>
620
+ + <Target Name="EnsureReactNativeWindowsTargets" BeforeTargets="PrepareForBuild">
621
+ + <PropertyGroup>
622
+ + <ErrorText>This project references targets in your node_modules\react-native-windows folder. The missing file is {0}.</ErrorText>
623
+ + </PropertyGroup>
624
+ + <Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.CppLib.props')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.CppLib.props'))" />
625
+ + <Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.CppLib.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.CppLib.targets'))" />
626
+ + </Target>
627
+ +</Project>
628
+
629
+ diff --git a/windows/SparkOPSQLite/SparkOPSQLite.vcxproj.filters b/windows/SparkOPSQLite/SparkOPSQLite.vcxproj.filters
630
+ new file mode 100644
631
+ index 0000000..c99c53c
632
+ --- /dev/null
633
+ +++ b/windows/SparkOPSQLite/SparkOPSQLite.vcxproj.filters
634
+ @@ -0,0 +1,44 @@
635
+ +<?xml version="1.0" encoding="utf-8"?>
636
+ +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
637
+ + <ItemGroup>
638
+ + <Filter Include="Source Files">
639
+ + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
640
+ + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
641
+ + </Filter>
642
+ + <Filter Include="Header Files">
643
+ + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
644
+ + <Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
645
+ + </Filter>
646
+ + <Filter Include="Resource Files">
647
+ + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
648
+ + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
649
+ + </Filter>
650
+ + </ItemGroup>
651
+ + <ItemGroup>
652
+ + <ClInclude Include="targetver.h">
653
+ + <Filter>Header Files</Filter>
654
+ + </ClInclude>
655
+ + <ClInclude Include="resource.h">
656
+ + <Filter>Header Files</Filter>
657
+ + </ClInclude>
658
+ + <ClInclude Include="SparkOPSQLite.h">
659
+ + <Filter>Header Files</Filter>
660
+ + </ClInclude>
661
+ + <ClInclude Include="pch.h">
662
+ + <Filter>Header Files</Filter>
663
+ + </ClInclude>
664
+ + </ItemGroup>
665
+ + <ItemGroup>
666
+ + <ClCompile Include="SparkOPSQLite.cpp">
667
+ + <Filter>Source Files</Filter>
668
+ + </ClCompile>
669
+ + <ClCompile Include="pch.cpp">
670
+ + <Filter>Source Files</Filter>
671
+ + </ClCompile>
672
+ + </ItemGroup>
673
+ + <ItemGroup>
674
+ + <ResourceCompile Include="SparkOPSQLite.rc">
675
+ + <Filter>Resource Files</Filter>
676
+ + </ResourceCompile>
677
+ + </ItemGroup>
678
+ +</Project>
679
+
680
+ diff --git a/windows/SparkOPSQLite/pch.cpp b/windows/SparkOPSQLite/pch.cpp
681
+ new file mode 100644
682
+ index 0000000..1d9f38c
683
+ --- /dev/null
684
+ +++ b/windows/SparkOPSQLite/pch.cpp
685
+ @@ -0,0 +1 @@
686
+ +#include "pch.h"
687
+ diff --git a/windows/SparkOPSQLite/pch.h b/windows/SparkOPSQLite/pch.h
688
+ new file mode 100644
689
+ index 0000000..61d356d
690
+ --- /dev/null
691
+ +++ b/windows/SparkOPSQLite/pch.h
692
+ @@ -0,0 +1,30 @@
693
+ +// pch.h : include file for standard system include files,
694
+ +// or project specific include files that are used frequently, but
695
+ +// are changed infrequently
696
+ +//
697
+ +
698
+ +#pragma once
699
+ +
700
+ +#include "targetver.h"
701
+ +
702
+ +#define NOMINMAX 1
703
+ +#define WIN32_LEAN_AND_MEAN 1
704
+ +#define WINRT_LEAN_AND_MEAN 1
705
+ +
706
+ +// Windows Header Files
707
+ +#include <windows.h>
708
+ +#undef GetCurrentTime
709
+ +#include <unknwn.h>
710
+ +
711
+ +// WinRT Header Files
712
+ +#include <winrt/base.h>
713
+ +#include <CppWinRTIncludes.h>
714
+ +#include <winrt/Microsoft.ReactNative.h>
715
+ +
716
+ +// C RunTime Header Files
717
+ +#include <malloc.h>
718
+ +#include <memory.h>
719
+ +#include <stdlib.h>
720
+ +#include <tchar.h>
721
+ +
722
+ +// Reference additional headers your project requires here
723
+ diff --git a/windows/SparkOPSQLite/resource.h b/windows/SparkOPSQLite/resource.h
724
+ new file mode 100644
725
+ index 0000000..bb510d6
726
+ --- /dev/null
727
+ +++ b/windows/SparkOPSQLite/resource.h
728
+ @@ -0,0 +1,5 @@
729
+ +//
730
+ +// Microsoft Visual C++ generated include file.
731
+ +// Used by SparkOPSQLite.rc
732
+ +
733
+ +#pragma once
734
+ diff --git a/windows/SparkOPSQLite/targetver.h b/windows/SparkOPSQLite/targetver.h
735
+ new file mode 100644
736
+ index 0000000..87c0086
737
+ --- /dev/null
738
+ +++ b/windows/SparkOPSQLite/targetver.h
739
+ @@ -0,0 +1,8 @@
740
+ +#pragma once
741
+ +
742
+ +// Including SDKDDKVer.h defines the highest available Windows platform.
743
+ +
744
+ +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
745
+ +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
746
+ +
747
+ +#include <SDKDDKVer.h>
748
+ diff --git a/windows/SparkOPSQLite.sln b/windows/SparkOPSQLite.sln
749
+ new file mode 100644
750
+ index 0000000..3839806
751
+ --- /dev/null
752
+ +++ b/windows/SparkOPSQLite.sln
753
+ @@ -0,0 +1,43 @@
754
+ +
755
+ +Microsoft Visual Studio Solution File, Format Version 12.00
756
+ +# Visual Studio Version 17
757
+ +VisualStudioVersion = 17.3.32929.385
758
+ +MinimumVisualStudioVersion = 10.0.40219.1
759
+ +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SparkOPSQLite", "SparkOPSQLite\SparkOPSQLite.vcxproj", "{96CE5E20-C675-425D-B566-7D0C8263959F}"
760
+ +EndProject
761
+ +Global
762
+ + GlobalSection(SolutionConfigurationPlatforms) = preSolution
763
+ + Debug|x64 = Debug|x64
764
+ + Debug|x86 = Debug|x86
765
+ + Debug|ARM64 = Debug|ARM64
766
+ + Release|x64 = Release|x64
767
+ + Release|x86 = Release|x86
768
+ + Release|ARM64 = Release|ARM64
769
+ + EndGlobalSection
770
+ + GlobalSection(ProjectConfigurationPlatforms) = postSolution
771
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Debug|x64.ActiveCfg = Debug|x64
772
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Debug|x64.Build.0 = Debug|x64
773
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Debug|x64.Deploy.0 = Debug|x64
774
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Debug|x86.ActiveCfg = Debug|Win32
775
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Debug|x86.Build.0 = Debug|Win32
776
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Debug|x86.Deploy.0 = Debug|Win32
777
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Debug|ARM64.ActiveCfg = Debug|ARM64
778
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Debug|ARM64.Build.0 = Debug|ARM64
779
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Debug|ARM64.Deploy.0 = Debug|ARM64
780
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Release|x64.ActiveCfg = Release|x64
781
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Release|x64.Build.0 = Release|x64
782
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Release|x64.Deploy.0 = Release|x64
783
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Release|x86.ActiveCfg = Release|Win32
784
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Release|x86.Build.0 = Release|Win32
785
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Release|x86.Deploy.0 = Release|Win32
786
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Release|ARM64.ActiveCfg = Release|ARM64
787
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Release|ARM64.Build.0 = Release|ARM64
788
+ + {96CE5E20-C675-425D-B566-7D0C8263959F}.Release|ARM64.Deploy.0 = Release|ARM64
789
+ + EndGlobalSection
790
+ + GlobalSection(SolutionProperties) = preSolution
791
+ + HideSolutionNode = FALSE
792
+ + EndGlobalSection
793
+ + GlobalSection(ExtensibilityGlobals) = postSolution
794
+ + SolutionGuid = {D43FAD39-F619-437D-BB40-04A3982ACB6A}
795
+ + EndGlobalSection
796
+ +EndGlobal