Add hunk package#202
Conversation
Package the hunk diff viewer from modem-dev/hunk, built from source with bun and exposing both the hunk and hunkdiff binaries. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR adds the ChangesHunk Package Build
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 `@packages/hunk/build.sh`:
- Around line 4-10: The build script (build.sh) fails to navigate into the
extracted source directory before running bun commands; update build.sh to cd
into the extracted directory using the provided version variable (e.g., cd
"hunk-$MINIMAL_ARG_VERSION") before running bun install and bun build so that
./src/main.tsx exists; ensure the cd occurs before the BUN_TMPDIR/BUN_INSTALL
exports or at least before bun install/build and preserve existing
temporary-directory setup and build commands in the same script.
🪄 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: CHILL
Plan: Pro
Run ID: 2d8682d5-a567-4afa-8023-60a6cb79f907
📒 Files selected for processing (2)
packages/hunk/build.nclpackages/hunk/build.sh
| mkdir -p .bun-tmp .bun-install | ||
| export BUN_TMPDIR="$PWD/.bun-tmp" | ||
| export BUN_INSTALL="$PWD/.bun-install" | ||
|
|
||
| bun install --frozen-lockfile --ignore-scripts | ||
|
|
||
| bun build --compile ./src/main.tsx --outfile hunk |
There was a problem hiding this comment.
Missing navigation to extracted source directory.
The build script does not navigate into the extracted source directory before running build commands. The Source dependency in build.ncl extracts the tarball with strip_prefix = "hunk-%{version}", creating a hunk-0.14.0 directory. However, line 10 references ./src/main.tsx which will not exist in the build root—it exists inside the extracted directory.
🐛 Proposed fix to navigate to extracted source
+cd hunk-$MINIMAL_ARG_VERSION
+
mkdir -p .bun-tmp .bun-install
export BUN_TMPDIR="$PWD/.bun-tmp"
export BUN_INSTALL="$PWD/.bun-install"As per coding guidelines: "Use 'cd' to navigate to the extracted source directory and reference the version variable via '$MINIMAL_ARG_VERSION' environment variable in build.sh".
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| mkdir -p .bun-tmp .bun-install | |
| export BUN_TMPDIR="$PWD/.bun-tmp" | |
| export BUN_INSTALL="$PWD/.bun-install" | |
| bun install --frozen-lockfile --ignore-scripts | |
| bun build --compile ./src/main.tsx --outfile hunk | |
| cd hunk-$MINIMAL_ARG_VERSION | |
| mkdir -p .bun-tmp .bun-install | |
| export BUN_TMPDIR="$PWD/.bun-tmp" | |
| export BUN_INSTALL="$PWD/.bun-install" | |
| bun install --frozen-lockfile --ignore-scripts | |
| bun build --compile ./src/main.tsx --outfile hunk |
🤖 Prompt for 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.
In `@packages/hunk/build.sh` around lines 4 - 10, The build script (build.sh)
fails to navigate into the extracted source directory before running bun
commands; update build.sh to cd into the extracted directory using the provided
version variable (e.g., cd "hunk-$MINIMAL_ARG_VERSION") before running bun
install and bun build so that ./src/main.tsx exists; ensure the cd occurs before
the BUN_TMPDIR/BUN_INSTALL exports or at least before bun install/build and
preserve existing temporary-directory setup and build commands in the same
script.
|
/build |
No-op commit to re-trigger builtbot after build-servers GitHub app update. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Jake King seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Summary
Packages hunk, a terminal diff viewer, so it's
available in the registry. Built from source with the
buntoolchain rather thanshipping the prebuilt release binary, giving us a real supply-chain guarantee and the
ability to tweak build flags. The package exposes both the
hunkandhunkdiffbinaries (the latter is a symlink to
hunk, matching upstream's launcher behavior).Related issues
Changes
hunkat upstream version 0.14.0.https://github.com/modem-dev/hunk/archive/refs/tags/v0.14.0.tar.gz(
sha256 = 8cb99e7366eddc82d1ccc754c9cdf4b55c64244929094e49571fad1b80ce759c).bun install --frozen-lockfile --ignore-scriptsthenbun build --compile ./src/main.tsxto produce a single binary; needsdns/internetto fetch JS dependencies during the build.
base,bun. Runtime deps:glibc,git.usr/bin/hunkand ausr/bin/hunkdiffsymlink to it.source_provenance→ GitHubmodem-dev/hunk;license_spdx = MIT.hunk --version.Checklist
employer's time). CLA Assistant will prompt me on this PR if I haven't already.
min checkpasses for the affected packages/harnesses.min patched-build <name>succeeds for any package I added or modified.source_provenancepoints to the canonical upstream and the source builds from source (not a prebuiltrelease binary) where the required toolchain is available.
sha256against the upstream archive.Notes for reviewers
needs.dns/needs.internet) forbun install.hunkdiffis shipped as a relative symlink tohunk; both names are declared asseparate
OutputBinglobs.Summary by CodeRabbit