Skip to content

Fix release build ordering, adopt clack, polish README#2

Merged
botre merged 5 commits into
masterfrom
fix/build-order-and-clack
May 8, 2026
Merged

Fix release build ordering, adopt clack, polish README#2
botre merged 5 commits into
masterfrom
fix/build-order-and-clack

Conversation

@botre
Copy link
Copy Markdown
Contributor

@botre botre commented May 8, 2026

Summary

Three related improvements that ship together as the next patch release.

1. Release ordering bug (the real one)

release.yml ran Build before Bump version. Because src/cli.ts does import pjson from "../package.json" and tsup inlines that JSON at bundle time, the published 1.0.0 tarball contained a dist/cli.js whose version string was still 1.0.0-rc.0 (the value in package.json at the moment of build). The package.json and tag were 1.0.0, but the binary printed the wrong version.

Fix: swap the order — Bump version first, then Build, then Publish.

2. Clack picker

Replace the readline numbered list with @clack/prompts's select. Arrow-key navigation, hint text for the IP, clean cancel handling via isCancel. Drops the readline import.

Non-TTY fallback (defaulting to the top-sorted candidate without prompting) is preserved.

3. README polish

  • Lead with value prop + demo gif.
  • New "Use cases" section: mobile UI checks, real-device APIs, PWA install flow, multi-device review, cross-browser sanity.
  • "Requirements" section replaces "Notes" with actionable 0.0.0.0 binding guidance (common framework flag spellings).

Files

  • .github/workflows/release.yml — reorder steps
  • src/cli.ts — swap readline → clack, drop prompt() helper
  • package.json / package-lock.json — add @clack/prompts ^1.3.0
  • static/demo.gif — regenerate so the gif shows v1.0.0
  • README.md — rewrite

Test plan

  • npm run lint clean
  • npm run build produces dist/cli.js (~5.8 KB), version baked = current package.json version
  • node dist/cli.js --port 8080 --host 1.2.3.4 prints localview v1.0.0 and the expected URL/QR
  • Non-TTY fallback (< /dev/null) still picks the top-sorted candidate and logs a notice
  • On merge, release workflow bumps 1.0.0 → 1.0.1 (patch default), and the published dist/cli.js prints v1.0.1

botre added 3 commits May 8, 2026 23:29
- Move the Build step to run *after* the Bump version step in
  release.yml. Previously tsup baked the pre-bump package.json (e.g.
  1.0.0-rc.0) into dist/cli.js, while npm published the post-bump
  version, so the published 1.0.0 still printed v1.0.0-rc.0 at runtime.
- Replace the readline-based numbered list with @clack/prompts' select.
  Arrow-key navigation, hint text for the IP, and a clean cancel path.
- Drop the now-unused readline import.
- Lead with the value prop and the demo gif rather than a numbered list.
- Add a Use cases section: mobile UI checks, real-device APIs, PWA
  install flow, multi-device review, cross-browser sanity.
- Tighten the Quick start to three real steps.
- Rename "Notes" to "Requirements" and make the 0.0.0.0 binding
  guidance actionable (lists common framework flag spellings).
@botre botre changed the title Fix release build ordering, adopt clack for interface picker Fix release build ordering, adopt clack, polish README May 8, 2026
@botre botre merged commit 66fca18 into master May 8, 2026
1 check 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.

1 participant