Skip to content

chore: Dependency doc#9792

Draft
wisniewskij wants to merge 9 commits into
mainfrom
@wisniewskij/doctor
Draft

chore: Dependency doc#9792
wisniewskij wants to merge 9 commits into
mainfrom
@wisniewskij/doctor

Conversation

@wisniewskij

Copy link
Copy Markdown
Contributor

Summary

Adds reanimated-doctor (yarn doctor) — a check that the host tools this repo depends on but does not install via yarn install match the versions the repo expects.

Motivation. Tools like clang-format, clang-tidy, cmake, cmake-format/cmake-lint, ruby, cocoapods, the JDK and the NDK are not version-enforced on a contributor's machine, so a local version can silently differ from CI's. The usual symptom is a "works on my machine" formatting/lint diff that fails CI for no obvious reason. This consolidates the existing scattered guards (disallow-non-exact.js, check-ruby-pods.sh, .nvmrc) into one place.

Approach — derive, don't duplicate. Every required version is read at runtime from the file that already pins it, so there's no second copy to drift:

Tool Source of the required version
node .nvmrc
yarn package.json#packageManager
clang-format node_modules/.bin/clang-format (the clang-format-node pin) vs the binary on PATH
ruby apps/fabric-example/Gemfile.lock (RUBY VERSION)
cocoapods Podfile.lock COCOAPODS:, probed via bundle exec pod
cmake-format / cmake-lint .github/actions/android-validation/action.yml (cmakelang==)
java (JDK) CI java-version in android-validation
cmake cmake_minimum_required() floor in CMakeLists.txt
NDK apps/fabric-example/android/build.gradle (ndkVersion)
clang-tidy / clangd / xcode-build-server genuinely unpinned — reported as info, not asserted

Cross-file consistency. It also flags repo files that disagree with each other. Currently surfaces four real inconsistencies: Gradle wrapper 9.3.1 vs 9.0.0, Spotless 8.4.0 vs 8.1.0, CI Java 17 vs 18, and Ruby 3.3.7 (.ruby-version) vs 3.3.6p108 (Gemfile.lock + CI guard).

Behaviour. Advisory by default — exits 0 and prints only rows that need attention. --display-all also shows passing rows; --ci makes error-severity findings (node/yarn) exit non-zero. No new dependencies, no build step. macOS-only checks (ruby/cocoapods/xcode-build-server) are skipped on Linux. Not yet wired into git hooks or CI — intentionally advisory first.

Note: this script is mostly AI-generated (disclosed in the file header).

Test plan

# default: only rows needing attention + cross-file conflicts; exits 0
yarn doctor

# show passing rows too
node scripts/doctor/doctor.js --display-all

# enforce: non-zero exit if node/yarn (error-severity) mismatch the repo pins
node scripts/doctor/doctor.js --ci ; echo "exit: $?"

wisniewskij and others added 4 commits June 30, 2026 17:34
- probe(): 10s timeout so a hung tool can't block the whole run
- --consistency-only: run only the cross-file checks (no host tools); with
  --ci, cross-file conflicts become fatal — a cheap, flake-free CI gate
- --quiet: show only warnings/errors/conflicts (hide INFO rows too)
- checkBundler(): derive BUNDLED WITH from apps/fabric-example/Gemfile.lock

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- .ruby-version 3.3.7 -> 3.3.6 (the outlier; Gemfile.lock + CI use 3.3.6p108)
- add an EXPECTED allow-list so the consistency checks only fire on NEW drift,
  not on reviewed/intentional divergences:
    - CI Java 18 (RN-compat / nightly jobs test it on purpose)
    - tvos-example gradle 9.0.0 (tracks older RN 0.84.1)
    - worklets spotless 8.1.0 (pending bump to 8.4.0; needs spotlessApply)
- accepted divergences are shown transparently (hidden under --quiet)

Cross-file consistency now passes: `--consistency-only --ci` exits 0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Conflating host-tool drift (fix by installing tools) with cross-file
consistency (fix by editing files / CI-enforceable) was a real source of
confusion. Make the distinction explicit in the summary.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant