fix: proper XDG base dir support using rc9 - #465
Conversation
| } | ||
|
|
||
| if (disabledByConf(rc.readUser({ name: RC_FILENAME }))) { | ||
| if (disabledByConf(rc.readUserConfig({ name: RC_FILENAME }))) { |
There was a problem hiding this comment.
will this still support ~/.nuxtrc (ie backwards compatibility)?
There was a problem hiding this comment.
Ohh right, I forgot about that
There was a problem hiding this comment.
I think it should be backward compatible now. Just need to add the new config read is all instead of replacing the old one
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe CLI checks both legacy and XDG-based user configuration locations for disabled telemetry and uses Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@src/cli.ts`:
- Around line 157-159: Update the disabledByConf branch in the CLI flow to
report the config path using the same XDG-aware base directory as
readUserConfig({ name: RC_FILENAME }). Replace the homedir-based resolve with
the existing configuration-directory resolution used by rc9, while preserving
the current message format and RC_FILENAME usage.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2308ab85-5e0b-427f-b845-84480974a094
📒 Files selected for processing (2)
src/cli.tssrc/utils/nuxtrc.ts
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/cli.ts (1)
182-182: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winCreate the XDG directory before the global rc9 write.
At
src/cli.ts:182,rc.updateUserConfig(update, RC_FILENAME)resolves to~/.config/.nuxtrcby default, and rc9’s write path does not create parent directories, so a first-time globalenable/disable/consentcan fail withENOENT. Reuse the samemkdirSync(rc9Base, { recursive: true })pattern already used bysrc/utils/nuxtrc.tsbefore callingrc.updateUserConfig.🤖 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 `@src/cli.ts` at line 182, Before the global rc9 write in the CLI flow, create the resolved rc9 base directory with mkdirSync(rc9Base, { recursive: true }), matching the existing pattern in nuxtrc utilities. Ensure this directory creation occurs before rc.updateUserConfig(update, RC_FILENAME) for first-time enable, disable, and consent operations.Source: MCP tools
🤖 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.
Outside diff comments:
In `@src/cli.ts`:
- Line 182: Before the global rc9 write in the CLI flow, create the resolved rc9
base directory with mkdirSync(rc9Base, { recursive: true }), matching the
existing pattern in nuxtrc utilities. Ensure this directory creation occurs
before rc.updateUserConfig(update, RC_FILENAME) for first-time enable, disable,
and consent operations.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3102f2fa-90e3-4348-b523-b21ad35a49f3
📒 Files selected for processing (2)
src/cli.tssrc/utils/nuxtrc.ts
🔗 Linked issue
resolves #464
📚 Description
Change the API used to get user config