Skip to content

Commit ed10968

Browse files
sean-zlaitechniqken-zlai
authored
Replace npm with pnpm (#136)
## Summary [`pnpm`](https://pnpm.io/) vs `npm` - Pros - Integrated (interactive) version manager - `pnpm up-deps` / (aliased `pnpm update -r -i --latest`) - `npm outdated` / `npm update --save-dev --save` only adhere to `package.json` semver - Must manually modify versions for major versions (ex. Vite 5 => 6) - Can use [`npx npm-check-updates`](https://github.com/raineorshine/npm-check-updates) package to provide similar functionality - Efficient Disk space - Workspace support - npm added [support](https://docs.npmjs.com/cli/v8/using-npm/workspaces) but not aware of any major projects using it - Typically [faster installs](https://pnpm.io/benchmarks) than npm - Slightly better developer ergonomics (`pnpm dev` vs `npm run dev`) - [Used](https://pnpm.io/users) by many large projects/companies (Vite, Svelte, etc) - Cons - Additional install (`npm` included with Node.js) - Synk [support](https://docs.snyk.io/supported-languages-package-managers-and-frameworks/javascript/javascript-for-open-source?_gl=1*1gi9low*_gcl_au*MTA2ODIxOTcxNy4xNzM0Mzg4MTY2*_ga*MTEzMzg2NzM3NS4xNzM0MDIzMDg5*_ga_X9SH3KP7B4*MTczNDU0MzI4Mi40LjAuMTczNDU0MzI4Mi4wLjAuMA..#pnpm) is currently in [preview](https://app.snyk.io/org/varant-zlai/manage/beta-features) - package version overrides not currently applying with Synk (configuration, preview status of integration, ...). Likely because snyk is configured to scan `package-lock.json` (npm) and not `pnpm-lock.yaml` (pnpm). ([here](https://app.snyk.io/org/varant-zlai/project/f4bdc116-d05b-4937-96b5-b1f9a02872e5)) --- ![image](https://github.com/user-attachments/assets/3fff95c6-f100-4083-9463-042b27763d1f) ![image](https://github.com/user-attachments/assets/decb6b45-60d0-40b5-a37a-803dd6deb302) ## Checklist - [ ] Added Unit Tests - [x] Covered by existing CI - [ ] Integration tested - [ ] Documentation update <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Updated README files to reflect the use of `pnpm` as the recommended package manager, including installation instructions and best practices. - **New Features** - Transitioned scripts in the project to utilize `pnpm` for various tasks including development, building, and testing. - **Configuration** - Modified Playwright configuration and other build configurations to use `pnpm` for starting the web server and managing dependencies. - **Dependency Updates** - Updated Spark dependency version from `3.5.0` to `3.5.1` and Jackson version from `2.15.1` to `2.15.2`. <!-- end of auto-generated comment: release notes by coderabbit.ai --> <!-- av pr metadata This information is embedded by the av CLI when creating PRs to track the status of stacks when using Aviator. Please do not delete or edit this section of the PR. ``` {"parent":"main","parentHead":"","trunk":"main"} ``` --> --------- Co-authored-by: Sean Lynch <[email protected]> Co-authored-by: ken-zlai <[email protected]>
1 parent 8d4340d commit ed10968

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

build.sbt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,14 @@ lazy val frontend = (project in file("frontend"))
240240
buildFrontend := {
241241
println("Installing frontend dependencies...")
242242
import scala.sys.process._
243-
val npmCiResult = Process("npm ci", file("frontend")).!
243+
val pnpmCiResult = Process("pnpm install --frozen-lockfile", file("frontend")).!
244244

245-
if (npmCiResult != 0) {
246-
sys.error("npm ci failed!")
245+
if (pnpmCiResult != 0) {
246+
sys.error("pnpm install failed!")
247247
}
248248

249249
println("Building frontend...")
250-
val buildResult = Process("npm run build", file("frontend")).!
250+
val buildResult = Process("pnpm run build", file("frontend")).!
251251

252252
if (buildResult == 0) {
253253
println("Copying frontend assets to /hub/public...")

0 commit comments

Comments
 (0)