Skip to content

build: rebuild committed build outputs only at release - #112

Merged
cesutherland merged 2 commits into
masterfrom
hsd/issue-111
Oct 30, 2026
Merged

cesutherland merged 2 commits into
masterfrom
hsd/issue-111

Conversation

@hsd-bot

@hsd-bot hsd-bot commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Closes #111

Summary

  • spec/LoadSpec.js now loads js/imagediff.js instead of the built imagediff.js.
  • bin/imagediff requires ../js/imagediff.js, so the CLI and its smoke tests (spec/CliSpec.js) run the current source.
  • CONTRIBUTING.md gets a short "Build outputs" section: rebuild and commit imagediff.js/imagediff.min.js only when preparing a release. The README's Scripts list points there and notes that npm test needs no build.

npm test passes in the dev container (44 Node specs, browser specs).

Decisions

  • The CLI requires the source rather than the built file. The built file is only the license header plus the source, and js/ ships in the npm package (checked with npm pack --dry-run), so installed CLIs behave the same. I chose this over redirecting module resolution only inside the test, which would be more fragile.
  • The built files are left as they are in this PR.
  • No CI check that blocks changes to the built files. That would need a workflow change, and the issue only asks for the guideline.

🤖 Generated with Claude Code

hsd-bot and others added 2 commits October 30, 2026 11:06
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hsd-bot

hsd-bot commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

hsd review round 1

Verdict: approve.

This covers what #111 asks for:

  • Tests run against the source. spec/LoadSpec.js now loads js/imagediff.js. bin/imagediff requires ../js/imagediff.js, so spec/CliSpec.js also tests the source. ImageDiffSpec.js and spec/index.html were already on the source. No spec loads imagediff.js or imagediff.min.js any more.
  • Built files untouched. The PR leaves imagediff.js and imagediff.min.js alone.
  • Docs. CONTRIBUTING.md has a short "Build outputs" section, and CLAUDE.md includes CONTRIBUTING.md, so agents will see it. The README's Scripts list matches it.

Checks:

  • npm test passes in the dev container: 44 Node specs, 39 browser specs.
  • The committed imagediff.js is exactly the license header plus js/imagediff.js. LoadSpec therefore still covers the same code that main serves.
  • The CLI change is safe for installs: there's no files field or .npmignore, so js/ ships in the package.

Non-blocking nit: LoadSpec no longer touches the main entry (./imagediff.js) directly. That's fine while the built file is only header + source. If the build ever transforms the code, a release-time check of the built file would be worth adding.

@hsd-bot

hsd-bot commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

hsd: ready for human review after 1 review round(s). Agent sessions are still live in tmux -L hsd-js-imagediff attach -t issue-111-build-rebuild-committed-build-outputs.

@cesutherland
cesutherland merged commit fa2496a into master Oct 30, 2026
4 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.

build: rebuild committed build outputs only at release

2 participants