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

Add the ability to pick a package manager of choice while scaffolding #2768

Closed
jamesgeorge007 opened this issue Jun 7, 2021 · 1 comment · Fixed by #2779
Closed

Add the ability to pick a package manager of choice while scaffolding #2768

jamesgeorge007 opened this issue Jun 7, 2021 · 1 comment · Fixed by #2779
Assignees

Comments

@jamesgeorge007
Copy link
Member

Is your feature request related to a problem? Please describe.
Currently, there isn't any way to specify a package manager of choice while generating the boilerplate (init | loader | plugin).

const packager = this.utils.getPackageManager();

const hasLocalNpm = fs.existsSync(path.resolve(process.cwd(), "package-lock.json"));
if (hasLocalNpm) {
return "npm";
}
const hasLocalYarn = fs.existsSync(path.resolve(process.cwd(), "yarn.lock"));
if (hasLocalYarn) {
return "yarn";
}
const hasLocalPnpm = fs.existsSync(path.resolve(process.cwd(), "pnpm-lock.yaml"));
if (hasLocalPnpm) {
return "pnpm";
}

With the current approach, npm is always chosen if creating a new project in an empty directory.

Describe the solution you'd like
It'd be nice to have a prompt that shows up with the available installers so that one can go ahead with the preferred package manager.

Describe alternatives you've considered
N/A

Additional context
N/A

@alexander-akait
Copy link
Member

Yep, PR welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants