Skip to content

Commit 729a549

Browse files
authored
chore(repo): setup hook to notify on package lock changes (nrwl#16972)
1 parent 024193f commit 729a549

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.husky/post-checkout

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
changedFiles="$(git diff-tree -r --name-only --no-commit-id $1 $2)"
3+
node ./scripts/notify-lockfile-changes.js $changedFiles

.husky/post-merge

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
changedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
3+
node ./scripts/notify-lockfile-changes.js $changedFiles

scripts/notify-lockfile-changes.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
if (process.argv.slice(2).some((arg) => arg.includes('pnpm-lock.yaml'))) {
2+
console.warn(
3+
[
4+
'⚠️ ----------------------------------------------------------------------------------------- ⚠️',
5+
'⚠️ pnpm-lock.yaml changed, please run `pnpm install` to ensure your packages are up to date. ⚠️',
6+
'⚠️ ----------------------------------------------------------------------------------------- ⚠️',
7+
].join('\n')
8+
);
9+
}

0 commit comments

Comments
 (0)