Repository navigation
fix(install): support current TanStack Start setup and callback registration - #253
Conversation
Honor configured package alternates in their declared dependency location. Recognize conventional app/ and src/ routes, including flat, nested, index, and route-file layouts, while retaining missing-package and callback mismatch checks.
setRedirectUris resolves applicationId as an AuthKit IDP application, not the default userland application returned by the installer read. Use the client-ID-matched environmentId instead, preserving dry-run validation, existing URIs, rechecks, and readback.
|
Stop treating the first glob match as the only candidate. Read matches sequentially and stop when one file satisfies the full rule; report diagnostics only if none does. Keep mustContain and mustContainAny constraints together in one file.
| continue; | ||
| } | ||
| let patternIssues: ValidationIssue[] | undefined; | ||
| for (const file of matches) { |
There was a problem hiding this comment.
Broad globs cause many reads
When no file contains the expected pattern, this loop reads every matching file. The TanStack source rule matches all TS, TSX, JS, and JSX files under app and src, so validation of a large app can spend substantial time reading files just to produce a missing-pattern warning. A bounded or more targeted check would avoid that cost while still checking beyond the first match.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/lib/validation/validator.ts
Line: 195
Comment:
**Broad globs cause many reads**
When no file contains the expected pattern, this loop reads every matching file. The TanStack source rule matches all TS, TSX, JS, and JSX files under `app` and `src`, so validation of a large app can spend substantial time reading files just to produce a missing-pattern warning. A bounded or more targeted check would avoid that cost while still checking beyond the first match.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Problem
A real TanStack Start install generated a valid app, but the CLI reported four false validation errors and then failed callback registration.
Two independent defects:
@tanstack/react-startas an alternate, but the validator ignored alternates. File checks also assumed the olderapp/layout, missing valid callback and middleware files undersrc/.setRedirectUris.applicationId. That argument resolves an AuthKit IDP application, so the real API returnedApplication not found.Fix
app/routesandsrc/routeslayouts, including nested, flat, index, and route files in TS/TSX/JS/JSX.environmentIdtosetRedirectUris. Keep existing URI/default preservation, dry-run validation, concurrent-change checks, readback, and mandatory callback registration.No general route parser, dashboard overwrite policy change, dependency change, or CI change.
Validation
applicationIdfailed withApplication not found; matchedenvironmentIdreturnedRedirectUrisSet. Diagnostic probes did not write settings.bun run test: 3,197 passed across 169 files.bun run typecheck,bun run lint,bun run build, andgit diff --checkpassed.