← Back to PRs

#23775: fix(build): stabilize Windows script execution and Telegram monitor typing

by ly85206559 open 2026-02-22 17:42 View on GitHub →
channel: telegram size: XS
## Summary - Use workspace-root pnpm -w exec for key package scripts to avoid Windows recursive exec lookup failures. - Fix AbortSignal narrowing in Telegram monitor webhook wait path to satisfy strict TypeScript checks. - Keep behavior unchanged while unblocking pnpm build on Windows. ## Test plan - [x] pnpm build no longer fails on missing sdown command due to recursive exec behavior. - [x] TypeScript error in src/telegram/monitor.ts (opts.abortSignal possibly undefined) is resolved. - [ ] Optional: run full CI checks. <!-- greptile_comment --> <h3>Greptile Summary</h3> Adds `pnpm -w exec` wrapper to key build/test/format commands in `package.json` to prevent Windows recursive executable lookup failures, and fixes TypeScript strict null check error in `src/telegram/monitor.ts` by storing `opts.abortSignal` in a local variable to enable proper type narrowing. - Modified 16 scripts in `package.json` (build, format, lint, test) to use `pnpm -w exec` prefix for commands like `tsdown`, `oxfmt`, `oxlint`, `tsc`, and `vitest` - Fixed TypeScript error in webhook wait path by extracting `opts.abortSignal` into a const `signal` variable, allowing TypeScript to narrow the type after the null check - No behavioral changes - all functionality remains identical <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - Both changes are low-risk bug fixes with no behavioral modifications. The `package.json` changes add explicit `pnpm -w exec` prefixes to ensure commands are found via pnpm's workspace resolution on Windows, avoiding recursive PATH lookups. The `monitor.ts` change is a standard TypeScript type narrowing fix that stores a possibly-undefined value in a const variable before accessing its properties, satisfying strict null checks. The existing test suite at line 398-415 covers the abort signal behavior and will verify correctness. - No files require special attention <sub>Last reviewed commit: b351219</sub> <!-- greptile_other_comments_section --> <sub>(5/5) You can turn off certain types of comments like style [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment -->

Most Similar PRs