Skip to content

Add full support for saving peer dependencies #248

Open
@yamcodes

Description

@yamcodes

Clear and concise description of the problem

As a developer using this project, I want to install peer dependencies easily so that I can manage them using this tool.

I intend to submit a PR for this issue.

Suggested solution

  1. In ni.ts, support --peer from Yarn 1 (Classic), Yarn 2+ and bun.
  2. In ni.ts, omit the comment indicating that installing peer dependencies using Yarn and Bun programmatically is impossible.
  3. In command parsing logic, add support for --save-peer (pnpm, npm) and --peer (Yarn, Bun).
  4. Add a new subcommand for saving peers: ni -P (in line with ni -D).
  5. Add docs for step (4) into the README.md.

Alternative

  1. In step 4 of the solution, use ni -p instead, in line with ni -g.

Additional context

Workarounds

  1. (Only supports pnpm and npm) call the interactive mode ni, choose the package and choose peer mode.
  2. (Works differently for pnpm/npm and yarn/bun) call ni --save-peer for pnpm/pnpm, ni --peer for Yarn/bun.

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions