Skip to content

feat(flo): add version command and make releases bundle cleanly - #33

Merged
brunokiafuka merged 2 commits into
mainfrom
flo-release-bundle-and-version
Jun 11, 2026
Merged

brunokiafuka merged 2 commits into
mainfrom
flo-release-bundle-and-version

Conversation

@brunokiafuka

@brunokiafuka brunokiafuka commented Jun 11, 2026 •

Copy link
Copy Markdown
Owner

What

Two related bits of release tooling for flo:

  1. flo version — prints the installed version (flo 0.3.0). Also responds to --version and -v. Reuses the existing readCurrentVersion() helper (now exported from updater.ts), so it works whether flo runs from compiled dist/ or directly via tsx.

  2. Releases now bundle cleanly and publish themselves — fixing the "the latest release doesn't have the stack in it" class of bug.

Why the bundling change

The published npm tarball is the only artifact that carries a compiled CLI (the git-clone install runs source via tsx). Two gaps let a stale bundle ship:

  • tsc never prunes. The build was tsc && chmod +x dist/flo.js with no clean step, so a renamed/removed command (e.g. branch.ts → stackCreate.ts) left an orphaned branch.js behind in dist/ — and that orphan is sitting in the published flo-tools@0.3.0 tarball, the fingerprint of an incremental build getting published.
  • release.sh never rebuilt or published. It only bumped the version and git pushed, relying entirely on whoever ran npm publish by hand happening to have a fresh dist/.

Changes

  • package.json: build is now rm -rf dist && tsc && chmod +x dist/flo.js — orphans can't survive a build.
  • release.sh: after committing the version bump it runs npm publish (which triggers prepublishOnly → the clean build) before pushing, so the npm tarball always matches the released source. If publish fails (auth/OTP), the commit stays local and un-pushed — no half-released state.
  • flo.ts / updater.ts: the version command + exported readCurrentVersion.

Verification

  • Clean build leaves no branch.js orphan.
  • flo version, flo --version, flo -v all print flo 0.3.0.
  • Full test suite passes (134 tests); oxlint + oxfmt clean.

- Add 'flo version' (also --version / -v), reusing readCurrentVersion.
- Clean the build (rm -rf dist before tsc) so renamed/removed commands
  no longer linger as orphans in the published bundle.
- release.sh now runs 'npm publish' (clean build via prepublishOnly)
  before pushing, so the npm tarball always matches the released source
  instead of relying on whoever publishes having a fresh dist.
@brunokiafuka
brunokiafuka merged commit ad585f8 into main Jun 11, 2026
1 of 2 checks passed
@brunokiafuka
brunokiafuka deleted the flo-release-bundle-and-version branch June 11, 2026 07:43
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