Skip to content

Source the CLI version from package.json and fix the bundle shebang - #11

Merged
tylerhogarth merged 2 commits into
mainfrom
fix/version-from-package
Sep 1, 2026
Merged

tylerhogarth merged 2 commits into
mainfrom
fix/version-from-package

Conversation

@tylerhogarth

Copy link
Copy Markdown
Owner

Fixes two release-correctness issues found while preparing the first npm publish, and bumps to 0.1.1.

Changes

  • Version: src/run.ts imports the version from package.json (inlined at build time) instead of a hardcoded constant, so a release bumps one place. The existing package test already compared tod --version against package.json; this removes the second bump site it guarded.
  • Bundle shebang: Bun.build carries the #!/usr/bin/env bun shebang from src/cli.ts into the node-target bundle, and the build script's prepend guard never fired. A global install on macOS or Linux would have executed the bin via bun, failing on machines without it. The build script now replaces any leading shebang with the node one, and the package test asserts the shebang line directly (the previous test invoked node dist/cli.js explicitly, which bypasses the shebang and hid the bug).
  • Version bump: 0.1.1.

Why

Non-technical operators install with npm i -g tod-ai and will not have bun. The shebang was the difference between the published package working and failing on every default install, and nothing on the check suite could catch it without asserting the shebang line itself.

🤖 Generated with Claude Code

tylerhogarth and others added 2 commits September 1, 2026 15:51
tod --version now reports the version imported from package.json at
build time, so releases only bump one place. Bun.build carries the
entry file's bun shebang into the node-target bundle, so the installed
bin required bun on unix machines; the build script now replaces any
leading shebang with the node one, and the package test asserts it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tylerhogarth
tylerhogarth merged commit 089b42e into main Sep 1, 2026
1 check passed
@tylerhogarth
tylerhogarth deleted the fix/version-from-package branch September 8, 2026 10:07
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