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

Component test pnpm scaffolding uses pnpm install not add #29052

Closed
MikeMcC399 opened this issue Mar 4, 2024 · 4 comments · Fixed by #29056
Closed

Component test pnpm scaffolding uses pnpm install not add #29052

MikeMcC399 opened this issue Mar 4, 2024 · 4 comments · Fixed by #29056
Labels
pkg/launchpad This is due to an issue in the packages/launchpad directory type: user experience Improvements needed for UX

Comments

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Mar 4, 2024

Current behavior

When scaffolding Cypress Component Testing in the presence of a pnpm-lock.yaml file from the pnpm package manager Cypress outputs a command string to instruct the user to install dependencies which starts with pnpm install. For instance, if "Vue CLI (Vue 3)" is selected as a front-end framework, the suggested installation command is:

pnpm install -D @vue/cli-service vue

Desired behavior

Cypress Component Testing scaffolding for pnpm environments should prepend the following command to the framework modules to be installed:

pnpm add -D

instead of pnpm install -D.

Although pnpm install appears to install the dependencies listed, it is not the documented way to do this ("pnpm install is used to install all dependencies for a project."). The description for pnpm add <pkg> says "Installs a package and any packages that it depends on. By default, any new package is installed as a production dependency.".

Cypress should not rely on an undocumented method to add packages using pnpm. pnpm install is undocumented for this purpose, whereas pnpm add is documented as the method to add packages.

Test code to reproduce

In a terminal window, execute:

npm install pnpm@latest -g
mkdir cy-pnpm-ct
cd cy-pnpm-ct
git init
pnpm init
pnpm add cypress -D
pnpm cypress open

Select "Component Testing"
Select "Front-end framework" > "Vue CLI (Vue 3)"
Click "Next step"
Note the instruction

pnpm install -D @vue/cli-service vue

Paste the instruction into a separate terminal window and execute it.

Note that it runs successfully.

Cypress Version

13.6.6

Node version

v20.11.1

Package manager and version

pnpm 8.15.4

Operating System

Ubuntu 22.04.4 LTS

Debug Logs

$ pnpm install -D @vue/cli-service vue
 WARN  3 deprecated subdependencies found: consolidate@0.15.1, stable@0.1.8, webpack-chain@6.5.1
Packages: +547
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 724, reused 641, downloaded 82, added 547, done

devDependencies:
+ @vue/cli-service 5.0.8
+ vue 3.4.21

Done in 15.1s

Other

References

@MikeMcC399
Copy link
Contributor Author

If requested, I can submit a PR to implement the suggestion to change from

pnpm install -D

to

pnpm add -D

for CT scaffolding.

@jennifer-shehane
Copy link
Member

@MikeMcC399 Yah, this would be a good change if you want to open a PR. Thanks!

@jennifer-shehane jennifer-shehane added type: user experience Improvements needed for UX stage: ready for work The issue is reproducible and in scope pkg/launchpad This is due to an issue in the packages/launchpad directory labels Mar 4, 2024
@MikeMcC399
Copy link
Contributor Author

@jennifer-shehane

Yah, this would be a good change if you want to open a PR. Thanks!

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 13, 2024

Released in 13.7.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.7.0, please open a new issue.

@cypress-bot cypress-bot bot removed the stage: ready for work The issue is reproducible and in scope label Mar 13, 2024
@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Mar 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pkg/launchpad This is due to an issue in the packages/launchpad directory type: user experience Improvements needed for UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants