Skip to content

Conversation

@eluce2
Copy link
Collaborator

@eluce2 eluce2 commented Jan 12, 2026

  • 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


Note

Standardizes docs to auto-version CLI/install snippets via a shared constant.

  • Adds PackageInstall component to render tabbed install commands, appending @{cliVersion} to @proofkit/* packages
  • Updates CliCommand to accept packageName (deprecated execPackage) and compose ${packageName}@${cliVersion} for exec usage
  • Replaces hardcoded @beta examples across docs (better-auth install/troubleshooting, fmodata quick-start, typegen quick start/UI) with CliCommand/PackageInstall
  • Adjusts usage from execPackage to packageName in MDX files

Written by Cursor Bugbot for commit 97148f3. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Jan 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
proofkit-docs Ready Ready Preview Jan 12, 2026 5:00pm

Copy link
Collaborator Author

eluce2 commented Jan 12, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

- 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>
@eluce2 eluce2 force-pushed the 01-12-docs_use_cliversion_constant_instead_of_hardcoded_beta branch from 253214e to 97148f3 Compare January 12, 2026 16:59
Copy link
Collaborator Author

eluce2 commented Jan 12, 2026

@CodeRabbit review

@coderabbitai
Copy link

coderabbitai bot commented Jan 12, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link

coderabbitai bot commented Jan 12, 2026

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
Component Enhancements
apps/docs/src/components/CliCommand.tsx
Updated CliCommand component signature to add optional packageName prop and mark execPackage as deprecated. Internally resolves package reference using packageName@cliVersion when execPackage is not provided.
Component Additions
apps/docs/src/components/PackageInstall.tsx
New client component that renders tabbed installation instructions across npm, pnpm, yarn, and bun. Auto-appends CLI version to @proofkit/ packages lacking version specification. Exported as both named and default export.
Installation & Quick-Start Docs
apps/docs/content/docs/better-auth/installation.mdx, apps/docs/content/docs/fmodata/quick-start.mdx
Added PackageInstall component imports and replaced static code blocks with <PackageInstall packages="..." /> invocations. Updated CliCommand usage to use packageName prop instead of execPackage, removing version suffixes.
Usage & Troubleshooting Docs
apps/docs/content/docs/better-auth/troubleshooting.mdx, apps/docs/content/docs/typegen/ui.mdx
Added CliCommand component imports and replaced inline shell examples with component invocations using packageName prop (e.g., <CliCommand command="migrate" exec packageName="@proofkit/better-auth" />).
Index Documentation
apps/docs/content/docs/typegen/index.mdx
Added CliCommand component import and consolidated multiple platform-specific shell instructions (pnpm/npm) into single CliCommand components using packageName prop in Quick Start and Running Typegen sections.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • proofgeist/proofkit\template docs #74: Both PRs modify the CliCommand component signature and its usage patterns across documentation files.
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: replacing hardcoded @beta references with a cliVersion constant throughout the documentation components.
Description check ✅ Passed The pull request description clearly outlines the changes: adding a packageName prop to CliCommand, creating a PackageInstall component, and converting hardcoded @beta references to use a constant throughout the documentation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 301df30 and 97148f3.

📒 Files selected for processing (7)
  • apps/docs/content/docs/better-auth/installation.mdx
  • apps/docs/content/docs/better-auth/troubleshooting.mdx
  • apps/docs/content/docs/fmodata/quick-start.mdx
  • apps/docs/content/docs/typegen/index.mdx
  • apps/docs/content/docs/typegen/ui.mdx
  • apps/docs/src/components/CliCommand.tsx
  • apps/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
Prefer unknown over any when 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.tsx
  • apps/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
Prefer for...of loops over .forEach() and indexed for loops
Use optional chaining (?.) and nullish coalescing (??) for safer property access
Prefer template literals over string concatenation
Use destructuring for object and array assignments
Use const by default, let only when reassignment is needed, never var
Always await promises in async functions - don't forget to use the return value
Use async/await syntax 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
Remove console.log, debugger, and alert statements from production code
Throw Error objects with descriptive messages, not strings or other values
Use try-catch blocks 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 use eval() or assign directly to document.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.tsx
  • apps/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 the key prop 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
Add rel="noopener" when using target="_blank" on links
Avoid dangerouslySetInnerHTML unless absolutely necessary
Use proper image components (e.g., Next.js <Image>) over <img> tags
Use Next.js <Image> component for images
Use next/head or 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 of React.forwardRef in React 19+

Files:

  • apps/docs/src/components/PackageInstall.tsx
  • apps/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 CliCommand component properly uses the new packageName prop 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 CliCommand component 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 the MANAGERS constant is appropriately extracted.

apps/docs/content/docs/fmodata/quick-start.mdx (2)

15-24: LGTM!

The PackageInstall component is correctly imported and used with the appropriate packages prop.


69-69: LGTM!

Consistent usage of the updated CliCommand component with the packageName prop.

apps/docs/src/components/CliCommand.tsx (1)

36-45: LGTM! Clean deprecation pattern with backwards compatibility.

The approach of maintaining execPackage for backwards compatibility while introducing packageName is 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 PackageInstall component 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 CliCommand usages now use packageName="@proofkit/better-auth" instead of the deprecated execPackage prop with hardcoded @beta suffix. This ensures the version is controlled centrally via the cliVersion constant.


8-8: The PackageInstall component 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.

@eluce2 eluce2 marked this pull request as ready for review January 12, 2026 17:15
@eluce2 eluce2 merged commit 849e3b5 into main Jan 12, 2026
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant