Skip to content

index --help documents an exit code caused by better-sqlite3, which the product no longer uses #303

Description

@MongLong0214

Found while narrowing the musl question: the only remaining better-sqlite3 string in the shipped bundle is a user-facing message.

The defect

src/commands/index-cmd.ts:134:

Exit codes: 0 built or refreshed, 2 could not run -- conflicting flags, or better-sqlite3 is not installed (SPEC §10).

Measured at a3d2211:

Check Result
better-sqlite3 in src/ outside comments only this message
declared in package.json dependencies none at all{}
in the lockfile absent
what the index actually imports node:sqlite (src/core/index-db.ts:57)

ADR-0012 replaced better-sqlite3 with node:sqlite precisely so there is no native dependency. The comments in index-db.ts that mention it are legitimate — they explain why that choice was made. This one is not a comment: it tells a user who hit exit 2 to go look for a package that is not part of the product and never will be.

Why it matters more than a typo

The message is the one place a user is sent when the command fails. Sending them after a package that does not exist costs them the time it takes to discover that, and it contradicts the ADR that removed the dependency — the same class of stale claim as an inventory naming code that has been deleted.

Fix direction

State the conditions that actually produce exit 2: conflicting flags, or the SQLite binding being unavailable, which is what index-db.ts degrades on. Scope: the one addHelpText string in src/commands/index-cmd.ts, plus an assertion so the message cannot name a package the manifest does not carry.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions