diff --git a/.husky/post-checkout b/.husky/post-checkout new file mode 100755 index 0000000000000..a2eaf794b9870 --- /dev/null +++ b/.husky/post-checkout @@ -0,0 +1,3 @@ +#!/bin/sh +changedFiles="$(git diff-tree -r --name-only --no-commit-id $1 $2)" +node ./scripts/notify-lockfile-changes.js $changedFiles \ No newline at end of file diff --git a/.husky/post-merge b/.husky/post-merge new file mode 100755 index 0000000000000..8e7913dbdc744 --- /dev/null +++ b/.husky/post-merge @@ -0,0 +1,3 @@ +#!/bin/sh +changedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" +node ./scripts/notify-lockfile-changes.js $changedFiles \ No newline at end of file diff --git a/scripts/notify-lockfile-changes.js b/scripts/notify-lockfile-changes.js new file mode 100644 index 0000000000000..1cb60472924fa --- /dev/null +++ b/scripts/notify-lockfile-changes.js @@ -0,0 +1,9 @@ +if (process.argv.slice(2).some((arg) => arg.includes('pnpm-lock.yaml'))) { + console.warn( + [ + '⚠️ ----------------------------------------------------------------------------------------- ⚠️', + '⚠️ pnpm-lock.yaml changed, please run `pnpm install` to ensure your packages are up to date. ⚠️', + '⚠️ ----------------------------------------------------------------------------------------- ⚠️', + ].join('\n') + ); +}