Show issues from all time

πŸ”— Linked issue

Refs: #1330, #1384 <!-- related PRs/discussions about Nuxt 4 tsconfig detection -->

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix
  • πŸ‘Œ Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

πŸ“š Description

Explain
Nuxt 4 defaults to the app/ directory and commonly uses a root tsconfig.json with project references only.
The shadcn-vue CLI validates TS path aliases from tsconfig.json/jsconfig.json, so without explicit compilerOptions.paths, users can hit β€œNo import alias found”.
Also, pointing componentDir at ./components/ui (Nuxt 3 style) can confuse Nuxt 4 users whose components live under app/components/ui.

What this PR changes

  1. Add a tsconfig.json (aliases) section (before nuxt.config.ts) showing explicit compilerOptions.paths:
    • Keep @/* and ~/* mapped to project root.
    • Map @/components/* β†’ ./app/components/* (Nuxt 4).
  2. In Configure nuxt.config.ts, set
    shadcn.componentDir = './app/components/ui' for Nuxt 4.
  3. Doc note about ordering: run the CLI before nuxi prepare (or mention mkdir -p app/components/ui) to avoid the β€œComponent directory does not exist …/components/ui” warning.
  4. Keep Nuxt 3 instructions intact.

Why
Ensures init/add pass alias validation and avoids confusing warnings for Nuxt 4 users.
Forward-compatible with ongoing work to auto-detect tsconfig for Nuxt (#1330, #1384).

Tested

  • Fresh Nuxt 4 app:
    • npx shadcn-vue@latest init βœ…
    • npx shadcn-vue@latest add button βœ…
    • npx nuxi prepare β†’ no warnings βœ…

πŸ“Έ Screenshots (if appropriate)

N/A (docs-only)

πŸ“ Checklist

  • I have linked an issue or discussion. (Refs: #1330, #1384)
  • I have updated the documentation accordingly.
Next issue in about 2 hours