npm-to-yarn icon indicating copy to clipboard operation
npm-to-yarn copied to clipboard

doen't convert `yarn` command to `pnpm`, `pnpm` to `npm`/`yarn`

Open dimaMachina opened this issue 2 years ago • 3 comments

> require('npm-to-yarn')('yarn add foo', 'npm');
'npm install foo'
> require('npm-to-yarn')('yarn add foo', 'pnpm');
'yarn add foo'

pnpm

> require('npm-to-yarn')('pnpm add foo', 'npm');
'pnpm add foo'
> require('npm-to-yarn')('pnpm add foo', 'yarn');
"pnpm add foo\n# couldn't auto-convert command"

dimaMachina avatar Jun 05 '23 22:06 dimaMachina

This isn't supported by the library right now, but PRs are welcome!

nebrelbug avatar Jun 07 '23 03:06 nebrelbug

I think the source code should be simplified, and yarnToNpm.ts should be removed (because we already have npmToYarn)

all commands should be translated no matter you pass yarn add or pnpm add

dimaMachina avatar Jun 07 '23 13:06 dimaMachina

Here's a list of commands conversion which does not work:

yarn - pnpm yarn - bun

pnpm - npm pnpm - yarn pnpm - bun

bun - npm bun - yarn bun - pnpm

Will send a pull fixing this

Jay-Karia avatar Aug 18 '24 11:08 Jay-Karia