Skip to content

fix: 1.1.2 with the healthcheck, scoped names and install fixes - #6

Merged
SibilSoren merged 7 commits into
mainfrom
fix/cli-1.1.2
Nov 17, 2026
Merged

SibilSoren merged 7 commits into
mainfrom
fix/cli-1.1.2

Conversation

@SibilSoren

@SibilSoren SibilSoren commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Description

A patch release with five fixes, so they reach npm before Drizzle (#5) ships in 1.2.0. Two of the commits are the same as in #5 (the healthcheck and the CI flake). I'll rebase #5 onto main once this is merged.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 📝 Documentation update
  • 🔧 Refactor / chore
  • 💥 Breaking change

Changes Made

  • Docker healthcheck. It called localhost, which can resolve to IPv6 first in the Alpine image while the server listens on IPv4, so containers never became healthy. It now calls 127.0.0.1. The docker compose job in feat: PostgreSQL with Drizzle (--db drizzle) #5 found this.
  • Scoped names. @acme/api created ./@acme/api, and the README's docker build -t @acme/api fails because Docker image names can't contain @. The project now goes in ./api, package.json keeps @acme/api, and the Docker commands use the folder's name through a new {{IMAGE_NAME}} placeholder.
  • Spinner. The install ran with execSync, which blocks the process, so the spinner stayed on its first frame. It now runs through execAsync in src/utils/exec.ts. npm or pnpm runs without a shell around it, except on Windows, which needs one for npm.cmd. That way the 5 minute timeout stops the install itself. The first CI run showed why this matters: on Ubuntu, sh -c started the command as a child and only the shell was stopped. Only the last 64 KB of output is kept for the error message, and a timeout says so.
  • Failed installs. After a failed install the CLI still said "Your API is ready!" and exited with 0. It now says the dependencies aren't installed, shows the commands to finish, and exits with 1. The files and the initial commit are kept, the same as with --skip-install.
  • Terminals with no width. I found this while checking the spinner in a pseudo-terminal. A terminal that reports 0 columns, such as docker run -t started from a script, makes ora work out infinitely many lines to clear, so the CLI hangs at 100% CPU once the install ends. 1.1.1 does this too. The spinner is now off there.
  • CI. The rate limit check starts away from a minute boundary, the same change as in feat: PostgreSQL with Drizzle (--db drizzle) #5. Gatekeeper counts per clock minute, and a burst that crossed the boundary let one extra request through now and then.
  • Release. Version 1.1.2 and its changelog. It also ships the option composition from refactor: add options through slots instead of exact-line edits #4, which doesn't change generated projects.

Testing

  • I've tested the CLI tool locally (npx tsx src/index.ts test-project)
  • The generated project boots successfully (npm run dev)
  • The generated project's tests pass (npm test)
  • I've run npm run lint with no errors

New tests cover the scoped folder and names, the Docker image name, a failed install, a terminal with 0 columns, and execAsync on its own, including a timeout while a child process still holds the output open. The install tests put a fake npm first on PATH. The spinner test checks that timers keep firing during the install: they fired 0 times on the old code. The 0-column test throws instead of hanging the test run on the old code.

Every commit passes lint, typecheck, tests and build. On the last commit, generated projects with and without Gatekeeper pass typecheck, build, tests, lint, the format check and the boot checks from ci.yml.

Screenshots / Logs

By hand, with the built CLI:

  • A real @acme/api install with git: the folder is api, the lockfile is in the first commit, and the generated project builds and passes its 22 tests. A real pnpm install works too, with pnpm-lock.yaml in the first commit.
  • A failing install shows npm's error and exits with 1:
[4/4] ✖ Failed to install dependencies
    npm error code ETARGET
    npm error notarget No matching version found
    "npm install" exited with code 1.
✔ Created the initial commit

  ✖ broken-api is created, but its dependencies aren't installed.

  Fix the error above, then finish with:

    cd broken-api
    npm install
    npm run dev
  • In a pseudo-terminal 80 columns wide, the spinner goes through all 10 frames (1 on main). At 0 columns it finishes with plain lines, where main hangs.

Checklist

  • My code follows the project's code style
  • I've updated documentation if needed
  • I've added an entry to CHANGELOG.md (if user-facing change)

The healthcheck called http://localhost:3000. On Alpine, localhost can
resolve to ::1 first, and the server only listens on IPv4, so the
container never became healthy. Nothing in CI waited for the healthcheck,
so it went unnoticed.
Gatekeeper counts per clock minute. When the 100 requests crossed the
boundary, the count dropped and the 101st request got through, which
failed the check now and then.
`create-api-starterkit @acme/api` created ./@acme/api, and the README told
you to `docker build -t @acme/api`, which Docker refuses. The project now
goes in ./api, package.json keeps @acme/api, and the Docker commands use
the folder's name.
The install ran with execSync, which blocks the process, so the spinner
froze on its first frame for the whole install. It now runs in the
background. npm or pnpm runs without a shell around it (except on
Windows, which needs one for npm.cmd), so the timeout stops the install
itself, and a timeout now says so instead of looking like any other
failure. Only the last 64 KB of output is kept, for showing why an
install failed.
After a failed install, the CLI still said "Your API is ready!" and
exited with 0, so a script or CI job carried on with a project that
couldn't run. It now says the dependencies aren't installed, shows how to
finish, and exits with 1. The project files are kept.
A terminal with no size, such as `docker run -t` started from a script,
reports 0 columns. ora then works out that it has infinitely many lines
to clear, and the CLI used 100% CPU writing escape codes forever once the
install finished. The spinner is off there, and the steps print as plain
lines.
@SibilSoren
SibilSoren merged commit efe9784 into main Nov 17, 2026
14 checks passed
@SibilSoren
SibilSoren deleted the fix/cli-1.1.2 branch November 17, 2026 07:31
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