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

fix(create-app): distinguish pnpm pkgManager #4193

Closed
wants to merge 0 commits into from
Closed

Conversation

1wkk
Copy link
Contributor

@1wkk 1wkk commented Jul 9, 2021

Description

When I use pnpm init @vitejs/app to create a vite app, finally it has two tip called npm install npm run dev, so I think create-app can't distinguish pnpm pkgManager, more and more people are using pnpm, so I think it's better to do this, and now it can distinguish pnpm.

Additional context

none


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

? 'yarn'
: /npm/.test(process.env.npm_execpath)
? 'npm'
: 'pnpm'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should make the fallout to npm instead of pnpm, for detecting what pm is used, here is a reference
https://github.com/zkochan/packages/blob/master/which-pm-runs/index.js

Copy link
Member

@antfu antfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

@Shinigami92 Shinigami92 added the p3-minor-bug An edge case that only affects very specific usage (priority) label Jul 9, 2021
@1wkk
Copy link
Contributor Author

1wkk commented Jul 9, 2021

Sorry, I can only barely understand what you mean because my English is not that good, but I think the modification I made may be what you mean, and thank you for your guidance.

@Shinigami92 Shinigami92 requested a review from antfu July 9, 2021 15:36
packages/create-app/index.js Outdated Show resolved Hide resolved
antfu
antfu previously approved these changes Jul 10, 2021
Shinigami92
Shinigami92 previously approved these changes Jul 10, 2021
@1wkk 1wkk requested a review from antfu July 12, 2021 06:36
@antfu
Copy link
Member

antfu commented Jul 12, 2021

@Cabbage9 Can you resolve the conflict? (the pkg is renamed to create-vite in #4179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants