Skip to content
Source
Sign inSign up
pingdotgg/t3code

refactor(server): device hosts own their device operations #21835

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/21835/headmerged by juliusmarminge View on GitHub

Showing 9 changed files with 41 additions and 0 deletions (loading 7).

x
0 of 9 viewed, 9 left
8 additions and 0 deletionsapps/server/src/device/DeviceActions.test.tsModified
View file
@@ -15,9 +15,17 @@
},
) => {
const calls: Call[] = [];
+ const unused = Effect.die("Device actions run host commands, never device operations");
const ready: DeviceHostReady = {
nodePath: process.execPath,
hub: { origin: "http://127.0.0.1:1" },
+ devices: {
+ list: unused,
+ boot: () => unused,
+ attach: () => unused,
+ shutdown: () => unused,
+ screenshot: () => unused,
+ },
helpers,
run: (command, args, options) => {
const call = { command, args, ...(options?.stdin ? { stdin: options.stdin } : {}) };
33 additions and 0 deletionsapps/server/src/device/DeviceHost.tsModified
View file
@@ -1,8 +1,11 @@
import type {
+ DeviceBootError,
DeviceHostId,
DeviceHostSummary,
+ DeviceOperationError,
DevicePlatform,
DevicePlatformAvailability,
+ DeviceSummary,