Skip to content

refactor: extract bundled Git provider - #1001

Merged
benvinegar merged 1 commit into
refactor/package-first-phase-2-vcsfrom
refactor/package-first-phase-2-git
Sep 6, 2026
Merged

refactor: extract bundled Git provider#1001
benvinegar merged 1 commit into
refactor/package-first-phase-2-vcsfrom
refactor/package-first-phase-2-git

Conversation

@benvinegar

@benvinegar benvinegar commented Sep 6, 2026

Copy link
Copy Markdown
Member

Summary

  • move the bundled Git provider into private workspace packages/hunk-git (@hunk/git)
  • keep provider composition and Git fallback behavior owned by Hunk
  • preserve Git adapter operations, source loading, history, detection, and watch behavior
  • add isolated package and import-boundary checks

Validation

  • focused Git and architecture tests
  • typecheck, Knip, dependency boundaries
  • npm build and pack validation

This is PR 2 of 4 and is stacked on the shared VCS infrastructure PR.

This PR description was generated by Pi using GPT-5.6 Sol

@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
hunk-web Ignored Ignored Preview Sep 6, 2026 2:12pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extracts the bundled Git VCS provider from Hunk application source into the private @hunk/git workspace package while preserving static bundling and the public VCS adapter contract.

  • Moves the Git implementation and its colocated tests without changing provider behavior.
  • Rewires bundled registration and loader tests to consume @hunk/git.
  • Adds workspace, lockfile, TypeScript, Knip, dependency-boundary, and Nix configuration for the package.
  • Adds package-isolation and dependency-boundary tests.
  • Preserves the Git revision-validation protections on diff, show, stash, and revision-resolution paths.

Confidence Score: 5/5

The PR appears safe to merge; the extraction preserves runtime behavior, security guards, test discovery, and static package bundling.

No actionable failures remain after verifying package resolution, adapter registration, Git argument validation, test discovery, and architecture boundaries.

Important Files Changed

Filename Overview
packages/hunk-git/src/index.ts Relocates the Git adapter implementation unchanged behind the new private package entry point.
packages/hunk-git/src/commands.ts Relocates Git command construction and execution while preserving revision validation and making internal-only helpers module-private.
packages/hunk-git/package.json Defines the private, source-exported workspace package with @hunk/vcs as its sole declared dependency.
packages/hunk/src/extensions/default/vcs/index.ts Switches bundled Git registration to the extracted @hunk/git factory.
scripts/hunk-git-package.test.ts Verifies the package export boundary, workspace registration, dependency isolation, and Bun loading behavior.
scripts/source-boundaries.test.ts Extends architecture checks to enforce isolation of the extracted Git provider.
.dependency-cruiser.cjs Adds a package-level dependency rule limiting the Git provider to itself and the VCS contract package.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  H[Hunk application] --> R[Bundled VCS registry]
  R --> G[Private @hunk/git package]
  G --> V[Public @hunk/vcs contract and helpers]
  G --> C[Git command execution]
  C --> P[Patch and source results]
  P --> H
  B[Bun package and binary builds] -. statically bundle .-> G
Loading

Reviews (1): Last reviewed commit: "refactor: extract bundled Git provider" | Re-trigger Greptile

@benvinegar
benvinegar force-pushed the refactor/package-first-phase-2-git branch 2 times, most recently from d793ff6 to 1232e1f Compare September 6, 2026 13:56
@benvinegar
benvinegar force-pushed the refactor/package-first-phase-2-git branch from 1232e1f to 5c28422 Compare September 6, 2026 14:12
@benvinegar
benvinegar merged commit 0bd9b87 into main Sep 6, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant