Skip to content

Commit

Permalink
Merge pull request #94 from bizob2828/third-party-notices-automation
Browse files Browse the repository at this point in the history
added husky + lint staged and hook to update third party manifest/notices
  • Loading branch information
michaelgoin authored Aug 25, 2021
2 parents 4c348d0 + a36d9e3 commit d432e55
Show file tree
Hide file tree
Showing 8 changed files with 11,594 additions and 4,519 deletions.
5 changes: 5 additions & 0 deletions lib/instrumentation/koa/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/../bin/update-third-party-notices.sh"

npx lint-staged
5 changes: 5 additions & 0 deletions lib/instrumentation/koa/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"**/*.js": [
"eslint --fix"
]
}
700 changes: 655 additions & 45 deletions lib/instrumentation/koa/THIRD_PARTY_NOTICES.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions lib/instrumentation/koa/THIRD_PARTY_NOTICES_FOOTER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-----

Portions copyright Node.js contributors. Depending on your existing libraries and package management settings,
your systems may call externally maintained libraries in addition to those listed above.
See [here](https://nodejs.org/en/docs/meta/topics/dependencies/) and [here](https://github.com/nodejs/node/blob/v4.3.1/LICENSE)
for additional details regarding externally maintained libraries and certain related licenses and notices.
22 changes: 22 additions & 0 deletions lib/instrumentation/koa/bin/update-third-party-notices.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh
#
# Checks all staged files for
# package.json. If it changes
# it will re-run `oss third-party manifest`
# and `oss third-party notices` to keep
# these files up to date as deps get updated

STAGED_FILES=$(git diff-index --cached --name-only HEAD)

for FILE in $STAGED_FILES
do
if [ $FILE == "package.json" ]; then
RUN_THIRD_PARTY=1
break
fi
done

if [ -n "$RUN_THIRD_PARTY" ]; then
echo "package.json changed, running oss manifest and notices"
npm run third-party-updates
fi
Loading

0 comments on commit d432e55

Please sign in to comment.