You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When tanstack add encounters pending Git changes, it prints a diagnostic and returns normally. Scripts therefore see exit code 0 even though no add-on was installed.
Throw an error from the Git guard so the existing CLI handler prints the same guidance and exits with code 1. The guard still honors --forced.
A regression test checks that pending changes reject the add operation. A focused Node 24 reproduction using the command handler, the Git guard, and a temporary Git repository observed exit code 0 before the fix and 1 after it. The forced invocation reached the installation path. In packages/create, the new test fails on main (the promise resolves instead of rejecting) and passes with the fix; the rest of tests/add-to-app.test.ts still passes. The full build was not run; the package tests that failed locally (copy-assets, edge/worker manifest, edge import) depend on build output and do not touch this code.
AI assistance was used to prepare the fix and regression test.
Summary by CodeRabbit
Bug Fixes
Add-on operations now report pending Git changes as an error and stop when not forced. Enabling the forced option bypasses this check.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
No actionable comments were generated in the recent review.
Walkthrough
When Git reports pending changes, addToApp now throws an error unless forced is true. A test checks rejection when Git reports an untracked file.
Changes: Pending Git Changes
Layer / File(s)
Summary
Pending-changes guard and test packages/create/src/add-to-app.ts, packages/create/tests/add-to-app.test.ts
When Git reports pending changes and forced is not true, addToApp throws an error. The test checks the error message when Git reports an untracked file.
The add command now exits with an error when pending Git changes are present, instead of reporting the problem and exiting successfully. The forced option still bypasses the check. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix(cli): exit nonzero when add rejects pending Git changes" matches the main change. The raw summary says addToApp now throws when Git reports pending changes and forced is not set, and th…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix(cli): exit nonzero when add rejects pending Git changes" matches the main change. The raw summary says addToApp now throws when Git reports pending changes and forced is not set, and the test covers the rejection. The title names the behavior change (nonzero exit on rejection) and the trigger (pending Git changes). It is specific and does not list files. The title is a conventional-commit style single sentence of 9 words.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: b8493636-3536-40d5-a573-c8ac9c8bd71e
Commits
Reviewing files that changed from the base of the PR and between 40e0043 and 7a58f39.
Files selected for processing: 2
packages/create/src/add-to-app.ts
packages/create/tests/add-to-app.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Thanks for catching this! Returning success when nothing was installed can hide a failed add operation in scripts. The guard change looks right.
AI review notes:
Reviewed the full two-file diff at 7a58f393164906019e8923d97b57477f660b8727 against 40e0043707b23b498c6a32950404893817a6f2c3. No dependency, hook or workflow changes.
The regression fails against the base guard and passes with this fix. A generated blank app outside the monorepo, initialized as a dirty Git repository, now exits 1 from the actual CLI with the commit-or-stash guidance. Existing forced add tests pass.
A clean frozen install, all 10 repository builds, lint and all 571 unit tests pass on Node 26.3.1. All 22 blocking browser checks also pass, including generated apps outside the monorepo. No hosted CI success or merge is claimed.
Required fork CI runs are waiting for direct GitHub execution, with no Core-owned paths changed. The current branch rules do not require a separate Core approval for this diff.
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
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.
When
tanstack addencounters pending Git changes, it prints a diagnostic and returns normally. Scripts therefore see exit code 0 even though no add-on was installed.Throw an error from the Git guard so the existing CLI handler prints the same guidance and exits with code 1. The guard still honors
--forced.A regression test checks that pending changes reject the add operation. A focused Node 24 reproduction using the command handler, the Git guard, and a temporary Git repository observed exit code 0 before the fix and 1 after it. The forced invocation reached the installation path. In
packages/create, the new test fails onmain(the promise resolves instead of rejecting) and passes with the fix; the rest oftests/add-to-app.test.tsstill passes. The full build was not run; the package tests that failed locally (copy-assets, edge/worker manifest, edge import) depend on build output and do not touch this code.AI assistance was used to prepare the fix and regression test.
Summary by CodeRabbit