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

feat: add pnpm support for installing CLI #11945

Merged
merged 3 commits into from Nov 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 10 additions & 3 deletions bin/webpack.js
Expand Up @@ -82,10 +82,17 @@ if (!cli.installed) {

console.error(notify);

const isYarn = fs.existsSync(path.resolve(process.cwd(), "yarn.lock"));
let packageManager;

if (fs.existsSync(path.resolve(process.cwd(), "yarn.lock"))) {
packageManager = "yarn";
} else if (fs.existsSync(path.resolve(process.cwd(), "pnpm-lock.yaml"))) {
packageManager = "pnpm";
} else {
packageManager = "npm";
}

const packageManager = isYarn ? "yarn" : "npm";
const installOptions = [isYarn ? "add" : "install", "-D"];
const installOptions = [packageManager === "yarn" ? "add" : "install", "-D"];

console.error(
`We will use "${packageManager}" to install the CLI via "${packageManager} ${installOptions.join(
Expand Down
3 changes: 2 additions & 1 deletion cspell.json
Expand Up @@ -221,7 +221,8 @@
"opencollective",
"dependabot",
"browserslist",
"samsunginternet"
"samsunginternet",
"pnpm"
],
"ignoreRegExpList": ["/Author.+/", "/data:.*/", "/\"mappings\":\".+\"/"],
"ignorePaths": ["**/dist/**", "examples/**/README.md"]
Expand Down