feat(typecheck): prompt to install vue-tsc and typescript#1316
feat(typecheck): prompt to install vue-tsc and typescript#1316danielroe wants to merge 1 commit into
vue-tsc and typescript#1316Conversation
3fd74e1 to
013fd41
Compare
commit: |
📝 WalkthroughWalkthroughThis PR refactors the typecheck command to ensure required dev dependencies ( Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/nuxi/src/commands/typecheck.ts (1)
128-128: ⚡ Quick winConsider logging if resolution fails after successful installation.
After successfully installing dependencies, if
resolveDeps({ cache: false })['vue-tsc']returnsundefined, the function silently returnsundefinedwithout explaining why resolution failed post-installation. While this edge case is caught by the check at line 58, adding a logger statement here would help users debug this unexpected scenario.📝 Proposed logging enhancement
+ const resolved = resolveDeps({ cache: false })['vue-tsc'] + if (!resolved) { + logger.error(`Failed to resolve ${colors.cyan('vue-tsc')} after installation. Please check your installation.`) + } - return resolveDeps({ cache: false })['vue-tsc'] + return resolved🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/nuxi/src/commands/typecheck.ts` at line 128, The call resolveDeps({ cache: false })['vue-tsc'] can return undefined after installation but currently silently returns; update the code in typecheck.ts around the return to detect a falsy result from resolveDeps({ cache: false }) and log a clear message via the existing logger (or processLogger) indicating that dependency resolution for 'vue-tsc' failed after install and include any relevant context (e.g., that installation succeeded but resolution returned undefined), then return or throw as appropriate; reference the resolveDeps function call and the 'vue-tsc' lookup to locate the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/nuxi/src/commands/typecheck.ts`:
- Line 128: The call resolveDeps({ cache: false })['vue-tsc'] can return
undefined after installation but currently silently returns; update the code in
typecheck.ts around the return to detect a falsy result from resolveDeps({
cache: false }) and log a clear message via the existing logger (or
processLogger) indicating that dependency resolution for 'vue-tsc' failed after
install and include any relevant context (e.g., that installation succeeded but
resolution returned undefined), then return or throw as appropriate; reference
the resolveDeps function call and the 'vue-tsc' lookup to locate the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c4f54fcc-6438-44ad-a35a-52801345d9c1
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
knip.jsonpackages/nuxi/src/commands/typecheck.tsplayground/package.json
|
That's good idea! Let me know if you merge it. I'll create a pr for golar with additional docs for it 🙏🏻 |
vue-tsc and typescript for typecheckvue-tsc and typescript for typecheck
vue-tsc and typescript for typecheckvue-tsc and typescript
🔗 Linked issue
resolves nuxt/nuxt#35009
📚 Description
this adds a prompt to install
vue-tsc+typescriptif they are missing and can't be resolved.this might break users if they were relying on the implicit
npx vue-tscbehaviour but it's considerably safer to have typescript/vue-tsc installed (as they could break at any time!) and is easily worked around.here's what it looks like
Screen.Recording.2026-05-13.at.21.28.24.mov
btw, I think we could build on this and automatically use golar if it's present/installed by user, without the need for config or flag (cc: @OskarLebuda)