From bfb30b03a7002376f3dc4ea7968b68b74c844871 Mon Sep 17 00:00:00 2001 From: Samuel Moelius Date: Tue, 15 Aug 2023 05:04:35 -0400 Subject: [PATCH] Use `pnpm` if a pnpm-lock.yaml file exists --- frameworks/src/ts/utils.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frameworks/src/ts/utils.rs b/frameworks/src/ts/utils.rs index acdc8f81..d8b078ef 100644 --- a/frameworks/src/ts/utils.rs +++ b/frameworks/src/ts/utils.rs @@ -8,8 +8,13 @@ pub fn install_node_modules(context: &LightContext) -> Result<()> { return Ok(()); } - // smoelius: If a `yarn.lock` file exists, use `yarn`. Otherwise, default to `npm install`. - let mut command = if context.root.join("yarn.lock").try_exists()? { + // smoelius: If a `pnpm-lock.yaml` file exists, use `pnpm install`. If a `yarn.lock` file + // exists, use `yarn`. If neither exist, default to `npm install`. + let mut command = if context.root.join("pnpm-lock.yaml").try_exists()? { + let mut command = Command::new("pnpm"); + command.arg("install"); + command + } else if context.root.join("yarn.lock").try_exists()? { Command::new("yarn") } else { let mut command = Command::new("npm");