Skip to content

feat(cli): add Auth.js and shadcn/ui plugins#284

Open
gonzoblasco wants to merge 2 commits into
akd-io:developfrom
gonzoblasco:feature/268-add-authjs-shadcn
Open

feat(cli): add Auth.js and shadcn/ui plugins#284
gonzoblasco wants to merge 2 commits into
akd-io:developfrom
gonzoblasco:feature/268-add-authjs-shadcn

Conversation

@gonzoblasco

Copy link
Copy Markdown

Add Auth.js and shadcn/ui (#268)

Closes #268

Summary

Adds two new plugins: Auth.js (NextAuth v5) for authentication and shadcn/ui for accessible component library support.

Auth.js plugin

  • Dependency: next-auth@beta (v5)
  • Generated files:
    • auth.ts — NextAuth config with empty providers array
    • app/api/auth/[...nextauth]/route.ts — route handler exporting GET/POST
    • proxy.ts — Next.js 16 middleware (session refresh)
  • Environment variable: AUTH_SECRET
  • Validation: requires App Router (--router=app)
  • Flag: --auth-js

shadcn/ui plugin

  • Dependencies: class-variance-authority, clsx, tailwind-merge, tailwindcss-animate, lucide-react
  • Dev dependency: shadcn (for CLI usage)
  • Generated files:
    • components.json — shadcn config (new-york style, neutral base color, CSS variables enabled)
    • lib/utils.tscn() helper using clsx + tailwind-merge
  • Script: ui:add (shadcn add) for adding components
  • Validation: requires Tailwind CSS (--styling=tailwind-css)
  • Flag: --shadcn

Design decisions

  • Two separate plugins: Auth.js and shadcn/ui can be used independently. The issue asks for both, but they don't depend on each other.
  • Auth.js v5 (beta): This is the current version with native App Router support. The proxy.ts file follows the Next.js 16 naming convention (formerly middleware.ts).
  • shadcn/ui manual file generation: Instead of running shadcn init (which is interactive), the plugin generates components.json and lib/utils.ts directly. Users can then run shadcn add <component> to add components as needed.
  • No components pre-installed: The plugin sets up the infrastructure but doesn't add any shadcn components. Users choose what they need via shadcn add.

Verification

  • pnpm run build — clean
  • pnpm run lint — no errors
  • pnpm run unit — 9/9 tests pass
  • ./bin/run --help shows --auth-js and --shadcn flags
  • ✅ Validation works: --auth-js --router=pages throws error
  • ✅ Validation works: --shadcn --styling=css-modules throws error

Notes

  • Website (create-next-stack.com) is NOT updated in this PR.
  • Auth.js requires App Router because v5 is designed for App Router. Pages Router support was dropped in v5.
  • shadcn/ui requires Tailwind CSS because it's built on Tailwind.

Auth.js plugin:
- next-auth@beta (v5) dependency
- Generates auth.ts, app/api/auth/[...nextauth]/route.ts, and proxy.ts
- AUTH_SECRET environment variable
- Validation: requires App Router (--router=app)

shadcn/ui plugin:
- class-variance-authority, clsx, tailwind-merge, tailwindcss-animate, lucide-react deps
- shadcn devDependency for CLI usage
- Generates components.json (new-york style, neutral base color) and lib/utils.ts (cn helper)
- ui:add script for adding components
- Validation: requires Tailwind CSS (--styling=tailwind-css)
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

@gonzoblasco is attempting to deploy a commit to the 9ty Team on Vercel.

A member of the Team first needs to authorize it.

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.

Add Auth.js, and ShadCN

1 participant