Repository navigation
Install frontend deps before format and format:check - #939
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The pre-commit hook runs
bun run format:checkbefore anything installs dependencies. On fresh checkouts and new dev environments there is nonode_modules, so the hook fails withprettier: command not foundand 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, andtypecheckalready self-prepare throughscripts/prepare-frontend-deps.shviapre<script>entries.formatandformat:checkwere the only scripts missing one. This adds the same two pre scripts so the lockfile-pinned Prettier is installed automatically when missing:preformatpreformat:checkValidation
node_modules.node_modules, staged the change, and ran.githooks/pre-commitend to end: deps installed, Prettier check passed,bun run buildpassed, and all 1003 Bun tests passed.git diff --checkclean.Not run:
nix flake check(no flake or CI-script change), Rust/desktop lanes (no Rust or UI change).