feat(serve): serve on orcad by default on Windows too (#25162)

D7 now runs every case on Windows (orcad-serve-mode-switch-windows), including Electron
serve adopting a daemon orcad forked, so Windows no longer needs the Electron default.

Co-authored-by: m4air <m4air@Mac.localdomain>
This commit is contained in:
OrcaWin
2026-10-04 03:17:55 -07:00
committed by GitHub
co-authored by m4air
parent 04d3e20358
commit 7eeb2568d7
5 changed files with 11 additions and 27 deletions
+3 -3
View File
@@ -78,9 +78,9 @@ no template in the install, the pinned Node could not be fetched, or a failed na
the default, and any other value falls back with a reason.
- Packaged macOS stays on Electron: only Electron serve, supervised by the CLI, can take a remote
app update there, and orcad has no updater. Recipe-JSON serve has no handoff and uses orcad.
- Windows defaults to Electron serve for now; `ORCA_SERVE_RUNTIME=orcad` opts in. Both hosts share
`<userData>\daemon` and so one daemon pipe. The `orcad-serve-mode-switch-windows` e2e job gates D7
on Windows.
- Windows serves on orcad too. Both hosts share `<userData>\daemon`, so the daemon pipe name
(hashed from that path) is the same, and the relocated Electron daemon host changes only the
executable, not the pipe. The `orcad-serve-mode-switch-windows` e2e job gates D7 there.
The slot and its pinned Node live under the desktop's `<userData>/orcad-artifacts`.
+1 -1
View File
@@ -167,7 +167,7 @@ orca-ide serve --port 6768 --pairing-address 100.64.1.20
Use only one host mode at a time. If the Orca desktop app is already sharing that computer, do not start a second `orca serve` process for the same setup.
`orca serve` runs on Orca's own Node server (orcad) by default. If orcad can't serve on this computer, it uses the desktop app's server instead and prints one line saying why. On Windows it uses the desktop app's server unless you set `ORCA_SERVE_RUNTIME=orcad`, and on a packaged macOS app it currently always does, so paired clients can still update it. To always use the desktop app's server, set `ORCA_SERVE_RUNTIME=electron`.
`orca serve` runs on Orca's own Node server (orcad) by default. If orcad can't serve on this computer, it uses the desktop app's server instead and prints one line saying why. On a packaged macOS app it currently always uses the desktop app's server, so paired clients can still update it. To always use the desktop app's server, set `ORCA_SERVE_RUNTIME=electron`.
### Mobile from a headless server
@@ -62,17 +62,14 @@ describe('orca serve runtime selection', () => {
expect(options.materializeSlot).not.toHaveBeenCalled()
})
it('serves on orcad by default and when orcad is asked for by name', async () => {
it('serves on orcad by default and when orcad is asked for by name, Windows included', async () => {
for (const env of [{}, { [SERVE_RUNTIME_ENV]: 'orcad' }]) {
expect(await selectServeRuntime(input({ env }))).toMatchObject({ kind: 'orcad' })
for (const platform of ['linux', 'win32'] as const) {
expect(await selectServeRuntime(input({ env, platform }))).toMatchObject({ kind: 'orcad' })
}
}
})
it('serves on orcad on Windows only when orcad is asked for by name', async () => {
const options = input({ env: { [SERVE_RUNTIME_ENV]: 'orcad' }, platform: 'win32' })
expect(await selectServeRuntime(options)).toMatchObject({ kind: 'orcad' })
})
it('runs the local slot on its pinned Node, linked into userData beside it', async () => {
const options = input()
const selection = await selectServeRuntime(options)
@@ -98,7 +95,6 @@ describe('orca serve runtime selection', () => {
{ env: { [SERVE_RUNTIME_ENV]: 'bun' } },
'ORCA_SERVE_RUNTIME=bun is neither orcad nor electron'
],
['Windows by default', { platform: 'win32' as const }, 'not the default on Windows yet'],
['packaged macOS', { usesMacUpdateHandoff: true }, 'so paired clients can still update it'],
['an unsupported host', { hostTarget: () => 'linux-riscv64-glibc' }, 'no orcad build exists'],
['an install without the template', { templateDirs: [] }, 'carries no orcad template'],
@@ -61,12 +61,6 @@ export async function selectServeRuntime(
if (requested && requested !== 'orcad') {
return electron(`${SERVE_RUNTIME_ENV}=${requested} is neither orcad nor electron`)
}
// Why: Windows stays on Electron by default until orcad serve is flipped on there separately.
if (!requested && input.platform === 'win32') {
return electron(
'local orcad serve is not the default on Windows yet; set ORCA_SERVE_RUNTIME=orcad to opt in'
)
}
// Why: only packaged macOS serve can take a remote app update, through Electron's updater
// and this CLI's supervisor; orcad has no updater, so switching would drop that.
if (input.usesMacUpdateHandoff) {
+3 -9
View File
@@ -272,15 +272,9 @@ test('`orca serve` runs on orcad by default and on Electron with ORCA_SERVE_RUNT
try {
const byDefault = await startCliServe(profile)
try {
// Windows still defaults to Electron serve; orcad is opt-in there.
if (process.platform === 'win32') {
expect(byDefault.stderr()).toContain('not the default on Windows yet')
expect(byDefault.readiness.health).toBeUndefined()
} else {
expect(byDefault.stderr()).toContain('[serve] running on orcad')
expect(byDefault.readiness.health).toBeDefined()
expect(profileLockRole(profile.userDataDir)).toBe('orcad')
}
expect(byDefault.stderr()).toContain('[serve] running on orcad')
expect(byDefault.readiness.health).toBeDefined()
expect(profileLockRole(profile.userDataDir)).toBe('orcad')
} finally {
await byDefault.stop()
}