Skip to content

Conversation

KSXGitHub
Copy link
Contributor

@KSXGitHub KSXGitHub commented Aug 14, 2025

TODO:

  • Remove auth information from pnpm config list.
  • Stop reading workspace specific settings (such as packages) from rc files.
  • Exclude workspace specific settings from rawConfig.
  • Make pnpm config get <array> output JSON.
  • Undo 529f9bd, merge the workspace specific settings into rawConfig as camelCase instead.
    • Consider reverting 3b10ab5 or correcting the changeset.
    • Implement: Changing case during initial load.
    • Implement: Changing case for pnpm config get.
    • Implement: Changing case for pnpm config set.
    • Implement: Make pnpm config set refuse kebab-case workspace-specific settings.
    • Implement: Changing case for pnpm config list.
    • Implement: Exclude unknown rc fields from pnpm config get.
    • Implement: Exclude unknown rc fields from pnpm config set.
    • Implement: Do not read non-camelCase fields from pnpm-workspace.yaml.
    • Create isCamelCase.test.ts.
    • Remove isStrictlyKebabCase.
    • Rename checkCases.ts to isCamelCase.ts.
    • Fix existing tests.
    • Test: Generic.
    • Test: Convert case.
    • Test: Ignore non-rc kebab-case keys.
    • Test: Ignore camelCase keys from rc files.
    • Changeset.
  • Stop printing things in INI format.
  • Stop loading non auth and non registry settings from rc files.
  • All non auth settings should be printed as camelCase.
  • Changeset.
Excluded because they are not breaking changes:
  • Explicit INI format.
    • --format json|ini.
    • --ini is an alias for --format ini.
    • --json is an alias for --format json.
Cancelled TODO:
  • More consistent casing for pnpm config list
    • pnpm config list --json should print all top-level keys in camelCase.
    • pnpm config list --json should print registries instead of registry and @scope:registry.
    • pnpm config list [--ini] should print workspace-specific keys in camelCase and other in kebab-case.
    • pnpm config list --json should print almost all as camelCase except @scope:registry and //domain:auth.
    • pnpm config list should print rc keys as kebab-case and workspace-specific keys as camelCase.
    • The same for pnpm get [--json] ''.
    • Test.
    • Changeset.
  • Test 529f9bd
    • Fix existing tests.
    • Test: Generic.
    • Test: Overriding.
    • Test: Convert case.

@zkochan zkochan added this to the v11.0 milestone Aug 14, 2025
@KSXGitHub KSXGitHub force-pushed the cli-config-breaking-changes branch from 9a0b040 to c6117b9 Compare August 14, 2025 10:40
@KSXGitHub KSXGitHub force-pushed the cli-config-breaking-changes branch from b96d217 to 3145b8e Compare August 21, 2025 13:29
"pnpm": major
---

`pnpm config list` and `pnpm config get ''` now hide auth-related settings.
Copy link
Contributor Author

@KSXGitHub KSXGitHub Sep 2, 2025

Choose a reason for hiding this comment

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

Similar to how npm config list would show username and _password as (protected)

Copy link
Member

Choose a reason for hiding this comment

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

The mixture of camel and kebab case is somewhat confusing.

I think we should make the global config file a yaml file too. In that case almost nothing should remain in kebab-case.

Copy link
Contributor Author

@KSXGitHub KSXGitHub Sep 3, 2025

Choose a reason for hiding this comment

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

There is still the local .npmrc which is kebab-case. Unless we either remove the INI mode completely (pnpm config get|list would print either JSON or raw text, no INI), or remove non-npm settings (i.e. settings that is only relevant to pnpm) from the rc files, or both, there ought to be inconsistency somewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should make the global config file a yaml file too.

How relevant is npm to pnpm configuration? Does pnpm need npm to do auth?

Copy link
Member

@zkochan zkochan Sep 3, 2025

Choose a reason for hiding this comment

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

We can kind of remove INI mode. We can read only the auth related things from the ini file and ignore anything else.

Alternatively, we could move everything to our own config file but then we need to pass npm CLI the settings somehow. Through npm_config_ env variables for instance. Also, we'd have to implement npm login ourself.

The reason we need the auth settings in ini is because we use npm CLI directly for some commands. Like publish, dist-tag, unpublish, login.

I think it is better to use the npm commands for these.

import { types } from './types.js'

export const isRcSetting = (kebabKey: string, extraTypes: Record<string, unknown> = {}): boolean =>
kebabKey.startsWith('@') || kebabKey.startsWith('//') || kebabKey in npmTypes || kebabKey in types || kebabKey in extraTypes
Copy link
Member

Choose a reason for hiding this comment

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

I'd limit this to just these:

Suggested change
kebabKey.startsWith('@') || kebabKey.startsWith('//') || kebabKey in npmTypes || kebabKey in types || kebabKey in extraTypes
kebabKey.startsWith('@') || kebabKey.startsWith('//')
  • any other auth related settings.

@KSXGitHub KSXGitHub requested a review from zkochan September 3, 2025 00:35
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.

2 participants