Stable copy for sharing

A second checkout of this repo serves a fixed version through ngrok while work goes on in the main checkout. It is a git worktree on the branch stable: same repository, own folder, own build, own port.
Working copyStable copy
Folderim-web-prototypesim-web-prototypes-stable, next to it
Branchmainstable
Runsbun run dev (Vite dev, hot reload)bun run stable (production build, vite preview)
Port31003200
Shared asngrok http 3200 --url=<static domain>.ngrok-free.dev

Set up once

git worktree add -b stable ../im-web-prototypes-stable main
cd ../im-web-prototypes-stable
git branch --set-upstream-to=main stable          # git pull takes local main
git config branch.stable.mergeoptions --ff-only   # and never makes a merge commit
bun install
bun run stable

Then, in another terminal: ngrok http 3200 --url=<static domain>.ngrok-free.dev. ngrok's free plan includes one static domain, so the shared link stays the same.

Ship a new version

Commit on main first: the stable copy only sees committed work.

cd ../im-web-prototypes-stable
git pull              # from local main, fast-forward only
bun install
bun run stable        # stop the running one first

git log stable..main lists what isn't shipped yet.

Worth knowing

  • Each copy keeps its own in-memory state (carts, orders, admin edits). A restart resets it.
  • vite.config.ts lets *.ngrok-free.dev through both the dev server and vite preview.
  • Receipt PDFs are printed by headless Chrome from this server's own address. Through a tunnel the request has no port, so the PDF code reads PORT (set to 3200 by bun run stable); without it, the stable copy would print PDFs from the dev server on 3100.
  • Don't run bun add in the stable copy. Add packages on main and merge.