From 4c8d4cb3e386a077f698c718067b8c65bba9e96e Mon Sep 17 00:00:00 2001 From: Jan Keromnes Date: Fri, 17 Jun 2022 14:46:30 +0200 Subject: [PATCH] [config-inferrer] Use 'pnpm' package manager when there is a pnpm-lock.yaml file or the package.json specifies it --- components/server/src/config/config-inferrer.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/server/src/config/config-inferrer.ts b/components/server/src/config/config-inferrer.ts index 17f9ce59c75849..4a4e3274f03659 100644 --- a/components/server/src/config/config-inferrer.ts +++ b/components/server/src/config/config-inferrer.ts @@ -41,10 +41,13 @@ export class ConfigInferrer { if (!pckjsonContent) { return; } - let command: "yarn" | "npm" = "npm"; + let command: "yarn" | "npm" | "pnpm" = "npm"; if (await ctx.exists("yarn.lock")) { command = "yarn"; } + if (await ctx.exists("pnpm-lock.yaml") || pckjsonContent.packageManager.startsWith("pnpm")) { + command = "pnpm"; + } this.addCommand(ctx.config, command + " install", "init"); try { const pckjson = JSON.parse(pckjsonContent);