feat: add native Windows statusline renderer#11
Conversation
…ateus #11 Closes #8. Before: cli/install.ts shelled out to `bun run build:reactions` at install time. Neither scripts/ nor server/ was in package.json#files, so the build always failed silently for npx users — every install fell back to the degraded reactions pool instead of the advertised 638-per-language set. After: - scripts/build-reactions.ts now writes the JSON to BOTH ~/.petsonality/reactions-pool.json (existing dev path, unchanged) AND dist/reactions-pool.json (new artifact, ships via package.json files = ["dist/", ...] which was already there) - cli/install.ts copies the prebuilt JSON from dist/ into ~/.petsonality/ instead of running the build. No bun runtime dependency at install time. Silent fallback only triggers if the artifact is genuinely missing (i.e. local dev without a fresh build). - npm pack --dry-run confirmed dist/reactions-pool.json (58KB) lands in the tarball. - Smoke-tested install: "Reactions pool installed (638/lang)" instead of the previous warn fallback. Also: credit @MestreY0d4-Uninter in CONTRIBUTORS.md for #11 (native PowerShell statusline, closed #4) — second contribution from him, much bigger scope than #5.
PR #11 (Mateus PowerShell) shipped pet-art.json with the OLD golden retriever frames because his branch baseline pre-dated PR #12 (Lwhieldon's redesign). Now that both are in main, regenerating build-art.ts brings pet-art.json in sync with the new front-facing Bonnie design — without this commit the PowerShell statusline would render dinosaur-era Golden while bash renders the new one.
|
merged into v0.4.4 — thank you. this is a substantively bigger PR than #5 and the architecture choices land well: the defensive PowerShell touches i specifically appreciated: shipped today. Lwhieldon (the original Windows bug reporter) and i will be the first to dogfood it on real Win11 — if anything surfaces we'll open follow-up issues, but the architecture you chose makes those easy to land incrementally. your second contribution = added you to CONTRIBUTORS.md with the full story. seriously, thank you. |
PRD lagged 1 patch version. Today's reality: - Header: 0.4.3 -> 0.4.4 - Phase 1 items 21-22 added: second external PR + Lwhieldon upgraded to contributor (PR #11 + #12); Issue #8 packaging fix (the silent fallback bug that affected every npx user since launch) - NEW G0 (high priority, top of "宣传 + 推广" section): multi-channel distribution architecture. Triggered by the npm registry outage we hit during v0.4.4 publish. Sets out the 3-channel target (npm + Claude Code Plugin + MCP Server Registry), the dist/-in-git decision, and the task list to land it before the next release cycle. - 教训 +3: install path can't depend on build tools (Issue #8); npm is a single point of failure for distribution; merge != regenerated, must rebuild after PR merge to keep generated files in sync - 决策记录: new 2026-04-29 second entry covering the multi-channel awakening + npm-as-SPOF realization - Footer: v3.8 -> v3.9
|
Thanks again for the thoughtful review and for shipping it so quickly. I’m glad the architecture landed well. If any Windows/statusline follow-up comes out of the Win11 dogfooding, feel free to tag me — I’d be happy to help with another narrow, incremental fix. |
Summary
pet-art.jsondata from the existing art source for the PowerShell rendererFixes #4.
Validation
bun test cli/statusline-config.test.ts cli/statusline-art.test.tsbun testbun run buildnpm pack --dry-rungit diff --check HEAD --pwsh -NoProfile -ExecutionPolicy Bypass -File statusline/pet-status.ps1rendered the pet from a realstatus.jsonschemaNote: I do not have a native Windows host in this environment. Windows PowerShell 5.1 compatibility is based on Microsoft docs for
ConvertFrom-Jsonandpowershell.exe -File; the native Windows path is implemented withpowershell.exe -NoProfile -ExecutionPolicy Bypass -File "..."and should exit quietly if runtime files are missing.