Skip to content

Install frontend deps before format and format:check - #939

Merged
AnthonyRonning merged 1 commit into
masterfrom
codex-prettier-hook-maple
Sep 15, 2026
Merged

AnthonyRonning merged 1 commit into
masterfrom
codex-prettier-hook-maple

Conversation

@AnthonyRonning

Copy link
Copy Markdown
Contributor

Problem

The pre-commit hook runs bun run format:check before anything installs dependencies. On fresh checkouts and new dev environments there is no node_modules, so the hook fails with prettier: command not found and blocks the commit. Prettier is a pinned devDependency, not a tool provided by the Nix flake, so entering the dev shell alone does not help.

Fix

test, build, dev, and typecheck already self-prepare through scripts/prepare-frontend-deps.sh via pre<script> entries. format and format:check were the only scripts missing one. This adds the same two pre scripts so the lockfile-pinned Prettier is installed automatically when missing:

  • preformat
  • preformat:check

Validation

  • Reproduced the failure on a fresh worktree with no node_modules.
  • Deleted node_modules, staged the change, and ran .githooks/pre-commit end to end: deps installed, Prettier check passed, bun run build passed, and all 1003 Bun tests passed.
  • The commit for this PR itself went through the fixed hook.
  • git diff --check clean.

Not run: nix flake check (no flake or CI-script change), Rust/desktop lanes (no Rust or UI change).

The pre-commit hook runs 'bun run format:check' before anything installs
dependencies, so commits fail on fresh checkouts and new dev environments
with 'prettier: command not found'. The test, build, dev, and typecheck
scripts already self-prepare through prepare-frontend-deps.sh; give format
and format:check the same pre scripts so the pinned Prettier from the
lockfile is installed when missing.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@AnthonyRonning
AnthonyRonning merged commit 1267df0 into master Sep 15, 2026
17 checks passed
@AnthonyRonning
AnthonyRonning deleted the codex-prettier-hook-maple branch September 15, 2026 20:04
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