Skip to content

Commit

Permalink
feat(script): license report
Browse files Browse the repository at this point in the history
  • Loading branch information
janek26 committed Feb 6, 2023
1 parent b0b34b7 commit 9aa9767
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ pnpm-lock.yaml
.env
sourcemaps
coverage
*.tsbuildinfo
*.tsbuildinfo
license-report.md
13 changes: 13 additions & 0 deletions license-report-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"output": "markdown",
"fields": [
"name",
"licenseType",
"link",
"author",
"installedVersion",
"definedVersion",
"remoteVersion",
"latestRemoteVersion"
]
}
36 changes: 36 additions & 0 deletions scripts/license-report.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# declare blacklist
BLACKLIST=(
"storybook"
)

# install license-report if not already installed
if ! command -v license-report &> /dev/null
then
echo "license-report could not be found, installing..."
npm install -g license-report
fi

# create license-report.md
echo "Generating license report..."
echo "# License Report" > license-report.md
echo "" >> license-report.md
echo "This report was generated on $(date)" >> license-report.md
echo "" >> license-report.md

# loop over all packages
for package in $(ls packages); do
# check if package is in a blacklist
if [[ " ${BLACKLIST[@]} " =~ " ${package} " ]]; then
echo "Skipping $package..."
continue
fi
echo "Generating license report for $package..."
echo "## @argent/$package" >> license-report.md
echo "" >> license-report.md
license-report --package=./packages/$package/package.json --only=prod --config=license-report-config.json >> license-report.md
echo "" >> license-report.md
done

# format license-report.md
echo "Formatting license report..."
yarn prettier --write license-report.md

0 comments on commit 9aa9767

Please sign in to comment.