From cd5bc1128d151706f523dc8d6f16843bdd7264f2 Mon Sep 17 00:00:00 2001 From: Simon Mavi Stewart Date: Fri, 21 Jun 2024 16:51:14 +0100 Subject: [PATCH] Add some notes on updating JS and java deps using Bazel --- CONTRIBUTING.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aa82517e05b5e..80b6ecaf11662 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -89,6 +89,40 @@ to check that your approach aligns with the project's ideas. Nothing is more frustrating than seeing your hard work go to waste because your vision doesn't align with the project's. +#### Dependencies Managed by Bazel + +##### Java + +Edit `MODULE.bazel`, and either update or add the dependency you want +using the regular maven coordinates to the `maven.install` with the +name `maven`. Once done, run `REPIN=1 bazel run @maven//:pin` to +update the lock file, create a PR and check the change in. + +##### JS + +We use `pnpm` for JS development in the project, and we also use [pnpm +workspaces](https://pnpm.io/workspaces). Take a look at the top-level +`pnpm-workspace.yaml` file to find them all, but the main thing to +know is that each of the workspaces has its own `package.json`. You +can add dependencies to specific workspaces either by using `pnpm` +installed on your local machine, or by executing: + +```shell +# Example of adding a dep to the JS webdriver bindings +cd javascript/node/selenium-webdriver +bazel run javascript:pnpm -- install my-amazing-dep --dir $PWD +``` + +This will install the dependency using the same version of `pnpm` we +build the project with for a single JS project. + +To update all dependencies in the tree to the latest version: + +`bazel run javascript:pnpm -- -r up --dir $PWD` + +This will also update the lock file, so once a change is made, create +a PR and commit all the changed files. + #### License Headers Every file in the Selenium project must carry the following license