-
Notifications
You must be signed in to change notification settings - Fork 2
docs: use cliVersion constant instead of hardcoded @beta #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: use cliVersion constant instead of hardcoded @beta #100
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
d9eca77 to
253214e
Compare
- Add packageName prop to CliCommand for auto-versioning - Create PackageInstall component for install commands - Convert all hardcoded @beta references to use constant Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
253214e to
97148f3
Compare
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughThis pull request introduces a new PackageInstall component for rendering package installation instructions across multiple package managers and updates the CliCommand component to accept a packageName prop instead of execPackage. Multiple documentation files are updated to use these new components and props, replacing hardcoded code blocks with dynamic component-based implementations. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
apps/docs/src/components/PackageInstall.tsx (1)
41-43: Consider removing redundant default export.Both named and default exports are provided. Since the documentation files use the named import
{ PackageInstall }, the default export on line 43 appears unused. You could simplify by keeping only the named export.Suggested change
export function PackageInstall({ packages }: { packages: string }) { // ... } - -export default PackageInstall;apps/docs/src/components/CliCommand.tsx (1)
51-51: Consider extracting the command template for readability.The inline template works but could be slightly clearer with the command parts separated.
♻️ Optional refactor for readability
- code={`${exec ? `${manager.execPrefix} ${pkg}` : manager.prefix} ${command}`} + code={exec ? `${manager.execPrefix} ${pkg} ${command}` : `${manager.prefix} ${command}`}This separates the two distinct command formats more explicitly.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
apps/docs/content/docs/better-auth/installation.mdxapps/docs/content/docs/better-auth/troubleshooting.mdxapps/docs/content/docs/fmodata/quick-start.mdxapps/docs/content/docs/typegen/index.mdxapps/docs/content/docs/typegen/ui.mdxapps/docs/src/components/CliCommand.tsxapps/docs/src/components/PackageInstall.tsx
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
**/*.{ts,tsx}: Use explicit types for function parameters and return values when they enhance clarity
Preferunknownoveranywhen the type is genuinely unknown
Use const assertions (as const) for immutable values and literal types
Leverage TypeScript's type narrowing instead of type assertions
Files:
apps/docs/src/components/PackageInstall.tsxapps/docs/src/components/CliCommand.tsx
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
**/*.{js,jsx,ts,tsx}: Use meaningful variable names instead of magic numbers - extract constants with descriptive names
Use arrow functions for callbacks and short functions
Preferfor...ofloops over.forEach()and indexedforloops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Useconstby default,letonly when reassignment is needed, nevervar
Alwaysawaitpromises in async functions - don't forget to use the return value
Useasync/awaitsyntax instead of promise chains for better readability
Handle errors appropriately in async code with try-catch blocks
Don't use async functions as Promise executors
Removeconsole.log,debugger, andalertstatements from production code
ThrowErrorobjects with descriptive messages, not strings or other values
Usetry-catchblocks meaningfully - don't catch errors just to rethrow them
Prefer early returns over nested conditionals for error cases
Extract complex conditions into well-named boolean variables
Use early returns to reduce nesting
Prefer simple conditionals over nested ternary operators
Don't useeval()or assign directly todocument.cookie
Avoid spread syntax in accumulators within loops
Use top-level regex literals instead of creating them in loops
Prefer specific imports over namespace imports
Use descriptive names for functions, variables, and types
Add comments for complex logic, but prefer self-documenting code
Files:
apps/docs/src/components/PackageInstall.tsxapps/docs/src/components/CliCommand.tsx
**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ultracite.mdc)
**/*.{jsx,tsx}: Use function components over class components in React
Call hooks at the top level only, never conditionally
Specify all dependencies in hook dependency arrays correctly
Use thekeyprop for elements in iterables (prefer unique IDs over array indices)
Nest children between opening and closing tags instead of passing as props in React
Don't define components inside other components
Use semantic HTML and ARIA attributes for accessibility: Provide meaningful alt text for images, Use proper heading hierarchy, Add labels for form inputs, Include keyboard event handlers alongside mouse events, Use semantic elements (<button>,<nav>, etc.) instead of divs with roles
Addrel="noopener"when usingtarget="_blank"on links
AvoiddangerouslySetInnerHTMLunless absolutely necessary
Use proper image components (e.g., Next.js<Image>) over<img>tags
Use Next.js<Image>component for images
Usenext/heador App Router metadata API for head elements
Use Server Components for async data fetching instead of async Client Components in Next.js
Use ref as a prop instead ofReact.forwardRefin React 19+
Files:
apps/docs/src/components/PackageInstall.tsxapps/docs/src/components/CliCommand.tsx
🧬 Code graph analysis (2)
apps/docs/src/components/PackageInstall.tsx (1)
apps/docs/src/lib/constants.ts (1)
cliVersion(2-2)
apps/docs/src/components/CliCommand.tsx (1)
apps/docs/src/lib/constants.ts (1)
cliVersion(2-2)
🔇 Additional comments (11)
apps/docs/content/docs/typegen/ui.mdx (1)
5-11: LGTM!The import and component usage are correct. The
CliCommandcomponent properly uses the newpackageNameprop to enable dynamic versioning instead of hardcoding@beta.apps/docs/content/docs/better-auth/troubleshooting.mdx (1)
5-14: LGTM!The import and component usage are correct and consistent with the updated API pattern across the documentation.
apps/docs/content/docs/typegen/index.mdx (2)
10-19: LGTM!The import and component usage are correct. Using an empty
command=""for the initialization step is appropriate.
49-49: LGTM!Consistent usage of the
CliCommandcomponent for the "Running Typegen" section.apps/docs/src/components/PackageInstall.tsx (1)
1-43: Well-implemented component with clear logic.The version detection logic using
!pkg.includes("@", 1)correctly identifies scoped packages without explicit versions by starting the search after the initial@character. The component structure is clean and theMANAGERSconstant is appropriately extracted.apps/docs/content/docs/fmodata/quick-start.mdx (2)
15-24: LGTM!The
PackageInstallcomponent is correctly imported and used with the appropriatepackagesprop.
69-69: LGTM!Consistent usage of the updated
CliCommandcomponent with thepackageNameprop.apps/docs/src/components/CliCommand.tsx (1)
36-45: LGTM! Clean deprecation pattern with backwards compatibility.The approach of maintaining
execPackagefor backwards compatibility while introducingpackageNameis well-structured. The nullish coalescing correctly prioritizes the legacy prop when provided.apps/docs/content/docs/better-auth/installation.mdx (3)
35-35: LGTM! Dynamic package installation component.Using the
PackageInstallcomponent with the package name allows for consistent versioning across documentation, replacing hardcoded install commands.
64-67: LGTM! Correctly migrated to the new packageName prop.Both
CliCommandusages now usepackageName="@proofkit/better-auth"instead of the deprecatedexecPackageprop with hardcoded@betasuffix. This ensures the version is controlled centrally via thecliVersionconstant.
8-8: ThePackageInstallcomponent is properly exported as a named export with the correct prop interface. The import statement on line 8 is valid and the component usage is correct. No changes needed.

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com
Note
Standardizes docs to auto-version CLI/install snippets via a shared constant.
PackageInstallcomponent to render tabbed install commands, appending@{cliVersion}to@proofkit/*packagesCliCommandto acceptpackageName(deprecatedexecPackage) and compose${packageName}@${cliVersion}for exec usage@betaexamples across docs (better-authinstall/troubleshooting,fmodataquick-start,typegenquick start/UI) withCliCommand/PackageInstallexecPackagetopackageNamein MDX filesWritten by Cursor Bugbot for commit 97148f3. This will update automatically on new commits. Configure here.