Skip to content

add pnpm catalog support #274

@Groupguanfang

Description

@Groupguanfang

Clear and concise description of the problem

When we use pnpm workspace + catalog, when we run this command:

ni add lodash

It is allowed to pass a new parameter --catalog [catalog] ], and then read pnpm-workspace.yaml and edit its catalog' or ` catalogs' fields to automatically synchronize the dependencies.

Example 1

When run this command:

ni add lodash --catalog prod

It will change the pnpm-workspace.yaml and package.json when the deps is installed:

# pnpm-workspace.yaml
catalogs:
  prod:
    lodash: # The version number
{
  "dependencies": {
    "lodash": "catalog:prod"
  }
}

Example 2

If run this command:

ni add lodash --catalog

It will add to the default catalog:

catalog:
  lodash: # The version number

Suggested solution

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions