Skip to content

Conversation

@batmn-dev
Copy link
Owner

@batmn-dev batmn-dev commented Jan 30, 2026

Summary

  • Monorepo Migration: Restructured project as a pnpm monorepo with Turborepo, separating the docs site (apps/www) from the component library (packages/ui)
  • Usage Meter Components: Added usage-meter and usage-meter-base components to the registry with variants (default, success, warning, danger) and size options
  • Documentation System: Implemented MDX-based documentation with component previews, installation tabs, and API tables following shadcn patterns
  • UI Refresh: Updated theme and typography with OKLCH color space, improved component styling, and added sidebar navigation
  • AI Agent Skills: Added comprehensive agent context files, skills (shadcn-ui, tailwind-v4-shadcn, monorepo-validation), and workflows
  • CI Pipeline: Added GitHub Actions workflow for linting, type checking, and building

Test plan

  • Verify pnpm install completes without errors
  • Verify pnpm build succeeds for all packages
  • Verify pnpm dev starts the docs site
  • Test component installation via npx shadcn add https://usage-ui.vercel.app/r/usage-meter.json
  • Verify documentation pages render correctly at /docs/[slug]
  • Check responsive design and theme toggle functionality

Summary by cubic

Migrates the project to a pnpm + Turborepo monorepo, rebuilds the docs to match shadcn patterns, and publishes Usage Meter components via the registry with a new theme and improved navigation. This makes installation easier, improves docs UX, and sets up CI for reliable builds.

  • New Features

    • Added Usage Meter and Usage Meter (Base) to the registry (installable via shadcn CLI) with variants and sizes; now depend on the external usage registry and the new theme.
    • Introduced an MDX-based docs system with live previews, install tabs, and API tables; refreshed home, tokens page, and sidebar to match shadcn’s layout and spacing.
    • Added a “Nature” OKLCH theme and registered brand blocks/components (blank, dashboard, store, header, sidebar, logo); enabled CI for linting, type checks, and builds; included MCP/agent configurations.
  • Migration

    • Monorepo structure: apps/www (docs site), packages/ui (component library) using pnpm and Turborepo.
    • Commands: pnpm install → pnpm build → pnpm dev.
    • Install a component: npx shadcn add https://usage-ui.vercel.app/r/usage-meter.json; docs available under /docs/[slug].

Written for commit 84ed9de. Summary will update on new commits.

- Update registry layout with proper container and grid structure
- Simplify home page to cleaner introduction with installation example
- Refactor sidebar for improved navigation
- Update docs layout with consistent spacing
- Refresh tokens page styling
@cursor
Copy link

cursor bot commented Jan 30, 2026

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on February 23.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@vercel
Copy link

vercel bot commented Jan 30, 2026

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

Project Deployment Actions Updated (UTC)
usage-ui Ready Ready Preview, Comment Jan 30, 2026 11:09pm

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 8 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="apps/www/public/r/usage-meter-base.json">

<violation number="1" location="apps/www/public/r/usage-meter-base.json:7">
P2: Avoid self-referencing the registry entry in registryDependencies; it creates a circular dependency for installers.</violation>
</file>

<file name="apps/www/public/r/usage-meter.json">

<violation number="1" location="apps/www/public/r/usage-meter.json:7">
P2: Avoid making a registry entry depend on itself; this creates a circular dependency during installation.</violation>

<violation number="2" location="apps/www/public/r/usage-meter.json:12">
P1: This registry entry no longer installs the usage-meter component; it installs a layout file instead. That will break consumers expecting the usage-meter component to be added.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

"content": "\"use client\";\n\nimport { Progress as ProgressPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst meterVariants = {\n default: \"bg-primary\",\n success: \"bg-chart-2\",\n warning: \"bg-chart-4\",\n danger: \"bg-destructive\",\n} as const;\n\nconst meterSizes = {\n sm: \"h-2\",\n default: \"h-3\",\n lg: \"h-4\",\n} as const;\n\ninterface UsageMeterProps\n extends Omit<\n React.ComponentProps<typeof ProgressPrimitive.Root>,\n \"value\" | \"max\"\n > {\n /** Current value (required) */\n value: number;\n /** Maximum value (default: 100) */\n max?: number;\n /** Visual variant */\n variant?: keyof typeof meterVariants;\n /** Size variant */\n size?: keyof typeof meterSizes;\n /** Optional label text */\n label?: string;\n /** Show percentage (default: true) */\n showPercentage?: boolean;\n}\n\nconst UsageMeter = React.forwardRef<\n React.ComponentRef<typeof ProgressPrimitive.Root>,\n UsageMeterProps\n>(\n (\n {\n className,\n value,\n max = 100,\n variant = \"default\",\n size = \"default\",\n label,\n showPercentage = true,\n ...props\n },\n ref,\n ) => {\n // Guard against max <= 0 to prevent division by zero and invalid progress state\n const safeMax = Math.max(1, max);\n const percentage = Math.round((value / safeMax) * 100);\n const clampedPercentage = Math.min(100, Math.max(0, percentage));\n\n return (\n <div data-slot=\"usage-meter-root\" className=\"w-full\">\n {(label || showPercentage) && (\n <div\n data-slot=\"usage-meter-header\"\n className=\"mb-1.5 flex items-center justify-between text-sm\"\n >\n {label && (\n <span\n data-slot=\"usage-meter-label\"\n className=\"font-medium text-foreground\"\n >\n {label}\n </span>\n )}\n {showPercentage && (\n <span\n data-slot=\"usage-meter-percentage\"\n className=\"text-muted-foreground tabular-nums\"\n >\n {clampedPercentage}%\n </span>\n )}\n </div>\n )}\n <ProgressPrimitive.Root\n ref={ref}\n data-slot=\"usage-meter\"\n value={value}\n max={safeMax}\n className={cn(\n \"relative w-full overflow-hidden rounded-full bg-secondary\",\n meterSizes[size],\n className,\n )}\n {...props}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"usage-meter-indicator\"\n className={cn(\n \"h-full w-full flex-1 transition-all duration-300 ease-in-out\",\n meterVariants[variant],\n )}\n style={{ transform: `translateX(-${100 - clampedPercentage}%)` }}\n />\n </ProgressPrimitive.Root>\n </div>\n );\n },\n);\nUsageMeter.displayName = \"UsageMeter\";\n\nexport { UsageMeter, meterVariants, meterSizes };\nexport type { UsageMeterProps };\n",
"type": "registry:component",
"target": "components/ui/usage-meter.tsx"
"path": "src/layouts/minimal-layout.tsx",
Copy link

@cubic-dev-ai cubic-dev-ai bot Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: This registry entry no longer installs the usage-meter component; it installs a layout file instead. That will break consumers expecting the usage-meter component to be added.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/www/public/r/usage-meter.json, line 12:

<comment>This registry entry no longer installs the usage-meter component; it installs a layout file instead. That will break consumers expecting the usage-meter component to be added.</comment>

<file context>
@@ -3,17 +3,17 @@
-      "content": "\"use client\";\n\nimport { Progress as ProgressPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst meterVariants = {\n  default: \"bg-primary\",\n  success: \"bg-chart-2\",\n  warning: \"bg-chart-4\",\n  danger: \"bg-destructive\",\n} as const;\n\nconst meterSizes = {\n  sm: \"h-2\",\n  default: \"h-3\",\n  lg: \"h-4\",\n} as const;\n\ninterface UsageMeterProps\n  extends Omit<\n    React.ComponentProps<typeof ProgressPrimitive.Root>,\n    \"value\" | \"max\"\n  > {\n  /** Current value (required) */\n  value: number;\n  /** Maximum value (default: 100) */\n  max?: number;\n  /** Visual variant */\n  variant?: keyof typeof meterVariants;\n  /** Size variant */\n  size?: keyof typeof meterSizes;\n  /** Optional label text */\n  label?: string;\n  /** Show percentage (default: true) */\n  showPercentage?: boolean;\n}\n\nconst UsageMeter = React.forwardRef<\n  React.ComponentRef<typeof ProgressPrimitive.Root>,\n  UsageMeterProps\n>(\n  (\n    {\n      className,\n      value,\n      max = 100,\n      variant = \"default\",\n      size = \"default\",\n      label,\n      showPercentage = true,\n      ...props\n    },\n    ref,\n  ) => {\n    // Guard against max <= 0 to prevent division by zero and invalid progress state\n    const safeMax = Math.max(1, max);\n    const percentage = Math.round((value / safeMax) * 100);\n    const clampedPercentage = Math.min(100, Math.max(0, percentage));\n\n    return (\n      <div data-slot=\"usage-meter-root\" className=\"w-full\">\n        {(label || showPercentage) && (\n          <div\n            data-slot=\"usage-meter-header\"\n            className=\"mb-1.5 flex items-center justify-between text-sm\"\n          >\n            {label && (\n              <span\n                data-slot=\"usage-meter-label\"\n                className=\"font-medium text-foreground\"\n              >\n                {label}\n              </span>\n            )}\n            {showPercentage && (\n              <span\n                data-slot=\"usage-meter-percentage\"\n                className=\"text-muted-foreground tabular-nums\"\n              >\n                {clampedPercentage}%\n              </span>\n            )}\n          </div>\n        )}\n        <ProgressPrimitive.Root\n          ref={ref}\n          data-slot=\"usage-meter\"\n          value={value}\n          max={safeMax}\n          className={cn(\n            \"relative w-full overflow-hidden rounded-full bg-secondary\",\n            meterSizes[size],\n            className,\n          )}\n          {...props}\n        >\n          <ProgressPrimitive.Indicator\n            data-slot=\"usage-meter-indicator\"\n            className={cn(\n              \"h-full w-full flex-1 transition-all duration-300 ease-in-out\",\n              meterVariants[variant],\n            )}\n            style={{ transform: `translateX(-${100 - clampedPercentage}%)` }}\n          />\n        </ProgressPrimitive.Root>\n      </div>\n    );\n  },\n);\nUsageMeter.displayName = \"UsageMeter\";\n\nexport { UsageMeter, meterVariants, meterSizes };\nexport type { UsageMeterProps };\n",
-      "type": "registry:component",
-      "target": "components/ui/usage-meter.tsx"
+      "path": "src/layouts/minimal-layout.tsx",
+      "content": "import { Geist, Geist_Mono, Montserrat } from \"next/font/google\";\nimport React, { type ReactNode } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nimport \"@/app/globals.css\";\n\nconst GeistSans = Geist({\n  subsets: [\"latin\"],\n  variable: \"--font-sans\",\n});\n\nconst GeistMono = Geist_Mono({\n  subsets: [\"latin\"],\n  variable: \"--font-mono\",\n});\n\nconst MontserratSerif = Montserrat({\n  subsets: [\"latin\"],\n  variable: \"--font-serif\",\n});\n\nexport default function RootLayout({\n  children,\n}: Readonly<{\n  children: ReactNode;\n}>) {\n  return (\n    <html\n      lang=\"en\"\n      className={cn(\n        GeistSans.variable,\n        GeistMono.variable,\n        MontserratSerif.variable,\n        \"bg-background text-foreground\",\n      )}\n    >\n      <body>\n        <main className=\"mt-16 flex w-full justify-center\">\n          <div className=\"container\">{children}</div>\n        </main>\n      </body>\n    </html>\n  );\n}\n",
+      "type": "registry:file",
</file context>
Fix with Cubic

