feat(flo): add version command and make releases bundle cleanly - #33
Merged
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two related bits of release tooling for flo:
flo version— prints the installed version (flo 0.3.0). Also responds to--versionand-v. Reuses the existingreadCurrentVersion()helper (now exported fromupdater.ts), so it works whether flo runs from compileddist/or directly viatsx.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:tscnever prunes. The build wastsc && chmod +x dist/flo.jswith no clean step, so a renamed/removed command (e.g.branch.ts→stackCreate.ts) left an orphanedbranch.jsbehind indist/— and that orphan is sitting in the publishedflo-tools@0.3.0tarball, the fingerprint of an incremental build getting published.release.shnever rebuilt or published. It only bumped the version andgit pushed, relying entirely on whoever rannpm publishby hand happening to have a freshdist/.Changes
package.json:buildis nowrm -rf dist && tsc && chmod +x dist/flo.js— orphans can't survive a build.release.sh: after committing the version bump it runsnpm publish(which triggersprepublishOnly→ 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: theversioncommand + exportedreadCurrentVersion.Verification
branch.jsorphan.flo version,flo --version,flo -vall printflo 0.3.0.