---
# System prepended metadata

title: Mass Updating Dependencies in JS SDK Repos
tags: [elder blade]

---

###### tags: `elder blade`

# Mass Updating Dependencies in JS SDK Repos

* Get on a cpair
* clone down the [sdk scripts module](https://github.braintreeps.com/team-sdk/scripts): `git clone git@github.braintreeps.com:team-sdk/scripts.git ~/bt/sdk-scripts`
* set an alias for the `sdk` command `alias sdk='~/bt/sdk-scripts/sdk'`
* Make sure you've installed the version of node used in the open source repos (right now, Node 16 `nvm install 16`)
* run `npx npm-check` in order to download a local copy of the npm-check module we will use later
* Make sure you've cloned down something from public github previously on this cpair so that the clone commands in the next script do not ask you to verify that you trust public github as a source
* clone down all the relevant deps using the sdk scripts command that's installed on cpairs `sdk setup js all-deps` - this will open a new tmux window with lots of different panes and in each pane, it'll clone down one of our open source projects and run `npm install` on each of them
* run a tmux commands to run the same command in all the panes at once: `ctrl + a + :` followed by `setw synchronize-panes on`
* run the command to update the dependencies. You can do this in a few ways:
    * run the following command `npx npm-check` - this will list out all the dependencies that need to be updated
    * run the following command `npx npm-check -u` - this will give you an interactive list of all the deps that can be updated. You can use `ctrl + a + z` to maximize a particular pane and choose which dependencies to update. (run the same command to minimize it again)
    * if you're confident in the package updates, you can run `npx npm-check -y` to install all updates (including major version updates)
* run `npm test` to verify the updates did not break anything
* fix anything that did break (may help to look at the changelog for any major version updates)
* For packages that have integration tests (framebus and restricted-input), you'll likely need to open a PR to verify any changes
* Once everything is passing, you can mass `git commit -am "chore: update dependcies"` and then `git push`. Check in on any emails about github actions failing and fix those.
* To stop syncronizing, either close every window in the tmux pane (`ctrl + d`) or run `ctrl + a + :` followed by `setw synchronize-panes` (it'll turn it off if it's currently on)