Consume generic EveElectron host
This commit is contained in:
parent
1218dbf655
commit
8975d7ebbb
7 changed files with 86 additions and 64 deletions
|
|
@ -1591,9 +1591,17 @@ function renderIpcChannelLines() {
|
|||
|
||||
function renderPreload() {
|
||||
const channelLines = renderIpcChannelLines();
|
||||
const eveProviderMethods = new Set([
|
||||
"eveSurface",
|
||||
"eveProviderAdvertisement",
|
||||
"eveDocument",
|
||||
"submitEveCommand",
|
||||
"windowControl",
|
||||
]);
|
||||
const apiLines = ipcChannels
|
||||
.filter(([name]) => name !== "viewportFeedUpdate" &&
|
||||
name !== "viewportFeedStop")
|
||||
name !== "viewportFeedStop" &&
|
||||
!eveProviderMethods.has(name))
|
||||
.map(([name]) => {
|
||||
if (name === "viewportFeed") {
|
||||
return ` watchViewportFeed: (request, callback) => {
|
||||
|
|
@ -1628,6 +1636,7 @@ function renderPreload() {
|
|||
// Generated by scripts/generate-rts-bindings.mjs from the RTS IPC surface contract.
|
||||
|
||||
const { contextBridge, ipcRenderer } = require("electron");
|
||||
const { installEveProviderBridge } = require("@gamecult/eve-electron/preload");
|
||||
|
||||
const channels = {
|
||||
${channelLines}
|
||||
|
|
@ -1636,5 +1645,17 @@ ${channelLines}
|
|||
contextBridge.exposeInMainWorld("aetheriaRts", {
|
||||
${apiLines}
|
||||
});
|
||||
|
||||
installEveProviderBridge({
|
||||
contextBridge,
|
||||
ipcRenderer,
|
||||
channels: {
|
||||
providerAdvertisement: channels.eveProviderAdvertisement,
|
||||
surface: channels.eveSurface,
|
||||
document: channels.eveDocument,
|
||||
submitCommand: channels.submitEveCommand,
|
||||
windowControl: channels.windowControl,
|
||||
},
|
||||
});
|
||||
`;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,11 @@ if (-not (Get-Content wwwroot\index.html -Raw).Contains('eve-surface-host')) {
|
|||
}
|
||||
|
||||
$appText = Get-Content wwwroot\app.js -Raw
|
||||
if (-not $appText.Contains('window.aetheriaRts.eveProviderAdvertisement') -or
|
||||
if (-not $appText.Contains('window.eveProvider.providerAdvertisement') -or
|
||||
-not $appText.Contains('EveBrowserProviderHost') -or
|
||||
-not $appText.Contains('window.aetheriaRts.eveDocument') -or
|
||||
-not $appText.Contains('window.eveProvider.document') -or
|
||||
$appText.Contains('window.aetheriaRts.eveProviderAdvertisement') -or
|
||||
$appText.Contains('window.aetheriaRts.eveDocument') -or
|
||||
$appText.Contains('eve:surface:aetheria.daemon.game') -or
|
||||
$appText.Contains('gamecult.aetheria.gravity_viewport.v1') -or
|
||||
$appText.Contains('gamecult.aetheria.render_splats_viewport.v1') -or
|
||||
|
|
@ -34,7 +36,7 @@ $mainText = Get-Content Electron\main.ts -Raw
|
|||
if (-not $mainText.Contains('await api.surfaceCatalog()') -or -not $mainText.Contains('await api.surfaceCatalogIndex()')) {
|
||||
Write-Error "Stage 7C Electron RTS verifier failed: Electron smoke does not call the preload CultMesh surface catalog APIs."
|
||||
}
|
||||
if (-not $mainText.Contains('await api.eveProviderAdvertisement()')) {
|
||||
if (-not $mainText.Contains('await eveProvider.providerAdvertisement()')) {
|
||||
Write-Error "Stage 7C Electron RTS verifier failed: Electron smoke does not verify provider advertisement discovery through preload."
|
||||
}
|
||||
|
||||
|
|
@ -45,7 +47,7 @@ if (-not $mainText.Contains('await api.renderSplatsViewport') -or
|
|||
Write-Error "Stage 7C Electron RTS verifier failed: Electron smoke does not verify daemon Eve field document lowering."
|
||||
}
|
||||
|
||||
if (-not $mainText.Contains('await api.submitEveCommand') -or
|
||||
if (-not $mainText.Contains('await eveProvider.submitCommand') -or
|
||||
-not $mainText.Contains('eveReceipt?.commandId') -or
|
||||
-not $mainText.Contains('eveReceipt?.accepted') -or
|
||||
-not $mainText.Contains('eveReceipt?.route')) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue