Skip to content

Conversation

@eluce2
Copy link
Collaborator

@eluce2 eluce2 commented Aug 25, 2025

dynamic templates

simplify settings

better cli

Refactor CLI and registry templates to support schema selection and enhance handlebars processing. Introduce new post-install steps for templates, update metadata structure, and improve error handling in template installation. Add support for dynamic route names in static components and ensure compatibility with Shadcn. Update dependencies and template paths for better consistency.

update changeset

update to beta

Summary by CodeRabbit

  • New Features

    • Schema-aware page template installation with Handlebars rendering and automatic navigation.
    • New “Basic Table” page template and Nuqs provider utility.
    • Dynamic env file detection; Next.js app/pages detection in projects.
    • Updated Next.js + shadcn template (Tailwind v4, Biome, VS Code settings, cn util, revised theming/icons).
  • Changes

    • Shadcn projects must add Auth via the template registry; Auth option hidden in CLI.
    • Mantine UI templates deprecated for new projects.
    • Adds zod dependency to shadcn projects.
  • Documentation

    • Updated guidance for shadcn usage and added template rules/README.
  • Chores

    • Beta pre-release versions across packages (CLI 1.2.0-beta.0).

@vercel
Copy link

vercel bot commented Aug 25, 2025

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

Project Deployment Preview Updated (UTC)
proofkit-docs Ready Ready Preview Aug 25, 2025 2:20am

@eluce2 eluce2 marked this pull request as ready for review August 25, 2025 02:14
This was referenced Aug 25, 2025
Copy link
Collaborator Author

eluce2 commented Aug 25, 2025

@eluce2 eluce2 mentioned this pull request Aug 25, 2025
Copy link
Collaborator Author

eluce2 commented Aug 25, 2025

Merge activity

  • Aug 25, 2:15 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Aug 25, 2:19 AM UTC: Graphite rebased this pull request as part of a merge.
  • Aug 25, 2:19 AM UTC: @eluce2 merged this pull request with Graphite.

@eluce2 eluce2 changed the base branch from 08-08-better-auth_in_cli to graphite-base/70 August 25, 2025 02:16
@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 25, 2025

Open in StackBlitz

@proofkit/better-auth

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/better-auth@70

@proofkit/cli

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/cli@70

create-proofkit

pnpm add https://pkg.pr.new/proofgeist/proofkit/create-proofkit@70

@proofkit/fmdapi

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/fmdapi@70

@proofkit/typegen

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/typegen@70

@proofkit/webviewer

pnpm add https://pkg.pr.new/proofgeist/proofkit/@proofkit/webviewer@70

commit: b7c2f72

@eluce2 eluce2 changed the base branch from graphite-base/70 to main August 25, 2025 02:17
eluce2 added 6 commits August 25, 2025 02:18
…nhance handlebars processing. Introduce new post-install steps for templates, update metadata structure, and improve error handling in template installation. Add support for dynamic route names in static components and ensure compatibility with Shadcn. Update dependencies and template paths for better consistency.
@eluce2 eluce2 force-pushed the 08-22-dynamic_templates branch from 2a2317b to b7c2f72 Compare August 25, 2025 02:18
@eluce2 eluce2 merged commit 26b523c into main Aug 25, 2025
3 of 4 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Aug 25, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Introduces a beta pre-release across packages. Overhauls CLI to gate Mantine vs Shadcn flows, add route/schema-aware registry installs with Handlebars rendering, Next.js detection, env discovery, and navigation updates. Updates registry schemas/APIs for Handlebars and routeName, adds new table/page templates, adjusts docs route, and refreshes the Shadcn Next.js template.

Changes

Cohort / File(s) Summary
Pre-release config
.\changeset/pre.json, .changeset/ui-default-shadcn.md
Adds pre-release config (mode pre, tag beta) and documents Shadcn-first workflow; deprecates Mantine templates for new projects.
Editor/planning misc
.cursor/plans/static-registry.md
Whitespace tweak; no functional change.
Docs registry route
apps/docs/src/app/r/[[...name]]/registry.ts
Switches to routeName-based retrieval; uses getStaticComponentForShadcn; rewrites dependencies to absolute; removes 501 dynamic branch.
CLI version/deps
packages/cli/package.json
Bumps to 1.2.0-beta.0; adds handlebars runtime dep.
CLI add flow gating
packages/cli/src/cli/add/auth.ts, packages/cli/src/cli/add/index.ts, packages/cli/src/cli/add/page/post-install/table.ts
Blocks Auth on Shadcn (throws/hidden option); skips table post-install for Shadcn; minor control-flow adjustments.
CLI registry install feature
packages/cli/src/cli/add/registry/install.ts
New page/template install flow: prompts for routeName, data source schema, renders Handlebars, updates nav, dedupes post-install, builds registry URL.
CLI registry support utils
packages/cli/src/cli/add/registry/getOptions.ts, .../postInstall/{handlebars.ts,index.ts,wrap-provider.ts}, .../preflight.ts
Adds Next.js detection (next-app/pages); introduces Handlebars data/rendering/path resolution; supports “next-steps” post-install; improves wrap provider for parenthesized returns; formatting.
CLI init/settings model
packages/cli/src/cli/init.ts, packages/cli/src/utils/parseSettings.ts
Discriminated settings by ui (mantine/shadcn); Shadcn-specific initial settings; merge now validates; defaults to ui: "shadcn".
CLI generators guards
packages/cli/src/generators/{auth.ts,tanstack-query.ts}
Early Shadcn guards (throw/return false) to disable Mantine-specific paths.
CLI helpers
packages/cli/src/helpers/{createProject.ts,shadcn-cli.ts,stealth-init.ts}
Adds zod dep for Shadcn projects; uses state.projectDir for shadcn CLI exec; formatting.
CLI installers/env
packages/cli/src/installers/{dependencyVersionMap.ts,envVars.ts,react-email.ts}
Adds zod to version map; dynamic T3 env file discovery API; skip react-email for Shadcn.
CLI utils env
packages/cli/src/utils/addToEnvs.ts
Uses findT3EnvFile() to resolve env schema path.
Template: Next.js Shadcn scaffolding
packages/cli/template/nextjs-shadcn/**/*
Modernizes template: Biome config, VSCode settings, ultracite rules, dependencies/scripts, Tailwind v4 config, components.json aliases, next.config import '@/lib/env', moves globals.css, stricter tsconfig, UI/icon updates, new lib/utils.ts cn, removes legacy helpers and safe-action stub, adjusts layout/main content.
Registry core schemas/APIs
packages/registry/lib/{types.ts,utils.ts,validator.ts}
Adds file.handlebars, template metadata revamp (schemaRequired, no type), registry index shape change, routeName-aware getStaticComponent, new getStaticComponentForShadcn, Handlebars encode/decode, validator checks .hbs existence.
Registry templates updates
packages/registry/templates/**/*
Removes meta.type across templates; adds better-auth Handlebars (auth.hbs), updates paths/imports; adds table/basic page template set (meta/constants/page.hbs/table.hbs/README.hbs); adds utils/nuqs meta; t3-env meta moves docs to postInstall next-steps; minor env.ts formatting.
Package versioning
packages/fmdapi/{CHANGELOG.md,package.json}, packages/typegen/{CHANGELOG.md,package.json}
Bumps to beta versions; notes fmdapi type-safety change; updates dependent version.
Dev/test script
test_handlebars.js
Demonstrates Handlebars token encoding/decoding and mock rendering for CLI compatibility.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant CLI as ProofKit CLI
  participant State as Project State
  participant Reg as Registry Service
  participant FS as Filesystem
  participant Nav as Navigation Config

  Dev->>CLI: proofkit add page/basic
  CLI->>State: load settings (ui, dataSources, projectDir)
  alt ui == "shadcn"
    CLI->>Dev: prompt routeName (/customers)
    opt template requires schema
      CLI->>Dev: select data source + schema
    end
    CLI->>Reg: GET /r/.../table/basic.json?routeName
    Reg-->>CLI: Template + files (handlebars-encoded)
    CLI->>CLI: build Handlebars data (settings, schema)
    CLI->>FS: render files to src/app/__PATH__/
    CLI->>Nav: add primary nav entry (label=pageName, href=/route)
    CLI->>CLI: run postInstall steps (deduped)
    CLI-->>Dev: Done
  else ui != "shadcn"
    CLI-->>Dev: Fallback/add flow (unchanged)
  end
Loading
sequenceDiagram
  autonumber
  participant Browser
  participant Docs as Docs Route /r/[...name]
  participant Reg as @proofkit/registry
  participant Origin as Request URL Origin

  Browser->>Docs: GET /r/.../registry.ts?routeName
  Docs->>Docs: parse routeName (decode/normalize)
  Docs->>Reg: getStaticComponentForShadcn(path, { routeName })
  Reg-->>Docs: RegistryItem (files, registryDependencies)
  Docs->>Docs: replace {proofkit} with Origin in dependencies
  Docs-->>Browser: 200 JSON (or 404 on error)
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

  • custom registry base #59 — Touches registry APIs/routes that this PR extends (routeName support, static component retrieval).
  • shadcn registry #43 — Implements the Shadcn component registry groundwork; this PR adds Handlebars and page flow on top.
  • add shadcn to template #44 — Adjusts CLI Shadcn integration; this PR further evolves CLI Shadcn flows and dependencies.

Suggested reviewers

  • chriscors

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 92914b9 and b7c2f72.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (70)
  • .changeset/pre.json (1 hunks)
  • .changeset/ui-default-shadcn.md (1 hunks)
  • .cursor/plans/static-registry.md (1 hunks)
  • apps/docs/src/app/r/[[...name]]/registry.ts (2 hunks)
  • packages/cli/package.json (2 hunks)
  • packages/cli/src/cli/add/auth.ts (1 hunks)
  • packages/cli/src/cli/add/index.ts (2 hunks)
  • packages/cli/src/cli/add/page/post-install/table.ts (1 hunks)
  • packages/cli/src/cli/add/registry/getOptions.ts (2 hunks)
  • packages/cli/src/cli/add/registry/install.ts (2 hunks)
  • packages/cli/src/cli/add/registry/postInstall/handlebars.ts (1 hunks)
  • packages/cli/src/cli/add/registry/postInstall/index.ts (1 hunks)
  • packages/cli/src/cli/add/registry/postInstall/wrap-provider.ts (2 hunks)
  • packages/cli/src/cli/add/registry/preflight.ts (1 hunks)
  • packages/cli/src/cli/init.ts (1 hunks)
  • packages/cli/src/generators/auth.ts (1 hunks)
  • packages/cli/src/generators/tanstack-query.ts (1 hunks)
  • packages/cli/src/helpers/createProject.ts (1 hunks)
  • packages/cli/src/helpers/shadcn-cli.ts (2 hunks)
  • packages/cli/src/helpers/stealth-init.ts (1 hunks)
  • packages/cli/src/installers/dependencyVersionMap.ts (1 hunks)
  • packages/cli/src/installers/envVars.ts (2 hunks)
  • packages/cli/src/installers/react-email.ts (1 hunks)
  • packages/cli/src/upgrades/index.ts (2 hunks)
  • packages/cli/src/utils/addToEnvs.ts (2 hunks)
  • packages/cli/src/utils/parseSettings.ts (2 hunks)
  • packages/cli/template/nextjs-shadcn/.claude/CLAUDE.md (1 hunks)
  • packages/cli/template/nextjs-shadcn/.cursor/rules/ultracite.mdc (1 hunks)
  • packages/cli/template/nextjs-shadcn/.vscode/settings.json (1 hunks)
  • packages/cli/template/nextjs-shadcn/biome.json (1 hunks)
  • packages/cli/template/nextjs-shadcn/components.json (1 hunks)
  • packages/cli/template/nextjs-shadcn/next.config.ts (1 hunks)
  • packages/cli/template/nextjs-shadcn/package.json (1 hunks)
  • packages/cli/template/nextjs-shadcn/postcss.config.cjs (0 hunks)
  • packages/cli/template/nextjs-shadcn/postcss.config.mjs (1 hunks)
  • packages/cli/template/nextjs-shadcn/proofkit.json (1 hunks)
  • packages/cli/template/nextjs-shadcn/src/app/(main)/page.tsx (2 hunks)
  • packages/cli/template/nextjs-shadcn/src/app/globals.css (2 hunks)
  • packages/cli/template/nextjs-shadcn/src/app/layout.tsx (1 hunks)
  • packages/cli/template/nextjs-shadcn/src/components/AppLogo.tsx (1 hunks)
  • packages/cli/template/nextjs-shadcn/src/components/AppShell/internal/AppShell.tsx (1 hunks)
  • packages/cli/template/nextjs-shadcn/src/lib/env.ts (0 hunks)
  • packages/cli/template/nextjs-shadcn/src/lib/utils.ts (1 hunks)
  • packages/cli/template/nextjs-shadcn/src/server/safe-action.ts (0 hunks)
  • packages/cli/template/nextjs-shadcn/src/utils/notification-helpers.ts (0 hunks)
  • packages/cli/template/nextjs-shadcn/src/utils/styles.ts (0 hunks)
  • packages/cli/template/nextjs-shadcn/tsconfig.json (2 hunks)
  • packages/fmdapi/CHANGELOG.md (1 hunks)
  • packages/fmdapi/package.json (1 hunks)
  • packages/registry/lib/types.ts (4 hunks)
  • packages/registry/lib/utils.ts (2 hunks)
  • packages/registry/lib/validator.ts (2 hunks)
  • packages/registry/templates/better-auth/_meta.ts (3 hunks)
  • packages/registry/templates/better-auth/auth.hbs (1 hunks)
  • packages/registry/templates/better-auth/auth.ts (0 hunks)
  • packages/registry/templates/components/mode-toggle/_meta.ts (0 hunks)
  • packages/registry/templates/email/auth-code/_meta.ts (0 hunks)
  • packages/registry/templates/email/generic/_meta.ts (0 hunks)
  • packages/registry/templates/react-email/_meta.ts (0 hunks)
  • packages/registry/templates/table/basic/README.hbs (1 hunks)
  • packages/registry/templates/table/basic/_meta.ts (1 hunks)
  • packages/registry/templates/table/basic/constants.ts (1 hunks)
  • packages/registry/templates/table/basic/page.hbs (1 hunks)
  • packages/registry/templates/table/basic/table.hbs (1 hunks)
  • packages/registry/templates/utils/nuqs/_meta.ts (1 hunks)
  • packages/registry/templates/utils/t3-env/_meta.ts (1 hunks)
  • packages/registry/templates/utils/t3-env/env.ts (1 hunks)
  • packages/typegen/CHANGELOG.md (1 hunks)
  • packages/typegen/package.json (1 hunks)
  • test_handlebars.js (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 08-22-dynamic_templates

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

2 participants