packages/scenarios-stage-tamagotchi-electron/README.md
Own the Electron capture scenarios used to generate tamagotchi docs screenshots.
This package owns product-specific Electron scenario definitions only. It depends on @proj-airi/vishot-runner-electron for:
defineScenario() helperIt does not launch Electron itself and it does not own browser-scene composition or shared screenshot staging.
This package is step 1 of the docs screenshot pipeline.
@proj-airi/stage-tamagotchi.@proj-airi/vishot-runner-electron.packages/scenarios-stage-tamagotchi-browser/artifacts/raw.From repo root, run:
pnpm -F @proj-airi/stage-tamagotchi build
pnpm -F @proj-airi/vishot-runner-electron capture ../../packages/scenarios-stage-tamagotchi-electron/src/scenarios/demo-controls-settings-chat-websocket/index.ts --output-dir ../../packages/scenarios-stage-tamagotchi-browser/artifacts/raw --format avif
Expected result:
27 raw files in packages/scenarios-stage-tamagotchi-browser/artifacts/raw00-stage-tamagotchi.avif ... 26-devtools-vision-capture.avifimport { defineScenario } from '@proj-airi/vishot-runner-electron'
export default defineScenario({
id: 'settings-connection',
async run({ capture, stageWindows, controlsIsland, settingsWindow }) {
const mainWindow = await stageWindows.waitFor('main')
await controlsIsland.expand(mainWindow.page)
const settings = await controlsIsland.openSettings(mainWindow.page)
const page = await settingsWindow.goToConnection(settings.page)
await page.waitForTimeout(1000)
await page.getByText('WebSocket Server Address').waitFor({ state: 'visible' })
await capture('connection-settings', page)
},
})
The docs workflow is organized as one section-based scenario module under src/scenarios/demo-controls-settings-chat-websocket/. The top-level index.ts orchestrates section manifests.
Important:
--output-dir for the runner should point to packages/scenarios-stage-tamagotchi-browser/artifacts/raw.src/scenarios.index.ts when the workflow is organized as a section folder.pnpm -F examples are resolved from the filtered package working directory.When running scenarios through @proj-airi/vishot-runner-electron, the built Electron app can use a different userData profile than dev:tamagotchi.
dev:tamagotchi plugin root commonly resolves to:
~/Library/Application Support/@proj-airi/stage-tamagotchi/plugins/v1~/Library/Application Support/Electron/plugins/v1If the chess plugin appears in dev but not in Vishot (Discovered 0 or Plugin manifest not found), link the plugin dist directory into the Electron profile plugins root too:
mkdir -p "$HOME/Library/Application Support/Electron/plugins/v1"
ln -sfn "/absolute/path/to/airi-plugin-game-chess/dist" "$HOME/Library/Application Support/Electron/plugins/v1/airi-plugin-game-chess"