This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
yarn build # Production build (TypeScript + Rollup)
yarn watch # Development mode with auto-rebuild and plugin restart- Install dependencies:
yarn install - Create symlink for development testing:
ln -s /path/to/aws-monitor/com.phantas-weng.aws-monitor.sdPlugin ~/Library/Application\ Support/com.elgato.StreamDeck/Plugins/com.phantas-weng.aws-monitor.sdPlugin
- Run
yarn watchfor development with hot reload - Launch Stream Deck in debug mode to view plugin logs:
open -a "Elgato Stream Deck" --args -debug - Install plugin:
streamdeck install com.phantas-weng.aws-monitor.sdPlugin
This is a Stream Deck plugin for monitoring AWS CodePipeline deployments.
Tech Stack: TypeScript, Elgato Stream Deck SDK v1.0.0, AWS SDK, node-canvas, Rollup
Entry Point: src/plugin.ts - Registers actions and connects to Stream Deck
Action Pattern: Uses SingletonAction from Stream Deck SDK. Each action handles Stream Deck events (onWillAppear, onKeyDown, onKeyUp, onWillDisappear).
Main Action: src/actions/codepipeline.ts - CodePipelineMonitor
- Polls AWS CodePipeline every 60 seconds when pipeline is in progress
- Auto-stops polling when all stages succeed
- Uses HTML5 Canvas API to render dynamic button images
- Timer state is tracked per-button using Maps (
pressTimers,refreshTimers)
UI/Settings: com.phantas-weng.aws-monitor.sdPlugin/ui/codepipeline.html - Property inspector for configuring AWS credentials and pipeline settings
Build Output: Compiled JS goes to com.phantas-weng.aws-monitor.sdPlugin/bin/
canvaspackage is marked as external in Rollup (provided by Stream Deck runtime)- Timer cleanup in
onWillDisappearprevents memory leaks - Button interactions: short press refreshes status, double-click opens CloudWatch logs (if
logGroupNameconfigured), long-press (1.3s) opens AWS Console - Status symbols: ✔ (green=success), ✘ (red=failed), . (blue=in progress)
- Code comments are in Traditional Chinese (zh-TW)