Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: npm2yarn2pnpm conversion to pnpm has some small errors with flags #80

Closed
1 task done
ndom91 opened this issue Jul 10, 2022 · 1 comment
Closed
1 task done

Comments

@ndom91
Copy link

ndom91 commented Jul 10, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

Two related issues regarding the conversion of the npm command to pnpm:

  1. Missing spaces
  2. Mis-translated flags

1. Missing space

When converting commands such as npm install prisma, everything works fine.

However, when passing flags, like npm install --save-dev prisma, the pnpm conversion is missing a space.

i.e. this:

image

Turns into:

image
image

Examples:

  1. Cypress Tutorial Page
  1. Prisma Adapter Page

2. Mis-translated flag

` ``bash
npm install --save-dev prisma
` ``

Will render, in the pnpm tab, to:

pnpm add prisma--save-prod-dev

When it should be pnpm add --save-dev prisma

Steps To Reproduce

Create a bash code block with an npm install command using a double dashed flag, i.e. --save-dev.

For example:

` ``bash npm2yarn2pnpm
npm install --save-dev prisma
` ``

Will render, in the pnpm tab, to:

pnpm add prisma--save-prod-dev

Notice the flag being mistranslated from --save-dev to --save-prod-dev, as well as the missing space between prisma and --save....

Expected behavior

npm install --save-dev prisma should be translated to pnpm add --save-dev prisma

Screenshots

See above.

Additional context

No response

favna added a commit to favna/npm-to-yarn that referenced this issue Jul 11, 2022
Fixes armano2#7 

Funny how these things go. I reported the issue then I started fixing a similar issue for npm to pnpm for sapphiredev/documentation-plugins#80 and turns out this fix also works for npm to yarn

Example regexr: regexr.com/6phbp
@favna favna closed this as completed in 35aa88c Jul 11, 2022
@favna
Copy link
Member

favna commented Jul 11, 2022

Released in v1.1.2

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

No branches or pull requests

2 participants