A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pnpm/pnpm/issues/8640 below:

`pnpm add` should use the default catalog · Issue #8640 · pnpm/pnpm · GitHub

Contribution Describe the user story

When running pnpm add, pnpm currently adds the latest version with of that dependency with ^. For example, running pnpm add is-positive edits package.json with the following contents:

{
  "name": "@example/lib",
  "dependencies": {
    "is-positive": "^3.1.0"
  }
}
Describe the solution you'd like

When a user has set up a default catalog entry for a dependency, it's likely that new usages of this dependency in a workspace package are intended to use the catalog protocol. Instead of adding a new version, use the catalog protocol:

{
  "name": "@example/lib",
  "dependencies": {
    "is-positive": "catalog:"
  }
}

Related: I realized we don't do this for workspace packages at the moment. It likely makes sense to add workspace:* out of the box too. (#6770)

Describe the drawbacks of your solution

Some users may prefer not using the catalog protocol out of the box, but I expect this to be exceedingly rare and somewhat defeats the purpose of catalogs.

There's a few more ambiguous cases with named catalogs though:

We can probably start by simply using the default catalog on pnpm add and ignoring named catalogs, but perhaps a future version prompts users if there's multiple named catalogs.

nickfujita, kenrick95, xollaborator, nonoll, zkochan and 2 more


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4