Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

platform.bible extension poc #1003

Merged
merged 60 commits into from
Nov 14, 2024
Merged

platform.bible extension poc #1003

merged 60 commits into from
Nov 14, 2024

Conversation

hahn-kev
Copy link
Collaborator

@hahn-kev hahn-kev commented Aug 6, 2024

this adds FW Lite as a tab in platform.bible. It is hardcoded to open sena-3, and requies the local web server is running, at the moment platform.bible does not support extensions launching processes.

todo before merging in:

  • try to make the extension launch the backend
  • automate or document how to build an extension and how to develop the extension

Copy link

github-actions bot commented Aug 6, 2024

UI unit Tests

12 tests  ±0   12 ✅ ±0   0s ⏱️ ±0s
 4 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 18d878a. ± Comparison against base commit faba095.

♻️ This comment has been updated with latest results.

# Conflicts:
#	frontend/viewer/src/lib/utils/search-params.ts
@myieye
Copy link
Contributor

myieye commented Sep 20, 2024

I was under the hopeful impression that we could maybe include the .NET backend as part of the extension as well. But...I can't find any documentation in that direction 🙁

@megahirt
Copy link
Contributor

We need @tjcouch-sil to help us figure out what is possible and possibly influence what changes we may need in order to include Lexbox Local backend into a PT extension installation.

@hahn-kev
Copy link
Collaborator Author

hahn-kev commented Sep 22, 2024

TJ recently told me that they support extensions launching their own processes, so we're supported just fine.

@hahn-kev hahn-kev marked this pull request as draft September 23, 2024 08:17
@tjcouch-sil
Copy link

Unfortunately I don't believe we have a guide wiki page written about elevated privileges like launching processes yet, but here is a brief explanation:

You can add to your manifest's elevatedPrivileges array different strings from ElevatedPrivilegeNames to receive access to the corresponding members of the ElevatedPrivileges property elevatedPrivileges on your activation function's context, the first parameter of your extension main file activate function. So you would want to add "createProcess" to your manifest's elevatedPrivileges array, which would then give you access to context.elevatedPrivileges.createProcess (if you don't have access, it will be undefined). It has fork and spawn straight from node's child_process library. It also has osData, which informs you of some important things related to launching processes like which operating system you're on.

You can click around in these links to see the TSDocs for these different types in that website. They're also available in VS Code via Intellisense (it's the same information).

Do note we don't currently close processes extensions spawn in development because of some technical limitations with how we're handling some things, but we do close processes extensions spawn in production. You can decide for now how you want to manage this in development haha sorry :p

# Conflicts:
#	backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs
#	backend/FwLite/LocalWebApp/LocalWebAppServer.cs
#	frontend/viewer/src/FwDataProjectView.svelte
#	frontend/viewer/src/lib/search-bar/SearchBar.svelte
#	frontend/viewer/src/lib/services/service-provider-signalr.ts
#	frontend/viewer/src/lib/services/service-provider.ts
@hahn-kev
Copy link
Collaborator Author

hahn-kev commented Nov 6, 2024

I've got this mostly working, there's just the issue of how the client talks to the server, there's currently some stuff blocking clients from talking to servers outside of the API that they provide for extensions. I've got an open question to TJ in discord about it.

edit: the workaround is to modify platform.bible like this:
image

@hahn-kev hahn-kev marked this pull request as ready for review November 6, 2024 10:17
@hahn-kev hahn-kev requested review from rmunn and myieye and removed request for rmunn November 6, 2024 10:17
myieye
myieye previously approved these changes Nov 13, 2024
Copy link
Contributor

@myieye myieye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍
Made a few fixups and hopefully resolved the merge conflicts correctly

@hahn-kev hahn-kev merged commit 3656265 into develop Nov 14, 2024
17 checks passed
@hahn-kev hahn-kev deleted the feat/paranext-extension branch November 14, 2024 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build platform.bible extension
4 participants