"dependencies": [],
"registryDependencies": [],
"registryDependencies": [
"https://usage-ui.vercel.app/r/usage-meter-base.json",
Copy link

@cubic-dev-ai cubic-dev-ai bot Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Avoid self-referencing the registry entry in registryDependencies; it creates a circular dependency for installers.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/www/public/r/usage-meter-base.json, line 7:

<comment>Avoid self-referencing the registry entry in registryDependencies; it creates a circular dependency for installers.</comment>

<file context>
@@ -3,15 +3,17 @@
-  "dependencies": [],
-  "registryDependencies": [],
+  "registryDependencies": [
+    "https://usage-ui.vercel.app/r/usage-meter-base.json",
+    "https://registry-starter.vercel.app/r/theme.json"
+  ],
</file context>
Fix with Cubic

"dependencies": [
"radix-ui"
"registryDependencies": [
"https://usage-ui.vercel.app/r/usage-meter.json",
Copy link

@cubic-dev-ai cubic-dev-ai bot Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Avoid making a registry entry depend on itself; this creates a circular dependency during installation.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/www/public/r/usage-meter.json, line 7:

<comment>Avoid making a registry entry depend on itself; this creates a circular dependency during installation.</comment>

<file context>
@@ -3,17 +3,17 @@
-  "dependencies": [
-    "radix-ui"
+  "registryDependencies": [
+    "https://usage-ui.vercel.app/r/usage-meter.json",
+    "https://registry-starter.vercel.app/r/theme.json"
   ],
</file context>
Fix with Cubic

@greptile-apps
Copy link

greptile-apps bot commented Jan 30, 2026

Greptile Overview

Greptile Summary

This PR updates the documentation system layout and styling to follow shadcn/ui patterns, but has critical issues in the generated registry files that will break component installations.

Key Changes

  • Layout Improvements: Updated (registry)/layout.tsx and docs/layout.tsx with improved content wrappers, spacing, and responsive grid layouts matching shadcn documentation patterns
  • Sidebar Refactor: Simplified registry-sidebar.tsx by removing collapsible sections, search functionality, and hydration workarounds; added gradient fades for visual polish
  • Content Updates: Rewrote homepage with clearer introduction and tokens page with improved typography

Critical Issues

Registry Files (Breaking)

The generated registry JSON files have severe problems that will prevent component installations:

  1. Wrong Project Identity: registry.json still identifies as "Registry Starter" instead of "usage-ui" (lines 3-4)
  2. Circular Dependencies: Both usage-meter and usage-meter-base list themselves as dependencies, creating infinite loops
  3. Missing Component Code: usage-meter.json and usage-meter-base.json contain a layout template instead of the actual component implementations

These files are in apps/www/public/r/ which should be generated, not manually edited. The root cause is likely in the build script that generates these files.

TypeScript Issues

Both layout files use React.CSSProperties without importing React (lines 19-24 in both files), which will cause type errors.

Recommendations

  • Fix the registry generation script to output correct component code
  • Update registry metadata to reflect the Usage UI project
  • Add React import or use inline type assertion for CSSProperties

Confidence Score: 1/5

  • This PR has critical issues that will break component installations via shadcn CLI
  • The registry JSON files contain fundamental errors: wrong project metadata, circular dependencies, and missing component implementations. Users attempting to install components will receive incorrect files or encounter dependency resolution failures. The TypeScript errors are fixable but the registry issues require regeneration.
  • All three registry JSON files (apps/www/public/r/registry.json, usage-meter.json, usage-meter-base.json) need to be regenerated with correct content

Important Files Changed

Filename Overview
apps/www/public/r/registry.json Generated registry with incorrect project name, circular dependencies in usage-meter components, and missing actual component files
apps/www/public/r/usage-meter.json Contains layout file instead of usage-meter component and has circular self-dependency
apps/www/public/r/usage-meter-base.json Contains layout file instead of usage-meter-base component and has circular self-dependency
apps/www/src/app/(registry)/layout.tsx Updated layout with shadcn docs pattern, but uses React.CSSProperties without importing React
apps/www/src/app/docs/layout.tsx Updated docs layout with content wrapper and spacing, but uses React.CSSProperties without importing React

Sequence Diagram

sequenceDiagram
    participant User
    participant Browser
    participant DocsLayout
    participant RegistryLayout
    participant Sidebar
    participant RegistryJSON
    
    User->>Browser: Visit documentation site
    Browser->>DocsLayout: Load /docs/[slug]
    DocsLayout->>Sidebar: Render RegistrySidebar
    Sidebar->>RegistryJSON: Fetch component registry
    Note over RegistryJSON: Generated files in public/r/
    RegistryJSON-->>Sidebar: Return registry items
    Sidebar->>Sidebar: Generate navigation menu
    Sidebar-->>DocsLayout: Display sidebar with components
    DocsLayout-->>Browser: Render docs page with sidebar
    
    User->>Browser: Navigate to home page
    Browser->>RegistryLayout: Load / route
    RegistryLayout->>Sidebar: Render RegistrySidebar
    Sidebar->>RegistryJSON: Fetch component registry
    RegistryJSON-->>Sidebar: Return registry items
    RegistryLayout-->>Browser: Render home with introduction
    
    User->>Browser: Install component via shadcn CLI
    Browser->>RegistryJSON: GET /r/usage-meter.json
    Note over RegistryJSON: Should contain component code<br/>Currently has layout template
    RegistryJSON-->>Browser: Return component definition
    Browser->>User: Install fails or installs wrong file
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, 7 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +19 to +24
style={
{
"--sidebar-width": "calc(var(--spacing) * 64)",
"--top-spacing": "0",
} as React.CSSProperties
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React.CSSProperties requires importing React

Suggested change
style={
{
"--sidebar-width": "calc(var(--spacing) * 64)",
"--top-spacing": "0",
} as React.CSSProperties
}
style={
{
"--sidebar-width": "calc(var(--spacing) * 64)",
"--top-spacing": "0",
} as import("react").CSSProperties
}

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!

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/www/src/app/(registry)/layout.tsx
Line: 19:24

Comment:
`React.CSSProperties` requires importing `React`

```suggestion
        style={
          {
            "--sidebar-width": "calc(var(--spacing) * 64)",
            "--top-spacing": "0",
          } as import("react").CSSProperties
        }
```

<sub>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!</sub>

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +19 to +24
style={
{
"--sidebar-width": "calc(var(--spacing) * 64)",
"--top-spacing": "0",
} as React.CSSProperties
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React.CSSProperties requires importing React

Suggested change
style={
{
"--sidebar-width": "calc(var(--spacing) * 64)",
"--top-spacing": "0",
} as React.CSSProperties
}
style={
{
"--sidebar-width": "calc(var(--spacing) * 64)",
"--top-spacing": "0",
} as import("react").CSSProperties
}

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!

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/www/src/app/docs/layout.tsx
Line: 19:24

Comment:
`React.CSSProperties` requires importing `React`

```suggestion
        style={
          {
            "--sidebar-width": "calc(var(--spacing) * 64)",
            "--top-spacing": "0",
          } as import("react").CSSProperties
        }
```

<sub>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!</sub>

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +3 to +4
"name": "Registry Starter",
"homepage": "https://registry-starter.vercel.app",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registry name and homepage don't match the Usage UI project - these appear to be leftover values from "Registry Starter"

Suggested change
"name": "Registry Starter",
"homepage": "https://registry-starter.vercel.app",
"name": "usage-ui",
"homepage": "https://usage-ui.vercel.app",
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/www/public/r/registry.json
Line: 3:4

Comment:
Registry name and homepage don't match the Usage UI project - these appear to be leftover values from "Registry Starter"

```suggestion
  "name": "usage-ui",
  "homepage": "https://usage-ui.vercel.app",
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +809 to +811
"registryDependencies": [
"https://usage-ui.vercel.app/r/usage-meter.json",
"https://registry-starter.vercel.app/r/theme.json"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circular dependency - usage-meter depends on itself via https://usage-ui.vercel.app/r/usage-meter.json

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/www/public/r/registry.json
Line: 809:811

Comment:
Circular dependency - `usage-meter` depends on itself via `https://usage-ui.vercel.app/r/usage-meter.json`

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +826 to +828
"registryDependencies": [
"https://usage-ui.vercel.app/r/usage-meter-base.json",
"https://registry-starter.vercel.app/r/theme.json"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circular dependency - usage-meter-base depends on itself via https://usage-ui.vercel.app/r/usage-meter-base.json

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/www/public/r/registry.json
Line: 826:828

Comment:
Circular dependency - `usage-meter-base` depends on itself via `https://usage-ui.vercel.app/r/usage-meter-base.json`

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +6 to +8
"registryDependencies": [
"https://usage-ui.vercel.app/r/usage-meter.json",
"https://registry-starter.vercel.app/r/theme.json"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circular dependency and wrong file provided - should contain actual usage-meter component code, not a layout template

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/www/public/r/usage-meter.json
Line: 6:8

Comment:
Circular dependency and wrong file provided - should contain actual `usage-meter` component code, not a layout template

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +6 to +8
"registryDependencies": [
"https://usage-ui.vercel.app/r/usage-meter-base.json",
"https://registry-starter.vercel.app/r/theme.json"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circular dependency and wrong file provided - should contain actual usage-meter-base component code, not a layout template

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/www/public/r/usage-meter-base.json
Line: 6:8

Comment:
Circular dependency and wrong file provided - should contain actual `usage-meter-base` component code, not a layout template

How can I resolve this? If you propose a fix, please make it concise.

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