feat(doctor): add Node.js version and Tailwind CSS checks (fix #193) - #194
feat(doctor): add Node.js version and Tailwind CSS checks (fix #193)#194aosmcleod wants to merge 2 commits into
Conversation
|
|
||
| const problemRecord: ProblemRecord[] = []; | ||
|
|
||
| // Check 1: Node.js version meets minimum requirement |
There was a problem hiding this comment.
when no heroui package is installed, this will be silently dropped
| const nodeVersion = process.versions.node; | ||
| const [nodeMajor] = nodeVersion.split('.').map(Number); | ||
|
|
||
| if (nodeMajor != null && nodeMajor < 22) { |
There was a problem hiding this comment.
node 22.0.0 - 22.21.x gets a false green light.
ref: see package.json
"engines": {
"node": ">=22.22.0",
"pnpm": ">=10.x"
},| }); | ||
| } | ||
|
|
||
| // Check 3: Tailwind CSS is installed |
There was a problem hiding this comment.
i think this one is not required as tailwindcss is a peer dependency where we already have the check below. If we add this check 3 and tw is missing, users will get 2 issues for the same root cause.
- Compare Node.js version against the full engines.node value (22.22.0) instead of major only, which was greenlighting 22.0.0 - 22.21.x. - Drop the dedicated Tailwind CSS check. Tailwind is a peer dependency of @heroui/react and is covered by the peer-dependency check, so the dedicated check produced two issues for the same root cause. - Convert the "no HeroUI packages" early return into a problemRecord entry so an unsupportedNodeVersion issue isn't silently dropped when HeroUI itself is missing.
|
@wingkwong addressed all three comments:
Ready for re-review. |
Closes #193
📝 Description
Expands the
doctorcommand with two additional checks that catch common setup issues before users hit confusing runtime errors.1. Node.js version check
The README states Node.js 22+ is required, but the
doctorcommand didn't verify this. Users on older Node versions (18/20 LTS are still common) get cryptic errors instead of a clear diagnostic.2. Tailwind CSS installation check
The
TAILWINDCSSconstant already existed insrc/constants/required.tsbut wasn't used in the doctor action. While the generic peer dependency check might catch this, a dedicated check provides a more helpful error message explaining that HeroUI v3 specifically requires Tailwind CSS v4.Current behavior
heroui doctor # Only checks: packages installed + peer deps metNew behavior
heroui doctor # Checks: Node version + packages installed + Tailwind CSS + peer deps metEach new check follows the existing
problemRecordpattern — no new abstractions or dependencies introduced.💣 Is this a breaking change (Yes/No):
No — strictly additive diagnostics. Existing checks are unchanged.
✅ Type of change