build(cli): port postbuild hook to TypeScript for Windows - #1433
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe postbuild step now uses a Bun-executable TypeScript script instead of a shell script. The script prepends a Node.js shebang to Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/postbuild.ts`:
- Around line 11-15: Update the postbuild logic around the bundle read and write
operations to detect whether the existing bundle already begins with the Node
hashbang before prepending it. Only add the hashbang when absent, while
preserving the current output for bundles without one.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5472833c-8681-4c3f-8d1c-ec9bfa13f01a
📒 Files selected for processing (4)
.github/workflows/ci.ymlpackage.jsonscripts/postbuild.shscripts/postbuild.ts
💤 Files with no reviewable changes (1)
- scripts/postbuild.sh
Note
PR body AI drafted & edited as needed
Overview of Changes
The Windows release job fails at each release after v1.0.1. The log shows this error:
On Linux and macOS, bun runs package scripts in a system shell. The system shell can start
.shfiles. On Windows, bun runs package scripts in Bun Shell. Bun Shell cannot start.shfiles. Thepostbuildhook is a.shfile. The hook fails, and the build stops.Changes:
scripts/postbuild.tsreplacesscripts/postbuild.sh. The new script does the same two steps. It adds the shebang line todist/cli.js. It sets the executable bit. It uses onlynode:fs, so it runs on all platforms.ci.yml: thewindows-smokejob now runsbun run build, notbun run build:bundle. The postbuild hook now runs on a Windows runner in CI. This prevents this failure in the future.This PR has no changeset. The published package does not change. See the proof below.
Testing
293e85aa…). The two file modes are the same (rwxr-xr-x). The Linux and macOS binaries do not change.Checklist
windows-smokeCI job now covers the postbuild hook)