feat(scripts): add build prerequisite preflight check - #1896
Open
legenddcr wants to merge 1 commit into
Open
Conversation
Add scripts/check-build-prereqs.mjs to detect missing build prerequisites that cause confusing cargo/pnpm failures: - Root node_modules missing (fix: pnpm install) - src/mobile-web/dist missing (fix: pnpm run prepare:mobile-web) — the bitfun-desktop Tauri build script references this as a resource - sherpa-onnx prebuilt cache missing — warns only for first-build scenario; when target/sherpa-onnx-prebuilt/<version>/lib/ exists, build.rs auto-detects it and no env var is needed The check supports --fix to auto-run fixable commands and re-verifies after fix. Hook: pnpm run check:build-prereqs pnpm run check:build-prereqs -- --fix Includes 6 unit tests covering pass/fail/warn/mixed/--fix paths. Updates CONTRIBUTING.md, CONTRIBUTING_CN.md, and AGENTS.md verification table.
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.
Summary
Cherry-pick AtomGit OpenBitFun/bitfun_agent_kernel#5 into the current GitHub repository.
The preflight check improves contributor feedback by detecting missing build prerequisites before pnpm or Cargo reports less actionable failures.
Changes
pnpm run check:build-prereqsnode_modulesandsrc/mobile-web/dist--fixfor the two deterministic pnpm prerequisitesVerification
node --check scripts/check-build-prereqs.mjsnode --check scripts/check-build-prereqs.test.mjsnode --test scripts/check-build-prereqs.test.mjs(6 passed)pnpm run check:build-prereqspnpm run check:repo-hygienegit diff --check origin/main...HEADNotes