Skip to content

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

@jamesgeorge007

Description

@jamesgeorge007

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

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions