Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Caution Review failedThe pull request is closed. WalkthroughDocumentation examples across multiple MDX files were updated to import Changes
Sequence Diagram(s)(omitted — changes are only documentation import path edits, no runtime/control-flow changes to illustrate) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (7)
✨ Finishing touches🧪 Generate unit tests
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. Comment |
There was a problem hiding this comment.
Greptile Summary
This PR modernizes the Stack Auth initialization tooling and project structure by introducing several key improvements:
Enhanced CLI Options: The init-stack package now accepts --project-id and --publishable-client-key command-line arguments, allowing users to pre-populate these critical configuration values during setup instead of manually entering them afterward. This enables automation and streamlines the developer onboarding experience.
Improved File Organization: The initialization tool now generates a cleaner project structure with separate stack/client.ts and stack/server.ts files instead of a single stack.ts file. This separation provides better organization by clearly distinguishing between client-side and server-side Stack Auth configurations, following Next.js best practices for preventing server-only code from accidentally running on the client.
Comprehensive Documentation Updates: All documentation files have been systematically updated to reflect the new file structure, with import paths changed from @/stack to @/stack/server for server-side usage and @/stack/client for client-side usage across setup guides, examples, and concept documentation.
Minor UI Refinement: The dashboard's new project page removes a redundant vertical separator between form and preview sections, likely because the different background colors already provide sufficient visual separation.
These changes integrate well with the existing codebase architecture and maintain backward compatibility while providing a more organized and automated setup experience for Stack Auth projects.
Confidence score: 4/5
- This PR is safe to merge with moderate risk due to structural changes affecting many files
- Score reflects comprehensive documentation updates and well-tested CLI enhancements, but file structure changes across the codebase require careful validation
- Pay close attention to init-stack package changes and ensure all import path updates are consistent across the codebase
16 files reviewed, 6 comments
| @@ -33,7 +33,7 @@ Sometimes, you want to retrieve the user only if they're signed in, and redirect | |||
| Since `useUser()` is a stateful hook, you can't use it on server components. Instead, you can import `stackServerApp` from `stack/client.ts` and call `getUser()`: | |||
There was a problem hiding this comment.
syntax: Comment mentions stack/client.ts but the actual import is from @/stack/server - this appears to be a documentation error
| Since `useUser()` is a stateful hook, you can't use it on server components. Instead, you can import `stackServerApp` from `stack/client.ts` and call `getUser()`: | |
| Since `useUser()` is a stateful hook, you can't use it on server components. Instead, you can import `stackServerApp` from `@/stack/server` and call `getUser()`: |
High-level PR Summary
This PR restructures how Stack apps are initialized by moving from a single
stack.tsfile to a directory structure with separate client and server files (stack/client.tsandstack/server.ts). The changes update all import paths throughout the codebase and documentation to reflect this new structure. Additionally, the PR adds command-line arguments to the init-stack tool to allow specifying project ID and publishable client key during initialization, which enhances the developer experience by allowing these values to be pre-populated in the generated configuration files.⏱️ Estimated Review Time: 1h 15m
💡 Review Order Suggestion
packages/init-stack/src/index.tspackages/init-stack/package.jsondocs/templates/getting-started/setup.mdxapps/dashboard/src/app/(main)/(protected)/projects/[projectId]/(overview)/setup-page.tsxdocs/templates/getting-started/example-pages.mdxdocs/templates/getting-started/users.mdxdocs/templates/components/stack-handler.mdxdocs/templates/components/stack-provider.mdxdocs/templates/concepts/oauth.mdxdocs/templates/concepts/permissions.mdxdocs/templates/concepts/user-onboarding.mdxdocs/templates/customization/custom-pages.mdxdocs/templates/customization/page-examples/forgot-password.mdxdocs/templates/customization/page-examples/password-reset.mdxdocs/templates/others/supabase.mdxapps/dashboard/src/app/(main)/(protected)/(outside-dashboard)/new-project/page-client.tsxapps/dashboard/src/app/(main)/(protected)/(outside-dashboard)/new-project/page-client.tsxImportant
Renamed
stack.tstostack/client.tsandstack/server.tsacross the codebase, updatedinit-stackpackage with new options, and adjusted documentation accordingly.stack.tstostack/client.tsandstack/server.tsinsetup-page.tsx,stack-handler.mdx,stack-provider.mdx,oauth.mdx,permissions.mdx,user-onboarding.mdx,custom-pages.mdx,forgot-password.mdx,password-reset.mdx,example-pages.mdx,setup.mdx,users.mdx,supabase.mdx.--project-idand--publishable-client-keyoptions toinit-stackinindex.ts.package.jsonscripts to includetest-run-keys-nextandtest-run-keys-jsfor testing with project ID and client key.Separatorcomponent frompage-client.tsx.This description was created by
for 27dbbc1. You can customize this summary. It will automatically update as commits are pushed.
Review by RecurseML
🔍 Review performed on 0c4958a..27dbbc1
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (3)
•
packages/init-stack/src/index.ts•
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/(overview)/setup-page.tsx•
apps/dashboard/src/app/(main)/(protected)/(outside-dashboard)/new-project/page-client.tsx⏭️ Files skipped (trigger manually) (13)
docs/templates/components/stack-handler.mdxdocs/templates/components/stack-provider.mdxdocs/templates/concepts/oauth.mdxdocs/templates/concepts/permissions.mdxdocs/templates/concepts/user-onboarding.mdxdocs/templates/customization/custom-pages.mdxdocs/templates/customization/page-examples/forgot-password.mdxdocs/templates/customization/page-examples/password-reset.mdxdocs/templates/getting-started/example-pages.mdxdocs/templates/getting-started/setup.mdxdocs/templates/getting-started/users.mdxdocs/templates/others/supabase.mdxpackages/init-stack/package.jsonSummary by CodeRabbit