Skip to content

feat: add support for pnpm config get globalconfig#10090

Merged
zkochan merged 11 commits intopnpm:mainfrom
ryo-manba:feat/config-get-globalconfig
Nov 8, 2025
Merged

feat: add support for pnpm config get globalconfig#10090
zkochan merged 11 commits intopnpm:mainfrom
ryo-manba:feat/config-get-globalconfig

Conversation

@ryo-manba
Copy link
Copy Markdown
Member

Fixes #9977

Added support for pnpm config get globalconfig to retrieve the global config file path, matching npm's behavior.

@ryo-manba ryo-manba marked this pull request as ready for review October 14, 2025 16:18
@ryo-manba ryo-manba requested a review from zkochan as a code owner October 14, 2025 16:18
Copy link
Copy Markdown
Member

@btea btea left a comment

Choose a reason for hiding this comment

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

I think this feature is quite convenient.

Copy link
Copy Markdown
Member

@zkochan zkochan left a comment

Choose a reason for hiding this comment

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

You are hardcoding the location instead of using the location from '@pnpm/config'. It should be just a regular setting that is present in the config object.

@ryo-manba ryo-manba requested a review from zkochan October 21, 2025 17:56
@ryo-manba ryo-manba marked this pull request as draft October 21, 2025 18:13
@ryo-manba ryo-manba marked this pull request as ready for review October 22, 2025 14:41
@ryo-manba
Copy link
Copy Markdown
Member Author

@zkochan
Thanks, I fixed it.

'bitbucket.com',
'bitbucket.org',
],
globalconfig: npmDefaults.globalconfig,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the global npm config is still useful for storing auth tokens. Maybe keep it as npm-globalconfig.

Comment on lines +12 to +14
if (key === 'globalconfig') {
return { output: opts.globalconfig, exitCode: 0 }
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

won't it work without this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good suggestion, I've fixed it.
refactor: move globalconfig to rawConfig

rootProjectManifest?: ProjectManifest
userConfig: Record<string, string>

globalconfig: string
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's not currently used anywhere. Only needed for config get command.
Can be added back if needed, but what do you think?

@ryo-manba ryo-manba requested a review from zkochan October 27, 2025 14:46
@ryo-manba ryo-manba marked this pull request as draft November 8, 2025 02:43
@ryo-manba ryo-manba marked this pull request as ready for review November 8, 2025 06:09
@zkochan zkochan merged commit d5d4eed into pnpm:main Nov 8, 2025
10 of 11 checks passed
zkochan pushed a commit that referenced this pull request Nov 8, 2025
@ryo-manba ryo-manba deleted the feat/config-get-globalconfig branch November 9, 2025 05:02
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.

pnpm config path --global: print global config path

3 participants