Skip to content

Conversation

@frankieyan
Copy link
Member

@frankieyan frankieyan commented Jan 21, 2026

Fixes #31

When using --stage-record-file, deleted files are now automatically removed from the records instead of throwing an error. This enables pre-commit hooks to include deleted files (diff-filter=ACMRD) so the tracker can clean up records for removed files.

Test plan

  1. Run npm run build
  2. Create a test file with a React Compiler error in src/__fixtures__/sample-project/src, and run node dist/index.mjs --overwrite to add it to records
  3. Delete the file (or you could just delete bad-component.tsx)
  4. Run node dist/index.mjs --stage-record-file src/__fixtures__/sample-project/src/<yourfile.tsx>
  5. Verify the deleted file is removed from the records file and the tool exits cleanly
  6. Running npx react-compiler-tracker --check-file src/__fixtures__/sample-project/src/<yourfile.tsx> exits with "No file found"

frankieyan and others added 2 commits January 20, 2026 21:49
When using --stage-record-file, deleted files are now automatically
removed from the records instead of throwing an error. This enables
pre-commit hooks to include deleted files (diff-filter=ACMRD) so the
tracker can clean up records for removed files.

- Add partitionByExistence() to separate existing/deleted files
- Update --stage-record-file to compile only existing files while
  passing all files to records for cleanup
- Add log messages for deleted files being removed
- Fix grammar in log messages ("1 file" vs "1 files")
- Update README with new behavior and diff-filter guidance

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@frankieyan frankieyan requested a review from a team as a code owner January 21, 2026 05:59
@frankieyan frankieyan requested review from pawelgrimm and removed request for a team January 21, 2026 05:59
@frankieyan frankieyan changed the title refactor: extract pluralize helper into utils module fix: remove deleted files from records file Jan 21, 2026
Copy link

@doist-bot doist-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR correctly implements the extraction of the pluralize helper and handles the logic for deleted files in the records staging process. The implementation of partitionByExistence and the corresponding logic in runStageRecords handles file partitioning effectively. The test coverage is adequate for the new functionality.

@frankieyan frankieyan changed the title fix: remove deleted files from records file fix: remove deleted files from records file with --stage-record-file Jan 21, 2026
@frankieyan frankieyan added the 👀 Show PR PR must be reviewed before or after merging label Jan 21, 2026
Pass existingFilePaths instead of allFilePaths to exitIfErrorsIncreased
since only existing files are compiled. Deleted files are handled
separately and don't need error checking.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@frankieyan frankieyan merged commit 34b00f8 into main Jan 22, 2026
2 checks passed
@frankieyan frankieyan deleted the frankieyan/pluralize-helper branch January 22, 2026 05:45
Copy link

@pawelgrimm pawelgrimm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

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

Labels

👀 Show PR PR must be reviewed before or after merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove deleted files from records file when --stage-record-file flag is used

3 participants