paranext / paranext-core

Electron client, extension host, and C# library for Paranext
https://paranext.github.io/paranext-core/
MIT License
16 stars 2 forks source link

Get SQLite (native modules) working in extensions #1028

Closed tjcouch-sil closed 2 weeks ago

tjcouch-sil commented 1 month ago

User Story As an extension developer, I want to be able to run native modules from Node so that I can develop complex software with superpowers.

Description Biblica wants to bring an alignment tool into P.B. They are using SQLite. We need to support native modules like SQLite in some way to get this working. We need to do some digging.

tjcouch-sil commented 1 month ago

sqlite3 - npm [node.js] How to use native modules in NW.js | Using Sqlite3 | Ryusei.IO node.js - How to use sqlite3 module with electron? - Stack Overflow node.js - Electron crashes when requiring sqlite3 native module in forked process - Stack Overflow electron/rebuild: Package to rebuild native Node.js modules against the currently installed Electron version electron/forge: :electron: A complete tool for building and publishing Electron applications Native Node Modules | Electron

tjcouch-sil commented 1 month ago

Investigate for 1-3 days and figure out how much it will take to do this. Make a plan for making this work.

lyonsil commented 1 month ago

A few high-level thoughts:

tjcouch-sil commented 1 month ago

Potentially investigate how VS Code handles native deps or LSP processes or whatever regarding cross-platform builds

lyonsil commented 2 weeks ago

Some examples of VSCode extensions I looked into:

lyonsil commented 2 weeks ago

The PR that is posted allows extensions to start other processes using the createProcess elevated privilege in manifest.json. If someone builds executables and packages them in the extension ZIP file, then they can start processes using those binaries. The elevated privilege details include what operating system you're running on so you can start the appropriate binary.