Skip to content

Install under ~/.config/fish/conf.d for Fish setup#28

Open
choimadeleine wants to merge 1 commit into
pnpm:mainfrom
choimadeleine:main
Open

Install under ~/.config/fish/conf.d for Fish setup#28
choimadeleine wants to merge 1 commit into
pnpm:mainfrom
choimadeleine:main

Conversation

@choimadeleine
Copy link
Copy Markdown

@choimadeleine choimadeleine commented May 22, 2026

For pnpm setup, append to ~/.config/fish/conf.d/pnpm.fish instead of
~/.config/fish/config.fish.

Closes pnpm/pnpm#11852.

Summary by CodeRabbit

  • Bug Fixes
    • Updated Fish shell configuration handling to write PNPM settings to a dedicated configuration location instead of the main shell configuration file, improving configuration management and reducing potential conflicts.

Review Change Stack

For `pnpm setup`, append to ~/.config/fish/conf.d/pnpm.fish instead of
~/.config/fish/config.fish.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

📝 Walkthrough

Walkthrough

This PR changes the Fish shell integration to write PNPM environment configuration to a dedicated file in ~/.config/fish/conf.d/pnpm.fish instead of appending to the general ~/.config/fish/config.fish. Both the implementation and corresponding test cases are updated to reflect this isolated configuration approach.

Changes

Fish shell configuration isolation

Layer / File(s) Summary
Fish shell path extender conf.d location
os/env/path-extender-posix/path-extender-posix.ts
The setupFishShell function now targets ~/.config/fish/conf.d/pnpm.fish for writing configuration instead of the main config.fish file.
Fish shell test suite updates
os/env/path-extender-posix/path-extender-posix.spec.ts
Test beforeEach setup and all Fish shell test cases create the .config/fish/conf.d directory and assert against the new pnpm.fish file location.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

  • #11852: Directly implements the requested feature to install PNPM configuration into ~/.config/fish/conf.d/pnpm.fish instead of modifying the main config.fish file.

Poem

🐰 A Fish that swam in conf.d,
Left config.fish wild and free,
Each shell now gets its own neat space,
No clutter in the config place! 🐚✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: installing Fish configuration under ~/.config/fish/conf.d instead of the main config.fish file.
Linked Issues check ✅ Passed The code changes directly address the requirement to install pnpm setup's Fish configuration into ~/.config/fish/conf.d/pnpm.fish, updating both the implementation and corresponding test cases.
Out of Scope Changes check ✅ Passed All changes are scoped to the Fish shell path extender implementation and its tests, directly supporting the Fish conf.d migration objective with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
os/env/path-extender-posix/path-extender-posix.spec.ts (1)

986-986: ⚡ Quick win

Use configFile-derived directory instead of cwd-relative mkdir.

Line 986 and the other fish setup lines create '.config/fish/conf.d' relative to the process cwd, while writes target an absolute configFile under homeDir. Using path.dirname(configFile) makes these tests robust and self-contained.

Suggested patch
-    fs.mkdirSync('.config/fish/conf.d', { recursive: true })
+    fs.mkdirSync(path.dirname(configFile), { recursive: true })

Apply the same replacement at Line 1014, Line 1043, Line 1068, Line 1122, Line 1158, and Line 1172.

Also applies to: 1014-1014, 1043-1043, 1068-1068, 1122-1122, 1158-1158, 1172-1172

🤖 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 `@os/env/path-extender-posix/path-extender-posix.spec.ts` at line 986, The
tests create the fish config directory relative to cwd using
fs.mkdirSync('.config/fish/conf.d', { recursive: true }) but later write to an
absolute configFile under homeDir; update each fish-setup mkdir to use the
directory derived from configFile (i.e., use path.dirname(configFile)) instead
of the hardcoded cwd-relative path so the test directories are created alongside
configFile; locate occurrences of fs.mkdirSync that target '.config/fish/conf.d'
(and other fish setup mkdirs) and replace them to create
path.dirname(configFile) with recursive:true, keeping the same fs.mkdirSync call
and options.
🤖 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 `@os/env/path-extender-posix/path-extender-posix.spec.ts`:
- Line 986: The tests create the fish config directory relative to cwd using
fs.mkdirSync('.config/fish/conf.d', { recursive: true }) but later write to an
absolute configFile under homeDir; update each fish-setup mkdir to use the
directory derived from configFile (i.e., use path.dirname(configFile)) instead
of the hardcoded cwd-relative path so the test directories are created alongside
configFile; locate occurrences of fs.mkdirSync that target '.config/fish/conf.d'
(and other fish setup mkdirs) and replace them to create
path.dirname(configFile) with recursive:true, keeping the same fs.mkdirSync call
and options.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 756ab793-bb82-40d3-b03a-129a1a9da3df

📥 Commits

Reviewing files that changed from the base of the PR and between a9b32aa and 327a612.

📒 Files selected for processing (2)
  • os/env/path-extender-posix/path-extender-posix.spec.ts
  • os/env/path-extender-posix/path-extender-posix.ts
📜 Review details
🔇 Additional comments (2)
os/env/path-extender-posix/path-extender-posix.ts (1)

142-142: LGTM!

os/env/path-extender-posix/path-extender-posix.spec.ts (1)

983-983: LGTM!

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.

Install under ~/.config/fish/conf.d for Fish setup

1 participant