Skip to content

Commit

Permalink
Add some notes on updating JS and java deps using Bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Jun 21, 2024
1 parent a7e392a commit cd5bc11
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cd5bc11

Please sign in to comment.