Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Changesets

Hunk uses [Changesets](https://github.com/changesets/changesets) for release-note fragments and npm version preparation.

For user-visible changes, add a changeset instead of editing `CHANGELOG.md` directly:

```bash
bun run changeset
```

Select `hunkdiff` and choose the semver bump that matches the shipped CLI/package change:

- `patch` for fixes and small behavior changes
- `minor` for new user-facing features
- `major` for breaking changes

`package.json` intentionally lists `"."` in `workspaces` so Changesets can discover the root `hunkdiff` package. Keep that entry unless Hunk moves the publishable package out of the repository root.

For maintenance-only PRs that should not appear in release notes, create an empty changeset:

```bash
bun run changeset -- --empty
```

Release prep runs:

```bash
bun run release:version
```

That consumes the pending `.changeset/*.md` files, updates `CHANGELOG.md`, and bumps package versions for the release commit.
5 changes: 5 additions & 0 deletions .changeset/chilly-diffs-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hunkdiff": patch
---

Adopt Changesets for release-note fragments so pull requests can avoid conflicting `CHANGELOG.md` edits.
16 changes: 16 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.4/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [
"@hunk/session-broker",
"@hunk/session-broker-bun",
"@hunk/session-broker-core",
"@hunk/session-broker-node"
]
}
19 changes: 19 additions & 0 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ jobs:
HEAD_SHA: ${{ github.sha }}
run: .github/scripts/detect-code-changes.sh "$BASE_SHA" "$HEAD_SHA"

changeset-status:
name: Release-note changeset
needs: changes
if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Set up Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.10

- name: Verify release-note changeset
run: bun run changeset:status -- --since=origin/main

windows-compat:
name: Windows compatibility
needs: changes
Expand Down
11 changes: 4 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,10 @@ CLI input

## releases

- Maintain the top-level `CHANGELOG.md` as the source of truth for user-visible changes.
- Keep upcoming work under `## [Unreleased]` with these subsections:
- `### Added`
- `### Changed`
- `### Fixed`
- Append to existing subsections instead of creating duplicates.
- When cutting a release, move the relevant unreleased entries into a new immutable version section and start a fresh `## [Unreleased]` section.
- Use Changesets for user-visible release notes. Add a `.changeset/*.md` entry with `bun run changeset` instead of editing `CHANGELOG.md` directly.
- Target the public `hunkdiff` package in changesets. Use `patch` for fixes and small behavior changes, `minor` for new user-facing features, and `major` for breaking changes.
- For maintenance-only PRs that should not appear in release notes, add an empty changeset with `bun run changeset -- --empty`.
- Keep the top-level `CHANGELOG.md` as the released changelog artifact. It is updated during release prep with `bun run release:version`, not by normal feature/fix PRs.
- Use the released changelog section as the starting point for the GitHub release body.
- GitHub releases should follow this format:

Expand Down
10 changes: 0 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# Changelog

All notable user-visible changes to Hunk are documented in this file.

## [Unreleased]

### Added

### Changed

### Fixed

## [0.15.3] - 2026-06-13

### Added
Expand Down
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,19 @@ Key rules:

- The npm package name is `hunkdiff`.
- The installed CLI command remains `hunk`.
- Add a Changeset for user-visible changes instead of editing `CHANGELOG.md` directly:

```bash
bun run changeset
```

Select `hunkdiff`, then choose `patch` for fixes and small behavior changes, `minor` for new user-facing features, or `major` for breaking changes.

- For maintenance-only PRs that should not appear in release notes, add an empty changeset:

```bash
bun run changeset -- --empty
```

- Release prep runs `bun run release:version` to consume pending changesets, update `CHANGELOG.md`, and bump package versions.
- The automated prebuilt publish workflow lives in `.github/workflows/release-prebuilt-npm.yml`.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"hunkdiff": "./bin/hunk.cjs"
},
"workspaces": [
".",
"packages/*"
],
Comment on lines 26 to 29

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Root package listed as explicit workspace member

Adding "." to workspaces is the correct way to make hunkdiff discoverable by changesets when the publishable package lives at the repo root. However, this is a non-standard entry — bun's workspace resolution must handle the root being listed both as the workspace host and as a member. If a future bun install or bun update run produces unexpected peer-resolution loops or lock-file churn, this is the first place to investigate.

Prompt To Fix With AI
This is a comment left during a code review.
Path: package.json
Line: 26-29

Comment:
**Root package listed as explicit workspace member**

Adding `"."` to `workspaces` is the correct way to make `hunkdiff` discoverable by changesets when the publishable package lives at the repo root. However, this is a non-standard entry — bun's workspace resolution must handle the root being listed both as the workspace host and as a member. If a future `bun install` or `bun update` run produces unexpected peer-resolution loops or lock-file churn, this is the first place to investigate.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept the root workspace entry because Changesets needs it to discover the publishable root hunkdiff package, and added a note in .changeset/README.md documenting that it is intentional.

This comment was generated by Pi using OpenAI GPT-5

"files": [
Expand Down Expand Up @@ -58,6 +59,9 @@
"format:check": "oxfmt --check .",
"lint": "oxlint . --deny-warnings",
"lint:fix": "oxlint . --fix",
"changeset": "bunx @changesets/cli@2.31.0",
"changeset:status": "bunx @changesets/cli@2.31.0 status",
"release:version": "bunx @changesets/cli@2.31.0 version",
"prepare": "simple-git-hooks",
"test": "\"${npm_execpath:-bun}\" test ./src ./packages ./scripts ./test/cli ./test/session",
"test:integration": "\"${npm_execpath:-bun}\" test ./test/pty",
Expand Down
Loading